From b027a6a6749f51b45fb0593b260a1d4d9cd77932 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期三, 04 十二月 2024 11:40:16 +0800
Subject: [PATCH] 表单定义切换源对象清空选择模板、查询模板&&切换搜索类型清空链接类型、选择模板、查询模板

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue |  262 ++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 184 insertions(+), 78 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
index e770a46..b035270 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
@@ -8,10 +8,8 @@
       :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">
@@ -57,6 +55,52 @@
         <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>
+
+      <template slot="extAttrLabel" slot-scope="{}">
+        <el-tooltip placement="top">
+          <div slot="content">绀轰緥:ext1:xx;ext2;ext3:xx;ext4:xxx;extn:xxx;
+            <br/>1銆佺敤鑻变氦鍗婅鍒嗗彿:鍒嗛殧鍚勭粍鍊�;
+            <br/>2銆佹瘡缁勭敤鑻变氦鍗婅鍐掑彿:鍒嗛殧鍗曚竴鎵╁睍灞炴�у悕绉板強灞炴�у��;
+            <br/>3銆佸彲浠ュ畾涔変换鎰忕粍锛屼絾鎬诲瓧绗﹂暱搴︿笉寰楄秴杩�4000;
+            <br/>4銆佽緭鍏ユ椂锛屼笉瑕佹暡鍥炶溅鎹㈣;
+          </div>
+          <span>鎵╁睍灞炴�� <i class="el-icon-warning" style="color:red;"></i> </span>
+        </el-tooltip>
+      </template>
+
+      <template slot="uiParserLabel" slot-scope="{}">
+        <el-tooltip placement="top">
+          <div slot="content">绀轰緥锛歫ava_cs;xxx.java_bs;xxx.net_cs;xxxx.net_bs;xxx.mobile_cs;xx.mobile_bs;xxx;
+            <br/>1銆佺敤鑻辨枃鍗婅鍒嗗彿;鍒嗗壊鍚勭粍鍊硷紱锛堣繖閲岀粨灏剧殑鏄腑鏂囧瓧绗︾殑鍒嗗彿锛�
+            <br/>2銆佹瘡缁勭敤鑻辨枃鍗婅鍐掑彿:鍒嗛殧鍗曚竴鎵╁睍灞炴�у悕绉板強灞炴�у�硷紱
+            <br/>3銆佸叾涓殑xxx鏄悇绉嶈В鏋愮被鐨勫畬鏁寸被鍨嬪悕绉帮紙瀹屽叏闄愬畾鍚�)锛�
+            <br/>4銆佽緭鍏ユ椂锛屼笉瑕佹暡鍥炶溅鎹㈣;
+          </div>
+          <span>UI瑙f瀽绫诲瀷 <i class="el-icon-warning" style="color:red;"></i> </span>
+        </el-tooltip>
+      </template>
+
+      <template slot="templateIdForm" slot-scope="{}">
+        <el-select v-model="form.templateId" filterable placeholder="璇烽�夋嫨">
+          <el-option
+            v-for="item in templateIdList"
+            :key="item.viName"
+            :label="item.viName"
+            :value="item.viName">
+          </el-option>
+        </el-select>
+      </template>
+
+      <template slot="queryTemplateNameForm" slot-scope="{}">
+        <el-select v-model="form.queryTemplateName" filterable placeholder="璇烽�夋嫨">
+          <el-option
+            v-for="item in queryTemplateNameList"
+            :key="item.qtName"
+            :label="item.qtName"
+            :value="item.qtName">
+          </el-option>
+        </el-select>
       </template>
     </avue-crud>
     <el-dialog
@@ -136,7 +180,7 @@
                   </el-form-item>
 
                   <el-col :span="12">
-                    <el-form-item label="鏄惁鎺堟潈锛�" prop="resource">
+                    <el-form-item label="鏄惁鎺堟潈锛�" prop="authorization">
                       <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>
@@ -198,8 +242,10 @@
       </el-container>
     </el-dialog>
     <action-dialog ref="actionDialog" @updataAction="actionSaveHandler"></action-dialog>
-    <clone-dialog ref="cloneDialog" :fromOid="fromOid" :sourceOId="sourceOId" type="pageDef" paramsType="tab"></clone-dialog>
-    <clone-dialog ref="cloneBtnDialog" :fromOid="formBtnOid" :sourceOId="sourceBtnOid" type="tabButton" paramsType="pageDef"></clone-dialog>
+    <clone-dialog ref="cloneDialog" :fromOid="fromOid" :sourceOId="sourceOId" paramsType="tab"
+                  type="pageDef"></clone-dialog>
+    <clone-dialog ref="cloneBtnDialog" :fromOid="formBtnOid" :sourceOId="sourceBtnOid" paramsType="pageDef"
+                  type="tabButton"></clone-dialog>
   </div>
 </template>
 
@@ -208,20 +254,19 @@
 import func from "@/util/func";
 import {
   getPLPageDefinations,
-  getBtmDatasByPage,
-  getPortalVIDatasByPage,
-  getQTInfoDatasByPage,
   getTabButtons,
   addTapButton,
   updateTapButton,
-  getLinkDatasByPage,
   addPageDefination,
   deleteTabButton,
   delPageDefination,
   joinBtn,
-  exitBtn
+  exitBtn,
+  updatePageDefination,
+  getPortalVIDatasByPage,
+  getQTInfoDatasByPage
 } from "@/api/UI/uiDefine";
-import actionDialog from '@/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/components/action';
+import actionDialog from '@/views/modelingMenu/ui/Aciton/components/dialog';
 import cloneDialog from "@/views/modelingMenu/ui/uiDefine/rightRegion/cloneDialog";
 
 export default {
@@ -243,10 +288,15 @@
   name: "index",
   data() {
     return {
-      formBtnOid:'',
-      sourceBtnOid:'',
-      sourceOId:'',
-      fromOid:'',
+      queryTemplateNameList: [],
+      templateIdList: [],
+      searchTargerChangeFlag: false,
+      showTypeChangeFlag: false,
+      linkTypeChangeFlag: false,
+      formBtnOid: '',
+      sourceBtnOid: '',
+      sourceOId: '',
+      fromOid: '',
       paramsForm: {},
       eventOption: {
         ...basicOption,
@@ -395,12 +445,13 @@
             ],
           },
           {
-            label: 'UI瑙f瀽绫诲瀷',
+            label: '',
             prop: 'uiParser',
             hide: true,
+            labelWidth: 100,
           },
           {
-            label: '鎵╁睍灞炴��',
+            label: '',
             prop: 'extAttr',
             hide: true,
           },
@@ -442,9 +493,10 @@
             },
             change: (val) => {
               const list = ['showType', 'linkType', 'templateId', 'SubUILayout', 'searchObjType', 'queryTemplateName', 'controlPath', 'expandCols', 'rootContent', 'showAbs', 'showLinkAbs', 'separator']
-              list.forEach(item => {
-                this.form[item] = "";
-              })
+              // list.forEach(item => {
+              //   this.form[item] = "";
+              // })
+              // this.form.searchTarger = '1'
               const searchTarger = this.option.column.find(item => item.prop === 'searchTarger');  // 鑾峰彇鎼滅储绫诲瀷閰嶇疆椤�
               searchTarger.display = true; // 鍒囨崲榛樿灞曠ず鎼滅储绫诲瀷
               // 妯℃澘绫诲瀷涓鸿〃鏍�
@@ -471,7 +523,7 @@
             dicData: [
               {
                 label: '涓嶆樉绀�',
-                value: '3'
+                value: '1'
               },
               {
                 label: '鏄剧ず瑙掕壊',
@@ -479,7 +531,7 @@
               },
               {
                 label: '鏄剧ずFolder',
-                value: '1',
+                value: '3',
               },
             ],
           },
@@ -509,11 +561,16 @@
                 const obj = this.option.group[0].column.find(item => item.prop === 'linkType');
                 obj.display = val.value !== '1';
               }
-              // 鍒囨崲娓呯┖妯℃澘绫诲瀷
-              const list = ['showType', 'linkType', 'templateId', 'SubUILayout', 'queryTemplateName', 'searchObjType'];
-              list.forEach(item => {
-                this.form[item] = '';
-              })
+
+              if (this.searchTargerChangeFlag) {
+                // 鍒囨崲娓呯┖妯℃澘绫诲瀷
+                const list = ['showType', 'linkType', 'templateId', 'SubUILayout', 'queryTemplateName', 'searchObjType', 'bsCustQueryCLsOrUrl', 'csCustQueryCLsOrUrl'];
+                list.forEach(item => {
+                  this.form[item] = '';
+                })
+              } else {
+                this.searchTargerChangeFlag = true;
+              }
             }
           },
           {
@@ -532,10 +589,37 @@
                 label: '婧愬璞�',
                 prop: 'showType',
                 type: 'select',
-                cascader: ['linkType', 'templateId', 'SubUILayout', 'searchObjType', 'queryTemplateName'],
+                cascader: ['linkType', 'SubUILayout', 'searchObjType'],
                 placeholder: "璇疯緭鍏ュ唴瀹�",
                 dicUrl: '/api/uiManagerController/getBtmDatasByPage?page=1&limit=-1',
                 filterable: true,
+                change: (val) => {
+                  if (val.value) {
+                    let params = {
+                      'conditionMap[selectBtmType]': this.form.searchTarger === '1' ? this.form.showType : this.form.linkType
+                    }
+                    getPortalVIDatasByPage(1, -1, params).then(res => {
+                      this.templateIdList = res.data.data;
+                    })
+                    getQTInfoDatasByPage(1, -1, params).then(res => {
+                      this.queryTemplateNameList = res.data.data;
+                    })
+                  }
+                  if (this.showTypeChangeFlag) {
+                    if (val.value) {
+                      if (this.form.searchTarger === '1') {
+                        this.form.templateId = "";
+                        this.form.queryTemplateName = "";
+                      } else {
+                        this.form.linkType = "";
+                        this.form.templateId = "";
+                        this.form.queryTemplateName = "";
+                      }
+                    }
+                  } else {
+                    this.showTypeChangeFlag = true;
+                  }
+                },
                 props: {
                   label: 'name',
                   value: 'name',
@@ -561,14 +645,33 @@
                   desc: 'tag'
                 },
                 dicUrl: '/api/uiManagerController/getLinkDatasByPage?page=1&limit=-1&conditionMap[selectBtmType]={{key}}',
+                change: (val) => {
+                  if (val.value) {
+                    let params = {
+                      'conditionMap[selectBtmType]': val.value
+                    }
+                    getPortalVIDatasByPage(1, -1, params).then(res => {
+                      this.templateIdList = res.data.data;
+                    })
+                    getQTInfoDatasByPage(1, -1, params).then(res => {
+                      this.queryTemplateNameList = res.data.data;
+                    })
+                  }
+                  if (this.linkTypeChangeFlag) {
+                    if (val.value) {
+                      this.form.templateId = "";
+                      this.form.queryTemplateName = "";
+                    }
+                  } else {
+                    this.linkTypeChangeFlag = true;
+                  }
+                }
               },
               {
                 label: '閫夋嫨妯℃澘',
                 prop: 'templateId',
                 display: false,
-                type: 'select',
-                filterable: true,
-                dicUrl: '/api/uiManagerController/getPortalVIDatasByPage?page=1&limit=-1&conditionMap[selectBtmType]={{key}}',
+                formslot: true,
                 rules: [
                   {
                     required: true,
@@ -576,11 +679,6 @@
                     trigger: 'submit'
                   }
                 ],
-                props: {
-                  label: 'viName',
-                  value: 'viName',
-                  desc: 'viType'
-                },
               },
               {
                 label: 'UI瀹氫箟',
@@ -589,9 +687,8 @@
                 filterable: true,
                 display: false,
                 props: {
-                  label: 'qtName',
-                  value: 'qtName',
-                  desc: 'btmName'
+                  label: 'plName',
+                  value: 'plCode',
                 },
                 dicUrl: '/api/uiManagerController/getUILayoutDatasByPage?page=1&limit=-1&conditionMap[selectBtmType]={{key}}',
               },
@@ -630,14 +727,8 @@
                 label: '鏌ヨ妯℃澘',
                 prop: 'queryTemplateName',
                 type: 'select',
-                filterable: true,
                 display: false,
-                props: {
-                  label: 'qtName',
-                  value: 'qtName',
-                  desc: 'btmName'
-                },
-                dicUrl: '/api/uiManagerController/getQTInfoDatasByPage?page=1&limit=-1&conditionMap[selectBtmType]={{key}}',
+                formslot: true,
               },
               {
                 label: '鎺у埗璺緞',
@@ -695,6 +786,20 @@
                 labelWidth: 135,
                 span: 12
               },
+              {
+                label: 'B/S鑷畾涔夋煡璇�',
+                prop: 'bsCustQueryCLsOrUrl',
+                display: false,
+                labelWidth: 115,
+                span: 12
+              },
+              {
+                label: 'C/S鑷畾涔夋煡璇�',
+                prop: 'csCustQueryCLsOrUrl',
+                display: false,
+                labelWidth: 115,
+                span: 12
+              },
             ]
           },
           {
@@ -722,7 +827,7 @@
     sourceData: {
       handler(val) {
         if (val && val.plOId) {
-          this.getTableList()
+          this.getTableList();
         } else {
           this.data = [];
         }
@@ -782,25 +887,11 @@
 
     // 澧炲姞
     addClickHandler() {
-      console.log(this.sourceData);
       if (!this.sourceData || !this.sourceData.plOId) {
         this.$message.error('璇峰湪涓婃柟閫夋嫨涓�鏉℃暟鎹悗杩涜娣诲姞');
         return;
       }
       this.$refs.crud.rowAdd();
-    },
-
-    // 缂栬緫鎵撳紑琛ㄥ崟鍓�
-    beforeOpen(done, type) {
-      if (type === 'edit') {
-        this.form.showType = 'Ludc';
-        this.$set(this.form, 'showType', 'Ludc');
-        // this.$set(this.option.group[0].column[0],'value','Ludc');
-        // this.option.group[0].column[0].value = 'Ludc';
-        done();
-      } else {
-        done();
-      }
     },
 
     // 澧炲姞鍏抽棴瀵硅瘽妗� 娓呯┖event鏁扮粍
@@ -825,13 +916,12 @@
           };
         });
       }
+      this.searchTargerChangeFlag = false;
       this.$refs.crud.rowEdit(row);
-      console.log(this.form);
     },
 
     // 鍒犻櫎
     rowDeleteHandler(row) {
-      console.log(row);
       this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬暟鎹悧锛�', '鎻愮ず', {
         confirmButtonText: '纭畾',
         cancelButtonText: '鍙栨秷',
@@ -860,16 +950,35 @@
         row.SubUIObjType = row.showType;
         row.showType = "";
       }
-      console.log(this.sourceData);
       const params = {
         ...row,
         tabPageOId: this.sourceData.plOId
       }
       addPageDefination(params).then(res => {
-        console.log(res);
         if (res.data.code === 200) {
           this.$message.success(res.data.obj);
-          done()
+          this.getTableList();
+          done();
+        }
+      }).catch(err => {
+        loading();
+      })
+    },
+
+    rowUpdateHandler(row, index, done, loading) {
+      if (row.templateType === '6') {
+        row.SubUIObjType = row.showType;
+        row.showType = "";
+      }
+      const params = {
+        ...row,
+        tabPageOId: this.sourceData.plOId
+      }
+      updatePageDefination(params).then(res => {
+        if (res.data.code === 200) {
+          this.$message.success(res.data.obj);
+          this.getTableList();
+          done();
         }
       }).catch(err => {
         loading();
@@ -927,7 +1036,7 @@
     // 妯℃澘绫诲瀷涓鸿〃鏍�
     templateTypeTable(val) {
       if (!val) return;
-      this.updateDisplay(val, ['showType', 'templateId', 'queryTemplateName']);
+      this.updateDisplay(val, ['showType', 'templateId', 'queryTemplateName', 'bsCustQueryCLsOrUrl', 'csCustQueryCLsOrUrl']);
     },
 
     // 妯℃澘绫诲瀷涓鸿嚜瀹氫箟妯℃澘
@@ -941,13 +1050,13 @@
     // 妯℃澘绫诲瀷涓烘爲琛�
     templateTypeTreeTable(val) {
       if (!val) return;
-      this.updateDisplay(val, ['showType', 'templateId', 'queryTemplateName', 'expandCols', 'zkfs']);
+      this.updateDisplay(val, ['showType', 'templateId', 'queryTemplateName', 'expandCols', 'expandMode', 'bsCustQueryCLsOrUrl', 'csCustQueryCLsOrUrl']);
     },
 
     // 妯℃澘绫诲瀷涓鸿〃鍗�
     templateTypeForm(val) {
       if (!val) return;
-      this.updateDisplay(val, ['showType', 'templateId', 'queryTemplateName']);
+      this.updateDisplay(val, ['showType', 'templateId', 'queryTemplateName', 'bsCustQueryCLsOrUrl', 'csCustQueryCLsOrUrl']);
     },
 
     // 妯℃澘绫诲瀷涓烘爲
@@ -955,7 +1064,7 @@
       if (!val) return;
       const searchTarger = this.option.column.find(item => item.prop === 'searchTarger');  // 鑾峰彇鎼滅储绫诲瀷閰嶇疆椤�
       searchTarger.display = false; // 涓嶅睍绀烘悳绱㈢被鍨�
-      this.updateDisplay(val, ['showType', 'queryTemplateName', 'rootContent', 'showAbs', 'showLinkAbs', 'separator', 'expandMode', 'linkType']);
+      this.updateDisplay(val, ['showType', 'queryTemplateName', 'rootContent', 'showAbs', 'showLinkAbs', 'separator', 'expandMode', 'linkType', 'bsCustQueryCLsOrUrl', 'csCustQueryCLsOrUrl']);
     },
 
     // 妯℃澘绫诲瀷涓篣I瀹氫箟
@@ -963,7 +1072,7 @@
       if (!val) return;
       const searchTarger = this.option.column.find(item => item.prop === 'searchTarger');  // 鑾峰彇鎼滅储绫诲瀷閰嶇疆椤�
       searchTarger.display = false; // 涓嶅睍绀烘悳绱㈢被鍨�
-      this.updateDisplay(val, ['showType', 'SubUILayout', 'searchType', 'searchObjType', 'queryTemplateName']);
+      this.updateDisplay(val, ['showType', 'SubUILayout', 'searchType', 'searchObjType', 'queryTemplateName', 'bsCustQueryCLsOrUrl', 'csCustQueryCLsOrUrl']);
     },
 
     // 鏌ユ壘鏁扮粍涓璞$储寮�
@@ -1042,7 +1151,7 @@
 
     // 鎸夐挳璁捐淇℃伅鍙傛暟淇℃伅淇敼
     paramsRowEditHandler(row) {
-      this.$refs.paramsCrud.rowEdit(row);
+      this.$refs.paramsCrud.rowEdit(row, row.$index);
     },
 
     // 鎸夐挳璁捐鍙傛暟淇℃伅娣诲姞鎸夐挳
@@ -1122,7 +1231,8 @@
       const params = this.saveType === 'add' ? {
         ...this.basicForm,
         parentId: this.nodeTreeRow.oId === 'parentNode' ? '' : this.nodeTreeRow.parentId,
-        buttonParams: bottomParams
+        buttonParams: bottomParams,
+        tableOId: this.selectList[0].id
       } : {
         ...this.basicForm,
         buttonParams: bottomParams
@@ -1160,7 +1270,6 @@
         type: 'warning'
       }).then(() => {
         deleteTabButton(this.nodeTreeRow).then(res => {
-          // console.log(res);
           if (res.data.code === 200) {
             this.$message.success('鍒犻櫎鎴愬姛');
             this.getTabBtnTree();
@@ -1192,7 +1301,7 @@
 
     // 閫夋嫨action
     actionFoucus() {
-      this.$refs.actionDialog.btnActionVisible = true;
+      this.$refs.actionDialog.openDialog();
     },
 
     // 淇濆瓨action
@@ -1203,7 +1312,6 @@
 
     // 鎵撳紑鍏嬮殕瀵硅瘽妗�
     rowCloneHandler(row) {
-      console.log(row);
       this.fromOid = this.sourceData.plOId;
       this.sourceOId = row.id;
       this.$refs.cloneDialog.openDialog(row);
@@ -1221,7 +1329,6 @@
         return;
       }
       joinBtn(this.nodeTreeRow).then(res => {
-        // console.log(res);
         if (res.data.code === 200) {
           this.$message.success(res.data.obj);
           this.getTabBtnTree();
@@ -1235,7 +1342,6 @@
         this.$message.error('璇烽�夋嫨鑺傜偣杩涜淇敼');
         return;
       }
-
       if (this.nodeTreeRow.oId === "parentNode") {
         this.$message.error('椤跺眰鑺傜偣涓嶅厑璁歌皟鏁�');
         return;

--
Gitblit v1.9.3