|
|
@@ -1,6 +1,105 @@
|
|
|
+<!-- 通知公告-公告通知管理 -->
|
|
|
<template>
|
|
|
- <app-view></app-view>
|
|
|
+ <app-view>
|
|
|
+ <template #header>
|
|
|
+ <app-filter :option="filterOption" />
|
|
|
+ </template>
|
|
|
+ <app-table :data="dataList" :columns="tableColumns" :loading="loading">
|
|
|
+ <template #headerLeft>
|
|
|
+ <app-operation :data-list="getActionButtons(['notice_manage_add'])"
|
|
|
+ @click="(code: string) => openComponent(code)" />
|
|
|
+ </template>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template #operate="{ row }">
|
|
|
+ <app-operation size="small"
|
|
|
+ :data-list="getActionButtons(['notice_manage_details', 'notice_manage_delete', 'notice_manage_force'])"
|
|
|
+ @click="(code: string) => openComponent(code, row)" circle />
|
|
|
+ </template>
|
|
|
+ <template #footer>
|
|
|
+ <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
|
|
|
+ @change="onSearch" />
|
|
|
+ </template>
|
|
|
+ </app-table>
|
|
|
+ <component :is="componentMap.get(componentId)" v-bind="{ record, queryParams }" @closed="closeComponent"
|
|
|
+ v-if="componentId" />
|
|
|
+ </app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
+import { shallowRef } from 'vue'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
+import { useDataFilter } from '@/hooks/datatable-v2'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
+import { useOperation } from '@/hooks/operation'
|
|
|
+import { query } from '@/services/api/notice'
|
|
|
+import AppTable from '@pc/components/base/table/index.vue'
|
|
|
+import AppPagination from '@pc/components/base/pagination/index.vue'
|
|
|
+import AppOperation from '@pc/components/base/operation/index.vue'
|
|
|
+import AppFilter from '@pc/components/base/table-filter-v2/index.vue'
|
|
|
+import { i18n } from '@/stores'
|
|
|
+
|
|
|
+const { global: { t } } = i18n
|
|
|
+
|
|
|
+const { componentMap, componentId, record, openComponent, closeComponent, getActionButtons } = useOperation<Notice.QueryRsp>({
|
|
|
+ onClose: () => onSearch()
|
|
|
+})
|
|
|
+
|
|
|
+const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(query, {
|
|
|
+ params: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20
|
|
|
+ },
|
|
|
+ onError: (err) => {
|
|
|
+ ElMessage.error(err)
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
+ { field: 'title', label: '标题' },
|
|
|
+ { field: 'msgtype', label: '消息类型' },
|
|
|
+ { field: 'sendtype', label: '发布类型' },
|
|
|
+ { field: 'sentstatus', label: '推送状态' },
|
|
|
+ { field: 'scheduletime', label: '生效时间' },
|
|
|
+ { field: 'endtime', label: '结束时间' },
|
|
|
+ { field: 'recipient', label: '接收人' },
|
|
|
+ { field: 'operate', label: 'common.operate', fixed: 'right' }
|
|
|
+])
|
|
|
+
|
|
|
+const { queryParams, filterOption, getQueryParams, resetFilters } = useDataFilter<Notice.QueryReq>({
|
|
|
+ filters: [
|
|
|
+ {
|
|
|
+ field: 'title',
|
|
|
+ label: '标题'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'msgtype',
|
|
|
+ label: '消息类型'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'content',
|
|
|
+ label: '消息内容'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'userid',
|
|
|
+ label: '接收交易商'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'sendtype',
|
|
|
+ label: '发布类型'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'isforcedisplay',
|
|
|
+ label: '是否强制弹出'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ buttons: [
|
|
|
+ { label: t('operation.search'), className: 'el-button--primary', onClick: () => onSearch() },
|
|
|
+ { label: t('operation.reset'), className: 'el-button--primary', validateEvent: false, onClick: () => resetFilters() }
|
|
|
+ ]
|
|
|
+})
|
|
|
+
|
|
|
+const onSearch = () => {
|
|
|
+ const qs = getQueryParams()
|
|
|
+ run(qs)
|
|
|
+}
|
|
|
</script>
|