From 4006805916d04a398243292316fbad8a05d2f67b Mon Sep 17 00:00:00 2001
From: yuxc <yuxc@vci-tech.com>
Date: 星期一, 06 一月 2025 16:23:18 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue | 304 +++++++++++++++++++++++++++++++-------------------
1 files changed, 190 insertions(+), 114 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue
index 2199e65..b403bec 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue
@@ -2,43 +2,59 @@
<el-container>
<el-aside>
<basic-container>
- <div ref="TreeBox" style="height: calc(100vh - 144px);!important;">
- <div class="headerCon">
- <el-button v-if="permissionList.addBtn" icon="el-icon-plus" plain size="small" type="primary" @click="addTreeClickHandler">鍒涘缓
- </el-button>
- <el-button v-if="permissionList.editBtn" icon="el-icon-edit" plain size="small" type="primary" @click="editTreeClickHandler">淇敼
- </el-button>
- <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="danger" @click="delTreeClickHandler">鍒犻櫎
- </el-button>
- <el-button v-if="permissionList.importBtn" icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">瀵煎叆
- </el-button>
- <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭
- </el-button>
- </div>
- <!-- 宸︿晶鏍� -->
- <div style="height: calc(100vh - 280px);">
- <avue-tree
- ref="tree"
- v-model="treeForm"
- :data="treeData"
- :option="treeOption"
- @save="rowTreeSaveHandler"
- @update="rowTreeUpdataHandler"
- @node-click="nodeClick">
+ <!-- 宸︿晶鏍� -->
+ <div style="height: calc(100vh - 150px);">
+ <avue-tree
+ ref="tree"
+ v-model="treeForm"
+ :data="treeData"
+ :option="treeOption"
+ @node-click="nodeClick">
<span slot-scope="{ node, data }" class="el-tree-node__label">
- <span>
- <i class="el-icon-s-promotion"></i>
+ <span style="display: flex">
+ <icon-show :name="data.icon"></icon-show>
{{ (node || {}).label }}
</span>
</span>
- </avue-tree>
- </div>
+ </avue-tree>
</div>
</basic-container>
</el-aside>
<el-main>
- <basic-container>
+ <basic-container v-show="treeNodeRow.id === 'root' ">
+ <div>
+ <avue-crud
+ ref="treeCrud"
+ v-model="treeForm"
+ :data="treeData[0].children"
+ :option="treeCrudOption"
+ @row-del="rowTreeDelHandler"
+ @row-save="rowTreeSaveHandler"
+ @row-update="rowTreeUpdataHandler"
+ @refresh-change="handleRefresh">
+ <template slot="menuLeft">
+ <el-button v-if="permissionList.addBtn" icon="el-icon-plus" plain size="small" type="primary" @click="addTreeClickHandler(treeNodeRow)">鍒涘缓
+ </el-button>
+ <!--<el-button v-if="permissionList.editBtn" icon="el-icon-edit" plain size="small" type="primary" @click="editTreeClickHandler">淇敼
+ </el-button>
+ <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="danger" @click="delTreeClickHandler">鍒犻櫎
+ </el-button>-->
+ <el-button v-if="permissionList.importBtn" icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">瀵煎叆
+ </el-button>
+ <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭
+ </el-button>
+ </template>
+ <template #menu="{ row, size }">
+ <el-button v-if="permissionList.addBtn" :size="size" icon="el-icon-plus"
+ text
+ type="text"
+ @click="addTreeClickHandler(row)">鏂板瀛愮骇</el-button>
+ </template>
+ </avue-crud>
+ </div>
+ </basic-container>
+ <basic-container v-show="treeNodeRow.id !== 'root'">
<div>
<avue-crud
ref="crud"
@@ -55,6 +71,14 @@
@refresh-change="handleRefresh"
@selection-change="selectChangeHandler"
@row-click="rowClickHandler">
+ <template slot="plImage" slot-scope="{row}">
+ <span class="avue-icon">
+ <icon-show :name="row.plImage"></icon-show>
+ </span>
+ </template>
+ <template slot-scope="{type,disabled}" slot="plImageForm">
+ <input-icon :disabled="disabled" v-model="form.plImage"></input-icon>
+ </template>
<template slot="plTypeType" slot-scope="{row}">
<el-tag :type="row.plTypeType === 'business' ? '' : 'success'">
{{ row.plTypeType === 'business' ? '涓氬姟绫诲瀷' : '閾炬帴绫诲瀷' }}
@@ -159,66 +183,15 @@
treeNodeRow: {},
treeForm: {},
treeOption: {
- addBtn: false,
+ menu: false,
defaultExpandedKeys: ['root'],
props: {
label: 'name',
value: 'id',
- children: 'childs'
- },
- dialogWidth:'800',
- dialogMenuPosition: 'right',
- formOption: {
- dialogMenuPosition: 'right',
- column: [
- {
- label: '鍒嗙被鍚嶇О',
- prop: 'name',
- rules: [
- {
- required: true,
- message: '璇疯緭鍏ュ垎绫诲悕绉�',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '鍒嗙被搴忓彿',
- prop: 'serialno',
- rules: [
- {
- required: true,
- message: '璇疯緭鍏ュ垎绫诲簭鍙�',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '鍒涘缓鑰�',
- prop: 'creator',
- disabled: true,
- },
- {
- label: '鍒涘缓鏃堕棿',
- prop: 'createTime',
- disabled: true,
- },
- {
- label: '鐖朵富绫�',
- prop: 'pidName',
- disabled: true,
- span:24
- },
- {
- label: '澶囨敞',
- prop: 'description',
- type:'textarea',
- span:24
- },
- ],
+ children: 'children'
}
},
- treeData: [],
+ treeData: []
}
},
computed:{
@@ -239,6 +212,50 @@
actionBottomEditBtn: this.vaildData(this.permission[this.$route.query.id].actionBottomEdit, false),
};
},
+ treeCrudOption(){
+ return {
+ ...basicOption,
+ editBtn: this.permissionList.editBtn,
+ delBtn: this.permissionList.delBtn,
+ addBtn: false,
+ calcHeight: -50,
+ highlightCurrentRow: true,
+ rowKey: 'id',
+ rowParentKey: 'pid',
+ menuWidth: 300,
+ span: 24,
+ labelWidth: 100,
+ dialogWidth: '800',
+ align:'left',
+ column: [{
+ label: '鍒嗙被鍚嶇О',
+ prop: 'name',
+ rules: [{
+ required: true,
+ message: '璇疯緭鍏ュ垎绫诲悕绉�',
+ trigger: 'blur'
+ }]
+ }, {
+ label: '鍒嗙被搴忓彿',
+ prop: 'serialno',
+ rules: [{
+ required: true,
+ message: '璇疯緭鍏ュ垎绫诲簭鍙�',
+ trigger: 'blur'
+ }]
+ }, {
+ label: '鐖朵富绫�',
+ prop: 'pidName',
+ disabled: true,
+ span: 24
+ }, {
+ label: '澶囨敞',
+ prop: 'description',
+ type: 'textarea',
+ span: 24
+ }],
+ }
+ },
option() {
return {
...basicOption,
@@ -255,6 +272,7 @@
{
label: '缂栧彿',
prop: 'plCode',
+ width: 220,
overHidden: true,
search: true,
rules: [
@@ -279,6 +297,18 @@
]
},
{
+ label: '鍥炬爣',
+ prop: 'plImage',
+ width: 80,
+ rules: [
+ {
+ required: true,
+ message: '璇烽�夋嫨鍥炬爣',
+ trigger: 'blur'
+ }
+ ]
+ },
+ {
label: '鍒嗙被',
prop: 'plActionCls',
type: 'tree',
@@ -286,7 +316,7 @@
props: {
label: 'name',
value: 'id',
- children: 'childs'
+ children: 'children'
},
rules: [
{
@@ -297,13 +327,13 @@
],
dicData: []
},
- {
+ /*{
label: 'C/S绫昏矾寰�',
prop: 'plCSClass',
- search: true,
+ hide:true,
searchLabelWidth:120,
overHidden: true,
- },
+ },*/
{
label: 'B/S閾炬帴鍦板潃',
prop: 'plBSUrl',
@@ -348,12 +378,11 @@
addBtn: false,
editBtn:this.permissionList.actionBottomEditBtn,
delBtn:this.permissionList.actionBottomDelBtn,
- calcHeight: -30,
+ calcHeight: -20,
selection: false,
refreshBtn: false,
dialogWidth:'700',
saveBtn:false,
- // height:'auto',
column: [
{
label: '鍙傛暟鍚嶇О',
@@ -392,19 +421,33 @@
}
getActionTree(params).then(res => {
const data = res.data.obj;
- this.treeData = [data];
+ this.treeData = this.treeDataFormAtter([data],'Action鍒嗙被');
const selectTreeData = this.option.column.find(item => item.prop === 'plActionCls'); // 鎵惧埌action娣诲姞鍒嗙被鏍�
- const dicData=[data];
+ const dicData=this.treeData;
dicData[0].disabled=true;//鏍硅妭鐐逛笉鑳介��
selectTreeData.dicData = dicData;
})
},
+ treeDataFormAtter(items,pidName) {
+ return items.map(item => {
+ // 杞崲褰撳墠鑺傜偣鐨勫睘鎬�
+ const formList = {
+ ...item,
+ pidName:pidName,
+ children: item.childs && item.childs.length > 0 ? this.treeDataFormAtter(item.childs,item.name) : undefined
+ };
+ return formList;
+ });
+ },
+
// 宸︿晶鏍戣鐐瑰嚮
nodeClick(row) {
this.treeNodeRow = row;
- this.getRightTableList(row);
- this.bottomData = [];
+ if(this.treeNodeRow.id !== 'root'){
+ this.getRightTableList(row);
+ this.bottomData = [];
+ }
},
// 澶撮儴鍒锋柊鎸夐挳
@@ -417,7 +460,6 @@
// 鍙充晶琛ㄦ牸淇℃伅
getRightTableList(row) {
- console.log(row);
this.tableLoading = true;
const params = {
plactioncls: row.id ? row.id : ''
@@ -445,7 +487,7 @@
this.lastIndex = newIndex;
},
() => {
- this.selectList = [];
+ this.selectList = [row];
}
);
@@ -485,13 +527,12 @@
beforeOpen(done, type, loading) {
if ([ 'edit'].includes(type)) {
// 缂栬緫閫昏緫
- this.$set(this.option.column[2],'disabled',false);
+ this.$set(this.option.column[3],'disabled',false);
} else {
// 鏂板閫昏緫
- this.$set(this.option.column[2],'disabled',true);
+ this.$set(this.option.column[3],'disabled',true);
}
done();
- console.log(this.option.column)
},
// action鍒楄〃澧炲姞
addClickHandler() {
@@ -565,9 +606,7 @@
exportAction(params).then(res => {
func.downloadFileByBlobHandler(res);
this.$message.success('瀵煎嚭鎴愬姛');
- }).catch(err => {
- this.$message.error(err);
- })
+ });
},
// action鍒楄〃琛屽垹闄�
@@ -674,27 +713,31 @@
},
// 宸︿晶鏍戝垱寤�
- addTreeClickHandler() {
- if (func.isEmptyObject(this.treeNodeRow)) {
+ addTreeClickHandler(row) {
+ let parentRow=row;
+ if(!row || !row.id){
+ parentRow=this.treeNodeRow
+ }
+ if (func.isEmptyObject(parentRow)) {
this.$message.error('璇烽�夋嫨涓�鏉″垎绫昏繘琛屾坊鍔�');
return;
}
- if (!this.treeNodeRow.id && this.treeNodeRow.name=='鏈垎绫�') {
+ if (!parentRow.id && parentRow.name=='鏈垎绫�') {
this.$message.error('鏈垎绫讳笅涓嶈兘鍒涘缓瀛愬垎绫�');
return;
}
- const {createTime, creator, name, id, description} = this.treeNodeRow;
+ const {createTime, creator, name, id, description} = parentRow;
this.$set(this.treeForm, 'createTime', func.formattedDate(createTime));
this.$set(this.treeForm, 'creator', creator);
this.$set(this.treeForm, 'pid', id);
this.$set(this.treeForm, 'pidName', name);
- this.$refs.tree.rowAdd();
+ this.$refs.treeCrud.rowAdd();
},
// action鍒嗙被淇濆瓨
- rowTreeSaveHandler(node, data, done, loading) {
- saveActionCls(data).then(res => {
+ rowTreeSaveHandler(row, done, loading) {
+ saveActionCls(row).then(res => {
if (res.data.code === 200) {
this.$message.success('鍒嗙被鍒涘缓鎴愬姛');
this.getTreeList();
@@ -730,15 +773,15 @@
this.$set(this.treeForm, 'pidName', pidName);
this.$set(this.treeForm, 'description', description);
- this.$refs.tree.rowEdit();
+ this.$refs.treeCrud.rowEdit();
},
// action鍒嗙被淇敼淇濆瓨
- rowTreeUpdataHandler(node, data, done, loading) {
- updateActionCls(data).then(res => {
+ rowTreeUpdataHandler(row, done, loading) {
+ updateActionCls(row).then(res => {
if (res.data.code === 200) {
this.$message.success('淇敼鎴愬姛');
- //this.getBottomList();
+ this.getTreeList();
}
done();
})
@@ -759,6 +802,32 @@
}
}
return 'null';
+ },
+
+ // action鍒嗙被淇敼淇濆瓨
+ rowTreeDelHandler( row) {
+ if (row.id === 'root') {
+ this.$message.error('鏍硅妭鐐逛笉鑳藉垹闄�');
+ return;
+ }
+
+ this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎褰撳墠鏁版嵁鍚楋紵', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteActionCls(row).then(res => {
+ if (res.data.code === 200) {
+ this.$message.success('鍒嗙被鍒犻櫎鎴愬姛');
+ this.getTreeList();
+ }
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
},
// action鍒嗙被鍒犻櫎
@@ -794,12 +863,18 @@
// action鍒嗙被瀵煎嚭
exportClickHandler() {
-
+ this.$message({
+ type: 'info',
+ message: '寰呭疄鐜�'
+ });
},
// action鍒嗙被瀵煎叆
uploadClickHandler() {
-
+ this.$message({
+ type: 'info',
+ message: '寰呭疄鐜�'
+ });
}
}
@@ -811,8 +886,9 @@
.el-scrollbar__wrap {
overflow: auto !important;
}
+
.avue-dialog .el-dialog__body .avue-form{
- margin: 0 auto;
+ margin: 0 auto !important;
}
}
</style>
--
Gitblit v1.9.3