|
@@ -11,7 +11,7 @@ const opts = reactive({
|
|
|
{ field: "noticeType", name: "公告通知类型", visible: true, width: 130 },
|
|
{ field: "noticeType", name: "公告通知类型", visible: true, width: 130 },
|
|
|
{ field: "readStatus", name: "是否阅读", visible: true, width: 100 },
|
|
{ field: "readStatus", name: "是否阅读", visible: true, width: 100 },
|
|
|
{ field: "createTime", name: "公告通知时间", visible: true, width: 190 },
|
|
{ field: "createTime", name: "公告通知时间", visible: true, width: 190 },
|
|
|
- { field: "actions", name: `操作`, width: 60 }
|
|
|
|
|
|
|
+ { field: "actions", name: `操作`, width: 80 }
|
|
|
],
|
|
],
|
|
|
queryParams: {
|
|
queryParams: {
|
|
|
noticeTitle: "",
|
|
noticeTitle: "",
|
|
@@ -57,8 +57,18 @@ const opts = reactive({
|
|
|
// }
|
|
// }
|
|
|
] as any,
|
|
] as any,
|
|
|
permission: "",
|
|
permission: "",
|
|
|
- handleFuns: {},
|
|
|
|
|
- customBtns: [],
|
|
|
|
|
|
|
+ handleFuns: {
|
|
|
|
|
+ handleRemoveAll
|
|
|
|
|
+ },
|
|
|
|
|
+ customBtns: [
|
|
|
|
|
+ {
|
|
|
|
|
+ key: "handleRemoveAll",
|
|
|
|
|
+ name: "删除全部已读",
|
|
|
|
|
+ icon: "bi bi-dash-square",
|
|
|
|
|
+ btnClass: "btn btn-light-danger",
|
|
|
|
|
+ disabledFun: () => false
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
tableListFun: apis.system.noticeApi.listMyNotice
|
|
tableListFun: apis.system.noticeApi.listMyNotice
|
|
|
})
|
|
})
|
|
|
const { queryParams } = toRefs(opts)
|
|
const { queryParams } = toRefs(opts)
|
|
@@ -71,8 +81,34 @@ function handleQuery(query?: any) {
|
|
|
function resetQuery() {
|
|
function resetQuery() {
|
|
|
//
|
|
//
|
|
|
}
|
|
}
|
|
|
|
|
+const detailData = ref()
|
|
|
function handleRead(row: any) {
|
|
function handleRead(row: any) {
|
|
|
- appStore.noticeStore.readNotice(row)
|
|
|
|
|
|
|
+ if (row.noticeType == "1") {
|
|
|
|
|
+ appStore.noticeStore.readNotice(row)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ detailData.value = row
|
|
|
|
|
+ if (row.readStatus == "1") {
|
|
|
|
|
+ modalRef.value.show()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ apis.system.noticeApi.read(row.noticeId, row.noticeType).then(() => {
|
|
|
|
|
+ modalRef.value.show()
|
|
|
|
|
+ handleQuery()
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+function handleRemove(row: any) {
|
|
|
|
|
+ apis.system.noticeApi.removeRead(row.noticeId).then(() => {
|
|
|
|
|
+ message.msgSuccess("删除成功")
|
|
|
|
|
+ handleQuery()
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function handleRemoveAll() {
|
|
|
|
|
+ apis.system.noticeApi.removeReadAll().then(() => {
|
|
|
|
|
+ message.msgSuccess("全部已读删除成功")
|
|
|
|
|
+ handleQuery()
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function init() {}
|
|
function init() {}
|
|
@@ -112,15 +148,34 @@ onMounted(init)
|
|
|
<DictTag type="sys_notice_read_status" :value="row.readStatus"></DictTag>
|
|
<DictTag type="sys_notice_read_status" :value="row.readStatus"></DictTag>
|
|
|
</template>
|
|
</template>
|
|
|
<template #actions="{ row }">
|
|
<template #actions="{ row }">
|
|
|
- <vb-tooltip v-if="row.readStatus == '0'" content="阅读" placement="top">
|
|
|
|
|
|
|
+ <vb-tooltip content="阅读" placement="top">
|
|
|
<el-button link type="primary" @click="handleRead(row)">
|
|
<el-button link type="primary" @click="handleRead(row)">
|
|
|
<template #icon>
|
|
<template #icon>
|
|
|
<VbIcon icon-name="book" icon-type="duotone" class="fs-3"></VbIcon>
|
|
<VbIcon icon-name="book" icon-type="duotone" class="fs-3"></VbIcon>
|
|
|
</template>
|
|
</template>
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</vb-tooltip>
|
|
</vb-tooltip>
|
|
|
- <span v-else>-</span>
|
|
|
|
|
|
|
+ <vb-tooltip v-if="row.readStatus == '1'" content="删除" placement="top">
|
|
|
|
|
+ <el-button link type="danger" @click="handleRemove(row)">
|
|
|
|
|
+ <template #icon>
|
|
|
|
|
+ <VbIcon icon-name="trash-square" icon-type="duotone" class="fs-3"></VbIcon>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </vb-tooltip>
|
|
|
</template>
|
|
</template>
|
|
|
</VbDataTable>
|
|
</VbDataTable>
|
|
|
|
|
+ <VbModal
|
|
|
|
|
+ v-model:modal="modalRef"
|
|
|
|
|
+ title="公告详情"
|
|
|
|
|
+ :confirm-btn="false"
|
|
|
|
|
+ :close-btn-class="'btn btn-danger'"
|
|
|
|
|
+ append-to-body>
|
|
|
|
|
+ <template #body>
|
|
|
|
|
+ <div v-if="detailData" class="d-flex flex-column">
|
|
|
|
|
+ <div class="fw-bold text-center my-3">{{ detailData.noticeTitle }}</div>
|
|
|
|
|
+ <div v-html="detailData.noticeContent"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </VbModal>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|