From d186b4d37394e4816e0f271fcced4d06b3069454 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期一, 16 十二月 2024 15:31:28 +0800
Subject: [PATCH] 路由query添加当前页面id&&人员组织管理模块下所有页面按钮权限控制
---
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue | 181 ++++++++++++++++++++++++++++++++++++++------
1 files changed, 155 insertions(+), 26 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue
index e5e94e5..83f30a9 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue
@@ -55,12 +55,6 @@
<el-input v-model="topName" placeholder="璇疯緭鍏ュ唴瀹�" size="mini" style="margin-right: 10px;"></el-input>
<el-button plain size="mini" type="success" @click="nameSearchHandler">鏌ヨ</el-button>
</span>
- <span style="display: flex; align-items: center;">
- <p
- style="display: flex; align-items: center; margin: 0 10px 0 0;flex-shrink: 0;font-size: 14px">鍏嬮殕鐩爣锛�</p>
- <el-input v-model="input" placeholder="璇疯緭鍏ュ唴瀹�" size="mini" style="margin-right: 10px;"></el-input>
- <el-button plain size="mini" type="success">鍏嬮殕鐩爣</el-button>
- </span>
</div>
</template>
<template slot="menu" slot-scope="scope">
@@ -72,12 +66,45 @@
</avue-crud>
</basic-container>
</el-main>
- <form-dialog ref="formDialog" :TreeNodeRow="this.nodeRow" :treeRadio="treeRadio" :editRow="editRow"></form-dialog>
+ <form-dialog ref="formDialog" :TreeNodeRow="this.nodeRow" :editRow="editRow" :treeRadio="treeRadio"
+ @updataTable="getRightPortalVIDatas"></form-dialog>
<table-dialog ref="tableDialog" :TreeNodeRow="this.nodeRow" :treeRadio="treeRadio"
@updataTable="getRightPortalVIDatas"></table-dialog>
<!-- 瀵煎叆 -->
<upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆"
@updata="getRightPortalVIDatas"></upload-file>
+ <el-dialog
+ v-dialogDrag
+ :visible.sync="cloneVisible"
+ append-to-body="true"
+ class="avue-dialog"
+ title="鍏嬮殕"
+ width="50%">
+ <basic-container>
+ <div ref="TreeBox" style="height: calc(100vh - 294px);!important;">
+ <!-- 宸︿晶鏍� -->
+ <div style="height: calc(100vh - 370px);">
+ <div style="margin-bottom: 10px;display: flex;justify-content: center">
+ <el-radio v-model="cloneTreeRadio" label="0" @input="cloneTreeRadioChange">涓氬姟绫诲瀷鏍�</el-radio>
+ <el-radio v-model="cloneTreeRadio" label="1" @input="cloneTreeRadioChange">閾炬帴绫诲瀷鏍�</el-radio>
+ </div>
+ <avue-tree ref="cloneTree" v-loading="cloneTreeLoading" :data="cloneTreeData" :option="treeOption"
+ @node-click="cloneTreeNodeClick">
+ <span slot-scope="{ node, data }" class="el-tree-node__label">
+ <span style="font-size: 15px">
+ <i class="el-icon-s-promotion"></i>
+ {{ (node || {}).label }}
+ </span>
+ </span>
+ </avue-tree>
+ </div>
+ </div>
+ </basic-container>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="cloneVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="cloneSaveHandler">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
</el-container>
</template>
@@ -85,7 +112,7 @@
import basicOption from "@/util/basic-option";
import FormDialog from "@/views/modelingMenu/ui/formDefine/components/formDialog";
import TableDialog from "@/views/modelingMenu/ui/formDefine/components/tableDialog";
-import {gridPortalVIDatas, getPortalVIById, deleteByIds, exportExcel} from "@/api/UI/formDefine/api";
+import {gridPortalVIDatas, getPortalVIById, deleteByIds, exportExcel, clone} from "@/api/UI/formDefine/api";
import {getBizTypes} from "@/api/modeling/businessType/api";
import {gridLink} from "@/api/modeling/linkType/api";
import func from "@/util/func";
@@ -95,6 +122,11 @@
components: {FormDialog, TableDialog},
data() {
return {
+ cloneTreeNode: {},
+ cloneTreeRadio: '0',
+ cloneTreeData: [],
+ cloneTreeLoading: false,
+ cloneVisible: false,
tipList: [
"瀵煎叆涓氬姟绫诲瀷鍚嶇О涓嶅彲涓虹┖",
"瀵煎叆鍚嶇О涓嶅彲涓虹┖涓斿悕绉板彧鑳戒负鑻辨枃瀛楁瘝",
@@ -149,7 +181,7 @@
},
dbClickList: [],
defaultData: [], // 鐢ㄤ簬鏌ヨ鎭㈠鍘熷鍊�,
- editRow:{},
+ editRow: {},
}
},
created() {
@@ -173,8 +205,9 @@
this.$refs.formDialog.getTreeList();
} else {
this.$refs.tableDialog.visible = true;
- this.$refs.tableDialog.getDbList();
- this.$refs.tableDialog.getSearchSelectList();
+ this.$refs.tableDialog.getDbList(); // 鍙屽嚮鎿嶄綔涓嬫媺鎺ュ彛
+ this.$refs.tableDialog.getSearchSelectList(); // 閫夋嫨琛ㄥ崟涓嬫媺鎺ュ彛
+ this.$refs.tableDialog.getFormSelect(); // 鏌ヨ妯℃澘涓嬫媺鎺ュ彛
}
},
@@ -190,7 +223,7 @@
this.treeData = data;
this.treeLoading = false;
}).catch(error => {
- loading.close();
+ this.treeLoading = false;
});
},
@@ -233,7 +266,6 @@
// 宸︿晶鏍戠偣鍑�
nodeClick(row) {
- console.log(row);
this.tableRadio = null;
this.nodeRow = row;
this.getRightPortalVIDatas(row);
@@ -280,7 +312,6 @@
// 缂栬緫鎸夐挳
editBtnClick(row) {
- console.log('row',row);
// 琛ㄦ牸
if (row.viType === 0) {
const params = {
@@ -299,14 +330,19 @@
// 鏇存柊琛ㄥ崟
this.$refs.tableDialog.form = {
...prmItem,
+ itemFieldWidthList: prmItem.itemFieldWidthList.map(item => {
+ return {
+ ...item,
+ $cellEdit: true,
+ }
+ }),
viName: res.data.obj.viName,
+ itemQtName: res.data.obj.prm.formQtName,
editNodeId: row.id,
- itemOutFieldList: (prmItem.itemOutFieldList || []).map(item => ({id: item})),
+ itemOutFieldList: (prmItem.itemOutFieldList || []),
itemSearchFieldList: (prmItem.itemSearchFieldList || []).map(item => ({id: item})),
- itemKeyFieldList: (prmItem.itemKeyFieldList || []).map(item => ({id: item})),
- searchLabel: prmItem.itemSeniorQueryCols || '',
- searchNumber: prmItem.itemSeniorQueryColsCounts || '1',
- searchSql: prmItem.itemQuerySql || '',
+ itemKeyFieldList: (prmItem.itemKeyFieldList || []),
+ searchNumber: '1',
itemFileWidthSelect: (prmItem.itemFieldWidthList && prmItem.itemFieldWidthList.length > 0) ? prmItem.itemFieldWidthList[0].key : '',
itemWidth: (prmItem.itemFieldWidthList && prmItem.itemFieldWidthList.length > 0) ? prmItem.itemFieldWidthList[0].value : '250'
};
@@ -315,9 +351,6 @@
const [width = '0', height = '0'] = (prmItem.itemImgWH || '0,0').split(',');
this.$refs.tableDialog.itemImgWidth = width;
this.$refs.tableDialog.itemImgHeight = height;
-
- // 鍙屽嚮鎿嶄綔鑾峰彇鏁版嵁鏂规硶
- this.$refs.tableDialog.getDbList();
// 鏄剧ず瀵硅瘽妗�
this.$refs.tableDialog.visible = true;
@@ -343,9 +376,9 @@
this.$refs.formDialog.formList = updatedData;
this.$refs.formDialog.getTreeList();
this.$refs.formDialog.topForm.viName = res.data.obj.viName;
+ this.$refs.formDialog.topForm.itemQtName = res.data.obj.prm.formQtName;
this.$refs.formDialog.topForm.columnNumber = this.getValueBasedOnInput(res.data.obj.prm.showCols);
this.$refs.formDialog.topForm.showColumn = res.data.obj.prm.showCols;
-
this.$refs.formDialog.visible = true;
}
})
@@ -381,12 +414,13 @@
// 鍚嶇О鏌ヨ
nameSearchHandler() {
if (!this.topName) {
- this.data = this.defaultData;
+ this.getRightPortalVIDatas();
return;
}
- const list = this.data.filter(item => item.viName.includes(this.topName.trim()));
+ const list = this.defaultData.filter(item => item.viName.includes(this.topName.trim()));
this.data = list;
+ this.page.total = this.data.length;
},
// 鍒犻櫎鎸夐挳
@@ -457,7 +491,7 @@
this.$refs.upload.visible = true;
},
- // 瀵煎嚭
+ // 鍏嬮殕
copyClickHandler() {
if (this.selectList.length <= 0) {
this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�');
@@ -468,6 +502,101 @@
this.$message.error('鍙兘閫夋嫨涓�鏉℃暟鎹�');
return;
}
+
+ this.cloneVisible = true;
+ this.cloneTreeLoading = true;
+ getBizTypes().then(res => {
+ const data = res.data.data.map(item => {
+ this.processChildren(item); // 澶勭悊姣忎釜鑺傜偣
+ item.attributes.id = item.attributes.id;
+ return item.attributes; // 杩斿洖澶勭悊鍚庣殑 attributes
+ });
+ this.cloneTreeData = data;
+ this.cloneTreeLoading = false;
+ }).catch(error => {
+ this.cloneTreeLoading = false;
+ });
+ },
+
+ // 鍏嬮殕鏍戠偣鍑�
+ cloneTreeNodeClick(row) {
+ this.cloneTreeNode = row;
+ },
+
+ // 鍏嬮殕鏍戠被鍨嬪垏鎹�
+ cloneTreeRadioChange(val) {
+ this.cloneTreeLoading = true;
+ if (val === "0") {
+ getBizTypes().then(res => {
+ const data = res.data.data.map(item => {
+ this.processChildren(item); // 澶勭悊姣忎釜鑺傜偣
+ item.attributes.id = item.attributes.id;
+ return item.attributes; // 杩斿洖澶勭悊鍚庣殑 attributes
+ });
+ this.cloneTreeData = data;
+ this.cloneTreeLoading = false;
+ });
+ } else {
+ gridLink().then(res => {
+ const data = res.data.data.map(item => {
+ item.id = item.name;
+ return item;
+ });
+ this.cloneTreeData = data;
+ this.cloneTreeLoading = false;
+ })
+ }
+ },
+
+ // 鏌ヨ琛ㄦ牸鏁版嵁璇︽儏
+ searchDetail() {
+ return new Promise((resolve, reject) => {
+ const params = {
+ id: this.selectList[0].id,
+ viType: this.selectList[0].viType
+ };
+ getPortalVIById(params).then(res => {
+ const obj = res.data.obj;
+ resolve(obj);
+ }).catch(error => {
+ reject(error);
+ });
+ });
+ },
+
+ // 鍏嬮殕淇濆瓨
+ async cloneSaveHandler() {
+ if (func.isEmptyObject(this.cloneTreeNode)) {
+ this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹繘琛屽厠闅�');
+ return;
+ }
+ const obj = await this.searchDetail();
+ this.$prompt('璇疯緭鍏ュ厠闅嗘枃浠跺悕绉�', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ }).then(({value}) => {
+ const params = {
+ clonePortalVIDTOList: [
+ {
+ viName: value,
+ typeName: this.cloneTreeRadio === '0' ? this.cloneTreeNode.id : this.cloneTreeNode.name,
+ typeFlag: this.cloneTreeRadio,
+ oldPortalVIDTO: {...obj}
+ }
+ ],
+ }
+ clone(params).then(res => {
+ if (res.data.code === 200) {
+ this.$message.success('鍏嬮殕鎴愬姛');
+ this.cloneVisible = false;
+ }
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '鍙栨秷杈撳叆'
+ });
+ });
}
}
}
--
Gitblit v1.9.3