浏览代码

位置关联

chenrui  2 年之前
父节点
当前提交
54d316462a

+ 88 - 5
src/components/Table/index.vue

@@ -309,13 +309,14 @@
                       "
                     >
                       <el-select
+                        v-if="asShow"
                         class="input-shadow"
                         size="small"
                         filterable
                         default-first-option
                         style="width: 100%"
                         v-model="tableForm[item.columnName]"
-                        @change="changeSelect(item.columnName)"
+                        @change="changeSelect(item.columnName, item)"
                         placeholder="请选择"
                       >
                         <el-option
@@ -582,6 +583,7 @@ export default {
   components: { Dialog, NoData },
   data() {
     return {
+      asShow: true,
       loading: false,
       flag: false,
       serviceId: null,
@@ -737,13 +739,40 @@ export default {
       this.noMore = false;
       this.tableData = [];
     },
-    changeSelect(data) {
+    changeSelect(data, name) {
       if (this.tableForm[data] === "") {
         this.tableForm[data] = null;
       }
       this.tableForm[this.tableOptions[data][0].setvalue] =
         this.tableForm[data];
-      //
+      if (this.tableForm.beginNode) {
+        const datas = _.cloneDeep(this.tableColsCopy);
+        // const reqUts = [];
+        datas.forEach(async (item) => {
+          if (item.columnLabel === "开始位置") {
+            this.tableOptions.beginPosition = await this.getSelectData(
+              item.listqueryTemplateID,
+              this.tableForm.beginNode
+            );
+            this.asShow = false;
+            this.asShow = true;
+          }
+        });
+      }
+      if (this.tableForm.endNode) {
+        const datas = _.cloneDeep(this.tableColsCopy);
+        // const reqUts = [];
+        datas.forEach(async (item) => {
+          if (item.columnLabel === "结束位置") {
+            this.tableOptions.endPosition = await this.getSelectData(
+              item.listqueryTemplateID,
+              this.tableForm.endNode
+            );
+            this.asShow = false;
+            this.asShow = true;
+          }
+        });
+      }
     },
     inputChangeHandler(data) {
       if (this.tableForm[data] === "") {
@@ -874,10 +903,10 @@ export default {
         });
     },
     //获取弹框-下拉数据
-    async getSelectData(id) {
+    async getSelectData(id, name) {
       const { code, returnData } = await Query({
         id,
-        dataContent: [],
+        dataContent: name ? [name] : [],
       });
       if (code == 0) {
         return returnData.listValues;
@@ -1006,12 +1035,66 @@ export default {
               row.queryTemplateColumnSetID
             );
             this.tableForm = JSON.parse(JSON.stringify(data));
+            // if (this.tableForm.beginNode) {
+            //   const datas = _.cloneDeep(this.tableColsCopy);
+            //   datas.forEach(async (item) => {
+            //     if (item.columnLabel === "开始位置") {
+            //       this.tableOptions.beginPosition = await this.getSelectData(
+            //         item.listqueryTemplateID,
+            //         this.tableForm.beginNode
+            //       );
+            //       this.asShow = false;
+            //       this.asShow = true;
+            //     }
+            //   });
+            // }
+            // if (this.tableForm.endNode) {
+            //   const datas = _.cloneDeep(this.tableColsCopy);
+            //   datas.forEach(async (item) => {
+            //     if (item.columnLabel === "结束位置") {
+            //       this.tableOptions.endPosition = await this.getSelectData(
+            //         item.listqueryTemplateID,
+            //         this.tableForm.endNode
+            //       );
+            //       this.asShow = false;
+            //       this.asShow = true;
+            //     }
+            //   });
+            // }
             // this.tableForm =this.tableForm;
             // Object.entries(tableForm).forEach(([key, value]) => {
             //   this.tableForm[key] = value
             // })
           } else {
             this.tableForm = JSON.parse(JSON.stringify(row));
+            if (this.tableForm.beginNode) {
+              const datas = _.cloneDeep(this.tableColsCopy);
+              // const reqUts = [];
+              datas.forEach(async (item) => {
+                if (item.columnLabel === "开始位置") {
+                  this.tableOptions.beginPosition = await this.getSelectData(
+                    item.listqueryTemplateID,
+                    this.tableForm.beginNode
+                  );
+                  this.asShow = false;
+                  this.asShow = true;
+                }
+              });
+            }
+            if (this.tableForm.endNode) {
+              const datas = _.cloneDeep(this.tableColsCopy);
+              // const reqUts = [];
+              datas.forEach(async (item) => {
+                if (item.columnLabel === "结束位置") {
+                  this.tableOptions.endPosition = await this.getSelectData(
+                    item.listqueryTemplateID,
+                    this.tableForm.endNode
+                  );
+                  this.asShow = false;
+                  this.asShow = true;
+                }
+              });
+            }
           }
           this.flag = true;
           this.tableType = "edit";

+ 3 - 24
src/views/systemSettings/views/warningSet/warningEdit.vue

@@ -78,7 +78,6 @@
         </el-form>
       </div>
     </div>
-
     <div class="centerBox">
       <div class="wrap">
         <DataTable
@@ -93,8 +92,7 @@
           authEdit="ss_aim_cardEdit"
           authDel="ss_aim_cardDelete"
           tableHeight="610"
-          :tableup="true"
-          :data-content="{ queryTemplateID }"
+          :data-content="{ alarmSceneId }"
         >
           <template v-slot:header>
             <div class="status flex-wrap">
@@ -270,10 +268,8 @@ import { Query, GeneralDataReception } from "@/api/dataIntegration";
 import { getQuery } from "@/api/flight";
 import DataTable from "@/components/Table";
 import {
-  AddWarning,
   AirlinesInquiry,
   AirportsList,
-  UserWarningList,
   AddUserWarning,
   DelUserWarning,
   traceNodeslist,
@@ -283,27 +279,10 @@ export default {
   components: { Dialog, Search, DataTable },
   data() {
     return {
-      queryTemplateID: null,
+      alarmSceneId: null,
       viShow: false,
       dataId: DATACONTENT_ID.sysServiceStrategyId,
-      optionProps: {
-        value: "inAicompanyCode2",
-        label: "inAicompanyCode2",
-      },
-      optionPropser: {
-        value: "outAicompanyCode2",
-        label: "outAicompanyCode2",
-      },
       id: this.$route.query.id,
-      // airportCode2: this.$route.query.airportCode2,
-      // BeginTime1: this.$route.query.BeginTime1,
-      // flightNO: this.$route.query.flightNO,
-      // ladingAirport: this.$route.query.ladingAirport,
-      // desc: this.$route.query.desc,
-      // warnName: this.$route.query.warnName,
-      // code2: this.$route.query.airportCode2,
-      // code3: this.$route.query.departureAirport,
-      // code4: this.$route.query.ladingAirport,
       flag: false,
       tableFormer: {},
       aircompeny: [],
@@ -400,7 +379,7 @@ export default {
     };
   },
   created() {
-    this.queryTemplateID = Number(this.$route.query.id);
+    this.alarmSceneId = Number(this.$route.query.id);
     this.sysServiceWarn();
     // this.UserWarning();
   },

+ 1 - 9
src/views/systemSettings/views/warningSet/warningSet.vue

@@ -243,22 +243,14 @@
 import Search from "@/layout/components/Search/index.vue";
 import { findarrays } from "@/utils/validate";
 import {
-  warningList,
   AddWarning,
   AirlinesInquiry,
-  AirportsList,
   DelWarning,
 } from "@/api/SystemSettings.js";
 import Dialog from "@/layout/components/Dialog/index.vue";
 import { getQuery } from "@/api/flight";
 import DataTable from "@/components/Table";
-import {
-  Query,
-  GeneralDataReception,
-  Start,
-  Stop,
-} from "@/api/dataIntegration";
-import { de } from "vis";
+import { Query, GeneralDataReception } from "@/api/dataIntegration";
 export default {
   components: { Search, Dialog, DataTable },
   data() {