From 1dea6ed29c32dd41bf69d3831f75c2a4ddd8b8bd Mon Sep 17 00:00:00 2001
From: sheng <15292050171@163.com>
Date: Fri, 28 Jul 2023 11:16:07 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20=20=E9=83=A8=E9=97=A8=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E4=B8=8E=E7=BC=96=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web/.gitignore | 1 -
.../{FormCom.vue => DeptFormCom.vue} | 47 ++++++++++++++++---
web/src/views/system/dept/index.vue | 9 ++--
web/src/views/system/dept/types.ts | 4 +-
4 files changed, 49 insertions(+), 12 deletions(-)
rename web/src/views/system/dept/components/{FormCom.vue => DeptFormCom.vue} (62%)
diff --git a/web/.gitignore b/web/.gitignore
index c6c57be..aa1baf2 100644
--- a/web/.gitignore
+++ b/web/.gitignore
@@ -1,7 +1,6 @@
.DS_Store
node_modules
/dist
-package-lock.json
yarn.lock
# local env files
diff --git a/web/src/views/system/dept/components/FormCom.vue b/web/src/views/system/dept/components/DeptFormCom.vue
similarity index 62%
rename from web/src/views/system/dept/components/FormCom.vue
rename to web/src/views/system/dept/components/DeptFormCom.vue
index 3f805db..2aff9a7 100644
--- a/web/src/views/system/dept/components/FormCom.vue
+++ b/web/src/views/system/dept/components/DeptFormCom.vue
@@ -26,17 +26,20 @@
- 保存
+
+ {{ deptFormData.id ? '保存' : '新增' }}
+
取消
-
diff --git a/web/src/views/system/dept/index.vue b/web/src/views/system/dept/index.vue
index 5bdb014..9cc0018 100644
--- a/web/src/views/system/dept/index.vue
+++ b/web/src/views/system/dept/index.vue
@@ -74,7 +74,7 @@
-
+
@@ -84,7 +84,7 @@ import { ref, onMounted, reactive } from 'vue';
import XEUtils from 'xe-utils';
import { ElForm, ElMessageBox, FormRules } from 'element-plus';
import TreeCom from './components/TreeCom.vue'
-import FormCom from './components/FormCom.vue'
+import DeptFormCom from './components/DeptFormCom.vue'
import { GetList, AddObj, UpdateObj, DelObj } from './api';
import { successMessage } from '../../../utils/message';
import { APIResponseData, DeptFormDataType, TreeItemType } from './types';
@@ -182,7 +182,10 @@ const handleUpdateMenu = (type: string, record?: TreeItemType) => {
}); */
};
-const handleDrawerClose = () => {
+const handleDrawerClose = (type?: string) => {
+ if (type === 'submit') {
+ getData()
+ }
drawerVisible.value = false
drawerFormData.value = {}
}
diff --git a/web/src/views/system/dept/types.ts b/web/src/views/system/dept/types.ts
index a1ef5c6..cf52653 100644
--- a/web/src/views/system/dept/types.ts
+++ b/web/src/views/system/dept/types.ts
@@ -40,9 +40,9 @@ export interface TreeItemType {
}
export interface DeptFormDataType {
- id: string;
+ id: string | number;
key: string;
- parent: string;
+ parent: string | number;
name: string;
owner: string;
phone: string;