From 0f4bac6483639a3be54d8fa311e005a2a3c99885 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期五, 27 九月 2024 17:45:55 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/plt-web/plt-web-ui/public/index.html | 3 Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/option.js | 2 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue | 13 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue | 1190 +++++++++++++++++++++ Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/versioning/index.vue | 261 ++-- Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue | 622 ++++++++++ Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue | 36 Source/plt-web/plt-web-ui/src/api/UI/uiDefine/api.js | 67 + Source/plt-web/plt-web-ui/src/components/PLT-basic-component/upload-file.vue | 14 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue | 2 Source/plt-web/plt-web-ui/src/App.vue | 5 Source/plt-web/plt-web-ui/src/router/page/index.js | 25 Source/plt-web/plt-web-ui/src/util/basic-option.js | 1 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/components/action.vue | 433 +++++++ Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/plShow.vue | 388 ++++++ Source/plt-web/plt-web-ui/src/api/UI/uiDefine.js | 180 +++ Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue | 36 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue | 2 Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue | 61 Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue | 2 20 files changed, 3,093 insertions(+), 250 deletions(-) diff --git a/Source/plt-web/plt-web-ui/public/index.html b/Source/plt-web/plt-web-ui/public/index.html index e72aba5..ebee444 100644 --- a/Source/plt-web/plt-web-ui/public/index.html +++ b/Source/plt-web/plt-web-ui/public/index.html @@ -97,8 +97,7 @@ </div> </div> <div class="avue-home__footer"> - <a href="https://bladex.vip" target="_blank"> - https://bladex.vip </a> + </div> </div> </div> diff --git a/Source/plt-web/plt-web-ui/src/App.vue b/Source/plt-web/plt-web-ui/src/App.vue index a3f276c..ea51abd 100644 --- a/Source/plt-web/plt-web-ui/src/App.vue +++ b/Source/plt-web/plt-web-ui/src/App.vue @@ -80,6 +80,9 @@ .avue-crud__pagination{ padding: 15px 0 10px; } +.el-form .el-col{ + margin-bottom: 0; +} .UITabs > .el-tabs__content{ height:calc(100% - 56px); } @@ -113,7 +116,7 @@ margin-bottom: 15px; } .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item{ - margin-bottom: 10px; + margin-bottom: 15px; } .tree-buttons .el-button{ 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 new file mode 100644 index 0000000..47bfd5d --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/api/UI/uiDefine.js @@ -0,0 +1,180 @@ +import request from '@/router/axios'; + +// 涓氬姟绫诲瀷鏍戞煡璇� +export function getBizTree(params) { + return request({ + url: "/api/uiManagerController/getBizTree", + method: "get", + params + }); +} +// 鍒楄〃鏌ヨ +export function gridUIContextData(page, limit, params) { + return request({ + url: "/api/uiManagerController/gridUIContextData", + method: "get", + params: { + page, + limit, + ...params + } + }); +} +export const saveUIContextData = (row) => { + return request({ + url: '/api/uiManagerController/saveUIContextData', + method: 'post', + data: row + }) +} + +export const updateUIContextData = (row) => { + return request({ + url: '/api/uiManagerController/updateUIContextData', + method: 'put', + data: row + }) +} +// 閫氳繃oid鍒犻櫎 +export function delUIContextData(params) { + return request({ + url: "/api/uiManagerController/delUIContextData", + method: "delete", + params + }) +} +//鍏嬮殕 +export const cloneUIContextData = (params) => { + return request({ + url: '/api/uiManagerController/cloneUIContextData', + method: 'post', + data: params + }) +} +// 瀵煎嚭閫夋嫨鍒楄〃 +//鍙傛暟 expDatas:閫夋嫨oid +export function getExpContextTree(params) { + return request({ + url: "/api/uiManagerController/getExpContextTree", + method: "get", + params: params + }); +} +// 瀵煎嚭 +export function expUIContextData (params) { + return request({ + url: '/api/uiManagerController/expUIContextData', + method: 'post', + responseType: 'blob', + data:{ + params + } + }) +} + +//涓婁笅鏂囧悇鍖哄煙鍒楄〃鏁版嵁 +export function getTabByContextIdAndType(params){ + return request({ + url: "/api/uiManagerController/getTabByContextIdAndType", + method: "get", + params + }); +} +export const addTabData = (row) => { + return request({ + url: '/api/uiManagerController/addTabData', + method: 'post', + data: row + }) +} + +export const updateTabData = (row) => { + return request({ + url: '/api/uiManagerController/updateTabData', + method: 'put', + data: row + }) +} +// 閫氳繃oid鍒犻櫎 +export function deleteTabData(params) { + return request({ + url: "/api/uiManagerController/deleteTabData", + method: "delete", + params + }) +} +//涓嬫柟琛ㄦ牸鏁版嵁 +export function getPLPageDefinations(params){ + return request({ + url: "/api/uiManagerController/getPLPageDefinations", + method: "get", + params + }); +} + +// 涓氬姟绫诲瀷涓嬫媺鏌ヨ +export function getBtmDatasByPage(page, limit, params) { + return request({ + url: "/api/uiManagerController/getBtmDatasByPage", + method: "get", + params: { + page, + limit, + ...params + } + }); +} + +// 閫夋嫨妯℃澘涓嬫媺鏌ヨ +export function getPortalVIDatasByPage(page, limit, params) { + return request({ + url: "/api/uiManagerController/getPortalVIDatasByPage", + method: "get", + params: { + page, + limit, + ...params + } + }); +} + +// 鏌ヨ妯℃澘涓嬫媺鏌ヨ +export function getQTInfoDatasByPage(page, limit, params) { + return request({ + url: "/api/uiManagerController/getQTInfoDatasByPage", + method: "get", + params: { + page, + limit, + ...params + } + }); +} + +// 鎸夐挳璁捐瀵硅瘽妗嗗乏渚ф爲鏌ヨ +export function getTabButtons(params) { + return request({ + url: "/api/uiManagerController/getTabButtons", + method: "get", + params + }); +} + +// 鎸夐挳璁捐瀵硅瘽妗嗘坊鍔� +export function addTapButton(params) { + return request({ + url: "/api/uiManagerController/addTapButton", + method: "post", + data:params + }); +} + +// 鎸夐挳璁捐瀵硅瘽妗嗘坊鍔� +export function updateTapButton(params) { + return request({ + url: "/api/uiManagerController/updateTapButton", + method: "put", + data:params + }); +} + diff --git a/Source/plt-web/plt-web-ui/src/api/UI/uiDefine/api.js b/Source/plt-web/plt-web-ui/src/api/UI/uiDefine/api.js new file mode 100644 index 0000000..8d494a1 --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/api/UI/uiDefine/api.js @@ -0,0 +1,67 @@ +import request from '@/router/axios'; + +// 涓氬姟绫诲瀷涓嬫媺鏌ヨ +export function getBtmDatasByPage(page, limit, params) { + return request({ + url: "/api/uiManagerController/getBtmDatasByPage", + method: "get", + params: { + page, + limit, + ...params + } + }); +} + +// 閫夋嫨妯℃澘涓嬫媺鏌ヨ +export function getPortalVIDatasByPage(page, limit, params) { + return request({ + url: "/api/uiManagerController/getPortalVIDatasByPage", + method: "get", + params: { + page, + limit, + ...params + } + }); +} + +// 鏌ヨ妯℃澘涓嬫媺鏌ヨ +export function getQTInfoDatasByPage(page, limit, params) { + return request({ + url: "/api/uiManagerController/getQTInfoDatasByPage", + method: "get", + params: { + page, + limit, + ...params + } + }); +} + +// 鎸夐挳璁捐瀵硅瘽妗嗗乏渚ф爲鏌ヨ +export function getTabButtons(params) { + return request({ + url: "/api/uiManagerController/getTabButtons", + method: "get", + params + }); +} + +// 鎸夐挳璁捐瀵硅瘽妗嗘坊鍔� +export function addTapButton(params) { + return request({ + url: "/api/uiManagerController/addTapButton", + method: "post", + data:params + }); +} + +// 鎸夐挳璁捐瀵硅瘽妗嗘坊鍔� +export function updateTapButton(params) { + return request({ + url: "/api/uiManagerController/updateTapButton", + method: "put", + data:params + }); +} diff --git a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/upload-file.vue b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/upload-file.vue index 7e23662..f8bf56f 100644 --- a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/upload-file.vue +++ b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/upload-file.vue @@ -69,8 +69,8 @@ }, // 璇锋眰鍦板潃 鎼哄甫鍙傛暟 fileData: { - type: Array, - default: () => [] + type: Object, + default: () => {} }, // 瀵煎叆鎻愮ず鏂囧瓧 tipList:["瀵煎叆妯℃澘涓爣鏄庣孩鑹插瓧浣撶殑涓哄繀杈撻」","閮ㄩ棬鍒椾笂涓嬬骇鍏崇郴蹇呴』鎸夌収鍙嶆枩鏉犻殧寮�(/)"] tipList:{ @@ -124,13 +124,14 @@ return true; }, // 鏂囦欢涓婁紶鎴愬姛 - onSuccess(resbonse) { - if (resbonse.code === 200) { + onSuccess(response) { + if (response.code === 200) { this.$message.success("瀵煎叆鎴愬姛锛�"); this.visible = false; - this.$emit('updata',resbonse); + this.$emit('updata',response); } else { - this.$message.error(resbonse.msg); + this.$emit('upfaildata',response); + this.$message.error(response.msg); } }, //鏂囦欢涓婁紶澶辫触 @@ -140,7 +141,6 @@ }, //鏂囦欢鐘舵�佹敼鍙� uploadChange(file) { - console.log( this.pageLoading); if (file.status === "success" || file.status === "error") { this.pageLoading.close(); } diff --git a/Source/plt-web/plt-web-ui/src/router/page/index.js b/Source/plt-web/plt-web-ui/src/router/page/index.js index 8a0cac6..5e4006d 100644 --- a/Source/plt-web/plt-web-ui/src/router/page/index.js +++ b/Source/plt-web/plt-web-ui/src/router/page/index.js @@ -91,11 +91,11 @@ }, { path: '/UIContentViewer', - name: '鍔ㄦ�佽〃鏍奸〉闈�', + name: 'UI涓婁笅鏂囧睍绀�', component: Layout, children: [ { - path: '', // 绌鸿矾寰勮〃绀鸿闂� '/dynamic-form' 鏃跺姞杞� Layout 缁勪欢 + path: '', // 绌鸿矾寰勮〃绀鸿闂� '/UIContentViewer' 鏃跺姞杞� Layout 缁勪欢 component: () => import('@/views/base/UIContentViewer'), props: true } @@ -103,14 +103,31 @@ }, { path: '/referIndex', - name: '鍔ㄦ�佽〃鏍奸〉闈�', + name: '鍙傜収绀轰緥', component: Layout, children: [ { - path: '', // 绌鸿矾寰勮〃绀鸿闂� '/dynamic-form' 鏃跺姞杞� Layout 缁勪欢 + path: '', // 绌鸿矾寰勮〃绀鸿闂� '/referIndex' 鏃跺姞杞� Layout 缁勪欢 component: () => import('@/views/test/referDemo/index'), props: true } ] }, + { + path: '/UIDefineShow/:uiDefineOid', + name: 'UI瀹氫箟璇︽儏', + component: Layout, + children: [ + { + path: '', // 绌鸿矾寰勮〃绀鸿闂� '/referIndex' 鏃跺姞杞� Layout 缁勪欢 + component: () => import('@/views/modelingMenu/ui/uiDefine/rightRegion/plShow'), + props: true + } + ], + meta:{ + keepAlive: true, + isTab: true, + isAuth: true + } + } ] diff --git a/Source/plt-web/plt-web-ui/src/util/basic-option.js b/Source/plt-web/plt-web-ui/src/util/basic-option.js index e34e741..196904c 100644 --- a/Source/plt-web/plt-web-ui/src/util/basic-option.js +++ b/Source/plt-web/plt-web-ui/src/util/basic-option.js @@ -10,6 +10,7 @@ headerAlign: 'center', align: 'center', emptyText: '鏆傛棤鍐呭', + tip:false, // selection 鏄惁鏈夐�夋嫨妗� // indexFixed:true/left/right, 鍥哄畾鍒� // menu:false, 鏄惁鏈夋搷浣滄爮 diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue index 0cd245d..befcded 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue @@ -21,8 +21,7 @@ <el-button icon="el-icon-plus" plain size="small" type="primary" @click="rowSaveHandlerClick">鍒涘缓</el-button> <el-button icon="el-icon-delete" plain size="small" type="danger" @click="allDelHandler">鍒犻櫎</el-button> <el-button icon="el-icon-view" plain size="small" type="primary" @click="chekView">鏌ョ湅浣跨敤鑼冨洿</el-button> - <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadTemplateHandler">涓嬭浇瀵煎叆妯℃澘 - </el-button> + <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadTemplateHandler">涓嬭浇瀵煎叆妯℃澘</el-button> <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadHandler">瀵煎叆</el-button> <el-button icon="el-icon-download" plain size="small" type="primary" @click="downLoadHandler">瀵煎嚭</el-button> </template> @@ -45,19 +44,25 @@ <template slot="label"> 鍚嶇О </template> - {{ lastItem.id }} + <div style="width: 330px"> + {{ lastItem.id }} + </div> </el-descriptions-item> <el-descriptions-item> <template slot="label"> 鏍囩 </template> + <div style="width: 330px"> {{ lastItem.name }} + </div> </el-descriptions-item> <el-descriptions-item> <template slot="label"> 鎻忚堪 </template> + <div style="width: 330px"> {{ lastItem.description }} + </div> </el-descriptions-item> <el-descriptions-item> <template slot="label"> @@ -75,9 +80,11 @@ <template slot="label"> 鍏佽涓虹┖ </template> + <div style="width: 330px"> <el-tag :type="lastItem.nullableFlag ? 'success' : 'danger'"> {{ lastItem.nullableFlag ? '鏄�' : '鍚�' }} </el-tag> + </div> </el-descriptions-item> <el-descriptions-item v-if="accuracy"> <template slot="label"> @@ -89,13 +96,17 @@ <template slot="label"> 闀垮害 </template> + <div style="width: 330px"> {{ lastItem.attrLength }} + </div> </el-descriptions-item> <el-descriptions-item> <template slot="label"> 榛樿鍊� </template> + <div style="width: 330px"> {{ lastItem.defaultValue }} + </div> </el-descriptions-item> </el-descriptions> @@ -106,33 +117,43 @@ <template slot="label"> 褰撳墠绫诲瀷 </template> + <div style="width: 345px"> {{ lastItem.version ? '閾炬帴绫诲瀷' : '涓氬姟绫诲瀷' }} + </div> </el-descriptions-item> <el-descriptions-item> <template slot="label"> 褰撳墠绫诲瀷鍊� </template> + <div style="width: 345px"> {{ lastItem.version ? lastItem.linkTypeName : lastItem.btmTypeId }} + </div> </el-descriptions-item> <el-descriptions-item v-if="lastItem.version"> <template slot="label"> 褰撳墠鐗堟湰娆� </template> + <div style="width: 345px"> {{ lastItem.version }} + </div> </el-descriptions-item> <el-descriptions-item> <template slot="label"> 浣跨敤鏋氫妇 </template> + <div style="width: 345px"> <el-tag :type="lastItem.enumId ? 'success' : 'danger'"> {{ lastItem.enumId ? '鏄�' : '鍚�' }} </el-tag> + </div> </el-descriptions-item> <el-descriptions-item> <template slot="label"> 褰撳墠鏋氫妇绫诲瀷 </template> + <div style="width: 345px"> {{ lastItem.enumId }} + </div> </el-descriptions-item> <el-descriptions-item> <template slot="label"> @@ -153,21 +174,25 @@ <template slot="label"> 浣跨敤鏋氫妇 </template> + <div style="width: 330px"> <el-tag :type="lastItem.enumFlag ? 'success' : 'danger'"> {{ lastItem.enumFlag ? '鏄�' : '鍚�' }} </el-tag> + </div> </el-descriptions-item> <el-descriptions-item> <template slot="label"> 鏋氫妇绫诲瀷 </template> + <div style="width: 330px"> {{ lastItem.enumFlag }} + </div> </el-descriptions-item> <el-descriptions-item> <template slot="label"> 鍙栧�艰寖鍥� </template> - <div style="width: 330px; height: 80px;overflow: auto"> + <div style="width: 345px; height: 80px;overflow: auto"> <el-tag v-for="item in rangeList" plain style="margin: 5px">{{ item }}</el-tag> </div> </el-descriptions-item> @@ -206,9 +231,7 @@ <el-row> <div class="addDialog"> <div> - <h3>灞炴�ч」</h3> - <el-col :span="12"> <el-form-item label="鍚嶇О锛�" prop="id"> <el-input v-model="form.id"></el-input> @@ -576,6 +599,7 @@ addBtn: false, editBtn: false, delBtn: false, + menuWidth:160, column }, tableLoading: false, diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/option.js b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/option.js index 695bd5a..1440b66 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/option.js +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/option.js @@ -14,11 +14,13 @@ label: '绫诲瀷', prop: 'attributeDataTypeText', sortable: true, + width:100 }, { label: '榛樿鍊�', prop: 'defaultValue', sortable: true, + width: 120 }, { label: '鎻忚堪', diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue index 4a4fc6e..49029ed 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue @@ -2,38 +2,10 @@ <el-container v-loading="createViewLoading"> <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="addClickHandler">鍒涘缓 - </el-button> - <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">淇敼 - </el-button> - <el-button icon="el-icon-delete" plain size="small" type="danger" @click="deleteClickHandler">鍒犻櫎 - </el-button> - <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭 - </el-button> - <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">瀵煎叆 - </el-button> - <el-button class="miniBtn" icon="el-icon-circle-plus-outline" plain size="small" - type="primary" @click="createViewClickHandler">鍒涘缓瑙嗗浘 - </el-button> - <el-button class="miniBtn" icon="el-icon-circle-plus-outline" plain size="small" - type="primary" @click="indexClickHandler">鍒涘缓绱㈠紩 - </el-button> - <el-button icon="el-icon-menu" plain size="small" style="width: 82px;text-align: center;padding-left: 1px" - type="primary" @click="checkClickHandler">涓�鑷存�ф鏌� - </el-button> - <el-button class="miniBtn" icon="el-icon-delete" plain size="small" - type="danger" @click="checkClickHandler">鍒犻櫎鏁版嵁 - </el-button> - <el-button class="smallBtn" plain size="small" - type="danger" @click="checkClickHandler">鍒犻櫎鍏ㄩ儴绫诲瀷 - </el-button> - <el-button class="smallBtn" plain size="small" type="primary" @click="checkViewClickHandler">鏌ョ湅浣跨敤鑼冨洿 - </el-button> - </div> + <div ref="TreeBox" style="height: calc(100vh - 154px);!important;"> + <!-- 宸︿晶鏍� --> - <div style="height: calc(100vh - 330px);"> + <div style="height: calc(100vh - 190px);"> <avue-tree ref="tree" v-loading="treeLoading" :data="treeData" :option="treeOption" @node-click="nodeClick"> <span slot-scope="{ node, data }" class="el-tree-node__label"> <span style="font-size: 15px"> @@ -48,7 +20,20 @@ </el-aside> <el-main> <basic-container> - <div style="display: flex;justify-content: center; height: 230px"> + <div> + <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">鍒涘缓</el-button> + <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">淇敼</el-button> + <el-button icon="el-icon-delete" plain size="small" type="danger" @click="deleteClickHandler">鍒犻櫎</el-button> + <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭</el-button> + <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">瀵煎叆</el-button> + <el-button icon="el-icon-circle-plus-outline" plain size="small" type="primary" @click="createViewClickHandler">鍒涘缓瑙嗗浘</el-button> + <el-button icon="el-icon-circle-plus-outline" plain size="small" type="primary" @click="indexClickHandler">鍒涘缓绱㈠紩</el-button> + <el-button icon="el-icon-menu" plain size="small" type="primary" @click="checkClickHandler">涓�鑷存�ф鏌�</el-button> + <el-button icon="el-icon-delete" plain size="small" type="danger" @click="checkClickHandler">鍒犻櫎鏁版嵁</el-button> + <el-button plain size="small" type="danger" @click="checkClickHandler">鍒犻櫎鍏ㄩ儴绫诲瀷</el-button> + <el-button plain size="small" type="primary" @click="checkViewClickHandler">鏌ョ湅浣跨敤鑼冨洿</el-button> + </div> + <div style="display: flex;justify-content: center; height: 230px;margin-top: 10px;"> <div class="descBox" style="max-height: 100px"> <el-descriptions :column="1" border class="margin-top" size="medium" title="灞炴�т俊鎭�"> <el-descriptions-item :contentStyle="descriptionOption.contentStyle" @@ -1703,18 +1688,6 @@ .headerCon > .el-button:nth-child(10) { margin-left: 0; -} - -.miniBtn { - width: 82px; - text-align: center; - padding-left: 7px; -} - -.smallBtn { - width: 82px; - text-align: center; - padding-left: 4.5px; } .descBox { diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue index 48bc0df..66319a6 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue @@ -2,30 +2,9 @@ <el-container v-loading="createViewLoading"> <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="addClickHandler">鍒涘缓 - </el-button> - <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">淇敼 - </el-button> - <el-button icon="el-icon-delete" plain size="small" type="danger" @click="deleteClickHandler">鍒犻櫎 - </el-button> - <el-button icon="el-icon-view" plain size="small" type="primary">鏌ョ湅 - </el-button> - <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭 - </el-button> - <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">瀵煎叆 - </el-button> - <el-button class="smallBtn" icon="el-icon-circle-plus-outline" plain size="small" - style="padding-left: 7px !important;" - type="primary" @click="createViewClickHandler">鍒涘缓瑙嗗浘 - </el-button> - <el-button class="smallBtn" icon="el-icon-menu" plain size="small" style="padding-left: 1px" - type="primary" @click="checkClickHandler">涓�鑷存�ф鏌� - </el-button> - </div> + <div ref="TreeBox" style="height: calc(100vh - 154px);!important;"> <!-- 宸︿晶鏍� --> - <div style="height: calc(100vh - 300px);"> + <div style="height: calc(100vh - 190px);"> <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> <span slot-scope="{ node, data }" class="el-tree-node__label"> <span style="font-size: 15px"> @@ -41,7 +20,16 @@ <el-main> <basic-container> - <div style="height: 380px"> + <div> + <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">鍒涘缓</el-button> + <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">淇敼</el-button> + <el-button icon="el-icon-delete" plain size="small" type="danger" @click="deleteClickHandler">鍒犻櫎</el-button> + <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭</el-button> + <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">瀵煎叆</el-button> + <el-button icon="el-icon-circle-plus-outline" plain size="small" type="primary" @click="createViewClickHandler">鍒涘缓瑙嗗浘</el-button> + <el-button icon="el-icon-menu" plain size="small" type="primary" @click="checkClickHandler">涓�鑷存�ф鏌�</el-button> + </div> + <div style="height: 380px;margin-top: 10px"> <el-descriptions :column="2" border class="margin-top" size="medium"> <el-descriptions-item :contentStyle="descriptionOption.contentStyle" :labelStyle="descriptionOption.labelStyle"> diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue index ec3de1a..e645fcb 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue @@ -32,8 +32,6 @@ <el-button icon="el-icon-delete" plain size="small" type="text" @click="delRowClickHandler(row)">鍒犻櫎 </el-button> </template> - - </avue-crud> <!-- 鏂板 淇敼 --> diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/versioning/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/versioning/index.vue index 5e6ad14..cfbe5d6 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/versioning/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/versioning/index.vue @@ -1,109 +1,30 @@ <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="addClickHandler">鍒涘缓 - </el-button> - <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">淇敼 - </el-button> - <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delClickHandler">鍒犻櫎 - </el-button> - <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭 - </el-button> - <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">瀵煎叆 - </el-button> - <el-button class="smallBtn" plain size="small" type="primary" - @click="checkViewClickHandler">鏌ョ湅浣跨敤鑼冨洿 - </el-button> - </div> - <!-- 宸︿晶鏍� --> - <div style="height: calc(100vh - 260px);"> - <avue-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> - {{ (node || {}).label }} - </span> - </span> - </avue-tree> - </div> - </div> - </basic-container> - </el-aside> - - <el-main> - <basic-container> - <el-descriptions :column="1" border class="margin-top" size="medium" title="灞炴�т俊鎭�"> - <el-descriptions-item :contentStyle="descriptionOption.contentStyle" - :labelStyle="descriptionOption.labelStyle"> - <template slot="label"> - <i :class="icons.id"></i> - 鍚嶇О - </template> - <el-tag v-if="nodeRow.id">{{ nodeRow.id }}</el-tag> - </el-descriptions-item> - <el-descriptions-item :contentStyle="descriptionOption.contentStyle" - :labelStyle="descriptionOption.labelStyle"> - <template slot="label"> - <i :class="icons.name"></i> - 鏍囩 - </template> - <el-tag v-if="nodeRow.name">{{ nodeRow.name }}</el-tag> - </el-descriptions-item> - <el-descriptions-item :contentStyle="descriptionOption.contentStyle" - :labelStyle="descriptionOption.labelStyle"> - <template slot="label"> - <i :class="icons.jump"></i> - 璺宠穬瀛楃 - </template> - <el-tag v-if="nodeRow.jumpCharacter">{{ nodeRow.jumpCharacter }}</el-tag> - </el-descriptions-item> - <el-descriptions-item :contentStyle="descriptionOption.contentStyle" - :labelStyle="descriptionOption.labelStyle"> - <template slot="label"> - <i :class="icons.init"></i> - 鍒濆鍊� - </template> - <el-tag v-if="nodeRow.initialValue">{{ nodeRow.initialValue }}</el-tag> - </el-descriptions-item> - <el-descriptions-item :contentStyle="descriptionOption.contentStyle" - :labelStyle="descriptionOption.labelStyle"> - <template slot="label"> - <i :class="icons.length"></i> - 姝ラ暱 - </template> - <el-tag v-if="nodeRow.stepLength">{{ nodeRow.stepLength }}</el-tag> - </el-descriptions-item> - <el-descriptions-item :contentStyle="descriptionOption.contentStyle" - :labelStyle="descriptionOption.labelStyle"> - <template slot="label"> - <i :class="icons.left"></i> - 鍓嶇紑 - </template> - <el-tag v-if="nodeRow.prefixion">{{ nodeRow.prefixion }}</el-tag> - </el-descriptions-item> - <el-descriptions-item :contentStyle="descriptionOption.contentStyle" - :labelStyle="descriptionOption.labelStyle"> - <template slot="label"> - <i :class="icons.right"></i> - 鍚庣紑 - </template> - <el-tag v-if="nodeRow.suffix">{{ nodeRow.suffix }}</el-tag> - </el-descriptions-item> - <el-descriptions-item :contentStyle="descriptionOption.contentStyle" - :labelStyle="descriptionOption.labelStyle"> - <template slot="label"> - <i :class="icons.desc"></i> - 鎻忚堪 - </template> - <el-tag v-if="nodeRow.description">{{ nodeRow.description }}</el-tag> - </el-descriptions-item> - </el-descriptions> - </basic-container> - </el-main> - + <basic-container> + <avue-crud + ref="crud" + :data="data" + :option="option" + :table-loading="loading" + @refresh-change="getTableList" + @selection-change="selectChange" + @row-click="rowClickHandler"> + <template slot="menuLeft" slot-scope="scope"> + <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">鍒涘缓</el-button> + <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭 + </el-button> + <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">瀵煎叆 + </el-button> + <el-button icon="el-icon-view" plain size="small" type="primary" + @click="checkViewClickHandler">鏌ョ湅浣跨敤鑼冨洿 + </el-button> + </template> + <template slot="menu" slot-scope="scope"> + <el-button icon="el-icon-edit" size="small" type="text" @click="editClickHandler(scope.row)">缂栬緫 + </el-button> + <el-button icon="el-icon-delete" size="small" type="text" @click="delClickHandler(scope.row)">鍒犻櫎 + </el-button> + </template> + </avue-crud> <!-- 鏂板 淇敼 --> <el-dialog v-dialogDrag @@ -166,7 +87,7 @@ <!-- 瀵煎叆 --> <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆" - @updata="getTreeList"></upload-file> + @updata="getTableList"></upload-file> <!-- 鏌ョ湅浣跨敤鑼冨洿 --> <el-dialog @@ -187,7 +108,7 @@ > </avue-crud> </el-dialog> - </el-container> + </basic-container> </template> <script> @@ -206,6 +127,57 @@ name: "index", data() { return { + loading: false, + data: [], + option: { + ...basicOption, + addBtn: false, + editBtn: false, + delBtn: false, + calcHeight: -30, + column: [ + { + label: '鍚嶇О', + prop: 'id', + sortable: true, + }, + { + label: '鏍囩', + prop: 'name', + sortable: true, + }, + { + label: '璺宠穬瀛楃', + prop: 'jumpCharacter', + sortable: true, + }, + { + label: '鍒濆鍊�', + prop: 'initialValue', + sortable: true, + }, + { + label: '姝ラ暱', + prop: 'stepLength', + sortable: true, + }, + { + label: '鍓嶇紑', + prop: 'prefixion', + sortable: true, + }, + { + label: '鍚庣紑', + prop: 'suffix', + sortable: true, + }, + { + label: '鎻忚堪', + prop: 'description', + sortable: true, + }, + ] + }, checkViewVisible: false, checkViewData: [], checkViewDataSearch: [], @@ -296,25 +268,24 @@ right: 'el-icon-caret-right', desc: 'el-icon-chat-line-square' }, + selectList: [], + lastIndex: null, } }, created() { - this.getTreeList(); + this.getTableList(); }, methods: { // 宸︿晶鏍戞煡璇� - getTreeList() { + getTableList() { + this.loading = true; getVersionRuleAllList().then(res => { const data = res.data.data; - this.treeData = data; + this.data = data; + this.loading = false; }).catch(err => { this.$message.error(err) }); - }, - - // 宸︿晶鏍戣鐐瑰嚮 - nodeClick(row) { - this.nodeRow = row; }, // 鍒涘缓鎸夐挳 @@ -324,14 +295,10 @@ }, // 淇敼鎸夐挳 - editClickHandler() { - if (func.isEmptyObject(this.nodeRow)) { - this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹紒'); - return; - } + editClickHandler(row) { + this.form = {...row}; this.visible = true; this.dialogTitle = 'edit'; - this.form = this.nodeRow; }, // 鏂板淇敼瀵硅瘽妗嗗叧闂� @@ -359,7 +326,7 @@ saveFunction(this.form).then(res => { if (res.data.code === 200) { this.$message.success(res.data.obj); - this.getTreeList(); + this.getTableList(); this.visible = false; } else { this.$message.error(res.data.obj); @@ -374,22 +341,17 @@ }, // 鍒犻櫎鎸夐挳 - delClickHandler() { - if (func.isEmptyObject(this.nodeRow)) { - this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹紒'); - return; - } + delClickHandler(row) { this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬暟鎹悧锛�', '鎻愮ず', { confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', type: 'warning' }).then(() => { - const list = [this.nodeRow]; + const list = [row]; deleteVersionRule(list).then(res => { if (res.data.code === 200) { this.$message.success(res.data.obj); - this.getTreeList(); - this.nodeRow = {}; + this.getTableList(); } }) }).catch(() => { @@ -402,12 +364,17 @@ // 瀵煎嚭 exportClickHandler() { - if (func.isEmptyObject(this.nodeRow)) { + if (this.selectList.length <= 0) { this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹紒'); return; } - exportVersionRule({vrNames: this.nodeRow.id}).then(res => { + if (this.selectList.length > 1) { + this.$message.error('鍙兘閫夋嫨涓�鏉℃暟鎹紒'); + return; + } + + exportVersionRule({vrNames: this.selectList[0].id}).then(res => { func.downloadFileByBlobHandler(res); this.$message.success('瀵煎嚭鎴愬姛'); }).catch(err => { @@ -422,11 +389,16 @@ // 鏌ョ湅浣跨敤鑼冨洿 checkViewClickHandler() { - if (func.isEmptyObject(this.nodeRow)) { + if (this.selectList.length <= 0) { this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹紒'); return; } - getUsedVersionRuleList({vrName: this.nodeRow.id}).then(res => { + + if (this.selectList.length > 1) { + this.$message.error('鍙兘閫夋嫨涓�鏉℃暟鎹紒'); + return; + } + getUsedVersionRuleList({vrName: this.selectList[0].id}).then(res => { if (res.data.code === 200) { this.checkViewVisible = true; const data = res.data.data; @@ -458,6 +430,27 @@ checkHandleReset() { this.checkViewData = this.checkViewDataSearch; }, + + // 閫夋嫨妗� + selectChange(row) { + this.selectList = row; + }, + + // 鐐瑰嚮琛� + rowClickHandler(row) { + func.rowClickHandler( + row, + this.$refs.crud, + this.lastIndex, + (newIndex) => { + this.lastIndex = newIndex; + }, + () => { + this.selectList = []; + } + ); + }, + } } </script> diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue index 0561cfc..3490a9d 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue @@ -528,7 +528,7 @@ //鑾峰彇鏌ヨ妯℃澘瀹氫箟涓嬫媺 getTemp(btmName,linkFlag) { if (btmName) { - queryTemplateListByAttr({btmName: btmName, linkFlag: linkFlag,direction:this.form.direction}).then(res => { + queryTemplateListByAttr({btmName: btmName, linkFlag: linkFlag,direction:linkFlag?null:this.form.direction}).then(res => { const data = res.data.data.map(item => { item.label = item.name + '-' + (item.linkTypeName || item.btmName); item.value = item.name; diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue index 5b8d5cf..1463262 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue @@ -251,7 +251,7 @@ this.tableLoading = false; }) }, - selectHandler(selection, row){debugger; + selectHandler(selection, row){ this.dialogSelectionRow=selection }, changeTemp(data) { 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 f3d3a47..78bea66 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 @@ -184,6 +184,8 @@ }); this.treeData = data; this.treeLoading = false; + }).catch(error => { + loading.close(); }); }, @@ -384,12 +386,10 @@ this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�'); return; } - console.log(this.selectList); const params = { ids: this.selectList.map(item => item.id).join(',') } deleteByIds(params).then(res => { - console.log(res); if (res.data.code === 200) { this.$message.success('鍒犻櫎鎴愬姛'); this.getRightPortalVIDatas(); @@ -397,7 +397,14 @@ }) }, - + rowDeleteHandler(row){ + deleteByIds({ids:row.id}).then(res => { + if (res.data.code === 200) { + this.$message.success('鍒犻櫎鎴愬姛'); + this.getRightPortalVIDatas(); + } + }) + }, // 澶氶�� selectChangeHandler(row) { this.selectList = row; diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue index e83166d..4870af7 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue @@ -6,12 +6,12 @@ <!-- 宸︿晶鏍� --> <div style="height: calc(100vh - 190px);"> <avue-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> - {{ (node || {}).label }} - </span> - </span> + <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> @@ -20,36 +20,323 @@ <el-main> <basic-container> - + <avue-crud + ref="crud" + :data="data" + :option="option" + :page.sync="page" + :table-loading="tableLoading" + @size-change="sizeChange" + @current-change="currentChange" + @selection-change="selectChangeHandler" + @search-change="handleSearch" + @search-reset="handleReset" + @row-click="rowClickHandler"> + <template slot="menuLeft"> + <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">鍒涘缓</el-button> + <!--<el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">淇敼</el-button> + <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">鍒犻櫎</el-button>--> + <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭</el-button> + <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">瀵煎叆</el-button> + <el-button icon="el-icon-place" plain size="small" type="primary" @click="">鎺堟潈</el-button> + </template> + <template slot="menu" slot-scope="scope"> + <el-button icon="el-icon-edit" size="small" type="text" @click="rowEditBtnClick(scope.row)">缂栬緫 + </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> + </template> + <template slot="plName" slot-scope="{row}"> + <el-link type="primary" @click="linkClickHandler(row)">{{ row.plName }}</el-link> + </template> + </avue-crud> + <!-- 鍒涘缓缂栬緫鑷畾涔夊璇濇 --> + <el-dialog + v-dialogDrag + v-loading="dialogLoading" + :title="dialogType === 'add' ? ' 鍒涘缓 涓婁笅鏂�' : '缂栬緫 涓婁笅鏂�'" + :visible.sync="dialogVisible" + append-to-body="true" + class="avue-dialog" + :close-on-click-modal="false" + width="500px" + @close="dialogClose" + > + <el-form ref="form" :model="form" :rules="rules" label-width="95px" size="small"> + <el-form-item label="鍚嶇О锛�" prop="plName"> + <el-input v-model="form.plName"></el-input> + </el-form-item> + <el-form-item label="UI涓婁笅鏂囷細" prop="plCode"> + <el-input v-model="form.plCode"></el-input> + </el-form-item> + <el-form-item label="鏄剧ず锛�" prop="plIsShow"> + <el-checkbox-group v-model="form.plIsShow"> + <el-checkbox label="瀵艰埅鍖�"></el-checkbox> + <el-checkbox label="鎺у埗鍖�"></el-checkbox> + <el-checkbox label="鎿嶄綔鍖�"></el-checkbox> + </el-checkbox-group> + </el-form-item> + <el-form-item label="鎻忚堪锛�" prop="plDesc"> + <el-input type="textarea" :rows="5" v-model="form.plDesc"></el-input> + </el-form-item> + </el-form> + <span slot="footer" class="dialog-footer"> + <el-button @click="dialogClose">鍙� 娑�</el-button> + <el-button type="primary" @click="saveHandler">纭� 瀹�</el-button> + </span> + </el-dialog> + <!-- 鍏嬮殕 --> + <el-dialog + key="cloneDialog" + v-dialogDrag + title="鍏嬮殕" + :visible.sync="cloneDialogVisible" + append-to-body="true" + class="avue-dialog" + width="500px" + @close="cloneDialogClose" + > + <avue-form ref="cloneForm" :option="cloneOption" v-model="cloneForm"></avue-form> + <span slot="footer" class="dialog-footer"> + <el-button @click="cloneDialogClose">鍙� 娑�</el-button> + <el-button type="primary" @click="cloneSaveHandler">纭� 瀹�</el-button> + </span> + </el-dialog> + <!-- 瀵煎嚭 --> + <el-dialog + key="cloneDialog" + v-dialogDrag + title="瀵煎嚭" + :visible.sync="expDialogVisible" + append-to-body="true" + class="avue-dialog" + width="500px" + @close="expDialogVisible=false" + > + <div style="height: 70%;min-height: 300px"> + <avue-tree ref="expTree" :data="expTreeData" :option="expOption"></avue-tree> + </div> + <span slot="footer" class="dialog-footer"> + <el-button @click="expDialogVisible=false">鍙� 娑�</el-button> + <el-button type="primary" @click="exportData">纭� 瀹�</el-button> + </span> + </el-dialog> </basic-container> + <!-- 瀵煎叆 --> + <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" :fileData="fileData" title="瀵煎叆" + @updata="getTableList" @upfaildata="upFail"></upload-file> + <el-dialog v-dialogDrag + :title="dialog.title" + :visible.sync="dialog.showDialog" + :fullscreen="true" + :append-to-body="true" + class="avue-dialog" + :destroy-on-close="true" + :close-on-click-modal="false" + @close="dialog.showDialog=false"> + <pl-show :uiDefineData="dialog.uiDefineData"></pl-show> + </el-dialog> </el-main> </el-container> </template> <script> -import {getBizTypes} from "@/api/modeling/businessType/api"; +import {getBizTree,gridUIContextData,saveUIContextData,updateUIContextData,delUIContextData, cloneUIContextData ,getExpContextTree,expUIContextData} from "@/api/UI/uiDefine"; +import basicOption from "@/util/basic-option"; +import func from "@/util/func"; +import plShow from "@/views/modelingMenu/ui/uiDefine/rightRegion/plShow"; export default { name: "index", + components:{plShow}, data() { return { + dialog: { + showDialog: false, + title: "涓婁笅鏂囪鎯�", + loading: false, + uiDefineData:null + }, + tipList: [], + upFileType: ['xls'], + fileUrl: 'api/uiManagerController/impUIContextData', + fileData:{}, + lastIndex: null, treeOption: { height: 'auto', - defaultExpandedKeys: ['topNode'], + defaultExpandAll: true, menu: false, addBtn: false, props: { - label: 'label', + label: 'text', value: 'oid', children: 'children' } }, nodeRow: {}, - treeData: [{ - label: '涓氬姟绫诲瀷鏍�', - oid: 'topNode', - children: [] - }], + treeData: [], + searchParams: { + 'conditionMap[txtName]': '', + 'conditionMap[txtCode]': '', + }, + tableLoading: false, + page: { + currentPage: 1, + pageSize: 50, + total: 0, + pageSizes: [10, 30, 50, 100], + }, + selectList: [], + option: { + ...basicOption, + calcHeight: -40, + addBtn: false, + editBtn: false, + delBtn: false, + tip: false, + searchMenuSpan: 6, + align:'left', + column: [{ + label: '鍚嶇О', + prop: 'plName', + search: true + }, { + label: 'UI涓婁笅鏂�', + prop: 'plCode', + search: true, + sortable: true, + }, { + label: '瀵艰埅鍖�', + prop: 'plIsShowNavigator', + width: 130, + align:'center', + formatter: function (row, value) { + if (row.plIsShowNavigator == 0) { + return '涓嶆樉绀�' + } else { + return '鏄剧ず' + } + } + }, { + label: '鎺у埗鍖�', + prop: 'plIsShowForm', + width: 130, + align:'center', + formatter: function (row, value) { + if (row.plIsShowForm == 0) { + return '涓嶆樉绀�' + } else { + return '鏄剧ず' + } + } + }, { + label: '鎿嶄綔鍖�', + prop: 'plIsShowTab', + width: 130, + align:'center', + formatter: function (row, value) { + if (row.plIsShowTab == 0) { + return '涓嶆樉绀�' + } else { + return '鏄剧ず' + } + } + }] + }, + data: [], + dialogLoading: false, + dialogVisible: false, + dialogType: '', + form: { + plName: '', + plCode: '', + plIsShow: [], + }, + rules: { + plName: [{ + required: true, + message: '璇疯緭鍏ュ悕绉�', + trigger: 'blur' + }], + plCode: [{ + required: true, + message: '璇疯緭鍏I涓婁笅鏂�', + trigger: 'blur' + }], + plIsShow: [{ + required: true, + message: '璇烽�夋嫨鏄剧ず鍖哄煙', + trigger: 'blur' + }] + }, + cloneDialogVisible:false, + cloneOption: { + submitBtn:false, + emptyBtn:false, + column: [{ + label: '鍏嬮殕鐩爣', + prop: 'cloneTargetName', + span:24, + type: 'tree', + clearable: true, + dicData: [], + defaultExpandAll:true, + rules: [ + { + required: true, + message: '璇烽�夋嫨鍏嬮殕鐩爣', + trigger: 'blur' + } + ] + }, { + label: 'UI鍚嶇О', + prop: 'cloneName', + span:24, + type: 'input', + rules: [ + { + required: true, + message: '璇疯緭鍏I鍚嶇О', + trigger: 'blur' + } + ] + }, { + label: 'UI涓婁笅鏂�', + prop: 'cloneContextCode', + span:24, + type: 'input', + rules: [ + { + required: true, + message: '璇疯緭鍏I涓婁笅鏂�', + trigger: 'blur' + } + ] + }] + }, + cloneForm:{ + //鍏嬮殕鐨勬簮瀵硅薄鐨勪俊鎭� + sourcePLUILayout:null, + cloneTargetName:'n', + cloneName:'', + cloneContextCode:'' + }, + expDialogVisible:false, + expTreeData:[], + expOption:{ + height: 'auto', + filter:false, + multiple:true, + defaultExpandAll: true, + menu: false, + addBtn: false, + props: { + label: 'text', + value: 'oid', + children: 'children' + } + } } }, created() { @@ -59,12 +346,19 @@ //鏍戣〃鏌ヨ getTreeList() { const loading = this.$loading({}); - getBizTypes().then(res => { - const data = res.data.data.map(item => { - item.attributes.label = item.attributes.id; - return item.attributes; + getBizTree().then(res => { + this.treeData=[res.data.obj]; + const dicData = res.data.obj.children.map(item => { + item.label=item.attributes.name; + item.value=item.attributes.name; + return item; }); - this.treeData[0].children = data; + this.cloneOption.column[0].dicData=[{ + label:'涓氬姟绫诲瀷鏍�', + value:'涓氬姟绫诲瀷鏍�', + disabled: true, + children:dicData + }]; loading.close(); }).catch(error => { loading.close(); @@ -72,8 +366,294 @@ }, // 鏍戠偣鍑� nodeClick(row) { - this.nodeRow = row; + if (row.oid) { + this.nodeRow = row; + this.tableLoading = true; + this.getTableList(); + } }, + getTableList(){ + const params = Object.assign(this.searchParams,{ + 'conditionMap[btmName]': this.nodeRow.attributes.name, + }) + gridUIContextData(this.page.currentPage, this.page.pageSize, params).then(res => { + this.data = res.data.data; + this.page.total = res.data.total; + this.$refs.crud.clearSelection(); + this.tableLoading = false; + }) + }, + linkClickHandler(row){ + this.dialog.title='銆�'+row.plName+' - '+row.plCode+'銆戣鎯�' + this.dialog.uiDefineData=row; + this.dialog.showDialog=true; + return false; + this.$router.push({ + path: '/UIDefineShow/:'+row.plOId, + name: row.plName+'璇︽儏' + }); + }, + sizeChange(val) { + this.page.pageSize = val; + }, + // 椤电爜 + currentChange(val) { + this.page.currentPage = val; + }, + // 澶氶�� + selectChangeHandler(row) { + this.selectList = row; + }, + // 鎼滅储 + handleSearch(params, done) { + this.searchParams = { + 'conditionMap[txtName]': params.plName, + 'conditionMap[txtCode]': params.plCode, + }; + this.getTableList() + done(); + }, + + // 閲嶇疆鎼滅储鏉′欢 + handleReset() { + this.searchParams = {}; + this.getTableList(); + }, + // 琛岀偣鍑� + rowClickHandler(row) { + func.rowClickHandler( + row, + this.$refs.crud, + this.lastIndex, + (newIndex) => { + this.lastIndex = newIndex; + }, + () => { + this.selectList = []; + } + ); + }, + + //鍒涘缓 + addHandler(){ + if(this.nodeRow && this.nodeRow.oid){ + this.form.plIsShow=[]; + this.form.plRelatedType=this.nodeRow.attributes.name; + this.dialogType = 'add'; + this.dialogVisible = true; + }else { + this.$message.error('璇烽�夋嫨涓氬姟绫诲瀷'); + } + + }, + editHandler(){ + if(this.selectList.length!=0){ + this.rowEditBtnClick(this.selectList[0]); + }else { + this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹繘琛岀紪杈�'); + } + }, + delHandler(){ + if (this.selectList.length <= 0) { + this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�'); + return; + } + const params = { + oids: this.selectList.map(item => item.plOId).join(',') + } + this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬暟鎹悧锛�', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + delUIContextData(params).then(res => { + if (res.data.code === 200) { + this.$message.success('鍒犻櫎鎴愬姛'); + this.getTableList(); + } + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }); + }); + }, + + // 鍏抽棴瀵硅瘽妗� + dialogClose() { + this.dialogVisible = false; + this.$refs.form.clearValidate(); + this.form = { + plName: '', + plCode: '', + plDesc:'', + plIsShow: [], + } + }, + // 淇濆瓨UI涓婁笅鏂� + saveHandler() { + this.$refs.form.validate((valid,done) => { + if (valid) { + let params = { + ...this.form + } + if(this.form.plIsShow.includes('瀵艰埅鍖�')){ + params.plIsShowNavigator=1 + }else { + params.plIsShowNavigator=0 + } + if(this.form.plIsShow.includes('鎺у埗鍖�')){ + params.plIsShowForm=1; + }else { + params.plIsShowForm=0; + } + if(this.form.plIsShow.includes('鎿嶄綔鍖�')){ + params.plIsShowTab=1; + }else { + params.plIsShowTab=0; + } + delete params.plIsShow; + if (this.dialogType === 'add') { + saveUIContextData(params).then(res => { + if (res.data.code === 200) { + this.$message.success('娣诲姞鎴愬姛'); + this.dialogClose(); + this.getTableList(); + } + }) + } else if (this.dialogType === 'edit') { + updateUIContextData(params).then(res => { + if (res.data.code === 200) { + this.$message.success('淇敼鎴愬姛'); + this.dialogClose() + this.getTableList(); + } + }) + } + } else { + return false; + } + }); + }, + // 瀵煎嚭 + exportClickHandler() { + if (this.selectList.length <= 0) { + this.$message.error('璇烽�夋嫨鏁版嵁'); + return; + } + const params = { + expDatas: this.selectList.map(item => item.plOId).join(',') + } + getExpContextTree(params).then(res => { + this.expTreeData=[res.data.obj]; + }) + this.expDialogVisible=true; + }, + exportData(){ + const params = {} + const checkedDatas=this.$refs.expTree.getCheckedNodes(); + if (checkedDatas.length <= 0) { + this.$message.error('璇烽�夋嫨鏁版嵁'); + return; + } + this.selectList.forEach(item=>{ + params[item.plOId]=checkedDatas.filter(checkitem => checkitem.parentId==item.plOId).map(checkitem => checkitem.oid).join(',') + }) + expUIContextData(params).then(res => { + func.downloadFileByBlobHandler(res); + this.$message.success('瀵煎嚭鎴愬姛'); + this.expDialogVisible=false; + }).catch(err => { + this.$message.error(err); + }); + }, + + // 瀵煎叆 + upLoadClickHandler() { + this.fileData={ + isCovered:false, + selectBtm:this.nodeRow.attributes.name + } + this.$refs.upload.visible = true; + }, + //瀵煎叆澶辫触 + upFail(response){ + + }, + // 缂栬緫鎸夐挳 + rowEditBtnClick(row) { + this.form={ + ...row, + plIsShow: [], + }; + if(row.plIsShowNavigator){ + this.form.plIsShow.push('瀵艰埅鍖�') + } + if(row.plIsShowForm){ + this.form.plIsShow.push('鎺у埗鍖�') + } + if(row.plIsShowTab){ + this.form.plIsShow.push('鎿嶄綔鍖�') + } + this.dialogType = 'edit'; + this.dialogVisible = true; + }, + // 鍒犻櫎鎸夐挳 + rowDeleteHandler(row) { + this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬暟鎹悧锛�', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + delUIContextData({oids: row.plOId}).then(res => { + if (res.data.code === 200) { + this.$message.success('鍒犻櫎鎴愬姛'); + this.getTableList(); + } + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }); + }); + }, + //鍏嬮殕 + rowCloneHandler(row){ + this.cloneForm={ + sourcePLUILayout:row, + cloneTargetName:'', + cloneName:row.plName+'_copy(0)', + cloneContextCode:row.plCode+'_copy(0)', + } + this.cloneDialogVisible=true; + }, + cloneSaveHandler(){ + this.$refs.cloneForm.validate((valid,done) => { + if (valid) { + cloneUIContextData(this.cloneForm).then(res => { + if (res.data.code === 200) { + this.$message.success('鍏嬮殕鎴愬姛'); + this.cloneDialogClose(); + this.getTableList(); + } + }) + } else { + return false; + } + }); + }, + cloneDialogClose(){ + this.cloneDialogVisible=false; + this.cloneForm= { + //鍏嬮殕鐨勬簮瀵硅薄鐨勪俊鎭� + sourcePLUILayout: null, + cloneTargetName: '', + cloneName: '', + cloneContextCode: '' + } + } } } </script> diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/components/action.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/components/action.vue new file mode 100644 index 0000000..952ab1a --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/components/action.vue @@ -0,0 +1,433 @@ +<template> + <el-dialog + v-dialogDrag + :visible.sync="btnActionVisible" + append-to-body="true" + class="avue-dialog" + title="閫夋嫨Action" + width="70%" + @close="dialogClose"> + <el-container> + <el-aside> + <basic-container> + <!-- 宸︿晶鏍� --> + <div> + <avue-tree + ref="tree" + v-model="treeForm" + :data="treeData" + :option="treeOption" + node-key="value" + @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> + {{ (node || {}).label }} + </span> + </span> + </avue-tree> + </div> + </basic-container> + </el-aside> + + <el-main> + <basic-container> + <div> + <avue-crud + ref="crud" + v-model="form" + :data="data" + :option="option" + :page.sync="page" + :table-loading="tableLoading" + @search-change="handleSearch" + @search-reset="handleReset" + @refresh-change="handleRefresh" + @selection-change="selectChangeHandler" + @row-click="rowClickHandler"> + <template slot="plTypeType" slot-scope="{row}"> + <el-tag :type="row.plTypeType === 'business' ? '' : 'success'"> + {{ row.plTypeType === 'business' ? '涓氬姟绫诲瀷' : '閾炬帴绫诲瀷' }} + </el-tag> + </template> + + </avue-crud> + </div> + </basic-container> + </el-main> + + + </el-container> + <span slot="footer" class="dialog-footer"> + <el-button @click="btnActionVisible = false">鍙� 娑�</el-button> + <el-button type="primary" @click="actionSaveHandler">纭� 瀹�</el-button> + </span> + </el-dialog> +</template> + +<script> +import { + getActionTree, + getActionTableData, +} from '@/api/UI/Action/api' +import func from "@/util/func"; +import basicOption from "@/util/basic-option"; + +export default { + name: "index", + data() { + return { + btnActionVisible: false, + currenRow: {}, // action褰撳墠琛屼俊鎭� + topMethodsObj: { + select: true, + all: true, + page: false + }, + transferTitle: ['鏈�夋嫨', '宸查�夋嫨'], + leftRoleData: [], + rightRoleData: [], + form: {}, + bottomTableLoading: false, + 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: { + ...basicOption, + addBtn: false, + height: 500, + highlightCurrentRow: true, + menu:false, + column: [ + { + label: '缂栧彿', + prop: 'plCode', + search: true, + rules: [ + { + required: true, + message: '璇疯緭鍏ョ紪鍙�', + trigger: 'blur' + } + ] + }, + { + label: '鍚嶇О', + prop: 'plName', + search: true, + rules: [ + { + required: true, + message: '璇疯緭鍏ュ悕绉�', + trigger: 'blur' + } + ] + }, + { + label: '绫昏矾寰�', + prop: 'plCSClass', + search: true, + overHidden: true, + }, + { + label: '鍒嗙被', + prop: 'plActionCls', + type: 'tree', + hide: true, + props: { + label: 'name', + value: 'id', + children: 'childs' + }, + rules: [ + { + required: true, + message: '璇烽�夋嫨鍒嗙被', + trigger: 'blur' + } + ], + dicData: [] + }, + { + label: '閾炬帴鍦板潃', + prop: 'plBSUrl', + search: true, + }, + { + label: '绫诲瀷', + prop: 'plTypeType', + search: true, + type: 'select', + dicData: [{ + label: '涓氬姟绫诲瀷', + value: 'business' + }, { + label: '閾炬帴绫诲瀷', + value: 'link' + }], + rules: [ + { + required: true, + message: '璇烽�夋嫨绫诲瀷', + trigger: 'blur' + } + ] + }, + { + label: '鎻忚堪', + prop: 'plDesc', + search: true, + overHidden: true, + }, + ] + }, + treeNodeRow: {}, + treeForm: {}, + treeOption: { + 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: [], + } + }, + created() { + this.getTreeList(); + }, + methods: { + // 宸︿晶鏍戣姹� + getTreeList(status) { + const params = { + isExp: status ? true : false + } + getActionTree(params).then(res => { + const data = res.data.obj; + this.treeData = [data]; + const selectTreeData = this.option.column.find(item => item.prop === 'plActionCls'); // 鎵惧埌action娣诲姞鍒嗙被鏍� + selectTreeData.dicData = [data]; + }) + }, + + // 宸︿晶鏍戣鐐瑰嚮 + nodeClick(row) { + this.treeNodeRow = row; + this.getRightTableList(row); + this.bottomData = []; + }, + + // 澶撮儴鍒锋柊鎸夐挳 + handleRefresh() { + if (func.isEmptyObject(this.treeNodeRow)) { + return; + } + this.getRightTableList(this.treeNodeRow); + }, + + // 鍙充晶琛ㄦ牸淇℃伅 + getRightTableList(row) { + this.tableLoading = true; + const params = { + plactioncls: row.id + } + getActionTableData(params).then(res => { + const data = res.data.data; + this.data = data; + this.tableLoading = false; + }) + }, + + // 琛ㄦ牸澶氶�� + selectChangeHandler(row) { + this.selectList = row; + }, + + // 琛岀偣鍑� + rowClickHandler(row) { + this.currenRow = row; + func.rowClickHandler( + row, + this.$refs.crud, + this.lastIndex, + (newIndex) => { + this.lastIndex = newIndex; + }, + () => { + this.selectList = []; + } + ); + }, + + // 鎼滅储 + handleSearch(params, done) { + if (func.isEmptyObject(this.treeNodeRow)) { + this.$message.error('璇峰厛鍦ㄥ乏渚ч�夋嫨鑺傜偣鍚庢搷浣�'); + return done(); + } + this.tableLoading = true; + const apiParams = { + plactioncls: this.treeNodeRow.id === 'root' ? '' : this.treeNodeRow.id, + ...params + } + + getActionTableData(apiParams).then(res => { + const data = res.data.data; + this.data = data; + this.tableLoading = false; + }) + done(); + }, + + // 閲嶇疆鎼滅储鏉′欢 + handleReset() { + if (func.isEmptyObject(this.treeNodeRow)) { + this.$message.error('璇峰厛鍦ㄥ乏渚ч�夋嫨鑺傜偣鍚庢搷浣�'); + return; + } + this.getRightTableList(this.treeNodeRow); + }, + + // 淇濆瓨action + actionSaveHandler() { + if (this.selectList.length != 1) { + this.$message.error('鍙兘閫夋嫨涓�鏉℃暟鎹�'); + return; + } + this.$emit('updataAction', this.selectList[0]); + this.dialogClose(); + }, + + dialogClose(){ + this.btnActionVisible = false; + this.data = []; + this.$refs.tree.setCurrentKey(null); + } + + } +} +</script> + +<style lang="scss" scoped> +::v-deep { + .el-scrollbar__wrap { + overflow: auto !important; + } + + .headerCon { + .el-button { + width: 82px; + } + } +} + +.headerCon { + display: flex; + flex-wrap: wrap; + margin-bottom: 5px; + + .el-button + .el-button { + margin-left: 5px; + } + + .el-button { + margin-top: 5px; + } +} + +.headerCon > .el-button:nth-child(4) { + margin-left: 0; +} + +.headerCon > .el-button:nth-child(7) { + margin-left: 0; +} + +.smallBtn { + width: 82px; + text-align: center; + padding-left: 4.5px; +} + +</style> 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 new file mode 100644 index 0000000..bba8a82 --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue @@ -0,0 +1,1190 @@ +<template> + <div> + <avue-crud + ref="crud" + v-model="form" + :data="data" + :option="option" + :table-loading="tableLoading" + @row-del="rowDelHandler" + @row-save="rowSaveHandler" + @row-update="rowUpdateHandler" + @refresh-change="handleRefresh" + @selection-change="selectChangeHandler" + @row-click="rowClickHandler"> + <template slot="menuLeft" slot-scope="scope"> + <el-button icon="el-icon-plus" plain size="small" type="primary" + @click="addClickHandler">澧炲姞 + </el-button> + <el-button icon="el-icon-edit-outline" plain size="small" type="primary" + @click="btnDesignClickHandler">鎸夐挳璁捐 + </el-button> + </template> + + <!-- eventKey浠ュ強eventValue鏄剧ず鍖哄煙 --> + <template slot="bottomValueForm" slot-scope="scope"> + <avue-crud + :data="eventData" + :option="eventOption" + @row-click="formDataRowClick"> + <template slot="menuLeft" slot-scope="scope"> + <el-button plain size="mini" type="primary" @click="formDataAddClickHandler">鍒涘缓</el-button> + </template> + + <template slot="menu" slot-scope="scope"> + <el-button plain size="mini" type="danger" @click="formDataDelClickHandler(scope.row)">鍒犻櫎</el-button> + <el-button plain size="mini" type="primary" @click="moveUp(scope.row)">涓婄Щ</el-button> + <el-button plain size="mini" type="primary" @click="moveDown(scope.row)">涓嬬Щ</el-button> + </template> + </avue-crud> + </template> + + + <!-- 鍒囨崲鎼滅储绫诲瀷 婧愬璞� 鐩爣瀵硅薄鏄剧ずlabel鍒囨崲 --> + <template slot="showTypeLabel" slot-scope="{}"> + <span v-if="form.templateType === '3'">椤剁骇鑺傜偣</span> + <span v-else-if="form.templateType === '5'">涓氬姟绫诲瀷</span> + <span v-else-if="form.templateType === '6'">瀵硅薄绫诲瀷</span> + <span v-else-if="form.searchTarger === '1'">婧愬璞�</span> + <span v-else-if="form.searchTarger === '2'">鐩爣瀵硅薄</span> + </template> + </avue-crud> + <el-dialog + v-dialogDrag + :visible.sync="btnDesignVisible" + append-to-body="true" + class="avue-dialog" + title="閰嶇疆鎸夐挳" + width="75%" + @close="dialogClose"> + <el-container v-loading="dialogLoading"> + <el-header style="height: 40px !important;"> + <div style="display: flex"> + <el-button :disabled="!disabledBtn" plain size="mini" type="primary" @click="addClickBtnHandler">娣诲姞 + </el-button> + <el-button :disabled="!disabledBtn" plain size="mini" type="primary" @click="editClickBtnHandler">淇敼 + </el-button> + <el-button :disabled="!disabledBtn" plain size="mini" type="danger" @click="delClickBtnHandler">鍒犻櫎 + </el-button> + <el-button :disabled="disabledBtn" plain size="mini" type="primary" @click="saveClickBtnHandler">淇濆瓨 + </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">澶嶅埗鍒板叾浠栫粍浠�</el-button> + </div> + </el-header> + <el-container> + <el-aside width="20%"> + <basic-container> + <div style="height:650px;"> + <avue-tree + ref="Tree" + :data="treeData" + :loading="treeLoading" + :option="treeOption" + node-key="value" + @node-click="nodeTreeClick"> + <span slot-scope="{ node, data }" class="el-tree-node__label"> + <span style="font-size: 14px"> + <i class="el-icon-s-promotion"></i> + {{ (node || {}).label }} + </span> + </span> + </avue-tree> + </div> + </basic-container> + </el-aside> + + <el-main> + <basic-container> + <el-divider content-position="left">鍩虹淇℃伅</el-divider> + <el-form ref="form" :model="basicForm" :rules="rules" label-width="90px" size="small" + style="margin-top: 20px"> + <el-row> + <el-form-item :inline-message='true' label="缂栧彿锛�" prop="seq"> + <el-input-number v-model="basicForm.seq" :disabled="disabledBtn" :max="9999" :min="1" + controls-position="right"></el-input-number> + </el-form-item> + + <el-form-item :inline-message='true' label="鍚嶇О锛�" prop="label"> + <el-col :span="14"> + <el-input v-model="basicForm.label" :readonly="disabledBtn"></el-input> + </el-col> + </el-form-item> + + <el-form-item label="Action锛�" prop="Action"> + <el-col :span="14"> + <div style="display: flex"> + <el-input v-model="basicForm.actionName" :readonly="disabledBtn"></el-input> + <el-button :disabled="disabledBtn" size="mini" style="margin-left: 10px" type="success" + @click="actionFoucus">閫夋嫨 + </el-button> + </div> + </el-col> + </el-form-item> + + <el-col :span="12"> + <el-form-item label="鏄惁鎺堟潈锛�" prop="resource"> + <el-radio v-model="basicForm.authorization" :disabled="disabledBtn" label="0">鏄�</el-radio> + <el-radio v-model="basicForm.authorization" :disabled="disabledBtn" label="1">鍚�</el-radio> + </el-form-item> + </el-col> + + <el-col :span="12"> + <el-form-item label="鏄惁鏄剧ず锛�" prop="show"> + <el-radio v-model="basicForm.show" :disabled="disabledBtn" label="0">鏄�</el-radio> + <el-radio v-model="basicForm.show" :disabled="disabledBtn" label="1">鍚�</el-radio> + </el-form-item> + </el-col> + + <el-col :span="12"> + <el-form-item label="鏄剧ず鏂瑰紡锛�" prop="showType"> + <el-radio v-model="basicForm.displayMode" :disabled="disabledBtn" label="text">鏂囧瓧</el-radio> + <el-radio v-model="basicForm.displayMode" :disabled="disabledBtn" label="image">鍥炬爣</el-radio> + <el-radio v-model="basicForm.displayMode" :disabled="disabledBtn" label="textandimage">鏂囧瓧鍜屽浘鏍� + </el-radio> + </el-form-item> + </el-col> + + <el-col :span="12"> + <el-form-item label="鎻愮ず淇℃伅锛�" prop="desc"> + <el-input v-model="basicForm.desc" :readonly="disabledBtn" type="textarea"></el-input> + </el-form-item> + </el-col> + + </el-row> + </el-form> + + <el-divider content-position="left">鍙傛暟淇℃伅</el-divider> + <avue-crud + ref="paramsCrud" + v-model="paramsForm" + :data="paramsData" + :option="paramsOption" + style="margin-top: 20px" + @row-save="paramsRowSave" + @row-update="paramsRowUpdate"> + <template slot="menuLeft" slot-scope="scope"> + <el-button :disabled="disabledBtn" icon="el-icon-plus" plain size="small" type="primary" + @click="paramsRowAddClickHandler">鍒涘缓 + </el-button> + </template> + + <template slot="menu" slot-scope="scope"> + <el-button :disabled="disabledBtn" icon="el-icon-edit" size="small" type="text" + @click="paramsRowEditHandler(scope.row)">淇敼 + </el-button> + <el-button :disabled="disabledBtn" icon="el-icon-delete" size="small" type="text" + @click="paramsRowDeleteHandler(scope.row)">鍒犻櫎 + </el-button> + </template> + + </avue-crud> + </basic-container> + </el-main> + </el-container> + </el-container> + </el-dialog> + <action-dialog ref="actionDialog" @updataAction="actionSaveHandler"></action-dialog> + </div> +</template> + +<script> +import basicOption from "@/util/basic-option"; +import func from "@/util/func"; +import { + getPLPageDefinations, + getBtmDatasByPage, + getPortalVIDatasByPage, + getQTInfoDatasByPage, + getTabButtons, + addTapButton, + updateTapButton, getTabByContextIdAndType +} from "@/api/UI/uiDefine"; +import actionDialog from '@/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/components/action'; + +export default { + props: { + sourceData: { + type: Object, + default: () => { + } + }, + height: { + type: String, + default: () => "auto" + } + }, + components: { + actionDialog + }, + name: "index", + data() { + return { + paramsForm:{}, + eventOption: { + ...basicOption, + addBtn: false, + editBtn: false, + delBtn: false, + refreshBtn: false, + highlightCurrentRow: true, + height: 200, + column: [ + { + label: 'EventKey', + prop: 'eventKey', + type: 'select', + value: 'SelectionEvent', + dicData: [ + { + label: 'SelectionEvent', + value: 'SelectionEvent' + }, + { + label: 'DBClickEvent', + value: 'DBClickEvent' + }, + { + label: 'ClickEvent', + value: 'ClickEvent' + } + ], + cell: true + }, + { + label: 'EventValue', + prop: 'eventValue', + cell: true, + rules: [ + { + required: true, + message: '璇疯緭鍏ventValue', + trigger: 'blur' + } + ] + } + ] + }, + eventData: [], + btnActionVisible: false, + dialogLoading: false, + saveType: '', + disabledBtn: true, + paramsData: [], + nodeTreeRow: {}, + paramsOption: { + ...basicOption, + height: 260, + addBtn: false, + tip: false, + editBtn: false, + delBtn: false, + refreshBtn: false, + column: [ + { + label: '鍚嶇О', + prop: 'name', + span: 24, + rules: [ + { + required: true, + message: '璇疯緭鍏ュ悕绉�', + trigger: 'blur' + } + ] + }, + { + label: '鍊�', + prop: 'value', + span: 24, + rules: [ + { + required: true, + message: '璇疯緭鍏ュ��', + trigger: 'blur' + } + ] + } + ] + }, + rules: { + seq: [ + {required: true, message: '璇疯緭鍏ョ紪鍙�', type: 'number', trigger: 'blur'}, + ], + label: [ + {required: true, message: '璇疯緭鍏ュ悕绉�', trigger: 'blur'}, + ], + }, + // 鎸夐挳璁捐 鍩虹淇℃伅 + basicForm: { + seq: 1 + }, + treeData: [], + treeOption: { + menu: false, + addBtn: false, + defaultExpandedKeys: ['parentNode'], + props: { + label: 'label', + value: 'oId', + children: 'children', + }, + }, + treeLoading: false, + btnDesignVisible: false, + FormData: [], + form: {}, + data: [], + option: { + ...basicOption, + height: this.height, + addBtn: false, + index: true, + calcHeight: -30, + column: [ + { + label: '鍚嶇О', + prop: 'name', + rules: [ + { + required: true, + message: '璇疯緭鍏ュ悕绉�', + trigger: 'blur' + } + ] + }, + { + label: '缂栧彿', + prop: 'seq', + hide: false, + rules: [ + { + required: true, + message: '璇疯緭鍏ョ紪鍙�', + trigger: 'blur' + } + ], + }, + { + label: 'UI瑙f瀽绫诲瀷', + prop: 'uiParser', + hide: true, + }, + { + label: '鎵╁睍灞炴��', + prop: 'extAttr', + hide: true, + }, + { + label: '妯℃澘绫诲瀷', + prop: 'templateType', + type: 'radio', + span: 24, + value: '1', + dicData: [ + { + label: 'Table(琛ㄦ牸)', + value: '1' + }, + { + label: 'Custom锛堣嚜瀹氫箟妯℃澘锛�', + value: '2' + }, + { + label: 'TreeTable(鏍戣〃)', + value: '3', + }, + { + label: 'Form(琛ㄥ崟)', + value: '4', + }, + { + label: 'Tree(鏍�)', + value: '5', + }, + { + label: 'UILayout(UI瀹氫箟)', + value: '6', + } + ], + formatter: (row) => { + const val = this.templateTypeValueHandler(row.templateType); + return val; + }, + change: (val) => { + console.log(val); + const searchTarger = this.option.column.find(item => item.prop === 'searchTarger'); // 鑾峰彇鎼滅储绫诲瀷閰嶇疆椤� + searchTarger.display = true; // 鍒囨崲榛樿灞曠ず鎼滅储绫诲瀷 + // 妯℃澘绫诲瀷涓鸿〃鏍� + this.templateTypeTable(val.value === '1'); + // 妯℃澘绫诲瀷涓鸿嚜瀹氫箟妯℃澘 + this.templateTypeCustom(val.value === '2'); + // 妯℃澘绫诲瀷涓烘爲琛� + this.templateTypeTreeTable(val.value === '3'); + // 妯℃澘绫诲瀷涓鸿〃鍗� + this.templateTypeForm(val.value === '4'); + // 妯℃澘绫诲瀷涓烘爲 + this.templateTypeTree(val.value === '5'); + // 妯℃澘绫诲瀷涓篣I瀹氫箟 + this.templateTypeUI(val.value === '6'); + } + }, + { + label: '鏄剧ず绫诲瀷', + prop: 'navigatorType', + type: 'radio', + span: 24, + value: '1', + hide: true, + dicData: [ + { + label: '涓嶆樉绀�', + value: '1' + }, + { + label: '鏄剧ず瑙掕壊', + value: '2' + }, + { + label: '鏄剧ずFolder', + value: '3', + }, + ], + }, + { + label: '鎼滅储绫诲瀷', + prop: 'searchTarger', + display: true, + type: 'radio', + value: '1', + span: 24, + dicData: [ + { + label: '鏈璞″睘鎬�', + value: '1' + }, + { + label: '鍏宠仈瀵硅薄灞炴��', + value: '2' + }, + ], + formatter: (row) => { + return row.searchTarger === '1' ? '鏈璞″睘鎬�' : '鍏宠仈瀵硅薄灞炴��'; + }, + change: (val) => { + // 濡傛灉妯℃澘绫诲瀷鏄〃鏍笺�� 鏍戣〃 銆� 琛ㄥ崟 鍒囨崲瀵硅薄灞炴�х殑鏃跺�欙紝濡傛灉鏄湰瀵硅薄灞炴�т笉灞曠ず閾炬帴绫诲瀷锛屽惁鍒欏睍绀洪摼鎺ョ被鍨� + if (['1', '3', '4'].includes(this.form.templateType)) { + const obj = this.option.group[0].column.find(item => item.prop === 'linkType'); + obj.display = val.value !== '1'; + } + } + }, + { + label: '鎻忚堪', + prop: 'description', + display: false + }, + ], + group: [ + { + label: '', + arrow: false, + prop: 'group1', + column: [ + { + label: '婧愬璞�', + prop: 'showType', + type: 'table', + display: false, + placeholder: "璇疯緭鍏ュ唴瀹�", + props: { + label: 'name', + value: 'name' + }, + children: { + border: true, + column: [{ + label: '鍚嶇О', + search: true, + searchSpan: 24, + prop: 'name' + }, { + label: '鏍囩', + prop: 'label' + }], + }, + onLoad: ({page, value, data}, callback) => { + //page鍒嗛〉 + // 涓嶇鏄悳绱� 杩樻槸棣栨鍔犺浇閮戒細瑙﹀彂page 鎵�浠ュ彧闇�瑕佹嬁page瀛樺湪涓庡惁杩涜璇锋眰灏卞彲浠� 濡傛灉鍐嶅幓鍒ゆ柇data鎼滅储 鎴栬�卾alue鍒濇鍔犺浇灏变細閲嶅璇锋眰 + if (page) { + const params = { + "conditionMap[filterInputValue]": value ? value.name : '' + }; + getBtmDatasByPage(page.currentPage, page.pageSize, params).then(res => { + callback({ + total: res.data.total, + data: res.data.data + }) + }) + } + }, + }, + { + label: '閾炬帴绫诲瀷', + prop: 'linkType', + type: 'table', + display: false, + 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 + }) + }) + } + }, + }, + { + label: '閫夋嫨妯℃澘', + prop: 'showTypea', + display: false, + type: 'table', + 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 + }) + }) + } + }, + }, + { + label: 'UI瀹氫箟', + prop: 'UI', + type: 'table', + display: false, + props: { + label: 'qtName', + value: 'qtName' + }, + 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 + }) + }) + } + }, + }, + { + label: '鏌ヨ绫诲瀷', + prop: 'searchType', + display: false, + type: 'radio', + span: 24, + dicData: [ + { + label: '涓氬姟绫诲瀷', + value: '1' + }, + { + label: '閾炬帴绫诲瀷', + value: '2' + } + ] + }, + { + label: '鏌ヨ瀵硅薄绫诲瀷', + prop: 'searchObjType', + type: 'table', + display: false, + labelWidth: 100, + props: { + label: 'qtName', + value: 'qtName' + }, + 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 + }) + }) + } + }, + }, + { + label: '鏌ヨ妯℃澘', + prop: 'showTypes', + type: 'table', + display: false, + props: { + label: 'qtName', + value: 'qtName' + }, + 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 + }) + }) + } + }, + }, + { + label: '鎺у埗璺緞', + prop: 'kzlj', + display: false, + type: 'textarea', + rows: 3 + }, + { + label: '鏍硅妭鐐规樉绀鸿〃杈惧紡', + prop: 'genjiedian', + display: false, + labelWidth: 135, + span: 24 + }, + { + label: '鏍戣妭鐐规樉绀鸿〃杈惧紡', + prop: 'shujiedian', + display: false, + labelWidth: 135, + span: 24 + }, + { + label: '鍙傜収鏍戣缃�', + prop: 'canzhaoshu', + display: false, + }, + { + label: '鍒嗛殧绗�', + prop: 'fgf', + display: false, + }, + { + label: '灞曞紑鏂瑰紡', + prop: 'zkfs', + display: false, + type: 'radio', + dicData: [ + { + label: '閫愮骇灞曞紑', + value: '1' + }, + { + label: '鍏ㄩ儴灞曞紑', + value: '2' + } + ] + }, + ] + }, + { + label: '', + arrow: false, + prop: 'group2', + column: [ + { + label: '', + prop: 'bottomValue', + span: 24, + labelWidth: 10 + }, + ] + } + ], + }, + tableLoading: false, + lastIndex: null, + selectList: [], + formDataRow: {}, + } + }, + watch: { + sourceData: { + handler(val) { + if (val && val.plOId) { + this.getTableList() + } else { + this.data = []; + } + }, + immediate: true, + deep: true + } + }, + computed: {}, + methods: { + //鑾峰彇鍒楄〃鏁版嵁 + getTableList() { + const params = { + pageContextOId: this.sourceData.plOId + } + getPLPageDefinations(params).then(res => { + this.data = res.data.data; + this.selectList = []; + this.$refs.crud.clearSelection(); + this.tableLoading = false; + }) + }, + // 鏍规嵁涓嶅悓鍊煎尯鍒嗙被鍨� + templateTypeValueHandler(val) { + const componentMap = { + '1': '琛ㄦ牸', + '2': '鑷畾涔夋ā鏉�', + '3': '鏍戣〃', + '4': '琛ㄥ崟', + '5': '鏍�', + '6': 'UI瀹氫箟', + }; + + return componentMap[val] || ""; // 濡傛灉涓虹┖ 杩斿洖绌� + }, + + // 琛ㄦ牸澶氶�� + selectChangeHandler(row) { + this.selectList = row; + }, + + // 琛岀偣鍑� + rowClickHandler(row) { + func.rowClickHandler( + row, + this.$refs.crud, + this.lastIndex, + (newIndex) => { + this.lastIndex = newIndex; + }, + () => { + this.selectList = []; + } + ); + }, + + // 澧炲姞 + addClickHandler() { + console.log(this.sourceData); + if (!this.sourceData || !this.sourceData.plOId) { + this.$message.error('璇峰湪涓婃柟閫夋嫨涓�鏉℃暟鎹悗杩涜娣诲姞'); + return; + } + this.$refs.crud.rowAdd(); + }, + + // 瀵硅瘽妗嗚〃鏍艰鐐瑰嚮 + formDataRowClick(row) { + this.formDataRow = row; + }, + + // 瀵硅瘽妗嗚〃鏍兼坊鍔� + formDataAddClickHandler() { + // if (!this.form.eventKey) { + // this.$message.error('璇烽�夋嫨EventKey'); + // return; + // } + // + // if (!this.form.eventValue) { + // this.$message.error('璇疯緭鍏ventValue'); + // return; + // } + // + // if (this.eventData.length >= 1) { + // const eventValueStatus = this.eventData.some(item => item.eventValue === this.form.eventValue); + // + // if (eventValueStatus) { + // this.$message.error('宸插瓨鍦ㄧ浉鍚岀殑 EventValue锛屼笉鑳介噸澶嶆坊鍔�'); + // return; + // } + // } + const obj = { + index: this.eventData.length, + eventKey: this.form.eventKey || 'SelectionEvent', + eventValue: this.form.eventValue, + $cellEdit: true + } + + this.eventData.push(obj); + }, + + // 瀵硅瘽妗嗚〃鏍煎垹闄� + formDataDelClickHandler(row) { + this.eventData = this.eventData.filter(item => item.index !== row.index); + }, + + // 妯℃澘绫诲瀷鏄剧ず闅愯棌鏂规硶 + updateDisplay(val, showTpeMap) { + const groupList = this.option.group[0].column; // 鑾峰彇绗竴灞俫roup鎵�鏈夋暟鎹� + groupList.forEach(item => { + item.display = showTpeMap.includes(item.prop) ? val : !val; // 鏇存柊display + }); + }, + + // 妯℃澘绫诲瀷涓鸿〃鏍� + templateTypeTable(val) { + if (!val) return; + this.updateDisplay(val, ['showType', 'showTypea', 'showTypes']); + }, + + // 妯℃澘绫诲瀷涓鸿嚜瀹氫箟妯℃澘 + templateTypeCustom(val) { + if (!val) return; + const searchTarger = this.option.column.find(item => item.prop === 'searchTarger'); // 鑾峰彇鎼滅储绫诲瀷閰嶇疆椤� + searchTarger.display = false; // 涓嶅睍绀烘悳绱㈢被鍨� + this.updateDisplay(val, ['kzlj']); + }, + + // 妯℃澘绫诲瀷涓烘爲琛� + templateTypeTreeTable(val) { + if (!val) return; + this.updateDisplay(val, ['showType', 'showTypea', 'showTypes', 'zkl', 'zkfs']); + }, + + // 妯℃澘绫诲瀷涓鸿〃鍗� + templateTypeForm(val) { + if (!val) return; + this.updateDisplay(val, ['showType', 'showTypea', 'showTypes']); + }, + + // 妯℃澘绫诲瀷涓烘爲 + templateTypeTree(val) { + if (!val) return; + const searchTarger = this.option.column.find(item => item.prop === 'searchTarger'); // 鑾峰彇鎼滅储绫诲瀷閰嶇疆椤� + searchTarger.display = false; // 涓嶅睍绀烘悳绱㈢被鍨� + this.updateDisplay(val, ['showType', 'showTypes', 'genjiedian', 'shujiedian', 'canzhaoshu', 'fgf', 'zkfs', 'linkType']); + }, + + // 妯℃澘绫诲瀷涓篣I瀹氫箟 + templateTypeUI(val) { + if (!val) return; + const searchTarger = this.option.column.find(item => item.prop === 'searchTarger'); // 鑾峰彇鎼滅储绫诲瀷閰嶇疆椤� + searchTarger.display = false; // 涓嶅睍绀烘悳绱㈢被鍨� + this.updateDisplay(val, ['showType', 'UI', 'searchType', 'searchObjType', 'showTypes']); + }, + + // 鏌ユ壘鏁扮粍涓璞$储寮� + findIndexByEventValue(array, eventValue) { + return array.findIndex(item => item.eventValue === eventValue); + }, + + // 涓婄Щ + moveUp(row) { + const index = this.findIndexByEventValue(this.eventData, row.eventValue); + if (index > 0) { + // 浣跨敤 splice 鏉ユā鎷熶氦鎹� + const temp = this.eventData.splice(index - 1, 1, this.eventData[index])[0]; // 绉婚櫎 index-1 鐨勫厓绱� 骞跺湪鐩稿悓浣嶇疆鎻掑叆 index 鐨勫厓绱� 杩斿洖琚Щ闄ょ殑鍏冪礌 + this.eventData.splice(index, 1, temp); // 鍦� index 浣嶇疆鎻掑叆涔嬪墠琚Щ闄ょ殑鍏冪礌 + } + }, + + // 涓嬬Щ + moveDown(row) { + const index = this.findIndexByEventValue(this.eventData, row.eventValue); + const length = this.eventData.length; + if (index < length - 1) { + const temp = this.eventData[index]; + this.eventData.splice(index, 1, this.eventData.splice(index + 1, 1, temp)[0]); + } + }, + + // 鎸夐挳璁捐鍏抽棴瀵硅瘽妗� + dialogClose() { + + }, + + // 鎸夐挳璁捐 + btnDesignClickHandler() { + if (this.selectList.length != 1) { + this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹�'); + return; + } + this.btnDesignVisible = true; + this.getTabBtnTree(); + }, + + // 宸︿晶鏍戣姹� + getTabBtnTree() { + const params = { + pageDefinationOid: this.selectList[0].id + } + this.treeLoading = true; + getTabButtons(params).then(res => { + if (res.data.code === 200) { + const data = res.data.data; + this.treeData = [{ + label: this.selectList[0].name, + oId: 'parentNode', + children: data + }]; + this.treeLoading = false; + } else { + this.$message.error('璇锋鏌ユ帶鍒跺彴閿欒'); + } + }) + }, + + // 鎸夐挳璁捐琛岀偣鍑� + nodeTreeClick(row) { + this.nodeTreeRow = row; + this.basicForm = {...row}; + this.paramsData = row.buttonParams ? Object.entries(row.buttonParams).map(([key, value]) => ({ + name: key, + value: value + })) : []; + this.disabledBtn = true; + }, + + // 鎸夐挳璁捐鍙傛暟淇℃伅鍒犻櫎 + paramsRowDeleteHandler(row) { + this.paramsData.splice(row.$index, 1) + }, + + // 鎸夐挳璁捐淇℃伅鍙傛暟淇℃伅淇敼 + paramsRowEditHandler(row) { + this.$refs.paramsCrud.rowEdit(row); + }, + + // 鎸夐挳璁捐鍙傛暟淇℃伅娣诲姞鎸夐挳 + paramsRowAddClickHandler() { + this.$refs.paramsCrud.rowAdd(); + }, + + // 鎸夐挳璁捐鍙傛暟淇℃伅淇敼淇濆瓨 + paramsRowUpdate(row, index, done, loading) { + this.paramsData.splice(index, 1, row); + done(); + }, + + // 鎸夐挳璁捐鍙傛暟淇℃伅淇濆瓨 + paramsRowSave(row, done, loading) { + if (!row.name) { + this.$message.error('鍚嶇О涓嶈兘涓虹┖'); + return loading(); + } + + if (!row.value) { + this.$message.error('鍊间笉鑳戒负绌�'); + return loading(); + } + + this.paramsData.push(row); + done(); + }, + + // 鎸夐挳璁捐娣诲姞 + addClickBtnHandler() { + if (func.isEmptyObject(this.nodeTreeRow)) { + this.$message.error('璇烽�夋嫨鑺傜偣杩涜娣诲姞'); + return; + } + this.disabledBtn = false; + this.basicForm = {}; + this.paramsData = []; + this.saveType = 'add'; + }, + + // 鎸夐挳璁捐淇敼 + editClickBtnHandler() { + if (func.isEmptyObject(this.nodeTreeRow)) { + this.$message.error('璇烽�夋嫨鑺傜偣杩涜淇敼'); + return; + } + + if (this.nodeTreeRow.oId === "parentNode") { + this.$message.error('椤跺眰鑺傜偣涓嶅厑璁镐慨鏀�'); + return; + } + + this.disabledBtn = false; + this.saveType = 'edit'; + }, + + // 鎸夐挳璁捐鍙栨秷 + escClickBtnHandler() { + this.disabledBtn = true; + if (this.saveType === 'add') { + this.$refs.Tree.setCurrentKey(null); + } + }, + + // 鎸夐挳璁捐淇濆瓨 + saveClickBtnHandler() { + this.dialogLoading = true; + const saveFunction = this.saveType === 'add' ? addTapButton : updateTapButton; + const bottomParams = {}; + if (this.paramsData.length > 0) { + this.paramsData.forEach(item => { + bottomParams[item.name] = item.value + }) + } + ; + + const params = this.saveType === 'add' ? { + ...this.basicForm, + parentId: this.nodeTreeRow.oId === 'parentNode' ? '' : this.nodeTreeRow.parentId, + buttonParams: bottomParams + } : { + ...this.basicForm, + buttonParams: bottomParams + } + + saveFunction(params).then(res => { + if (res.data.code === 200) { + this.$message.success(res.data.obj); + this.disabledBtn = true; + this.getTabBtnTree(); + this.basicForm = {}; + this.paramsData = []; + this.dialogLoading = false; + } + }).catch(err => { + this.dialogLoading = false; + }) + }, + + // 鎸夐挳璁捐鍒犻櫎 + delClickBtnHandler() { + if (func.isEmptyObject(this.nodeTreeRow)) { + this.$message.error('璇烽�夋嫨鑺傜偣杩涜鍒犻櫎'); + return; + } + + if (this.nodeTreeRow.oId === "parentNode") { + this.$message.error('椤跺眰鑺傜偣涓嶅厑璁稿垹闄�'); + return; + } + + this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬暟鎹悧锛�', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }); + }); + }, + + // 閫夋嫨action + actionFoucus() { + this.$refs.actionDialog.btnActionVisible = true; + }, + + // 淇濆瓨action + actionSaveHandler(val) { + this.$set(this.basicForm, 'actionName', val.plName); + this.$set(this.basicForm, 'actionOId', val.plOId); + } + } +} +</script> + +<style lang="scss" scoped> +.el-divider__text, .el-link { + font-size: 16px !important; +} +</style> diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/plShow.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/plShow.vue new file mode 100644 index 0000000..6c677e5 --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/plShow.vue @@ -0,0 +1,388 @@ +<template> + <div> + <el-tabs v-model="areaType" type="card" @tab-click="handleClick"> + <el-tab-pane v-if="uiDefineData.plIsShowNavigator" label="瀵艰埅鍖�" name="1"></el-tab-pane> + <el-tab-pane v-if="uiDefineData.plIsShowForm" label="鎺у埗鍖�" name="2"></el-tab-pane> + <el-tab-pane v-if="uiDefineData.plIsShowTab" label="鎿嶄綔鍖�" name="3"></el-tab-pane> + </el-tabs> + <avue-crud + ref="crud" + :data="data" + :option="option" + :table-loading="tableLoading" + @selection-change="selectChangeHandler" + @row-click="rowClickHandler"> + <template slot="menuLeft"> + <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">鍒涘缓</el-button> + <!--<el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">淇敼</el-button> + <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">鍒犻櫎</el-button>--> + </template> + <template slot="menu" slot-scope="scope"> + <el-button icon="el-icon-edit" size="small" type="text" @click="rowEditBtnClick(scope.row)">缂栬緫 + </el-button> + <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">鍒犻櫎 + </el-button> + </template> + <template slot="plIsOpen" slot-scope="{row}"> + <el-tag v-if="row.plIsOpen === 1" type="success">鍚敤</el-tag> + <el-tag v-else type="danger">鏈惎鐢�</el-tag> + </template> + </avue-crud> + <bottom-table :sourceData="selectList[0]" :height="'280px'" style="margin-top: 15px;"></bottom-table> + <!-- 鍒涘缓缂栬緫鑷畾涔夊璇濇 --> + <el-dialog + v-dialogDrag + v-loading="dialogLoading" + :title="dialogType === 'add' ? ' 鍒涘缓 椤电' : '缂栬緫 椤电'" + :visible.sync="dialogVisible" + append-to-body="true" + class="avue-dialog" + :close-on-click-modal="false" + width="800px" + @close="dialogClose" + > + <el-form ref="form" :model="form" :rules="rules" label-width="100px" size="small"> + <el-row> + <el-col :span="12"> + <el-form-item label="椤甸潰缂栫爜锛�" prop="plCode"> + <el-input v-model="form.plCode"></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鍚嶇О锛�" prop="plName"> + <el-input v-model="form.plName"></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="搴忓彿锛�" prop="plSeq"> + <el-input v-model="form.plSeq"></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鏄惁鍚敤" prop="plIsOpen"> + <el-switch v-model="form.plIsOpen" :active-value="1" :inactive-value="0" active-color="#13ce66" inactive-color="#ff4949"></el-switch> + </el-form-item> + </el-col> + </el-row> + <el-form-item label="鏄剧ず琛ㄨ揪寮忥細" prop="plOpenExpression"> + <el-input type="textarea" :rows="3" v-model="form.plOpenExpression"></el-input> + </el-form-item> + <el-form-item label="鍥介檯鍖栨爣鍑嗭細" prop="plLabel"> + <el-input type="textarea" :rows="1" v-model="form.plLabel"></el-input> + </el-form-item> + <el-form-item label="鎻忚堪锛�" prop="plDesc"> + <el-input type="textarea" :rows="1" v-model="form.plDesc"></el-input> + </el-form-item> + <el-form-item label="UI瑙f瀽绫伙細" prop="plUIParser"> + <el-input type="textarea" :rows="2" v-model="form.plUIParser"></el-input> + </el-form-item> + <div class="tip"> + <div style="color: #D40000">绀轰緥锛歫ava_cs:xxx;java_bs:xxx;net_cs:xxx;net_bs:xxx;mobile_cs:xxx;mobile_bs:xxx;</div> + <div>1銆佺敤鑻辨枃鍗婅鍒嗗彿;鍒嗛殧鍚勭粍鍊笺��</div> + <div>2銆佹瘡缁勭敤鑻辨枃鍗婅鍐掑彿:鍒嗛殧鍗曚竴鎷撳睍灞炴�у悕绉板強灞炴�у�笺��</div> + <div>3銆佸叾涓殑xxx鏄悇绉嶈В鏋愮被鐨勫畬鏁寸被鍨嬪悕绉帮紙瀹屽叏闄愬畾鍚嶏級銆�</div> + <div>4銆佽緭鍏ユ椂锛屼笉瑕佹暡鍥炶溅鎹㈣銆�</div> + </div> + <el-form-item label="鎷撳睍灞炴�э細" prop="plExtAttr"> + <el-input type="textarea" :rows="2" v-model="form.plExtAttr"></el-input> + </el-form-item> + <div class="tip"> + <div style="color: #D40000">绀轰緥锛歟xt1:xx;ext2:xx;ext3:xxx;ext4:xxx;extn:xxx</div> + <div>1銆佺敤鑻辨枃鍗婅鍒嗗彿;鍒嗛殧鍚勭粍鍊笺��</div> + <div>2銆佹瘡缁勭敤鑻辨枃鍗婅鍐掑彿:鍒嗛殧鍗曚竴鎷撳睍灞炴�у悕绉板強灞炴�у�笺��</div> + <div>3銆佸彲浠ュ畾涔変换鎰忕粍锛屼絾鎬诲瓧绗﹂暱搴︿笉寰楄秴杩�4000銆�</div> + <div>4銆佽緭鍏ユ椂锛屼笉瑕佹暡鍥炶溅鎹㈣銆�</div> + </div> + </el-form> + <span slot="footer" class="dialog-footer"> + <el-button @click="dialogClose">鍙� 娑�</el-button> + <el-button type="primary" @click="saveHandler">纭� 瀹�</el-button> + </span> + </el-dialog> + </div> +</template> + +<script> +import basicOption from "@/util/basic-option"; +import { + getTabByContextIdAndType, + addTabData, + updateTabData, + deleteTabData, +} from "@/api/UI/uiDefine"; +import func from "@/util/func"; +import bottomTable from "./bottomTable/index"; + +export default { +name: "plShow", + props: { + uiDefineData: { + type: Object, + default: {} + }, + }, + components:{bottomTable}, + data() { + return { + uiDefineOid:'', + areaType: '', + tableLoading: false, + selectList: [], + option: { + ...basicOption, + height:'300px', + addBtn: false, + editBtn: false, + delBtn: false, + index:false, + menuWidth:160, + align:'left', + column: [{ + label: '搴忓彿', + prop: 'plSeq', + width:50 + }, { + label: '缂栫爜', + prop: 'plCode', + width:180 + }, { + label: '鍚嶇О', + prop: 'plName', + width:200 + }, { + label: '鏄惁鍚敤', + prop: 'plIsOpen', + align:'center', + width: 90 + }, { + label: '鏄剧ず琛ㄨ揪寮�', + prop: 'plOpenExpression', + overHidden:true, + width:300 + }, { + label: 'UI瑙f瀽绫�', + prop: 'plUIParser' + }, { + label: '鎷撳睍灞炴��', + prop: 'plExtAttr' + }, { + label: '鎻忚堪', + prop: 'plDesc' + }] + }, + data: [], + dialogLoading: false, + dialogVisible: false, + dialogType: '', + form: { + plSeq: '', + plCode: '', + plName: '', + plIsOpen:0, + plOpenExpression:'', + plLabel:'', + plUIParser:'', + plExtAttr:'', + plDesc:'' + }, + rules: { + plName: [{ + required: true, + message: '璇疯緭鍏ュ悕绉�', + trigger: 'blur' + }], + plCode: [{ + required: true, + message: '璇疯緭鍏ョ紪鐮�', + trigger: 'blur' + }], + plSeq: [{ + required: true, + message: '璇疯緭鍏ュ簭鍙�', + trigger: 'blur' + }] + }, + } + }, + watch: { + uiDefineData:{ + handler(val) { + if(val && val.plOId) { + if (val.plIsShowNavigator) { + this.areaType = '1'; + }else if(val.plIsShowForm){ + this.areaType = '2' + }else{ + this.areaType = '3' + } + this.getTableList() + } + }, + immediate: true, + deep:true + } + }, + created() { + this.uiDefineOid=this.$route.params.uiDefineOid; + }, + methods: { + handleClick(tab, event) { + this.getTableList() + }, + getTableList(){ + const params = { + contextId:this.uiDefineData.plOId, + areaType:this.areaType + } + getTabByContextIdAndType( params).then(res => { + this.data = res.data.data; + this.selectList=[]; + this.$refs.crud.clearSelection(); + this.tableLoading = false; + }) + }, + selectChangeHandler(row) { + this.selectList = row; + }, + // 琛岀偣鍑� + rowClickHandler(row) { + func.rowClickHandler( + row, + this.$refs.crud, + this.lastIndex, + (newIndex) => { + this.lastIndex = newIndex; + }, + () => { + this.selectList = []; + } + ); + }, + //鍒涘缓 + addHandler(){ + this.form={ + plSeq: '', + plCode: '', + plName: '', + plIsOpen:0, + plOpenExpression:'', + plLabel:'', + plUIParser:'', + plExtAttr:'', + plDesc:'' + }; + this.dialogType = 'add'; + this.dialogVisible = true; + }, + editHandler(){ + if(this.selectList.length!=0){ + this.rowEditBtnClick(this.selectList[0]); + }else { + this.$message.error('璇烽�夋嫨涓�鏉℃暟鎹繘琛岀紪杈�'); + } + }, + delHandler(){ + if (this.selectList.length <= 0) { + this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�'); + return; + } + const params = { + oids: this.selectList.map(item => item.plOId).join(',') + } + this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬暟鎹悧锛�', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + deleteTabData(params).then(res => { + if (res.data.code === 200) { + this.$message.success('鍒犻櫎鎴愬姛'); + this.getTableList(); + } + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }); + }); + }, + // 缂栬緫鎸夐挳 + rowEditBtnClick(row) { + this.form=row; + this.dialogType = 'edit'; + this.dialogVisible = true; + }, + // 鍒犻櫎鎸夐挳 + rowDeleteHandler(row) { + this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬暟鎹悧锛�', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + deleteTabData({oids: row.plOId}).then(res => { + if (res.data.code === 200) { + this.$message.success('鍒犻櫎鎴愬姛'); + this.getTableList(); + } + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }); + }); + }, + // 鍏抽棴瀵硅瘽妗� + dialogClose() { + this.dialogVisible = false; + this.$refs.form.clearValidate(); + this.form = { + plName: '', + plCode: '', + plDesc:'', + plIsShow: [], + } + }, + // 淇濆瓨椤电 + saveHandler() { + this.$refs.form.validate((valid,done) => { + if (valid) { + const params = { + plAreaType:parseInt(this.areaType), + plContextOId:this.uiDefineData.plOId, + ...this.form + } + if (this.dialogType === 'add') { + addTabData(params).then(res => { + if (res.data.code === 200) { + this.$message.success('娣诲姞鎴愬姛'); + this.dialogClose(); + this.getTableList(); + } + }) + } else if (this.dialogType === 'edit') { + updateTabData(params).then(res => { + if (res.data.code === 200) { + this.$message.success('淇敼鎴愬姛'); + this.dialogClose() + this.getTableList(); + } + }) + } + } else { + return false; + } + }); + }, + } +} +</script> + +<style scoped> +.tip{ + font-size: 12px; + color: #909399; + margin: -13px 0 10px 100px; +} +</style> -- Gitblit v1.9.3