Authored by XuHaoJie

Merge branch 'master' of http://113.200.75.45:82/monitor_v3/hg-monitor-web into master-V32-XuHaoJie

@@ -119,7 +119,6 @@ export default { @@ -119,7 +119,6 @@ export default {
119 } 119 }
120 120
121 if(w < max){ 121 if(w < max){
122 - console.log('%');  
123 return max / w * width; 122 return max / w * width;
124 } 123 }
125 } 124 }
@@ -10,8 +10,36 @@ var global = {}; @@ -10,8 +10,36 @@ var global = {};
10 global.layui = window.parent.layui; 10 global.layui = window.parent.layui;
11 11
12 global.common = { 12 global.common = {
  13 +
13 }; 14 };
14 15
  16 +global.message = {
  17 + types:{
  18 + // 数据重复添加
  19 + CODE_DD: `{1}已经存在,请勿重复添加!`,
  20 + CODE_MAX:`{1}数目已达上线,请取消部分类型,再进行提交`,
  21 + CODE_DELETE_CONFIRM:`删除{1}后不可恢复,请谨慎操作!`,
  22 + CODE_ADD:`添加成功`,
  23 + CODE_UPDATE:`修改成功`,
  24 + CODE_DELETE:`删除成功`
  25 + },
  26 + get: function (type, args ) {
  27 + let arr = [];
  28 + if(typeof(args) == 'string'){
  29 + arr.push(args);
  30 + }
  31 + let msg = global.message.types[type];
  32 + if(!msg){
  33 + console.error('请求类型:%s在列表中:%s,不存在,请确认',type,JSON.stringify(global.message.types))
  34 + return '';
  35 + }
  36 + for(let i = 0; i < arr.length; i++){
  37 + msg = msg.replace(new RegExp("\\{" + i + "\\}", "g"), arr[i]);
  38 + }
  39 + return msg;
  40 + }
  41 +}
  42 +
15 global.showLoading = (callback) => { 43 global.showLoading = (callback) => {
16 const loading = ElementPlus.ElLoading.service({ 44 const loading = ElementPlus.ElLoading.service({
17 lock: true, 45 lock: true,
@@ -285,6 +285,7 @@ @@ -285,6 +285,7 @@
285 color:#3B91FF; 285 color:#3B91FF;
286 286
287 } 287 }
  288 +
288 .step-img{ 289 .step-img{
289 background-image: url("/vue3/src/assets/images/faultDiagnosis/icon-step-add.png"); 290 background-image: url("/vue3/src/assets/images/faultDiagnosis/icon-step-add.png");
290 width: 50px; 291 width: 50px;
@@ -464,10 +465,26 @@ @@ -464,10 +465,26 @@
464 .max-width-134{ 465 .max-width-134{
465 max-width: 134px; 466 max-width: 134px;
466 } 467 }
467 -.position-absolute{  
468 - 468 +.step-img-link{
  469 + width: 50px;
  470 + height: 50px;
  471 + background:#1ed76d;
  472 + border-radius: 50%;
  473 +}
  474 +.step-img-link.isActiveG{
  475 + background: #1ed76d;
469 } 476 }
470 -.btn-el-btn{ 477 +.step-img-link.isActiveY{
  478 + background: #fea500;
471 } 479 }
472 -.btn-el-btn .el-button{ 480 +.list-line-netLink{
  481 + border-top-color:#1ed76d;
473 } 482 }
  483 +.list-line-netLink.isActiveY{
  484 + border-top-color:#ffa500;
  485 +
  486 +}
  487 +.list-line-netLink.isActiveG{
  488 + border-top-color:#1ed76d;
  489 +
  490 +}
1 -<div>  
2 - <!--<el-steps :space="'20%'" :active="1" simple>  
3 - <el-step title="数据库" v-for="i in 3">  
4 - <template #icon>  
5 - &lt;!&ndash;<img src="/src/style/img/restypeimg/DATABASE_REDIS.png" />&ndash;&gt;  
6 - <i class="iconfont icon-database" />  
7 - </template>  
8 - </el-step>  
9 - </el-steps>--> 1 +<el-row clas="netLink">
  2 + <el-col :span="3" v-for="(itemLink,index) in networkMonitorList" class="max-width-134">
  3 + <div class="list-step flex-div-start">
  4 + <div class="list-step-top flex-div">
10 5
  6 + <div :class="['step-img-link','flex-div-center',{'isActiveG':itemLink.value==0,'isActiveY':itemLink.value==1}]" style="cursor: default">
  7 + <i class="icon-step flex-div-center"><img :src="'/vue3/src/assets/images/faultDiagnosis/netLink-icon.png'" alt=""></i>
  8 + </div>
11 9
12 - <el-steps :active="3" align-center>  
13 - <el-step title="Step 1" description="Some description" v-for="i in 3">  
14 - <template #icon>  
15 - <i class="iconfont icon-database" />  
16 - <!--<img src="/src/style/img/restypeimg/DATABASE_REDIS.png" style="background: black;border-radius: 5px;width: 80%;height: 80%;"/>-->  
17 - </template>  
18 - </el-step> 10 + <span v-if="index+1<networkMonitorList.length" :class="['list-line','list-line-netLink',{'isActiveG':itemLink.value==0,'isActiveY':itemLink.value==1}]"></span>
19 11
20 - </el-steps>  
21 -</div> 12 + </div>
  13 + <div class="list-step-name flex-div-start">
  14 + <span class="text-overflow width-100" :title="itemLink.linkName">
  15 + {{itemLink.linkName}}
  16 + </span>
  17 + <span class="list-line-none"></span>
  18 + </div>
  19 +
  20 + </div>
  21 + </el-col>
  22 +</el-row>
1 -  
2 export default { 1 export default {
3 - name: 'netLinks', 2 + name: 'diagnosisNet',
4 template: '', 3 template: '',
5 - components: {  
6 -  
7 - },  
8 - data() {  
9 - return {}  
10 - }, 4 + components: {},
11 props: { 5 props: {
12 - faultType:{ 6 + faultNo: {
13 type: String, 7 type: String,
14 - default:'NPM' 8 + default: ''
15 }, 9 },
16 - faultNo:{  
17 - type: String,  
18 - default:'' 10 + },
  11 + data() {
  12 + return {
  13 +
19 } 14 }
20 }, 15 },
21 - setup(props, {attrs, slots, emit}) {  
22 - let width = Vue.ref(window.innerWidth*0.8 - 190); 16 + computed: {},
  17 + setup(props) {
23 const {proxy} = Vue.getCurrentInstance(); 18 const {proxy} = Vue.getCurrentInstance();
24 - let list = Vue.ref([  
25 - {  
26 - content: 'Custom icon',  
27 - timestamp: '2018-04-12 20:46',  
28 - size: 'large',  
29 - type: 'primary',  
30 - },  
31 - {  
32 - content: 'Custom color',  
33 - timestamp: '2018-04-03 20:46',  
34 - color: '#0bbd87',  
35 - },  
36 - {  
37 - content: 'Custom size',  
38 - timestamp: '2018-04-03 20:46',  
39 - size: 'large',  
40 - },  
41 - {  
42 - content: 'Custom hollow',  
43 - timestamp: '2018-04-03 20:46',  
44 - type: 'primary',  
45 - hollow: true,  
46 - },  
47 - {  
48 - content: 'Default node',  
49 - timestamp: '2018-04-03 20:46',  
50 - },  
51 - ]);  
52 -  
53 -  
54 - // 监听编辑状态  
55 - Vue.watch(() => props.faultNo, (newValue, oldVlaue) => { 19 + let networkMonitorList=Vue.ref([]);
56 20
57 - });  
58 -  
59 - // 挂载完  
60 Vue.onMounted(() => { 21 Vue.onMounted(() => {
  22 + proxy.getNetLinkList();
  23 +
61 }) 24 })
  25 + Vue.watch(props.targetId, (newVal) => {
  26 + console.log("new targetid",newVal)
  27 + proxy.getNetLinkList()
  28 + })
  29 + //根据targetId获取链路信息列表
  30 + let getNetLinkList=()=>{
  31 + let params={
  32 + // targetId:props.targetId,
  33 + faultNo:props.faultNo
  34 +
  35 + }
  36 + //api-web/fault/result/findNetLinkResult
  37 + //api-web/fault/conf/netLink/getNetLinkList
  38 + proxy.$http.get('/api-web/fault/result/findNetLinkResult',params,function (res){
  39 + if(res && res.data){
  40 + proxy.networkMonitorList=res.data;
62 41
  42 + }
  43 + })
  44 + }
63 return { 45 return {
64 - width,  
65 - list 46 + getNetLinkList,
  47 + networkMonitorList,
66 } 48 }
  49 +
67 } 50 }
68 -} 51 +}
@@ -42,13 +42,13 @@ const faultDetail = () => { @@ -42,13 +42,13 @@ const faultDetail = () => {
42 itemName: '检测指标', 42 itemName: '检测指标',
43 detail: true, 43 detail: true,
44 colType: 'flag' 44 colType: 'flag'
45 - }/*, { 45 + }, {
46 faultType: 'NETLINK', 46 faultType: 'NETLINK',
47 faultTypeName: '网络链路', 47 faultTypeName: '网络链路',
48 components: 'netLinks', 48 components: 'netLinks',
49 color: '#409EFF', 49 color: '#409EFF',
50 detail:true 50 detail:true
51 - }*/] 51 + }]
52 }); 52 });
53 53
54 /** 54 /**