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/api/queryTemplate/queryDefine.js                                       |   13 +
 Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js                                     |   21 --
 Source/plt-web/plt-web-ui/src/api/queryTemplate/businessTypeQuery.js                                 |   50 ++++++-
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue     |   15 +
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/index.vue           |   58 +++++++-
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue      |  106 ++------------
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formQueryDialog.vue |  121 ++++++++++++-----
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue               |   13 -
 8 files changed, 225 insertions(+), 172 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/api/queryTemplate/businessTypeQuery.js b/Source/plt-web/plt-web-ui/src/api/queryTemplate/businessTypeQuery.js
index 3b4f3bd..0a1e973 100644
--- a/Source/plt-web/plt-web-ui/src/api/queryTemplate/businessTypeQuery.js
+++ b/Source/plt-web/plt-web-ui/src/api/queryTemplate/businessTypeQuery.js
@@ -1,12 +1,48 @@
 import request from '@/router/axios';
 //涓氬姟绫诲瀷鏌ヨ妯℃澘
-// 妯℃澘鍒楄〃鏌ヨ
-export function gridTemplate(params) {
+// 鍒涘缓
+export function linkSave(params) {
   return request({
-    url: "/api/templateController/queryTemplateList",
-    method: "get",
-    params:{
-      ...params
-    }
+    url: "/api/templateController/linkSave",
+    method: "post",
+    data:params
   });
 }
+// 鍒犻櫎
+export function deleteLinkTemplate(params) {
+  return request({
+    url: "/api/templateController/deleteLinkTemplate",
+    method: "delete",
+    params:params
+  });
+}
+// 鏌ヨ鏉′欢鐨勬煡璇㈡帴鍙o紝鎺ュ彛鏂瑰紡POST锛屽弬鏁颁笌淇濆瓨鎺ュ彛浼犲弬涓�鑷�
+export function getCriteria(params) {
+  return request({
+    url: "/api/templateController/getCriteria",
+    method: "post",
+    data:params
+  });
+}
+
+// 瀵煎嚭
+export function expBtmQTTemplate  (params) {
+  return request({
+    url: '/api/templateController/expBtmQTTemplate',
+    method: 'post',
+    headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'},
+    responseType: 'blob',
+    data:params
+  })
+}
+
+// 瀵煎叆
+export function impBtmTemplate  (params) {
+  return request({
+    url: '/api/templateController/impBtmTemplate',
+    method: 'post',
+    headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'},
+    responseType: 'blob',
+    data:params
+  })
+}
diff --git a/Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js b/Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js
index c8539ec..e425620 100644
--- a/Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js
+++ b/Source/plt-web/plt-web-ui/src/api/queryTemplate/linkTypeQuery.js
@@ -1,15 +1,6 @@
 import request from '@/router/axios';
 //閾炬帴绫诲瀷鏌ヨ妯℃澘
-//鍒楄〃
-export function getObjTypeQTs(btName) {
-  return request({
-    url: "/api/templateController/getObjTypeQTs",
-    method: "get",
-    params:{
-      btName
-    }
-  });
-}
+
 // 鍒涘缓
 export function linkSave(params) {
   return request({
@@ -39,10 +30,10 @@
 export function expLinkTemplate  (params) {
   return request({
     url: '/api/templateController/expLinkTemplate',
-    method: 'get',
-    //headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'},
+    method: 'post',
+    headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'},
     responseType: 'blob',
-    params
+    data:params
   })
 }
 
@@ -50,9 +41,9 @@
 export function impLinkTemplate  (params) {
   return request({
     url: '/api/templateController/impLinkTemplate',
-    method: 'get',
+    method: 'post',
     headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'},
     responseType: 'blob',
-    params
+    data:params
   })
 }
diff --git a/Source/plt-web/plt-web-ui/src/api/queryTemplate/queryDefine.js b/Source/plt-web/plt-web-ui/src/api/queryTemplate/queryDefine.js
index 71c3460..4309334 100644
--- a/Source/plt-web/plt-web-ui/src/api/queryTemplate/queryDefine.js
+++ b/Source/plt-web/plt-web-ui/src/api/queryTemplate/queryDefine.js
@@ -24,8 +24,17 @@
     }
   });
 }
-
-//鑾峰彇鎵�鏈夋煡璇㈡ā鏉�
+//鏌ヨ妯℃澘鍒楄〃
+export function getObjTypeQTs(btName) {
+  return request({
+    url: "/api/templateController/getObjTypeQTs",
+    method: "get",
+    params:{
+      btName
+    }
+  });
+}
+//鑾峰彇鎵�鏈夋煡璇㈡ā鏉垮垪琛�
 export function getAllQTs(page,limit) {
   return request({
     url: "/api/templateController/getAllQTs",
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>
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formQueryDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formQueryDialog.vue
index 677e8bd..38ff8db 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formQueryDialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formQueryDialog.vue
@@ -24,8 +24,9 @@
         <el-button  size="mini" type="danger" icon="el-icon-delete" @click="delCondition(index)" style="padding: 7px 8px"></el-button>
       </div>
     </div>
-    <div v-else style="height: 220px;text-align: left">
-      <avue-tree ref="tree" @node-drop="handleDrop" style="height: 220px" :data="treeData" :option="treeOption"  @node-click="nodeClick" node-key="value"></avue-tree>
+    <div v-else @drop="drop" @dragover.prevent style="height: 220px;text-align: left">
+      <avue-tree ref="tree" @node-drag-end="handleDragEnd" @node-drag-leave="handleDragLeave"  @node-drag-over="handleDragOver"
+                  style="height: 220px" :data="treeData" :option="treeOption"  @node-click="nodeClick" node-key="value"></avue-tree>
     </div>
     <div style="text-align: right;margin-top: 10px;">
       <el-button v-if="radioForm==1"  plain size="mini" type="primary" @click="addHandler">澧炲姞閫昏緫</el-button>
@@ -35,6 +36,7 @@
       <el-button  plain size="mini" type="primary" @click="">鍙栨秷</el-button>
     </div>
 
+    <!--淇敼鏉′欢-->
     <el-dialog v-dialogDrag
                :title="dialog.title"
                :visible.sync="dialog.showDialog"
@@ -114,7 +116,7 @@
 import basicOption from "@/util/basic-option";
 import {getAllQTs} from "@/api/queryTemplate/queryDefine";
 import {getCriteria} from "@/api/queryTemplate/linkTypeQuery";
-
+import {dateFormat} from "@/util/date"
 export default {
 name: "formQueryDialog",
   props: {
@@ -374,11 +376,38 @@
               nodeChild.forEach((item,index)=>{
                 that.treeIndex++;
                 if(item.column !=null && item.column != undefined){
+                  const values= item.column.split(' ');
+                  let inputValue='';
+                  let operator='';
+                  let showLabel=''
+                  if(item.column.indexOf('not in')!=-1){
+                    operator='not in';
+                    if(values.length>3){
+                      inputValue=values[3];
+                    }
+                  }else{
+                    if(values.length>1){
+                      operator=values[1];
+                      if(values.length>2){
+                        inputValue=values[2];
+                      }
+                    }
+                  }
+
+                  if(values[0].indexOf('.')!=-1){
+                    const labels=values[0].split('.')
+                    showLabel=labels[labels.length-1];
+                  }else {
+                    showLabel=values[0];
+                  }
                   children.push({
                     label:item.column,
                     value:item.column+that.treeIndex,
                     type:item.type,
-                    valueIndex:'v'+that.treeIndex
+                    valueIndex:'v'+that.treeIndex,
+                    inputValue:inputValue,
+                    operator:operator,
+                    showLabel:showLabel
                   })
                 }else {
                   children.push({
@@ -437,23 +466,47 @@
         }
         params.type=data.atttributes.vtDataType;
         this.conditionList.push(params)
-      }else {debugger;
+      }else {
         if (this.clickNode.label != '骞朵笖' && this.clickNode.label != '鎴栬��') {
           this.$message.error('璇烽�変腑閫昏緫鏉′欢娣诲姞鏌ヨ椤�');
           return;
         }
-        this.treeIndex++;
-        this.$refs.tree.append({
-          label: data.value,
-          value: data.value + this.treeIndex,
-          valueIndex: 'v' + this.treeIndex,
-          children: []
-        }, this.clickNode);
+        this.$refs.tree.append(this.initItem(data), this.clickNode);
       }
     },
-    handleDrop(draggingNode, dropNode, dropType, ev) {
+    initItem(data){
+      this.treeIndex++;
+      let item={
+        label: data.value,
+        value: data.value + this.treeIndex,
+        valueIndex: 'v' + this.treeIndex,
+        type:data.vtDataType,
+        children: [],
+        inputValue:data.value,
+        operator:'=',
+        showLabel:data.value
+      };
+      let showLabel='';
+      if(data.value.indexOf('.')!=-1){
+        const labels=data.value.split('.')
+        showLabel=labels[labels.length-1];
+      }else {
+        showLabel=data.value;
+      }
+      item.showLabel=showLabel;
+      return item
+    },
+    handleDragEnd(draggingNode, dropNode, dropType, ev) {
       debugger;
-      console.log('tree drop: ', dropNode.label, dropType);
+      console.log('tree drag end: ', dropNode && dropNode.label, dropType);
+    },
+    handleDragOver({event}) {
+      // 闃绘榛樿浜嬩欢锛屽厑璁告斁缃�
+      event.preventDefault();
+    },
+    handleDragLeave({event}) {
+      // 娓呴櫎鏀剧疆鏁堟灉
+      event.preventDefault();
     },
     //鍒犻櫎鏅�氭煡璇㈡潯浠�
     delCondition(index) {
@@ -478,9 +531,13 @@
         if(node.children){
           this.clearTreeValue(node.children)
         }else {
-          let values=node.label.split(' ');
-          if(values.length>2){
-            node.label=values[0]+' '+values[1];
+          if(node.label.indexOf('not in')!=-1){
+            node.label=node.label.split(' ')[0]+' not in'
+          }else {
+            let values = node.label.split(' ');
+            if (values.length > 2) {
+              node.label = values[0] + ' ' + values[1];
+            }
           }
         }
       })
@@ -535,24 +592,6 @@
         } else if (this.clickNode.label == '鎴栬��') {
           this.clickNode.label = '骞朵笖'
         } else {
-          const values= this.clickNode.label.split(' ');
-          this.clickNode.inputValue='';
-          if(values.length>1){
-            this.clickNode.operator=values[1];
-            if(values.length>2){
-              if(['VTDateTime','VTDate','VTTime'].includes(this.clickNode.type)){
-                this.clickNode.inputValue=new Date(values[2]);
-              }else {
-                this.clickNode.inputValue=values[2];
-              }
-            }
-          }
-          if(values[0].indexOf('.')!=-1){
-            const labels=values[0].split('.')
-            this.clickNode.showLabel=labels[labels.length-1];
-          }else {
-            this.clickNode.showLabel=values[0];
-          }
           this.dialog.showDialog = true;
         }
       } else {
@@ -609,6 +648,18 @@
     submitDialog() {
       const values= this.clickNode.label.split(' ');
       this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+this.clickNode.inputValue;
+      try{
+        if(['VTDateTime'].includes(this.clickNode.type)){
+          this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+dateFormat(this.clickNode.inputValue);
+        }else  if(['VTDate'].includes(this.clickNode.type)){
+          this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+dateFormat(this.clickNode.inputValue ,'yyyy-MM-dd');
+        }else  if(['VTTime'].includes(this.clickNode.type)){
+          this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+dateFormat(this.clickNode.inputValue ,'hh:mm:ss');
+        }
+      }catch (e) {
+
+      }
+
       this.dialog.showDialog = false;
     },
     //鑾峰彇鏌ヨ妯℃澘鍒楄〃
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/index.vue
index a17252d..e4b9c2d 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/index.vue
@@ -34,6 +34,9 @@
                     :data="crudData" :option="crudOption" :table-loading="tableLoading" style="margin-top: 10px">
         </avue-crud>
         <form-dialog ref="formRef" @refresh="getTemp"></form-dialog>
+        <!--瀵煎叆    -->
+        <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆"
+                     @updata="uploadCallBack"></upload-file>
       </basic-container>
     </el-main>
 
@@ -42,12 +45,12 @@
 
 <script>
 import {getBizTypes} from "@/api/modeling/businessType/api";
-import {gridTemplate,saveTemplate,updateTemplate,deleteTemplate} from "@/api/queryTemplate/queryDefine";
+import {deleteLinkTemplate,expBtmQTTemplate,impBtmTemplate} from "@/api/queryTemplate/businessTypeQuery";
+import {getObjTypeQTs} from "@/api/queryTemplate/queryDefine";
 import basicOption from "@/util/basic-option";
 import func from "@/util/func";
 import {dateFormat} from "@/util/date";
 import FormDialog from "./formDialog.vue"
-import {deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery";
 export default {
   name: "index",
   components: {FormDialog},
@@ -94,21 +97,24 @@
         height: "auto",
         calcHeight: -40,
         tip: false,
+        header:false,
         column: [{
           label: '鏌ヨ妯℃澘鍚嶇О',
-          prop: 'name'
+          prop: 'qtName'
         }, {
           label: '鍒涘缓浜�',
           prop: 'creator'
         }, {
           label: '鍒涘缓鏃堕棿',
-          prop: 'createTime',
-          formatter:function (row, value) {
-            return dateFormat(new Date(value))
-          }
+          prop: 'createTimeText'
         }]
       },
       selectionRow: [],
+      tipList: [
+        "瀵煎叆浠呰兘涓婁紶.vciqtf鏍煎紡鏂囦欢"
+      ],
+      upFileType: ['vciqtf'],
+      fileUrl: 'api/templateController/impBtmTemplate',
     }
   },
   created() {
@@ -135,7 +141,7 @@
       this.getTemp();
     },
     getTemp() {
-      gridTemplate({btmName: this.nodeRow.label, linkFlag: false}).then(res => {
+      getObjTypeQTs(this.nodeRow.label).then(res => {
         this.crudData =  res.data.data;
         this.tableLoading = false;
       })
@@ -198,6 +204,42 @@
           message: '宸插彇娑堝垹闄�'
         });
       });
+    },
+    //瀵煎嚭
+    exportClickHandler(){
+      if (this.selectionRow.length <= 0) {
+        this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹繘琛屽鍑�');
+        return;
+      }
+
+      let qtNames = this.selectionRow.map(item => item.qtName).join(',');
+      expBtmQTTemplate({qtNames: qtNames}).then(res => {
+        func.downloadFileByBlobHandler(res);
+        this.$message.success('瀵煎嚭鎴愬姛');
+      })
+    },
+    upLoadClickHandler(){
+      this.$refs.upload.visible = true;
+    },
+    uploadCallBack(res){
+      function getText(child){
+        let text=''
+        if(child[0].children && child[0].children.length>0){
+          text=getText(child[0].children)
+        }else{
+          text=child[0].text ||child[0];
+        }
+        return text
+      }
+      if(res.obj) {
+        if (res.obj.children) {
+          this.$message.info(getText(res.obj.children));
+        }
+      }
+      if(res.data){
+        this.crudData = res.data;
+      }
+      //this.getTemp();
     }
   }
 }
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
index 96e4274..38ff8db 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
@@ -25,7 +25,8 @@
       </div>
     </div>
     <div v-else @drop="drop" @dragover.prevent style="height: 220px;text-align: left">
-      <avue-tree ref="tree" @node-drop="handleDrop" @node-drag-end="handleDragEnd" style="height: 220px" :data="treeData" :option="treeOption"  @node-click="nodeClick" node-key="value"></avue-tree>
+      <avue-tree ref="tree" @node-drag-end="handleDragEnd" @node-drag-leave="handleDragLeave"  @node-drag-over="handleDragOver"
+                  style="height: 220px" :data="treeData" :option="treeOption"  @node-click="nodeClick" node-key="value"></avue-tree>
     </div>
     <div style="text-align: right;margin-top: 10px;">
       <el-button v-if="radioForm==1"  plain size="mini" type="primary" @click="addHandler">澧炲姞閫昏緫</el-button>
@@ -495,14 +496,18 @@
       item.showLabel=showLabel;
       return item
     },
-    handleDrop(draggingNode, dropNode, dropType, ev) {
-      debugger;
-      console.log('tree drop: ', dropNode.label, dropType);
-    },
     handleDragEnd(draggingNode, dropNode, dropType, ev) {
       debugger;
       console.log('tree drag end: ', dropNode && dropNode.label, dropType);
     },
+    handleDragOver({event}) {
+      // 闃绘榛樿浜嬩欢锛屽厑璁告斁缃�
+      event.preventDefault();
+    },
+    handleDragLeave({event}) {
+      // 娓呴櫎鏀剧疆鏁堟灉
+      event.preventDefault();
+    },
     //鍒犻櫎鏅�氭煡璇㈡潯浠�
     delCondition(index) {
       this.conditionList.splice(index, 1);
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue
index 2134676..67f6eda 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue
@@ -43,7 +43,8 @@
 
 <script>
 import {gridLink} from "@/api/modeling/linkType/api";
-import {getObjTypeQTs,deleteLinkTemplate,expLinkTemplate,impLinkTemplate} from "@/api/queryTemplate/linkTypeQuery";
+import {deleteLinkTemplate,expLinkTemplate,impLinkTemplate} from "@/api/queryTemplate/linkTypeQuery";
+import {getObjTypeQTs} from "@/api/queryTemplate/queryDefine";
 import basicOption from "@/util/basic-option";
 import FormDialog from "./formDialog.vue"
 import func from "@/util/func";
@@ -70,16 +71,6 @@
         oid: 'topNode',
         children: []
       }],
-      templateForm: '',
-      templateData: [],
-      form: {
-        name: ''
-      },
-      rules: {
-        name: [
-          {required: true, message: '璇疯緭鍏ユ煡璇㈡ā鏉垮悕绉�', trigger: 'blur'}
-        ]
-      },
       title: '',
       visible: false,
       tableLoading: false,

--
Gitblit v1.9.3