fix: 反馈、报修附件显示修改

main
wx-jincw 2 months ago
parent 1bb8060f3c
commit 09390a9249

@ -175,14 +175,35 @@
</text> </text>
</view> </view>
<view <view
class="image-grid" class="image-section"
v-if="item.files && item.files.length" v-if="item.beforeProcessFiles && item.beforeProcessFiles.length"
> >
<text class="image-title">反馈图片</text>
<view class="image-grid">
<view <view
class="image-item" class="image-item"
v-for="(file, imgIndex) in item.files" v-for="(file, imgIndex) in item.beforeProcessFiles"
:key="imgIndex" :key="'before-' + imgIndex"
@click="previewRecordImages(item.files, imgIndex)" @click="previewRecordImages(item.beforeProcessFiles, imgIndex)"
>
<image
:src="HTTP_ADMIN_URL + '/' + (file.url || file.attDir)"
mode="aspectFill"
></image>
</view>
</view>
</view>
<view
class="image-section"
v-if="item.afterProcessFiles && item.afterProcessFiles.length"
>
<text class="image-title">处理图片</text>
<view class="image-grid">
<view
class="image-item"
v-for="(file, imgIndex) in item.afterProcessFiles"
:key="'after-' + imgIndex"
@click="previewRecordImages(item.afterProcessFiles, imgIndex)"
> >
<image <image
:src="HTTP_ADMIN_URL + '/' + (file.url || file.attDir)" :src="HTTP_ADMIN_URL + '/' + (file.url || file.attDir)"
@ -192,6 +213,7 @@
</view> </view>
</view> </view>
</view> </view>
</view>
<view class="empty" v-if="!loading && records.length === 0"> <view class="empty" v-if="!loading && records.length === 0">
<text class="iconfont icon-wushuju"></text> <text class="iconfont icon-wushuju"></text>
@ -365,7 +387,7 @@ export default {
csContent: this.form.csContent.trim(), csContent: this.form.csContent.trim(),
remark: this.form.remark.trim(), remark: this.form.remark.trim(),
phone: this.form.phone.trim(), phone: this.form.phone.trim(),
files: imageFiles beforeProcessFiles: imageFiles
}; };
try { try {
@ -783,8 +805,17 @@ export default {
} }
} }
.image-grid { .image-section {
margin-top: 12rpx; margin-top: 12rpx;
.image-title {
display: block;
font-size: 22rpx;
color: #666;
margin-bottom: 10rpx;
}
.image-grid {
margin-left: 0; margin-left: 0;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@ -806,6 +837,7 @@ export default {
} }
} }
} }
}
.empty { .empty {
margin-top: 80rpx; margin-top: 80rpx;

@ -10,17 +10,21 @@
</view> </view>
</view> </view>
<view class="tab-row"> <view class="filter-row">
<view class="tab" :class="typeTab === 'all' ? 'active' : ''" @click="switchType('all')"></view> <text class="filter-label">通知类型</text>
<view class="tab" :class="typeTab === '1' ? 'active' : ''" @click="switchType('1')"></view> <picker
<view class="tab" :class="typeTab === '2' ? 'active' : ''" @click="switchType('2')"></view> mode="selector"
:range="noticeTypeOptions"
range-key="label"
:value="selectedNoticeTypeIndex"
@change="onNoticeTypeChange"
>
<view class="filter-picker">
<text class="picker-text">{{ selectedNoticeTypeLabel }}</text>
<text class="picker-arrow"></text>
</view>
</picker>
</view> </view>
<!-- <view class="tab-row" style="margin-top: 20rpx;">
<view class="tab" :class="statusTab === 'all' ? 'active' : ''" @click="switchStatus('all')"></view>
<view class="tab" :class="statusTab === '0' ? 'active' : ''" @click="switchStatus('0')">稿</view>
<view class="tab" :class="statusTab === '1' ? 'active' : ''" @click="switchStatus('1')"></view>
</view> -->
</view> </view>
<!-- 列表 --> <!-- 列表 -->
@ -50,7 +54,7 @@
<view class="card-body"> <view class="card-body">
<view class="row"> <view class="row">
<text class="label">通知类型</text> <text class="label">通知类型</text>
<text class="value">{{ item.noticeType || '—' }}</text> <text class="value">{{ dict.getLabel('sys_notice_type', item.noticeType) || item.noticeType || '—' }}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="label">通知范围</text> <text class="label">通知范围</text>
@ -87,9 +91,8 @@ export default {
return { return {
query: { query: {
noticeTitle: '', noticeTitle: '',
noticeType: '',
}, },
typeTab: 'all', // all | 1 | 2
statusTab: '1', // all | 0 | 1
records: [], records: [],
page: 1, page: 1,
limit: 10, limit: 10,
@ -104,13 +107,29 @@ export default {
onPullDownRefresh() { onPullDownRefresh() {
this.refreshList(); this.refreshList();
}, },
methods: { computed: {
switchType(type) { noticeTypeOptions() {
this.typeTab = type; const dictList = this.dict.get('sys_notice_type') || [];
this.refreshList(); const options = dictList.map(item => ({
label: item.dictLabel,
value: item.dictValue,
}));
return [{ label: '全部', value: '' }].concat(options);
},
selectedNoticeTypeIndex() {
const index = this.noticeTypeOptions.findIndex(item => item.value === this.query.noticeType);
return index >= 0 ? index : 0;
},
selectedNoticeTypeLabel() {
const current = this.noticeTypeOptions[this.selectedNoticeTypeIndex];
return current ? current.label : '全部';
},
}, },
switchStatus(status) { methods: {
this.statusTab = status; onNoticeTypeChange(e) {
const index = Number(e?.detail?.value);
const current = this.noticeTypeOptions[index];
this.query.noticeType = current ? current.value : '';
this.refreshList(); this.refreshList();
}, },
async refreshList() { async refreshList() {
@ -133,8 +152,11 @@ export default {
}; };
const noticeTitle = (this.query.noticeTitle || '').trim(); const noticeTitle = (this.query.noticeTitle || '').trim();
if (noticeTitle) params.noticeTitle = noticeTitle; if (noticeTitle) params.noticeTitle = noticeTitle;
if (this.typeTab !== 'all') params.type = this.typeTab; if (this.query.noticeType) {
if (this.statusTab !== 'all') params.status = this.statusTab; params.noticeType = this.query.noticeType;
// 使 type
params.type = this.query.noticeType;
}
return params; return params;
}, },
async fetchList() { async fetchList() {
@ -225,37 +247,39 @@ export default {
} }
} }
.tab-row { .filter-row {
display: flex; display: flex;
align-items: center;
justify-content: space-between;
background-color: #fff; background-color: #fff;
border-radius: 12rpx; border-radius: 12rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.06); box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.06);
padding: 0 20rpx;
.tab {
flex: 1;
height: 72rpx; height: 72rpx;
display: flex;
align-items: center; .filter-label {
justify-content: center;
font-size: 26rpx; font-size: 26rpx;
color: #666; color: #666;
position: relative; }
&.active { .filter-picker {
color: #409eff; display: flex;
font-weight: 600; align-items: center;
max-width: 420rpx;
&::after { .picker-text {
content: ''; font-size: 26rpx;
position: absolute; color: #409eff;
bottom: 0; max-width: 360rpx;
left: 50%; white-space: nowrap;
transform: translateX(-50%); overflow: hidden;
width: 60rpx; text-overflow: ellipsis;
height: 4rpx;
background-color: #409eff;
border-radius: 2rpx;
} }
.picker-arrow {
margin-left: 10rpx;
font-size: 18rpx;
color: #999;
} }
} }
} }

@ -10,7 +10,7 @@
<view class="info-list"> <view class="info-list">
<view class="row" v-if="notice.noticeType"> <view class="row" v-if="notice.noticeType">
<text class="label">通知类型</text> <text class="label">通知类型</text>
<text class="value">{{ notice.noticeType }}</text> <text class="value">{{ dict.getLabel('sys_notice_type', notice.noticeType) || notice.noticeType }}</text>
</view> </view>
<view class="row" v-if="notice.draftDeptName"> <view class="row" v-if="notice.draftDeptName">
<text class="label">通知单位</text> <text class="label">通知单位</text>

@ -149,14 +149,13 @@
</text> </text>
</view> </view>
<view <view class="image-section" v-if="item.files && item.files.length">
class="image-grid" <text class="image-title">故障图片</text>
v-if="item.files && item.files.length" <view class="image-grid">
>
<view <view
class="image-item" class="image-item"
v-for="(file, imgIndex) in item.files" v-for="(file, imgIndex) in item.files"
:key="imgIndex" :key="'fault-' + imgIndex"
@click="previewRecordImages(item.files, imgIndex)" @click="previewRecordImages(item.files, imgIndex)"
> >
<image <image
@ -166,6 +165,27 @@
</view> </view>
</view> </view>
</view> </view>
<view
class="image-section"
v-if="item.afterProcessFiles && item.afterProcessFiles.length"
>
<text class="image-title">处理结果图片</text>
<view class="image-grid">
<view
class="image-item"
v-for="(file, imgIndex) in item.afterProcessFiles"
:key="'result-' + imgIndex"
@click="previewRecordImages(item.afterProcessFiles, imgIndex)"
>
<image
:src="HTTP_ADMIN_URL + '/' + (file.url || file.attDir)"
mode="aspectFill"
></image>
</view>
</view>
</view>
</view>
</view> </view>
<view class="empty" v-if="!loading && records.length === 0"> <view class="empty" v-if="!loading && records.length === 0">
@ -850,8 +870,17 @@ export default {
} }
} }
.image-grid { .image-section {
margin-top: 12rpx; margin-top: 12rpx;
.image-title {
display: block;
font-size: 22rpx;
color: #666;
margin-bottom: 10rpx;
}
.image-grid {
margin-left: 0; margin-left: 0;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@ -873,6 +902,7 @@ export default {
} }
} }
} }
}
.empty { .empty {
margin-top: 80rpx; margin-top: 80rpx;

Loading…
Cancel
Save