|
@@ -34,11 +34,24 @@
|
|
|
</el-card>
|
|
</el-card>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 添加或修改应用程序管理对话框 -->
|
|
|
|
|
+ <el-dialog :title="title" v-model="open" width="800px" append-to-body>
|
|
|
|
|
+ <el-table v-loading="loading" :data="recordList" border style="height:600px;overflow-y: auto;">
|
|
|
|
|
+ <el-table-column label="序号" align="center" width="120">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <span>{{ scope.$index+1}}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="指标名称" align="left" prop="name"/>
|
|
|
|
|
+ <el-table-column label="告警数量" align="center" prop="num" width="120"/>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup name="Record">
|
|
<script setup name="Record">
|
|
|
-import {getBizType,getBizObj} from "@/api/alarm/record";
|
|
|
|
|
|
|
+import {getBizObj, getBizType, getMetrics} from "@/api/alarm/record";
|
|
|
import {useRouter} from "vue-router";
|
|
import {useRouter} from "vue-router";
|
|
|
import * as echarts from 'echarts'
|
|
import * as echarts from 'echarts'
|
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
@@ -50,6 +63,7 @@ const {biz_type} = proxy.useDict('biz_type');
|
|
|
const recordList = ref([]);
|
|
const recordList = ref([]);
|
|
|
const loading = ref(true);
|
|
const loading = ref(true);
|
|
|
const showSearch = ref(true);
|
|
const showSearch = ref(true);
|
|
|
|
|
+const open = ref(false);
|
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
|
const title = ref("");
|
|
const title = ref("");
|
|
|
const chartType = ref();
|
|
const chartType = ref();
|
|
@@ -62,7 +76,8 @@ const data = reactive({
|
|
|
queryParams: {
|
|
queryParams: {
|
|
|
start: null,
|
|
start: null,
|
|
|
end: null,
|
|
end: null,
|
|
|
- type:null
|
|
|
|
|
|
|
+ type: null,
|
|
|
|
|
+ objId: null
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -80,9 +95,9 @@ function initChart(res) {
|
|
|
for (const i in res.data) {
|
|
for (const i in res.data) {
|
|
|
let obj = res.data[i]
|
|
let obj = res.data[i]
|
|
|
ydata.push(obj.name);
|
|
ydata.push(obj.name);
|
|
|
- salvProValue.push({id:obj.id,value:obj.num});
|
|
|
|
|
|
|
+ salvProValue.push({id: obj.id, value: obj.num});
|
|
|
if (i == 0) {
|
|
if (i == 0) {
|
|
|
- rightData(obj.id,obj.name);
|
|
|
|
|
|
|
+ rightData(obj.id, obj.name);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
let option = {
|
|
let option = {
|
|
@@ -274,12 +289,13 @@ function initChart(res) {
|
|
|
|
|
|
|
|
myChart.setOption(option);
|
|
myChart.setOption(option);
|
|
|
myChart.on("click", function (param) {
|
|
myChart.on("click", function (param) {
|
|
|
- rightData(param.data.id,param.name);
|
|
|
|
|
|
|
+ rightData(param.data.id, param.name);
|
|
|
// console.error(param,param.data.id,param.data.value,param.name);
|
|
// console.error(param,param.data.id,param.data.value,param.name);
|
|
|
// let url = '/zabbix/zabbix.php?action=map.view&sysmapid=2&kiosk=1&line';
|
|
// let url = '/zabbix/zabbix.php?action=map.view&sysmapid=2&kiosk=1&line';
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-function initChartRight(res,name) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+function initChartRight(res, name) {
|
|
|
const myChart = echarts.init(chartRightType.value);
|
|
const myChart = echarts.init(chartRightType.value);
|
|
|
let colorList = ['#fe8019', '#fec429', '#4a90e2', '#9095a7', '#4cb051', '#ec0019', '#dcb093', '#fe8019', '#fec429', '#4a90e2', '#9095a7', '#4cb051', '#ec0019', '#dcb093'];
|
|
let colorList = ['#fe8019', '#fec429', '#4a90e2', '#9095a7', '#4cb051', '#ec0019', '#dcb093', '#fe8019', '#fec429', '#4a90e2', '#9095a7', '#4cb051', '#ec0019', '#dcb093'];
|
|
|
var ydata = [];
|
|
var ydata = [];
|
|
@@ -287,12 +303,12 @@ function initChartRight(res,name) {
|
|
|
for (const i in res.data) {
|
|
for (const i in res.data) {
|
|
|
let obj = res.data[i]
|
|
let obj = res.data[i]
|
|
|
ydata.push(obj.name);
|
|
ydata.push(obj.name);
|
|
|
- salvProValue.push({id:obj.id,value:obj.num});
|
|
|
|
|
|
|
+ salvProValue.push({id: obj.id, value: obj.num});
|
|
|
}
|
|
}
|
|
|
let option = {
|
|
let option = {
|
|
|
title: {
|
|
title: {
|
|
|
show: true,
|
|
show: true,
|
|
|
- text: name+' 业务组件统计',
|
|
|
|
|
|
|
+ text: name + ' 业务组件统计',
|
|
|
textStyle: {
|
|
textStyle: {
|
|
|
fontFamily: 'PingFangSC-Regular, PingFang SC',
|
|
fontFamily: 'PingFangSC-Regular, PingFang SC',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
@@ -478,18 +494,18 @@ function initChartRight(res,name) {
|
|
|
|
|
|
|
|
myChart.setOption(option);
|
|
myChart.setOption(option);
|
|
|
myChart.on("click", function (param) {
|
|
myChart.on("click", function (param) {
|
|
|
- console.log(param)
|
|
|
|
|
|
|
+ detail(param.data.id, param.name);
|
|
|
// console.error(param,param.data.id,param.data.value,param.name);
|
|
// console.error(param,param.data.id,param.data.value,param.name);
|
|
|
// let url = '/zabbix/zabbix.php?action=map.view&sysmapid=2&kiosk=1&line';
|
|
// let url = '/zabbix/zabbix.php?action=map.view&sysmapid=2&kiosk=1&line';
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-function rightData(type,name){
|
|
|
|
|
- queryParams.value.type=type;
|
|
|
|
|
|
|
+function rightData(type, name) {
|
|
|
|
|
+ queryParams.value.type = type;
|
|
|
getBizObj(queryParams.value).then(response => {
|
|
getBizObj(queryParams.value).then(response => {
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
- initChartRight(response,name);
|
|
|
|
|
|
|
+ initChartRight(response, name);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -507,6 +523,22 @@ function getList() {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+function detail(objId, name) {
|
|
|
|
|
+ open.value = true;
|
|
|
|
|
+ title.value = "[" + name + "]指标风险排名";
|
|
|
|
|
+ loading.value = true;
|
|
|
|
|
+ queryParams.value.objId = objId;
|
|
|
|
|
+ queryParams.value.params = {};
|
|
|
|
|
+ if (null != daterangeAlarmTime && '' != daterangeAlarmTime) {
|
|
|
|
|
+ queryParams.value.start = daterangeAlarmTime.value[0];
|
|
|
|
|
+ queryParams.value.end = daterangeAlarmTime.value[1];
|
|
|
|
|
+ }
|
|
|
|
|
+ getMetrics(queryParams.value).then(response => {
|
|
|
|
|
+ loading.value = false;
|
|
|
|
|
+ recordList.value = response.data;
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
|
function handleQuery() {
|
|
function handleQuery() {
|
|
|
queryParams.value.pageNum = 1;
|
|
queryParams.value.pageNum = 1;
|