Showing
5 changed files
with
143 additions
and
30 deletions
@@ -3,8 +3,8 @@ | @@ -3,8 +3,8 @@ | ||
3 | <img src="../src/style/img/fault/dialtest.gif"> | 3 | <img src="../src/style/img/fault/dialtest.gif"> |
4 | <h3 style="margin-left: 10px;color: #666666;font-size: 18px">业务拨测</h3> | 4 | <h3 style="margin-left: 10px;color: #666666;font-size: 18px">业务拨测</h3> |
5 | <div style="width: calc(100% - 200px);line-height: 54px" class="align-right"> | 5 | <div style="width: calc(100% - 200px);line-height: 54px" class="align-right"> |
6 | - <a class="m-r-20" @click="">更多</a> | ||
7 | - <a v-model="cardName" @click="openOrCloseDialtest(dialTest.faultFixInfoList)">{{cardName}}</a> | 6 | + <a class="m-r-20" v-if="card && card.length > 0" @click="openMoreDialog">更多</a> |
7 | + <a v-model="cardName" v-if="card && card.length > 0" @click="openOrCloseDialtest(dialTest.faultFixInfoList)">{{cardName}}</a> | ||
8 | </div> | 8 | </div> |
9 | </div> | 9 | </div> |
10 | <el-divider/> | 10 | <el-divider/> |
@@ -15,32 +15,33 @@ | @@ -15,32 +15,33 @@ | ||
15 | <div style="width: 230px;margin-left: 20px;display: flex;align-self: center;color: #666666;font-size: 16px"> | 15 | <div style="width: 230px;margin-left: 20px;display: flex;align-self: center;color: #666666;font-size: 16px"> |
16 | <img src="../src/style/img/fault/disRes.png"> | 16 | <img src="../src/style/img/fault/disRes.png"> |
17 | <span style="margin: 0px 6px 0px 6px;width: 105px">诊断业务场景</span> | 17 | <span style="margin: 0px 6px 0px 6px;width: 105px">诊断业务场景</span> |
18 | - <h>{{dialTest && dialTest.diagnosticResources ?dialTest.diagnosticResources:0}}</h> | 18 | + |
19 | + <h class="text-link">{{getFaultItemValue(dialTest,'diagnosticResources')}}</h> | ||
19 | </div> | 20 | </div> |
20 | | | 21 | | |
21 | <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: #666666;font-size: 16px"> | 22 | <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: #666666;font-size: 16px"> |
22 | <img src="../src/style/img/fault/disKpi.png"> | 23 | <img src="../src/style/img/fault/disKpi.png"> |
23 | <span style="margin: 0px 6px 0px 6px;width: 105px">诊断指标</span> | 24 | <span style="margin: 0px 6px 0px 6px;width: 105px">诊断指标</span> |
24 | - <h>{{dialTest && dialTest.diagnosticIndicators ?dialTest.diagnosticIndicators:0}}</h> | 25 | + <h class="text-link">{{ getFaultItemValue(dialTest,'diagnosticIndicators') }}</h> |
25 | </div> | 26 | </div> |
26 | | | 27 | | |
27 | <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: #666666;font-size: 16px"> | 28 | <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: #666666;font-size: 16px"> |
28 | <img src="../src/style/img/fault/disItem.png"> | 29 | <img src="../src/style/img/fault/disItem.png"> |
29 | <span style="margin: 0px 6px 0px 6px;width: 105px"> 诊断项</span> | 30 | <span style="margin: 0px 6px 0px 6px;width: 105px"> 诊断项</span> |
30 | - <h>{{dialTest && dialTest.diagnosticItem ?dialTest.diagnosticItem:0}}</h> | 31 | + <h class="text-link">{{ getFaultItemValue(dialTest,'diagnosticItem') }}</h> |
31 | </div> | 32 | </div> |
32 | </div> | 33 | </div> |
33 | <div style="text-align: left;display: flex;margin-top: 10px;"> | 34 | <div style="text-align: left;display: flex;margin-top: 10px;"> |
34 | <div style="width: 230px;margin-left: 20px;display: flex;align-self: center;color: #75af49;"> | 35 | <div style="width: 230px;margin-left: 20px;display: flex;align-self: center;color: #75af49;"> |
35 | <img src="../src/style/img/fault/success.png" style="width: 22px;height: 22px;"> | 36 | <img src="../src/style/img/fault/success.png" style="width: 22px;height: 22px;"> |
36 | <span style="margin: 0px 6px 0px 6px;width: 105px;font-size: 16px">正常</span> | 37 | <span style="margin: 0px 6px 0px 6px;width: 105px;font-size: 16px">正常</span> |
37 | - <h style="font-size: 24px">{{dialTest && dialTest.normal ?dialTest.normal:0}}</h> | 38 | + <h class="text-link" style="font-size: 24px">{{ getFaultItemValue(dialTest,'normal')}}</h> |
38 | </div> | 39 | </div> |
39 | | | 40 | | |
40 | <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: #febb1a;" @click="openAlarm"> | 41 | <div style="width: 200px;margin-left: 20px;display: flex;align-self: center;color: #febb1a;" @click="openAlarm"> |
41 | <img src="../src/style/img/fault/error.png" style="width: 22px;height: 22px;"> | 42 | <img src="../src/style/img/fault/error.png" style="width: 22px;height: 22px;"> |
42 | <span style="margin: 0px 6px 0px 6px;width: 105px;font-size: 16px"> 异常</span> | 43 | <span style="margin: 0px 6px 0px 6px;width: 105px;font-size: 16px"> 异常</span> |
43 | - <h style="font-size: 24px">{{dialTest && dialTest.abnormal ?dialTest.abnormal:0}}</h> | 44 | + <h class="text-link" style="font-size: 24px">{{ getFaultItemValue(dialTest,'abnormal') }}</h> |
44 | </div> | 45 | </div> |
45 | </div> | 46 | </div> |
46 | </div> | 47 | </div> |
@@ -9,12 +9,16 @@ export default { | @@ -9,12 +9,16 @@ export default { | ||
9 | faultNo: { | 9 | faultNo: { |
10 | type: String, | 10 | type: String, |
11 | default: '' | 11 | default: '' |
12 | + }, | ||
13 | + targetType: { | ||
14 | + type: String, | ||
15 | + default: '' | ||
12 | } | 16 | } |
13 | }, | 17 | }, |
14 | data() { | 18 | data() { |
15 | return {} | 19 | return {} |
16 | }, | 20 | }, |
17 | - setup(props, {attrs, slots, emit}) { | 21 | + setup(props, {attrs, slots, emit}) { |
18 | const {proxy} = Vue.getCurrentInstance(); | 22 | const {proxy} = Vue.getCurrentInstance(); |
19 | 23 | ||
20 | let dialTest = Vue.ref(); | 24 | let dialTest = Vue.ref(); |
@@ -24,11 +28,11 @@ export default { | @@ -24,11 +28,11 @@ export default { | ||
24 | let cardName = Vue.ref('展开'); | 28 | let cardName = Vue.ref('展开'); |
25 | let openOrCloseDialtest = (data) => { | 29 | let openOrCloseDialtest = (data) => { |
26 | cardOpen.value = !cardOpen.value; | 30 | cardOpen.value = !cardOpen.value; |
27 | - if (cardOpen.value){ | ||
28 | - cardName.value='收起'; | 31 | + if (cardOpen.value) { |
32 | + cardName.value = '收起'; | ||
29 | getDialtestCard(data); | 33 | getDialtestCard(data); |
30 | - }else { | ||
31 | - cardName.value='展开'; | 34 | + } else { |
35 | + cardName.value = '展开'; | ||
32 | } | 36 | } |
33 | } | 37 | } |
34 | 38 | ||
@@ -36,7 +40,7 @@ export default { | @@ -36,7 +40,7 @@ export default { | ||
36 | let getDialtestList = () => { | 40 | let getDialtestList = () => { |
37 | let params = { | 41 | let params = { |
38 | faultNo: props.faultNo, | 42 | faultNo: props.faultNo, |
39 | - targetType: "dialtest" | 43 | + targetType: props.targetType |
40 | } | 44 | } |
41 | 45 | ||
42 | store.dispatch('getFaultList', params).then((res) => { | 46 | store.dispatch('getFaultList', params).then((res) => { |
@@ -50,16 +54,16 @@ export default { | @@ -50,16 +54,16 @@ export default { | ||
50 | } | 54 | } |
51 | let getDialtestCard = (data) => { | 55 | let getDialtestCard = (data) => { |
52 | for (let i = 0; i < data.length; i++) { | 56 | for (let i = 0; i < data.length; i++) { |
53 | - let resItem={ | ||
54 | - shortName:'', | ||
55 | - taskName:'', | ||
56 | - color:'' | 57 | + let resItem = { |
58 | + shortName: '', | ||
59 | + taskName: '', | ||
60 | + color: '' | ||
57 | } | 61 | } |
58 | for (let j = 0; j < data[i].length; j++) { | 62 | for (let j = 0; j < data[i].length; j++) { |
59 | - if (data[i][j].kpiId=='point_succ'){ | ||
60 | - resItem.shortName=data[i][j].shortName; | ||
61 | - resItem.taskName=data[i][j].taskName; | ||
62 | - resItem.color=data[i][j].color; | 63 | + if (data[i][j].kpiId == 'point_succ') { |
64 | + resItem.shortName = data[i][j].shortName; | ||
65 | + resItem.taskName = data[i][j].taskName; | ||
66 | + resItem.color = data[i][j].color; | ||
63 | } | 67 | } |
64 | } | 68 | } |
65 | cardData.value.push(resItem); | 69 | cardData.value.push(resItem); |
@@ -68,12 +72,16 @@ export default { | @@ -68,12 +72,16 @@ export default { | ||
68 | } | 72 | } |
69 | 73 | ||
70 | const openAlarm = () => { | 74 | const openAlarm = () => { |
71 | - service.sendEventAlarmDialog(emit,{ | 75 | + service.sendEventAlarmDialog(emit, { |
72 | faultNo: props.faultNo, | 76 | faultNo: props.faultNo, |
73 | - targetType: "dialtest" | 77 | + targetType: props.targetType |
74 | }); | 78 | }); |
75 | } | 79 | } |
76 | 80 | ||
81 | + const openMoreDialog = () => { | ||
82 | + service.sendEventMoreDialog(emit, proxy.$global, card.value); | ||
83 | + } | ||
84 | + | ||
77 | // 挂载完 | 85 | // 挂载完 |
78 | Vue.onMounted(() => { | 86 | Vue.onMounted(() => { |
79 | getDialtestList(); | 87 | getDialtestList(); |
@@ -87,7 +95,9 @@ export default { | @@ -87,7 +95,9 @@ export default { | ||
87 | dialTest, | 95 | dialTest, |
88 | openAlarm, | 96 | openAlarm, |
89 | getDialtestCard, | 97 | getDialtestCard, |
90 | - cardData | 98 | + cardData, |
99 | + openMoreDialog, | ||
100 | + getFaultItemValue: service.getFaultItemValue | ||
91 | } | 101 | } |
92 | } | 102 | } |
93 | } | 103 | } |
@@ -61,3 +61,21 @@ | @@ -61,3 +61,21 @@ | ||
61 | </div> | 61 | </div> |
62 | </template> | 62 | </template> |
63 | </cm-dialog> | 63 | </cm-dialog> |
64 | + | ||
65 | + | ||
66 | +<!-- 资源明细 --> | ||
67 | +<cm-dialog top="3vh" title="更多" width="80%" :showDialogVisible="moreDialog" | ||
68 | + @hidedialog="showMoreDialog" :showFooter="false"> | ||
69 | + <template v-slot> | ||
70 | + <div> | ||
71 | + <cm-table-page v-if="moreObj.columns.length > 0" :columns="moreObj.columns" | ||
72 | + :dataList="moreObj.data" | ||
73 | + :showIndex="true" | ||
74 | + :showBorder="true" | ||
75 | + :showPage="false" | ||
76 | + :height="500" | ||
77 | + :showTools="false"> | ||
78 | + </cm-table-page> | ||
79 | + </div> | ||
80 | + </template> | ||
81 | +</cm-dialog> |
@@ -90,6 +90,18 @@ export default { | @@ -90,6 +90,18 @@ export default { | ||
90 | faultDetailDetailInfo.value.faultNo = proxy.$global.getQueryVariable('faultNo') | 90 | faultDetailDetailInfo.value.faultNo = proxy.$global.getQueryVariable('faultNo') |
91 | faultDetailDetailInfo.value.configId = proxy.$global.getQueryVariable('configId') | 91 | faultDetailDetailInfo.value.configId = proxy.$global.getQueryVariable('configId') |
92 | 92 | ||
93 | + | ||
94 | + let moreDialog = Vue.ref(false); | ||
95 | + let moreObj = Vue.ref({ | ||
96 | + columns: [], | ||
97 | + data: [] | ||
98 | + }); | ||
99 | + const showMoreDialog = (flg, obj) => { | ||
100 | + moreDialog.value = flg; | ||
101 | + | ||
102 | + moreObj.value = obj; | ||
103 | + } | ||
104 | + | ||
93 | /** | 105 | /** |
94 | * 设置弹框信息 | 106 | * 设置弹框信息 |
95 | * @param row | 107 | * @param row |
@@ -131,16 +143,20 @@ export default { | @@ -131,16 +143,20 @@ export default { | ||
131 | } | 143 | } |
132 | 144 | ||
133 | // 展示弹框 | 145 | // 展示弹框 |
134 | - const openDialog = (type, {faultNo, targetType, resId, kpiId, flag}) => { | ||
135 | - if (type == 'alarm') { | 146 | + const openDialog = (type, {faultNo, targetType, resId, kpiId, flag}, obj) => { |
147 | + if (type === 'alarm') { | ||
136 | service.openAlarmDialog(proxy, faultNo, targetType, resId, kpiId, flag); | 148 | service.openAlarmDialog(proxy, faultNo, targetType, resId, kpiId, flag); |
137 | - } else if (type == 'resList') { | 149 | + } else if (type === 'resList') { |
138 | service.handleClick(proxy, faultNo, targetType, resId, kpiId, flag); | 150 | service.handleClick(proxy, faultNo, targetType, resId, kpiId, flag); |
139 | - } else if (type == 'line') { | 151 | + } else if (type === 'line') { |
140 | service.openLine(proxy, faultNo, targetType, resId, kpiId, flag); | 152 | service.openLine(proxy, faultNo, targetType, resId, kpiId, flag); |
153 | + } else if (type === 'more') { | ||
154 | + // 展示更多 | ||
155 | + showMoreDialog(true, obj); | ||
141 | } | 156 | } |
142 | } | 157 | } |
143 | 158 | ||
159 | + | ||
144 | Vue.onMounted(() => { | 160 | Vue.onMounted(() => { |
145 | settingDetail(); | 161 | settingDetail(); |
146 | }); | 162 | }); |
@@ -149,6 +165,9 @@ export default { | @@ -149,6 +165,9 @@ export default { | ||
149 | faultDetailDialogTitle, | 165 | faultDetailDialogTitle, |
150 | faultDetailDetailInfo, | 166 | faultDetailDetailInfo, |
151 | openDialog, | 167 | openDialog, |
168 | + moreObj, | ||
169 | + moreDialog, | ||
170 | + showMoreDialog, | ||
152 | ...service | 171 | ...service |
153 | } | 172 | } |
154 | } | 173 | } |
@@ -258,20 +258,85 @@ const faultEvent = () => { | @@ -258,20 +258,85 @@ const faultEvent = () => { | ||
258 | emit('openDialog', 'line', getParams(params)); | 258 | emit('openDialog', 'line', getParams(params)); |
259 | } | 259 | } |
260 | 260 | ||
261 | + /** | ||
262 | + * 更多弹框 | ||
263 | + * @param emit | ||
264 | + * @param global | ||
265 | + * @param arr [[{指标对象},{指标对象},....].[{指标对象},{指标对象},....]] | ||
266 | + */ | ||
267 | + const sendEventMoreDialog = (emit, global, arr, option) => { | ||
268 | + if (!arr || arr.length == 0) { | ||
269 | + global.showMsg("暂无数据!", "warning"); | ||
270 | + return; | ||
271 | + } | ||
272 | + | ||
273 | + var obj = { | ||
274 | + columns: [{ | ||
275 | + prop: 'shortName', | ||
276 | + width: 120, | ||
277 | + label: '名称', | ||
278 | + }], | ||
279 | + data: [] | ||
280 | + } | ||
281 | + | ||
282 | + arr.forEach(function (list) { | ||
283 | + list.forEach(function (listItem) { | ||
284 | + var dataItem = {}; | ||
285 | + var kpiId = listItem.kpiId; | ||
286 | + var kpiName = listItem.kpiName; | ||
287 | + var val = listItem.diagnosisResult; | ||
288 | + | ||
289 | + if (obj.columns.length == 0) { | ||
290 | + obj.columns.push({ | ||
291 | + prop: kpiId, | ||
292 | + label: kpiName, | ||
293 | + }); | ||
294 | + } | ||
295 | + | ||
296 | + dataItem[kpiId] = val; | ||
297 | + dataItem['shortName'] = listItem.shortName; | ||
298 | + | ||
299 | + obj.data.push(dataItem); | ||
300 | + }); | ||
301 | + }) | ||
302 | + | ||
303 | + emit('openDialog', 'more', {}, obj); | ||
304 | + } | ||
305 | + | ||
261 | return { | 306 | return { |
262 | sendEventAlarmDialog, | 307 | sendEventAlarmDialog, |
263 | sendEventResListDialog, | 308 | sendEventResListDialog, |
264 | - sendEventLineDialog | 309 | + sendEventLineDialog, |
310 | + sendEventMoreDialog | ||
311 | + | ||
312 | + } | ||
313 | + | ||
314 | +} | ||
315 | + | ||
316 | +const getFaultItemValue = (obj, key, defaultVal) => { | ||
317 | + | ||
318 | + if (!defaultVal) { | ||
319 | + defaultVal = 0; | ||
320 | + } | ||
321 | + | ||
322 | + if(!obj){ | ||
323 | + return defaultVal; | ||
324 | + } | ||
265 | 325 | ||
326 | + var num = obj[key]; | ||
327 | + if (!isNaN(num)) { | ||
328 | + return num; | ||
266 | } | 329 | } |
267 | 330 | ||
331 | + return defaultVal; | ||
268 | } | 332 | } |
269 | 333 | ||
270 | const service = { | 334 | const service = { |
271 | ...lineService(), | 335 | ...lineService(), |
272 | ...alarmService(), | 336 | ...alarmService(), |
273 | ...resListService(), | 337 | ...resListService(), |
274 | - ...faultEvent() | 338 | + ...faultEvent(), |
339 | + getFaultItemValue | ||
275 | } | 340 | } |
276 | 341 | ||
277 | export default service | 342 | export default service |
-
Please register or login to post a comment