From ac3136bbe65533f3c8090935f0dfb834d0cf91bc Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期一, 09 九月 2024 11:03:29 +0800
Subject: [PATCH] 业务类型查询模板导出接口上传

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue |  118 ++++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 73 insertions(+), 45 deletions(-)

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..237f483 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" 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>
@@ -93,6 +94,7 @@
         <el-button size="small" @click="cancleQueryDialog">鍙� 娑�</el-button>
       </div>
     </el-dialog>
+    <!--鏌ヨ-->
     <el-dialog v-dialogDrag
                :title="queryResultDialog.title"
                :visible.sync="queryResultDialog.showDialog"
@@ -101,7 +103,7 @@
                class="avue-dialog"
                :destroy-on-close="true"
                :close-on-click-modal="false"
-               @close="queryResultDialog.showDialog='false'">
+               @close="queryResultDialog.showDialog=false">
       <div class="el-input--small">
         <avue-crud  ref="crud" :data="resultData" :option="resultOption"
                     :table-loading="queryResultDialog.loading">
@@ -379,12 +381,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];
@@ -444,36 +454,60 @@
       const data = JSON.parse(event.dataTransfer.getData('item'));
       if (this.radioForm == 0) {
         const params = {
-          clause: data.value,
+          clause: data.name,
           operator: '=',
           ordinaryValue: ''
         }
-        if (data.atttributes.vtDataType == 'VTInteger' || data.atttributes.vtDataType == 'VTDouble' || data.atttributes.vtDataType == 'VTLong') {
+        if (data.vtDataType == 'VTInteger' || data.vtDataType == 'VTDouble' || data.vtDataType == 'VTLong') {
           params.operatorDic =JSON.parse(JSON.stringify(this.operatorIntDic)) ;
-        } else if (data.atttributes.vtDataType == 'VTDateTime' || data.atttributes.vtDataType == 'VTDate' || data.atttributes.vtDataType == 'VTTime') {
+        } else if (data.vtDataType == 'VTDateTime' || data.vtDataType == 'VTDate' || data.vtDataType == 'VTTime') {
           params.operatorDic = JSON.parse(JSON.stringify(this.operatorDateDic))
         } else {
           params.operatorDic = JSON.parse(JSON.stringify(this.operatorDic))
         }
-        params.type=data.atttributes.vtDataType;
+        params.type=data.vtDataType;
         this.conditionList.push(params)
       }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.name,
+        value: data.name + this.treeIndex,
+        valueIndex: 'v' + this.treeIndex,
+        type:data.vtDataType,
+        children: [],
+        inputValue:'',
+        operator:'=',
+        showLabel:data.name
+      };
+      let showLabel='';
+      if(data.name.indexOf('.')!=-1){
+        const labels=data.name.split('.')
+        showLabel=labels[labels.length-1];
+      }else {
+        showLabel=data.name;
+      }
+      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) {
@@ -498,9 +532,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];
+            }
           }
         }
       })
@@ -578,21 +616,7 @@
     },
     //鏌ヨ
     queryHandler(){
-      this.$parent.$parent.$parent.$parent.$refs.form.validate((valid) => {
-        if (valid) {
-          this.queryResultDialog.loading=true;
-          const formData=this.$parent.$parent.$parent.$parent.initFormData();
-          getCriteria(formData).then(res => {
-            if (res.data.success) {
-              this.resultData=res.data.data;
-              this.queryResultDialog.showDialog=true;
-              this.queryResultDialog.loading=false;
-            }
-          });
-        } else {
-          return false;
-        }
-      });
+      this.$emit('queryHandler');
     },
     //閫夋嫨鏌ヨ妯℃澘
     checkTemp(index) {
@@ -610,15 +634,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;
     },
     //鑾峰彇鏌ヨ妯℃澘鍒楄〃

--
Gitblit v1.9.3