Browse Source

修改报警弹窗接口及列表显示列,替换设备详情各部件图片

baiyanting 1 year ago
parent
commit
999fce8ec6

+ 16 - 0
src/api/zhbj/index.js

@@ -1,5 +1,21 @@
 import request from "@/tools/request";
 
+//获取设备报警列表数据
+export function GetDeviceTableData(data) {
+  return request({
+    baseURL: process.env.VUE_APP_ALARM,
+    url: `/alarminfo/findAlarmlist?begin=${data.begin}&end=${
+      data.end
+    }&alarmType=${data.alarmType}&stationid=${data.stationid}${
+      data.alarmType == "windturbine" || data.alarmType == "inverter"
+        ? `&deviceid=${data.deviceid}`
+        : ""
+    }&pageNum=${data.pageNum}&pageSize=${data.pageSize}&description=${
+      data.description
+    }&isclose=${data.isclose}`,
+    method: "get",
+  });
+}
 //获取报警列表数据
 export function GetTableData(data) {
   return request({

BIN
src/assets/imgs/bj.png


BIN
src/assets/imgs/clx.png


BIN
src/assets/imgs/fdj.png


BIN
src/assets/imgs/jc.png


BIN
src/assets/imgs/ph.png


BIN
src/assets/imgs/qt.png


BIN
src/assets/imgs/yy.png


+ 20 - 23
src/components/alarm/index.vue

@@ -2,10 +2,7 @@
   <el-dialog v-model="dialogVisible" width="80%" top="120px">
     <template #title>
       <div class="dialog-title">
-        <div class="title">
-            设备报警信息
-            <span style="font-size:12px">(3小时内)</span>
-        </div>
+        <div class="title">设备报警信息</div>
       </div>
     </template>
     <div class="dialog-body">
@@ -31,12 +28,9 @@
             <template #default="{ row }">
               <span v-if="item.code == 'rank'">{{ getRank(row.rank) }}</span>
               <span
-                v-else-if="item.code == 'endts' && item.title == '是否解除'"
-                >{{ row.endts ? "已解除" : "未解除" }}</span
+                v-else-if="item.code == 'closeTime' && item.title == '是否解除'"
+                >{{ row.closeTime ? "已解除" : "未解除" }}</span
               >
-              <span v-else-if="item.code == 'endts'">{{
-                row.endts ? getTime(row.endts) : "--"
-              }}</span>
               <span v-else>{{ row[item.code] }}</span>
             </template>
           </el-table-column>
@@ -54,7 +48,7 @@
   </el-dialog>
 </template>
 <script>
-import { GetTableData } from "@/api/zhbj/index.js";
+import { GetDeviceTableData } from "@/api/zhbj/index.js";
 import dayjs from "dayjs";
 export default {
   name: "alarm", //
@@ -65,12 +59,12 @@ export default {
       dialogVisible: false,
       tableData: [],
       tableHeader: [
-        { title: "时间", code: "ts", width: "200" },
-        { title: "场站名称", code: "stationname", width: "200" },
-        { title: "设备名称", code: "devicename", width: "180" },
+        { title: "时间", code: "lastUpdateTime", width: "200" },
+        { title: "场站名称", code: "stationName", width: "200" },
+        { title: "设备名称", code: "deviceName", width: "180" },
         { title: "报警描述", code: "description" },
-        { title: "是否解除", code: "endts", width: "120" },
-        { title: "解除时间", code: "endts", width: "200" },
+        { title: "是否解除", code: "closeTime", width: "120" },
+        // { title: "解除时间", code: "closeTime", width: "200" },
         { title: "是否确认", code: "confirmed", width: "120" },
       ],
       page: {
@@ -85,8 +79,8 @@ export default {
   },
   created() {},
   methods: {
-    getTime(endts) {
-      return dayjs(endts).format("YYYY-MM-DD HH:mm:ss");
+    getTime(closeTime) {
+      return dayjs(closeTime).format("YYYY-MM-DD HH:mm:ss");
     },
     getRank(rank) {
       if (rank === 1) {
@@ -113,23 +107,26 @@ export default {
     },
     getTableData() {
       this.BASE.showLoading();
-      GetTableData({
-        begin: dayjs().add(-3, "hour").format("YYYY-MM-DD HH:mm:ss"),
-        end: dayjs().format("YYYY-MM-DD HH:mm:ss"),
+      GetDeviceTableData({
+        begin: "",
+        end: "",
         alarmType: this.wtype == -1 ? "windturbine" : "inverter",
         stationid: this.wpid,
         deviceid: this.wtid,
         pageNum: this.page.currentPage,
         pageSize: this.page.pagesize,
         description: "",
+        isclose:false
       }).then(({ data }) => {
         this.BASE.closeLoading();
-        if (data.ls.length) {
-          this.tableData = data.ls.map((item) => {
+        if (data.records.length) {
+          this.tableData = data.records.map((item) => {
             return {
               ...item,
               confirmed: item.confirmed ? "是" : "否",
-              ts: dayjs(item.ts).format("YYYY-MM-DD HH:mm:ss"),
+              lastUpdateTime: dayjs(item.lastUpdateTime).format(
+                "YYYY-MM-DD HH:mm:ss"
+              ),
             };
           });
           this.page.total = data.total;

+ 20 - 20
src/views/stateMonitor/factoryMonitor/photovoltaic/lightBoosterStation/index.vue

@@ -115,11 +115,11 @@
           <template #default="{ row }">
             <span v-if="item.code == 'rank'">{{ getRank(row.rank) }}</span>
             <span
-              v-else-if="item.code == 'endts' && item.title == '是否解除'"
-              >{{ row.endts ? "已解除" : "未解除" }}</span
+              v-else-if="item.code == 'closeTime' && item.title == '是否解除'"
+              >{{ row.closeTime ? "已解除" : "未解除" }}</span
             >
-            <span v-else-if="item.code == 'endts'">{{
-              row.endts ? getTime(row.endts) : "--"
+            <span v-else-if="item.code == 'closeTime'">{{
+              row.closeTime ? getTime(row.closeTime) : "--"
             }}</span>
             <span v-else>{{ row[item.code] }}</span>
           </template>
@@ -149,7 +149,7 @@ import GFtunliuwuyuan from "./components/tunliuwuyuan.vue";
 import GFyanggaoweijiabao from "./components/yanggaoweijiabao.vue";
 import GFyingxianjinghui from "./components/yingxianjinghui.vue";
 import GFyouyuyouwei from "./components/youyuyouwei.vue";
-import { GetTableData } from "@/api/zhbj/index.js";
+import { GetDeviceTableData } from "@/api/zhbj/index.js";
 import dayjs from "dayjs";
 import { ElMessageBox } from "element-plus";
 export default {
@@ -180,11 +180,11 @@ export default {
       end: "",
       page: { currentPage: 1, pagesize: 22, total: 0 },
       tableHeader: [
-        { title: "时间", code: "ts", width: "160" },
-        { title: "场站名称", code: "stationname", width: "150" },
+        { title: "时间", code: "lastUpdateTime", width: "160" },
+        { title: "场站名称", code: "stationName", width: "150" },
         { title: "报警描述", code: "description" },
-        { title: "是否解除", code: "endts", width: "110" },
-        { title: "解除时间", code: "endts", width: "160" },
+        { title: "是否解除", code: "closeTime", width: "110" },
+        // { title: "解除时间", code: "closeTime", width: "160" },
         { title: "是否确认", code: "confirmed", width: "110" },
       ],
     };
@@ -198,8 +198,8 @@ export default {
     },
   },
   methods: {
-    getTime(endts) {
-      return dayjs(endts).format("YYYY-MM-DD HH:mm:ss");
+    getTime(closeTime) {
+      return dayjs(closeTime).format("YYYY-MM-DD HH:mm:ss");
     },
     // 时间选择器第一个禁用
     disabledDate(time) {
@@ -236,11 +236,8 @@ export default {
     handleAlarm(id, name) {
       this.sub = id;
       this.title = name;
-      this.begin = dayjs()
-        // .add(-2, "day")
-        .startOf("day")
-        .format("YYYY-MM-DD HH:mm:ss");
-      this.end = dayjs().format("YYYY-MM-DD HH:mm:ss");
+      this.begin = "";
+      this.end = "";
       this.getAlarm(true);
     },
     getAlarm(flag) {
@@ -255,14 +252,17 @@ export default {
         description: this.description,
         pageNum: this.page.currentPage,
         pageSize: this.page.pagesize,
+        isclose: false,
       };
-      GetTableData(params).then(({ data }) => {
-        if (data.ls.length) {
-          this.drawerList = data.ls.map((item) => {
+      GetDeviceTableData(params).then(({ data }) => {
+        if (data.records.length) {
+          this.drawerList = data.records.map((item) => {
             return {
               ...item,
               confirmed: item.confirmed ? "是" : "否",
-              ts: dayjs(item.ts).format("YYYY-MM-DD HH:mm:ss"),
+              lastUpdateTime: dayjs(item.lastUpdateTime).format(
+                "YYYY-MM-DD HH:mm:ss"
+              ),
             };
           });
           this.page.total = data.total;

+ 15 - 19
src/views/stateMonitor/factoryMonitor/windPowerPlant/boosterStation/index.vue

@@ -95,12 +95,9 @@
           <template #default="{ row }">
             <span v-if="item.code == 'rank'">{{ getRank(row.rank) }}</span>
             <span
-              v-else-if="item.code == 'endts' && item.title == '是否解除'"
-              >{{ row.endts ? "已解除" : "未解除" }}</span
+              v-else-if="item.code == 'closeTime' && item.title == '是否解除'"
+              >{{ row.closeTime ? "已解除" : "未解除" }}</span
             >
-            <span v-else-if="item.code == 'endts'">{{
-              row.endts ? getTime(row.endts) : "--"
-            }}</span>
             <span v-else>{{ row[item.code] }}</span>
           </template>
         </el-table-column>
@@ -171,11 +168,10 @@ export default {
       end: "",
       page: { currentPage: 1, pagesize: 22, total: 0 },
       tableHeader: [
-        { title: "时间", code: "ts", width: "160" },
-        { title: "场站名称", code: "stationname", width: "150" },
+        { title: "时间", code: "lastUpdateTime", width: "160" },
+        { title: "场站名称", code: "stationName", width: "150" },
         { title: "报警描述", code: "description" },
-        { title: "是否解除", code: "endts", width: "110" },
-        { title: "解除时间", code: "endts", width: "160" },
+        { title: "是否解除", code: "closeTime", width: "110" },
         { title: "是否确认", code: "confirmed", width: "110" },
       ],
     };
@@ -189,8 +185,8 @@ export default {
     },
   },
   methods: {
-    getTime(endts) {
-      return dayjs(endts).format("YYYY-MM-DD HH:mm:ss");
+    getTime(closeTime) {
+      return dayjs(closeTime).format("YYYY-MM-DD HH:mm:ss");
     },
     // 时间选择器第一个禁用
     disabledDate(time) {
@@ -227,11 +223,8 @@ export default {
     handleAlarm(id, name) {
       this.sub = id;
       this.title = name;
-      this.begin = dayjs()
-        // .add(-2, "day")
-        .startOf("day")
-        .format("YYYY-MM-DD HH:mm:ss");
-      this.end = dayjs().format("YYYY-MM-DD HH:mm:ss");
+      this.begin = "";
+      this.end = "";
       this.getAlarm();
     },
     getAlarm() {
@@ -243,14 +236,17 @@ export default {
         description: this.description,
         pageNum: this.page.currentPage,
         pageSize: this.page.pagesize,
+        isclose: false,
       };
       GetTableData(params).then(({ data }) => {
-        if (data.ls.length) {
-          this.drawerList = data.ls.map((item) => {
+        if (data.records.length) {
+          this.drawerList = data.records.map((item) => {
             return {
               ...item,
               confirmed: item.confirmed ? "是" : "否",
-              ts: dayjs(item.ts).format("YYYY-MM-DD HH:mm:ss"),
+              lastUpdateTime: dayjs(item.lastUpdateTime).format(
+                "YYYY-MM-DD HH:mm:ss"
+              ),
             };
           });
           this.page.total = data.total;