Merge remote-tracking branch 'origin/codeCheck' into codeCheck
# Conflicts: # nezha-fronted/src/components/page/asset/asset.vue
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
<el-submenu index="1" popper-class="nz-submenu">
|
||||
<template slot="title">
|
||||
<div @click="jumpTo('dashboard')" :class ="(activeIndex == 'dashboard' || activeIndex == 'panel' || activeIndex == 'metricPreview') ? 'menu-active' :'' " >
|
||||
{{$t('overall.dashboard')}}
|
||||
{{$t('overall.dashboard')}}
|
||||
</div>
|
||||
</template>
|
||||
<el-menu-item index="1-0">
|
||||
@@ -58,13 +58,13 @@
|
||||
<el-menu-item :index="'3-' + index">
|
||||
<div @click="jumpToAsset(item.id)" :class="{'menu-item-active' : (activeIndex == 'asset' && indOf(activeItemIndexes, item.id) > -1) }">
|
||||
<span class="too-long-split" style="width: 130px;">{{item.name}}</span>
|
||||
<idc-config-box :post-idc="item" ref="idcConfigBox" placement="left" @after="getIDCOptionData">
|
||||
<template v-slot:optionZone>
|
||||
<div @click="closeAllPop" class="menu-edit">
|
||||
<i class="nz-icon nz-icon-edit" @click="getIDCOptionData(item.id)" style="color: inherit"></i>
|
||||
</div>
|
||||
</template>
|
||||
</idc-config-box>
|
||||
<!-- <idc-config-box :post-idc="item" ref="idcConfigBox" placement="left" @after="getIDCOptionData" :user-data="userDatas">-->
|
||||
<!-- <template v-slot:optionZone>-->
|
||||
<!-- <div @click="closeAllPop" class="menu-edit">-->
|
||||
<!-- <i class="nz-icon nz-icon-edit" @click="getIDCOptionData(item.id)" style="color: inherit"></i>-->
|
||||
<!-- </div>-->
|
||||
<!-- </template>-->
|
||||
<!-- </idc-config-box>-->
|
||||
</div>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
@@ -208,6 +208,7 @@
|
||||
idcUserData: '',
|
||||
IDCOptionData: [],
|
||||
addUnitShow: false,
|
||||
userDatas:[]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -231,9 +232,9 @@
|
||||
}
|
||||
});
|
||||
this.activeIndex = data
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
createBox(item) {
|
||||
if (item.type == 0) {
|
||||
this.$refs.panelBox.show(true);
|
||||
@@ -400,13 +401,21 @@
|
||||
logout() {
|
||||
this.$get('logout');
|
||||
this.jumpTo('login');
|
||||
}
|
||||
},
|
||||
getUserData() {
|
||||
this.$get('sys/user/list').then(response => {
|
||||
if (response.code === 200) {
|
||||
this.userDatas = response.data.list
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if (!localStorage.getItem("nz-language")) {
|
||||
localStorage.setItem("nz-language", "en");
|
||||
}
|
||||
this.language = localStorage.getItem("nz-language");
|
||||
this.getUserData();
|
||||
},
|
||||
mounted() {
|
||||
this.getUserData();
|
||||
@@ -491,7 +500,7 @@
|
||||
}
|
||||
.header .el-menu--horizontal>.el-submenu .el-submenu__title {
|
||||
min-width: 120px;
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
color:$header-text-color;
|
||||
padding: 0;
|
||||
}
|
||||
@@ -516,7 +525,7 @@
|
||||
}*/
|
||||
.el-submenu.is-active .el-submenu__title{
|
||||
border-bottom-color: transparent !important;
|
||||
}
|
||||
}
|
||||
.menu-create .menu-icon-create .nz-icon:before{
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
@@ -524,7 +533,7 @@
|
||||
font-size: 20px;
|
||||
margin-top:-4px;
|
||||
margin-bottom:6px;
|
||||
}
|
||||
}
|
||||
.el-submenu__icon-arrow .el-icon-arrow-down{
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,8 @@ export default {
|
||||
postCabinet:{type:Object},
|
||||
placement:{type:String},
|
||||
buttonClass:{type:String},
|
||||
isEdit:{type:Boolean,default:true}
|
||||
isEdit:{type:Boolean,default:true},
|
||||
postIdcDatas:{type:Array}
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
@@ -149,6 +150,17 @@ export default {
|
||||
},
|
||||
getIdcDatas:function(){
|
||||
let temp=this;
|
||||
if(temp.postIdcDatas&&temp.postIdcDatas.length>0){
|
||||
temp.idcDatas=temp.postIdcDatas;
|
||||
for (let i in temp.idcDatas){
|
||||
let item=temp.idcDatas[i];
|
||||
if(item.id==temp.cabinet.idcId){
|
||||
temp.idc=item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
temp.$get('idc').then(response => {
|
||||
if (response.code === 200) {
|
||||
temp.idcDatas = response.data.list;
|
||||
|
||||
@@ -110,14 +110,15 @@
|
||||
},
|
||||
getUserData() {
|
||||
let temp=this;
|
||||
if(!temp.userData||temp.userData.length<1){
|
||||
temp.$get('sys/user/list').then(response => {
|
||||
if (response.code === 200) {
|
||||
temp.principals = response.data.list
|
||||
console.log("queryUserData")
|
||||
}
|
||||
})
|
||||
if(temp.userData&&temp.userData.length>0){
|
||||
temp.principals=temp.userData;
|
||||
return;
|
||||
}
|
||||
temp.$get('sys/user/list').then(response => {
|
||||
if (response.code === 200) {
|
||||
temp.principals = response.data.list
|
||||
}
|
||||
})
|
||||
},
|
||||
saveOrToEdit:function(){
|
||||
if (!this.popBox.isEdit) {
|
||||
|
||||
@@ -86,6 +86,17 @@
|
||||
<div v-if="item.prop=='state'">
|
||||
<span>{{scope.row.state==1 ? $t('asset.createAssetTab.inStock') : $t('asset.createAssetTab.notInStock')}}</span>
|
||||
</div>
|
||||
<div v-if="item.prop == 'ping'">
|
||||
<el-popover
|
||||
placement="right"
|
||||
width="200"
|
||||
trigger="hover"
|
||||
:content="scope.row.pingLastUpdate+'['+scope.row.pingRtt+']'">
|
||||
<span slot="reference">
|
||||
<i :class="{'active-icon green':scope.row.pingState==1,'active-icon red':scope.row.pingState != 1}"></i>
|
||||
</span>
|
||||
</el-popover>
|
||||
</div>
|
||||
<template v-if="item.prop=='Module'">
|
||||
<template v-if="scope.row.moduleNum > 0" >
|
||||
<module-list-pop :asset-id="scope.row.id + ''" @openModuleBox="openModuleBox" placement="left" :ref="'moduleListPop' + scope.row.id">
|
||||
@@ -106,10 +117,9 @@
|
||||
<span class="link" @click="closeAllPop">{{scope.row.idc.name}}</span>
|
||||
</template>
|
||||
</idc-config-box>
|
||||
<!--<span class="link">{{scope.row.idc.name}}</span>-->
|
||||
</div>
|
||||
<template v-if="item.prop=='cabinet'">
|
||||
<cabinet-config-box v-if="scope.row.cabinet&&scope.row.cabinet!='--'" ref="cabinetConfigBox" placement="left" :is-edit="false" :post-cabinet="JSON.parse(JSON.stringify(scope.row.cabinet))" @after="getAssetData(null, true)">
|
||||
<cabinet-config-box v-if="scope.row.cabinet&&scope.row.cabinet!='--'" ref="cabinetConfigBox" placement="left" :is-edit="false" :post-cabinet="JSON.parse(JSON.stringify(scope.row.cabinet))" @after="getAssetData(null, true)" :post-idc-datas="IDCOptionData">
|
||||
<span slot="optionZone" @click="closeAllPop" class="link">{{returnData(scope.row.cabinet)}}</span>
|
||||
</cabinet-config-box>
|
||||
<span v-else>{{returnData(scope.row.cabinet)}}</span>
|
||||
@@ -196,6 +206,12 @@
|
||||
type: 'select',
|
||||
label: 'assetState',
|
||||
disabled: false
|
||||
},{
|
||||
id: 22,
|
||||
name: "pingStatus",
|
||||
type: 'select',
|
||||
label: 'pingStatus',
|
||||
disabled: false
|
||||
}],
|
||||
},
|
||||
searchLabel: {}, //搜索参数
|
||||
@@ -227,6 +243,10 @@
|
||||
prop: 'state',
|
||||
show: true,
|
||||
}, {
|
||||
label:this.$t('asset.tableTitle.assetPing'),
|
||||
prop:'ping',
|
||||
show:true,
|
||||
},{
|
||||
label: this.$t("asset.tableTitle.modules"),
|
||||
prop: 'Module',
|
||||
show: true,
|
||||
@@ -665,6 +685,10 @@
|
||||
this.getAssetData();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getUserData();
|
||||
this.getIDCOptionData();
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(()=>{
|
||||
if (this.$store.state.assetData.selectedData.length > 0) {
|
||||
@@ -672,9 +696,6 @@
|
||||
this.checkList = this.$store.state.assetData.selectedData;
|
||||
}
|
||||
}, 50);
|
||||
|
||||
this.getUserData();
|
||||
this.getIDCOptionData();
|
||||
let localStorageTitle=localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path);
|
||||
this.tablelable = localStorageTitle ? JSON.parse(localStorageTitle) : this.tableTitle;
|
||||
this.dropCol = localStorageTitle ? JSON.parse(localStorageTitle) : this.tableTitle;
|
||||
@@ -703,3 +724,17 @@
|
||||
margin-right:6px;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss">
|
||||
.active-icon{
|
||||
width:20px;
|
||||
height:20px;
|
||||
border-radius:50%;
|
||||
}
|
||||
.active-icon .red{
|
||||
background-color:red;
|
||||
}
|
||||
.active-icon .green{
|
||||
background-color:lightGreen;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user