From 99dda6d4254e062f386976e0d66c8379020d3944 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期五, 06 九月 2024 16:34:18 +0800
Subject: [PATCH] 查询模板导出导入

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue |  106 ++++++++--------------------------------------------
 1 files changed, 17 insertions(+), 89 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue
index 5d3b778..696107f 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue
@@ -43,11 +43,11 @@
       <el-container style="margin-top: 10px;">
         <el-aside style="width:350px">
           <fieldset>
-            <legend>&nbsp;閾炬帴绫诲瀷鍊欓�夋潯浠�&nbsp;</legend>
+            <legend>&nbsp;鍊欓�夋潯浠�&nbsp;</legend>
             <div>
               鏌ヨ妯℃澘瀹氫箟
-              <avue-select @change="linkQueryDefineChange" class="el-input--small" v-model="linkQueryDefineForm" placeholder="璇烽�夋嫨鍐呭" type="tree" :dic="linkQueryDefineDic" style="width:240px"></avue-select>
-              <avue-tree style="height: 265px" :data="linkTreeData" :option="treeOption"  @node-drag-start="handleDragStart">
+              <avue-select @change="businessQueryDefineChange" class="el-input--small" v-model="businessQueryDefineForm" placeholder="璇烽�夋嫨鍐呭" type="tree" :dic="businessQueryDefineDic" style="width: 240px;"></avue-select>
+              <avue-tree style="height: 265px" :data="businessTreeData" :option="treeOption"  @node-drag-start="handleDragStart" @node-drag-end="handleDragEnd">
               </avue-tree>
             </div>
           </fieldset>
@@ -63,17 +63,6 @@
             ></form-query-dialog>
           </fieldset>
         </el-main>
-        <el-aside style="width:350px">
-          <fieldset>
-            <legend>&nbsp;涓氬姟绫诲瀷鍊欓�夋潯浠�&nbsp;</legend>
-            <div>
-              鏌ヨ妯℃澘瀹氫箟
-              <avue-select @change="businessQueryDefineChange" class="el-input--small" v-model="businessQueryDefineForm" placeholder="璇烽�夋嫨鍐呭" type="tree" :dic="businessQueryDefineDic" style="width: 240px;"></avue-select>
-              <avue-tree style="height: 265px" :data="businessTreeData" :option="treeOption"  @node-drag-start="handleDragStart">
-              </avue-tree>
-            </div>
-          </fieldset>
-        </el-aside>
       </el-container>
     </div>
     <div class="dialog-footer avue-dialog__footer">
@@ -210,10 +199,6 @@
           return true;
         },
       },
-      linkQueryDefineForm:'',//閾炬帴绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑鍊�
-      linkQueryDefineDic:[],//閾炬帴绫诲瀷鏌ヨ妯℃澘瀹氫箟涓嬫媺鏁版嵁
-      //閾炬帴绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑椤瑰睘鎬�
-      linkTreeData: [],
       businessQueryDefineForm:'',//涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑鍊�
       businessQueryDefineDic:[],//涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟涓嬫媺鏁版嵁
       //涓氬姟绫诲瀷鏌ヨ妯℃澘瀹氫箟閫変腑椤瑰睘鎬�
@@ -222,56 +207,9 @@
       queryTree:{},
       //鏅�氭煡璇㈡潯浠�
       queryCondition:[],
-
     };
   },
   watch: {
-    //鏂瑰悜
-    'form.direction': {
-      handler(val) {
-        if(val=='positive'){
-          //姝e悜
-          const dicData=this.treeData.btmItemsTo.map(item=>{
-            return {
-              label: item,
-              value: item
-            }
-          })
-          dicData.push({
-            label: '鎵�鏈夌被鍨�',
-            value: '*'
-          })
-          this.$refs.form.updateDic('btmType', dicData);
-          this.form.btmType=dicData[0].value
-          this.getAllAttr();
-        }else if(val=='opposite'){
-          //鍙嶅悜
-          const dicData=this.treeData.btmItemsFrom.map(item=>{
-            return {
-              label: item,
-              value: item
-            }
-          })
-          dicData.push({
-            label: '鎵�鏈夌被鍨�',
-            value: '*'
-          })
-          this.$refs.form.updateDic('btmType', dicData);
-          this.form.btmType=dicData[0].value
-          this.getAllAttr();
-        }
-      },
-      immediate: true,
-    },
-    //涓氬姟绫诲瀷
-    'form.btmType': {
-      handler(val) {
-        if(val && val!='*'){
-          this.getTemp(val,false);
-        }
-      },
-      immediate: true,
-    }
   },
   methods: {
     openDialog(btmName, title, mode, data) {
@@ -283,6 +221,7 @@
       if (data.selectData) {
         this.selectData = data.selectData;
         this.form.qtName = this.selectData.qtName;
+        this.form.level = this.selectData.queryTemplate.level;
         if (data.selectData.queryTemplate.orderInfoList && data.selectData.queryTemplate.orderInfoList.length > 0) {
           this.orderInfoList = JSON.parse(JSON.stringify(data.selectData.queryTemplate.orderInfoList));//宸叉湁鎺掑簭
         }
@@ -327,6 +266,8 @@
               this.$message.success("淇濆瓨鎴愬姛");
               this.cancelDialog();
               this.$emit("refresh");
+            }else {
+              this.$refs.form.clearValidate();
             }
           });
         } else {
@@ -340,10 +281,9 @@
         qtName: this.form.qtName,
         levelFlag: this.form.levelFlag,
         queryTemplate: {
-          btmType: this.form.btmType,
           clauseList: ['*'],
+          direction: this.form.direction,
           id: this.form.qtName,
-          level: this.form.level,
           linkType: this.form.btmName,
           orderInfoList: this.orderInfoList,
           recReturnMode: 1,//閫掑綊杩斿洖鏁版嵁妯″紡:1锛歊ECRETURNMODE_FLAT, 2锛歊ECRETURNMODE_FILTER
@@ -444,36 +384,16 @@
     //鑾峰彇鏌ヨ妯℃澘瀹氫箟涓嬫媺
     getTemp(btmName,linkFlag) {
       if (btmName) {
-        queryTemplateListByAttr({btmName: btmName, linkFlag: linkFlag,direction:this.form.direction}).then(res => {
+        queryTemplateListByAttr({btmName: btmName}).then(res => {
           const data = res.data.data.map(item => {
             item.label = item.name + '-' + (item.linkTypeName || item.btmName);
             item.value = item.name;
             return item;
           });
-          if(linkFlag){
-            this.linkQueryDefineDic=data
-            data.length>0 && (this.linkQueryDefineForm=data[0].value);
-          }else {
             this.businessQueryDefineDic=data;
             data.length>0 && (this.businessQueryDefineForm= data[0].value);
-          }
+
         })
-      }
-    },
-    linkQueryDefineChange(data) {
-      if (data.value) {
-        const childData = data.item.attrs.map(item => {
-          return {
-            label: item.name,
-            value: item.name,
-            atttributes:item
-          };
-        });
-        this.linkTreeData = [{
-          label: data.value,
-          value: data.value,
-          children: childData
-        }]
       }
     },
     businessQueryDefineChange(data) {
@@ -496,7 +416,15 @@
     handleDragStart(node, ev) {
       // 浣跨敤 setData 鏂规硶璁剧疆鏁版嵁
       ev.dataTransfer.setData('item', JSON.stringify(node.data));
+      if(this.form.levelFlag==1){
+        this.$refs.formQuery.$refs.tree.$emit('tree-node-drag-start', ev,{node:this.$refs.formQuery.initItem(node)});
+      }
     },
+    handleDragEnd(draggingNode,endNode,position,ev){
+      if(this.form.levelFlag==1) {
+        this.$refs.formQuery.$refs.tree.$emit('tree-node-drag-end', ev);
+      }
+    }
   },
 }
 </script>

--
Gitblit v1.9.3