Browse Source

修稿告警预警

chenrui  1 year ago
parent
commit
309e2d3962

+ 6 - 4
public/config.js

@@ -5,7 +5,7 @@ var LOOP_INTERVAL = {
   waybill: 15 * 1000,
   goods: 15 * 1000,
   dashboard: 15 * 1000,
-}
+};
 
 var NEW_DATACONTENT_ID = [
   51000,
@@ -80,7 +80,7 @@ var NEW_DATACONTENT_ID = [
   12, //位置查询
   13, //预警报警场景维护
   14, //预警报警策略维护
-]
+];
 
 var DATACONTENT_ID = {
   /***-----登录------***/
@@ -192,7 +192,9 @@ var DATACONTENT_ID = {
   sysServiceJdId: 11, //预警报警-节点查询
   sysServiceWzId: 12, //预警报警-位置查询
   sysServiceCjId: 13, //预警报警-场景维护
+  sysServiceCjIds: 10013, //预警报警-场景维护
   sysServiceClId: 14, //预警报警-策略维护
+  sysServiceClIds: 10014,
   sysQueryEditId: 24, //系统设置-查询模板-编辑-根据id获取服务
   sysQueryChildTabId: 25, //系统设置-查询模板-列设置-表格-id
   sysQueryChildEditTabId: 26, //系统设置-查询模板-列设置-表格-编辑-id
@@ -392,7 +394,7 @@ var DATACONTENT_ID = {
   modeAgentbased: 51047, //基于代理人
   modeSpecialList: 51049, //特货明细
   modedeliverydetails: 51050, //拉货明细
-}
+};
 
 var SERVICE_ID = {
   /***-----账号管理------***/
@@ -427,4 +429,4 @@ var SERVICE_ID = {
 
   /***-----离港管理------***/
   departureScId: 8011, //发送报警预警日志信息
-}
+};

+ 70 - 70
src/api/webApi.ts

@@ -1,39 +1,39 @@
-import request from '@/utils/axiosReq'
-import { CommonQueryResult } from '~/common'
+import request from "@/utils/axiosReq";
+import { CommonQueryResult } from "~/common";
 
 export function Query<T = any>(params): Promise<CommonQueryResult<T>> {
   if (NEW_DATACONTENT_ID.includes(params.id)) {
-    return NewQuery<T>(params)
+    return NewQuery<T>(params);
   }
   return request({
-    url: '/openApi/query',
-    method: 'post',
+    url: "/openApi/query",
+    method: "post",
     data: params,
-  })
+  });
 }
 
 function NewQuery<T = any>(params): Promise<CommonQueryResult<T>> {
   return request({
-    url: '/newOpenApi/search',
-    method: 'post',
+    url: "/newOpenApi/search",
+    method: "post",
     data: params,
-  })
+  });
 }
 
 export async function myQuery(id, ...dataContent) {
   const params = {
     id,
     dataContent,
-  }
+  };
   try {
-    const result = await Query(params)
+    const result = await Query(params);
     if (Number(result.code) === 0) {
-      return result.returnData.listValues
+      return result.returnData.listValues;
     } else {
-      return Promise.reject(result.message)
+      return Promise.reject(result.message);
     }
   } catch (error) {
-    return Promise.reject(error)
+    return Promise.reject(error);
   }
 }
 
@@ -41,25 +41,25 @@ export async function htQuery(id, ...dataContent) {
   const params = {
     id,
     dataContent,
-  }
+  };
   try {
-    const result = await Query(params)
+    const result = await Query(params);
     if (Number(result.code) === 0) {
-      return result.returnData
+      return result.returnData;
     } else {
-      return []
+      return [];
     }
   } catch (error) {
-    return []
+    return [];
   }
 }
 
 export function GeneralDataReception(params): Promise<CommonQueryResult> {
   return request({
-    url: '/openApi/generalDataReception',
-    method: 'post',
+    url: "/openApi/generalDataReception",
+    method: "post",
     data: params,
-  })
+  });
 }
 
 //增/删/改
@@ -75,112 +75,112 @@ export async function dataToChange(
       dataContent: formatChange(data, event, key),
       event: `${event}`,
       // authId: this.AauthId
-    }
+    };
     const { code, message } =
       event == 1
         ? await newData(params)
         : event == 2
         ? await modifyData(params)
-        : await moveData(params)
-    return { code, message }
+        : await moveData(params);
+    return { code, message };
   } catch (error) {
-    return { code: 1, message: error }
+    return { code: 1, message: error };
   }
 }
 
 //新增
 function newData(params) {
   return request({
-    url: '/openApi/newdata',
-    method: 'post',
+    url: "/externalApi/openApi/sendData",
+    method: "post",
     data: params,
-  })
+  });
 }
 
 //修改
 function modifyData(params) {
   return request({
-    url: '/openApi/modifydata',
-    method: 'post',
+    url: "/externalApi/openApi/sendData",
+    method: "post",
     data: params,
-  })
+  });
 }
 
 //删除movedata
 function moveData(params) {
   return request({
-    url: '/openApi/movedata',
-    method: 'post',
+    url: "/externalApi/openApi/sendData",
+    method: "post",
     data: params,
-  })
+  });
 }
 
 function formatChange(data, event, key) {
-  const datas: any = []
-  const flag = Array.isArray(data)
+  const datas: any = [];
+  const flag = Array.isArray(data);
   if (flag) {
     for (let i = 0; i < data.length; i++) {
-      let obj: any = {}
+      let obj: any = {};
       if (event == 1) {
-        obj.Value = data[i]
+        obj.Value = data[i];
       } else if (event == 2) {
-        obj.Value = data[i]
-        obj.filter = {}
+        obj.Value = data[i];
+        obj.filter = {};
         if (Array.isArray(key)) {
-          const keys = <any>[]
-          const vals = <any>[]
-          obj.filter = []
+          const keys = <any>[];
+          const vals = <any>[];
+          obj.filter = [];
           for (let j = 0; j < key.length; j++) {
-            const dep = key[i]
-            keys.push(Object.keys(dep))
-            vals.push(Object.values(dep))
+            const dep = key[i];
+            keys.push(Object.keys(dep));
+            vals.push(Object.values(dep));
           }
           const nobj = {
-            left: '(',
+            left: "(",
             column: `${keys[i]}`,
-            comparator: '=',
+            comparator: "=",
             value: `${vals[i]}`,
-            right: ')',
-            connector: 'and',
-          }
-          obj.filter.push(nobj)
+            right: ")",
+            connector: "and",
+          };
+          obj.filter.push(nobj);
           if (obj.Value.hasOwnProperty(keys[i])) {
-            delete obj.Value[keys[i]]
+            delete obj.Value[keys[i]];
           }
         } else {
-          obj.filter[key] = data[i][key]
+          obj.filter[key] = data[i][key];
           if (obj.Value[key]) {
-            delete obj.Value[key]
+            delete obj.Value[key];
           }
         }
       } else {
-        obj = data[i]
+        obj = data[i];
       }
-      datas.push(obj)
+      datas.push(obj);
     }
   } else {
-    let obj: any = {}
+    let obj: any = {};
     if (event == 1) {
-      obj.Value = data
+      obj.Value = data;
     } else if (event == 2) {
-      obj.Value = data
+      obj.Value = data;
       obj.filter = [
         {
-          left: '(',
+          left: "(",
           column: `${key}`,
-          comparator: '=',
+          comparator: "=",
           value: `${data[key]}`,
-          right: ')',
-          connector: 'and',
+          right: ")",
+          connector: "and",
         },
-      ]
+      ];
       if (obj.Value[key]) {
-        delete obj.Value[key]
+        delete obj.Value[key];
       }
     } else {
-      obj = data
+      obj = data;
     }
-    datas.push(obj)
+    datas.push(obj);
   }
-  return datas
+  return datas;
 }

+ 271 - 52
src/views/systemSettings/warningEdit/index.vue

@@ -9,50 +9,131 @@
         </template>
       </Minheader>
       <div class="diacont">
-        <el-form :model="tableForm" class="w100 fw" :rules="formRules" ref="warningEditsForm">
+        <el-form
+          :model="tableForm"
+          class="w100 fw"
+          :rules="formRules"
+          ref="warningEditsForm"
+        >
           <!-- <div class="outersurface pd30">
             <el-form-item label="策略名称" size="default">
               <el-input v-model="tableForm.name" placeholder="请输入策略名称" />
             </el-form-item>
           </div> -->
           <div class="outersurface pd30">
-            <el-form-item label="航司二字码" size="default" prop="IATACode" :rules="formRules.isNotNull">
-              <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-form-item
+              label="航司二字码"
+              size="default"
+              prop="IATACode"
+              :rules="formRules.isNotNull"
+            >
+              <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.airportID" :label="item.airportName" :value="item.IATACode">
+              <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.airportID"
+                  :label="item.airportName"
+                  :value="item.IATACode"
+                >
                 </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.landingAirport" class="input-shadow" filterable default-first-option clearable placeholder="请选择降落机场">
-                <el-option v-for="item in tableOption" :key="item.airportID" :label="item.airportName" :value="item.IATACode">
+              <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.airportID"
+                  :label="item.airportName"
+                  :value="item.IATACode"
+                >
                 </el-option>
               </el-select>
             </el-form-item>
           </div>
           <div class="outersurface">
-            <el-form-item label="航班号" size="default" prop="flightNo" :rules="formRules.isNotNull">
-              <el-input v-model="tableForm.flightNo" placeholder="请输入航班号" />
+            <el-form-item
+              label="航班号"
+              size="default"
+              prop="flightNo"
+              :rules="formRules.isNotNull"
+            >
+              <el-input
+                v-model="tableForm.flightNo"
+                placeholder="请输入航班号"
+              />
             </el-form-item>
           </div>
           <div class="outersurface pd30">
-            <el-form-item label="生效时间" size="default" prop="startDate" :rules="formRules.isNotNull">
-              <el-date-picker v-model="tableForm.startDate" :rows="1" type="datetime" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择日期时间">
+            <el-form-item
+              label="生效时间"
+              size="default"
+              prop="startDate"
+              :rules="formRules.isNotNull"
+            >
+              <el-date-picker
+                v-model="tableForm.startDate"
+                :rows="1"
+                type="datetime"
+                format="YYYY-MM-DD HH:mm:ss"
+                value-format="YYYY-MM-DD HH:mm:ss"
+                placeholder="选择日期时间"
+              >
               </el-date-picker>
             </el-form-item>
           </div>
           <div class="outersurface pd30">
-            <el-form-item label="失效时间" size="default" prop="endDate" :rules="formRules.isNotNull">
-              <el-date-picker format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" v-model="tableForm.endDate" :rows="1" type="datetime" placeholder="选择日期时间">
+            <el-form-item
+              label="失效时间"
+              size="default"
+              prop="endDate"
+              :rules="formRules.isNotNull"
+            >
+              <el-date-picker
+                format="YYYY-MM-DD HH:mm:ss"
+                value-format="YYYY-MM-DD HH:mm:ss"
+                v-model="tableForm.endDate"
+                :rows="1"
+                type="datetime"
+                placeholder="选择日期时间"
+              >
               </el-date-picker>
             </el-form-item>
           </div>
@@ -60,7 +141,14 @@
       </div>
     </div>
     <div class="centerBox">
-      <Minheader :is-auth="true" :is-statuser="true" :is-Search="false" powerData="add_alert_policy_button" @addForm="addForm" style="margin-top: 20px">
+      <Minheader
+        :is-auth="true"
+        :is-statuser="true"
+        :is-Search="false"
+        powerData="add_alert_policy_button"
+        @addForm="addForm"
+        style="margin-top: 20px"
+      >
         <template #header>
           <div class="status flex-wrap">
             <div class="manageTitle">预警告警策略</div>
@@ -69,70 +157,186 @@
       </Minheader>
     </div>
     <div class="containers scroll-y">
-      <DataTable :tableHeader="tableCols" :tableData="tableData" :tableBtnGroup="tableBtnGroup" :tableProperty="{ rowKey: 'ID' }" @btnClick="btnClick" />
+      <DataTable
+        :tableHeader="tableCols"
+        :tableData="tableData"
+        :tableBtnGroup="tableBtnGroup"
+        :tableProperty="{ rowKey: 'ID' }"
+        @btnClick="btnClick"
+      />
     </div>
-    <Dialog width="600px" :flag="flag" :type="type" :msgTitle="msgTitle" :delName="delName" @resetForm="resetForm" @delRest="delRest" @submitForm="submitForm" @delRemove="delRemove">
+    <Dialog
+      width="600px"
+      :flag="flag"
+      :type="type"
+      :msgTitle="msgTitle"
+      :delName="delName"
+      @resetForm="resetForm"
+      @delRest="delRest"
+      @submitForm="submitForm"
+      @delRemove="delRemove"
+    >
       <div class="diacont">
         <el-form :model="tableForms" :rules="formRules" ref="warningEditForm">
           <el-row :gutter="24">
             <el-col :span="12">
-              <el-form-item label="策略名称" size="default" prop="StrategyName" :rules="formRules.isNotNull">
-                <el-input v-model="tableForms.StrategyName" placeholder="请输入策略名称" />
+              <el-form-item
+                label="策略名称"
+                size="default"
+                prop="StrategyName"
+                :rules="formRules.isNotNull"
+              >
+                <el-input
+                  v-model="tableForms.StrategyName"
+                  placeholder="请输入策略名称"
+                />
               </el-form-item>
             </el-col>
             <el-col :span="12">
               <el-form-item label="计算依据" size="default">
-                <el-select style="width: 100%" v-model="tableForms.calculationBasis" class="input-shadow" filterable default-first-option clearable placeholder="请选择计算依据">
-                  <el-option 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">
+                <el-select
+                  style="width: 100%"
+                  v-model="tableForms.calculationBasis"
+                  class="input-shadow"
+                  filterable
+                  default-first-option
+                  clearable
+                  placeholder="请选择计算依据"
+                >
+                  <el-option
+                    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"
+                  >
                   </el-option>
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="12">
-              <el-form-item label="预警时长" size="default" prop="warningDuration" :rules="formRules.isNotNull">
-                <el-input v-model="tableForms.warningDuration" placeholder="请输入预警时长" />
+              <el-form-item
+                label="预警时长"
+                size="default"
+                prop="warningDuration"
+                :rules="formRules.isNotNull"
+              >
+                <el-input
+                  v-model="tableForms.warningDuration"
+                  placeholder="请输入预警时长"
+                />
               </el-form-item>
             </el-col>
             <el-col :span="12">
-              <el-form-item label="报警时长" size="default" prop="alarmDuration" :rules="formRules.isNotNull">
-                <el-input v-model="tableForms.alarmDuration" placeholder="请输入报警时长" />
+              <el-form-item
+                label="报警时长"
+                size="default"
+                prop="alarmDuration"
+                :rules="formRules.isNotNull"
+              >
+                <el-input
+                  v-model="tableForms.alarmDuration"
+                  placeholder="请输入报警时长"
+                />
               </el-form-item>
             </el-col>
             <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.nodeID" :label="item.nodeName" :value="item.nodeCode">
+                <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.nodeID"
+                    :label="item.nodeName"
+                    :value="item.nodeCode"
+                  >
                   </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="tableForms.beginPosition" class="input-shadow" filterable default-first-option clearable placeholder="请选择开始位置" @change="changebegin">
-                  <el-option v-for="item in tableOptionbegin" :key="item.positionID" :label="item.positionDescribe" :value="item.locationCode">
+                <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.positionID"
+                    :label="item.positionDescribe"
+                    :value="item.locationCode"
+                  >
                   </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="tableForms.endNode" class="input-shadow" filterable default-first-option clearable placeholder="请选择结束节点" @change="changeSelected">
-                  <el-option v-for="item in tableOptionser" :key="item.nodeID" :label="item.nodeName" :value="item.nodeCode">
+                <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 tableOptionser"
+                    :key="item.nodeID"
+                    :label="item.nodeName"
+                    :value="item.nodeCode"
+                  >
                   </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="tableForms.endPosition" class="input-shadow" filterable default-first-option clearable placeholder="请选择结束位置" @change="changeEndPos">
-                  <el-option v-for="item in tableOptionbegin" :key="item.positionID" :label="item.positionDescribe" :value="item.locationCode">
+                <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 tableOptionbegin"
+                    :key="item.positionID"
+                    :label="item.positionDescribe"
+                    :value="item.locationCode"
+                  >
                   </el-option>
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="24">
-              <el-form-item label="数量报警百分比" label-width="120" size="default">
-                <el-input v-model="tableForms.percentage" placeholder="请输入数量报警百分比" />
+              <el-form-item
+                label="数量报警百分比"
+                label-width="120"
+                size="default"
+              >
+                <el-input
+                  v-model="tableForms.percentage"
+                  placeholder="请输入数量报警百分比"
+                />
               </el-form-item>
             </el-col>
           </el-row>
@@ -180,7 +384,7 @@ const tableForm = reactive({
   event: 2,
 }); //报警预警场景
 const tableForms = reactive<any>({
-  alarmStrategyID: "",
+  alarmStrategyID: null,
   StrategyName: "",
   calculationBasis: "",
   warningDuration: "",
@@ -242,7 +446,7 @@ const addForm = () => {
 //取消
 const resetForm = () => {
   flag.value = false;
-  tableForms.alarmStrategyID = "";
+  tableForms.alarmStrategyID = null;
   tableForms.StrategyName = "";
   tableForms.calculationBasis = "";
   tableForms.warningDuration = "";
@@ -255,9 +459,9 @@ const resetForm = () => {
   delName.value = "";
 };
 const delRemove = async () => {
-  tableForms.event = 3;
+  // tableForms.event = 3;
   const { code, message } = await dataToChange(
-    DATACONTENT_ID.sysServiceClId,
+    DATACONTENT_ID.sysServiceClIds,
     tableForms,
     3
   );
@@ -299,18 +503,29 @@ const btnClick = (row, index, param) => {
     msgTitle.value = "删除报警预警策略";
     flag.value = true;
     type.value = "del";
-    tableForms.event = 3;
+    // tableForms.event = 3;
     delName.value = index.StrategyName;
     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;
-    tableForms.percentage = index.percentage;
+    delete tableForms.StrategyName;
+    delete tableForms.calculationBasis;
+    delete tableForms.warningDuration;
+    delete tableForms.alarmDuration;
+    delete tableForms.beginNode;
+    delete tableForms.endNode;
+    delete tableForms.endPosition;
+    delete tableForms.percentage;
+    delete tableForms.beginPosition;
+    delete tableForms.alarmSceneId;
+    delete tableForms.event;
+    // 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;
+    // tableForms.percentage = index.percentage;
   } else if (param === 4) {
   }
 };
@@ -593,9 +808,13 @@ const submitForm = () => {
       const event = type.value == "add" ? 1 : 2;
       const { code, message } =
         event == 1
-          ? await dataToChange(DATACONTENT_ID.sysServiceClId, tableForms, event)
+          ? await dataToChange(
+              DATACONTENT_ID.sysServiceClIds,
+              tableForms,
+              event
+            )
           : await dataToChange(
-              DATACONTENT_ID.sysServiceClId,
+              DATACONTENT_ID.sysServiceClIds,
               tableForms,
               event,
               "alarmSceneId"
@@ -667,7 +886,7 @@ const preserForm = async () => {
   warningEditsForm.value.validate(async (valid: any) => {
     if (valid) {
       const { code, message } = await dataToChange(
-        DATACONTENT_ID.sysServiceCjId,
+        DATACONTENT_ID.sysServiceCjIds,
         tableForm,
         2,
         "alarmSceneId"

+ 255 - 38
src/views/systemSettings/warningSet/index.vue

@@ -1,7 +1,13 @@
 <template>
   <div class="airportInfo scroll-y">
     <div class="wrap">
-      <Minheader :is-auth="true" :is-statuser="true" powerData="alert_alarm_settings_add_button" @addForm="addForm" @searchForms="searchForms">
+      <Minheader
+        :is-auth="true"
+        :is-statuser="true"
+        powerData="alert_alarm_settings_add_button"
+        @addForm="addForm"
+        @searchForms="searchForms"
+      >
         <template #header>
           <div class="status flex-wrap">
             <div class="manageTitle">预警告警维护</div>
@@ -9,9 +15,25 @@
         </template>
       </Minheader>
       <div class="app-containers">
-        <DataTable :tableHeader="tableCols" :tableData="tableData" :tableBtnGroup="tableBtnGroup" :tableProperty="{ rowKey: 'ID' }" @btnClick="btnClick" />
+        <DataTable
+          :tableHeader="tableCols"
+          :tableData="tableData"
+          :tableBtnGroup="tableBtnGroup"
+          :tableProperty="{ rowKey: 'ID' }"
+          @btnClick="btnClick"
+        />
       </div>
-      <Dialog width="600px" :flag="flag" :type="type" :msgTitle="msgTitle" :delName="delName" @resetForm="resetForm" @delRest="delRest" @submitForm="submitForm" @delRemove="delRemove">
+      <Dialog
+        width="600px"
+        :flag="flag"
+        :type="type"
+        :msgTitle="msgTitle"
+        :delName="delName"
+        @resetForm="resetForm"
+        @delRest="delRest"
+        @submitForm="submitForm"
+        @delRemove="delRemove"
+      >
         <div class="diacont">
           <el-form :model="tableForm" :rules="formRules" ref="warningSetForm">
             <el-row :gutter="24">
@@ -24,43 +46,119 @@
                 </el-form-item>
               </el-col> -->
               <el-col :span="12">
-                <el-form-item label="航司二字码" size="default" prop="IATACode" :rules="formRules.isNotNull">
-                  <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-form-item
+                  label="航司二字码"
+                  size="default"
+                  prop="IATACode"
+                  :rules="formRules.isNotNull"
+                >
+                  <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.airportID" :label="item.airportName" :value="item.IATACode">
+                  <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.airportID"
+                      :label="item.airportName"
+                      :value="item.IATACode"
+                    >
                     </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.landingAirport" class="input-shadow" filterable default-first-option clearable placeholder="请选择降落机场">
-                    <el-option v-for="item in tableOptionser" :key="item.airportID" :label="item.airportName" :value="item.IATACode">
+                  <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.airportID"
+                      :label="item.airportName"
+                      :value="item.IATACode"
+                    >
                     </el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col>
-                <el-form-item label="航班号" size="default" prop="flightNo" :rules="formRules.isNotNull">
-                  <el-input v-model="tableForm.flightNo" placeholder="请输入航班号" />
+                <el-form-item
+                  label="航班号"
+                  size="default"
+                  prop="flightNo"
+                  :rules="formRules.isNotNull"
+                >
+                  <el-input
+                    v-model="tableForm.flightNo"
+                    placeholder="请输入航班号"
+                  />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="生效时间" size="default" prop="startDate" :rules="formRules.isNotNull">
-                  <el-date-picker v-model="tableForm.startDate" :rows="1" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="选择日期时间">
+                <el-form-item
+                  label="生效时间"
+                  size="default"
+                  prop="startDate"
+                  :rules="formRules.isNotNull"
+                >
+                  <el-date-picker
+                    v-model="tableForm.startDate"
+                    :rows="1"
+                    type="date"
+                    format="YYYY-MM-DD"
+                    value-format="YYYY-MM-DD"
+                    placeholder="选择日期时间"
+                  >
                   </el-date-picker>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="失效时间" size="default" prop="endDate" :rules="formRules.isNotNull">
-                  <el-date-picker format="YYYY-MM-DD" value-format="YYYY-MM-DD" v-model="tableForm.endDate" :rows="1" type="date" placeholder="选择日期时间">
+                <el-form-item
+                  label="失效时间"
+                  size="default"
+                  prop="endDate"
+                  :rules="formRules.isNotNull"
+                >
+                  <el-date-picker
+                    format="YYYY-MM-DD"
+                    value-format="YYYY-MM-DD"
+                    v-model="tableForm.endDate"
+                    :rows="1"
+                    type="date"
+                    placeholder="选择日期时间"
+                  >
                   </el-date-picker>
                 </el-form-item>
               </el-col>
@@ -230,36 +328,155 @@ const delRest = () => {
 //获取表格数据
 const getQuery = async (data?) => {
   try {
+    const columnSet = [
+      {
+        queryTemplateColumnSetID: 290,
+        queryTemplateID: 13,
+        columnName: "alarmStrategyID",
+        columnLabel: "策略编号",
+        columnDescribe: "策略编号",
+        needSort: 0,
+        needFilters: 1,
+        needShow: 0,
+        needGroup: 0,
+        dataType: "int",
+        listqueryTemplateID: null,
+        needCount: null,
+        orderNumber: null,
+        needSearch: null,
+      },
+      {
+        queryTemplateColumnSetID: 291,
+        queryTemplateID: 13,
+        columnName: "IATACode",
+        columnLabel: "航司二字码",
+        columnDescribe: "航司二字码",
+        needSort: 0,
+        needFilters: 1,
+        needShow: 1,
+        needGroup: 0,
+        dataType: "varchar",
+        listqueryTemplateID: null,
+        needCount: null,
+        orderNumber: null,
+        needSearch: null,
+      },
+      {
+        queryTemplateColumnSetID: 292,
+        queryTemplateID: 13,
+        columnName: "flightNo",
+        columnLabel: "航班号",
+        columnDescribe: "航班号",
+        needSort: 0,
+        needFilters: 1,
+        needShow: 1,
+        needGroup: 0,
+        dataType: "int",
+        listqueryTemplateID: 1803423,
+        needCount: null,
+        orderNumber: null,
+        needSearch: null,
+      },
+      {
+        queryTemplateColumnSetID: 293,
+        queryTemplateID: 13,
+        columnName: "departmentAirport",
+        columnLabel: "起飞机场",
+        columnDescribe: "起飞机场",
+        needSort: 0,
+        needFilters: 1,
+        needShow: 1,
+        needGroup: 0,
+        dataType: "number",
+        listqueryTemplateID: null,
+        needCount: null,
+        orderNumber: null,
+        needSearch: null,
+      },
+      {
+        queryTemplateColumnSetID: 294,
+        queryTemplateID: 13,
+        columnName: "landingAirport",
+        columnLabel: "降落机场",
+        columnDescribe: "降落机场",
+        needSort: 0,
+        needFilters: 1,
+        needShow: 1,
+        needGroup: 0,
+        dataType: "number",
+        listqueryTemplateID: null,
+        needCount: null,
+        orderNumber: null,
+        needSearch: null,
+      },
+      {
+        queryTemplateColumnSetID: 295,
+        queryTemplateID: 13,
+        columnName: "startDate",
+        columnLabel: "生效时间",
+        columnDescribe: "生效时间",
+        needSort: 0,
+        needFilters: 1,
+        needShow: 1,
+        needGroup: 0,
+        dataType: "varchar",
+        listqueryTemplateID: 1803424,
+        needCount: null,
+        orderNumber: null,
+        needSearch: null,
+      },
+      {
+        queryTemplateColumnSetID: 296,
+        queryTemplateID: 13,
+        columnName: "endDate",
+        columnLabel: "失效时间",
+        columnDescribe: "失效时间",
+        needSort: 0,
+        needFilters: 1,
+        needShow: 1,
+        needGroup: 0,
+        dataType: "varchar",
+        listqueryTemplateID: 1803425,
+        needCount: null,
+        orderNumber: null,
+        needSearch: null,
+      },
+    ];
     const { code, returnData } = await Query({
-      id: DATACONTENT_ID.sysServiceWarningId,
+      id: DATACONTENT_ID.sysServiceCjId,
       needPage: ++page.value,
       dataContent: data ? [data] : [],
     });
     if (code === "0") {
-      if (returnData.listValues.length === 0) {
+      // console.log(returnData);
+      if (returnData.length === 0) {
         page.value--;
         noMore.value = true;
       }
-      const titleColumn = returnData.columnSet.find(
-        (item) => item.needShow === 1
-      );
-      if (titleColumn) {
-        rowTitle.value = titleColumn.columnName;
-      }
-      submitID.value = returnData.submitID;
-      tableData.value.push(...returnData.listValues);
-      tableCols.value = returnData.columnSet;
-      returnData.columnSet.forEach((item) => {
-        if (item.listqueryTemplateID && item.columnName === "landingAirport") {
-          listqueryTemplateID.value = item.listqueryTemplateID;
-          // getSelectData(item.listqueryTemplateID);
-        }
-      });
-      tableCols.value.forEach((element) => {
-        element.label = element.columnLabel;
-        element.key = element.columnName;
-      });
-      serviceId.value = returnData.submitID;
+      tableData.value.push(...returnData);
+      tableCols.value = columnSet;
+      console.log(tableData);
+      // const titleColumn = returnData.columnSet.find(
+      //   (item) => item.needShow === 1
+      // );
+      // if (titleColumn) {
+      //   rowTitle.value = titleColumn.columnName;
+      // }
+      // submitID.value = returnData.submitID;
+      // tableData.value.push(...returnData);
+      // console.log(tableData);
+      // tableCols.value = returnData.columnSet;
+      // returnData.columnSet.forEach((item) => {
+      //   if (item.listqueryTemplateID && item.columnName === "landingAirport") {
+      //     listqueryTemplateID.value = item.listqueryTemplateID;
+      //     // getSelectData(item.listqueryTemplateID);
+      //   }
+      // });
+      // tableCols.value.forEach((element) => {
+      //   element.label = element.columnLabel;
+      //   element.key = element.columnName;
+      // });
+      // serviceId.value = returnData.submitID;
     } else {
       page.value--;
     }