From 8bd81a9ff5543b40c8717b88af357250958598ef Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期一, 21 十月 2024 15:54:21 +0800
Subject: [PATCH] 处理上周遗留bug,表单定义查询模板

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue                  |    3 +
 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/tableDialog.vue |   48 +++++++++++++++--------
 Source/plt-web/plt-web-ui/src/api/UI/formDefine/api.js                                    |    9 ++++
 Source/plt-web/plt-web-ui/src/views/authority/function/functionView/index.vue             |    1 
 4 files changed, 44 insertions(+), 17 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/api/UI/formDefine/api.js b/Source/plt-web/plt-web-ui/src/api/UI/formDefine/api.js
index 6384a78..5a093b9 100644
--- a/Source/plt-web/plt-web-ui/src/api/UI/formDefine/api.js
+++ b/Source/plt-web/plt-web-ui/src/api/UI/formDefine/api.js
@@ -68,6 +68,15 @@
   })
 }
 
+// 琛ㄦ牸鏌ヨ妯℃澘涓嬫媺鏌ヨ
+export function getObjTypeQTs(params) {
+  return request({
+    url: "/api/templateController/getObjTypeQTs",
+    method: "get",
+    params
+  })
+}
+
 const obj ={
   "id": "",// 淇敼鏃跺�欏繀浼�
   "prm": {
diff --git a/Source/plt-web/plt-web-ui/src/views/authority/function/functionView/index.vue b/Source/plt-web/plt-web-ui/src/views/authority/function/functionView/index.vue
index 4bef6c2..a5a323e 100644
--- a/Source/plt-web/plt-web-ui/src/views/authority/function/functionView/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/authority/function/functionView/index.vue
@@ -103,6 +103,7 @@
       this.treeLoading = true;
       getSysModelAuth({roleId: row.oid}).then(res => {
         const data = res.data.data;
+        // console.log(data);
         this.$refs.uiTree.setCheckedKeys(data);
         this.treeLoading = false;
       })
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/tableDialog.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/tableDialog.vue
index cbfdc6b..320ee99 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/tableDialog.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/components/tableDialog.vue
@@ -284,8 +284,7 @@
       <el-col :span="24">
         <el-form-item label="鏌ヨ妯℃澘">
           <el-select v-model="form.itemQtName" placeholder="璇烽�夋嫨鏌ヨ妯℃澘" size="mini">
-            <el-option label="鍖哄煙涓�" value="shanghai"></el-option>
-            <el-option label="鍖哄煙浜�" value="beijing"></el-option>
+            <el-option v-for="(item,index) in searchQtNameList" :key="index" :label="item.qtName" :value="item.qtName"></el-option>
           </el-select>
         </el-form-item>
       </el-col>
@@ -324,7 +323,7 @@
 
 <script>
 import basicOption from "@/util/basic-option";
-import {gridPortalVIDatas, getPortalVIById, getItemDblList, savePortalVI} from "@/api/UI/formDefine/api";
+import {gridPortalVIDatas, getPortalVIById, getItemDblList, savePortalVI, getObjTypeQTs} from "@/api/UI/formDefine/api";
 import func from "@/util/func";
 
 export default {
@@ -345,6 +344,7 @@
   },
   data() {
     return {
+      searchQtNameList:[],
       formLoading: false,
       itemImgHeight: '',
       itemImgWidth: '',
@@ -454,7 +454,7 @@
     formSelectClickHandler() {
       this.selectFormVisible = true;
       const params = {
-        'conditionMap[typeName]': this.TreeNodeRow.id,
+        'conditionMap[typeName]': this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name,
         'conditionMap[viType]': 'Form',
         'conditionMap[viTypeFlag]': this.treeRadio === '0' ? 'BtmType' : this.treeRadio === '1' ? 'LinkType' : '',
       }
@@ -470,7 +470,7 @@
     getFormSelectList() {
       this.formLoading = true;
       const params = {
-        'conditionMap[typeName]': this.TreeNodeRow.id,
+        'conditionMap[typeName]': this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name,
         'conditionMap[viType]': 'Form',
         'conditionMap[viTypeFlag]': this.treeRadio === '0' ? 'BtmType' : this.treeRadio === '1' ? 'LinkType' : '',
       };
@@ -484,7 +484,7 @@
           // 纭繚 this.selectList 宸茬粡璧嬪�间笖涓嶄负绌�
           if (this.selectList && this.selectList.length > 0) {
             const param = {
-              id: this.selectList[0].id,
+              id: this.form.itemInObj,
               viType: '1'
             };
 
@@ -501,9 +501,17 @@
           const list = data.filter(item =>
             !this.form.itemOutFieldList.some(outItem => outItem.id === item.id)
           );
+          this.getSearchSelectList();
           this.$set(this.form, 'itemSelectOutFieldList', list);
           this.formLoading = false;
         }
+      })
+    },
+
+    // 鏌ヨ妯℃澘涓嬫媺鎺ュ彛鏌ヨ
+    getSearchSelectList(){
+      getObjTypeQTs({btName: this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name}).then(res => {
+        this.searchQtNameList = res.data.data;
       })
     },
 
@@ -671,6 +679,10 @@
 
     // 鏌ヨ妯℃澘娣诲姞
     searchAddClickHandler() {
+      if(!this.form.searchLabel){
+        this.$message.error('鏌ヨ瀛楁涓嶈兘涓虹┖!');
+        return;
+      }
       this.form.itemSeniorQueryBOS.push({
         itemSeniorQueryCols: this.form.searchLabel,
         itemSeniorQueryColsCounts: this.form.searchNumber,
@@ -685,37 +697,39 @@
         return;
       }
 
-      this.form.itemSeniorQueryBOS = this.form.itemSeniorQueryBOS.filter(item => item.itemSeniorQueryCols != this.itemSeniorRow.id);
-      this.itemSeniorRow = {};
+      this.form.itemSeniorQueryBOS = this.form.itemSeniorQueryBOS.filter(item => item.itemSeniorQueryCols != this.itemSeniorRow.itemSeniorQueryCols);
     },
 
     // 琛ㄦ牸瀵硅瘽妗嗕繚瀛�
     dialogSaveClickHandler() {
-      this.form.itemSelectOutFieldList = this.form.itemSelectOutFieldList.map(item => item.id); // 鍙娇鐢ㄥ瓧娈�
-      this.form.itemOutFieldList = this.form.itemOutFieldList.map(item => item.id); // 闇�瑕佷娇鐢ㄥ瓧娈�
-      this.form.itemSearchFieldList = this.form.itemSearchFieldList.map(item => item.id); // 鍙緵鎼滅储瀛楁
-      this.form.itemKeyFieldList = this.form.itemKeyFieldList.map(item => item.id); // 闇�瑕佷娇鐢ㄥ瓧娈�
-      this.form.itemImgWH = `${this.itemImgHeight},${this.itemImgWidth}`;
+      const paramsForm = {...this.form};
+      paramsForm.itemSelectOutFieldList = this.form.itemSelectOutFieldList.map(item => item.id); // 鍙娇鐢ㄥ瓧娈�
+      paramsForm.itemOutFieldList = this.form.itemOutFieldList.map(item => item.id); // 闇�瑕佷娇鐢ㄥ瓧娈�
+      paramsForm.itemSearchFieldList = this.form.itemSearchFieldList.map(item => item.id); // 鍙緵鎼滅储瀛楁
+      paramsForm.itemKeyFieldList = this.form.itemKeyFieldList.map(item => item.id); // 闇�瑕佷娇鐢ㄥ瓧娈�
+      paramsForm.itemImgWH = `${this.itemImgWidth},${this.itemImgHeight}`;
       const params = {
         id: this.form.editNodeId,
         prm: {
           formQtName: '',
           prmItemList: [
-            this.form
+            paramsForm
           ],
         },
         typeFlag: this.treeRadio,
         typeFlagText: this.treeRadio === '0' ? "涓氬姟绫诲瀷鐨勮〃鍗�" : '閾炬帴绫诲瀷鐨勮〃鍗�',
-        typeName: this.TreeNodeRow.attributes.id,
+        typeName: this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name, // 涓氬姟绫诲瀷鍚� or 閾炬帴绫诲瀷鍚�
         viName: this.form.viName,
         viType: 0,
         viTypeText: "琛ㄦ牸"
       }
       savePortalVI(params).then(res => {
+        // console.log(params);
         if (res.data.code === 200) {
-          this.$message.success('淇濆瓨鎴愬姛');
-          this.closeDialog();
+          this.$message.success(res.data.obj);
+          // this.closeDialog();
           this.$emit('updataTable');
+          this.visible = false;
         }
       })
     }
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue
index 37201c5..e5e94e5 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/formDefine/index.vue
@@ -174,6 +174,7 @@
       } else {
         this.$refs.tableDialog.visible = true;
         this.$refs.tableDialog.getDbList();
+        this.$refs.tableDialog.getSearchSelectList();
       }
     },
 
@@ -232,6 +233,7 @@
 
     // 宸︿晶鏍戠偣鍑�
     nodeClick(row) {
+      console.log(row);
       this.tableRadio = null;
       this.nodeRow = row;
       this.getRightPortalVIDatas(row);
@@ -278,6 +280,7 @@
 
     // 缂栬緫鎸夐挳
     editBtnClick(row) {
+      console.log('row',row);
       // 琛ㄦ牸
       if (row.viType === 0) {
         const params = {

--
Gitblit v1.9.3