Merge remote-tracking branch 'origin/codeCheck' into codeCheck
This commit is contained in:
@@ -1395,10 +1395,10 @@ li{
|
|||||||
.nz-submenu .el-menu--popup .el-menu-item .menu-item-active{
|
.nz-submenu .el-menu--popup .el-menu-item .menu-item-active{
|
||||||
color:$global-text-color-active !important;
|
color:$global-text-color-active !important;
|
||||||
}
|
}
|
||||||
.el-icon-setting:before {
|
//.el-icon-setting:before {
|
||||||
content: "\E6CA";
|
// content: "\E6CA";
|
||||||
color: #BA3939;
|
// color: #BA3939;
|
||||||
}
|
//}
|
||||||
|
|
||||||
.el-dropdown-menu__item:focus,
|
.el-dropdown-menu__item:focus,
|
||||||
.el-dropdown-menu__item:not(.is-disabled):hover,
|
.el-dropdown-menu__item:not(.is-disabled):hover,
|
||||||
|
|||||||
@@ -575,7 +575,13 @@ const cn = {
|
|||||||
cabinetNum: "机柜数量",
|
cabinetNum: "机柜数量",
|
||||||
assets: "资产",
|
assets: "资产",
|
||||||
remark: "备注",
|
remark: "备注",
|
||||||
cabinets: "机柜"
|
cabinets: "机柜",
|
||||||
|
traffic:{
|
||||||
|
title:'流量配置',
|
||||||
|
add:'添加',
|
||||||
|
direction:'方向',
|
||||||
|
tags:'标签'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
model: {
|
model: {
|
||||||
model: "资产模型",
|
model: "资产模型",
|
||||||
|
|||||||
@@ -303,7 +303,8 @@ const en = {
|
|||||||
url:'Invalid URL',
|
url:'Invalid URL',
|
||||||
uSize:'Must be number(1 - 47)',
|
uSize:'Must be number(1 - 47)',
|
||||||
requiredIdc:'dc is required',
|
requiredIdc:'dc is required',
|
||||||
key:'Invalid key'
|
key:'Invalid key',
|
||||||
|
repeat:'Repeat'
|
||||||
},
|
},
|
||||||
search: {
|
search: {
|
||||||
searchTip: 'Enter to search',//'点击或回车执行搜索'
|
searchTip: 'Enter to search',//'点击或回车执行搜索'
|
||||||
@@ -562,6 +563,8 @@ const en = {
|
|||||||
traffic:{
|
traffic:{
|
||||||
title:'Traffic Setting',
|
title:'Traffic Setting',
|
||||||
add:'Add',
|
add:'Add',
|
||||||
|
direction:'Direction',
|
||||||
|
tags:'Tags'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
model: {
|
model: {
|
||||||
|
|||||||
@@ -3,27 +3,17 @@
|
|||||||
<div class="right-sub-box sub-box" v-if="editTagsBox.show" :style="'top: ' + editTagsBox.top + 'px; left: ' + editTagsBox.left + 'px;'" >
|
<div class="right-sub-box sub-box" v-if="editTagsBox.show" :style="'top: ' + editTagsBox.top + 'px; left: ' + editTagsBox.left + 'px;'" >
|
||||||
<div class="param-box" style="height: calc(100% - 25px)">
|
<div class="param-box" style="height: calc(100% - 25px)">
|
||||||
<el-scrollbar style="height: 100%">
|
<el-scrollbar style="height: 100%">
|
||||||
<!--<div class="param-box-row" v-for="(item, index) in tempTagsObj" :key="index">
|
<div class="param-box-row" v-for="(item, index) in tempTagsObj" :key="index">
|
||||||
<el-input placeholder="key" class="param-box-row-key input-x-mini-22" v-model="item.key"></el-input>
|
<el-input placeholder="key" class="param-box-row-key input-x-mini-22" v-model="item.key" @input="validateInput(item.key,index)" :class="{'input-error':inputKeyErr[index]}"></el-input>
|
||||||
<span class="param-box-row-eq">=</span>
|
<span class="param-box-row-eq">=</span>
|
||||||
<el-input placeholder="value" class="param-box-row-value input-x-mini-22" v-model="item.value"></el-input>
|
<el-input placeholder="value" class="param-box-row-value input-x-mini-22" v-model="item.value"></el-input>
|
||||||
<span class="param-box-row-symbol" :id="'remove-param-'+index" @click="removeTags(index)"><i class="nz-icon nz-icon-minus-square"></i></span>
|
<span class="param-box-row-symbol" :id="'remove-param-'+index" @click="removeTags(index)"><i class="nz-icon nz-icon-minus-square"></i></span>
|
||||||
</div>-->
|
<span style="color: #F56C6C;font-size: 12px;" v-if="inputKeyErr[index]">{{$t('validate.key')}}</span>
|
||||||
<el-tag v-for="(item, index) in tempTagsObj" class="sub-box-tags" size="small" :closable="true" :key="index" @close='delTag(item,index)' @click="editTag(item,index)">
|
|
||||||
<div >{{item.key}}:{{item.value}}</div>
|
|
||||||
</el-tag>
|
|
||||||
<div class="param-box-row" v-show="showNewTagInput">
|
|
||||||
<el-input placeholder="key" style="width: 63px" ref="tagKeyInput" class="param-box-row-key input-x-mini-22" :class="{'input-error':newTagInputError}" v-model="newTag.key" @keydown.enter.native="confirmInput" @blur="confirmInput"></el-input>
|
|
||||||
<span class="param-box-row-eq">=</span>
|
|
||||||
<el-input placeholder="value" style="width: 63px" class="param-box-row-value input-x-mini-22" v-model="newTag.value" @keydown.enter.native="confirmInput" @blur="confirmInput"></el-input>
|
|
||||||
</div>
|
|
||||||
<div v-if="showNewTagInput&&newTagInputError" style="text-align: left;padding-left: 10px">
|
|
||||||
<span style="color: #F56C6C;font-size: 12px;">{{$t('validate.key')}}</span>
|
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
<div class="add-btn">
|
<div class="add-btn">
|
||||||
<!-- <el-button @click="addTags" id="add-param" style="height: 18px; line-height: 18px; padding-top: 0; padding-bottom: 0;" size="mini"><i class="el-icon-plus"></i></el-button>-->
|
<el-button @click="addTags" id="add-param" style="height: 18px; line-height: 18px; padding-top: 0; padding-bottom: 0;" size="mini"><i class="el-icon-plus"></i></el-button>
|
||||||
<el-button @click="showEditTagsBox(false)" style="height: 18px; line-height: 18px; padding-top: 0; padding-bottom: 0;" size="mini"><i class="el-icon-check"></i></el-button>
|
<el-button @click="showEditTagsBox(false)" style="height: 18px; line-height: 18px; padding-top: 0; padding-bottom: 0;" size="mini"><i class="el-icon-check"></i></el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -39,9 +29,7 @@
|
|||||||
tempTagsObj:[],
|
tempTagsObj:[],
|
||||||
rowIndex:0,
|
rowIndex:0,
|
||||||
curConfigs:null,
|
curConfigs:null,
|
||||||
newTag:{key:'',value:''},
|
inputKeyErr:[],
|
||||||
showNewTagInput:true,
|
|
||||||
newTagInputError:false,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
@@ -53,6 +41,7 @@
|
|||||||
this.editTagsBox.top = position.top + 25;
|
this.editTagsBox.top = position.top + 25;
|
||||||
this.editTagsBox.left = position.left - 48;
|
this.editTagsBox.left = position.left - 48;
|
||||||
this.tempTagsObj=[];
|
this.tempTagsObj=[];
|
||||||
|
this.inputKeyErr=[];
|
||||||
let obj=null;
|
let obj=null;
|
||||||
try{
|
try{
|
||||||
obj=configs[index]['tags']
|
obj=configs[index]['tags']
|
||||||
@@ -62,14 +51,19 @@
|
|||||||
if(obj){
|
if(obj){
|
||||||
for(let key in obj){
|
for(let key in obj){
|
||||||
this.tempTagsObj.push({key:key,value:obj[key]})
|
this.tempTagsObj.push({key:key,value:obj[key]})
|
||||||
|
this.inputKeyErr.push(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!this.editTagsBox.show) {
|
if (!this.editTagsBox.show) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.confirmInput();
|
let temp=this.inputKeyErr.find(item=>{
|
||||||
this.showNewTagInput=true;
|
return item == true;
|
||||||
|
})
|
||||||
|
if(typeof temp != "undefined"){
|
||||||
|
return ;
|
||||||
|
}
|
||||||
let tempObj={};
|
let tempObj={};
|
||||||
for(let i=0;i<this.tempTagsObj.length;i++){
|
for(let i=0;i<this.tempTagsObj.length;i++){
|
||||||
let obj=this.tempTagsObj[i];
|
let obj=this.tempTagsObj[i];
|
||||||
@@ -79,79 +73,27 @@
|
|||||||
}
|
}
|
||||||
this.curConfigs[this.rowIndex]['tags']=Object.assign({},tempObj)
|
this.curConfigs[this.rowIndex]['tags']=Object.assign({},tempObj)
|
||||||
}
|
}
|
||||||
|
this.$emit('after')
|
||||||
this.editTagsBox.show = show;
|
this.editTagsBox.show = show;
|
||||||
},
|
},
|
||||||
validateInput:function(){
|
|
||||||
if(this.newTag.key == ''){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(!/[a-zA-Z_:][a-zA-Z0-9_:]*/.test(this.newTag.key)){
|
|
||||||
this.newTagInputError=true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(this.newTag.value == ''){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
this.newTagInputError=false;
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
confirmInput:function(){
|
|
||||||
if(this.validateInput()){
|
|
||||||
this.tempTagsObj.push(Object.assign({},this.newTag));
|
|
||||||
this.showNewTagInput=true;
|
|
||||||
this.newTag={key:'',value:''};
|
|
||||||
this.$nextTick(()=>{
|
|
||||||
this.$refs.tagKeyInput.focus();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
editTag:function(tag,index){
|
|
||||||
console.log(222)
|
|
||||||
if(this.showNewTagInput == true){//已经有编辑状态的tag,先保存
|
|
||||||
this.confirmInput();
|
|
||||||
}
|
|
||||||
this.tempTagsObj.splice(index,1);
|
|
||||||
this.newTag=Object.assign({},tag)
|
|
||||||
this.showNewTagInput=true;
|
|
||||||
this.$nextTick(()=>{
|
|
||||||
this.$refs.tagKeyInput.focus();
|
|
||||||
})
|
|
||||||
},
|
|
||||||
addTags:function(){
|
addTags:function(){
|
||||||
if(this.showNewTagInput == true){//已经有编辑状态的tag,先保存
|
this.tempTagsObj.push({key:'',value:''})
|
||||||
this.confirmInput();
|
this.inputKeyErr.push(false);
|
||||||
|
},
|
||||||
|
validateInput:function(value,index){
|
||||||
|
if(!/[a-zA-Z_:][a-zA-Z0-9_:]*/.test(value)){
|
||||||
|
this.inputKeyErr.splice(index,1,true)
|
||||||
|
}else{
|
||||||
|
this.inputKeyErr.splice(index,1,false)
|
||||||
}
|
}
|
||||||
this.newTag={key:'',value:''}
|
|
||||||
this.showNewTagInput=true;
|
|
||||||
this.$nextTick(()=>{
|
|
||||||
this.$refs.tagKeyInput.focus();
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
delTag:function(tag,index){
|
removeTags:function(index){
|
||||||
this.tempTagsObj.splice(index,1)
|
this.tempTagsObj.splice(index,1)
|
||||||
},
|
|
||||||
clearNewTag:function(){
|
|
||||||
this.newTag={key:'',value:''}
|
|
||||||
this.showNewTagInput=true;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
|
||||||
.sub-box-tags{
|
|
||||||
position: relative;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
display: block;
|
|
||||||
width: 150px;
|
|
||||||
margin-left: 10px;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
.sub-box-tags .el-tag__close{
|
|
||||||
position: absolute;
|
|
||||||
top: 5px;
|
|
||||||
right: 2px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.right-sub-box {
|
.right-sub-box {
|
||||||
width: 170px;
|
width: 170px;
|
||||||
@@ -160,13 +102,6 @@
|
|||||||
z-index: 2;
|
z-index: 2;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
.sub-box{
|
|
||||||
padding:5px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.sub-box .param-box-row{
|
|
||||||
padding:0 10px 0 10px !important;
|
|
||||||
}
|
|
||||||
.sub-box .add-btn{
|
.sub-box .add-btn{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
@@ -165,10 +165,14 @@
|
|||||||
return valid;
|
return valid;
|
||||||
},
|
},
|
||||||
valiateRepeatFunc:function(host,index){
|
valiateRepeatFunc:function(host,index){
|
||||||
|
if(host != ''){
|
||||||
let temp=this.traffic.setting.find((item,i)=>{
|
let temp=this.traffic.setting.find((item,i)=>{
|
||||||
return i != index && item.host == host;
|
return i != index && item.host == host;
|
||||||
})
|
})
|
||||||
return typeof temp == "undefined";
|
return typeof temp == "undefined";
|
||||||
|
}else{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
delAssetSetting:function(index){
|
delAssetSetting:function(index){
|
||||||
this.uuids.splice(index,1);
|
this.uuids.splice(index,1);
|
||||||
@@ -300,7 +304,7 @@
|
|||||||
direction:[],
|
direction:[],
|
||||||
ifindex:'',
|
ifindex:'',
|
||||||
ifdescr:' ',
|
ifdescr:' ',
|
||||||
tags:"",
|
tags:{},
|
||||||
edit:true,
|
edit:true,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
:trigger-on-focus="false"
|
:trigger-on-focus="false"
|
||||||
:highlight-first-item="true"
|
:highlight-first-item="true"
|
||||||
@input="hostInputChange"
|
@input="hostInputChange"
|
||||||
|
@blur="validateHostEmpty"
|
||||||
></el-autocomplete>
|
></el-autocomplete>
|
||||||
<el-popover trigger="click" placement="bottom" @show="popShow" @hide="popHide" popper-class="no-style-class">
|
<el-popover trigger="click" placement="bottom" @show="popShow" @hide="popHide" popper-class="no-style-class">
|
||||||
<div class="mib-browser-ad-search">
|
<div class="mib-browser-ad-search">
|
||||||
@@ -111,6 +112,11 @@
|
|||||||
</button>
|
</button>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
<div class="right-box-row-btn" @click="delSelf"><i class="el-icon-minus"></i></div>
|
<div class="right-box-row-btn" @click="delSelf"><i class="el-icon-minus"></i></div>
|
||||||
|
<div>
|
||||||
|
<span style="color:#F56C6C;font-size: 12px;" v-if="hostRepeat">{{$t('validate.repeat')}}</span>
|
||||||
|
<span style="color:#F56C6C;font-size: 12px;" v-if="hostInvalid">{{$t('validate.host')}}</span>
|
||||||
|
<span style="color:#F56C6C;font-size: 12px;" v-if="hostEmpty">{{$t('validate.required')}}</span>
|
||||||
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div class="endpoints-box-endpoints">
|
<div class="endpoints-box-endpoints">
|
||||||
<el-table :data="assetSetting.configs"
|
<el-table :data="assetSetting.configs"
|
||||||
@@ -122,6 +128,7 @@
|
|||||||
@row-dblclick="changeRowEditState"
|
@row-dblclick="changeRowEditState"
|
||||||
@row-click="validateRows"
|
@row-click="validateRows"
|
||||||
class="taffic-setting-tab"
|
class="taffic-setting-tab"
|
||||||
|
v-if="refreshTab"
|
||||||
style="width: 100%;">
|
style="width: 100%;">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label-class-name="endpoints-box-endpoints-title"
|
label-class-name="endpoints-box-endpoints-title"
|
||||||
@@ -139,22 +146,34 @@
|
|||||||
</template>
|
</template>
|
||||||
<template slot-scope="scope" :column="item">
|
<template slot-scope="scope" :column="item">
|
||||||
<template v-if="item.prop == 'tags'">
|
<template v-if="item.prop == 'tags'">
|
||||||
<div style="height: 50px;" @click="showEditTagsBox(true,scope.$index,scope.row,$event)">
|
<div class="tab-tags" @click="showEditTagsBox(true,scope.$index,scope.row,$event)">
|
||||||
<el-scrollbar style="height: 100%;">
|
<!--<el-scrollbar style="height: 100%;">
|
||||||
<el-tag
|
<el-tag
|
||||||
v-for="(value, key, index) in scope.row[item.prop]"
|
v-for="(value, key, index) in scope.row[item.prop]"
|
||||||
class="tab-tags"
|
class="tab-tags"
|
||||||
size="mini"
|
size="mini"
|
||||||
:closable="scope.row.edit==true"
|
|
||||||
:key="key"
|
:key="key"
|
||||||
style="display: block;margin-bottom:5px;" >
|
style="display: block;margin-bottom:5px;" >
|
||||||
<!-- <div class="tab-tags-item">-->
|
<!– <div class="tab-tags-item">–>
|
||||||
<!-- <div class="tag-item-key">{{key}}:</div><div class="tag-item-value">{{value}}</div>-->
|
<!– <div class="tag-item-key">{{key}}:</div><div class="tag-item-value">{{value}}</div>–>
|
||||||
|
|
||||||
<!-- </div>-->
|
<!– </div>–>
|
||||||
{{key}}:{{value}}
|
{{key}}:{{value}}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</el-scrollbar>
|
</el-scrollbar>-->
|
||||||
|
<el-tooltip placement="top" effect="light" popper-class="tags-pop transparent-pop">
|
||||||
|
<div slot="content">
|
||||||
|
<div class="tab-tags-item" v-for="(value, key, index) in scope.row[item.prop]">
|
||||||
|
<div class="tag-item-key">{{key}}</div>
|
||||||
|
<div class="tag-item-value">{{value}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tab-tags-item" v-if="Object.keys(scope.row[item.prop]).length>0">
|
||||||
|
<div class="tag-item-key">{{Object.keys(scope.row[item.prop])[0]}}</div>
|
||||||
|
<div class="tag-item-value">{{scope.row[item.prop][Object.keys(scope.row[item.prop])[0]]}}</div>
|
||||||
|
<div class="tag-item-text" v-if="Object.keys(scope.row[item.prop]).length>1">+{{Object.keys(scope.row[item.prop]).length-1}}</div>
|
||||||
|
</div>
|
||||||
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="item.prop == 'ifindex'">
|
<template v-if="item.prop == 'ifindex'">
|
||||||
@@ -177,10 +196,11 @@
|
|||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="item.prop == 'ifdescr'">
|
<template v-if="item.prop == 'ifdescr'">
|
||||||
<span v-if="scope.row.edit==false">{{scope.row[item.prop]}}</span>
|
<!--<span v-if="scope.row.edit==false">{{scope.row[item.prop]}}</span>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-input v-model="scope.row[item.prop]" size="small" clearable></el-input>
|
<el-input v-model="scope.row[item.prop]" size="small" clearable></el-input>
|
||||||
</template>
|
</template>-->
|
||||||
|
<span>{{scope.row[item.prop]}}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="item.prop == 'direction'">
|
<template v-if="item.prop == 'direction'">
|
||||||
<template v-if="scope.row.edit==false">
|
<template v-if="scope.row.edit==false">
|
||||||
@@ -200,7 +220,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="" :width="30">
|
<el-table-column label="" :width="30">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button @click.stop="delTabRow(scope.$index,scope.row.ifindex)" :disabled="assetSetting.host == null" style="width: 18px;height: 18px; line-height: 18px; padding:0;" size="mini"><i class="el-icon-minus"></i></el-button>
|
<el-button @click.stop="delTabRow(scope.$index,scope.row)" :disabled="assetSetting.host == null" style="width: 18px;height: 18px; line-height: 18px; padding:0;" size="mini"><i class="el-icon-minus"></i></el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -208,7 +228,7 @@
|
|||||||
<el-button @click="addTabRow" style="height: 18px; line-height: 18px; padding-top: 0; padding-bottom: 0;" size="mini"><i class="el-icon-plus"></i></el-button>
|
<el-button @click="addTabRow" style="height: 18px; line-height: 18px; padding-top: 0; padding-bottom: 0;" size="mini"><i class="el-icon-plus"></i></el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<sub-box ref="subBox"></sub-box>
|
<sub-box ref="subBox" @after="refreshTabFunc"></sub-box>
|
||||||
<loading ref="loading"></loading>
|
<loading ref="loading"></loading>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -235,6 +255,8 @@
|
|||||||
assetValidate:false,
|
assetValidate:false,
|
||||||
hostRepeat:false,
|
hostRepeat:false,
|
||||||
hostInvalid:false,
|
hostInvalid:false,
|
||||||
|
hostEmpty:false,
|
||||||
|
refreshTab:true,
|
||||||
tableLabels:[
|
tableLabels:[
|
||||||
{
|
{
|
||||||
label:'ifIndex',
|
label:'ifIndex',
|
||||||
@@ -251,14 +273,14 @@
|
|||||||
errRows:[],
|
errRows:[],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label:'direction',
|
label:this.$t('config.dc.traffic.direction'),
|
||||||
prop:'direction',
|
prop:'direction',
|
||||||
width:100,
|
width:100,
|
||||||
required:true,
|
required:true,
|
||||||
errRows:[],
|
errRows:[],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label:'tags',
|
label:this.$t('config.dc.traffic.tags'),
|
||||||
prop:'tags',
|
prop:'tags',
|
||||||
required:false,
|
required:false,
|
||||||
errRows:[],
|
errRows:[],
|
||||||
@@ -283,6 +305,12 @@
|
|||||||
clearAssetInput:function(){
|
clearAssetInput:function(){
|
||||||
this.resetComponet();
|
this.resetComponet();
|
||||||
},
|
},
|
||||||
|
refreshTabFunc:function(){
|
||||||
|
this.refreshTab=false;
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.refreshTab=true;
|
||||||
|
});
|
||||||
|
},
|
||||||
resetComponet:function(){
|
resetComponet:function(){
|
||||||
this.ifIndexList=[];
|
this.ifIndexList=[];
|
||||||
this.assetSetting.assetId=null;
|
this.assetSetting.assetId=null;
|
||||||
@@ -401,15 +429,15 @@
|
|||||||
},
|
},
|
||||||
ifIndexInputChange:function(ifindex,row,index){
|
ifIndexInputChange:function(ifindex,row,index){
|
||||||
if(this.ifIndexList && this.ifIndexList.length>0){
|
if(this.ifIndexList && this.ifIndexList.length>0){
|
||||||
let temp=this.ifIndexList.find(item=>{
|
// let temp=this.ifIndexList.find(item=>{
|
||||||
return item.value == ifindex;
|
// return item.value == ifindex;
|
||||||
})
|
// })
|
||||||
if(!temp){
|
// if(!temp){
|
||||||
this.ifIndexError=true;
|
// this.ifIndexError=true;
|
||||||
return ;
|
// return ;
|
||||||
}else{
|
// }else{
|
||||||
this.ifIndexError=false;
|
// this.ifIndexError=false;
|
||||||
}
|
// }
|
||||||
this.ifIndexChange(ifindex,row)
|
this.ifIndexChange(ifindex,row)
|
||||||
let tmp=this.assetSetting.configs.find((item,i)=>{
|
let tmp=this.assetSetting.configs.find((item,i)=>{
|
||||||
return i != index && item.ifindex == ifindex;
|
return i != index && item.ifindex == ifindex;
|
||||||
@@ -429,12 +457,20 @@
|
|||||||
clearTimeout(this.hostTimer);
|
clearTimeout(this.hostTimer);
|
||||||
}
|
}
|
||||||
this.hostTimer=setTimeout(()=>{
|
this.hostTimer=setTimeout(()=>{
|
||||||
this.queryInterfaceInfos(true);
|
|
||||||
this.validateHostRepeat(value);
|
this.validateHostRepeat(value);
|
||||||
this.validateHostValid(value);
|
this.validateHostValid(value);
|
||||||
},1000)
|
if(!this.hostEmpty&&!this.hostRepeat&&!this.hostInvalid){
|
||||||
|
this.queryInterfaceInfos(true);
|
||||||
|
}
|
||||||
|
},500)
|
||||||
|
},
|
||||||
|
validateHostEmpty:function(){
|
||||||
|
this.hostEmpty=!this.assetSetting.host||this.assetSetting.host == '';
|
||||||
},
|
},
|
||||||
validateHostValid:function(host){
|
validateHostValid:function(host){
|
||||||
|
if(host==''){
|
||||||
|
return false
|
||||||
|
}
|
||||||
const hostReg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])(\:\d{0,5})?$/
|
const hostReg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])(\:\d{0,5})?$/
|
||||||
if (hostReg.test(host)) {
|
if (hostReg.test(host)) {
|
||||||
this.hostInvalid=false;
|
this.hostInvalid=false;
|
||||||
@@ -478,6 +514,18 @@
|
|||||||
if(required &&(!value || (typeof value =='string' && value == '')||(value instanceof Array && value.length<1))){
|
if(required &&(!value || (typeof value =='string' && value == '')||(value instanceof Array && value.length<1))){
|
||||||
validateFlag=false
|
validateFlag=false
|
||||||
label.errRows.push(index) //保存有错误的行的index,通过行列唯一定位有错误的输入框
|
label.errRows.push(index) //保存有错误的行的index,通过行列唯一定位有错误的输入框
|
||||||
|
}else{
|
||||||
|
if(label.prop == 'ifindex'){
|
||||||
|
if(this.ifIndexList && this.ifIndexList.length>0) {
|
||||||
|
let temp = this.ifIndexList.find(item => {
|
||||||
|
return item.value == value;
|
||||||
|
})
|
||||||
|
if(!temp){
|
||||||
|
validateFlag=false
|
||||||
|
label.errRows.push(index) //保存有错误的行的index,通过行列唯一定位有错误的输入框
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -507,15 +555,18 @@
|
|||||||
direction:[],
|
direction:[],
|
||||||
ifindex:null,
|
ifindex:null,
|
||||||
ifdescr:' ',
|
ifdescr:' ',
|
||||||
tags:"",
|
tags:{},
|
||||||
edit:true,
|
edit:true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
delTabRow:function(index,ifindex){
|
delTabRow:function(index,row){
|
||||||
if(this.assetSetting.configs.length>1){
|
if(this.assetSetting.configs.length>1){
|
||||||
this.assetSetting.configs.splice(index,1)
|
this.assetSetting.configs.splice(index,1);
|
||||||
this.changeIfIndexOccupyState(ifindex,false)
|
if(row.edit == true && this.ifIndexError == true){
|
||||||
|
this.ifIndexError=false;
|
||||||
|
}
|
||||||
|
this.changeIfIndexOccupyState(row.ifindex,false)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resetIfIndexOccupyState:function(){
|
resetIfIndexOccupyState:function(){
|
||||||
@@ -578,17 +629,36 @@
|
|||||||
</style>
|
</style>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.tab-tags{
|
.tab-tags{
|
||||||
/*border: 0px;*/
|
width: 100%;
|
||||||
/*padding: 0;*/
|
height: 22px;
|
||||||
/*display: inline-block;*/
|
|
||||||
/*border-radius: 2px;*/
|
|
||||||
/*width: 100px;*/
|
|
||||||
}
|
}
|
||||||
.tab-tags .tab-tags-item{
|
.tags-pop{
|
||||||
|
width: 110px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.tab-tags-item{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
}
|
}
|
||||||
.tab-tags-item .tag-item-key{
|
.tab-tags-item .tag-item-key{
|
||||||
/*background-color: #E6E4E4;*/
|
border:1px solid #E6E4E4;
|
||||||
|
border-top-left-radius: 3px;
|
||||||
|
border-bottom-left-radius: 3px;
|
||||||
|
background-color: #E6E4E4;
|
||||||
|
width: 52px;
|
||||||
|
}
|
||||||
|
.tab-tags-item .tag-item-value{
|
||||||
|
border:1px solid #E6E4E4;
|
||||||
|
border-top-right-radius: 3px;
|
||||||
|
border-bottom-right-radius: 3px;
|
||||||
|
background-color: #FFF;
|
||||||
|
width: 52px;
|
||||||
|
}
|
||||||
|
.tab-tags-item .tag-item-text{
|
||||||
|
background-color: #FFF;
|
||||||
|
width: 20px;
|
||||||
}
|
}
|
||||||
.taffic-setting-tab .el-table__row:hover{
|
.taffic-setting-tab .el-table__row:hover{
|
||||||
.input__inner{
|
.input__inner{
|
||||||
|
|||||||
@@ -47,6 +47,10 @@
|
|||||||
class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="dc-add">
|
class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="dc-add">
|
||||||
<i class="nz-icon-create-square nz-icon"></i>
|
<i class="nz-icon-create-square nz-icon"></i>
|
||||||
</button>
|
</button>
|
||||||
|
<!-- <button type="button" @click="listLanguage" :title="$t('overall.createDatacenter')"-->
|
||||||
|
<!-- class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" >-->
|
||||||
|
<!-- <i class="nz-icon-create-square nz-icon"></i>-->
|
||||||
|
<!-- </button>-->
|
||||||
</div>
|
</div>
|
||||||
<div class="pagination-top pagination-top-hide display-none"></div>
|
<div class="pagination-top pagination-top-hide display-none"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -79,7 +83,7 @@
|
|||||||
|
|
||||||
<span :title="$t('overall.delete')" @click="del(scope.row)" class="content-right-option" :id="'dc-del-'+scope.row.id"><i class="el-icon-delete"></i></span>
|
<span :title="$t('overall.delete')" @click="del(scope.row)" class="content-right-option" :id="'dc-del-'+scope.row.id"><i class="el-icon-delete"></i></span>
|
||||||
|
|
||||||
<span :title="$t('config.dc.traffic.title')" @click="configTraffic(scope.row)" class="content-right-option" :id="'dc-del-'+scope.row.id" ><i class="el-icon-s-tools"></i></span>
|
<span :title="$t('config.dc.traffic.title')" @click="configTraffic(scope.row)" class="content-right-option" :id="'dc-setting-'+scope.row.id" ><i class="el-icon-setting"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<template v-else-if="item.prop == 'principal'">
|
<template v-else-if="item.prop == 'principal'">
|
||||||
<template v-if="scope.row.principal">
|
<template v-if="scope.row.principal">
|
||||||
@@ -148,6 +152,7 @@
|
|||||||
var vm;
|
var vm;
|
||||||
import bus from '../../../libs/bus';
|
import bus from '../../../libs/bus';
|
||||||
import trafficSettingBox from "../../common/rightBox/trafficSetting/trafficSettingBox";
|
import trafficSettingBox from "../../common/rightBox/trafficSetting/trafficSettingBox";
|
||||||
|
import util from "./util";
|
||||||
export default {
|
export default {
|
||||||
name: "dc",
|
name: "dc",
|
||||||
components:{
|
components:{
|
||||||
@@ -252,6 +257,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
listLanguage:function(){
|
||||||
|
util.methods.listLanguage();
|
||||||
|
console.log(util.data().languageList)
|
||||||
|
},
|
||||||
elementsetShow(s, e) {
|
elementsetShow(s, e) {
|
||||||
var eventfixed = {
|
var eventfixed = {
|
||||||
shezhi: 0,
|
shezhi: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user