Browse Source

告警预警

chenrui  2 years ago
parent
commit
7129b508e8

+ 29 - 1
src/views/systemSettings/warningEdit/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="airportInfo">
     <div class="headerBox">
-      <Minheader :is-Preser="true" :is-statuser="true">
+      <Minheader :is-Preser="true" :is-statuser="true" @preserForm="preserForm">
         <template #header>
           <div class="status flex-wrap">
             <div class="manageTitle">报警预警场景</div>
@@ -281,6 +281,7 @@ import DataTable from "@/components/tableTemp/index.vue";
 import Dialog from "@/components/dialog/index.vue";
 import { Query, GeneralDataReception } from "@/api/webApi";
 import { ElMessage } from "element-plus";
+const router = useRouter();
 const route = useRoute();
 const page = ref<number>(0); //分页参数
 const dataContent = ref<object>({});
@@ -290,6 +291,7 @@ const tableCols = ref([]); //表头数据
 const serviceId = ref<String>("");
 const tableObj = ref({}); //增删改数据缓存
 const tableForm = reactive({
+  alarmSceneId: "",
   IATACode: "",
   departmentAirport: "",
   landingAirport: "",
@@ -414,6 +416,9 @@ const sysServiceWarn = async () => {
       dataContent: arr,
     });
     if (code === "0") {
+      tableForm.alarmSceneId = returnData.listValues[0].alarmSceneId
+        ? returnData.listValues[0].alarmSceneId
+        : "";
       tableForm.IATACode = returnData.listValues[0].IATACode
         ? returnData.listValues[0].IATACode
         : "";
@@ -523,6 +528,29 @@ const generalDataReception = async (data) => {
     resetForm();
   }
 };
+//编辑数据
+const preserForm = async () => {
+  tableForm.event = 2;
+  generalDataReceptions(tableForm);
+};
+//表格-增/删/改
+const generalDataReceptions = async (data) => {
+  try {
+    data = {
+      ...data,
+    };
+    const { code, message } = await GeneralDataReception({
+      serviceId: route.query.submitID,
+      dataContent: JSON.stringify(data),
+    });
+    if (code === "0") {
+      ElMessage.success(`操作成功`);
+      router.push({ path: "/systemSettings/warningSet" });
+    } else {
+      ElMessage.error(`操作失败`);
+    }
+  } catch (error) {}
+};
 sysServiceWarn();
 getQuery();
 </script>

+ 3 - 0
src/views/systemSettings/warningSet/index.vue

@@ -162,6 +162,7 @@ const type = ref<String>(""); //判断是否删除
 const msgTitle = ref<String>("新增告警预警维护"); //弹窗标题
 const tableColsCopys = reactive<Object>({}); //弹窗\
 const tableOptionser = ref<Array>([]); //弹窗下拉
+const submitID = ref<String>("");
 const tableForm = reactive({
   IATACode: "",
   departmentAirport: "",
@@ -245,6 +246,7 @@ const btnClick = (row, index, param) => {
       path: "/systemSettings/warningEdit",
       query: {
         alarmSceneId: index.alarmSceneId,
+        submitID: submitID.value,
       },
     });
   } else if (param === 3) {
@@ -294,6 +296,7 @@ const getQuery = async () => {
       if (titleColumn) {
         rowTitle.value = titleColumn.columnName;
       }
+      submitID.value = returnData.submitID;
       tableData.value.push(...returnData.listValues);
       tableCols.value = returnData.columnSet;
       returnData.columnSet.forEach((item) => {