|
@@ -28,6 +28,79 @@
|
|
|
v-loading="tableLoading"
|
|
|
@select-change="selectChange"
|
|
|
>
|
|
|
+ <template #type="{ col, row }">
|
|
|
+ {{ noticeTypeFilter(row[col.colKey]) }}
|
|
|
+ </template>
|
|
|
+ <template #name="{ col, row }">
|
|
|
+ <span>{{ row.title }}</span>
|
|
|
+ <span>
|
|
|
+ 【 {{ row.createName + ':'
|
|
|
+ }}{{
|
|
|
+ row.status === 'PUBLISH'
|
|
|
+ ? timestampFilter(row.publishTime)
|
|
|
+ : '暂未发布'
|
|
|
+ }}】
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template #status="{ col, row }">
|
|
|
+ {{ publishStatusFilter(row[col.colKey]) }}
|
|
|
+ </template>
|
|
|
+ <template #operate="{ col, row }">
|
|
|
+ <div class="table-operations">
|
|
|
+ <t-link
|
|
|
+ v-if="row.status === 'PUBLISH'"
|
|
|
+ theme="danger"
|
|
|
+ hover="color"
|
|
|
+ @click="
|
|
|
+ (e) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ handleCancelPublish(row);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 撤销发布
|
|
|
+ </t-link>
|
|
|
+ <t-link
|
|
|
+ v-else
|
|
|
+ theme="primary"
|
|
|
+ hover="color"
|
|
|
+ @click="
|
|
|
+ (e) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ handlePublish(row);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 发布
|
|
|
+ </t-link>
|
|
|
+ <t-link
|
|
|
+ v-if="row.status === 'PUBLISH'"
|
|
|
+ theme="primary"
|
|
|
+ hover="color"
|
|
|
+ @click="
|
|
|
+ (e) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ handleFeedbackView(row);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 回执查询
|
|
|
+ </t-link>
|
|
|
+ <t-link
|
|
|
+ v-if="row.status !== 'PUBLISH'"
|
|
|
+ theme="primary"
|
|
|
+ hover="color"
|
|
|
+ @click="
|
|
|
+ (e) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ handleEdit(row);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 修改
|
|
|
+ </t-link>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</t-table>
|
|
|
</div>
|
|
|
|
|
@@ -51,6 +124,13 @@ import {
|
|
|
noticePublishApi,
|
|
|
noticeCancelPublishApi,
|
|
|
} from '@/api/system';
|
|
|
+import { dictToOptionList } from '@/utils/tool';
|
|
|
+import { NOTICE_TYPE, PUBLISH_STATUS } from '@/config/constants';
|
|
|
+import {
|
|
|
+ noticeTypeFilter,
|
|
|
+ publishStatusFilter,
|
|
|
+ timestampFilter,
|
|
|
+} from '@/utils/filter';
|
|
|
|
|
|
const showEditNoticeDialog = ref(false);
|
|
|
const curRow = ref(null);
|
|
@@ -63,10 +143,7 @@ const fields = ref([
|
|
|
type: 'select',
|
|
|
labelWidth: 100,
|
|
|
colSpan: 5,
|
|
|
- options: [
|
|
|
- { value: 1, label: '已发布' },
|
|
|
- { value: 2, label: '未发布' },
|
|
|
- ],
|
|
|
+ options: dictToOptionList(PUBLISH_STATUS),
|
|
|
},
|
|
|
{
|
|
|
prop: 'type',
|
|
@@ -74,7 +151,7 @@ const fields = ref([
|
|
|
type: 'select',
|
|
|
labelWidth: 60,
|
|
|
colSpan: 5,
|
|
|
- options: [{ value: 1, label: '公告' }],
|
|
|
+ options: dictToOptionList(NOTICE_TYPE),
|
|
|
},
|
|
|
{
|
|
|
prop: 'publishTime',
|
|
@@ -126,61 +203,16 @@ const computedParams = computed(() => {
|
|
|
|
|
|
const columns = [
|
|
|
{ colKey: 'row-select', type: 'multiple', width: 50 },
|
|
|
- { colKey: 'type', title: '类型' },
|
|
|
- { colKey: 'title', title: '消息名称' },
|
|
|
- { colKey: 'status', title: '发布状态' },
|
|
|
+ { colKey: 'type', title: '类型', cell: 'type', width: 120 },
|
|
|
+ { colKey: 'title', title: '消息名称', cell: 'name' },
|
|
|
+ { colKey: 'status', title: '发布状态', cell: 'status', width: 100 },
|
|
|
{
|
|
|
title: '操作',
|
|
|
colKey: 'operate',
|
|
|
fixed: 'right',
|
|
|
- width: 240,
|
|
|
+ width: 160,
|
|
|
align: 'center',
|
|
|
- cell: (h, { row }) => {
|
|
|
- return (
|
|
|
- <div class="table-operations">
|
|
|
- <t-link
|
|
|
- theme="primary"
|
|
|
- hover="color"
|
|
|
- onClick={(e) => {
|
|
|
- e.stopPropagation();
|
|
|
- handleCancelPublish(row);
|
|
|
- }}
|
|
|
- >
|
|
|
- 撤销发布
|
|
|
- </t-link>
|
|
|
- <t-link
|
|
|
- theme="primary"
|
|
|
- hover="color"
|
|
|
- onClick={(e) => {
|
|
|
- e.stopPropagation();
|
|
|
- handlePublish(row);
|
|
|
- }}
|
|
|
- >
|
|
|
- 发布
|
|
|
- </t-link>
|
|
|
- <t-link
|
|
|
- theme="primary"
|
|
|
- hover="color"
|
|
|
- onClick={(e) => {
|
|
|
- e.stopPropagation();
|
|
|
- handleFeedbackView(row);
|
|
|
- }}
|
|
|
- >
|
|
|
- 回执查询
|
|
|
- </t-link>
|
|
|
- <t-link
|
|
|
- theme="primary"
|
|
|
- hover="color"
|
|
|
- onClick={(e) => {
|
|
|
- e.stopPropagation();
|
|
|
- handleEdit(row);
|
|
|
- }}
|
|
|
- >
|
|
|
- 修改
|
|
|
- </t-link>
|
|
|
- </div>
|
|
|
- );
|
|
|
- },
|
|
|
+ cell: 'operate',
|
|
|
},
|
|
|
];
|
|
|
const {
|
|
@@ -227,8 +259,8 @@ const handleDestroy = () => {
|
|
|
};
|
|
|
const handleCancelPublish = (row) => {
|
|
|
const confirmDia = DialogPlugin({
|
|
|
- header: '操作提示',
|
|
|
- body: `确定要撤销发布当前信息吗`,
|
|
|
+ header: '撤销发布提示',
|
|
|
+ body: `您确定要撤销发布该通知公告吗?一旦撤销发布,该通知公告信息的回执将会被清空,重新发布后该通知公告将作为新消息发布。`,
|
|
|
confirmBtn: '确定',
|
|
|
cancelBtn: '取消',
|
|
|
onConfirm: async () => {
|
|
@@ -249,8 +281,8 @@ const handleEdit = (row) => {
|
|
|
};
|
|
|
const handlePublish = (row) => {
|
|
|
const confirmDia = DialogPlugin({
|
|
|
- header: '操作提示',
|
|
|
- body: `确定要发布当前信息吗`,
|
|
|
+ header: '发布提示',
|
|
|
+ body: `您确定要发布该通知公告吗?`,
|
|
|
confirmBtn: '确定',
|
|
|
cancelBtn: '取消',
|
|
|
onConfirm: async () => {
|