From 6af68085ff6615e1ec3a5dd18c761250800d6fca Mon Sep 17 00:00:00 2001
From: LiuHao <liuhaoai545@gmail.com>
Date: 星期二, 06 六月 2023 22:23:43 +0800
Subject: [PATCH] update 修改页面代码 去除ele的引入以及vue的类型声明

---
 src/views/system/tenant/index.vue |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/views/system/tenant/index.vue b/src/views/system/tenant/index.vue
index 8ea4b40..b593607 100644
--- a/src/views/system/tenant/index.vue
+++ b/src/views/system/tenant/index.vue
@@ -145,8 +145,6 @@
 import { selectTenantPackage } from '@/api/system/tenantPackage';
 import { TenantForm, TenantQuery, TenantVO } from '@/api/system/tenant/types';
 import { TenantPkgVO } from '@/api/system/tenantPackage/types';
-import { ComponentInternalInstance } from 'vue';
-import { ElForm } from 'element-plus';
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 
@@ -160,8 +158,8 @@
 const multiple = ref(true);
 const total = ref(0);
 
-const queryFormRef = ref(ElForm);
-const tenantFormRef = ref(ElForm);
+const queryFormRef = ref<ElFormInstance>();
+const tenantFormRef = ref<ElFormInstance>();
 
 const dialog = reactive<DialogOption>({
     visible: false,
@@ -253,7 +251,7 @@
 // 琛ㄥ崟閲嶇疆
 const reset = () => {
     form.value = {...initFormData};
-    tenantFormRef.value.resetFields();
+    tenantFormRef.value?.resetFields();
 }
 
 /** 鎼滅储鎸夐挳鎿嶄綔 */
@@ -264,7 +262,7 @@
 
 /** 閲嶇疆鎸夐挳鎿嶄綔 */
 const resetQuery = () => {
-    queryFormRef.value.resetFields();
+    queryFormRef.value?.resetFields();
     handleQuery();
 }
 
@@ -292,7 +290,7 @@
     dialog.title = "淇敼绉熸埛";
     nextTick(async () => {
         reset();
-        getTenantPackage();
+        await getTenantPackage();
         const _id = row?.id || ids.value[0];
         const res = await getTenant(_id);
         loading.value = false;
@@ -302,7 +300,7 @@
 
 /** 鎻愪氦鎸夐挳 */
 const submitForm = () => {
-    tenantFormRef.value.validate(async (valid: boolean) => {
+    tenantFormRef.value?.validate(async (valid: boolean) => {
         if (valid) {
             buttonLoading.value = true;
             if (form.value.id) {
@@ -323,7 +321,7 @@
     await proxy?.$modal.confirm('鏄惁纭鍒犻櫎绉熸埛缂栧彿涓�"' + _ids + '"鐨勬暟鎹」锛�')
     loading.value = true;
     await delTenant(_ids).finally(() => loading.value = false);
-    getList();
+    await getList();
     proxy?.$modal.msgSuccess("鍒犻櫎鎴愬姛");
 
 
@@ -335,7 +333,7 @@
         await proxy?.$modal.confirm('鏄惁纭鍚屾绉熸埛濂楅绉熸埛缂栧彿涓�"' + row.tenantId + '"鐨勬暟鎹」锛�');
         loading.value = true;
         await syncTenantPackage(row.tenantId, row.packageId);
-        getList();
+        await getList();
         proxy?.$modal.msgSuccess("鍚屾鎴愬姛");
     } catch {return} finally {
         loading.value = false;

--
Gitblit v1.9.3