fix:修复体检档案标题显示错误,新增阳性编辑删除按钮
This commit is contained in:
parent
85c56ebf89
commit
9fbee9caf4
@ -9,20 +9,16 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-if="value.length" class="list">
|
<view v-if="value.length" class="list">
|
||||||
<uni-swipe-action>
|
<view v-for="(i, idx) in value" :key="idx" class="item">
|
||||||
<uni-swipe-action-item v-for="(i, idx) in value" :key="idx">
|
<view class="item-main">
|
||||||
<view class="item">
|
<view class="item-title">{{ idx + 1 }}、{{ i.category || '' }}</view>
|
||||||
<view class="item-title">{{ idx + 1 }}、{{ i.category || '' }}</view>
|
<view class="item-sub">{{ i.opinion || '' }}</view>
|
||||||
<view class="item-sub">{{ i.opinion || '' }}</view>
|
</view>
|
||||||
</view>
|
<view class="item-actions">
|
||||||
<template #right>
|
<view class="text-action edit" @click.stop="edit(i, idx)">编辑</view>
|
||||||
<view class="actions">
|
<view class="text-action del" @click.stop="remove(idx)">删除</view>
|
||||||
<view class="action edit" @click.stop="edit(i, idx)">编辑</view>
|
</view>
|
||||||
<view class="action del" @click.stop="remove(idx)">删除</view>
|
</view>
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
</uni-swipe-action-item>
|
|
||||||
</uni-swipe-action>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-else class="empty">暂无内容,点击右侧 + 添加</view>
|
<view v-else class="empty">暂无内容,点击右侧 + 添加</view>
|
||||||
@ -90,12 +86,14 @@ function edit(item, idx) {
|
|||||||
|
|
||||||
function remove(idx) {
|
function remove(idx) {
|
||||||
if (props.disableChange) return;
|
if (props.disableChange) return;
|
||||||
confirm('确定删除吗?', () => {
|
confirm('确定删除吗?')
|
||||||
const list = value.value.map((i) => ({ category: i.category, opinion: i.opinion }));
|
.then(() => {
|
||||||
list.splice(idx, 1);
|
const list = value.value.map((i) => ({ category: i.category, opinion: i.opinion }));
|
||||||
emitChange(list);
|
list.splice(idx, 1);
|
||||||
toast('已删除');
|
emitChange(list);
|
||||||
});
|
toast('已删除');
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -127,37 +125,49 @@ function remove(idx) {
|
|||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
.item {
|
.item {
|
||||||
padding: 20rpx 0;
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 24rpx;
|
||||||
|
padding: 24rpx 0;
|
||||||
|
border-bottom: 2rpx solid #f3f4f6;
|
||||||
|
}
|
||||||
|
.item:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
.item-main {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
.item-title {
|
.item-title {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #111827;
|
color: #111827;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
.item-sub {
|
.item-sub {
|
||||||
margin-top: 12rpx;
|
margin-top: 12rpx;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #6b7280;
|
color: #6b7280;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
.actions {
|
.item-actions {
|
||||||
display: flex;
|
|
||||||
height: 100%;
|
|
||||||
align-items: stretch;
|
|
||||||
}
|
|
||||||
.action {
|
|
||||||
width: 140rpx;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
gap: 20rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding-top: 4rpx;
|
||||||
|
}
|
||||||
|
.text-action {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #fff;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
.action.edit {
|
.text-action.edit {
|
||||||
background: #0877F1;
|
color: #0877F1;
|
||||||
}
|
}
|
||||||
.action.del {
|
.text-action.del {
|
||||||
background: #ff4d4f;
|
color: #ff4d4f;
|
||||||
}
|
}
|
||||||
.empty {
|
.empty {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
|
|||||||
@ -44,7 +44,17 @@ const eventName = ref('');
|
|||||||
|
|
||||||
onLoad((opt) => {
|
onLoad((opt) => {
|
||||||
eventName.value = String(opt?.eventName || '');
|
eventName.value = String(opt?.eventName || '');
|
||||||
if (opt?.title) uni.setNavigationBarTitle({ title: String(opt.title) });
|
if (opt?.title) {
|
||||||
|
let title = String(opt.title);
|
||||||
|
try {
|
||||||
|
title = decodeURIComponent(title);
|
||||||
|
} catch {
|
||||||
|
title = String(opt.title);
|
||||||
|
}
|
||||||
|
uni.setNavigationBarTitle({ title: title || '阳性发现及处理意见' });
|
||||||
|
} else {
|
||||||
|
uni.setNavigationBarTitle({ title: '阳性发现及处理意见' });
|
||||||
|
}
|
||||||
const data = uni.getStorageSync('current-positive-find') || {};
|
const data = uni.getStorageSync('current-positive-find') || {};
|
||||||
category.value = typeof data?.category === 'string' ? data.category : '';
|
category.value = typeof data?.category === 'string' ? data.category : '';
|
||||||
opinion.value = typeof data?.opinion === 'string' ? data.opinion : '';
|
opinion.value = typeof data?.opinion === 'string' ? data.opinion : '';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user