|
@@ -29,9 +29,13 @@
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
+ <!-- <VueUiXy :dataset="dataset" :config="config" /> -->
|
|
<el-row :gutter="15" class="home-card-two mb15">
|
|
<el-row :gutter="15" class="home-card-two mb15">
|
|
<el-col :xs="24" :sm="14" :md="14" :lg="16" :xl="16">
|
|
<el-col :xs="24" :sm="14" :md="14" :lg="16" :xl="16">
|
|
<div class="home-card-item chart">
|
|
<div class="home-card-item chart">
|
|
|
|
+ <!-- <div class="home-card-item-title">
|
|
|
|
+ <span>设备消息</span>
|
|
|
|
+ </div> -->
|
|
<div style="height: 100%" ref="homeLineRef"></div>
|
|
<div style="height: 100%" ref="homeLineRef"></div>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -52,10 +56,10 @@
|
|
<el-table-column label="ID" align="center" prop="id" width="100" v-col="'ID'" />
|
|
<el-table-column label="ID" align="center" prop="id" width="100" v-col="'ID'" />
|
|
<el-table-column label="告警类型" width="120" prop="type" align="center" show-overflow-tooltip v-col="'type'">
|
|
<el-table-column label="告警类型" width="120" prop="type" align="center" show-overflow-tooltip v-col="'type'">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <span v-if="scope.row.type == 1">规则告警</span>
|
|
|
|
- <span v-else-if="scope.row.type == 2">设备自主告警</span>
|
|
|
|
- <span v-else-if="scope.row.type == 3">规侧告警升级</span>
|
|
|
|
- <span v-else>设备自主告警</span>
|
|
|
|
|
|
+ <span v-if="scope.row.type == 1">规则告警</span>
|
|
|
|
+ <span v-else-if="scope.row.type == 2">设备自主告警</span>
|
|
|
|
+ <span v-else-if="scope.row.type == 3">规侧告警升级</span>
|
|
|
|
+ <span v-else>设备自主告警</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="规则级别" width="120" align="center" prop="alarmLevel.name" show-overflow-tooltip v-col="'alarmLevel'" />
|
|
<el-table-column label="规则级别" width="120" align="center" prop="alarmLevel.name" show-overflow-tooltip v-col="'alarmLevel'" />
|
|
@@ -91,6 +95,9 @@ import { toRefs, reactive, defineComponent, onMounted, ref, watch, nextTick, onA
|
|
import * as echarts from 'echarts';
|
|
import * as echarts from 'echarts';
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
import { useStore } from '/@/store/index';
|
|
import { useStore } from '/@/store/index';
|
|
|
|
+import { VueUiXy } from "vue-data-ui";
|
|
|
|
+import "vue-data-ui/style.css";
|
|
|
|
+import { getLineData } from "/@/utils/dataUiOptions";
|
|
|
|
|
|
import api from '/@/api/datahub';
|
|
import api from '/@/api/datahub';
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
@@ -107,10 +114,20 @@ let global: any = {
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: 'home',
|
|
name: 'home',
|
|
- components: { EditDic, DetailDic },
|
|
|
|
|
|
+ components: { EditDic, DetailDic, VueUiXy },
|
|
setup() {
|
|
setup() {
|
|
// 页面是显示状态
|
|
// 页面是显示状态
|
|
let isActice = true
|
|
let isActice = true
|
|
|
|
+ const config = ref({
|
|
|
|
+ type: "line",
|
|
|
|
+ style: {
|
|
|
|
+ maxHeight: 250,
|
|
|
|
+ },
|
|
|
|
+ height: 250,
|
|
|
|
+ width: 1000,
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ const dataset = ref<any[]>([]);
|
|
|
|
|
|
onUnmounted(() => {
|
|
onUnmounted(() => {
|
|
isActice = false
|
|
isActice = false
|
|
@@ -450,6 +467,19 @@ export default defineComponent({
|
|
state.lineChartMsgTotalData = msgArr.map((item: any) => item.Value)
|
|
state.lineChartMsgTotalData = msgArr.map((item: any) => item.Value)
|
|
state.lineChartXAxisData = msgArr.map((item: any) => item.Title)
|
|
state.lineChartXAxisData = msgArr.map((item: any) => item.Title)
|
|
state.lineChartAlarmTotalData = alarmArr.map((item: any) => item.Value)
|
|
state.lineChartAlarmTotalData = alarmArr.map((item: any) => item.Value)
|
|
|
|
+
|
|
|
|
+ const chartData = getLineData({
|
|
|
|
+ xAxis: msgArr.map((item: any) => item.Title),
|
|
|
|
+ legend: ['消息量', '预警量'],
|
|
|
|
+ datas: [
|
|
|
|
+ msgArr.map((item: any) => item.Value),
|
|
|
|
+ alarmArr.map((item: any) => item.Value)
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ config.value = chartData.config
|
|
|
|
+ dataset.value = chartData.dataset
|
|
|
|
+
|
|
}).finally(() => loopRquest(getDeviceDataCount, 60000))
|
|
}).finally(() => loopRquest(getDeviceDataCount, 60000))
|
|
}
|
|
}
|
|
|
|
|
|
@@ -604,6 +634,8 @@ export default defineComponent({
|
|
);
|
|
);
|
|
return {
|
|
return {
|
|
homeLineRef,
|
|
homeLineRef,
|
|
|
|
+ config,
|
|
|
|
+ dataset,
|
|
homePieRef,
|
|
homePieRef,
|
|
homeBarRef,
|
|
homeBarRef,
|
|
detailRef,
|
|
detailRef,
|