Ver código fonte

硬盘录像机调试

jiawuxian 1 ano atrás
pai
commit
74efaf8eb8

+ 30 - 0
src/api/iot/dvrDisk.js

@@ -0,0 +1,30 @@
+import request from '@/utils/request'
+
+
+// 查询定时任务调度列表
+export function list(query) {
+    return request({
+      url: '/iot/dvrdisk/web/find',
+      method: 'post',
+      data: query
+    })
+  }
+
+
+// 查询定时任务调度列表
+export function dvrdiskStatistic(query) {
+    return request({
+      url: '/iot/dvrdisk/web/diskstatistic',
+      method: 'get',
+      params: query
+    })
+  }
+  
+// 查询定时任务调度列表
+export function history(query) {
+    return request({
+      url: '/iot/dvrdisk/web/history',
+      method: 'post',
+      data: query
+    })
+  }

+ 38 - 40
src/views/videoRecorder/dialog.vue → src/views/iot/videoRecorder/detail.dialog.vue

@@ -14,46 +14,45 @@
           :label-style="labelStyle"
           :contentStyle="content_style"
         >
-          <el-descriptions-item labelClassName="gx_info_label" label="设备名称">
-            <!-- {{ formData.taskName }} -->
-            长乐农商行
+          <el-descriptions-item labelClassName="gx_info_label" label="所属机构">
+            {{ dvr.orgName }}
           </el-descriptions-item>
           <el-descriptions-item labelClassName="gx_info_label" label="监控主机">
-            长乐农商行1楼-02主机
-            <!-- <dict-tag
-              :options="dict.type.retrieval_task_status"
-              :value="formData.status"
-            /> -->
+            {{ dvr.equipmentName }}
           </el-descriptions-item>
           <el-descriptions-item labelClassName="gx_info_label" label="网络状态">
-            异常
+            {{ dvr.netStateStr }}
             <!-- {{ formData.planStartTime }}-{{ formData.planEndTime }} -->
           </el-descriptions-item>
           <el-descriptions-item labelClassName="gx_info_label" label="IP地址">
             <!-- {{ formData.orgName }} -->
-            10.87.10.166
+            {{ dvr.ip }}
           </el-descriptions-item>
         </el-descriptions>
         <div class="titleDiv">硬盘状态</div>
         <div class="divCls">
-          <div class="Fatherprogress" v-for="i in 6" :key="i">
+          <div
+            class="Fatherprogress"
+            v-for="disk in dvr.diskInfos"
+            :key="disk.diskIndex"
+          >
             <div>
-              <span class="progressName">硬盘({{ i }}) <span v-if="i==4" style="color: brown;">(异常)</span></span
-              ><span class="progressMain">3725.90G已用(共3725.90G)</span>
+              <span class="progressName"
+                >{{ disk.diskName }}
+                <span v-if="i == 4" style="color: brown"
+                  >({{ disk.state === 1 ? "异常" : "正常" }})</span
+                ></span
+              ><span class="progressMain"
+                >{{ ((disk.total-disk.available) / 1024).toFixed(1) }}G已用(共{{
+                  (disk.total / 1024).toFixed(1)
+                }}G)</span
+              >
             </div>
-            <el-progress
-            v-if="i==4"
+           
+            <el-progress              
               class="progress"
               stroke-width="10"
-              :percentage="50"
-              status="exception"
-            ></el-progress>
-            <el-progress
-            v-else
-              class="progress"
-              stroke-width="10"
-              :percentage="50"
-              
+              :percentage="(disk.total-disk.available)/disk.total"
             ></el-progress>
           </div>
         </div>
@@ -202,9 +201,11 @@ export default {
         "min-width": "300px",
         "word-break": "break-all",
       },
-      id: params ? params.id : null,
       isShow: false,
+      equipmentCode: null,
+      dvr: {},
       formData: this.reset(),
+      historyData: [],
       queryParams: {
         pageNum: 1,
         pageSize: 10,
@@ -284,26 +285,23 @@ export default {
         ...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 refresh(equipmentCode, other) {
+      getTask(id).then((response) => {
+        this.formData = response.data;
+        this.open = true;
+      });
     },
-    async show(id, other = {}) {
-      this.id = id;
-      await this.refresh(id, other);
+    async show(dvr, other = {}) {
+      this.dvr = this.dvr;
+      this.equipmentCode = dvr.equipmentCode;
+      await this.refresh(equipmentCode, other);
       this.isShow = true;
     },
     // 事件
     onHide() {
       this.isShow = false;
     },
+    renderDiskInfo(info) {},
     // 事件
     //apimark//
   },
@@ -348,7 +346,7 @@ export default {
     }
   }
 }
-.el-dialog__body{
-    padding-top: 0px;
+.el-dialog__body {
+  padding-top: 0px;
 }
 </style>

+ 51 - 151
src/views/videoRecorder/index.vue → src/views/iot/videoRecorder/index.vue

@@ -31,7 +31,7 @@
                 />
               </el-form-item>
 
-              <el-form-item label="任务时间" prop="planStartTime">
+              <!-- <el-form-item label="任务时间" prop="planStartTime">
                 <DataRangePicker
                   type="daterange"
                   value-format="yyyy-MM-dd HH:mm:ss"
@@ -42,7 +42,7 @@
                   :picker-options="pickerOptions"
                 >
                 </DataRangePicker>
-              </el-form-item>
+              </el-form-item> -->
             </el-form>
 
             <el-row :gutter="10">
@@ -77,10 +77,10 @@
               </el-col>
               <el-col :span="19">
                 <div class="numCls">
-                  <div>监控主机总数:100</div>
-                  <div>硬盘总数:94</div>
+                  <div>监控主机总数:{{dvrdiskStatistic.dvrTotal}}</div>
+                  <div>硬盘总数:{{dvrdiskStatistic.diskTotal}}</div>
                   <div>
-                    异常总数:<span :style="{ color: '#fb5d70' }">6</span>
+                    异常总数:<span :style="{ color: '#fb5d70' }">{{dvrdiskStatistic.diskExceptionCount}}</span>
                   </div>
                 </div>
               </el-col>
@@ -93,7 +93,7 @@
 
           <el-table
             v-loading="loading"
-            :data="taskList"
+            :data="tableData"
             border
             height="600"
             size="small"
@@ -115,13 +115,13 @@
             <el-table-column
               label="组织机构"
               align="center"
-              prop="taskName"
+              prop="orgName"
               width="220"
             />
             <el-table-column
               label="监控主机"
               align="center"
-              prop="sbmc"
+              prop="equipmentName"
               width="220"
               show-overflow-tooltip="true"
             />
@@ -129,7 +129,7 @@
             <el-table-column
               label="品牌"
               align="center"
-              prop="pp"
+              prop="brand"
               width="220"
             />
             <el-table-column
@@ -138,7 +138,7 @@
               prop="ip"
               width="160"
             />
-            <el-table-column label="网络状态" align="center" prop="wlzt">
+            <el-table-column label="网络状态" align="center" prop="netStateStr">
               <!-- <template slot-scope="scope">
                 <span>
                   <dict-tag
@@ -148,7 +148,7 @@
                 </span>
               </template> -->
             </el-table-column>
-            <el-table-column label="硬盘总数" align="center" prop="ypzs">
+            <el-table-column label="硬盘总数" align="center" prop="diskCount">
               <!-- <template slot-scope="scope">
                 {{ scope.row.planStartTime }}~{{ scope.row.planEndTime }}
               </template> -->
@@ -157,15 +157,25 @@
             <el-table-column
               label="异常数量(序号)"
               align="center"
-              prop="exceptionCount"
+              prop="diskExceptionCount"
               width="150"
             />
             <el-table-column
-              label="剩余空间/总空间"
+              label="已用空间/总空间"
               align="center"
               prop="sykj"
               width="160"
-            />
+            >
+              <template slot-scope="r">
+                <el-tag
+                  v-for="disk in r.row.diskInfos"
+                  :key="disk.index"
+                  class="diskinfo-el-tag"
+                  type="info"
+                  >{{ renderDiskInfo(disk, r.row) }}</el-tag
+                >
+              </template>
+            </el-table-column>
 
             <el-table-column
               label="操作"
@@ -186,7 +196,7 @@
               </template>
             </el-table-column>
           </el-table>
-          <dialog-info ref="infoDialog" @success="refresh(true)"></dialog-info>
+          <detail-dialog ref="infoDialog" @success="refresh(true)"></detail-dialog>
           <pagination
             v-show="total > 0"
             :total="total"
@@ -201,60 +211,35 @@
 </template>
 
 <script>
-import { listTask } from "@/api/core/task";
 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 DetailDialog from "./detail.dialog.vue";
 import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
 import dayjs from "dayjs";
-import { mapGetters } from "vuex";
+import api from "@/api/iot/dvrDisk.js";
+
 export default {
-  components: { OrgTree, DialogInfo, DataRangePicker },
+  components: { OrgTree, DetailDialog, DataRangePicker },
   name: "Task",
   dicts: ["sys_access_cycle"],
   data() {
     return {
       // 遮罩层
       loading: false,
-      // 选中数组
-      ids: [],
-      // 非单个停用
-      single: true,
-      // 非多个停用
-      multiple: true,
       // 显示搜索条件
       showSearch: true,
       // 总条数
       total: 0,
-      // 监控调阅任务表格数据
-      taskList: [
-        {
-          taskName: "长乐农商行",
-          sbmc: "三楼海康",
-          pp: "海康视频存储设备",
-          ip: "10.87.10.166",
-          wlzt: "正常",
-          ypzs: "50",
-          exceptionCount: "2",
-          sykj: "995G/7449G",
-        },
-      ],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
+      //
+      tableData: [],
+      dvrdiskStatistic:{},
       // 查询参数
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        taskName: null,
-        cycle: null,
-        dateRange: [],
-        planStartTime: null,
-        status: null,
-        roleId: null,
-        checkSub: true,
+        equipmentName: null,
+        checkSub: false,
+        orgId: null,
+        // range:[],
       },
       selectedOrgName: "",
       // 表单参数
@@ -274,38 +259,19 @@ export default {
   },
   methods: {
     /** 查询监控调阅任务列表 */
-    getList() {
-      this.taskList = [
-        {
-          taskName: "长乐农商行",
-          sbmc: "长乐农商行1楼-02主机",
-          pp: "海康视频存储设备",
-          ip: "10.87.10.166",
-          wlzt: "正常",
-          ypzs: "50",
-          exceptionCount: "2",
-          sykj: "995G/7449G",
-        },
-        {
-          taskName: "闽侯县联社",
-          sbmc: "闽侯县联社大厅-01主机",
-          pp: "大华视频存储设备",
-          ip: "10.87.10.187",
-          wlzt: "正常",
-          ypzs: "50",
-          exceptionCount: "0",
-          sykj: "0G/1024G",
-        },
-      ];
-      return;
-      this.loading = true;
-      listTask(this.queryParams).then((response) => {
-        this.taskList = response.rows;
-        this.total = response.total;
+    async getList() {
+      api.list(this.queryParams).then((r) => {
+        this.tableData = r.rows;
+        this.total = r.total;
         this.loading = false;
       });
     },
 
+    async getDvrdiskStatistic() {
+      let { orgId, checkSub } = this.queryParams;
+      api.dvrdiskStatistic({ orgId, checkSub }).then(r=>this.dvrdiskStatistic=r.data);
+    },
+
     getDefaultOrg(org) {
       this.orgName = org.name;
       this.selectedOrgName = org.shortName;
@@ -314,10 +280,12 @@ export default {
     getDefaultKey(key) {
       this.queryParams.orgId = key;
       this.getList();
+      this.getDvrdiskStatistic();
     },
     checkChange(state) {
       this.queryParams.checkSub = state;
       this.handleQuery();
+      this.getDvrdiskStatistic();
     },
     // 节点单击事件
     clickTreeNode(data) {
@@ -325,46 +293,7 @@ export default {
       this.orgName = data.name;
       this.selectedOrgName = data.shortName;
       this.handleQuery();
-    },
-    /** 下穿状态改变*/
-    changeCheckBox() {
-      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");
+      this.getDvrdiskStatistic();
     },
     /** 搜索按钮操作 */
     handleQuery() {
@@ -378,41 +307,12 @@ export default {
       this.queryParams.orgId = this.orgId;
       this.selectedOrgName = this.orgName;
       this.queryParams.checkSub = true;
-      this.queryParams.dateRange = ["", ""];
-      this.queryParams.planStartTime = null;
+      // this.queryParams.dateRange = ["", ""];
+      // this.queryParams.planStartTime = null;
       this.$refs["orgTree"].setCheckSub(this.queryParams.checkSub);
       this.handleQuery();
     },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.id);
-      this.single = selection.length !== 1;
-      this.multiple = !selection.length;
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加监控调阅任务";
-    },
-    /** 修改按钮操作 */
-    lookView(row) {
-      this.$refs["infoDialog"].show(row.id, {});
-    },
-
-    /** 导出按钮操作 */
-    handleExport() {
-      console.log(this);
-      this.download(
-        "core/retrievalTask/export",
-        {
-          ...this.queryParams,
-        },
-        `${
-          this.selectedOrgName
-        }-${this.$tab.getCurrentTabName()}-${dayjs().format("YYYYMMDD")}.xlsx`
-      );
-    },
+    
   },
 };
 </script>