From c93ff74fb5a47d38554d40b5ab00cfe07eac1f2a Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期四, 24 十月 2024 17:21:22 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/plt-web/plt-web-ui/src/views/systemModel/operateType/index.vue | 35 ++++++++++++++++++++++++++---------
1 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/systemModel/operateType/index.vue b/Source/plt-web/plt-web-ui/src/views/systemModel/operateType/index.vue
index cea9234..afbb76d 100644
--- a/Source/plt-web/plt-web-ui/src/views/systemModel/operateType/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/systemModel/operateType/index.vue
@@ -2,8 +2,8 @@
<el-container>
<el-aside>
<basic-container>
- <div style="max-height: calc(100vh - 170px);overflow: auto">
- <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick">
+ <div style="max-height: calc(100vh - 150px);overflow: auto">
+ <avue-tree :key="refresh" node-key="id" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick">
<span slot-scope="{ node, data }" class="el-tree-node__label">
<span style="font-size: 15px">
<i class="el-icon-s-promotion"></i>
@@ -17,7 +17,7 @@
<el-main>
<basic-container>
- <el-form ref="form" :model="form" label-width="85px" style="height: 79vh">
+ <el-form ref="form" :model="form" label-width="85px" style="max-height: calc(100vh - 180px);overflow: auto;">
<el-form-item label="鍚嶇О锛�">
<el-input v-model="form.name" placeholder="璇疯緭鍏ュ悕绉�"></el-input>
</el-form-item>
@@ -73,6 +73,7 @@
editStatus:false,
addStatus: false,
nodeRow: {},
+ currentClickNode:null,
form: {},
treeData: [],
treeOption: {
@@ -111,10 +112,11 @@
},
methods: {
// 鏍戣鐐瑰嚮
- nodeClick(row) {
+ nodeClick(row,node) {
console.log(row);
this.form = {...row};
this.nodeRow = {...row};
+ this.currentClickNode=node;
this.addStatus = false;
this.editStatus = false;
},
@@ -173,7 +175,7 @@
addOperationType(params).then(res => {
if(res.data.code === 200){
this.$message.success(res.data.msg);
- this.refresh = Math.random(); // 鍒锋柊宸︿晶鏍�
+ this.handleRefreshTree('add')
this.addStatus = false;
}
})
@@ -227,7 +229,7 @@
updateOperationType(params).then(res => {
if(res.data.code === 200){
this.$message.success(res.data.msg);
- this.refresh = Math.random(); // 鍒锋柊宸︿晶鏍�
+ this.handleRefreshTree('edit')
this.editStatus = false;
}
})
@@ -243,7 +245,7 @@
delOperationType(this.form).then(res => {
if (res.data.code === 200) {
this.$message.success(res.data.msg);
- this.resetFormValue();
+ this.handleRefreshTree('del')
this.addStatus = false;
this.editStatus = false;
this.nodeRow = {};
@@ -262,10 +264,25 @@
exportFunctionSql({isFunction: false}).then(res => {
func.downloadFileByBlobHandler(res);
this.$message.success('瀵煎嚭鎴愬姛');
- }).catch(err => {
- this.$message.error(err);
});
},
+ handleRefreshTree(type) {
+ //type:add\edit\del
+ if(type=="del"){
+ this.$refs.tree.remove(this.currentClickNode);
+ this.currentClickNode=null;
+ this.form={};
+ }else{
+ if (this.currentClickNode) {
+ let node = this.currentClickNode.parent;
+ node.loaded = false;
+ node.expand();
+ this.$refs.tree.setCurrentNode(this.currentClickNode);
+ }else {
+ this.refresh = Math.random(); // 鍒锋柊宸︿晶鏍�
+ }
+ }
+ }
}
}
</script>
--
Gitblit v1.9.3