From 59ff9baa407775998954f271f7ed2cde8db01a26 Mon Sep 17 00:00:00 2001
From: wangting <wangting@vci-tech.com>
Date: 星期二, 14 一月 2025 17:06:05 +0800
Subject: [PATCH] 查询模板下拉框数据联动,排序列表与创建表单排序字段数据联动

---
 Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue                       |   14 ++--
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue      |  103 +++++++++++++++++-----------------
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue |   13 ++--
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue  |    2 
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue           |   12 +++
 5 files changed, 77 insertions(+), 67 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue
index 166830c..d09d91f 100644
--- a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue
+++ b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue
@@ -1,6 +1,6 @@
 <template>
   <!--鍔ㄦ�佹ā鏉�-->
-  <avue-form ref="form" :option="option" v-model="form" v-loading="loading">
+  <avue-form ref="basicform" :option="option" v-model="form" v-loading="loading">
     <template v-for="item in allColumn" :slot="item.prop+ ''">
       <vciWebRefer
         v-if="item.type === 'refer'"
@@ -326,7 +326,7 @@
     // 琛ㄥ崟鏍¢獙
     validate(done) {
       return new Promise((resolve) => {
-        this.$refs.form.validate((valid,fields) => {
+        this.$refs.basicform.validate((valid,fields) => {
           done(valid,fields);
           if (valid) {
             resolve(true);
@@ -339,19 +339,19 @@
       });
     },
     resetFields(){
-      this.$refs.form.resetFields()
+      this.$refs.basicform.resetFields()
     },
     clearValidate(props){
-      this.$refs.form.clearValidate(props)
+      this.$refs.basicform.clearValidate(props)
     },
     updateDic(prop,data){
-      this.$refs.form.updateDic(prop,data)
+      this.$refs.basicform.updateDic(prop,data)
     },
     dicInit(){
-      this.$refs.form.dicInit()
+      this.$refs.basicform.dicInit()
     },
     getPropRef(){
-      this.$refs.form.getPropRef()
+      this.$refs.basicform.getPropRef()
     }
   },
 };
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 df7697a..c67930c 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
@@ -365,7 +365,7 @@
       this.orderFieldList.unshift({
         id: data.row.orderField
       });
-      this.tableFormOption.column[0].dicData = this.orderFieldList
+      this.$refs.tableForm.updateDic('orderField',this.orderFieldList);
     },
     //鑾峰彇鎺掑簭璁剧疆涓墍鏈夋帓搴忓瓧娈�
     getAllAttr() {
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 e1c0044..f49918d 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
@@ -143,7 +143,16 @@
         }, {
           label: '鍙嶅悜',
           value: 'opposite'
-        }]
+        }],
+        control: (val, form) => {
+          const dicData=this.getDicData(val);
+          this.form.btmType=dicData[0].value
+          return {
+            btmType: {
+              dicData: dicData
+            }
+          };
+        }
       },{
         label: '涓氬姟绫诲瀷',
         prop: 'btmType',
@@ -155,7 +164,14 @@
           message: "璇烽�夋嫨涓氬姟绫诲瀷",
           trigger: "blur"
         }],
-        dicData: []
+        dicData: [],
+        change: ({ value, column, item, dic }) => {
+          this.form.btmType=value;
+          if(value){
+            this.getAllAttr();
+            this.getTemp(value,false);
+          }
+        },
       }, {
         label: '鐗堟湰鐗堟',
         prop: 'version',
@@ -315,54 +331,7 @@
 
     };
   },
-  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,
-    }
-  },
+  watch: {},
   methods: {
     openDialog(btmName, title, mode, data) {
       this.dialog.title = title;
@@ -384,6 +353,9 @@
         this.queryCondition=this.selectData.queryTemplate.condition;
         this.queryTree=this.selectData.tree;
         this.form.levelFlag=this.selectData.levelFlag;
+
+        const dicData=this.getDicData(this.form.direction);
+        this.formItems[2].dicData=dicData;
       } else {
         this.form.direction='positive';
         this.selectData = {};
@@ -393,10 +365,39 @@
           connector:'骞朵笖',
           child:[]
         };
+        const dicData=this.getDicData(this.form.direction);
+        this.formItems[2].dicData=dicData;
+        this.form.btmType=dicData[0].value;
       }
       this.dialog.showDialog = true;
       this.treeOption.defaultExpandedKeys=[data.treeData.label]
       this.getTemp(data.treeData.label, true)
+    },
+    //鑾峰彇涓氬姟绫诲瀷涓嬫媺鏁版嵁
+    getDicData(directionVal){
+      let dicData=[];
+      if(directionVal=='positive'){
+        //姝e悜
+        dicData=this.treeData.btmItemsTo.map(item=>{
+          return {
+            label: item,
+            value: item
+          }
+        })
+      }else if(directionVal=='opposite'){
+        //鍙嶅悜
+        dicData=this.treeData.btmItemsFrom.map(item=>{
+          return {
+            label: item,
+            value: item
+          }
+        })
+      }
+      dicData.push({
+        label: '鎵�鏈夌被鍨�',
+        value: '*'
+      })
+      return dicData;
     },
     cancelDialog() {
       this.dialog.loading = false;
@@ -497,7 +498,7 @@
       this.orderFieldList.unshift({
         id: data.row.orderField
       });
-      this.tableFormOption.column[0].dicData= this.orderFieldList
+      this.$refs.tableForm.updateDic('orderField',this.orderFieldList);
     },
     //鑾峰彇鎺掑簭璁剧疆涓墍鏈夋帓搴忓瓧娈�
     getAllAttr() {
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 73a0c21..f03a5b9 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
@@ -49,11 +49,11 @@
                  @node-click="nodeClick"></avue-tree>
     </div>
     <div v-if="!readOnly" style="text-align: right;margin-top: 10px;">
-      <el-button v-if="radioForm==1" plain size="mini" type="primary" @click="addHandler">澧炲姞閫昏緫</el-button>
-      <el-button v-if="radioForm==1" plain size="mini" type="primary" @click="editHandler">淇敼鏉′欢</el-button>
-      <el-button v-if="radioForm==1" plain size="mini" type="primary" @click="delHandler">鍒犻櫎</el-button>
+      <el-button v-show="radioForm==1" plain size="mini" type="primary" @click="addHandler">澧炲姞閫昏緫</el-button>
+      <el-button v-show="radioForm==1" plain size="mini" type="primary" @click="editHandler">淇敼鏉′欢</el-button>
+      <el-button v-show="radioForm==1" plain size="mini" type="primary" @click="delHandler">鍒犻櫎</el-button>
       <el-button plain size="mini" type="primary" @click="queryHandler">鏌ヨ</el-button>
-      <el-button plain size="mini" type="primary" @click="">鍙栨秷</el-button>
+      <!--<el-button plain size="mini" type="primary" @click="">鍙栨秷</el-button>-->
     </div>
 
     <!--淇敼鏉′欢-->
@@ -155,7 +155,6 @@
 <script>
 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 {
@@ -506,7 +505,9 @@
     }
   },
   created() {
-    this.getTemp();
+    if (!this.readOnly) {
+      this.getTemp();
+    }
   },
   methods: {
     // 鎷栨嫿鍒版椂
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 af91b00..b3519cc 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
@@ -141,7 +141,11 @@
           prop: 'btmType',
           width: 130,
           formatter:function (row, value) {
-            return row.queryTemplate.btmType;
+            if (row.queryTemplate.btmType == '*') {
+              return '鎵�鏈夌被鍨�'
+            } else {
+              return row.queryTemplate.btmType;
+            }
           }
         }, {
           label: '鐗堟湰鐗堟',
@@ -164,7 +168,11 @@
           prop: 'queryISLeaf',
           width: 120,
           formatter:function (row, value) {
-            return row.queryTemplate.queryISLeaf
+            if(row.queryTemplate.queryISLeaf=='false' || row.queryTemplate.queryISLeaf==false){
+              return '鍚�'
+            }else{
+              return '鏄�'
+            }
           }
         }, {
           label: '瀛愯妭鐐瑰眰娆℃暟',

--
Gitblit v1.9.3