From 3b3fd904b9b34e77445d749bca8c28beadcaf3db Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期三, 27 十一月 2024 14:35:50 +0800
Subject: [PATCH] 查询模板查询条件显示

---
 Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/dataView.vue                  |   28 +++++---
 Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue                     |   86 ++++++++++++++++++++++++++++
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue      |    2 
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue |   18 +++++-
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue             |    4 
 Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue  |    2 
 6 files changed, 120 insertions(+), 20 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/dataView.vue b/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/dataView.vue
index 3ee08e4..b2eb1c6 100644
--- a/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/dataView.vue
+++ b/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/dataView.vue
@@ -1,13 +1,15 @@
 <template>
   <div style="padding: 10px 0">
-    <el-tabs tab-position="left" style="height: 100%;">
+    <el-tabs tab-position="left" :style="'height: '+height+';'">
       <el-tab-pane label="涓讳綋">
         <fieldset>
           <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>
-
+            <div v-if="!readOnly">
+              <el-button plain size="mini" type="primary" @click="userHandler">閫変腑鐢ㄦ埛</el-button>
+              <el-button plain size="mini" type="primary" @click="roleHandler">閫夋嫨瑙掕壊</el-button>
+              <el-button plain size="mini" type="primary" @click="deptHandler">閫夋嫨鐢ㄦ埛缁�</el-button>
+            </div>
           </div>
         </fieldset>
       </el-tab-pane>
@@ -21,7 +23,13 @@
 export default {
   name: "dataView",
   props: {
-    selectData: {
+    //閫変腑鐨勪笟鍔$被鍨嬭妭鐐�
+    btmNode: {
+      type: Object,
+      default: {}
+    },
+    //閫変腑琛屾暟鎹�
+    data: {
       type: Object,
       default: {}
     },
@@ -29,21 +37,19 @@
       type: Boolean,
       default: false
     },
+    height: {
+      type: String,
+      default: '400px'
+    },
   },
   data() {
     return {
-      data:{
-
-      }
     }
   },
   created() {
-    this.getData();
   },
   methods: {
-    getData(){
 
-    }
   }
 }
 </script>
diff --git a/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue b/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue
index f3955f1..1412b4f 100644
--- a/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue
@@ -35,8 +35,25 @@
           </template>
         </avue-crud>
         <div>
-          <data-view key="dataView"></data-view>
+          <data-view key="dataView" :btmNode="nodeRow" :data="viewData" :readOnly="true" height="400px"></data-view>
         </div>
+        <!-- 鏂板 && 缂栬緫 -->
+        <el-dialog
+          v-dialogDrag
+          :title="title === 'add' ? '鍒涘缓' : '淇敼'"
+          :visible.sync="visible"
+          append-to-body="true"
+          class="avue-dialog"
+          width="75%"
+          @close="addDialogClose">
+            <div>
+              <data-view key="editView" :btmNode="nodeRow" :data="viewData" :readOnly="false" height="60vh"></data-view>
+            </div>
+            <span slot="footer" class="dialog-footer">
+               <el-button size="small" type="primary" @click="addDialogSavaHandler">纭� 瀹�</el-button>
+               <el-button size="small" @click="addDialogClose">鍙� 娑�</el-button>
+            </span>
+        </el-dialog>
         <!-- 鏌ョ湅鎺堟潈缁撴灉    -->
         <el-dialog
           v-dialogDrag
@@ -70,6 +87,7 @@
 import {getTypeActionByType} from "@/api/authority/ui/typeAction";
 import func from "@/util/func";
 import {getUsedEnumList} from "@/api/modeling/enumType/api";
+import {deleteTemplate, saveTemplate, updateTemplate} from "@/api/queryTemplate/queryDefine";
 export default {
   name: "index",
   components:{dataView},
@@ -116,6 +134,10 @@
         ]
       },
       data: [],
+      viewData:{},
+      title: '',
+      visible: false,
+      form:{}
     }
   },
   created() {
@@ -164,10 +186,15 @@
           this.selectList = [row];
         }
       );
+      this.getViewData(row)
     },
     // 閫夋嫨妗�
     selectChange(row) {
       this.selectList = row;
+    },
+    //鑾峰彇涓嬫柟鏁版嵁
+    getViewData(row){
+      this.viewData={};
     },
     // 鏌ョ湅鎺堟潈缁撴灉
     chekView() {
@@ -206,7 +233,62 @@
       done();
 
     },
-
+    //鍒涘缓
+    addHandler(){
+      if (func.isEmptyObject(this.nodeRow)) {
+        this.$message.error('璇烽�夋嫨瑕佹坊鍔犵殑鑺傜偣');
+        return;
+      }
+      this.title = 'add';
+      this.visible = true;
+    },
+    //淇敼
+    editHandler(){
+      if (func.isEmptyObject(this.nodeRow)) {
+        this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�');
+        return;
+      }
+      this.title = 'edit';
+      this.visible = true;
+    },
+    // 鏂板缂栬緫淇濆瓨
+    addDialogSavaHandler() {
+      saveTemplate(this.viewData).then(res => {
+        if (res.data.code === 200) {
+          this.$message.success(res.data.obj);
+          this.getTableList();
+          this.addDialogClose();
+        }
+      })
+    },
+    // 鏂板缂栬緫瀵硅瘽妗嗗彇娑�
+    addDialogClose() {
+      this.visible = false;
+    },
+    //鍒犻櫎
+    delHandler(){
+      if (func.isEmptyObject(this.nodeRow)) {
+        this.$message.error('璇烽�夋嫨鏁版嵁');
+        return;
+      }
+      this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬暟鎹悧锛�', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        deleteTemplate({name:this.templateForm}).then(res => {
+          if (res.data.code === 200) {
+            this.$message.success(res.data.obj);
+            this.getTableList();
+          }
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '宸插彇娑堝垹闄�'
+        });
+      });
+    },
     // 鏌ョ湅浣跨敤鑼冨洿閲嶇疆
     checkHandleReset() {
       this.checkViewData = this.checkViewDataSearch;
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 655a93b..3533948 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
@@ -71,7 +71,7 @@
       </el-container>
     </div>
     <div class="dialog-footer avue-dialog__footer">
-      <el-button plain size="small" type="primary" @click="submitDialog">淇� 瀛�</el-button>
+      <el-button size="small" type="primary" @click="submitDialog">淇� 瀛�</el-button>
       <el-button size="small" @click="cancelDialog">鍙� 娑�</el-button>
     </div>
   </el-dialog>
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 511838f..8c35f7c 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
@@ -79,7 +79,7 @@
       </el-container>
     </div>
     <div class="dialog-footer avue-dialog__footer">
-      <el-button type="primary" plain size="small" @click="submitDialog" >淇� 瀛�</el-button>
+      <el-button type="primary" size="small" @click="submitDialog" >淇� 瀛�</el-button>
       <el-button size="small" @click="cancelDialog">鍙� 娑�</el-button>
     </div>
   </el-dialog>
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 f34c297..bfe46ab 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
@@ -35,7 +35,7 @@
         <avue-input v-else v-model="condition.ordinaryValue" :disabled="readOnly" placeholder=""
                     style="width: 300px;margin-right: 5px;"></avue-input>-->
         <avue-input v-model="condition.ordinaryValue" :disabled="readOnly" placeholder=""
-                    style="width: 300px;margin-right: 5px;"></avue-input>
+                    style="width: 36%;margin-right: 5px;"></avue-input>
         <el-button v-if="!readOnly" plain size="mini" type="primary" @click="checkTemp(index)">閫夋嫨鏌ヨ妯℃澘</el-button>
         <el-button v-if="!readOnly" icon="el-icon-delete" size="mini" style="padding: 7px 8px" type="danger"
                    @click="delCondition(index)"></el-button>
@@ -357,7 +357,7 @@
                 if (queryTemplate.condition.cIMap[key].leafInfo.value.queryTemplate) {
                   getValue(queryTemplate.condition.cIMap[key].leafInfo.value.queryTemplate, item)
                 } else {
-                  item.ordinaryValue = queryTemplate.condition.cIMap[key].leafInfo.value.ordinaryValue;
+                  //item.ordinaryValue = queryTemplate.condition.cIMap[key].leafInfo.value.ordinaryValue;
                   item.type = queryTemplate.condition.cIMap[key].leafInfo.type;
                   if (['VTInteger', 'VTDouble', 'VTLong'].includes(item.type)) {
                     item.operatorDic = that.operatorIntDic;
@@ -381,7 +381,19 @@
                 operatorDic: []
               }
               if (this.queryCondition.cIMap[key].leafInfo.value.queryTemplate) {
-                getValue(this.queryCondition.cIMap[key].leafInfo.value.queryTemplate, item)
+                item.ordinaryValue = this.queryCondition.cIMap[key].leafInfo.value.queryTemplate.id+';'+this.queryCondition.cIMap[key].leafInfo.value.queryTemplate.clauseList.join(',');
+                if(this.queryCondition.cIMap[key].leafInfo.value.queryTemplate.id.indexOf('qt_')==0){
+                  getValue(this.queryCondition.cIMap[key].leafInfo.value.queryTemplate, item)
+                }else {
+                  item.type = this.queryCondition.cIMap[key].leafInfo.type;
+                  if (['VTInteger', 'VTDouble', 'VTLong'].includes(item.type)) {
+                    item.operatorDic = that.operatorIntDic;
+                  } else if (['VTDateTime', 'VTDate', 'VTTime'].includes(item.type)) {
+                    item.operatorDic = that.operatorDateDic;
+                  } else {
+                    item.operatorDic = that.operatorDic;
+                  }
+                }
               } else {
                 item.ordinaryValue = this.queryCondition.cIMap[key].leafInfo.value.ordinaryValue;
                 item.type = this.queryCondition.cIMap[key].leafInfo.type;
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue
index 0258cd6..749b9f9 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/queryDefine/index.vue
@@ -57,8 +57,8 @@
         @select="selectHandler">
       </avue-crud>
       <span slot="footer" class="dialog-footer">
-         <el-button @click="addDialogClose">鍙� 娑�</el-button>
-         <el-button type="primary" @click="addDialogSavaHandler">纭� 瀹�</el-button>
+         <el-button size="small" type="primary" @click="addDialogSavaHandler">纭� 瀹�</el-button>
+         <el-button size="small" @click="addDialogClose">鍙� 娑�</el-button>
         </span>
     </el-dialog>
   </el-container>

--
Gitblit v1.9.3