From 7ff49365700b8195cf2ff47381663aee39015771 Mon Sep 17 00:00:00 2001 From: valarchie <343928303@qq.com> Date: Wed, 12 Jul 2023 21:02:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=84=E8=8C=83=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E7=9A=84=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/notice/form.vue | 6 ++++-- src/views/system/notice/index.vue | 8 +++++--- src/views/system/notice/utils/hook.tsx | 19 +++++++++++-------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/views/system/notice/form.vue b/src/views/system/notice/form.vue index 45ac2a7..c2eb36f 100644 --- a/src/views/system/notice/form.vue +++ b/src/views/system/notice/form.vue @@ -48,7 +48,9 @@ defineExpose({ getFormRuleRef }); class="!w-[180px]" > 重置 @@ -130,6 +131,7 @@ const { adaptive :data="dataList" :columns="dynamicColumns" + :default-sort="{ prop: 'createTime', order: 'descending' }" :pagination="pagination" :paginationSmall="size === 'small' ? true : false" :header-cell-style="{ diff --git a/src/views/system/notice/utils/hook.tsx b/src/views/system/notice/utils/hook.tsx index 4f67769..2797ac6 100644 --- a/src/views/system/notice/utils/hook.tsx +++ b/src/views/system/notice/utils/hook.tsx @@ -15,9 +15,8 @@ import { import { reactive, ref, onMounted, h, toRaw } from "vue"; import { useUserStoreHook } from "@/store/modules/user"; -const sysNoticeTypeMap = useUserStoreHook().dictionaryMap["sys_notice_type"]; -const sysNoticeStatusMap = - useUserStoreHook().dictionaryMap["sys_notice_status"]; +const noticeTypeMap = useUserStoreHook().dictionaryMap["sysNotice.noticeType"]; +const noticeStatusMap = useUserStoreHook().dictionaryMap["sysNotice.status"]; export function useNoticeHook() { const pagination = reactive({ @@ -63,10 +62,10 @@ export function useNoticeHook() { cellRenderer: ({ row, props }) => ( - {sysNoticeTypeMap[row.noticeType].label} + {noticeTypeMap[row.noticeType].label} ) }, @@ -77,10 +76,10 @@ export function useNoticeHook() { cellRenderer: ({ row, props }) => ( - {sysNoticeStatusMap[row.status].label} + {noticeStatusMap[row.status].label} ) }, @@ -213,9 +212,13 @@ export function useNoticeHook() { }, 500); } - const resetForm = formEl => { + const resetForm = (formEl, tableRef) => { if (!formEl) return; formEl.resetFields(); + searchFormParams.orderColumn = ""; + searchFormParams.orderDirection = ""; + + tableRef.getTableRef().clearSort(); onSearch(); };