Browse Source

预警告警

chenrui  2 years ago
parent
commit
c53d0b1e60

+ 58 - 7
src/views/systemSettings/warningEdit/index.vue

@@ -131,7 +131,7 @@
       <Minheader
         :is-auth="true"
         :is-statuser="true"
-        :is-Search="true"
+        :is-Search="false"
         powerData="add_alert_policy_button"
         @addForm="addForm"
         style="margin-top: 20px"
@@ -157,6 +157,7 @@
       :flag="flag"
       :type="type"
       :msgTitle="msgTitle"
+      :delName="delName"
       @resetForm="resetForm"
       @delRest="delRest"
       @submitForm="submitForm"
@@ -190,7 +191,7 @@
                   placeholder="请选择计算依据"
                 >
                   <el-option
-                    v-for="item in tableOptionser"
+                    v-for="item in calculationBasis"
                     :key="item.v ? item.v : item.planDepartureApt"
                     :label="item.k ? item.k : item.planDepartureApt"
                     :value="item.v ? item.v : item.planDepartureApt"
@@ -338,6 +339,7 @@ const serviceId = ref<String>("");
 const beginPositionId = ref<String>("");
 const endPositionId = ref<String>("");
 const tableObj = ref({}); //增删改数据缓存
+const delName = ref<String>("");
 const tableForm = reactive({
   alarmSceneId: "",
   IATACode: "",
@@ -366,6 +368,7 @@ const tableOptionser = ref<Array>([]); //下拉
 const tableOptionbegin = ref<Array>([]); //下拉
 const tableOptionend = ref<Array>([]); //下拉
 const tableOptionendPos = ref<Array>([]); //下拉
+const calculationBasis = ref<Array>([]); //下拉
 const flag = ref<Boolean>(false); //弹窗开关
 const type = ref<String>(""); //判断是否删除
 const msgTitle = ref<String>("新增报警预警策略"); //弹窗标题
@@ -418,9 +421,11 @@ const resetForm = () => {
   tableForms.beginPosition = "";
   tableForms.endNode = "";
   tableForms.endPosition = "";
+  delName.value = "";
 };
 const delRemove = () => {
   tableForms.event = 3;
+
   generalDataReception(tableForms);
 };
 //删除
@@ -434,20 +439,46 @@ const btnClick = (row, index, param) => {
     flag.value = true;
     type.value = "";
     tableForms.event = 2;
+    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.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;
+    // 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;
     type.value = "del";
     tableForms.event = 3;
+    delName.value = index.StrategyName;
     tableForms.alarmStrategyID = index.alarmStrategyID;
     tableForms.StrategyName = index.StrategyName;
     tableForms.calculationBasis = index.calculationBasis;
@@ -460,6 +491,7 @@ const btnClick = (row, index, param) => {
   } else if (param === 4) {
   }
 };
+
 //获取预警报警场景(按照ID)
 const sysServiceWarn = async () => {
   try {
@@ -501,6 +533,18 @@ const sysServiceWarn = async () => {
     // this.loading = false;
   }
 };
+//飞机场-下拉数据
+const getSelectDatas = async (id, name) => {
+  const { code, returnData } = await Query({
+    id,
+    dataContent: name ? [name] : name === null ? [null] : [],
+  });
+  if (code == 0) {
+    tableOption.value = returnData.listValues;
+  } else {
+    tableOption.value = [];
+  }
+};
 //获取弹框-下拉数据
 const getSelectData = async (id, name, dataNme) => {
   const { code, returnData } = await Query({
@@ -509,6 +553,9 @@ const getSelectData = async (id, name, dataNme) => {
   });
   if (code == 0) {
     // return returnData.listValues;
+    if (dataNme === "calculationBasis") {
+      calculationBasis.value = returnData.listValues;
+    }
     if (dataNme === "beginNode") {
       tableOptionser.value = returnData.listValues;
     } else if (dataNme === "beginPosition") {
@@ -543,6 +590,9 @@ const getQuery = async () => {
       tableData.value.push(...returnData.listValues);
       tableCols.value = returnData.columnSet;
       returnData.columnSet.forEach((item) => {
+        if (item.columnName === "calculationBasis") {
+          getSelectData(item.listqueryTemplateID, "", "calculationBasis");
+        }
         if (item.listqueryTemplateID && item.columnName === "beginNode") {
           getSelectData(item.listqueryTemplateID, "", "beginNode");
         } else if (
@@ -674,6 +724,7 @@ const generalDataReceptions = async (data) => {
 };
 sysServiceWarn();
 getQuery();
+getSelectDatas(route.query.listqueryTemplateID);
 </script>
 
 <style lang="scss" scoped>

+ 9 - 2
src/views/systemSettings/warningSet/index.vue

@@ -10,7 +10,7 @@
       >
         <template #header>
           <div class="status flex-wrap">
-            <div class="manageTitle">告警预警维护</div>
+            <div class="manageTitle">告警预警策略</div>
           </div>
         </template></Minheader
       >
@@ -28,6 +28,7 @@
         :flag="flag"
         :type="type"
         :msgTitle="msgTitle"
+        :delName="delName"
         @resetForm="resetForm"
         @delRest="delRest"
         @submitForm="submitForm"
@@ -185,6 +186,8 @@ const msgTitle = ref<String>("新增告警预警维护"); //弹窗标题
 const tableColsCopys = reactive<Object>({}); //弹窗\
 const tableOptionser = ref<Array>([]); //弹窗下拉
 const submitID = ref<String>("");
+const delName = ref<String>("");
+const listqueryTemplateID = ref<String>("");
 const tableForm = reactive({
   IATACode: "",
   departmentAirport: "",
@@ -237,7 +240,7 @@ const getSelectData = async (id, name) => {
 };
 //新增
 const addForm = () => {
-  msgTitle.value = "新增告警预警维护";
+  msgTitle.value = "新增告警预警策略";
   flag.value = true;
   type.value = "";
   tableForm.event = 1;
@@ -252,6 +255,7 @@ const resetForm = () => {
   tableForm.startDate = "";
   tableForm.endDate = "";
   tableForm.event = "";
+  delName.value = "";
 };
 //编辑
 // const editDialog = (data) => {
@@ -273,6 +277,7 @@ const btnClick = (row, index, param) => {
       query: {
         alarmSceneId: index.alarmSceneId,
         submitID: submitID.value,
+        listqueryTemplateID: listqueryTemplateID.value,
       },
     });
   } else if (param === 3) {
@@ -280,6 +285,7 @@ const btnClick = (row, index, param) => {
     flag.value = true;
     type.value = "del";
     tableForm.event = 3;
+    delName.value = index.flightNo;
     tableForm.alarmSceneId = index.alarmSceneId;
     tableForm.IATACode = index.IATACode;
     tableForm.departmentAirport = index.departmentAirport;
@@ -328,6 +334,7 @@ const getQuery = async (data) => {
       tableCols.value = returnData.columnSet;
       returnData.columnSet.forEach((item) => {
         if (item.listqueryTemplateID && item.columnName === "landingAirport") {
+          listqueryTemplateID.value = item.listqueryTemplateID;
           getSelectData(item.listqueryTemplateID);
         }
       });