From 22e8a57b31acfcc8aa84b96b797a055a0445af41 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期一, 18 十一月 2024 23:47:14 +0800
Subject: [PATCH] update 优化 将同步字典功能迁移到租户管理内

---
 src/views/system/tenant/index.vue |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/src/views/system/tenant/index.vue b/src/views/system/tenant/index.vue
index fabe18d..e2cec99 100644
--- a/src/views/system/tenant/index.vue
+++ b/src/views/system/tenant/index.vue
@@ -44,6 +44,9 @@
           <el-col :span="1.5">
             <el-button v-hasPermi="['system:tenant:export']" type="warning" plain icon="Download" @click="handleExport">瀵煎嚭</el-button>
           </el-col>
+          <el-col :span="1.5">
+            <el-button v-if="userId === 1" type="success" plain icon="Refresh" @click="handleSyncTenantDict">鍚屾绉熸埛瀛楀吀</el-button>
+          </el-col>
           <right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
         </el-row>
       </template>
@@ -141,13 +144,16 @@
 </template>
 
 <script setup name="Tenant" lang="ts">
-import { listTenant, getTenant, delTenant, addTenant, updateTenant, changeTenantStatus, syncTenantPackage } from '@/api/system/tenant';
+import { listTenant, getTenant, delTenant, addTenant, updateTenant, changeTenantStatus, syncTenantPackage, syncTenantDict } from '@/api/system/tenant';
 import { selectTenantPackage } from '@/api/system/tenantPackage';
+import useUserStore from '@/store/modules/user';
 import { TenantForm, TenantQuery, TenantVO } from '@/api/system/tenant/types';
 import { TenantPkgVO } from '@/api/system/tenantPackage/types';
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 
+const userStore = useUserStore();
+const userId = ref(userStore.userId);
 const tenantList = ref<TenantVO[]>([]);
 const packageList = ref<TenantPkgVO[]>([]);
 const buttonLoading = ref(false);
@@ -343,6 +349,13 @@
   );
 };
 
+/**鍚屾绉熸埛瀛楀吀*/
+const handleSyncTenantDict = async () => {
+  await proxy?.$modal.confirm('纭瑕佸悓姝ユ墍鏈夌鎴峰瓧鍏稿悧锛�');
+  let res = await syncTenantDict();
+  proxy?.$modal.msgSuccess(res.msg);
+};
+
 onMounted(() => {
   getList();
 });

--
Gitblit v1.9.3