Browse Source

修改预警报警

zhaoke 1 year ago
parent
commit
a76685a5bf

+ 13 - 1
public/config.js

@@ -73,7 +73,13 @@ var NEW_DATACONTENT_ID = [
   52034,
   52033,
   52022,
-  52023
+  52023,
+  9, //航站查询
+  10, //航司查询
+  11, //节点查询
+  12, //位置查询
+  13, //预警报警场景维护
+  14, //预警报警策略维护
 ]
 
 var DATACONTENT_ID = {
@@ -181,6 +187,12 @@ var DATACONTENT_ID = {
   sysServiceWarningId: 18029, //查询预警报警场景列表
   sysServiceWarnId: 18030, //预警报警场景(按照ID)
   sysServiceStrategyId: 18033, //预警报警策略(按照ID)
+  sysServiceHzId: 9, //预警报警-航站查询
+  sysServiceHsId: 10, //预警报警-航司查询
+  sysServiceJdId: 11, //预警报警-节点查询
+  sysServiceWzId: 12, //预警报警-位置查询
+  sysServiceCjId: 13, //预警报警-场景维护
+  sysServiceClId: 14, //预警报警-策略维护
   sysQueryEditId: 24, //系统设置-查询模板-编辑-根据id获取服务
   sysQueryChildTabId: 25, //系统设置-查询模板-列设置-表格-id
   sysQueryChildEditTabId: 26, //系统设置-查询模板-列设置-表格-编辑-id

+ 17 - 0
src/api/webApi.ts

@@ -37,6 +37,23 @@ export async function myQuery(id, ...dataContent) {
   }
 }
 
+export async function htQuery(id, ...dataContent) {
+  const params = {
+    id,
+    dataContent,
+  }
+  try {
+    const result = await Query(params)
+    if (Number(result.code) === 0) {
+      return result.returnData
+    } else {
+      return []
+    }
+  } catch (error) {
+    return []
+  }
+}
+
 export function GeneralDataReception(params): Promise<CommonQueryResult> {
   return request({
     url: '/openApi/generalDataReception',

+ 80 - 99
src/views/systemSettings/warningEdit/index.vue

@@ -17,13 +17,16 @@
           </div> -->
           <div class="outersurface pd30">
             <el-form-item label="航司二字码" size="default" prop="IATACode" :rules="formRules.isNotNull">
-              <el-input v-model="tableForm.IATACode" placeholder="请输入航司二字码" />
+              <el-select style="width: 100%" v-model="tableForm.IATACode" class="input-shadow" filterable default-first-option clearable placeholder="请选择航司二字码">
+                <el-option v-for="item in iaCodeArr" :key="item.airlineCompanyID" :label="item.ITATCode" :value="item.ITATCode">
+                </el-option>
+              </el-select>
             </el-form-item>
           </div>
           <div class="outersurface pd30">
             <el-form-item label="起飞机场" size="default">
               <el-select style="width: 100%" v-model="tableForm.departmentAirport" class="input-shadow" filterable default-first-option clearable placeholder="请选择起飞机场">
-                <el-option v-for="item in tableOption" :key="item.v ? item.v : item.planDepartureApt" :label="item.k ? item.k : item.planDepartureApt" :value="item.v ? item.v : item.planDepartureApt">
+                <el-option v-for="item in tableOption" :key="item.airportID" :label="item.airportName" :value="item.IATACode">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -31,7 +34,7 @@
           <div class="outersurface pd30">
             <el-form-item label="降落机场" size="default">
               <el-select style="width: 100%" v-model="tableForm.landingAirport" class="input-shadow" filterable default-first-option clearable placeholder="请选择降落机场">
-                <el-option v-for="item in tableOption" :key="item.v ? item.v : item.planDepartureApt" :label="item.k ? item.k : item.planDepartureApt" :value="item.v ? item.v : item.planDepartureApt">
+                <el-option v-for="item in tableOption" :key="item.airportID" :label="item.airportName" :value="item.IATACode">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -98,7 +101,7 @@
             <el-col :span="12">
               <el-form-item label="开始节点" size="default">
                 <el-select style="width: 100%" v-model="tableForms.beginNode" class="input-shadow" filterable default-first-option clearable placeholder="请选择开始节点" @change="changeSelect">
-                  <el-option v-for="item in tableOptionser" :key="item.v" :label="item.k" :value="item.v">
+                  <el-option v-for="item in tableOptionser" :key="item.nodeID" :label="item.nodeName" :value="item.nodeCode">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -106,7 +109,7 @@
             <el-col :span="12">
               <el-form-item label="开始位置" size="default">
                 <el-select style="width: 100%" v-model="tableForms.beginPosition" class="input-shadow" filterable default-first-option clearable placeholder="请选择开始位置" @change="changebegin">
-                  <el-option v-for="item in tableOptionbegin" :key="item.v ? item.v : item.planDepartureApt" :label="item.k ? item.k : item.planDepartureApt" :value="item.v ? item.v : item.planDepartureApt">
+                  <el-option v-for="item in tableOptionbegin" :key="item.positionID" :label="item.positionDescribe" :value="item.locationCode">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -114,7 +117,7 @@
             <el-col :span="12">
               <el-form-item label="结束节点" size="default">
                 <el-select style="width: 100%" v-model="tableForms.endNode" class="input-shadow" filterable default-first-option clearable placeholder="请选择结束节点" @change="changeSelected">
-                  <el-option v-for="item in tableOptionend" :key="item.v ? item.v : item.planDepartureApt" :label="item.k ? item.k : item.planDepartureApt" :value="item.v ? item.v : item.planDepartureApt">
+                  <el-option v-for="item in tableOptionser" :key="item.nodeID" :label="item.nodeName" :value="item.nodeCode">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -122,7 +125,7 @@
             <el-col :span="12">
               <el-form-item label="结束位置" size="default">
                 <el-select style="width: 100%" v-model="tableForms.endPosition" class="input-shadow" filterable default-first-option clearable placeholder="请选择结束位置" @change="changeEndPos">
-                  <el-option v-for="item in tableOptionendPos" :key="item.v ? item.v : item.planDepartureApt" :label="item.k ? item.k : item.planDepartureApt" :value="item.v ? item.v : item.planDepartureApt">
+                  <el-option v-for="item in tableOptionbegin" :key="item.positionID" :label="item.positionDescribe" :value="item.locationCode">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -144,8 +147,9 @@ import _ from "lodash";
 import Minheader from "@/components/minheader/index.vue";
 import DataTable from "@/components/tableTemp/index.vue";
 import Dialog from "@/components/dialog/index.vue";
-import { Query, GeneralDataReception } from "@/api/webApi";
+import { Query, GeneralDataReception, htQuery } from "@/api/webApi";
 import { ElMessage } from "element-plus";
+import { onMounted } from "vue";
 const formRules = useElement().formRules;
 const router = useRouter();
 const route = useRoute();
@@ -154,6 +158,7 @@ const dataContent = ref<object>({});
 const noMore = ref<boolean>(false);
 const rowTitle = ref<string>("");
 const tableCols = ref<any>([]); //表头数据
+const iaCodeArr = ref<any>([]); //航司二字码
 const serviceId = ref<string | any>("");
 const beginPositionId = ref<string | any>("");
 const endPositionId = ref<string | any>("");
@@ -270,41 +275,6 @@ const btnClick = (row, index, param) => {
         }
       }
     }
-    return;
-    calculationBasis.value.forEach((element) => {
-      if (index.calculationBasis === element.k) {
-        tableForms.calculationBasis = element.v;
-      }
-    });
-    tableOptionser.value.forEach((element) => {
-      if (index.beginNode === element.k) {
-        tableForms.beginNode = element.v;
-      }
-    });
-    tableOptionbegin.value.forEach((element) => {
-      if (index.beginPosition === element.k) {
-        tableForms.beginPosition = element.v;
-      }
-    });
-    tableOptionend.value.forEach((element) => {
-      if (index.endNode === element.k) {
-        tableForms.endNode = element.v;
-      }
-    });
-    tableOptionendPos.value.forEach((element) => {
-      if (index.endPosition === element.k) {
-        tableForms.endPosition = element.v;
-      }
-    });
-    tableForms.alarmStrategyID = index.alarmStrategyID;
-    tableForms.StrategyName = index.StrategyName;
-    // tableForms.calculationBasis = index.calculationBasis;
-    tableForms.warningDuration = index.warningDuration;
-    tableForms.alarmDuration = index.alarmDuration;
-    // tableForms.beginNode = index.beginNode;
-    // tableForms.beginPosition = index.beginPosition;
-    // tableForms.endNode = index.endNode;
-    // tableForms.endPosition = index.endPosition;
   } else if (param === 3) {
     msgTitle.value = "删除报警预警策略";
     flag.value = true;
@@ -328,34 +298,19 @@ const btnClick = (row, index, param) => {
 //获取预警报警场景(按照ID)
 const sysServiceWarn = async () => {
   try {
-    let arr = [route.query.alarmSceneId];
-    // arr.push(this.$route.query.id);
-    const { code, returnData } = await Query({
-      id: DATACONTENT_ID.sysServiceWarnId,
-      dataContent: arr,
+    const result: any = await htQuery(DATACONTENT_ID.sysServiceCjId, {
+      alarmSceneId: route.query.alarmSceneId,
     });
-    if (code === "0") {
-      tableForm.alarmSceneId = returnData.listValues[0].alarmSceneId
-        ? returnData.listValues[0].alarmSceneId
-        : "";
-      tableForm.IATACode = returnData.listValues[0].IATACode
-        ? returnData.listValues[0].IATACode
-        : "";
-      tableForm.departmentAirport = returnData.listValues[0].departmentAirport
-        ? returnData.listValues[0].departmentAirport
-        : "";
-      tableForm.landingAirport = returnData.listValues[0].landingAirport
-        ? returnData.listValues[0].landingAirport
-        : "";
-      tableForm.flightNo = returnData.listValues[0].flightNo
-        ? returnData.listValues[0].flightNo
-        : "";
-      tableForm.startDate = returnData.listValues[0].startDate
-        ? returnData.listValues[0].startDate
-        : "";
-      tableForm.endDate = returnData.listValues[0].endDate
-        ? returnData.listValues[0].endDate
-        : "";
+    if (result.length) {
+      const newVal = _.cloneDeep(result[0]);
+      for (const key in tableForm) {
+        console.log(key);
+        for (const p in newVal) {
+          if (key == p) {
+            tableForm[key] = newVal[p];
+          }
+        }
+      }
     } else {
       // this.page--;
       // this.$message.error.message;
@@ -389,15 +344,15 @@ const getSelectData = async (id, name, dataNme) => {
     if (dataNme === "calculationBasis") {
       calculationBasis.value = returnData.listValues;
     }
-    if (dataNme === "beginNode") {
-      tableOptionser.value = returnData.listValues;
-    } else if (dataNme === "beginPosition") {
-      tableOptionbegin.value = returnData.listValues;
-    } else if (dataNme === "endNode") {
-      tableOptionend.value = returnData.listValues;
-    } else if (dataNme === "endPosition") {
-      tableOptionendPos.value = returnData.listValues;
-    }
+    // if (dataNme === "beginNode") {
+    //   tableOptionser.value = returnData.listValues;
+    // } else if (dataNme === "beginPosition") {
+    //   tableOptionbegin.value = returnData.listValues;
+    // } else if (dataNme === "endNode") {
+    //   tableOptionend.value = returnData.listValues;
+    // } else if (dataNme === "endPosition") {
+    //   tableOptionendPos.value = returnData.listValues;
+    // }
   } else {
   }
 };
@@ -426,23 +381,23 @@ const getQuery = async () => {
         if (item.columnName === "calculationBasis") {
           getSelectData(item.listqueryTemplateID, "", "calculationBasis");
         }
-        if (item.listqueryTemplateID && item.columnName === "beginNode") {
-          getSelectData(item.listqueryTemplateID, "", "beginNode");
-        } else if (
-          item.listqueryTemplateID &&
-          item.columnName === "beginPosition"
-        ) {
-          getSelectData(item.listqueryTemplateID, null, "beginPosition");
-          beginPositionId.value = item.listqueryTemplateID;
-        } else if (item.listqueryTemplateID && item.columnName === "endNode") {
-          getSelectData(item.listqueryTemplateID, "", "endNode");
-        } else if (
-          item.listqueryTemplateID &&
-          item.columnName === "endPosition"
-        ) {
-          getSelectData(item.listqueryTemplateID, null, "endPosition");
-          endPositionId.value = item.listqueryTemplateID;
-        }
+        // if (item.listqueryTemplateID && item.columnName === "beginNode") {
+        //   getSelectData(item.listqueryTemplateID, "", "beginNode");
+        // } else if (
+        //   item.listqueryTemplateID &&
+        //   item.columnName === "beginPosition"
+        // ) {
+        //   getSelectData(item.listqueryTemplateID, null, "beginPosition");
+        //   beginPositionId.value = item.listqueryTemplateID;
+        // } else if (item.listqueryTemplateID && item.columnName === "endNode") {
+        //   getSelectData(item.listqueryTemplateID, "", "endNode");
+        // } else if (
+        //   item.listqueryTemplateID &&
+        //   item.columnName === "endPosition"
+        // ) {
+        //   getSelectData(item.listqueryTemplateID, null, "endPosition");
+        //   endPositionId.value = item.listqueryTemplateID;
+        // }
       });
       tableCols.value.forEach((element) => {
         element.label = element.columnLabel;
@@ -555,9 +510,35 @@ const generalDataReceptions = async (data) => {
     }
   } catch (error) {}
 };
-sysServiceWarn();
-getQuery();
-getSelectDatas(route.query.listqueryTemplateID);
+//获取航司二字码
+const getIaCode = async () => {
+  const result = await htQuery(DATACONTENT_ID.sysServiceHsId);
+  iaCodeArr.value = result;
+};
+//获取机场
+const getAirpot = async () => {
+  const result = await htQuery(DATACONTENT_ID.sysServiceHzId);
+  tableOption.value = result;
+};
+//获取节点
+const getJdData = async () => {
+  const result = await htQuery(DATACONTENT_ID.sysServiceJdId);
+  tableOptionser.value = result;
+};
+//获取位置
+const getWzData = async () => {
+  const result = await htQuery(DATACONTENT_ID.sysServiceWzId);
+  tableOptionbegin.value = result;
+};
+onMounted(() => {
+  sysServiceWarn();
+  getQuery();
+  getSelectDatas(route.query.listqueryTemplateID);
+  getIaCode();
+  getAirpot();
+  getJdData();
+  getWzData();
+});
 </script>
 
 <style lang="scss" scoped>

+ 24 - 5
src/views/systemSettings/warningSet/index.vue

@@ -25,13 +25,16 @@
               </el-col> -->
               <el-col :span="12">
                 <el-form-item label="航司二字码" size="default" prop="IATACode" :rules="formRules.isNotNull">
-                  <el-input v-model="tableForm.IATACode" placeholder="请输入航司二字码" />
+                  <el-select style="width: 100%" v-model="tableForm.IATACode" class="input-shadow" filterable default-first-option clearable placeholder="请选择航司二字码">
+                    <el-option v-for="item in iaCodeArr" :key="item.airlineCompanyID" :label="item.ITATCode" :value="item.ITATCode">
+                    </el-option>
+                  </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="起飞机场" size="default">
                   <el-select style="width: 100%" v-model="tableForm.departmentAirport" class="input-shadow" filterable default-first-option clearable placeholder="请选择起飞机场">
-                    <el-option v-for="item in tableOptionser" :key="item.v ? item.v : item.planDepartureApt" :label="item.k ? item.k : item.planDepartureApt" :value="item.v ? item.v : item.planDepartureApt">
+                    <el-option v-for="item in tableOptionser" :key="item.airportID" :label="item.airportName" :value="item.IATACode">
                     </el-option>
                   </el-select>
                 </el-form-item>
@@ -39,7 +42,7 @@
               <el-col :span="12">
                 <el-form-item label="降落机场" size="default">
                   <el-select style="width: 100%" v-model="tableForm.landingAirport" class="input-shadow" filterable default-first-option clearable placeholder="请选择降落机场">
-                    <el-option v-for="item in tableOptionser" :key="item.v ? item.v : item.planDepartureApt" :label="item.k ? item.k : item.planDepartureApt" :value="item.v ? item.v : item.planDepartureApt">
+                    <el-option v-for="item in tableOptionser" :key="item.airportID" :label="item.airportName" :value="item.IATACode">
                     </el-option>
                   </el-select>
                 </el-form-item>
@@ -81,14 +84,16 @@
 import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
-import { Query, GeneralDataReception } from "@/api/webApi";
+import { Query, GeneralDataReception, htQuery } from "@/api/webApi";
 import { ElMessage } from "element-plus";
+import { onMounted } from "vue";
 const formRules = useElement().formRules;
 const page = ref<number>(0); //分页参数
 const dataContent = ref<object>({});
 const noMore = ref<boolean>(false);
 const rowTitle = ref<string>("");
 const tableCols = ref<any>([]); //表头数据
+const iaCodeArr = ref<any>([]); //航司二字码
 const serviceId = ref<string | any>("");
 const tableObj = ref({}); //增删改数据缓存
 const router = useRouter();
@@ -247,7 +252,7 @@ const getQuery = async (data?) => {
       returnData.columnSet.forEach((item) => {
         if (item.listqueryTemplateID && item.columnName === "landingAirport") {
           listqueryTemplateID.value = item.listqueryTemplateID;
-          getSelectData(item.listqueryTemplateID);
+          // getSelectData(item.listqueryTemplateID);
         }
       });
       tableCols.value.forEach((element) => {
@@ -319,6 +324,20 @@ const searchForms = (data) => {
   tableData.value = [];
   getQuery(data);
 };
+//获取航司二字码
+const getIaCode = async () => {
+  const result = await htQuery(DATACONTENT_ID.sysServiceHsId);
+  iaCodeArr.value = result;
+};
+//获取机场
+const getAirpot = async () => {
+  const result = await htQuery(DATACONTENT_ID.sysServiceHzId);
+  tableOptionser.value = result;
+};
+onMounted(() => {
+  getIaCode();
+  getAirpot();
+});
 // getQuery();
 </script>
 <style lang="scss" scoped>