coys 1 anno fa
parent
commit
22a679f81b

+ 162 - 0
src/views/defenseMonitoring/dialog.edit.vue

@@ -0,0 +1,162 @@
+<template>
+  <div class="rule-type">
+    <DialogCom
+      :title="id ? '编辑报警控制器' : '新增报警控制器'"
+      :visible.sync="isShow"
+      @close="onHide"
+      width="500px"
+    >
+      <div class="page-body">
+        <el-form
+          :model="formData"
+          :rules="formDataRules"
+          size="small"
+          ref="form"
+          label-position="right"
+          label-width="150px"
+          label-prefix=":"
+        >
+          <el-form-item label="所属机构" prop="orgId">
+            <orgDropDown
+              v-model="formData.orgId"
+              placeholder="选择所属机构"
+              @select="onOrgSelect"
+            />
+          </el-form-item>
+          <el-form-item label="报警主机" prop="alarmHostId">
+            <el-select
+              label="报警主机"
+              v-model="formData.alarmHostId"
+              placeholder="请选择报警主机"
+              clearable
+              style="width: 310px"
+            >
+              <el-option
+                v-for="host in alarmHostOptions"
+                :key="host.id"
+                :label="host.name"
+                :value="host.id"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item prop="name" label="报警控制器名称:">
+            <el-input
+              v-model="formData.name"
+              :maxlength="50"
+              name="name"
+              placeholder="请输入报警控制器名称"
+              clearable
+            />
+          </el-form-item>
+
+          <el-form-item prop="type" label="24小时报警控制器:">
+            <el-switch
+              v-model="formData.allHour"
+              :active-value="1"
+              :inactive-value="0"
+            >
+            </el-switch>
+          </el-form-item>
+        </el-form>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="onSubmit">确定</el-button>
+        <el-button @click="isShow = false">取消</el-button>
+      </div>
+    </DialogCom>
+  </div>
+</template>
+
+<script>
+import { mapState, mapMutations, mapGetters } from "vuex";
+import * as api from "@/api/resumption/protection";
+import { listIdName } from "@/api/system/device";
+import orgDropDown from "@/components/orgTree/orgDropDown.vue";
+export default {
+  data() {
+    return {
+      id: null,
+      isShow: false,
+      formData: this.reset(),
+      alarmHostOptions: [],
+      // 机构树选项
+      formDataRules: {
+        orgId: [{ required: true, message: "请选择所属机构" }],
+        name: [{ required: true, message: "请输入报警控制器名称" }],
+        alarmHostId: [{ required: true, message: "请选择报警主机" }],
+      },
+    };
+  },
+  props: {},
+  watch: {
+    // "formData.orgId":{
+    //   handler(v){
+    //     console.info("formData.orgId",v)
+    //   }
+    // }
+  },
+  computed: {
+    ...mapGetters(["orgId"]),
+  },
+  methods: {
+    ...mapMutations([]),
+    reset() {
+      return {
+        id: null,
+        orgId: null,
+        orgPath: null,
+        orgName: null,
+        name: null,
+        allHour: 0,
+        alarmHostId: null,
+      };
+    },
+    async refresh(id, other) {
+      this.formData = id ? (await api.get(id)).data : this.reset(other);
+    },
+    async show(id, other = {}) {
+      this.id = id;
+      await this.refresh(id, other);
+      this.isShow = true;
+    },
+
+    // 事件
+    onHide() {
+      this.$refs.form.resetFields();
+      this.formData = this.reset();
+    },
+    onSubmit() {
+      this.$refs.form.validate(async (isValidate) => {
+        if (!isValidate) return;
+        await api.update(this.formData);
+        this.$emit("success");
+        this.isShow = false;
+      });
+    },
+    onOrgSelect(node) {
+      // console.info(node)
+      this.formData.orgPath = node.path;
+      this.formData.orgName = node.shortName;
+      listIdName({ orgId: node.id, deviceType: 1, assetType: 2 }).then((d) => {
+        this.alarmHostOptions = d.data;
+        if (!d.data.find((i) => i.id == this.formData.alarmHostId)) {
+          this.formData.alarmHostId = null;
+        }
+      });
+    },
+  },
+  created() {},
+  mounted() {},
+  components: { orgDropDown },
+};
+</script>
+
+<style lang="scss" scoped>
+.brand_info {
+  .el-form {
+    width: 600px;
+    padding-top: 40px;
+  }
+}
+</style>

+ 216 - 0
src/views/defenseMonitoring/dialog.history.vue

@@ -0,0 +1,216 @@
+<template>
+  <div class="device-info">
+    <DialogCom
+      title="布撤防历史"
+      :visible.sync="isShow"
+      width="1200px"
+      @close="close"
+    >
+      <div class="page-body">
+        <el-descriptions
+          class="margin-top"
+          :column="2"
+          size="medium"
+          border
+          :contentStyle="content_style"
+          :label-style="labelStyle"
+        >
+          <el-descriptions-item labelClassName="gx_info_label" label="所属机构:">
+            {{ protection.orgName }}
+          </el-descriptions-item>
+          <el-descriptions-item labelClassName="gx_info_label" label="报警控制器名称:">
+            {{ protection.name }}
+          </el-descriptions-item>
+          <!-- <el-descriptions-item labelClassName="gx_info_label" label="24小时报警控制器:">
+            {{ protection.allHour ? "是" : "否" }}
+          </el-descriptions-item> -->
+         
+        </el-descriptions>
+         <div>
+          <!-- <div style="margin-bottom: 20px">
+            <span> 所属机构:</span>
+            <span>{{ protection.orgName }}</span>
+          </div>
+          <div style="margin-bottom: 20px">
+            <span>报警控制器名称:</span>
+            <span>{{ protection.name }}</span>
+          </div>
+          <div style="margin-bottom: 20px">
+            <span> 24小时报警控制器:</span>
+            <span>{{ protection.allHour ? "是" : "否" }}</span>
+          </div> -->
+          <div style="margin-bottom: 20px">
+            <span>上报时间范围:</span>
+            <DataRangePicker
+              v-model="queryParams.updateTime"
+              key="daterange"
+              type="daterange"
+              clearable
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+            >
+            </DataRangePicker>
+          </div>
+          <div class="extend_mod">
+            <el-table :data="tableData" border style="width: 100%">
+            <el-table-column
+              type="index"
+              label="序号"
+              width="60"
+              align="center"
+            ></el-table-column>
+            <el-table-column
+              prop="statusText"
+              label="报警控制器状态"
+              align="center"
+              ><template slot-scope="r">
+                {{ getLabel(statusDict, r.row.status) }}
+              </template></el-table-column
+            >
+            <el-table-column
+              prop="updateTime"
+              label="布撤防登记时间"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column
+              align="center"
+              prop="statusUpdatorName"
+              label="登记人/数据来源"
+            ></el-table-column>
+            <el-table-column
+              prop="updateTime"
+              label="登记时间"
+              align="center"
+            >
+            </el-table-column>
+          </el-table>
+          </div>
+        
+          <div style="margin-top: 20px; text-align: right">
+            <pagination
+              v-show="total > 0"
+              :total="total"
+              :page.sync="queryParams.pageNum"
+              :limit.sync="queryParams.pageSize"
+              @pagination="getList"
+            />
+          </div>
+        </div> 
+      </div>
+
+      <div slot="footer" class="dialog-footer" style="margin-top: 20px">
+        <el-button @click="onHide">关闭</el-button>
+        <!--<el-button type="primary" @click="onSubmit">确定</el-button> -->
+      </div>
+    </DialogCom>
+  </div>
+</template>
+
+<script>
+import * as api from "@/api/resumption/protection";
+import { getLabel } from "@/views/commonOption.js";
+import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
+export default {
+  data() {
+    const params = this.$route.params;
+    return {
+      id: params ? params.id : null,
+      isShow: false,
+      protection: {},
+      tableData: [],
+      queryParams: this.resetSearch(),
+      total: 1,
+      labelStyle: {
+        color: "#000",
+        "text-align": "center",
+        height: "40px",
+        "min-width": "150px",
+        "word-break": "keep-all",
+      },
+      content_style: {
+        "text-align": "left",
+        "min-width": "300px",
+        "word-break": "break-all",
+      },
+    };
+  },
+  props: {
+    statusDict: {
+      type: Array,
+    },
+  },
+  watch: {
+    "queryParams.updateTime": {
+      deep: true,
+      handler(v) {
+        this.refresh();
+      },
+    },
+  },
+  computed: {},
+  methods: {
+    getLabel,
+    async refresh() {
+      this.pageNum = 1;
+      this.getList();
+    },
+    async getList() {
+      await api.history(this.queryParams).then((v) => {
+        this.tableData = v.rows;
+        this.total = v.total;
+      });
+    },
+    onHide() {
+      this.isShow = false;
+    },
+    close() {
+      this.queryParams = this.resetSearch();
+      this.tableData = [];
+      this.total = 0;
+    },
+    async show(protection) {
+      this.protection = protection;
+      this.queryParams = this.resetSearch();
+      this.queryParams.protectionId = protection.id;
+      await this.refresh();
+      this.isShow = true;
+    },
+    handleSizeChange(val) {
+      this.queryParams.pageSize = val;
+      this.getList();
+    },
+    handleCurrentChange(val) {
+      this.queryParams.pageNum = val;
+      this.getList();
+    },
+    resetSearch() {
+      return {
+        pageNum: 1,
+        pageSize: 10,
+        protectionId: null,
+        updateTime: [new Date(new Date() - 3600 * 1000 * 24 * 90), new Date()],
+      };
+    },
+    // 事件
+    //apimark//
+  },
+  created() {},
+  mounted() {},
+  components: {
+    DataRangePicker,
+    // EditAttribute,
+  },
+};
+</script>
+
+<style lang="scss" >
+
+.device_info {
+  .el-form {
+    width: 600px;
+    padding-top: 40px;
+  }
+}
+</style>

+ 0 - 223
src/views/defenseMonitoring/dialog.vue

@@ -1,223 +0,0 @@
-<template>
-  <div class="edu-training-edit">
-    <DialogCom title="布防历史" :visible.sync="isShow" width="60%">
-      <div class="page-body">
-        <el-form
-          :model="formData"
-          size="small"
-          ref="form"
-          :inline="true"
-          label-position="right"
-          label-width="160px"
-          label-suffix=":"
-        >
-          <el-form-item label="上报时间范围" prop="taskName">
-            <DataRangePicker
-              type="daterange"
-              value-format="yyyy-MM-dd HH:mm:ss"
-              :default-time="['00:00:00', '23:59:59']"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              v-model="queryParams.dateRange"
-              :picker-options="pickerOptions"
-            >
-            </DataRangePicker>
-          </el-form-item>
-          <el-button
-            type="primary"
-            icon="el-icon-search"
-            size="mini"
-            @click="handleQuery"
-            >搜索
-          </el-button>
-          <el-button
-            type="primary"
-            icon="el-icon-refresh"
-            size="mini"
-            @click="resetQuery"
-            >重置
-          </el-button>
-
-          <div class="extend_mod">
-            <el-table
-              v-loading="loading"
-              :data="formData.taskDataVoList"
-              @selection-change="handleSelectionChange"
-              height="300px"
-              border=""
-            >
-              <el-table-column label="防区编号" align="center" prop="sbmc" />
-              <el-table-column
-                label="防区名称"
-                align="center"
-                prop="sbmc1"
-              /><el-table-column
-                label="所属机构"
-                align="center"
-                prop="taskName"
-              />
-              <el-table-column label="布防状态" align="center" prop="pp" />
-              <el-table-column label="上报时间" align="center" prop="ip" />
-            </el-table>
-            
-            <pagination
-              v-show="total > 0"
-              :total="total"
-              :page.sync="queryParams.pageNum"
-              :limit.sync="queryParams.pageSize"
-              @pagination="getList" 
-              />
-              
-          </div>
-        </el-form>
-      </div>
-
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="onHide">关闭</el-button>
-      </div>
-    </DialogCom>
-  </div>
-</template>
-
-<script>
-import { mapState, mapMutations } from "vuex";
-import { getEduTask } from "@/api/core/edu/eduTask";
-import { getTask } from "@/api/core/task";
-import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
-export default {
-  components: { DataRangePicker },
-  dicts: [
-    "core_registration_project",
-    "core_check_type",
-    "retrieval_task_status",
-  ],
-  data() {
-    const params = this.$route.params;
-    return {
-      labelStyle: {
-        color: "#000",
-        "text-align": "center",
-        height: "40px",
-        "min-width": "150px",
-        "word-break": "keep-all",
-      },
-      content_style: {
-        "text-align": "left",
-        "min-width": "300px",
-        "word-break": "break-all",
-      },
-      id: params ? params.id : null,
-      isShow: false,
-      formData: this.reset(),
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        taskName: null,
-        cycle: null,
-        dateRange: [],
-        planStartTime: null,
-        status: null,
-        roleId: null,
-        checkSub: true,
-      },
-      total: 1,
-    };
-  },
-  props: {},
-  watch: {},
-  computed: {
-    ...mapState(["loginUser"]),
-  },
-  methods: {
-    getList(){
-
-    },
-        ...mapMutations([]),
-    reset(other = {}) {
-      return {
-        id: null,
-        taskName: null,
-        status: null,
-        planStartTime: null,
-        planEndTime: null,
-        orgName: null,
-        roleName: null,
-        retrievalUserName: null,
-        startTime: null,
-        endTime: null,
-        taskDataVoList: [
-          {
-            taskName: "福建农信",
-            sbmc: "4000",
-            sbmc1: "报警主机子系统布防状态检测数据 1",
-            pp: " 撤防",
-            ip: "2023-12-22 14:49:00",
-
-            ypzs: "门已打开",
-            status: "在线",
-          },
-        ],
-        ...other,
-      };
-    },
-    async refresh(id, other) {
-      if (!id) {
-        this.reset(other);
-      } else {
-        getTask(id).then((response) => {
-          this.formData = response.data;
-          this.open = true;
-          this.title = "调阅详情";
-        });
-      }
-    },
-    async show(id, other = {}) {
-      this.id = id;
-      await this.refresh(id, other);
-      this.isShow = true;
-    },
-    // 事件
-    onHide() {
-      this.isShow = false;
-    },
-    // 事件
-    //apimark//
-  },
-  mounted() {},
-};
-</script>
-
-<style lang="scss">
-.page-body {
-  margin-top: 20px;
-}
-.pagination-container{
-    box-shadow: none;
-}
-.divCls {
-  display: flex;
-  flex-flow: wrap;
-  align-items: center;
-  .Fatherprogress {
-    width: 400px;
-    margin-bottom: 20px;
-    margin-top: 20px;
-    .progressName {
-      font-size: 17px;
-    }
-    .progressMain {
-      font-size: 14px;
-      color: #8c8c8c;
-      display: inline-block;
-      margin-left: 20px;
-      // margin: 0 auto;
-    }
-    .el-progress__text {
-      display: none;
-    }
-  }
-}
-.el-dialog__body {
-  padding-top: 0px;
-}
-</style>

+ 293 - 273
src/views/defenseMonitoring/index.vue

@@ -1,179 +1,240 @@
 <template>
   <div class="app-container">
-    <el-row :gutter="20">
+    <el-row :gutter="10">
+      <!--机构数据-->
+      <!-- <el-col :span="4" :xs="24">
+        <org-tree
+          v-model="queryParams.orgId"
+          @defaultOrg="getDefaultOrg"
+          @checkChange="checkChange"
+          @click="clickTreeNode"
+        ></org-tree>
+      </el-col> -->
+
       <el-col :span="24" :xs="24">
         <div class="main-right-box">
+          <!--    搜索条件    -->
           <div class="main-search-box">
             <el-form
               :model="queryParams"
-              ref="queryForm"
+              ref="search"
               size="small"
               :inline="true"
               v-show="showSearch"
             >
-              <el-form-item label="组织机构">
+              <el-form-item label="所属机构">
                 <org-tree
                   v-model="queryParams.orgId"
-                  @defaultKey="getDefaultKey"
                   @defaultOrg="getDefaultOrg"
                   @checkChange="checkChange"
                   @click="clickTreeNode"
                   ref="orgTree"
                 ></org-tree>
               </el-form-item>
-              <el-form-item label="布防状态" prop="taskName">
+              <el-form-item prop="key" label="报警控制器名称">
+                <el-input
+                  v-model="queryParams.key"
+                  :maxlength="50"
+                  placeholder="请输入报警控制器名称"
+                  clearable
+                />
+              </el-form-item>
+              <el-form-item prop="status" label="报警控制器状态">
                 <el-select
-                  v-model="queryParams.taskName"
+                  label="报警控制器状态"
+                  v-model="queryParams.status"
+                  placeholder="请选择报警控制器状态"
                   clearable
-                  label="布防状态"
-                  placeholder="请选择布防状态"
-                  prop="orgType"
-                  @change="cleanExecOrgList"
                 >
                   <el-option
-                    v-for="item in dict.type.sys_org_type"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
+                    v-for="dict in dict.type.protection_status"
+                    :key="dict.value"
+                    :label="dict.label"
+                    :value="dict.value"
+                  />
                 </el-select>
               </el-form-item>
 
-              <el-form-item label="上报时间范围" prop="taskName">
+              <el-form-item prop="dateRange" label="布撤防登记时间">
                 <DataRangePicker
+                  v-model="queryParams.dateRange"
+                  key="daterange"
                   type="daterange"
-                  value-format="yyyy-MM-dd HH:mm:ss"
-                  :default-time="['00:00:00', '23:59:59']"
+                  range-separator="至"
                   start-placeholder="开始日期"
                   end-placeholder="结束日期"
-                  v-model="queryParams.dateRange"
-                  :picker-options="pickerOptions"
                 >
                 </DataRangePicker>
               </el-form-item>
-              <el-form-item label="上报时间" prop="planStartTime">
-                <el-select
-                  v-model="queryParams.planStartTime"
-                  clearable
-                  label="上报时间"
-                  placeholder="请选择上报时间"
-                  prop="orgType"
-                  @change="cleanExecOrgList"
-                >
-                  <el-option
-                    v-for="item in dict.type.sys_org_type"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
-                </el-select>
-              </el-form-item>
             </el-form>
 
+            <!--    按纽    -->
             <el-row :gutter="10">
               <el-col :span="1.5">
                 <el-button
                   type="primary"
                   icon="el-icon-search"
                   size="mini"
-                  @click="handleQuery"
-                  >搜索
-                </el-button>
-              </el-col>
-              <el-col :span="1.5">
+                  @click="getList"
+                  v-hasPermi="['device:protection']"
+                  >搜索</el-button
+                >
                 <el-button
                   type="primary"
                   icon="el-icon-refresh"
                   size="mini"
                   @click="resetQuery"
-                  >重置
-                </el-button>
+                  >重置</el-button
+                >
+                <!-- <el-button
+                  type="primary"
+                  icon="el-icon-plus"
+                  size="mini"
+                  @click="handleAdd()"
+                  v-hasPermi="['device:protection:add']"
+                  >新增</el-button
+                > -->
+                <el-button
+                  type="primary"
+                  icon="el-icon-download"
+                  size="mini"
+                  @click="handleExport()"
+                  v-hasPermi="['device:protection']"
+                  >导出数据</el-button
+                >
               </el-col>
-
-              <!-- <el-col :span="1.5">
-                  <el-button
-                    type="primary"
-                    icon="el-icon-download"
-                    size="mini"
-                    @click="handleExport"
-                    v-hasPermi="['core:task:export']"
-                    >导出</el-button
-                  >
-                </el-col> -->
-
               <right-toolbar
                 :showSearch.sync="showSearch"
                 @queryTable="getList"
               ></right-toolbar>
             </el-row>
           </div>
-
           <el-table
-            v-loading="loading"
-            :data="taskList"
-            border
-            height="600"
             size="small"
+            border
+            v-loading="loading"
+            :data="pageData"
+            @selection-change="handleSelectionChange"
+            height="594"
           >
-            <!-- <el-table-column
-                label="序号"
-                type="index"
-                align="center"
-                width="100"
-              >
-                <template slot-scope="scope">
-                  <span>{{
-                    (queryParams.pageNum - 1) * queryParams.pageSize +
-                    scope.$index +
-                    1
-                  }}</span>
-                </template>
-              </el-table-column> -->
             <el-table-column
-              label="组织机构"
               align="center"
-              prop="taskName"
-              width="220"
-            />
+              type="index"
+              label="序号"
+              width="60"
+              v-if="columns[0].visible"
+            >
+              <template slot-scope="scope">
+                {{
+                  (queryParams.pageNum - 1) * queryParams.pageSize +
+                  scope.$index +
+                  1
+                }}
+              </template>
+            </el-table-column>
             <el-table-column
-              label="防区编号"
               align="center"
-              prop="sbmc"
-              show-overflow-tooltip="true"
-            />
+              prop="orgName"
+              label="所属机构"
+              v-if="columns[1].visible"
+            ></el-table-column>
             <el-table-column
-              label="防区名称"
               align="center"
-              prop="sbmc1"
-              width="220"
-              show-overflow-tooltip="true"
-            />
-
-            <el-table-column label="布防状态" align="center" prop="pp" />
-            <el-table-column label="上报时间" align="center" prop="ip" />
-
+              prop="name"
+              label="报警控制器名称"
+              show-overflow-tooltip
+              v-if="columns[2].visible"
+            >
+            </el-table-column>
             <el-table-column
-              label="操作"
-              fixed="right"
-              style="width: 100px"
               align="center"
-              class-name="small-padding fixed-width"
+              prop="status"
+              label="报警控制器状态"
+              width="150"
+              v-if="columns[3].visible"
             >
-              <template slot-scope="scope">
+              <template slot-scope="r"
+                >{{
+                  getLabel(dict.type.protection_status, r.row.status, "未知")
+                }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              align="center"
+              prop="statusUpdatorName"
+              label="登记人/数据来源"
+              show-overflow-tooltip
+              width="150"
+              v-if="columns[4].visible"
+            >
+            </el-table-column>
+            <el-table-column
+              align="center"
+              prop="statusUpdateTime"
+              label="最近登记时间"
+              width="150"
+              v-if="columns[5].visible"
+            >
+            </el-table-column>
+            <el-table-column
+              align="center"
+              prop="statusUpdateTime"
+              label="布撤防登记时间"
+              width="150"
+              v-if="columns[5].visible"
+            >
+            </el-table-column>
+            <el-table-column align="center" label="操作">
+              <template slot-scope="r">
+                <!-- <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-edit-outline"
+                @click="updateStatus(r.row.id, 1)"
+                v-hasPermi="['device:protectionstatus:maintain']"
+                >布防</el-button
+              >
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-edit-outline"
+                @click="updateStatus(r.row.id, 0)"
+                v-hasPermi="['device:protectionstatus:maintain']"
+                >撤防</el-button
+              > -->
+                <!-- <el-button
+                  size="mini"
+                  type="text"
+                  icon="el-icon-edit-outline"
+                  @click="onEdit(r.row.id)"
+                  v-hasPermi="['device:protection:edit']"
+                  >编辑</el-button
+                > -->
                 <el-button
                   size="mini"
                   type="text"
-                  icon="el-icon-view"
-                  @click="lookView(scope.row)"
-                  v-hasPermi="['core:task:query']"
-                  >布防历史</el-button
+                  icon="el-icon-document-copy"
+                  @click="onHistory(r.row)"
+                  v-hasPermi="['device:protection']"
+                  >布防历史</el-button
                 >
+                <!-- <el-popconfirm
+                  @confirm="onDel(r.row.id)"
+                  title="点击确定删除报警控制器"
+                >
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-delete"
+                    v-hasPermi="['device:protection:remove']"
+                    slot="reference"
+                    >删除</el-button
+                  >
+                </el-popconfirm> -->
               </template>
             </el-table-column>
           </el-table>
-          <dialog-info ref="infoDialog" @success="refresh(true)"></dialog-info>
+
           <pagination
             v-show="total > 0"
             :total="total"
@@ -184,223 +245,182 @@
         </div>
       </el-col>
     </el-row>
+    <dialog-edit
+      ref="editDialog"
+      @success="getList()"
+      :orgTypeOptions="dict.type.sys_org_type"
+      :ruleTypeOptions="dict.type.rule_type"
+    ></dialog-edit>
+    <dialog-history
+      ref="historyDialog"
+      :statusDict="dict.type.protection_status"
+    ></dialog-history>
   </div>
 </template>
 
 <script>
-import { listTask } from "@/api/core/task";
+// import OrgTree from "@/components/orgTree";
 import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
-import DialogInfo from "./dialog.vue";
-import { listPlanRole } from "@/api/core/edu/plan";
-import { formatTime } from "@/utils/ruoyi";
-import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
-import dayjs from "dayjs";
+import DialogEdit from "./dialog.edit";
+import DialogHistory from "./dialog.history";
+import * as api from "@/api/resumption/protection";
+import { getLabel } from "@/views/commonOption.js";
 import { mapGetters } from "vuex";
+import dayjs from "dayjs";
+import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
 export default {
-  components: { OrgTree, DialogInfo, DataRangePicker },
-  name: "Task",
-  // dicts: ["sys_access_cycle"],
-  dicts: ["sys_org_type", "plan_status"],
+  name: "protection",
+  dicts: ["protection_status"],
+  components: {
+    DialogEdit,
+    OrgTree,
+    DialogHistory,
+    DataRangePicker,
+  },
   data() {
+    const { params, query } = this.$route;
     return {
-      // 遮罩层
+      isShow: false,
       loading: false,
-      // 选中数组
       ids: [],
-      // 非单个
+      // 非单个
       single: true,
-      // 非多个
+      // 非多个
       multiple: true,
       // 显示搜索条件
       showSearch: true,
-      // 总条数
-      total: 1,
-      // 监控调阅任务表格数据
-      taskList: [
-        {
-          taskName: "长乐农商行",
-          sbmc: "三楼海康",
-          pp: "海康视频存储设备",
-          ip: "10.87.10.166",
-          wlzt: "正常",
-          ypzs: "50",
-          exceptionCount: "2",
-          sykj: "995G/7449G",
-        },
-      ],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
+      total: 0,
+      selectedOrgName: null,
       queryParams: {
+        orgId: null,
+        checkSub: true,
+        key: null,
+        status: null,
+        dateRange: null,
         pageNum: 1,
         pageSize: 10,
-        taskName: null,
-        cycle: null,
-        dateRange: [],
-        planStartTime: null,
-        status: null,
-        roleId: null,
-        checkSub: true,
+        ...query,
       },
-      selectedOrgName: "",
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {},
-
-      orgName: "",
+      pageData: [],
+      // 列信息
+      columns: [
+        { key: 0, label: `序号`, visible: true },
+        { key: 1, label: `所属机构`, visible: true },
+        { key: 2, label: `报警控制器名称`, visible: true },
+        { key: 3, label: `报警控制器状态`, visible: true },
+        { key: 4, label: `登记人`, visible: true },
+        { key: 5, label: `最近登记时间`, visible: true },
+      ],
     };
   },
-  created() {
-    this.queryParams.orgId = this.$store.getters.orgId;
-    this.getList();
-  },
+  props: {},
+  watch: {},
   computed: {
     ...mapGetters(["orgId", "orgName"]),
   },
   methods: {
-    /** 查询监控调阅任务列表 */
+    getLabel,
     getList() {
-      this.taskList = [
-        {
-          taskName: "福建农信",
-          sbmc: "4000",
-          sbmc1: "报警主机子系统布防状态检测数据 1",
-          pp: " 撤防",
-          ip: "2023-12-22 14:49:00",
-         
-          ypzs: "门已打开",
-          status: "在线",
-        },
-        {
-          //自助区卷帘门一
-          taskName: "福建农信",
-          sbmc: "4001",
-          sbmc1: "报警主机子系统布防状态检测数据 2",
-          pp: " 布防",
-          ip: "2023-12-22 14:49:00",
-          
-        },
-      ];
-      return;
       this.loading = true;
-      listTask(this.queryParams).then((response) => {
-        this.taskList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
+      this.pageData = [];
+      api
+        .list(this.queryParams)
+        .then((response) => {
+          this.pageData = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        })
+        .catch(() => {
+          this.loading = false;
+        });
     },
 
-    getDefaultOrg(org) {
-      this.orgName = org.name;
-      this.selectedOrgName = org.shortName;
+    handleAdd(id, other = {}) {
+      this.$refs.editDialog.show(id, other);
     },
+    handleExport() {
+      if (this.total == 0) {
+        this.$message.error({
+          message: `无可用数据导出!`,
+          type: "error",
+          duration: 2000,
+        });
+        return;
+      }
 
-    getDefaultKey(key) {
-      this.queryParams.orgId = key;
-      this.getList();
+      this.download(
+        "/core/resumption/protection/export",
+        {
+          ...this.queryParams,
+        },
+        `${this.selectedOrgName}-布撤防情况跟踪-${dayjs(new Date()).format(
+          "YYYYMMDD"
+        )}.xlsx`
+      );
     },
-    checkChange(state) {
-      this.queryParams.checkSub = state;
-      this.handleQuery();
+    onEdit(id, other = {}) {
+      this.$refs.editDialog.show(id, other);
     },
-    // 节点单击事件
-    clickTreeNode(data) {
-      this.queryParams.orgId = data.id;
-      this.orgName = data.name;
-      this.selectedOrgName = data.shortName;
-      this.handleQuery();
+    onHistory(row) {
+      this.$refs.historyDialog.show(row);
     },
-    /** 下穿状态改变*/
-    changeCheckBox() {
+    async onDel(id) {
+      let b = (await api.del(id)).data;
+      if (b) {
+        this.$message.info("删除成功");
+      }
+
       this.getList();
     },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        planId: null,
-        taskName: null,
-        orgId: null,
-        orgPath: null,
-        orgName: null,
-        ymdDate: null,
-        ymdYear: null,
-        ymdHalfyear: null,
-        ymdQuarter: null,
-        ymdMonth: null,
-        ymdWeek: null,
-        ymdDay: null,
-        cycle: null,
-        planStartTime: null,
-        planEndTime: null,
-        startTime: null,
-        endTime: null,
-        status: null,
-        roleId: null,
-        retrievalUser: null,
-        orderNum: null,
-        batchNum: null,
-        submitTime: null,
-        exceptionCount: null,
-      };
-      this.resetForm("form");
+    updateStatus(id, status) {
+      api.updateStatus(id, status).then((r) => {
+        this.$message.info("更新状态成功");
+        this.getList();
+      });
     },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      //this.queryParams.dateRange = [];
-      this.getList();
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.userId);
+      this.single = selection.length != 1;
+      this.multiple = !selection.length;
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
+      this.resetForm("search");
+      this.queryParams.dateRange = null;
       this.queryParams.orgId = this.orgId;
       this.selectedOrgName = this.orgName;
       this.queryParams.checkSub = true;
-      this.queryParams.dateRange = ["", ""];
-      this.queryParams.planStartTime = null;
       this.$refs["orgTree"].setCheckSub(this.queryParams.checkSub);
-      this.handleQuery();
+      // this.queryParams.orgId = undefined;
+      // this.$refs.tree.setCurrentKey(null);
+      this.getList();
     },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.id);
-      this.single = selection.length !== 1;
-      this.multiple = !selection.length;
+    //单选框状态改变
+    checkChange(state) {
+      this.queryParams.checkSub = state;
+      this.getList();
     },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加监控调阅任务";
+    getDefaultOrg(node) {
+      this.queryParams.orgId = node.id;
+      this.selectedOrgName = node.shortName;
+      this.getList();
     },
-    /** 修改按钮操作 */
-    lookView(row) {
-      this.$refs["infoDialog"].show(row.id, {});
+    // 节点单击事件
+    clickTreeNode(data) {
+      this.queryParams.orgId = data.id;
+      this.selectedOrgName = data.shortName;
+      this.getList();
     },
-
-    /** 导出按钮操作 */
-    // handleExport() {
-    //   console.log(this);
-    //   this.download(
-    //     "core/retrievalTask/export",
-    //     {
-    //       ...this.queryParams,
-    //     },
-    //     `${
-    //       this.selectedOrgName
-    //     }-${this.$tab.getCurrentTabName()}-${dayjs().format("YYYYMMDD")}.xlsx`
-    //   );
-    // },
   },
+  mounted() {},
 };
 </script>
-<style lang="scss" scoped></style>
+
+<style lang="scss" scoped>
+/* .search_key{
+  ::v-deep .el-form-item__label{
+    width:60px !important;
+  }
+} */
+</style>

+ 1 - 1
src/views/dynamicLoopManagement/index.vue

@@ -658,7 +658,7 @@ export default {
     handleAdd() {
       this.reset();
       this.open = true;
-      this.title = "添加监控调阅任务";
+      this.title = "添加设备";
     },
     /** 修改按钮操作 */
     lookView(row) {

+ 42 - 3
src/views/warn/index.vue

@@ -39,7 +39,24 @@
                   </el-option>
                 </el-select>
               </el-form-item>
-
+              <el-form-item label="资产类别" prop="taskName">
+                <el-select
+                  v-model="queryParams.taskName"
+                  clearable
+                  label="资产类别"
+                  placeholder="请选择资产类别"
+                  prop="orgType"
+                  @change="cleanExecOrgList"
+                >
+                  <el-option
+                    v-for="item in dict.type.sys_org_type"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
               <el-form-item label="告警时间" prop="planStartTime">
                 <DataRangePicker
                   type="daterange"
@@ -52,7 +69,19 @@
                 >
                 </DataRangePicker>
               </el-form-item>
-              <el-form-item label="是否已全部处理" prop="taskName">
+              <el-form-item label="恢复时间" prop="planStartTime">
+                <DataRangePicker
+                  type="daterange"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  :default-time="['00:00:00', '23:59:59']"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                  v-model="queryParams.dateRange"
+                  :picker-options="pickerOptions"
+                >
+                </DataRangePicker>
+              </el-form-item>
+              <el-form-item label="是否处理" prop="taskName">
                 <el-select
                   v-model="queryParams.taskName"
                   clearable
@@ -165,7 +194,17 @@
                 </span>
               </template> -->
             </el-table-column>
-            <el-table-column label="告警规则" align="center" prop="ypzs">
+            <el-table-column label="恢复时间" align="center" prop="wlzt">
+              <!-- <template slot-scope="scope">
+                <span>
+                  <dict-tag
+                    :options="dict.type.retrieval_task_status"
+                    :value="scope.row.status"
+                  />
+                </span>
+              </template> -->
+            </el-table-column>
+            <el-table-column label="告警模板" align="center" prop="ypzs">
               <!-- <template slot-scope="scope">
                 {{ scope.row.planStartTime }}~{{ scope.row.planEndTime }}
               </template> -->