|
|
|
@ -5,11 +5,6 @@
|
|
|
|
<view class="title-section">
|
|
|
|
<view class="title-section">
|
|
|
|
<text class="detail-title">{{ notice.noticeTitle || '未命名通知' }}</text>
|
|
|
|
<text class="detail-title">{{ notice.noticeTitle || '未命名通知' }}</text>
|
|
|
|
|
|
|
|
|
|
|
|
<view class="tag-row">
|
|
|
|
|
|
|
|
<text class="tag kind" :class="typeClassMap[notice.type] || ''">{{ typeText(notice.type) }}</text>
|
|
|
|
|
|
|
|
<text class="tag status" :class="statusClassMap[notice.status] || statusClassMap['__default__']">{{ statusText(notice.status) }}</text>
|
|
|
|
|
|
|
|
<text class="tag sms" :class="smsClassMap[notice.smsStatus] || ''">{{ smsText(notice.smsStatus) }}</text>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<view class="info-list">
|
|
|
|
<view class="info-list">
|
|
|
|
@ -17,29 +12,17 @@
|
|
|
|
<text class="label">通知类型:</text>
|
|
|
|
<text class="label">通知类型:</text>
|
|
|
|
<text class="value">{{ notice.noticeType }}</text>
|
|
|
|
<text class="value">{{ notice.noticeType }}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="row" v-if="notice.noticeSource">
|
|
|
|
<view class="row" v-if="notice.draftDeptName">
|
|
|
|
<text class="label">通知来源:</text>
|
|
|
|
<text class="label">通知单位:</text>
|
|
|
|
<text class="value">{{ notice.noticeSource }}</text>
|
|
|
|
<text class="value">{{ notice.draftDeptName }}</text>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="row" v-if="notice.draftDept">
|
|
|
|
|
|
|
|
<text class="label">拟稿单位:</text>
|
|
|
|
|
|
|
|
<text class="value">{{ notice.draftDept }}</text>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="row" v-if="notice.noticeScope">
|
|
|
|
<view class="row" v-if="notice.noticeScope">
|
|
|
|
<text class="label">通知范围:</text>
|
|
|
|
<text class="label">通知范围:</text>
|
|
|
|
<text class="value">{{ notice.noticeScope }}</text>
|
|
|
|
<text class="value">{{ notice.noticeScope }}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="row" v-if="notice.bizType || notice.bizId">
|
|
|
|
|
|
|
|
<text class="label">业务信息:</text>
|
|
|
|
|
|
|
|
<text class="value">{{ bizText(notice.bizType, notice.bizId) }}</text>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="row" v-if="notice.noticeTime">
|
|
|
|
<view class="row" v-if="notice.noticeTime">
|
|
|
|
<text class="label">通知时间:</text>
|
|
|
|
<text class="label">通知时间:</text>
|
|
|
|
<text class="value">{{ formatDate(notice.noticeTime) }}</text>
|
|
|
|
<text class="value">{{ notice.noticeTime }}</text>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="row" v-if="notice.remark">
|
|
|
|
|
|
|
|
<text class="label">备注:</text>
|
|
|
|
|
|
|
|
<text class="value remark-value">{{ notice.remark }}</text>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
@ -52,6 +35,36 @@
|
|
|
|
></jyf-parser>
|
|
|
|
></jyf-parser>
|
|
|
|
<view class="empty" v-else>暂无通知内容</view>
|
|
|
|
<view class="empty" v-else>暂无通知内容</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="attach-box" v-if="fileList.length">
|
|
|
|
|
|
|
|
<view class="attach-title">附件列表</view>
|
|
|
|
|
|
|
|
<view class="attach-list">
|
|
|
|
|
|
|
|
<view
|
|
|
|
|
|
|
|
class="attach-item"
|
|
|
|
|
|
|
|
v-for="(file, index) in fileList"
|
|
|
|
|
|
|
|
:key="file.attId || file.fileId || index"
|
|
|
|
|
|
|
|
@click="fileClick(file)"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<view class="left">
|
|
|
|
|
|
|
|
<image
|
|
|
|
|
|
|
|
v-if="isImageFile(file)"
|
|
|
|
|
|
|
|
class="thumb"
|
|
|
|
|
|
|
|
:src="getFileUrl(file)"
|
|
|
|
|
|
|
|
mode="aspectFill"
|
|
|
|
|
|
|
|
></image>
|
|
|
|
|
|
|
|
<view v-else class="file-icon">文</view>
|
|
|
|
|
|
|
|
<view class="meta">
|
|
|
|
|
|
|
|
<text class="name">{{ file.name || '未命名附件' }}</text>
|
|
|
|
|
|
|
|
<text class="desc">
|
|
|
|
|
|
|
|
{{ (file.attType || '文件').toUpperCase() }}
|
|
|
|
|
|
|
|
<text v-if="formatFileSize(file.attSize)"> · {{ formatFileSize(file.attSize) }}</text>
|
|
|
|
|
|
|
|
</text>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<text class="preview-btn">{{ isImageFile(file) ? '预览' : '打开' }}</text>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<view class="empty-page" v-else>
|
|
|
|
<view class="empty-page" v-else>
|
|
|
|
@ -69,13 +82,16 @@
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import jyfParser from '@/components/jyf-parser/jyf-parser';
|
|
|
|
import jyfParser from '@/components/jyf-parser/jyf-parser';
|
|
|
|
import { pubnoticeDetailApi } from '@/api/pubnotice.js';
|
|
|
|
import { pubnoticeDetailApi } from '@/api/pubnotice.js';
|
|
|
|
|
|
|
|
import { HTTP_ADMIN_URL } from '@/config/app';
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
'jyf-parser': jyfParser,
|
|
|
|
'jyf-parser': jyfParser,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
dicts: ['sys_notice_type'],
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
|
|
|
|
HTTP_ADMIN_URL,
|
|
|
|
loading: false,
|
|
|
|
loading: false,
|
|
|
|
noticeId: '',
|
|
|
|
noticeId: '',
|
|
|
|
notice: {},
|
|
|
|
notice: {},
|
|
|
|
@ -84,22 +100,19 @@ export default {
|
|
|
|
table: 'width:100%;border-collapse:collapse;',
|
|
|
|
table: 'width:100%;border-collapse:collapse;',
|
|
|
|
video: 'max-width:100%;',
|
|
|
|
video: 'max-width:100%;',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeClassMap: {
|
|
|
|
|
|
|
|
1: 'tag-internal',
|
|
|
|
};
|
|
|
|
2: 'tag-external',
|
|
|
|
|
|
|
|
'__default__': ''
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
statusClassMap: {
|
|
|
|
computed: {
|
|
|
|
0: 'status-draft',
|
|
|
|
fileList() {
|
|
|
|
1: 'status-submit',
|
|
|
|
return Array.isArray(this.notice?.files) ? this.notice.files : [];
|
|
|
|
'__default__': ''
|
|
|
|
},
|
|
|
|
|
|
|
|
imageFiles() {
|
|
|
|
|
|
|
|
return this.fileList
|
|
|
|
|
|
|
|
.filter((item) => this.isImageFile(item))
|
|
|
|
|
|
|
|
.map((item) => this.getFileUrl(item))
|
|
|
|
|
|
|
|
.filter(Boolean);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
smsClassMap: {
|
|
|
|
|
|
|
|
0: 'sms-unsent',
|
|
|
|
|
|
|
|
1: 'sms-sent',
|
|
|
|
|
|
|
|
'__default__': ''
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onLoad(options) {
|
|
|
|
onLoad(options) {
|
|
|
|
this.noticeId = options.noticeId || options.id || '';
|
|
|
|
this.noticeId = options.noticeId || options.id || '';
|
|
|
|
@ -120,40 +133,83 @@ export default {
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
bizText(bizType, bizId) {
|
|
|
|
getFilePath(item) {
|
|
|
|
const t = bizType ? String(bizType) : '';
|
|
|
|
if (!item) return '';
|
|
|
|
const id = bizId ? String(bizId) : '';
|
|
|
|
return item.attDir || item.sattDir || item.url || item.filePath || '';
|
|
|
|
if (!t && !id) return '—';
|
|
|
|
},
|
|
|
|
if (t && id) return `${t} #${id}`;
|
|
|
|
getFileUrl(item) {
|
|
|
|
return t || id;
|
|
|
|
const path = this.getFilePath(item);
|
|
|
|
|
|
|
|
if (!path) return '';
|
|
|
|
|
|
|
|
if (/^https?:\/\//i.test(path)) return path;
|
|
|
|
|
|
|
|
const base = String(this.HTTP_ADMIN_URL || '').replace(/\/$/, '');
|
|
|
|
|
|
|
|
return `${base}/${String(path).replace(/^\//, '')}`;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
formatDate(val) {
|
|
|
|
isImageFile(item) {
|
|
|
|
if (!val) return '';
|
|
|
|
const type = String(item?.attType || '').toLowerCase();
|
|
|
|
if (typeof val === 'string') {
|
|
|
|
return (
|
|
|
|
return val.replace('T', ' ').slice(0, 19);
|
|
|
|
['pic', 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'].includes(type)
|
|
|
|
}
|
|
|
|
);
|
|
|
|
if (val instanceof Date) {
|
|
|
|
|
|
|
|
const pad = (n) => (n < 10 ? '0' + n : '' + n);
|
|
|
|
|
|
|
|
return `${val.getFullYear()}-${pad(val.getMonth() + 1)}-${pad(val.getDate())} ${pad(
|
|
|
|
|
|
|
|
val.getHours()
|
|
|
|
|
|
|
|
)}:${pad(val.getMinutes())}`;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return String(val);
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeText(type) {
|
|
|
|
formatFileSize(size) {
|
|
|
|
if (type === 1 || type === '1') return '内部';
|
|
|
|
const num = Number(size);
|
|
|
|
if (type === 2 || type === '2') return '外部';
|
|
|
|
if (!num || Number.isNaN(num)) return '';
|
|
|
|
return type || '—';
|
|
|
|
if (num < 1024) return `${num}B`;
|
|
|
|
|
|
|
|
if (num < 1024 * 1024) return `${(num / 1024).toFixed(1)}KB`;
|
|
|
|
|
|
|
|
if (num < 1024 * 1024 * 1024) return `${(num / 1024 / 1024).toFixed(1)}MB`;
|
|
|
|
|
|
|
|
return `${(num / 1024 / 1024 / 1024).toFixed(1)}GB`;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
statusText(status) {
|
|
|
|
async fileClick(item) {
|
|
|
|
if (status === 0 || status === '0') return '草稿';
|
|
|
|
const current = this.getFileUrl(item);
|
|
|
|
if (status === 1 || status === '1') return '提交';
|
|
|
|
if (!current) {
|
|
|
|
return status ?? '—';
|
|
|
|
uni.showToast({
|
|
|
|
|
|
|
|
title: '附件地址无效',
|
|
|
|
|
|
|
|
icon: 'none',
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.isImageFile(item)) {
|
|
|
|
|
|
|
|
uni.previewImage({
|
|
|
|
|
|
|
|
current,
|
|
|
|
|
|
|
|
urls: this.imageFiles,
|
|
|
|
|
|
|
|
fail: (e) => {
|
|
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
|
|
title: e?.errMsg || '预览失败',
|
|
|
|
|
|
|
|
icon: 'none',
|
|
|
|
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
smsText(smsStatus) {
|
|
|
|
});
|
|
|
|
if (smsStatus === 0 || smsStatus === '0') return '未发';
|
|
|
|
return;
|
|
|
|
if (smsStatus === 1 || smsStatus === '1') return '已发';
|
|
|
|
}
|
|
|
|
return smsStatus ?? '—';
|
|
|
|
uni.showLoading({
|
|
|
|
|
|
|
|
title: '加载中...',
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const downloadRes = await new Promise((resolve, reject) => {
|
|
|
|
|
|
|
|
uni.downloadFile({
|
|
|
|
|
|
|
|
url: current,
|
|
|
|
|
|
|
|
success: (res) => resolve(res),
|
|
|
|
|
|
|
|
fail: reject,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
if (downloadRes.statusCode !== 200) {
|
|
|
|
|
|
|
|
throw new Error('加载失败');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
await new Promise((resolve, reject) => {
|
|
|
|
|
|
|
|
uni.openDocument({
|
|
|
|
|
|
|
|
filePath: downloadRes.tempFilePath,
|
|
|
|
|
|
|
|
showMenu: true,
|
|
|
|
|
|
|
|
success: resolve,
|
|
|
|
|
|
|
|
fail: reject,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
|
|
title: e?.errMsg || e?.message || '打开失败',
|
|
|
|
|
|
|
|
icon: 'none',
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
@ -184,49 +240,6 @@ export default {
|
|
|
|
word-break: break-all;
|
|
|
|
word-break: break-all;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tag-row {
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
gap: 10rpx;
|
|
|
|
|
|
|
|
margin-top: 14rpx;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.tag {
|
|
|
|
|
|
|
|
padding: 6rpx 16rpx;
|
|
|
|
|
|
|
|
border-radius: 20rpx;
|
|
|
|
|
|
|
|
font-size: 20rpx;
|
|
|
|
|
|
|
|
line-height: 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.tag-internal {
|
|
|
|
|
|
|
|
background-color: #e6f7ff;
|
|
|
|
|
|
|
|
color: #409eff;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.tag-external {
|
|
|
|
|
|
|
|
background-color: #fff7e6;
|
|
|
|
|
|
|
|
color: #fa8c16;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.status-draft {
|
|
|
|
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
|
|
|
|
color: #666;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.status-submit {
|
|
|
|
|
|
|
|
background-color: #f6ffed;
|
|
|
|
|
|
|
|
color: #52c41a;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.sms-unsent {
|
|
|
|
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
|
|
|
|
color: #999;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.sms-sent {
|
|
|
|
|
|
|
|
background-color: #e6fffb;
|
|
|
|
|
|
|
|
color: #13c2c2;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.info-list {
|
|
|
|
.info-list {
|
|
|
|
@ -261,6 +274,91 @@ export default {
|
|
|
|
border-top: 1rpx solid #f5f5f5;
|
|
|
|
border-top: 1rpx solid #f5f5f5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.attach-box {
|
|
|
|
|
|
|
|
margin-top: 24rpx;
|
|
|
|
|
|
|
|
padding-top: 20rpx;
|
|
|
|
|
|
|
|
border-top: 1rpx solid #f5f5f5;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.attach-title {
|
|
|
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
|
|
color: #333;
|
|
|
|
|
|
|
|
margin-bottom: 16rpx;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.attach-list {
|
|
|
|
|
|
|
|
.attach-item {
|
|
|
|
|
|
|
|
min-height: 108rpx;
|
|
|
|
|
|
|
|
border: 1rpx solid #f0f0f0;
|
|
|
|
|
|
|
|
border-radius: 10rpx;
|
|
|
|
|
|
|
|
padding: 14rpx 16rpx;
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
margin-bottom: 12rpx;
|
|
|
|
|
|
|
|
background: #fafafa;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.left {
|
|
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.thumb {
|
|
|
|
|
|
|
|
width: 72rpx;
|
|
|
|
|
|
|
|
height: 72rpx;
|
|
|
|
|
|
|
|
border-radius: 8rpx;
|
|
|
|
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
|
|
|
|
margin-right: 14rpx;
|
|
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.file-icon {
|
|
|
|
|
|
|
|
width: 72rpx;
|
|
|
|
|
|
|
|
height: 72rpx;
|
|
|
|
|
|
|
|
border-radius: 8rpx;
|
|
|
|
|
|
|
|
background: #eef4ff;
|
|
|
|
|
|
|
|
color: #409eff;
|
|
|
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
margin-right: 14rpx;
|
|
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.meta {
|
|
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.name {
|
|
|
|
|
|
|
|
font-size: 24rpx;
|
|
|
|
|
|
|
|
color: #333;
|
|
|
|
|
|
|
|
line-height: 1.4;
|
|
|
|
|
|
|
|
word-break: break-all;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.desc {
|
|
|
|
|
|
|
|
margin-top: 6rpx;
|
|
|
|
|
|
|
|
font-size: 20rpx;
|
|
|
|
|
|
|
|
color: #999;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.preview-btn {
|
|
|
|
|
|
|
|
margin-left: 16rpx;
|
|
|
|
|
|
|
|
color: #409eff;
|
|
|
|
|
|
|
|
font-size: 24rpx;
|
|
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.empty-page {
|
|
|
|
.empty-page {
|
|
|
|
margin-top: 120rpx;
|
|
|
|
margin-top: 120rpx;
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
|