Authored by xwx

故障诊断拨测及npm页面

Showing 19 changed files with 267 additions and 1 deletions
@@ -11,7 +11,18 @@ let getRuleAdvanced = (ruleId) => { @@ -11,7 +11,18 @@ let getRuleAdvanced = (ruleId) => {
11 return get('/api-web/fault/conf/rule/getRuleAdvanced', {ruleId: ruleId}); 11 return get('/api-web/fault/conf/rule/getRuleAdvanced', {ruleId: ruleId});
12 } 12 }
13 13
  14 +/**
  15 + * 诊断报告
  16 + * http://192.168.0.59:3000/project/78/interface/api/3916
  17 + * @param ruleId
  18 + * @returns {Promise<*>}
  19 + */
  20 +let getFaultList = (params) => {
  21 + return get('/api-web/fault/result/tableList', params);
  22 +}
  23 +
14 24
15 export default { 25 export default {
16 - getRuleAdvanced 26 + getRuleAdvanced,
  27 + getFaultList
17 } 28 }
@@ -13,6 +13,9 @@ export default { @@ -13,6 +13,9 @@ export default {
13 actions: { 13 actions: {
14 getRuleAdvanced(context, ruleId) { 14 getRuleAdvanced(context, ruleId) {
15 return faultDiagnosisApi.getRuleAdvanced(ruleId); 15 return faultDiagnosisApi.getRuleAdvanced(ruleId);
  16 + },
  17 + getFaultList(context, params) {
  18 + return faultDiagnosisApi.getFaultList(params);
16 } 19 }
17 } 20 }
18 }; 21 };
  1 +<div class="container" :style="{'height':height+'px','min-height':height+'px'}">
  2 + <div class="cm-card" style="margin: 10px">
  3 + <div class="heard" style="display:flex;padding: 26px 26px 0px 26px">
  4 + <div style="display:flex;"><img src="../src/style/img/dialtest.gif">
  5 + <h3 style="margin-left: 10px">业务拨测</h3></div>
  6 + <div style="flex: 1;text-align: right;display: inline-block;margin-top: 33px;">
  7 + <a style="margin-right: 20px;color: #1E9FFF;cursor:pointer " @click="allCard()">更多</a>
  8 + <a style="color: #1E9FFF;cursor:pointer " @click="closeCard()">收起</a>
  9 + </div>
  10 + </div>
  11 + <el-divider/>
  12 + <div class="content" v-model="dialTest" style="display:flex;padding: 26px 26px 26px 26px;">
  13 + <div style="height: 50px;text-align: left;margin-left: 4%;min-width: 20%;"><a>汇总信息</a></div>
  14 + <div>
  15 + <div style="text-align: left;display: flex;">
  16 + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;">
  17 + <img src="../src/style/img/disRes.png">
  18 + <span style="margin: 0px 6px 0px 6px;width: 95px">诊断业务场景</span>
  19 + <h>{{dialTest && dialTest.diagnosticResources ?dialTest.diagnosticResources:0}}</h>
  20 + </div>
  21 + |
  22 + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;">
  23 + <img src="../src/style/img/disKpi.png">
  24 + <span style="margin: 0px 6px 0px 6px;width: 95px">诊断指标</span>
  25 + <h>{{dialTest && dialTest.diagnosticIndicators ?dialTest.diagnosticIndicators:0}}</h>
  26 + </div>
  27 + |
  28 + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;">
  29 + <img src="../src/style/img/disItem.png">
  30 + <span style="margin: 0px 6px 0px 6px;width: 95px"> 诊断项</span>
  31 + <h>{{dialTest && dialTest.diagnosticItem ?dialTest.diagnosticItem:0}}</h>
  32 + </div>
  33 + </div>
  34 + <div style="text-align: left;display: flex;margin-top: 10px;">
  35 + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: yellowgreen">
  36 + <img src="../src/style/img/success.png">
  37 + <span style="margin: 0px 6px 0px 6px;width: 95px;">正常</span>
  38 + <h style="font-size: 20px">{{dialTest && dialTest.normal ?dialTest.normal:0}}</h>
  39 + </div>
  40 + |
  41 + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: #f8d305">
  42 + <img src="../src/style/img/error.png">
  43 + <span style="margin: 0px 6px 0px 6px;width: 95px;"> 异常</span>
  44 + <h style="font-size: 20px">{{dialTest && dialTest.abnormal ?dialTest.abnormal:0}}</h>
  45 + </div>
  46 + </div>
  47 + </div>
  48 + <div style="display:flex;width: 35%">
  49 + <div>正常占比</div>
  50 + <div class="progress-con">
  51 + <el-progress :text-inside="true" :stroke-width="26" :percentage="dialTest && dialTest.normalProportion?dialTest.normalProportion*100:0"
  52 + color="#64A64C"/>
  53 + </div>
  54 + </div>
  55 + </div>
  56 + <div v-if="cardOpen" style="margin-top:20px;background-color: whitesmoke;display: flex;justify-content: flex-start;flex-wrap: wrap;padding: 26px 26px 0px 26px;">
  57 + <div v-for="item in card" style="width: 14%;overflow: hidden;">
  58 + <div style="width: 100%;min-height: 191px;background: url('../src/style/img/disBiz.png') no-repeat;background-size: 100% 100%;padding-top: 20px;margin-bottom: 26px;box-sizing: border-box;">
  59 + <div :style="{backgroundColor: item.color}"
  60 + style=" width: 100px;height: 100px;border-radius: 100px;-webkit-border-radius: 100px;margin: 0px auto 10px auto;display: flex;align-items: center;color: white;">
  61 + <span>{{item.shortName}}</span>
  62 + </div>
  63 + <p style="margin: -5px 0px 0px 16px;width: 85%;">{{item.taskName}}</p>
  64 + </div>
  65 + </div>
  66 + </div>
  67 + </div>
  68 +</div>
  1 +import store from '/vue3/src/store/index.js';
  2 +
  3 +export default {
  4 + name: 'faultDialTest',
  5 + template: '',
  6 + components: {},
  7 + data() {
  8 + return {}
  9 + },
  10 + setup(props, {attrs, slots, emit}) {
  11 + const {proxy} = Vue.getCurrentInstance();
  12 +
  13 +
  14 + let dialTest = Vue.ref();
  15 + let card = Vue.ref({})
  16 + let cardOpen = Vue.ref(false);
  17 + let allCard = () => {
  18 + cardOpen.value = true;
  19 + }
  20 + let closeCard = () => {
  21 + cardOpen.value = false;
  22 + }
  23 + let getDialtestList = () => {
  24 + let params = {
  25 + faultNo: "GZ202204080012",
  26 + targetType: "dialtest"
  27 + }
  28 +
  29 + store.dispatch('getFaultList', params).then((res) => {
  30 + if (res.data && res.success) {
  31 + dialTest.value = res.data[0];
  32 + card.value = dialTest.value.faultFixInfoList[0];
  33 + }
  34 + }).catch(e => {
  35 + console.log(e);
  36 + })
  37 + }
  38 +
  39 + // 挂载完
  40 + Vue.onMounted(() => {
  41 + getDialtestList();
  42 + })
  43 +
  44 +
  45 + return {
  46 + card,
  47 + allCard,
  48 + closeCard,
  49 + cardOpen,
  50 + dialTest
  51 + }
  52 + }
  53 +}
  1 +<div class="container" :style="{'height':height+'px','max-height':height+'px'}">
  2 + <div class="cm-card" style="margin: 10px">
  3 + <div class="heard" style="display:flex;padding: 26px 26px 0px 26px">
  4 + <div style="display:flex;"><img src="../src/style/img/npm.gif">
  5 + <h3 style="margin-left: 10px">NPM</h3></div>
  6 + <div style="flex: 1;text-align: right;display: inline-block;margin-top: 33px;">
  7 + <a style="margin-right: 20px;color: #1E9FFF;cursor:pointer " @click="openNpmCard()">更多</a>
  8 + <a style="color: #1E9FFF;cursor:pointer " @click="closeNpmCard()">收起</a>
  9 + </div>
  10 + </div>
  11 + <el-divider/>
  12 + <div class="content" v-model="dialTest" style="display:flex;padding: 26px 26px 26px 26px;">
  13 + <div style="height: 50px;text-align: left;margin-left: 4%;min-width: 20%;"><a>汇总信息</a></div>
  14 + <div>
  15 + <div style="text-align: left;display: flex;">
  16 + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;">
  17 + <img src="../src/style/img/npmLink.png">
  18 + <span style="margin: 0px 6px 0px 6px;width: 95px">诊断链路场景</span>
  19 + <h>{{dialTest && dialTest.diagnosticResources ?dialTest.diagnosticResources:0}}</h>
  20 + </div>
  21 + |
  22 + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;">
  23 + <img src="../src/style/img/disKpi.png">
  24 + <span style="margin: 0px 6px 0px 6px;width: 95px">诊断指标</span>
  25 + <h>{{dialTest && dialTest.diagnosticIndicators ?dialTest.diagnosticIndicators:0}}</h>
  26 + </div>
  27 + |
  28 + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;">
  29 + <img src="../src/style/img/disItem.png">
  30 + <span style="margin: 0px 6px 0px 6px;width: 95px"> 诊断项</span>
  31 + <h>{{dialTest && dialTest.diagnosticItem ?dialTest.diagnosticItem:0}}</h>
  32 + </div>
  33 + </div>
  34 + <div style="text-align: left;display: flex;margin-top: 10px;">
  35 + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: yellowgreen">
  36 + <img src="../src/style/img/success.png">
  37 + <span style="margin: 0px 6px 0px 6px;width: 95px;">正常</span>
  38 + <h style="font-size: 20px">{{dialTest && dialTest.normal ?dialTest.normal:0}}</h>
  39 + </div>
  40 + |
  41 + <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: #f8d305">
  42 + <img src="../src/style/img/error.png">
  43 + <span style="margin: 0px 6px 0px 6px;width: 95px;"> 异常</span>
  44 + <h style="font-size: 20px">{{dialTest && dialTest.abnormal ?dialTest.abnormal:0}}</h>
  45 + </div>
  46 + </div>
  47 + </div>
  48 + <div style="display:flex;width: 35%">
  49 + <div>正常占比</div>
  50 + <div class="progress-con">
  51 + <el-progress :text-inside="true" :stroke-width="26"
  52 + :percentage="dialTest && dialTest.normalProportion ? dialTest.normalProportion*100 : 0"
  53 + color="#64A64C"/>
  54 + </div>
  55 + </div>
  56 + </div>
  57 + <div v-if="cardOpen"
  58 + style="margin-top:20px;background-color: whitesmoke;display: flex;justify-content: flex-start;flex-wrap: wrap;padding: 26px 26px 0px 26px;">
  59 + <div v-for="item in card" style="width: 25%;overflow: hidden;">
  60 + <div style="width: 100%;min-height: 184px;background: url('../src/style/img/npmCard.png') no-repeat;background-size: 100% 100%;padding-top: 20px;margin-bottom: 26px;box-sizing: border-box;">
  61 + <p style="width: 85%;margin-left: -40px">{{item[0].streamName}}</p>
  62 + <div style="margin-top: 47px;">
  63 + <p style="width: 85%;text-align: left;padding-left: 50px;">{{item[1].kpiName}}<h
  64 + style="margin-left: 6px;text-decoration: underline">{{item[1].diagnosisResult}}</h></p>
  65 + </div>
  66 + <div style="display: flex;text-align: left;margin-top: -17px;margin-left: 50px;">
  67 + <p style="width: 50%;">{{item[2].kpiName}}<h style="margin-left: 6px;text-decoration: underline"
  68 + :style="{color: item[2].color}">{{item[2].diagnosisResult}}%</h>
  69 + </p>
  70 + <p style="width: 50%;">{{item[0].kpiName}}<h style="margin-left: 6px;text-decoration: underline"
  71 + :style="{color: item[0].color}">{{item[0].diagnosisResult}}%</h>
  72 + </p>
  73 + </div>
  74 + </div>
  75 + </div>
  76 + </div>
  77 + </div>
  78 +</div>
  1 +import store from '/vue3/src/store/index.js';
  2 +
  3 +export default {
  4 + name: 'npm',
  5 + template: '',
  6 + components: {},
  7 + data() {
  8 + return {}
  9 + },
  10 + setup(props, {attrs, slots, emit}) {
  11 + const {proxy} = Vue.getCurrentInstance();
  12 +
  13 +
  14 + let dialTest = Vue.ref();
  15 + let card = Vue.ref({})
  16 + let cardOpen = Vue.ref(false);
  17 + let openNpmCard = () => {
  18 + cardOpen.value = true;
  19 + }
  20 + let closeNpmCard = () => {
  21 + cardOpen.value = false;
  22 + }
  23 + let getNpmList = () => {
  24 + let params = {
  25 + faultNo: "GZ202204080012",
  26 + targetType: "npm"
  27 + }
  28 +
  29 + store.dispatch('getFaultList', params).then((res) => {
  30 + if (res.data && res.success) {
  31 + dialTest.value = res.data[0];
  32 + card.value = dialTest.value.faultFixInfoList;
  33 + }
  34 + }).catch(e => {
  35 + console.log(e);
  36 + })
  37 + }
  38 +
  39 + // 挂载完
  40 + Vue.onMounted(() => {
  41 + getNpmList();
  42 + })
  43 +
  44 +
  45 + return {
  46 + card,
  47 + openNpmCard,
  48 + closeNpmCard,
  49 + cardOpen,
  50 + dialTest
  51 + }
  52 + }
  53 +}