From d8d03861a07ac549e58ed8adb08cdec3f75d5c50 Mon Sep 17 00:00:00 2001
From: wangting <wangting@vci-tech.com>
Date: 星期四, 26 十二月 2024 16:20:56 +0800
Subject: [PATCH] 序列和选择框取消固定列
---
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue | 357 ++++++++++++++++++++++++++++++++++++----------------------
1 files changed, 221 insertions(+), 136 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 6b235af..26189cb 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
@@ -1,19 +1,18 @@
<template>
<el-container>
-
<el-aside>
<basic-container>
<div ref="TreeBox" style="height: calc(100vh - 144px);!important;">
<div class="headerCon">
- <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addTreeClickHandler">鍒涘缓
+ <el-button v-if="permissionList.addBtn" icon="el-icon-plus" plain size="small" type="primary" @click="addTreeClickHandler">鍒涘缓
</el-button>
- <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editTreeClickHandler">淇敼
+ <el-button v-if="permissionList.editBtn" icon="el-icon-edit" plain size="small" type="primary" @click="editTreeClickHandler">淇敼
</el-button>
- <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delTreeClickHandler">鍒犻櫎
+ <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="danger" @click="delTreeClickHandler">鍒犻櫎
</el-button>
- <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭
+ <el-button v-if="permissionList.importBtn" icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">瀵煎叆
</el-button>
- <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">瀵煎叆
+ <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭
</el-button>
</div>
<!-- 宸︿晶鏍� -->
@@ -27,7 +26,7 @@
@update="rowTreeUpdataHandler"
@node-click="nodeClick">
<span slot-scope="{ node, data }" class="el-tree-node__label">
- <span style="font-size: 15px">
+ <span>
<i class="el-icon-s-promotion"></i>
{{ (node || {}).label }}
</span>
@@ -46,8 +45,8 @@
v-model="form"
:data="data"
:option="option"
- :page.sync="page"
:table-loading="tableLoading"
+ :before-open="beforeOpen"
@row-del="rowDelHandler"
@row-save="rowSaveHandler"
@row-update="rowUpdateHandler"
@@ -62,10 +61,10 @@
</el-tag>
</template>
<template slot="menuLeft" slot-scope="scope">
- <el-button v-if="treeNodeRow.id !== 'root'" icon="el-icon-plus" plain size="small" type="primary"
+ <el-button v-if="treeNodeRow.id !== 'root' && permissionList.actionTopAddBtn" icon="el-icon-plus" plain size="small" type="primary"
@click="addClickHandler">澧炲姞
</el-button>
- <el-button icon="el-icon-download" plain size="small" type="success" @click="downLoadHandler">瀵煎嚭
+ <el-button v-if="permissionList.actionTopExportBtn" icon="el-icon-download" plain size="small" type="success" @click="downLoadHandler">瀵煎嚭
</el-button>
</template>
</avue-crud>
@@ -74,6 +73,7 @@
<div style="margin-top: 10px">
<avue-crud
ref="BottomCrud"
+ v-model="bottomForm"
:data="bottomData"
:option="bottomOption"
:table-loading="bottomTableLoading"
@@ -82,10 +82,21 @@
@row-del="BottomRowDelHandler"
>
<template slot="menuLeft" slot-scope="scope">
- <el-button icon="el-icon-plus" plain size="small" type="primary" @click="bottomAddClickHandler">澧炲姞
+ <el-button v-if="permissionList.actionBottomAddBtn" icon="el-icon-plus" plain size="small" type="primary" @click="bottomAddClickHandler">澧炲姞
</el-button>
</template>
-
+ <template slot="menuForm" slot-scope="scope">
+ <el-button type="primary"
+ size="small"
+ icon="el-icon-check"
+ v-if="scope.type === 'add'"
+ @click="handleSaveNext()">淇濆瓨鍚庣户缁坊鍔�</el-button>
+ <el-button type="primary"
+ size="small"
+ icon="el-icon-circle-plus-outline"
+ v-if="scope.type === 'add'"
+ @click="$refs.BottomCrud.rowSave()">淇濆瓨</el-button>
+ </template>
</avue-crud>
</div>
</basic-container>
@@ -122,6 +133,7 @@
} from '@/api/UI/Action/api'
import func from "@/util/func";
import basicOption from "@/util/basic-option";
+import {mapGetters} from "vuex";
export default {
name: "index",
@@ -138,49 +150,107 @@
rightRoleData: [],
form: {},
bottomTableLoading: false,
+ bottomForm:{},
bottomData: [],
- bottomOption: {
- ...basicOption,
- addBtn: false,
- calcHeight: -30,
- selection: false,
- refreshBtn: false,
- // height:'auto',
- column: [
- {
- label: '鍙傛暟鍚嶇О',
- prop: 'name',
- rules: [
- {
- required: true,
- message: '璇疯緭鍏ュ弬鏁板悕绉�',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '榛樿鍊�',
- prop: 'defaultValue',
- },
- {
- label: '鎻愮ず淇℃伅',
- prop: 'description',
- span: 24,
- type: 'textarea',
- rows: 4
- },
- ],
- },
tableLoading: false,
lastIndex: null,
selectList: [],
data: [],
- option: {
+ treeNodeRow: {},
+ treeForm: {},
+ treeOption: {
+ addBtn: 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
+ },
+ ],
+ }
+ },
+ treeData: [],
+ }
+ },
+ computed:{
+ ...mapGetters(["permission"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false),
+ delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
+ editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false),
+ exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false),
+ importBtn: this.vaildData(this.permission[this.$route.query.id].IMPORT, false),
+ actionTopAddBtn: this.vaildData(this.permission[this.$route.query.id].actionTopAdd, false),
+ actionTopDelBtn: this.vaildData(this.permission[this.$route.query.id].actionTopDel, false),
+ actionTopEditBtn: this.vaildData(this.permission[this.$route.query.id].actionTopEdit, false),
+ actionTopExportBtn: this.vaildData(this.permission[this.$route.query.id].actionTopExport, false),
+ actionBottomAddBtn: this.vaildData(this.permission[this.$route.query.id].actionBottomAdd, false),
+ actionBottomDelBtn: this.vaildData(this.permission[this.$route.query.id].actionBottomDel, false),
+ actionBottomEditBtn: this.vaildData(this.permission[this.$route.query.id].actionBottomEdit, false),
+ };
+ },
+ option() {
+ return {
...basicOption,
+ editBtn:this.permissionList.actionTopEditBtn,
+ delBtn:this.permissionList.actionTopDelBtn,
addBtn: false,
height: 350,
highlightCurrentRow: true,
menuWidth:160,
+ span:24,
+ labelWidth:100,
+ dialogWidth:'700',
column: [
{
label: '缂栧彿',
@@ -209,13 +279,6 @@
]
},
{
- label: 'C/S绫昏矾寰�',
- prop: 'plCSClass',
- search: true,
- searchLabelWidth:120,
- overHidden: true,
- },
- {
label: '鍒嗙被',
prop: 'plActionCls',
type: 'tree',
@@ -235,6 +298,13 @@
dicData: []
},
{
+ label: 'C/S绫昏矾寰�',
+ prop: 'plCSClass',
+ search: true,
+ searchLabelWidth:120,
+ overHidden: true,
+ },
+ {
label: 'B/S閾炬帴鍦板潃',
prop: 'plBSUrl',
search: true,
@@ -245,7 +315,7 @@
label: '绫诲瀷',
prop: 'plTypeType',
search: true,
- type: 'select',
+ type: 'radio',
width:100,
dicData: [{
label: '涓氬姟绫诲瀷',
@@ -267,66 +337,48 @@
prop: 'plDesc',
search: true,
overHidden: true,
+ type: 'textarea'
},
]
- },
- treeNodeRow: {},
- treeForm: {},
- treeOption: {
+ }
+ },
+ bottomOption(){
+ return {
+ ...basicOption,
addBtn: false,
- defaultExpandedKeys: ['root'],
- props: {
- label: 'name',
- value: 'id',
- children: 'childs'
- },
- formOption: {
- column: [
- {
- label: '鍒嗙被鍚嶇О',
- prop: 'name',
- rules: [
- {
- required: true,
- message: '璇疯緭鍏ュ垎绫诲悕绉�',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '鍒嗙被搴忓彿',
- prop: 'serialno',
- rules: [
- {
- required: true,
- message: '璇疯緭鍏ュ垎绫诲簭鍙�',
- trigger: 'blur'
- }
- ]
- },
- {
- label: '鍒涘缓鑰�',
- prop: 'creator',
- readonly: true,
- },
- {
- label: '鍒涘缓鏃堕棿',
- prop: 'createTime',
- readonly: true,
- },
- {
- label: '鐖朵富绫�',
- prop: 'pidName',
- readonly: true,
- },
- {
- label: '澶囨敞',
- prop: 'description'
- },
- ],
- }
- },
- treeData: [],
+ editBtn:this.permissionList.actionBottomEditBtn,
+ delBtn:this.permissionList.actionBottomDelBtn,
+ calcHeight: -30,
+ selection: false,
+ refreshBtn: false,
+ dialogWidth:'700',
+ saveBtn:false,
+ // height:'auto',
+ column: [
+ {
+ label: '鍙傛暟鍚嶇О',
+ prop: 'name',
+ rules: [
+ {
+ required: true,
+ message: '璇疯緭鍏ュ弬鏁板悕绉�',
+ trigger: 'blur'
+ }
+ ]
+ },
+ {
+ label: '榛樿鍊�',
+ prop: 'defaultValue',
+ },
+ {
+ label: '鎻愮ず淇℃伅',
+ prop: 'description',
+ span: 24,
+ type: 'textarea',
+ rows: 4
+ },
+ ],
+ }
}
},
created() {
@@ -365,9 +417,10 @@
// 鍙充晶琛ㄦ牸淇℃伅
getRightTableList(row) {
+ console.log(row);
this.tableLoading = true;
const params = {
- plactioncls: row.id
+ plactioncls: row.id ? row.id : ''
}
getActionTableData(params).then(res => {
const data = res.data.data;
@@ -408,7 +461,7 @@
}
this.tableLoading = true;
const apiParams = {
- plactioncls: this.treeNodeRow.id === 'root' ? '' : this.treeNodeRow.id,
+ plactioncls: this.treeNodeRow.id === 'root' ? '' : this.treeNodeRow.id ? this.treeNodeRow.id : '',
...params
}
@@ -429,6 +482,17 @@
this.getRightTableList(this.treeNodeRow);
},
+ beforeOpen(done, type, loading) {
+ if ([ 'edit'].includes(type)) {
+ // 缂栬緫閫昏緫
+ this.$set(this.option.column[2],'disabled',false);
+ } else {
+ // 鏂板閫昏緫
+ this.$set(this.option.column[2],'disabled',true);
+ }
+ done();
+ console.log(this.option.column)
+ },
// action鍒楄〃澧炲姞
addClickHandler() {
if (func.isEmptyObject(this.treeNodeRow)) {
@@ -473,29 +537,24 @@
this.leftRoleData = [{
name: '缂栧彿',
oid: '缂栧彿'
- },
- {
- name: '绫昏矾寰�',
- oid: '绫昏矾寰�'
- },
- {
- name: '閾炬帴鍦板潃',
- oid: '閾炬帴鍦板潃'
- },
- {
- name: '绫诲瀷',
- oid: '绫诲瀷'
- },
- {
- name: '鎻忚堪',
- oid: '鎻忚堪'
- },]
+ }, {
+ name: '绫昏矾寰�',
+ oid: '绫昏矾寰�'
+ }, {
+ name: '閾炬帴鍦板潃',
+ oid: '閾炬帴鍦板潃'
+ }, {
+ name: '绫诲瀷',
+ oid: '绫诲瀷'
+ }, {
+ name: '鎻忚堪',
+ oid: '鎻忚堪'
+ },]
this.$refs.transfer.visible = true;
},
// 绌挎妗嗕繚瀛� index涓�0鏄�夋嫨 1鏄叏閮�
exportSendHandler(row, index) {
- console.log(row, index);
const params = {
dataType: index,
chooseDataOid: index === 0 ? this.selectList.map(item => item.plOId) : [],
@@ -506,9 +565,7 @@
exportAction(params).then(res => {
func.downloadFileByBlobHandler(res);
this.$message.success('瀵煎嚭鎴愬姛');
- }).catch(err => {
- this.$message.error(err);
- })
+ });
},
// action鍒楄〃琛屽垹闄�
@@ -553,6 +610,7 @@
// 鍙傛暟鍒楄〃鏂板淇濆瓨
BottomRowSaveHandler(form, done, loading) {
+ form.actionOid=this.currenRow.plOId;
savePLActionParam(form).then(res => {
if (res.data.code === 200) {
this.$message.success('娣诲姞鎴愬姛');
@@ -562,7 +620,24 @@
})
loading();
},
+ handleSaveNext(){
+ this.$refs.BottomCrud.$refs.dialogForm.$refs.tableForm.$refs.form.validate((valid) => {
+ if (valid) {
+ this.bottomForm.actionOid=this.currenRow.plOId;
+ savePLActionParam(this.bottomForm).then(res => {
+ if (res.data.code === 200) {
+ this.$message.success('娣诲姞鎴愬姛');
+ this.bottomForm={};
+ this.getBottomList();
+ this.$refs.BottomCrud.$refs.dialogForm.$refs.tableForm.$refs.form.resetFields()
+ }
+ })
+ } else {
+ return false;
+ }
+ });
+ },
// 鍙傛暟鍒楄〃淇敼淇濆瓨
BottomRowUpdateHandler(row, index, done, loading) {
updatePLActionParam(row).then(res => {
@@ -602,7 +677,10 @@
this.$message.error('璇烽�夋嫨涓�鏉″垎绫昏繘琛屾坊鍔�');
return;
}
-
+ if (!this.treeNodeRow.id && this.treeNodeRow.name=='鏈垎绫�') {
+ this.$message.error('鏈垎绫讳笅涓嶈兘鍒涘缓瀛愬垎绫�');
+ return;
+ }
const {createTime, creator, name, id, description} = this.treeNodeRow;
this.$set(this.treeForm, 'createTime', func.formattedDate(createTime));
this.$set(this.treeForm, 'creator', creator);
@@ -619,8 +697,8 @@
this.$message.success('鍒嗙被鍒涘缓鎴愬姛');
this.getTreeList();
}
- done();
})
+ done();
loading();
},
@@ -635,6 +713,10 @@
this.$message.error('鏍硅妭鐐逛笉鑳戒慨鏀�');
return;
}
+ if (!this.treeNodeRow.id && this.treeNodeRow.name=='鏈垎绫�') {
+ this.$message.error('鏈垎绫讳笉鑳戒慨鏀�');
+ return;
+ }
const {name, serialno, creator, createTime, pid, description, id} = this.treeNodeRow;
const pidName = this.findObjectNameById(this.treeData, pid);
this.$set(this.treeForm, 'name', name);
@@ -654,7 +736,7 @@
updateActionCls(data).then(res => {
if (res.data.code === 200) {
this.$message.success('淇敼鎴愬姛');
- this.getBottomList();
+ //this.getBottomList();
}
done();
})
@@ -727,5 +809,8 @@
.el-scrollbar__wrap {
overflow: auto !important;
}
+ .avue-dialog .el-dialog__body .avue-form{
+ margin: 0 auto;
+ }
}
</style>
--
Gitblit v1.10.0