Merge branch 'master-v32-lushangqing' into 'master'
故障联调 链路节点组件更改 See merge request !293
Showing
2 changed files
with
63 additions
and
18 deletions
1 | -<el-row clas="netLink"> | ||
2 | - <el-col :span="3" v-for="(itemLink,index) in networkMonitorList" class="max-width-134"> | 1 | +<el-row class="netLink margin-bottom-10" v-for="(itemLink,index) in networkMonitorList"> |
2 | + <el-col :span="24" class="flex-div-start margin-bottom-10">{{itemLink.linkName}}</el-col> | ||
3 | + | ||
4 | + <el-col :span="3" v-for="(itemNode,indexNode) in itemLink.nodeData" class="max-width-134"> | ||
3 | <div class="list-step flex-div-start"> | 5 | <div class="list-step flex-div-start"> |
4 | <div class="list-step-top flex-div"> | 6 | <div class="list-step-top flex-div"> |
5 | - <div :class="['step-img-link','flex-div-center',{'isActiveG':itemLink.value==0,'isActiveY':itemLink.value==1}]" style="cursor: default"> | ||
6 | - <i class="icon-step flex-div-center"><img :src="'/vue3/src/assets/images/faultDiagnosis/netLink-icon.png'" alt=""></i> | 7 | + <div :class="['step-img-link','flex-div-center',{'isActiveG':itemNode[0].state==0,'isActiveY':itemNode[0].state==1}]" style="cursor: default"> |
8 | + <i class="icon-step flex-div-center"> | ||
9 | + <img v-if="!itemNode[0].resType" :src="'/vue3/src/assets/images/faultDiagnosis/netLink-icon.png'" alt=""> | ||
10 | + <img v-if="itemNode[0].resType" :src="'/src/style/img/fault/'+itemNode[0].resType+'.png'" alt=""> | ||
11 | + </i> | ||
7 | </div> | 12 | </div> |
8 | - <span v-if="index+1<networkMonitorList.length" :class="['list-line','list-line-netLink',{'isActiveG':itemLink.value==0,'isActiveY':itemLink.value==1}]"></span> | 13 | + <span v-if="itemNode[1] && indexNode+1<itemLink.nodeList.length" :class="['list-line','list-line-netLink',{'isActiveG':itemNode[1].state==0,'isActiveY':itemNode[1].state==1}]"></span> |
9 | </div> | 14 | </div> |
10 | <div class="list-step-name flex-div-start"> | 15 | <div class="list-step-name flex-div-start"> |
11 | - <span class="text-overflow width-100" :title="itemLink.linkName"> | ||
12 | - {{itemLink.linkName}} | 16 | + <span class="text-overflow width-100" :title="itemNode[0].nodeName"> |
17 | + {{itemNode[0].nodeName}} | ||
13 | </span> | 18 | </span> |
14 | <span class="list-line-none"></span> | 19 | <span class="list-line-none"></span> |
15 | </div> | 20 | </div> |
@@ -20,39 +20,61 @@ export default { | @@ -20,39 +20,61 @@ export default { | ||
20 | linkName:'链路1', | 20 | linkName:'链路1', |
21 | linkDesc:'测试链路1', | 21 | linkDesc:'测试链路1', |
22 | nodeList:[{ | 22 | nodeList:[{ |
23 | - name:'节点1', | 23 | + nodeName:'节点1', |
24 | desc:'xxx', | 24 | desc:'xxx', |
25 | + nodeType: "point", | ||
26 | + resType:'ALI_CLOUD_ECS', | ||
25 | state:0 | 27 | state:0 |
26 | },{ | 28 | },{ |
27 | - name:'节点2', | ||
28 | desc:'xxx', | 29 | desc:'xxx', |
30 | + nodeType: "line", | ||
31 | + resType:'ALI_CLOUD_ECS', | ||
29 | state:0 | 32 | state:0 |
30 | },{ | 33 | },{ |
31 | - name:'节点3', | 34 | + nodeName:'节点3', |
32 | desc:'xxx', | 35 | desc:'xxx', |
36 | + nodeType: "point", | ||
37 | + resType:'ALI_CLOUD_ECS', | ||
38 | + state:1 | ||
39 | + },{ | ||
40 | + desc:'xxx', | ||
41 | + nodeType: "line", | ||
42 | + resType:'ALI_CLOUD_ECS', | ||
43 | + state:1 | ||
44 | + },{ | ||
45 | + nodeName:'节点4', | ||
46 | + desc:'xxx', | ||
47 | + nodeType: "point", | ||
48 | + resType:'ALI_CLOUD_ECS', | ||
33 | state:0 | 49 | state:0 |
34 | }] | 50 | }] |
35 | },{ | 51 | },{ |
36 | linkName:'链路2', | 52 | linkName:'链路2', |
37 | linkDesc:'测试链路2', | 53 | linkDesc:'测试链路2', |
38 | nodeList:[{ | 54 | nodeList:[{ |
39 | - name:'节点1', | 55 | + nodeName:'节点1', |
40 | desc:'xxx', | 56 | desc:'xxx', |
41 | - state:0 | 57 | + nodeType: "point", |
58 | + resType:'ALI_CLOUD_ECS', | ||
59 | + state:1 | ||
42 | },{ | 60 | },{ |
43 | - name:'节点2', | ||
44 | desc:'xxx', | 61 | desc:'xxx', |
45 | - state:0 | 62 | + nodeType: "line", |
63 | + resType:'ALI_CLOUD_ECS', | ||
64 | + state:1 | ||
46 | },{ | 65 | },{ |
47 | - name:'节点3', | 66 | + nodeName:'节点3', |
48 | desc:'xxx', | 67 | desc:'xxx', |
68 | + nodeType: "point", | ||
69 | + resType:'ALI_CLOUD_ECS', | ||
49 | state:0 | 70 | state:0 |
50 | }] | 71 | }] |
51 | }]); | 72 | }]); |
52 | 73 | ||
53 | - // Vue.onMounted(() => { | ||
54 | - // getNetLinkList(); | ||
55 | - // }) | 74 | + Vue.onMounted(() => { |
75 | + // getNetLinkList(); | ||
76 | + reNodeData(); | ||
77 | + }) | ||
56 | // Vue.watch(props.itemInfo, (newVal) => { | 78 | // Vue.watch(props.itemInfo, (newVal) => { |
57 | // getNetLinkList() | 79 | // getNetLinkList() |
58 | // }) | 80 | // }) |
@@ -74,10 +96,28 @@ export default { | @@ -74,10 +96,28 @@ export default { | ||
74 | } | 96 | } |
75 | }) | 97 | }) |
76 | } | 98 | } |
99 | + /** | ||
100 | + * 将节点数据结构重新组合成二维数组 | ||
101 | + * <p> | ||
102 | + * 作者: LSQ | ||
103 | + * 时间:2021/12/27 17:10 | ||
104 | + * 获取到链路节点数据之后调用 | ||
105 | + */ | ||
106 | + let reNodeData=()=>{ | ||
107 | + networkMonitorList.value.map((item,index)=>{ | ||
108 | + let arr=[]; | ||
109 | + | ||
110 | + for(let i=0;i<item.nodeList.length;i+=2){ | ||
111 | + arr.push(item.nodeList.slice(i,i+2)) | ||
112 | + } | ||
113 | + item.nodeData=arr; | ||
114 | + }) | ||
115 | + } | ||
77 | 116 | ||
78 | return { | 117 | return { |
79 | getNetLinkList, | 118 | getNetLinkList, |
80 | networkMonitorList, | 119 | networkMonitorList, |
120 | + reNodeData | ||
81 | } | 121 | } |
82 | 122 | ||
83 | } | 123 | } |
-
Please register or login to post a comment