From 38f3a931edad42c5712c710a77f922259dfc64dd Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期五, 06 九月 2024 12:30:37 +0800
Subject: [PATCH] 链接类型查询模板

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue      |    9 +++-
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue |   82 +++++++++++++++++++++++++++++-----------
 Source/plt-web/plt-web-ui/src/components/PLT-basic-component/upload-file.vue                     |    3 -
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue           |   22 ++++++++++
 4 files changed, 88 insertions(+), 28 deletions(-)

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 1195fc0..7e23662 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
@@ -125,11 +125,10 @@
     },
     // 鏂囦欢涓婁紶鎴愬姛
     onSuccess(resbonse) {
-      console.log(resbonse);
       if (resbonse.code === 200) {
         this.$message.success("瀵煎叆鎴愬姛锛�");
         this.visible = false;
-        this.$emit('updata');
+        this.$emit('updata',resbonse);
       } else {
         this.$message.error(resbonse.msg);
       }
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 27fbae3..91d6197 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
@@ -69,7 +69,7 @@
             <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 style="height: 265px" :data="businessTreeData" :option="treeOption"  @node-drag-start="handleDragStart" @node-drag-end="handleDragEnd">
               </avue-tree>
             </div>
           </fieldset>
@@ -561,9 +561,14 @@
     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);
+      }
     }
   },
 }
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 b997c17..96e4274 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,7 @@
       </div>
     </div>
     <div v-else @drop="drop" @dragover.prevent 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>
+      <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>
     </div>
     <div style="text-align: right;margin-top: 10px;">
       <el-button v-if="radioForm==1"  plain size="mini" type="primary" @click="addHandler">澧炲姞閫昏緫</el-button>
@@ -379,12 +379,20 @@
                   let inputValue='';
                   let operator='';
                   let showLabel=''
-                  if(values.length>1){
-                    operator=values[1];
-                    if(values.length>2){
-                      inputValue=values[2];
+                  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];
@@ -462,18 +470,38 @@
           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);
       }
+    },
+    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
     },
     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);
     },
     //鍒犻櫎鏅�氭煡璇㈡潯浠�
     delCondition(index) {
@@ -498,9 +526,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];
+            }
           }
         }
       })
@@ -610,15 +642,19 @@
     //鏌ヨ鏉′欢淇濆瓨
     submitDialog() {
       const values= this.clickNode.label.split(' ');
-      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');
-      }else {
-        this.clickNode.label = values[0]+' '+this.clickNode.operator+' '+this.clickNode.inputValue;
+      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/linkTypeQuery/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue
index 7f0d303..2134676 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
@@ -35,7 +35,7 @@
         <form-dialog ref="formRef" @refresh="getTemp"></form-dialog>
         <!--瀵煎叆    -->
         <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="瀵煎叆"
-                     @updata="getTemp"></upload-file>
+                     @updata="uploadCallBack"></upload-file>
       </basic-container>
     </el-main>
   </el-container>
@@ -267,6 +267,26 @@
     },
     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();
     }
   }
 }

--
Gitblit v1.9.3