From 7d6f70a75a1cee14aa69b23d008669851640c7ee Mon Sep 17 00:00:00 2001
From: dap <15891557205@163.com>
Date: Sun, 6 Oct 2024 11:15:25 +0800
Subject: [PATCH] feat: dict
---
.../src/views/system/dict/type/index.vue | 55 ++++++++++++++++++-
1 file changed, 53 insertions(+), 2 deletions(-)
diff --git a/apps/web-antd/src/views/system/dict/type/index.vue b/apps/web-antd/src/views/system/dict/type/index.vue
index 6eb90c90..24dc2717 100644
--- a/apps/web-antd/src/views/system/dict/type/index.vue
+++ b/apps/web-antd/src/views/system/dict/type/index.vue
@@ -5,7 +5,15 @@ import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
-import { Modal, Popconfirm, Space } from 'ant-design-vue';
+import {
+ Dropdown,
+ Menu,
+ MenuItem,
+ type MenuProps,
+ Modal,
+ Popconfirm,
+ Space,
+} from 'ant-design-vue';
import dayjs from 'dayjs';
import { useVbenVxeGrid, type VxeGridProps } from '#/adapter';
@@ -13,7 +21,9 @@ import {
dictTypeExport,
dictTypeList,
dictTypeRemove,
+ refreshDictTypeCache,
} from '#/api/system/dict/dict-type';
+import { dictSyncTenant } from '#/api/system/tenant';
import { downloadExcel } from '#/utils/file/download';
import { emitter } from '../mitt';
@@ -132,6 +142,35 @@ function handleMultiDelete() {
},
});
}
+
+const handleMenuClick: MenuProps['onClick'] = (e) => {
+ switch (e.key) {
+ case '1': {
+ handleRefreshCache();
+ break;
+ }
+ case '2': {
+ handleSyncTenantDict();
+ break;
+ }
+ }
+};
+async function handleRefreshCache() {
+ await refreshDictTypeCache();
+ await tableApi.query();
+}
+
+function handleSyncTenantDict() {
+ Modal.confirm({
+ title: '提示',
+ iconType: 'warning',
+ content: '确认同步租户字典?',
+ onOk: async () => {
+ await dictSyncTenant();
+ await tableApi.query();
+ },
+ });
+}
@@ -142,7 +181,19 @@ function handleMultiDelete() {
- 缓存(TODO)
+
+
+
+
+ 更多
+