|
@@ -37,17 +37,17 @@
|
|
|
align="center"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="subSystem"
|
|
|
+ prop="subSystemName"
|
|
|
label="子系统"
|
|
|
align="center"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="devcName"
|
|
|
- label="设备名称"
|
|
|
+ prop="objName"
|
|
|
+ label="对象名称"
|
|
|
align="center"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="warnDes"
|
|
|
+ prop="alarmMsg"
|
|
|
label="描述"
|
|
|
align="center"
|
|
|
/>
|
|
@@ -55,15 +55,19 @@
|
|
|
label="操作"
|
|
|
align="center"
|
|
|
>
|
|
|
- <template v-slot:default="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="mini"
|
|
|
-
|
|
|
- @click="handleEdit(scope.row)"
|
|
|
- >
|
|
|
- 待确认
|
|
|
- </el-button>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-dropdown @command="(cmd)=>handleCommand(cmd, scope.row)"
|
|
|
+ v-if="![ALARM_STATE.dissolved.value, ALARM_STATE.dissolved.value].includes(scope.row.alarmState)">
|
|
|
+ <span class="el-dropdown-link">
|
|
|
+ <dict-tag :options="dict.type.alarm_state" :value="scope.row.alarmState"></dict-tag>
|
|
|
+ <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </span>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item :command="ALARM_STATE.disposing.code" v-if="scope.row.alarmState === ALARM_STATE.new.value">开始处理</el-dropdown-item>
|
|
|
+ <el-dropdown-item :command="ALARM_STATE.disposed.code">已处理</el-dropdown-item>
|
|
|
+ <el-dropdown-item :command="ALARM_STATE.dissolved.code">已消散</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</template>
|
|
@@ -102,15 +106,18 @@
|
|
|
|
|
|
<script>
|
|
|
|
|
|
-import { fetchAlarmIndexDay, fetchAlarmIndexMonth, fetchAlarmIndexYear } from '@/api/alarm/alarm-info';
|
|
|
+import {
|
|
|
+ fetchAlarmIndexDay, fetchAlarmIndexMonth, fetchAlarmIndexYear, listAlarmInfo, updateAlarmInfo,
|
|
|
+} from '@/api/alarm/alarm-info';
|
|
|
import { ApiCode } from '@/api/apiEmums';
|
|
|
-import { get } from '@/api/commonApi';
|
|
|
import Block from '@/components/Block/block.vue';
|
|
|
import BlockTable from '@/components/Block/BlockTable/index.vue';
|
|
|
import BarChartBlock from '@/components/Block/charts/BarChartBlock.vue';
|
|
|
import PieChartBlock from '@/components/Block/charts/PieChartBlock.vue';
|
|
|
+import { ALARM_STATE } from '@/enums/alarm';
|
|
|
import { DateTool } from '@/utils/DateTool';
|
|
|
import DeviceWaring from '@/views/analysis/device/DevcWarning/index.vue';
|
|
|
+import Tag from '@/views/basecfg/tag/index.vue';
|
|
|
import dayjs from 'dayjs';
|
|
|
import { mapGetters, mapMutations } from 'vuex';
|
|
|
import * as areaApi from '../../../api/basecfg/area';
|
|
@@ -118,8 +125,9 @@ import LineChartBlock from '../../../components/Block/charts/LineChartBlock.vue'
|
|
|
import SwitchTag from '../../../components/SwitchTag/index.vue';
|
|
|
|
|
|
export default {
|
|
|
- dicts: ['alarm_type'],
|
|
|
+ dicts: ['alarm_type', 'alarm_state'],
|
|
|
components: {
|
|
|
+ Tag,
|
|
|
BlockTable,
|
|
|
DeviceWaring,
|
|
|
Block,
|
|
@@ -130,6 +138,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ ALARM_STATE,
|
|
|
areaTag: [],
|
|
|
defArea: {},
|
|
|
dateType: { val: 'day' },
|
|
@@ -138,30 +147,9 @@ export default {
|
|
|
xAxis: {
|
|
|
type: 'category',
|
|
|
boundaryGap: false,
|
|
|
- data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月'],
|
|
|
+ data: [],
|
|
|
},
|
|
|
- series: [
|
|
|
- {
|
|
|
- name: '紧急',
|
|
|
- type: 'line',
|
|
|
- data: [122, 142, 111, 134, 90, 30, 110],
|
|
|
- },
|
|
|
- {
|
|
|
- name: '重要',
|
|
|
- type: 'line',
|
|
|
- data: [220, 152, 171, 214, 190, 230, 210],
|
|
|
- },
|
|
|
- {
|
|
|
- name: '次要',
|
|
|
- type: 'line',
|
|
|
- data: [120, 162, 161, 134, 260, 130, 200],
|
|
|
- },
|
|
|
- {
|
|
|
- name: '警告',
|
|
|
- type: 'line',
|
|
|
- data: [20, 182, 131, 144, 130, 140, 90],
|
|
|
- },
|
|
|
- ],
|
|
|
+ series: [],
|
|
|
},
|
|
|
alarmTableData: [
|
|
|
{
|
|
@@ -175,18 +163,7 @@ export default {
|
|
|
date: '2024年6月1日 12:00:00',
|
|
|
},
|
|
|
],
|
|
|
- realTimeTableData: [
|
|
|
- {
|
|
|
- subSystem: '安防',
|
|
|
- devcName: '东围墙50',
|
|
|
- warnDes: '设备故障',
|
|
|
- },
|
|
|
- {
|
|
|
- subSystem: '安防',
|
|
|
- devcName: '东围墙50',
|
|
|
- warnDes: '设备故障',
|
|
|
- },
|
|
|
- ],
|
|
|
+ realTimeTableData: [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -217,7 +194,9 @@ export default {
|
|
|
}
|
|
|
if (item.val === 'day') {
|
|
|
const xaxis = DateTool.getTime(60);
|
|
|
- const { data } = await fetchAlarmIndexDay({ areaCode: this.selectedServiceArea.val });
|
|
|
+ const { data } = await fetchAlarmIndexDay({
|
|
|
+ areaCode: this.selectedServiceArea.val,
|
|
|
+ });
|
|
|
const series = this.toSeries(data, xaxis);
|
|
|
this.devcWarningHis.xAxis.data = xaxis;
|
|
|
this.devcWarningHis.series = series;
|
|
@@ -280,40 +259,33 @@ export default {
|
|
|
},
|
|
|
queryCharts() {
|
|
|
this.onDateTypeSwitch(this.dateType);
|
|
|
- this.getPvList();
|
|
|
+ this.getRealTimeAlarm();
|
|
|
},
|
|
|
- async getPvList() {
|
|
|
+ async getRealTimeAlarm() {
|
|
|
+ let result = [];
|
|
|
const {
|
|
|
- data,
|
|
|
code,
|
|
|
- } = await get('/prod/list/prod/this/day/index', {
|
|
|
- areaCode: this.defArea.val,
|
|
|
+ rows,
|
|
|
+ } = await listAlarmInfo({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ areaCode: this.selectedServiceArea.val,
|
|
|
+ alarmStateList: [
|
|
|
+ ALARM_STATE.new.value, ALARM_STATE.disposing.value,
|
|
|
+ ],
|
|
|
});
|
|
|
- const result = {};
|
|
|
- if (ApiCode.SUCCESS !== code || !data || data.length < 1) {
|
|
|
- return null;
|
|
|
+ if (ApiCode.SUCCESS === code && rows && rows.length > 0) {
|
|
|
+ result = rows;
|
|
|
}
|
|
|
- const xAxis = DateTool.getTime(60);
|
|
|
- data.forEach(item => {
|
|
|
- const {
|
|
|
- elecQuantity,
|
|
|
- timeIndex,
|
|
|
- } = item;
|
|
|
- result[timeIndex] = {
|
|
|
- elecQuantity,
|
|
|
- };
|
|
|
- });
|
|
|
- const chartData = [];
|
|
|
- xAxis.forEach((item, index) => {
|
|
|
- const timeIndex = index + 1;
|
|
|
- if (result[timeIndex]) {
|
|
|
- chartData.push(result[timeIndex].elecQuantity);
|
|
|
- } else {
|
|
|
- chartData.push(0);
|
|
|
- }
|
|
|
+ this.realTimeTableData = result;
|
|
|
+ },
|
|
|
+ async handleCommand(command, data) {
|
|
|
+ debugger
|
|
|
+ await updateAlarmInfo({
|
|
|
+ id: data.id,
|
|
|
+ alarmState: ALARM_STATE[command].value,
|
|
|
});
|
|
|
- this.pvData.xAxis.data = xAxis;
|
|
|
- this.pvData.series[0].data = chartData;
|
|
|
+ await this.getRealTimeAlarm();
|
|
|
},
|
|
|
},
|
|
|
};
|