Эх сурвалжийг харах

报警控制器需求变更

jiawuxian 2 жил өмнө
parent
commit
06a30eb9e3

+ 3 - 3
src/views/resumption/protection/dialog.history.vue

@@ -36,16 +36,16 @@
           </div>
           <el-table :data="tableData" border style="width: 100%">
             <el-table-column type="index" label="序号"></el-table-column>
-            <el-table-column prop="statusText" label="布撤防状态"
+            <el-table-column prop="statusText" label="报警控制器状态"
               ><template slot-scope="r">
                 {{ getLabel(statusDict, r.row.status) }}
               </template></el-table-column
             >
-            <el-table-column prop="updateTime" label="上报时间">
+            <el-table-column prop="updateTime" label="布撤防登记时间">
             </el-table-column>
             <el-table-column
               prop="statusUpdatorName"
-              label="上报人"
+              label="登记人"
             ></el-table-column>
           </el-table>
           <div style="margin-top: 20px; text-align: right">

+ 63 - 20
src/views/resumption/protection/index.vue

@@ -21,11 +21,11 @@
           v-show="showSearch"
           label-width="120px"
         >
-          <el-form-item prop="key" label="关键字" class="search_key">
+          <el-form-item prop="key" label="报警控制器名称">
             <el-input
               v-model="queryParams.key"
               :maxlength="50"
-              placeholder="请输入搜索关键字"
+              placeholder="请输入报警控制器名称"
               clearable
             />
           </el-form-item>
@@ -45,7 +45,7 @@
             </el-select>
           </el-form-item>
 
-          <el-form-item prop="dateRange" label="布撤防时间范围">
+          <el-form-item prop="dateRange" label="布撤防登记时间">
             <el-date-picker
               v-model="queryParams.dateRange"
               type="datetimerange"
@@ -56,7 +56,11 @@
             >
             </el-date-picker>
           </el-form-item>
-          <el-form-item>
+        </el-form>
+
+        <!--    按纽    -->
+        <el-row :gutter="10" class="mb8">
+          <el-col :span="1.5">
             <el-button
               type="primary"
               icon="el-icon-search"
@@ -68,12 +72,6 @@
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
               >重置</el-button
             >
-          </el-form-item>
-        </el-form>
-
-        <!--    按纽    -->
-        <el-row :gutter="10" class="mb8">
-          <el-col :span="1.5">
             <el-button
               type="primary"
               icon="el-icon-plus"
@@ -82,6 +80,15 @@
               v-hasPermi="['device:protection:add']"
               >新增</el-button
             >
+            <el-button
+              type="primary"
+              plain
+              icon="el-icon-download"
+              size="mini"
+              @click="handleExport()"
+              v-hasPermi="['device:protection']"
+              >导出</el-button
+            >
           </el-col>
           <!-- <el-col :span="1.5">
             <el-button
@@ -139,19 +146,25 @@
           </el-table-column>
           <el-table-column
             prop="status"
-            label="布撤防状态"
+            label="报警控制器状态"
             v-if="columns[3].visible"
           >
             <template slot-scope="r"
-              >{{ getLabel(dict.type.protection_status, r.row.status,"未知") }}
+              >{{ getLabel(dict.type.protection_status, r.row.status, "未知") }}
             </template>
           </el-table-column>
           <el-table-column
-            prop="statusUpdateTime"
-            label="最后登记时间"
+            prop="statusUpdatorName"
+            label="登记人"
             v-if="columns[4].visible"
           >
           </el-table-column>
+          <el-table-column
+            prop="statusUpdateTime"
+            label="最近登记时间"
+            v-if="columns[5].visible"
+          >
+          </el-table-column>
           <el-table-column label="操作">
             <template slot-scope="r">
               <!-- <el-button
@@ -218,7 +231,10 @@
       :orgTypeOptions="dict.type.sys_org_type"
       :ruleTypeOptions="dict.type.rule_type"
     ></dialog-edit>
-    <dialog-history ref="historyDialog" :statusDict="dict.type.protection_status"></dialog-history>
+    <dialog-history
+      ref="historyDialog"
+      :statusDict="dict.type.protection_status"
+    ></dialog-history>
   </div>
 </template>
 
@@ -228,6 +244,8 @@ import DialogEdit from "./dialog.edit";
 import DialogHistory from "./dialog.history";
 import * as api from "@/api/resumption/protection";
 import { getLabel } from "./../../commonOption";
+import { mapGetters } from "vuex";
+import dayjs from "dayjs"
 
 export default {
   name: "protection",
@@ -250,6 +268,7 @@ export default {
       // 显示搜索条件
       showSearch: true,
       total: 0,
+      selectedOrgName: null,
       queryParams: {
         orgId: null,
         checkSub: true,
@@ -267,13 +286,15 @@ export default {
         { key: 1, label: `所属机构`, visible: true },
         { key: 2, label: `报警控制器名称`, visible: true },
         { key: 3, label: `报警控制器状态`, visible: true },
-        { key: 4, label: `布撤防时间`, visible: true },
+        { key: 4, label: `登记人`, visible: true },
+        { key: 5, label: `最近登记时间`, visible: true },
       ],
     };
   },
   props: {},
   watch: {},
   computed: {
+    ...mapGetters(["orgName"]),
   },
   methods: {
     getLabel,
@@ -292,11 +313,32 @@ export default {
     },
     getDefaultKey(key) {
       this.queryParams.orgId = key;
+     this. selectedOrgName=this.orgName,
       this.getList();
     },
     handleAdd(id, other = {}) {
       this.$refs.editDialog.show(id, other);
     },
+    handleExport(){
+      if (this.total==0) {
+        this.$message.error({
+          message: `无可用数据导出!`,
+          type: "error",
+          duration: 2000,
+        });
+        return;
+      }
+
+      this.download(
+        "/core/resumption/protection/export",
+        {
+          ...this.queryParams,
+        },
+        `【${this.selectedOrgName}】-布撤防情况跟踪-${dayjs(new Date()).format(
+          "YYYYMMDD"
+        )}.xlsx`
+      );
+    },
     onEdit(id, other = {}) {
       this.$refs.editDialog.show(id, other);
     },
@@ -304,8 +346,8 @@ export default {
       this.$refs.historyDialog.show(row);
     },
     async onDel(id) {
-      let b=(await api.del(id)).data;
-      if(b){
+      let b = (await api.del(id)).data;
+      if (b) {
         this.$message.info("删除成功");
       }
 
@@ -338,6 +380,7 @@ export default {
     // 节点单击事件
     clickTreeNode(data) {
       this.queryParams.orgId = data.id;
+      this. selectedOrgName=data.name,
       this.getList();
     },
   },
@@ -346,9 +389,9 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.search_key{
+/* .search_key{
   ::v-deep .el-form-item__label{
     width:60px !important;
   }
-}
+} */
 </style>

+ 1 - 1
src/views/resumption/taskManager/index.vue

@@ -305,7 +305,7 @@ export default {
     async exportExcel() {
       if (!this.isTableHaveData) {
         this.$message.error({
-          message: `无可用数据导出!`,
+          message: `无可用数据导出!`,
           type: "error",
           duration: 2000,
         });