Authored by wangtao

故障调整

... ... @@ -3,8 +3,8 @@
<img src="../src/style/img/fault/dialtest.gif">
<h3 style="margin-left: 10px;color: #666666;font-size: 18px">业务拨测</h3>
<div style="width: calc(100% - 200px);line-height: 54px" class="align-right">
<a class="m-r-20" @click="">更多</a>
<a v-model="cardName" @click="openOrCloseDialtest(dialTest.faultFixInfoList)">{{cardName}}</a>
<a class="m-r-20" v-if="card && card.length > 0" @click="openMoreDialog">更多</a>
<a v-model="cardName" v-if="card && card.length > 0" @click="openOrCloseDialtest(dialTest.faultFixInfoList)">{{cardName}}</a>
</div>
</div>
<el-divider/>
... ... @@ -15,32 +15,33 @@
<div style="width: 230px;margin-left: 20px;display: flex;align-self: center;color: #666666;font-size: 16px">
<img src="../src/style/img/fault/disRes.png">
<span style="margin: 0px 6px 0px 6px;width: 105px">诊断业务场景</span>
<h>{{dialTest && dialTest.diagnosticResources ?dialTest.diagnosticResources:0}}</h>
<h class="text-link">{{getFaultItemValue(dialTest,'diagnosticResources')}}</h>
</div>
|
<div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: #666666;font-size: 16px">
<img src="../src/style/img/fault/disKpi.png">
<span style="margin: 0px 6px 0px 6px;width: 105px">诊断指标</span>
<h>{{dialTest && dialTest.diagnosticIndicators ?dialTest.diagnosticIndicators:0}}</h>
<h class="text-link">{{ getFaultItemValue(dialTest,'diagnosticIndicators') }}</h>
</div>
|
<div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: #666666;font-size: 16px">
<img src="../src/style/img/fault/disItem.png">
<span style="margin: 0px 6px 0px 6px;width: 105px"> 诊断项</span>
<h>{{dialTest && dialTest.diagnosticItem ?dialTest.diagnosticItem:0}}</h>
<h class="text-link">{{ getFaultItemValue(dialTest,'diagnosticItem') }}</h>
</div>
</div>
<div style="text-align: left;display: flex;margin-top: 10px;">
<div style="width: 230px;margin-left: 20px;display: flex;align-self: center;color: #75af49;">
<img src="../src/style/img/fault/success.png" style="width: 22px;height: 22px;">
<span style="margin: 0px 6px 0px 6px;width: 105px;font-size: 16px">正常</span>
<h style="font-size: 24px">{{dialTest && dialTest.normal ?dialTest.normal:0}}</h>
<h class="text-link" style="font-size: 24px">{{ getFaultItemValue(dialTest,'normal')}}</h>
</div>
|
<div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: #febb1a;" @click="openAlarm">
<img src="../src/style/img/fault/error.png" style="width: 22px;height: 22px;">
<span style="margin: 0px 6px 0px 6px;width: 105px;font-size: 16px"> 异常</span>
<h style="font-size: 24px">{{dialTest && dialTest.abnormal ?dialTest.abnormal:0}}</h>
<h class="text-link" style="font-size: 24px">{{ getFaultItemValue(dialTest,'abnormal') }}</h>
</div>
</div>
</div>
... ...
... ... @@ -9,12 +9,16 @@ export default {
faultNo: {
type: String,
default: ''
},
targetType: {
type: String,
default: ''
}
},
data() {
return {}
},
setup(props, {attrs, slots, emit}) {
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
let dialTest = Vue.ref();
... ... @@ -24,11 +28,11 @@ export default {
let cardName = Vue.ref('展开');
let openOrCloseDialtest = (data) => {
cardOpen.value = !cardOpen.value;
if (cardOpen.value){
cardName.value='收起';
if (cardOpen.value) {
cardName.value = '收起';
getDialtestCard(data);
}else {
cardName.value='展开';
} else {
cardName.value = '展开';
}
}
... ... @@ -36,7 +40,7 @@ export default {
let getDialtestList = () => {
let params = {
faultNo: props.faultNo,
targetType: "dialtest"
targetType: props.targetType
}
store.dispatch('getFaultList', params).then((res) => {
... ... @@ -50,16 +54,16 @@ export default {
}
let getDialtestCard = (data) => {
for (let i = 0; i < data.length; i++) {
let resItem={
shortName:'',
taskName:'',
color:''
let resItem = {
shortName: '',
taskName: '',
color: ''
}
for (let j = 0; j < data[i].length; j++) {
if (data[i][j].kpiId=='point_succ'){
resItem.shortName=data[i][j].shortName;
resItem.taskName=data[i][j].taskName;
resItem.color=data[i][j].color;
if (data[i][j].kpiId == 'point_succ') {
resItem.shortName = data[i][j].shortName;
resItem.taskName = data[i][j].taskName;
resItem.color = data[i][j].color;
}
}
cardData.value.push(resItem);
... ... @@ -68,12 +72,16 @@ export default {
}
const openAlarm = () => {
service.sendEventAlarmDialog(emit,{
service.sendEventAlarmDialog(emit, {
faultNo: props.faultNo,
targetType: "dialtest"
targetType: props.targetType
});
}
const openMoreDialog = () => {
service.sendEventMoreDialog(emit, proxy.$global, card.value);
}
// 挂载完
Vue.onMounted(() => {
getDialtestList();
... ... @@ -87,7 +95,9 @@ export default {
dialTest,
openAlarm,
getDialtestCard,
cardData
cardData,
openMoreDialog,
getFaultItemValue: service.getFaultItemValue
}
}
}
... ...
... ... @@ -61,3 +61,21 @@
</div>
</template>
</cm-dialog>
<!-- 资源明细 -->
<cm-dialog top="3vh" title="更多" width="80%" :showDialogVisible="moreDialog"
@hidedialog="showMoreDialog" :showFooter="false">
<template v-slot>
<div>
<cm-table-page v-if="moreObj.columns.length > 0" :columns="moreObj.columns"
:dataList="moreObj.data"
:showIndex="true"
:showBorder="true"
:showPage="false"
:height="500"
:showTools="false">
</cm-table-page>
</div>
</template>
</cm-dialog>
... ...
... ... @@ -90,6 +90,18 @@ export default {
faultDetailDetailInfo.value.faultNo = proxy.$global.getQueryVariable('faultNo')
faultDetailDetailInfo.value.configId = proxy.$global.getQueryVariable('configId')
let moreDialog = Vue.ref(false);
let moreObj = Vue.ref({
columns: [],
data: []
});
const showMoreDialog = (flg, obj) => {
moreDialog.value = flg;
moreObj.value = obj;
}
/**
* 设置弹框信息
* @param row
... ... @@ -131,16 +143,20 @@ export default {
}
// 展示弹框
const openDialog = (type, {faultNo, targetType, resId, kpiId, flag}) => {
if (type == 'alarm') {
const openDialog = (type, {faultNo, targetType, resId, kpiId, flag}, obj) => {
if (type === 'alarm') {
service.openAlarmDialog(proxy, faultNo, targetType, resId, kpiId, flag);
} else if (type == 'resList') {
} else if (type === 'resList') {
service.handleClick(proxy, faultNo, targetType, resId, kpiId, flag);
} else if (type == 'line') {
} else if (type === 'line') {
service.openLine(proxy, faultNo, targetType, resId, kpiId, flag);
} else if (type === 'more') {
// 展示更多
showMoreDialog(true, obj);
}
}
Vue.onMounted(() => {
settingDetail();
});
... ... @@ -149,6 +165,9 @@ export default {
faultDetailDialogTitle,
faultDetailDetailInfo,
openDialog,
moreObj,
moreDialog,
showMoreDialog,
...service
}
}
... ...
... ... @@ -258,20 +258,85 @@ const faultEvent = () => {
emit('openDialog', 'line', getParams(params));
}
/**
* 更多弹框
* @param emit
* @param global
* @param arr [[{指标对象},{指标对象},....].[{指标对象},{指标对象},....]]
*/
const sendEventMoreDialog = (emit, global, arr, option) => {
if (!arr || arr.length == 0) {
global.showMsg("暂无数据!", "warning");
return;
}
var obj = {
columns: [{
prop: 'shortName',
width: 120,
label: '名称',
}],
data: []
}
arr.forEach(function (list) {
list.forEach(function (listItem) {
var dataItem = {};
var kpiId = listItem.kpiId;
var kpiName = listItem.kpiName;
var val = listItem.diagnosisResult;
if (obj.columns.length == 0) {
obj.columns.push({
prop: kpiId,
label: kpiName,
});
}
dataItem[kpiId] = val;
dataItem['shortName'] = listItem.shortName;
obj.data.push(dataItem);
});
})
emit('openDialog', 'more', {}, obj);
}
return {
sendEventAlarmDialog,
sendEventResListDialog,
sendEventLineDialog
sendEventLineDialog,
sendEventMoreDialog
}
}
const getFaultItemValue = (obj, key, defaultVal) => {
if (!defaultVal) {
defaultVal = 0;
}
if(!obj){
return defaultVal;
}
var num = obj[key];
if (!isNaN(num)) {
return num;
}
return defaultVal;
}
const service = {
...lineService(),
...alarmService(),
...resListService(),
...faultEvent()
...faultEvent(),
getFaultItemValue
}
export default service
... ...