perf: dc代码提交

This commit is contained in:
chenjinsong
2020-07-16 17:33:20 +08:00
parent 44769006d0
commit 98aa99f66d
9 changed files with 270 additions and 395 deletions

View File

@@ -159,7 +159,6 @@
@sendStateData="closeAsset"></asset-add-unit>-->
<asset-box :edit-unit-show='addUnitShow' @refreshData="refreshAsset" @sendStateData="closeAsset" v-if="assetBoxShow"
ref="assetAddUnit"></asset-box>
<dc-box ref="dcBox" :dc="currentDc" :user-data="userDatas" @reload="getAssetData"></dc-box>
<alert-config-box :parentAlertRule="alertRule" @reload="" ref="alertConfigBox"></alert-config-box>
<change-password :cur-user="username" :show-dialog="showChangePwd" @click="showPwdDialog" @dialogClosed="dialogClosed"></change-password>
</div>
@@ -186,7 +185,6 @@
id:'',
name: ''
},
currentDc: {},
projectData: [], //顶部菜单project列表中的数据
editProject: {id: '', name: '', remark: ''}, //新增/编辑的project
currentProject: {id: '', name: '', remark: ''}, //module/endpoint弹框用来回显project
@@ -218,11 +216,6 @@
receiver: '',
},
createMenu: [ //新增按钮内容
/*{
label: this.$t('dashboard.panel.title'),
url: 'panel',
type: 0
},*/
{
label: this.$t('project.project.project'),
url: 'project',
@@ -248,11 +241,6 @@
url: 'alertConfig',
type: 5
},
// {
// label: this.$t('config.dc.dc'),
// url: 'dc',
// type: 6
// }
],
addIdcData: {
id: '',
@@ -340,19 +328,6 @@
this.addUnitShow = true;
this.$refs.assetAddUnit.resetAsset();
});
} else if (item.type == 6) {
this.currentDc = {
id: '',
name: '',
location: '',
tel: '',
principal: '',
area: {
id: '',
name: ''
}
},
this.$refs.dcBox.show(true, true);
}
},
jumpToAsset(id) {

View File

@@ -1,16 +1,6 @@
<template>
<el-popover :placement="placement" width="487" ref="selectAreaPopBox" v-model="popBox.show" popper-class="nz-pop nz-pop-select-area" transition="slide">
<div>
<!-- begin--顶部按钮-->
<!--<div class="pop-top-btns">
<button type="button" @click="esc" class="nz-btn nz-btn-size-alien nz-btn-size-small nz-btn-style-light nz-btn-min-width-35" id="dc-esc">
<span class="pop-top-btn-icon"><i class="el-icon-close"></i></span>
<span class="pop-top-btn-txt">{{$t('overall.esc')}}</span>
</button>
</div>-->
<!-- end--顶部按钮-->
<!--<div class="pop-title">{{$t('config.dc.selectArea')}}</div>-->
<div class="pop-item-wider">
<el-scrollbar class="select-area-tree">
<el-tree
@@ -28,9 +18,6 @@
</el-tree>
</el-scrollbar>
</div>
<!--<div class="">
<button class="float-right nz-btn nz-btn-size-small nz-btn-style-normal nz-btn-min-width-60" type="button" @click="selectArea">{{$t('overall.ok')}}</button>
</div>-->
</div>
<div slot="reference">
<slot name="trigger">
@@ -48,12 +35,15 @@
areaData: {type: Array},
currentArea: {type: Number}
},
created() {
},
mounted() {
this.$nextTick(() => {
/*this.$nextTick(() => {
console.info(this.$refs)
this.$refs.areaTree.setCurrentKey(this.currentArea);
});
});*/
setTimeout(() => {
console.info(this.$refs)
this.$refs.areaTree.setCurrentKey(this.currentArea);
}, 100);
},
data(){
return {
@@ -87,8 +77,6 @@
}
}
},
watch:{
}
}
</script>

View File

@@ -1,5 +1,5 @@
<template>
<div class="right-box right-box-account" v-clickoutside="clickos">
<div class="right-box right-box-account" v-clickoutside="clickOutside">
<!-- begin--顶部按钮-->
<div class="right-box-top-btns">
<button type="button" v-if="editUser.userId" @click="del"
@@ -88,15 +88,13 @@
}
},
methods: {
clickos() {
this.esc(false);
},
/*关闭弹框*/
esc(refresh) {
this.$emit("close", refresh);
},
clickOutside() {
this.esc(false);
},
/*保存*/
save() {
this.$refs.accountForm.validate(valid => {
@@ -108,7 +106,6 @@
this.esc(true);
} else {
this.$message.error(response.msg);
this.esc(false);
}
});
} else {
@@ -118,7 +115,6 @@
this.esc(true);
} else {
this.$message.error(response.msg);
this.esc(false);
}
});
}
@@ -155,8 +151,5 @@
}
}
},
mounted() {
}
}
</script>

View File

@@ -1,8 +1,8 @@
<template>
<div class="right-box right-box-dc" v-clickoutside="clickos">
<div class="right-box right-box-dc" v-clickoutside="clickOutside">
<!-- begin--顶部按钮-->
<div class="right-box-top-btns">
<button id="dc-del" type="button" v-if="currentDc.id" @click="del" class="nz-btn nz-btn-size-normal nz-btn-size-alien nz-btn-style-light">
<button id="dc-del" type="button" v-if="editDc.id" @click="del" class="nz-btn nz-btn-size-normal nz-btn-size-alien nz-btn-style-light">
<span class="right-box-top-btn-icon"><i class="el-icon-delete"></i></span>
<span class="right-box-top-btn-txt">{{$t('overall.delete')}}</span>
</button>
@@ -10,49 +10,34 @@
<!-- end--顶部按钮-->
<!-- begin--标题-->
<div class="right-box-title">{{}}</div>
<div class="right-box-title">{{editDc.id ? ($t("asset.createAssetTab.editIdcTab.title") + " ID" + editDc.id) : $t("asset.createAssetTab.AddIdcTab.title")}}</div>
<!-- end--标题-->
<!-- begin--表单-->
<el-scrollbar class="right-box-form-box">
<el-form class="right-box-form right-box-form-left" label-width="120px" :model="currentDc" label-position="right" :rules="rules" ref="dcForm">
<el-form class="right-box-form right-box-form-left" label-width="120px" :model="editDc" label-position="right" :rules="rules" ref="dcForm">
<el-form-item :label='$t("overall.name")' prop="name">
<el-input v-if="rightBox.isEdit" placeholder="" maxlength="64" show-word-limit v-model="currentDc.name" size="small"></el-input>
<div v-if="!rightBox.isEdit" class="right-box-form-content-txt">{{currentDc.name}}</div>
<el-input placeholder="" maxlength="64" show-word-limit v-model="editDc.name" size="small"></el-input>
</el-form-item>
<el-form-item :label='$t("asset.createAssetTab.location")' prop="location">
<el-input v-if="rightBox.isEdit" placeholder="" v-model="currentDc.location" size="small"></el-input>
<div v-if="!rightBox.isEdit && currentDc.location" class="right-box-form-content-txt">{{currentDc.location}}</div>
<div v-else-if="!rightBox.isEdit" class="right-box-form-content-txt">-</div>
<el-input placeholder="" v-model="editDc.location" size="small"></el-input>
</el-form-item>
<el-form-item :label='$t("asset.createAssetTab.tel")' prop="tel">
<el-input v-if="rightBox.isEdit" placeholder="" v-model="currentDc.tel" size="small"></el-input>
<div v-if="!rightBox.isEdit && currentDc.tel" class="right-box-form-content-txt">{{currentDc.tel}}</div>
<div v-else-if="!rightBox.isEdit" class="right-box-form-content-txt">-</div>
<el-input placeholder="" v-model="editDc.tel" size="small"></el-input>
</el-form-item>
<el-form-item :label='$t("asset.createAssetTab.principal")' prop="principal">
<el-select value-key="id" popper-class="config-dropdown"
v-model="currentDc.principal" placeholder="" v-if="rightBox.isEdit" size="small">
<el-option @click.native="" v-for="item in userData" :key="item.userId" :label="item.username"
:value="item.userId" :id="'dc-principal-op-'+item.userId">
<el-select value-key="id" popper-class="config-dropdown" v-model="editDc.principal" placeholder="" size="small">
<el-option @click.native="" v-for="item in userData" :key="item.userId" :label="item.username" :value="item.userId" :id="'dc-principal-op-'+item.userId">
<span>{{item.username}}</span>
</el-option>
</el-select>
<div v-if="!rightBox.isEdit && currentDc.principal" class="right-box-form-content-txt">
<template v-for="item in userData">
<template v-if="item.userId == currentDc.principal">{{item.username}}</template>
</template>
</div>
<div v-else-if="!rightBox.isEdit" class="right-box-form-content-txt">-</div>
</el-form-item>
<el-form-item :label='$t("config.dc.area")' prop="area">
<select-area ref="selectArea" :areaData="areaData" :placement="'bottom-start'" @selectArea="selectArea" :currentArea="currentDc.area.id">
<select-area ref="selectArea" :areaData="areaData" :placement="'bottom-start'" @selectArea="selectArea" :currentArea="editDc.area.id">
<template v-slot:trigger>
<el-input v-if="rightBox.isEdit" placeholder="" v-model="currentDc.area.name" size="small" readonly="readonly" @click.native="toSelectArea"></el-input>
<el-input placeholder="" v-model="editDc.area.name" size="small" readonly="readonly" @click.native="toSelectArea"></el-input>
</template>
</select-area>
<div v-if="!rightBox.isEdit && currentDc.area.name" class="right-box-form-content-txt">{{currentDc.area.name}}</div>
<div v-else-if="!rightBox.isEdit" class="right-box-form-content-txt">-</div>
</el-form-item>
</el-form>
</el-scrollbar>
@@ -62,7 +47,7 @@
<button @click="esc" id="dc-box-esc" class="nz-btn nz-btn-size-normal nz-btn-style-light nz-btn-min-width-100">
<span>{{$t('overall.cancel')}}</span>
</button>
<button v-if="rightBox.isEdit" @click="saveOrToEdit" id="dc-box-save" class="nz-btn nz-btn-size-normal nz-btn-style-normal nz-btn-min-width-100">
<button @click="save" id="dc-box-save" class="nz-btn nz-btn-size-normal nz-btn-style-normal nz-btn-min-width-100">
<span>{{$t('overall.save')}}</span>
</button>
</div>
@@ -71,32 +56,19 @@
</template>
<script>
import selectArea from "../popBox/selectArea"; //dc弹框
export default {
name: "dcBox",
props: {
dc: Object,
userData: Array
},
components:{
'select-area': selectArea
},
data() {
return {
currentDc: {
id: '',
name: '',
location: '',
tel: '',
principal: '',
area: {
id: '',
name: ''
},
areaId: ''
},
rightBox: {
show: false,
firstShow: false,
title: '',
isEdit: false
},
editDc: {},
rules: {
name: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
@@ -106,50 +78,42 @@
}
},
methods: {
show(show, isEdit) {
this.rightBox.show = show;
this.rightBox.isEdit = isEdit;
},
clickos() {
this.rightBox.show = false;
},
/*关闭弹框*/
esc() {
this.rightBox.show = false;
this.rightBox.firstShow = false;
esc(refresh) {
this.$emit("close", refresh);
},
clickOutside() {
this.esc(false);
},
/*弹出选择area弹框*/
toSelectArea() {
this.$refs.selectArea.openBox(this.currentDc.area);
this.$refs.selectArea.openBox(this.editDc.area);
},
/*保存*/
save() {
this.$refs.dcForm.validate((valid) => {
if (valid) {
if (this.currentDc.id) {
if (this.currentDc.area) {
this.currentDc.areaId = this.currentDc.area.id;
if (this.editDc.id) {
if (this.editDc.area) {
this.editDc.areaId = this.editDc.area.id;
}
this.$put('idc', this.currentDc).then(response => {
this.$put('idc', this.editDc).then(response => {
if (response.code === 200) {
this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")});
this.rightBox.show = false;
this.$emit('reload');
this.esc(true);
} else {
this.$message.error(response.msg);
}
});
} else {
if (this.currentDc.area) {
this.currentDc.areaId = this.currentDc.area.id;
if (this.editDc.area) {
this.editDc.areaId = this.editDc.area.id;
}
this.$post('idc', this.currentDc).then(response => {
this.$post('idc', this.editDc).then(response => {
if (response.code === 200) {
this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")});
this.rightBox.show = false;
this.$emit("reload");
this.esc(true);
} else {
this.$message.error(response.msg);
}
@@ -160,14 +124,6 @@
}
});
},
saveOrToEdit: function() {
if (!this.rightBox.isEdit) {
this.rightBox.isEdit = true;
this.rightBox.title = this.$t("asset.createAssetTab.editIdcTab.title") + " ID" + this.currentDc.id;
} else {
this.save();
}
},
/*删除*/
del() {
this.$confirm(this.$t("tip.confirmDelete"), {
@@ -175,11 +131,10 @@
cancelButtonText: this.$t("tip.no"),
type: 'warning'
}).then(() => {
this.$delete("idc?ids=" + this.currentDc.id).then(response => {
this.$delete("idc?ids=" + this.editDc.id).then(response => {
if (response.code === 200) {
this.$message({duration: 1000, type: 'success', message: this.$t("tip.deleteSuccess")});
this.rightBox.show = false;
this.$emit("reload");
this.esc(true);
} else {
this.$message.error(response.msg);
}
@@ -195,31 +150,21 @@
},
selectArea(area) {
this.currentDc.area.id = area.id;
this.currentDc.area.name = area.name;
this.editDc.area.id = area.id;
this.editDc.area.name = area.name;
}
},
mounted() {
this.getAreaData();
},
computed: {
},
watch: {
dc: {
immediate: true,
deep:true,
handler(n, o) {
this.currentDc = JSON.parse(JSON.stringify(n));
if (n && n.id) {
this.rightBox.title =this.rightBox.isEdit? this.$t("asset.createAssetTab.editIdcTab.title") + " ID" + n.id : this.$t("config.dc.dc") + " ID" + n.id ;
} else {
this.rightBox.title = this.$t("asset.createAssetTab.AddIdcTab.title");
}
this.editDc = JSON.parse(JSON.stringify(n));
}
},
}
}
</script>
<style scoped>
</style>

View File

@@ -1,5 +1,5 @@
<template>
<div class="right-box right-box-prom" v-clickoutside="clickos">
<div class="right-box right-box-prom" v-clickoutside="clickOutside">
<!-- begin--顶部按钮-->
<div class="right-box-top-btns">
<button type="button" v-if="editPromServer.id" @click="del"
@@ -91,15 +91,13 @@
}
},
methods: {
clickos() {
this.esc(false);
},
/*关闭弹框*/
esc(refresh) {
this.$emit("close", refresh);
},
clickOutside() {
this.esc(false);
},
/*保存*/
save() {
this.$refs.promServerForm.validate(valid => {
@@ -111,7 +109,6 @@
this.esc(true);
} else {
this.$message.error(response.msg);
this.esc(false);
}
});
} else {
@@ -121,7 +118,6 @@
this.esc(true);
} else {
this.$message.error(response.msg);
this.esc(false);
}
});
}

View File

@@ -1,23 +1,13 @@
<template>
<transition name="right-box">
<div class="right-box right-box-project" v-if="rightBox.show" v-clickoutside="clickos" >
<!-- begin--顶部按钮-->
<div class="right-box-top-btns">
<button v-if="!rightBox.isEdit" id="project-edit" type="button" @click="saveOrToEdit" class="nz-btn nz-btn-size-normal nz-btn-size-alien nz-btn-style-light nz-btn-min-width-82">
<span class="right-box-top-btn-icon"><i class="nz-icon nz-icon-edit"></i></span>
<span class="right-box-top-btn-txt">{{$t('overall.edit')}}</span>
</button>
</div>
<!-- end--顶部按钮-->
<div class="right-box right-box-project" v-clickoutside="clickOutside" >
<!-- begin--标题-->
<div class="right-box-title">{{rightBox.title}}</div>
<div class="right-box-title">{{$t('config.dc.traffic.title')}}</div>
<!-- end--标题-->
<el-scrollbar class="right-box-form-box">
<el-form class="right-box-form" :model="traffic" label-width="100px" label-position="left" :rules="rules" ref="trafficForm">
<el-form class="right-box-form" :model="traffic" label-width="100px" label-position="left" ref="trafficForm">
<el-form-item :label="$t('config.dc.dc')" size="small">
<el-input :disabled="true" v-model="dcObj.name"></el-input>
<el-input :disabled="true" v-model="dc.name"></el-input>
</el-form-item>
<traffic-setting-tab ref="trafficSetting" :post-asset-list="assetList" v-for="(item,index) in traffic.setting" :index="index" :asset-setting="item" :key="uuids[index]" :id="uuids[index]" @delSelf="delAssetSetting" :validate-repeat-func="valiateRepeatFunc"></traffic-setting-tab>
<button @click="addAssetSetting" class="nz-btn nz-btn-size-normal nz-btn-style-light nz-btn-min-width-100" style="margin:5px 1px">{{$t('config.dc.traffic.add')}}</button>
@@ -29,12 +19,11 @@
<button @click="esc" id="project-esc" class="nz-btn nz-btn-size-normal nz-btn-style-light nz-btn-min-width-100">
<span>{{$t('overall.cancel')}}</span>
</button>
<button v-if="rightBox.isEdit" @click="saveOrToEdit" id="project-save" class="nz-btn nz-btn-size-normal nz-btn-style-normal nz-btn-min-width-100">
<button @click="save" id="project-save" class="nz-btn nz-btn-size-normal nz-btn-style-normal nz-btn-min-width-100">
<span>{{$t('overall.save')}}</span>
</button>
</div>
</div>
</transition>
</template>
<script>
@@ -47,20 +36,17 @@
'traffic-setting-tab':trafficSettingTab
},
props:{
dcObj:{
dc:{
type: Object,
required: true
},
},
mounted() {
this.queryTrafficSettings();
},
data(){
return{
assetList:[],
rightBox: {
show: false,
title: this.$t('config.dc.traffic.title'),
isCreate: false,
isEdit:false
},
uuids:[],
traffic:{
idcId:'',
@@ -90,11 +76,7 @@
}
]
},
rules:{}
}
},
created() {
},
methods:{
addAssetSetting:function(){
@@ -178,19 +160,14 @@
this.uuids.splice(index,1);
this.traffic.setting.splice(index,1)
},
show(show,isEdit) {
this.rightBox.show = show;
this.rightBox.isEdit=isEdit;
this.queryTrafficSettings();
},
clickos() {
this.esc();
clickOutside() {
this.esc(false);
},
/*关闭弹框*/
esc() {
this.rightBox.show = false;
esc(refresh) {
this.$emit("close", refresh);
},
/*保存*/
save() {
@@ -198,9 +175,9 @@
if (valid) {
//拆解数据
let result={
idcId:this.dcObj.id,
idcId: this.dc.id,
setting:[],
}
};
this.traffic.setting.forEach(assetSetting=>{
assetSetting.configs.forEach(config=>{
let settingItem={
@@ -213,7 +190,7 @@
ifindex:config.ifindex,
ifdescr:config.ifdescr,
tags:config.tags,
}
};
result.setting.push(settingItem);
})
})
@@ -221,7 +198,7 @@
this.$put('/idc/trafficSetting', result).then(response=>{
if(response.code == 200){
this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")});
this.rightBox.show = false;
this.esc(false);
}else{
console.error(response.msg)
this.$message.error(response.msg);
@@ -232,16 +209,8 @@
return false;
}
},
saveOrToEdit: function() {
if (!this.rightBox.isEdit) {
this.rightBox.isEdit = true;
this.rightBox.title = this.$t("project.project.editProject") + " ID" + this.project.id;
} else {
this.save();
}
},
queryTrafficSettings:function(){
this.$get('/idc/trafficSetting?id='+this.dcObj.id).then(response=>{
this.$get('/idc/trafficSetting?id='+this.dc.id).then(response=>{
if(response.code == 200){
let list=response.data.list;
if(list.length>0){
@@ -256,7 +225,7 @@
}
})
this.traffic={
idcId:this.dcObj.id,
idcId:this.dc.id,
setting:[],
}
let keys=map.keys();
@@ -331,11 +300,11 @@
}
})
},
queryAssetList:function(){
queryAssetList() {
let queryParams = {
pageSize:-1,
idcId:this.dcObj.id,
}
idcId:this.dc.id,
};
this.assetList=[];
this.$get('/asset',queryParams).then(response=>{
if(response.code == 200){
@@ -352,7 +321,7 @@
},
},
watch:{
dcObj:{
dc:{
immediate:true,
deep:true,
handler(){

View File

@@ -43,7 +43,7 @@
<div class="top-tool-search">
<search-input ref="searchInput" :searchMsg="searchMsg" @search="search" :inTransform="inTransform"></search-input>
</div>
<button type="button" @click="toAdd" :title="$t('overall.createDatacenter')"
<button type="button" @click="add" :title="$t('overall.createDatacenter')"
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>
</button>
@@ -131,7 +131,7 @@
<Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
</div>
</div>
<bottom-box v-if="showSubList" :show-sub-list="showSubList" :subResizeShow="subResizeShow" :obj="cabinetDc" :isFullScreen="isFullScreen" :from="'dc'" :targetTab.sync="targetTab" :detail="dcDetail"
<bottom-box v-if="showSubList" :show-sub-list="showSubList" :subResizeShow="subResizeShow" :obj="dc" :isFullScreen="isFullScreen" :from="'dc'" :targetTab.sync="targetTab" :detail="dcDetail"
@closeSubList="showSubList = false" @fullScreen="fullScreen" @exitFullScreen="exitFullScreen" @listResize="listResize" ></bottom-box>
</div>
</left-menu>
@@ -143,19 +143,24 @@
:table-title="tableTitle"
ref="elementset"
></element-set>
<transition name="right-box">
<dc-box ref="dcBox" :dc="currentDc" :user-data="userData" @reload="getTableData"></dc-box>
<dc-box @close="closeDcBox" :dc="dc" :user-data="userData" @reload="getTableData" v-if="rightBox.dc.show"></dc-box>
</transition>
<transition name="right-box">
<traffic-setting-box @close="closeTrafficBox" :dc="dc" ref="trafficBox" v-if="rightBox.trafficSetting.show"></traffic-setting-box>
</transition>
<traffic-setting-box :dc-obj="currentDc" ref="trafficBox"></traffic-setting-box>
</div>
</template>
<script>
import bus from '../../../libs/bus';
import dcBox from "../../common/rightBox/dcBox"; //dc弹框
import trafficSettingBox from "../../common/rightBox/trafficSetting/trafficSettingBox";
export default {
name: "dc",
components:{
'traffic-setting-box': trafficSettingBox,
'dc-box': dcBox
},
data() {
return {
@@ -166,7 +171,6 @@
subResizeShow: true,
isFullScreen: false,
showSubList: false, //是否展示二级列表
cabinetDc: {}, // 用在二级cabinet列表页里
dcDetail: [], //dc的详情信息包含标题
toTopBtnTop: this.$tableHeight.toTopBtnTop, //to-top按钮的top属性
@@ -185,10 +189,14 @@
tel: '',
principal: '',
area: {
id: '',
id: 0,
name: ''
}
},
rightBox: {
dc: {show: false},
trafficSetting: {show: false}
},
pageObj: {
pageNo: 1,
pageSize: 50,
@@ -301,28 +309,22 @@
}
});
},
edit: function (u) {
let tempDc = JSON.parse(JSON.stringify(u));
if (!tempDc.area) {
this.$set(tempDc, 'area', {id: '', name: ''});
edit(u) {
this.dc = JSON.parse(JSON.stringify(u));
if (!this.dc.area) {
this.$set(this.dc, 'area', {id: '', name: ''});
}
this.currentDc = tempDc;
this.$refs.dcBox.show(true, true);
this.rightBox.dc.show = true;
},
configTraffic: function (u) {
let tempDc = JSON.parse(JSON.stringify(u));
this.currentDc = tempDc;
setTimeout(()=>{
this.$refs.trafficBox.show(true, true);
},200)
configTraffic(u) {
this.dc = JSON.parse(JSON.stringify(u));
this.rightBox.trafficSetting.show = true;
},
detail(obj) {
let tempDc = JSON.parse(JSON.stringify(obj));
if (!tempDc.area) {
this.$set(tempDc, 'area', {id: '', name: ''});
detail(u) {
this.dc = JSON.parse(JSON.stringify(u));
if (!this.dc.area) {
this.$set(this.dc, 'area', {id: '', name: ''});
}
this.cabinetDc = tempDc;
this.targetTab = "detail";
this.showSubList = true;
},
@@ -362,12 +364,24 @@
},
add() {
this.dc = this.newDc();
this.rightBox.show = true;
this.rightBox.dc.show = true;
},
newDc() {
return JSON.parse(JSON.stringify(this.blankDc));
},
del: function (u) {
closeDcBox(refresh) {
this.rightBox.dc.show = false;
if (refresh) {
this.getTableData();
}
},
closeTrafficBox(refresh) {
this.rightBox.trafficSetting.show = false;
if (refresh) {
this.getTableData();
}
},
del(u) {
this.$confirm(this.$t("tip.confirmDelete"), {
confirmButtonText: this.$t("tip.yes"),
cancelButtonText: this.$t("tip.no"),
@@ -383,7 +397,7 @@
});
});
},
getTableData: function () {
getTableData() {
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
this.loading = true;
@@ -433,7 +447,7 @@
},
showCabinet(dc) {
this.targetTab = 'cabinet';
this.cabinetDc = JSON.parse(JSON.stringify(dc));
this.dc = JSON.parse(JSON.stringify(dc));
this.showSubList = true;
},
//是否需要排序
@@ -469,11 +483,13 @@
},
},
watch: {
cabinetDc: {
dc: {
deep: true,
handler(n) {
if (n.id) {
this.dcDetail = this.convertToDetail(n);
}
}
},
showSubList(n) {
this.$bottomBoxWindow.showSubListWatch(vm, n);

View File

@@ -308,9 +308,6 @@
this.$store.commit('setHeaderTable', data);
this.tablelable = data;
},
clickos() {
this.rightBox.show = false;
},
edit(u) {
this.promServer = JSON.parse(JSON.stringify(u));
this.rightBox.show = true;

View File

@@ -39,9 +39,7 @@ import dcConfigBox from "./components/common/popBox/dcConfig"; //idc配置弹框
import panelBox from "./components/common/rightBox/panelBox"; //面板弹框组件
import moduleListPop from "./components/page/asset/moduleListPop"; //面板弹框组件
import cabinetConfigBox from "./components/common/popBox/cabinetConfig"; //面板弹框组件
import dcBox from "./components/common/rightBox/dcBox"; //dc弹框
import modelBox from "./components/common/rightBox/modelBox"; //model弹框
import selectArea from "./components/common/popBox/selectArea"; //dc弹框
import bottomBox from "./components/common/bottomBox/bottomBox"; //上滑框
import "perfect-scrollbar/css/perfect-scrollbar.css";
import loading from "./components/common/loading";
@@ -64,9 +62,7 @@ Vue.component("idc-config-box", dcConfigBox);
Vue.component("panel-box", panelBox);
Vue.component("module-list-pop", moduleListPop);
Vue.component("cabinet-config-box", cabinetConfigBox);
Vue.component("dc-box", dcBox);
Vue.component("model-box", modelBox);
Vue.component("select-area", selectArea);
Vue.component('loading',loading);
Vue.component('bottom-box', bottomBox);
Vue.component('mib-box',mibBox);