From 983ba566b009f1c9679ade8ea46be270c5b04875 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期三, 09 十月 2024 17:22:30 +0800
Subject: [PATCH] 整合代码
---
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue | 349 +++++++++++++++++++++----------------------------
Source/plt-web/plt-web-ui/src/api/UI/uiDefine.js | 53 +++++++
2 files changed, 200 insertions(+), 202 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/api/UI/uiDefine.js b/Source/plt-web/plt-web-ui/src/api/UI/uiDefine.js
index 2986312..f88763c 100644
--- a/Source/plt-web/plt-web-ui/src/api/UI/uiDefine.js
+++ b/Source/plt-web/plt-web-ui/src/api/UI/uiDefine.js
@@ -164,6 +164,28 @@
});
}
+// UI瀹氫箟涓嬫媺鏌ヨ
+export function getUILayoutDatasByPage(page, limit, params) {
+ return request({
+ url: "/api/uiManagerController/getUILayoutDatasByPage",
+ method: "get",
+ params: {
+ page,
+ limit,
+ ...params
+ }
+ });
+}
+
+// 涓嬫柟琛ㄦ牸鍒犻櫎
+export function delPageDefination(params) {
+ return request({
+ url: "/api/uiManagerController/delPageDefination",
+ method: "delete",
+ params
+ });
+}
+
// 鎸夐挳璁捐瀵硅瘽妗嗗乏渚ф爲鏌ヨ
export function getTabButtons(params) {
return request({
@@ -176,7 +198,7 @@
// 鎸夐挳璁捐瀵硅瘽妗嗘坊鍔�
export function addTapButton(params) {
return request({
- url: "/api/uiManagerController/addTapButton",
+ url: "/api/uiManagerController/addTabButton",
method: "post",
data:params
});
@@ -185,7 +207,34 @@
// 鎸夐挳璁捐瀵硅瘽妗嗘坊鍔�
export function updateTapButton(params) {
return request({
- url: "/api/uiManagerController/updateTapButton",
+ url: "/api/uiManagerController/updateTabButton",
+ method: "put",
+ data:params
+ });
+}
+
+// 鎸夐挳璁捐瀵硅瘽妗嗗垹闄�
+export function deleteTabButton(params) {
+ return request({
+ url: "/api/uiManagerController/deleteTabButton",
+ method: "delete",
+ data:params
+ });
+}
+
+// 鎸夐挳璁捐璋冩暣涓轰笅绾ф寜閽�
+export function joinBtn(params) {
+ return request({
+ url: "/api/uiManagerController/joinBtn",
+ method: "put",
+ data:params
+ });
+}
+
+// 鎸夐挳璁捐璋冩暣涓轰笂绾ф寜閽�
+export function exitBtn(params) {
+ return request({
+ url: "/api/uiManagerController/exitBtn",
method: "put",
data:params
});
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
index 961577c..6c8a6f5 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
@@ -3,6 +3,8 @@
<avue-crud
ref="crud"
v-model="form"
+ :before-close="beforeClose"
+ :before-open="beforeOpen"
:data="data"
:option="option"
:table-loading="tableLoading"
@@ -26,7 +28,8 @@
</el-button>
<el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">鍒犻櫎
</el-button>
- <el-button icon="el-icon-document-copy" size="small" type="text" @click="rowCloneHandler(scope.row)">鍏嬮殕</el-button>
+ <el-button icon="el-icon-document-copy" size="small" type="text" @click="rowCloneHandler(scope.row)">鍏嬮殕
+ </el-button>
</template>
<!-- eventKey浠ュ強eventValue鏄剧ず鍖哄煙 -->
@@ -46,7 +49,6 @@
</template>
</avue-crud>
</template>
-
<!-- 鍒囨崲鎼滅储绫诲瀷 婧愬璞� 鐩爣瀵硅薄鏄剧ずlabel鍒囨崲 -->
<template slot="showTypeLabel" slot-scope="{}">
@@ -78,9 +80,9 @@
</el-button>
<el-button :disabled="disabledBtn" plain size="mini" type="primary" @click="escClickBtnHandler">鍙栨秷
</el-button>
- <el-button plain size="mini" type="primary">璋冩暣涓轰笅绾ф寜閽�</el-button>
- <el-button plain size="mini" type="primary">璋冩暣涓轰笂绾ф寜閽�</el-button>
- <el-button plain size="mini" type="primary" @click="cloneClickBtnHandler">澶嶅埗鍒板叾浠栫粍浠�</el-button>
+ <el-button plain size="mini" type="primary" @click="changeBottomBtnHandler">璋冩暣涓轰笅绾ф寜閽�</el-button>
+ <el-button plain size="mini" type="primary" @click="changeTopBtnHandler">璋冩暣涓轰笂绾ф寜閽�</el-button>
+ <el-button plain size="mini" type="primary" @click="cloneClickBtnHandler">澶嶅埗鍒板叾浠栫粍浠�</el-button>
</div>
</el-header>
<el-container>
@@ -212,7 +214,11 @@
addTapButton,
updateTapButton,
getLinkDatasByPage,
- addPageDefination
+ addPageDefination,
+ deleteTabButton,
+ delPageDefination,
+ joinBtn,
+ exitBtn
} from "@/api/UI/uiDefine";
import actionDialog from '@/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/components/action';
import cloneDialog from "@/views/modelingMenu/ui/uiDefine/rightRegion/cloneDialog";
@@ -430,7 +436,7 @@
return val;
},
change: (val) => {
- const list = ['showType' ,'linkType' ,'templateId', 'SubUILayout' , 'searchObjType' ,'queryTemplateName', 'controlPath' ,'expandCols', 'rootContent', 'showAbs' ,'showLinkAbs' ,'separator']
+ const list = ['showType', 'linkType', 'templateId', 'SubUILayout', 'searchObjType', 'queryTemplateName', 'controlPath', 'expandCols', 'rootContent', 'showAbs', 'showLinkAbs', 'separator']
list.forEach(item => {
this.form[item] = "";
})
@@ -520,12 +526,15 @@
{
label: '婧愬璞�',
prop: 'showType',
- type: 'table',
- display: false,
+ type: 'select',
+ cascader: ['linkType', 'templateId', 'SubUILayout', 'searchObjType', 'queryTemplateName'],
placeholder: "璇疯緭鍏ュ唴瀹�",
+ dicUrl: '/api/uiManagerController/getBtmDatasByPage?page=1&limit=-1',
+ filterable: true,
props: {
label: 'name',
- value: 'name'
+ value: 'name',
+ desc: 'label'
},
rules: [
{
@@ -534,81 +543,27 @@
trigger: 'change'
}
],
- children: {
- border: true,
- column: [{
- label: '鍚嶇О',
- search: true,
- searchSpan: 24,
- prop: 'name'
- }, {
- label: '鏍囩',
- prop: 'label'
- }],
- },
- change: (val) => {
- const list = ['linkType', 'templateId', 'SubUILayout', 'queryTemplateName', 'searchObjType'];
- list.forEach(item => {
- this.form[item] = '';
- })
- },
- onLoad: ({page, value, data}, callback) => {
- //page鍒嗛〉
- // 涓嶇鏄悳绱� 杩樻槸棣栨鍔犺浇閮戒細瑙﹀彂page 鎵�浠ュ彧闇�瑕佹嬁page瀛樺湪涓庡惁杩涜璇锋眰灏卞彲浠� 濡傛灉鍐嶅幓鍒ゆ柇data鎼滅储 鎴栬�卾alue鍒濇鍔犺浇灏变細閲嶅璇锋眰
- if (page) {
- const params = {
- "conditionMap[filterInputValue]": data ? data.name : ''
- };
- getBtmDatasByPage(page.currentPage, page.pageSize, params).then(res => {
- callback({
- total: res.data.total,
- data: res.data.data
- })
- })
- }
- },
},
{
label: '閾炬帴绫诲瀷',
prop: 'linkType',
- type: 'table',
+ type: 'select',
display: false,
+ filterable: true,
props: {
label: 'name',
- value: 'name'
+ value: 'name',
+ desc: 'tag'
},
- children: {
- border: true,
- column: [{
- label: '鍚嶇О',
- search: true,
- searchSpan: 24,
- prop: 'name'
- }, {
- label: '鏍囩',
- prop: 'tag'
- }],
- },
- onLoad: ({page, value, data}, callback) => {
- if (page) {
- const params = {
- "conditionMap[selectBtmType]": this.form.showType,
- };
- getLinkDatasByPage(page.currentPage, page.pageSize, params).then(res => {
- console.log(res);
- callback({
- total: res.data.total,
- data: res.data.data
- })
- })
- }
- },
+ dicUrl: '/api/uiManagerController/getLinkDatasByPage?page=1&limit=-1&conditionMap[selectBtmType]={{key}}',
},
{
label: '閫夋嫨妯℃澘',
prop: 'templateId',
display: false,
- type: 'table',
+ type: 'select',
+ filterable: true,
+ dicUrl: '/api/uiManagerController/getPortalVIDatasByPage?page=1&limit=-1&conditionMap[selectBtmType]={{key}}',
rules: [
{
required: true,
@@ -618,71 +573,22 @@
],
props: {
label: 'viName',
- value: 'viName'
- },
- children: {
- border: true,
- column: [{
- label: '鍚嶇О',
- search: true,
- searchSpan: 24,
- prop: 'viName'
- }, {
- label: '绫诲瀷',
- prop: 'viType'
- }],
- },
- onLoad: ({page, value, data}, callback) => {
- if (page) {
- const params = {
- "conditionMap[selectBtmType]": this.form.showType,
- "conditionMap[filterInputValue]": data ? data.viName : '',
- };
- getPortalVIDatasByPage(page.currentPage, page.pageSize, params).then(res => {
- console.log(res);
- callback({
- total: res.data.total,
- data: res.data.data
- })
- })
- }
+ value: 'viName',
+ desc: 'viType'
},
},
{
label: 'UI瀹氫箟',
prop: 'SubUILayout',
- type: 'table',
+ type: 'select',
+ filterable: true,
display: false,
props: {
label: 'qtName',
- value: 'qtName'
+ value: 'qtName',
+ desc: 'btmName'
},
- children: {
- border: true,
- column: [{
- label: '鍚嶇О',
- search: true,
- searchSpan: 24,
- prop: 'qtName'
- }, {
- label: '绫诲瀷',
- prop: 'btmName'
- }],
- },
- onLoad: ({page, value, data}, callback) => {
- if (page) {
- const params = {
- "conditionMap[selectBtmType]": this.form.showType,
- "conditionMap[filterInputValue]": data ? data.qtName : '',
- };
- getQTInfoDatasByPage(page.currentPage, page.pageSize, params).then(res => {
- callback({
- total: res.data.total,
- data: res.data.data
- })
- })
- }
- },
+ dicUrl: '/api/uiManagerController/getUILayoutDatasByPage?page=1&limit=-1&conditionMap[selectBtmType]={{key}}',
},
{
label: '鏌ヨ绫诲瀷',
@@ -705,75 +611,28 @@
{
label: '鏌ヨ瀵硅薄绫诲瀷',
prop: 'searchObjType',
- type: 'table',
+ type: 'select',
display: false,
labelWidth: 100,
props: {
label: 'qtName',
- value: 'qtName'
+ value: 'qtName',
+ desc: 'btmName'
},
- children: {
- border: true,
- column: [{
- label: '鍚嶇О',
- search: true,
- searchSpan: 24,
- prop: 'qtName'
- }, {
- label: '绫诲瀷',
- prop: 'btmName'
- }],
- },
- onLoad: ({page, value, data}, callback) => {
- if (page) {
- const params = {
- "conditionMap[selectBtmType]": null, // cs绔湁闂 鏆傛椂涓嶅睍绀哄唴瀹�
- };
- getLinkDatasByPage(page.currentPage, page.pageSize, params).then(res => {
- console.log(res);
- callback({
- total: res.data.total,
- data: res.data.data
- })
- })
- }
- },
+ dicUrl: '/api/uiManagerController/getLinkDatasByPage?page=1&limit=-1&conditionMap[selectBtmType]=',// cs绔湁闂 鏆傛椂涓嶅睍绀哄唴瀹�
},
{
label: '鏌ヨ妯℃澘',
prop: 'queryTemplateName',
- type: 'table',
+ type: 'select',
+ filterable: true,
display: false,
props: {
label: 'qtName',
- value: 'qtName'
+ value: 'qtName',
+ desc: 'btmName'
},
- children: {
- border: true,
- column: [{
- label: '鍚嶇О',
- search: true,
- searchSpan: 24,
- prop: 'qtName'
- }, {
- label: '绫诲瀷',
- prop: 'btmName'
- }],
- },
- onLoad: ({page, value, data}, callback) => {
- if (page) {
- const params = {
- "conditionMap[selectBtmType]": this.form.showType,
- "conditionMap[filterInputValue]": data ? data.qtName : '',
- };
- getQTInfoDatasByPage(page.currentPage, page.pageSize, params).then(res => {
- callback({
- total: res.data.total,
- data: res.data.data
- })
- })
- }
- },
+ dicUrl: '/api/uiManagerController/getQTInfoDatasByPage?page=1&limit=-1&conditionMap[selectBtmType]={{key}}',
},
{
label: '鎺у埗璺緞',
@@ -805,7 +664,7 @@
prop: 'expandMode',
display: false,
type: 'radio',
- value:'1',
+ value: '1',
dicData: [
{
label: '閫愮骇灞曞紑',
@@ -881,6 +740,7 @@
this.tableLoading = false;
})
},
+
// 鏍规嵁涓嶅悓鍊煎尯鍒嗙被鍨�
templateTypeValueHandler(val) {
const componentMap = {
@@ -925,9 +785,27 @@
this.$refs.crud.rowAdd();
},
+ // 缂栬緫鎵撳紑琛ㄥ崟鍓�
+ beforeOpen(done, type) {
+ if (type === 'edit') {
+ this.form.showType = 'Ludc';
+ this.$set(this.form, 'showType', 'Ludc');
+ // this.$set(this.option.group[0].column[0],'value','Ludc');
+ // this.option.group[0].column[0].value = 'Ludc';
+ done();
+ } else {
+ done();
+ }
+ },
+
+ // 澧炲姞鍏抽棴瀵硅瘽妗� 娓呯┖event鏁扮粍
+ beforeClose(done) {
+ this.eventData = [];
+ done();
+ },
+
// 淇敼
editBtnClick(row) {
- console.log(row);
this.eventData = [];
if (row.eventKey && row.eventValue) {
let keys = row.eventKey.split(',');
@@ -943,26 +821,52 @@
});
}
this.$refs.crud.rowEdit(row);
+ console.log(this.form);
+ },
+
+ // 鍒犻櫎
+ rowDeleteHandler(row) {
+ console.log(row);
+ this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬暟鎹悧锛�', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ const params = {
+ oids: row.id
+ }
+ delPageDefination(params).then(res => {
+ if (res.data.code === 200) {
+ this.$message.success('鍒犻櫎鎴愬姛');
+ this.getTableList();
+ }
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
},
// 淇濆瓨
- rowSaveHandler(row,done,loading){
- if(row.templateType === '6'){
+ rowSaveHandler(row, done, loading) {
+ if (row.templateType === '6') {
row.SubUIObjType = row.showType;
row.showType = "";
}
console.log(this.sourceData);
const params = {
...row,
- tabPageOId:this.sourceData.plOId
+ tabPageOId: this.sourceData.plOId
}
addPageDefination(params).then(res => {
console.log(res);
- if(res.data.code === 200){
+ if (res.data.code === 200) {
this.$message.success(res.data.obj);
done()
}
- }).catch(err=> {
+ }).catch(err => {
loading();
})
},
@@ -1080,11 +984,6 @@
const temp = this.eventData[index];
this.eventData.splice(index, 1, this.eventData.splice(index + 1, 1, temp)[0]);
}
- },
-
- // 鎸夐挳璁捐鍏抽棴瀵硅瘽妗�
- dialogClose() {
-
},
// 鎸夐挳璁捐
@@ -1213,7 +1112,6 @@
bottomParams[item.name] = item.value
})
}
- ;
const params = this.saveType === 'add' ? {
...this.basicForm,
@@ -1255,7 +1153,15 @@
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
-
+ deleteTabButton(this.nodeTreeRow).then(res => {
+ // console.log(res);
+ if (res.data.code === 200) {
+ this.$message.success('鍒犻櫎鎴愬姛');
+ this.getTabBtnTree();
+ this.basicForm = {};
+ this.paramsData = [];
+ }
+ })
}).catch(() => {
this.$message({
type: 'info',
@@ -1264,7 +1170,8 @@
});
},
- cloneClickBtnHandler(){
+ // 澶嶅埗鍒板叾浠栫粍浠�
+ cloneClickBtnHandler() {
if (func.isEmptyObject(this.nodeTreeRow)) {
this.$message.error('璇烽�夋嫨鑺傜偣杩涜澶嶅埗');
return;
@@ -1275,6 +1182,7 @@
}
this.$refs.cloneDialog.openDialog(this.nodeTreeRow);
},
+
// 閫夋嫨action
actionFoucus() {
this.$refs.actionDialog.btnActionVisible = true;
@@ -1285,10 +1193,51 @@
this.$set(this.basicForm, 'actionName', val.plName);
this.$set(this.basicForm, 'actionOId', val.plOId);
},
+
+ // 鎵撳紑鍏嬮殕瀵硅瘽妗�
rowCloneHandler(row) {
this.$refs.cloneDialog.openDialog(row);
},
- }
+
+ // 璋冩暣涓轰笅绾ф寜閽�
+ changeBottomBtnHandler() {
+ if (func.isEmptyObject(this.nodeTreeRow)) {
+ this.$message.error('璇烽�夋嫨鑺傜偣杩涜淇敼');
+ return;
+ }
+
+ if (this.nodeTreeRow.oId === "parentNode") {
+ this.$message.error('椤跺眰鑺傜偣涓嶅厑璁歌皟鏁�');
+ return;
+ }
+ joinBtn(this.nodeTreeRow).then(res => {
+ // console.log(res);
+ if (res.data.code === 200) {
+ this.$message.success(res.data.obj);
+ this.getTabBtnTree();
+ }
+ })
+ },
+
+ // 璋冩暣涓轰笂绾ф寜閽�
+ changeTopBtnHandler() {
+ if (func.isEmptyObject(this.nodeTreeRow)) {
+ this.$message.error('璇烽�夋嫨鑺傜偣杩涜淇敼');
+ return;
+ }
+
+ if (this.nodeTreeRow.oId === "parentNode") {
+ this.$message.error('椤跺眰鑺傜偣涓嶅厑璁歌皟鏁�');
+ return;
+ }
+ exitBtn(this.nodeTreeRow).then(res => {
+ if (res.data.code === 200) {
+ this.$message.success(res.data.obj);
+ this.getTabBtnTree();
+ }
+ })
+ }
+ },
}
</script>
--
Gitblit v1.9.3