2019-12-02 16:16:26 +08:00
|
|
|
|
<template>
|
2019-12-26 16:31:53 +08:00
|
|
|
|
<div class="header">
|
|
|
|
|
|
<div class="submenu">
|
|
|
|
|
|
<el-menu
|
|
|
|
|
|
class="nz-menu"
|
|
|
|
|
|
mode="horizontal"
|
|
|
|
|
|
background-color="#232f3e"
|
|
|
|
|
|
text-color="#ffffff"
|
|
|
|
|
|
unique-opened
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-submenu index="0" popper-class="nz-submenu">
|
|
|
|
|
|
<template slot="title">
|
|
|
|
|
|
<div class="menu-create">
|
|
|
|
|
|
<i class="el-icon-plus"></i>
|
|
|
|
|
|
<div>{{$t('overall.create')}}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-for="(item, index) in createMenu">
|
|
|
|
|
|
<el-menu-item :index="'0-' + index">
|
|
|
|
|
|
<div @click="createBox(item)">
|
|
|
|
|
|
<span>{{item.label}}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-submenu>
|
2019-12-27 17:53:17 +08:00
|
|
|
|
<el-submenu index="1" popper-class="nz-submenu">
|
2019-12-26 16:40:13 +08:00
|
|
|
|
<template slot="title">
|
|
|
|
|
|
<div @click="jumpTo('dashboard')">{{$t('overall.dashboard')}}</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<el-menu-item index="1-0">
|
|
|
|
|
|
<div @click="jumpTo('panel')">{{$t('dashboard.panel.title')}}</div>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
<el-menu-item index="1-1">
|
|
|
|
|
|
<div @click="jumpTo('metricPreview')">{{$t('dashboard.metricPreview.title')}}</div>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
</el-submenu>
|
|
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
<el-submenu index="2" popper-class="nz-submenu">
|
|
|
|
|
|
<template slot="title">
|
|
|
|
|
|
<div @click="jumpToProject(projectData[0])">{{$t('overall.project')}}</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-for="(item, index) in projectData">
|
|
|
|
|
|
<el-menu-item :index="'2-' + index">
|
|
|
|
|
|
<div @click="jumpToProject(item)">
|
|
|
|
|
|
<span>{{item.name}}</span>
|
2019-12-27 17:53:17 +08:00
|
|
|
|
<div @click.stop="toEditProject(item)" class="menu-edit"><i style="color: inherit"
|
|
|
|
|
|
class="el-icon-edit-outline"></i></div>
|
2019-12-26 16:31:53 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-submenu>
|
2019-12-27 17:53:17 +08:00
|
|
|
|
<el-submenu index="3" popper-class="nz-submenu">
|
|
|
|
|
|
<template slot="title">
|
|
|
|
|
|
<div @click="jumpTo('asset')">{{$t('overall.asset')}}</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-for="(item, index) in assetData">
|
|
|
|
|
|
<el-menu-item :index="'3-' + index">
|
|
|
|
|
|
<div @click="jumpToAsset('asset',item.id)">
|
|
|
|
|
|
<span>{{item.name}}</span>
|
2020-01-10 18:16:25 +08:00
|
|
|
|
<idc-config-box :post-idc="item" ref="idcConfigBox" placement="left" @after="getIDCOptionData" :button-class="'menu-edit'">
|
2020-01-08 09:16:34 +08:00
|
|
|
|
<template v-slot:optionZone>
|
2020-01-10 18:16:25 +08:00
|
|
|
|
<div @click="closeAllPop">
|
|
|
|
|
|
<i class="el-icon-edit-outline" @click="getIDCOptionData(item.id)" style="color: inherit"></i>
|
|
|
|
|
|
</div>
|
2020-01-08 09:16:34 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</idc-config-box>
|
|
|
|
|
|
<!--<el-popover
|
2019-12-27 17:53:17 +08:00
|
|
|
|
placement="bottom"
|
|
|
|
|
|
v-model="item[item.name]"
|
|
|
|
|
|
trigger="click"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="pop-window-assetType-content">
|
|
|
|
|
|
<div class="right-box-top-btns">
|
|
|
|
|
|
<div class="right-box-top-btn right-box-top-btn-full"
|
|
|
|
|
|
@click="item[item.name] = false">
|
|
|
|
|
|
<div class="right-box-btn-icon">
|
|
|
|
|
|
<i class="el-icon-close"></i>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span>{{$t('overall.esc')}}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="pop-window">
|
|
|
|
|
|
<span style="display: block;padding-bottom: 20px">标题</span>
|
|
|
|
|
|
<div style="padding-top: 10px;padding-left: 20px">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label style="font-size: 12px">DN name</label>
|
|
|
|
|
|
<input class='sidebar-pop-input' v-model="addIdcData.name"/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="padding-top: 40px">
|
|
|
|
|
|
<label style="font-size: 12px">Loaction</label>
|
|
|
|
|
|
<input class='sidebar-pop-input' v-model="addIdcData.location"/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="padding-top: 40px">
|
|
|
|
|
|
<label style="font-size: 12px;padding-right: 20px">负责人</label>
|
|
|
|
|
|
<select class='sidebar-pop-input-select'
|
|
|
|
|
|
style="margin-left:-40px "
|
|
|
|
|
|
v-model="addIdcData.principal"
|
|
|
|
|
|
clearable>
|
|
|
|
|
|
<option
|
|
|
|
|
|
v-for="item in idcUserData"
|
|
|
|
|
|
:key="item.key"
|
|
|
|
|
|
:label="item.username"
|
|
|
|
|
|
:value="item.userId"
|
|
|
|
|
|
>
|
|
|
|
|
|
</option>
|
|
|
|
|
|
</select>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="padding-top: 40px">
|
|
|
|
|
|
<label style="font-size: 12px">Tel</label>
|
|
|
|
|
|
<input class='sidebar-pop-input' v-model="addIdcData.tel"/>
|
|
|
|
|
|
</div>
|
2019-12-26 17:39:30 +08:00
|
|
|
|
</div>
|
2019-12-27 17:53:17 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="right-box-bottom-btns">
|
|
|
|
|
|
<div class="right-box-bottom-btn right-box-bottom-btn-cancel"
|
|
|
|
|
|
@click.stop="item[item.name]= false">
|
|
|
|
|
|
{{$t('overall.cancel')}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="right-box-bottom-btn right-box-bottom-btn-50"
|
|
|
|
|
|
@click="editData('idc',item.id)">
|
|
|
|
|
|
{{$t('overall.save')}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div @click.stop="getIDCOptionData(item.id)" slot="reference" class="menu-edit">
|
|
|
|
|
|
<i style="color: inherit" class="el-icon-edit-outline"></i>
|
|
|
|
|
|
</div>
|
2020-01-08 09:16:34 +08:00
|
|
|
|
</el-popover>-->
|
2019-12-27 17:53:17 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-submenu>
|
2019-12-26 16:31:53 +08:00
|
|
|
|
<el-submenu index="4-0" popper-class="nz-submenu">
|
|
|
|
|
|
<template slot="title">
|
|
|
|
|
|
<div @click="jumpTo('alertList')">{{$t('overall.alert')}}</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<el-menu-item index="4-1">
|
|
|
|
|
|
<div @click="jumpTo('alertList')">{{$t('alert.alertList')}}</div>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
<el-menu-item index="4-2">
|
|
|
|
|
|
<div @click="jumpTo('alertConfig')">{{$t('alert.alertConfig')}}</div>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
</el-submenu>
|
|
|
|
|
|
<el-submenu index="5" popper-class="nz-submenu">
|
|
|
|
|
|
<template slot="title">
|
|
|
|
|
|
<div @click="jumpTo('account')">{{$t('overall.config')}}</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<el-menu-item index="5-0">
|
|
|
|
|
|
<div @click="jumpTo('account')">{{$t('config.account.account')}}</div>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
<el-menu-item index="5-1">
|
|
|
|
|
|
<div @click="jumpTo('promServer')">{{$t('config.promServer.promServerList')}}</div>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
</el-submenu>
|
|
|
|
|
|
</el-menu>
|
2019-12-05 16:48:23 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="header-right">
|
|
|
|
|
|
<el-menu
|
|
|
|
|
|
class=""
|
|
|
|
|
|
mode="horizontal"
|
|
|
|
|
|
background-color="#232f3e"
|
|
|
|
|
|
text-color="#ffffff"
|
|
|
|
|
|
unique-opened
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-submenu index="6" popper-class="nz-submenu">
|
|
|
|
|
|
<template slot="title">
|
|
|
|
|
|
<div>{{username}}</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<el-menu-item index="6-0">
|
|
|
|
|
|
<div :style="language=='en'?'color:#f90':''" @click="changeLocal('en')">English</div>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
<el-menu-item index="6-1">
|
|
|
|
|
|
<div :style="language=='cn'?'color:#f90':''" @click="changeLocal('cn')">中文</div>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
<el-menu-item class="nz-menu-line" @click.stop index="6-2">
|
|
|
|
|
|
<div style="height: 1px; width: 100%; background-color: #cccccc;"></div>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
<el-menu-item index="6-3">
|
|
|
|
|
|
<div @click="logout">{{$t('overall.signOut')}}</div>
|
|
|
|
|
|
</el-menu-item>
|
|
|
|
|
|
</el-submenu>
|
|
|
|
|
|
</el-menu>
|
|
|
|
|
|
<!--<div class="header-user-con">
|
|
|
|
|
|
<div class="flagselect">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-popover
|
|
|
|
|
|
placement="bottom"
|
|
|
|
|
|
title=""
|
|
|
|
|
|
width="200"
|
|
|
|
|
|
trigger="hover"
|
2019-12-25 20:33:58 +08:00
|
|
|
|
>
|
2019-12-26 16:31:53 +08:00
|
|
|
|
<div class="userout">
|
|
|
|
|
|
<div :style="language!='en'?'color:#a6a6a6':''" @click="changeLocal('en')">
|
|
|
|
|
|
<p>English</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div :style="language=='cn'?'':'color:#a6a6a6'" @click="changeLocal('cn')">
|
|
|
|
|
|
<p>简体</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="cursor:no-drop;color:#a6a6a6">
|
|
|
|
|
|
<p>русский</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="sign-out" @click="jumpTo('')">
|
|
|
|
|
|
退出登录
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div slot="reference" class="user-avator">
|
|
|
|
|
|
<span>用户名</span>
|
|
|
|
|
|
<i class="el-submenu__icon-arrow el-icon-arrow-down header-name-jiantou"></i>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-popover>
|
|
|
|
|
|
</div>-->
|
2019-12-02 16:16:26 +08:00
|
|
|
|
</div>
|
2020-01-03 17:17:09 +08:00
|
|
|
|
<panel-box :panel="editPanel" @reload="panelListReload" @reloadForDel="" ref="panelBox"></panel-box>
|
2019-12-31 19:02:58 +08:00
|
|
|
|
<project-box :project="editProject" ref="projectBox"></project-box>
|
2019-12-26 16:31:53 +08:00
|
|
|
|
<module-box :currentProject="currentProject" :module="editModule" @reload="" ref="moduleBox"></module-box>
|
2019-12-27 17:53:17 +08:00
|
|
|
|
<add-endpoint-box :currentProject="currentProject" :currentModule="currentModule" @reload=""
|
|
|
|
|
|
ref="addEndpointBox"></add-endpoint-box>
|
2019-12-26 16:31:53 +08:00
|
|
|
|
<alert-config-box :parentAlertRule="alertRule" @reload="" ref="alertConfigBox"></alert-config-box>
|
|
|
|
|
|
</div>
|
2019-12-02 16:16:26 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2019-12-26 16:31:53 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: "Header",
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
username: sessionStorage.getItem("nz-username"),
|
|
|
|
|
|
language: localStorage.getItem("nz-language"),
|
|
|
|
|
|
assetData: [],
|
2020-01-03 17:17:09 +08:00
|
|
|
|
editPanel:{//新增or编辑的panel
|
|
|
|
|
|
id:'',
|
|
|
|
|
|
name: ''
|
|
|
|
|
|
},
|
2019-12-26 16:31:53 +08:00
|
|
|
|
projectData: [], //顶部菜单project列表中的数据
|
|
|
|
|
|
editProject: {id: '', name: '', remark: ''}, //新增/编辑的project
|
|
|
|
|
|
currentProject: {id: '', name: '', remark: ''}, //module/endpoint弹框用来回显project
|
|
|
|
|
|
editModule: {id: '', name: '', project: {}, port: '', path: '', param: '', paramObj: []}, //新增/编辑的module
|
|
|
|
|
|
currentModule: {id: '', name: '', project: {}, port: '', path: '', param: '', paramObj: []}, //endpoint弹框用来回显module,此处固定为空对象
|
|
|
|
|
|
editEndpoint: { //新增/编辑的endpoint
|
|
|
|
|
|
id: '',
|
|
|
|
|
|
host: '',
|
|
|
|
|
|
port: '',
|
|
|
|
|
|
param: '',
|
|
|
|
|
|
path: '',
|
|
|
|
|
|
asset: {id: '', name: '', host: ''},
|
|
|
|
|
|
project: {id: '', name: ''},
|
|
|
|
|
|
module: {id: '', name: '', param: '', paramObj: {}, projectId: ''},
|
|
|
|
|
|
moduleId: '',
|
|
|
|
|
|
assetId: ''
|
2019-12-13 17:08:35 +08:00
|
|
|
|
},
|
2019-12-26 16:31:53 +08:00
|
|
|
|
alertRule: {
|
|
|
|
|
|
id: '',
|
|
|
|
|
|
alertName: '',
|
|
|
|
|
|
type: '',
|
|
|
|
|
|
linkObject: {id: '', name: ''},
|
|
|
|
|
|
linkId: '',
|
|
|
|
|
|
expr: '',
|
|
|
|
|
|
last: '',
|
|
|
|
|
|
severity: '',
|
|
|
|
|
|
summary: '',
|
|
|
|
|
|
description: '',
|
|
|
|
|
|
receiver: '',
|
2019-12-13 17:08:35 +08:00
|
|
|
|
},
|
2019-12-26 16:31:53 +08:00
|
|
|
|
createMenu: [ //新增按钮内容
|
2020-01-03 17:17:09 +08:00
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('dashboard.panel.createPanelTitle'),
|
|
|
|
|
|
url: 'panel',
|
|
|
|
|
|
type: 0
|
|
|
|
|
|
},
|
2019-12-26 16:31:53 +08:00
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('project.project.createProject'),
|
|
|
|
|
|
url: 'project',
|
|
|
|
|
|
type: 1
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('project.module.createModule'),
|
|
|
|
|
|
url: 'project',
|
|
|
|
|
|
type: 2
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('project.endpoint.createEndpoint'),
|
|
|
|
|
|
url: 'project',
|
|
|
|
|
|
type: 3
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('asset.createAsset'),
|
|
|
|
|
|
url: 'asset',
|
|
|
|
|
|
type: 4
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
label: this.$t('alert.config.createAlertConfig'),
|
|
|
|
|
|
url: 'alertConfig',
|
|
|
|
|
|
type: 5
|
|
|
|
|
|
}
|
2019-12-26 17:39:30 +08:00
|
|
|
|
],
|
|
|
|
|
|
addIdcData: {
|
|
|
|
|
|
id: '',
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
location: '',
|
|
|
|
|
|
principal: '',
|
|
|
|
|
|
tel: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
idcUserData: '',
|
|
|
|
|
|
IDCOptionData: [],
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
jumpTo(data) {
|
|
|
|
|
|
this.$router.push({
|
|
|
|
|
|
path: "/" + data,
|
|
|
|
|
|
query: {
|
|
|
|
|
|
t: +new Date()
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2019-12-26 17:39:30 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
createBox(item) {
|
2020-01-03 17:17:09 +08:00
|
|
|
|
if (item.type == 0) {
|
|
|
|
|
|
this.$refs.panelBox.show(true);
|
|
|
|
|
|
this.editPanel = {id: '', name: ''};
|
|
|
|
|
|
}else if (item.type == 1) {
|
2020-01-07 17:41:46 +08:00
|
|
|
|
this.$refs.projectBox.show(true,true);
|
2019-12-26 16:31:53 +08:00
|
|
|
|
this.editProject = {id: '', name: '', remark: ''};
|
|
|
|
|
|
} else if (item.type == 2) {
|
2020-01-07 17:41:46 +08:00
|
|
|
|
this.$refs.moduleBox.show(true,true);
|
2019-12-27 17:53:17 +08:00
|
|
|
|
this.editModule = {
|
|
|
|
|
|
id: '',
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
project: this.$store.state.currentProject,
|
|
|
|
|
|
port: '',
|
|
|
|
|
|
path: '',
|
|
|
|
|
|
param: '',
|
|
|
|
|
|
paramObj: []
|
|
|
|
|
|
};
|
2019-12-26 16:31:53 +08:00
|
|
|
|
} else if (item.type == 3) {
|
|
|
|
|
|
this.$refs.addEndpointBox.show(true);
|
|
|
|
|
|
this.$refs.addEndpointBox.clearEndpoints();
|
|
|
|
|
|
} else if (item.type == 5) {
|
|
|
|
|
|
this.$refs.alertConfigBox.show(true, true);
|
2019-12-13 17:08:35 +08:00
|
|
|
|
}
|
2019-12-26 16:31:53 +08:00
|
|
|
|
},
|
|
|
|
|
|
jumpToAsset(data, id) {
|
2020-01-08 09:16:34 +08:00
|
|
|
|
if (id != this.$store.state.assetData.selectedData) {
|
|
|
|
|
|
this.$store.state.assetData = {selectedData: id, step: this.$store.state.assetData.step+1};
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$store.state.assetData.step = this.$store.state.assetData.step+1;
|
|
|
|
|
|
}
|
2019-12-26 16:31:53 +08:00
|
|
|
|
this.jumpTo(data);
|
|
|
|
|
|
},
|
|
|
|
|
|
jumpToProject(p) {
|
|
|
|
|
|
this.currentProject = p;
|
|
|
|
|
|
this.$store.commit('setProject', p);
|
|
|
|
|
|
this.jumpTo('project');
|
|
|
|
|
|
},
|
2019-12-26 17:39:30 +08:00
|
|
|
|
getUserData() {
|
|
|
|
|
|
this.$get('sys/user/list').then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.idcUserData = response.data.list
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
getIDCOptionData(data) {
|
|
|
|
|
|
this.$get('idc?id=' + data).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.addIdcData = response.data.list[0];
|
|
|
|
|
|
this.clickFlush(this.addIdcData)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
editData(data, Id) {
|
|
|
|
|
|
let idcData = {
|
|
|
|
|
|
id: '',
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
location: '',
|
|
|
|
|
|
principal: '',
|
|
|
|
|
|
tel: ''
|
|
|
|
|
|
}
|
|
|
|
|
|
if (data === 'idc') {
|
|
|
|
|
|
idcData.id = Id
|
|
|
|
|
|
idcData.name = this.addIdcData.name
|
|
|
|
|
|
idcData.location = this.addIdcData.location
|
|
|
|
|
|
idcData.principal = this.addIdcData.principal
|
|
|
|
|
|
idcData.tel = this.addIdcData.tel
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$put(data, idcData).then(res => {
|
|
|
|
|
|
const h = this.$createElement;
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
this.$notify({
|
|
|
|
|
|
message: h('i', {style: 'color: teal'}, '修改成功'),
|
|
|
|
|
|
duration: 2000
|
|
|
|
|
|
})
|
|
|
|
|
|
this.$store.state.flushDataSign = true
|
2019-12-27 17:53:17 +08:00
|
|
|
|
} else {
|
2019-12-26 17:39:30 +08:00
|
|
|
|
this.$notify({
|
|
|
|
|
|
message: h('i', {style: 'color: teal'}, res.msg),
|
|
|
|
|
|
duration: 2000
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
clickFlush(itemData) {
|
|
|
|
|
|
for (let i = 0; i < this.assetData.length; i++) {
|
|
|
|
|
|
const element = this.assetData[i];
|
|
|
|
|
|
if (element.id === itemData.id) {
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
element[element.name] = true;
|
|
|
|
|
|
}, 100)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
element[element.name] = false
|
|
|
|
|
|
}
|
2019-12-02 16:16:26 +08:00
|
|
|
|
}
|
2019-12-26 16:31:53 +08:00
|
|
|
|
},
|
|
|
|
|
|
getAssetData() {
|
|
|
|
|
|
this.$get('idc', this.pageObj).then(response => {
|
|
|
|
|
|
if (response.code == 200) {
|
|
|
|
|
|
this.assetData = response.data.list
|
2019-12-26 17:39:30 +08:00
|
|
|
|
this.assetData.forEach(item => {
|
|
|
|
|
|
this.$set(item, item.name, false)
|
|
|
|
|
|
})
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2019-12-26 17:39:30 +08:00
|
|
|
|
changeLocal(lang) {
|
|
|
|
|
|
if (lang != localStorage.getItem("nz-language")) {
|
|
|
|
|
|
localStorage.setItem("nz-language", lang);
|
|
|
|
|
|
window.location.reload();
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2020-01-10 18:16:25 +08:00
|
|
|
|
closeAllPop:function(){
|
|
|
|
|
|
this.$refs.idcConfigBox.forEach((item)=>{
|
|
|
|
|
|
item.show(false)
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2019-12-26 16:31:53 +08:00
|
|
|
|
getProjectList() {
|
|
|
|
|
|
this.$get('project', {}).then(response => {
|
|
|
|
|
|
if (response.code == 200) {
|
|
|
|
|
|
this.projectData = response.data.list;
|
|
|
|
|
|
let flag = false;
|
|
|
|
|
|
//如果currentProject不在新取到的数据里,说明它被删了
|
|
|
|
|
|
for (let i = 0; i < this.projectData.length; i++) {
|
|
|
|
|
|
if (this.projectData[i].id == this.currentProject.id) {
|
|
|
|
|
|
flag = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!flag && this.projectData.length > 0) {
|
|
|
|
|
|
this.currentProject = this.projectData[0];
|
|
|
|
|
|
this.$store.commit('setProject', this.currentProject);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
toEditProject(p) {
|
2020-01-07 18:11:54 +08:00
|
|
|
|
this.$refs.projectBox.show(true,true);
|
2019-12-26 16:31:53 +08:00
|
|
|
|
this.editProject = Object.assign({}, p);
|
|
|
|
|
|
},
|
2020-01-03 17:17:09 +08:00
|
|
|
|
panelListReload(){
|
|
|
|
|
|
if(this.$route.path==='/panel'){
|
|
|
|
|
|
this.$store.commit('panelListChange',true);//新增panel之后,且当前页面为panel页面,则更新panel列表
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2019-12-26 16:31:53 +08:00
|
|
|
|
logout() {
|
|
|
|
|
|
this.$get('logout');
|
|
|
|
|
|
this.jumpTo('login');
|
2019-12-18 17:00:44 +08:00
|
|
|
|
}
|
2019-12-02 16:16:26 +08:00
|
|
|
|
},
|
2019-12-26 16:31:53 +08:00
|
|
|
|
created() {
|
|
|
|
|
|
if (!localStorage.getItem("nz-language")) {
|
|
|
|
|
|
localStorage.setItem("nz-language", "en");
|
|
|
|
|
|
}
|
|
|
|
|
|
this.language = localStorage.getItem("nz-language");
|
2019-12-12 17:15:33 +08:00
|
|
|
|
},
|
2019-12-26 16:31:53 +08:00
|
|
|
|
mounted() {
|
2019-12-26 17:39:30 +08:00
|
|
|
|
this.getUserData();
|
2019-12-26 16:31:53 +08:00
|
|
|
|
this.getAssetData();
|
|
|
|
|
|
this.getProjectList();
|
2019-12-02 16:16:26 +08:00
|
|
|
|
},
|
2019-12-26 16:31:53 +08:00
|
|
|
|
computed: {
|
|
|
|
|
|
projectListReloadWatch() {
|
2019-12-31 19:02:58 +08:00
|
|
|
|
return this.$store.state.projectListChange;
|
2019-12-27 17:08:39 +08:00
|
|
|
|
},
|
|
|
|
|
|
getIdcData() {
|
2020-01-08 10:17:31 +08:00
|
|
|
|
return this.$store.state.assetDcList;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2019-12-05 16:48:23 +08:00
|
|
|
|
},
|
2019-12-26 16:31:53 +08:00
|
|
|
|
watch: {
|
2019-12-27 17:53:17 +08:00
|
|
|
|
getIdcData: {
|
2019-12-27 17:08:39 +08:00
|
|
|
|
handler(newVal, oldVal) {
|
|
|
|
|
|
this.getAssetData()
|
|
|
|
|
|
},
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
},
|
2019-12-26 16:31:53 +08:00
|
|
|
|
projectListReloadWatch(n, o) {
|
2019-12-31 19:02:58 +08:00
|
|
|
|
this.getProjectList();
|
2019-12-12 17:15:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2019-12-02 16:16:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
2019-12-27 17:53:17 +08:00
|
|
|
|
.el-menu.el-menu--horizontal {
|
2019-12-26 16:31:53 +08:00
|
|
|
|
border-bottom: 0px;
|
|
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.el-submenu__title .el-submenu__icon-arrow {
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
|
|
|
|
|
.el-menu--horizontal > .el-menu-item.is-active {
|
2019-12-26 16:31:53 +08:00
|
|
|
|
border-bottom: 0px;
|
|
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
|
|
|
|
|
.el-menu--horizontal > .el-submenu.is-active .el-submenu__title,
|
|
|
|
|
|
.el-menu--horizontal > .el-menu-item.is-active,
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.el-menu--horizontal .el-menu-item:not(.is-disabled):focus, .el-menu--horizontal .el-menu-item:not(.is-disabled):hover {
|
|
|
|
|
|
border-bottom: 0px;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.el-menu--horizontal.nz-submenu {
|
|
|
|
|
|
border: 1px solid #bbbbbb;
|
|
|
|
|
|
border-top: none;
|
|
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.nz-submenu .el-menu--popup {
|
|
|
|
|
|
background-color: white !important;
|
|
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.nz-submenu .el-menu--popup .el-menu-item {
|
|
|
|
|
|
background-color: white !important;
|
|
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.nz-submenu .el-menu--popup-bottom-start {
|
|
|
|
|
|
margin-top: 0;
|
2020-01-02 18:13:01 +08:00
|
|
|
|
box-shadow: 0 2px 2px 0 rgba(0,0,0,.2);
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.nz-submenu.el-menu--horizontal .el-menu .el-menu-item {
|
|
|
|
|
|
padding: 0 20px;
|
|
|
|
|
|
color: #444444 !important;
|
|
|
|
|
|
transition: none;
|
|
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.nz-submenu.el-menu--horizontal .el-menu .el-menu-item:hover {
|
|
|
|
|
|
color: #ff9900 !important;
|
|
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.el-submenu__title .el-icon-plus {
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
|
|
|
|
|
.el-menu-item > div, .el-menu-item > div > div {
|
2019-12-26 16:31:53 +08:00
|
|
|
|
font-size: 15px;
|
|
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.nz-menu-line {
|
|
|
|
|
|
cursor: default;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
height: 18px !important;
|
|
|
|
|
|
}
|
2019-12-02 16:16:26 +08:00
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.submenu {
|
2019-12-02 16:16:26 +08:00
|
|
|
|
padding-left: 50%;
|
2019-12-06 17:36:33 +08:00
|
|
|
|
width: 500px;
|
2019-12-02 16:16:26 +08:00
|
|
|
|
float: left;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2019-12-05 16:48:23 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.header {
|
2019-12-02 16:16:26 +08:00
|
|
|
|
position: relative;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 60px;
|
2019-12-25 17:15:09 +08:00
|
|
|
|
background-color: #232f3e;
|
2019-12-06 16:43:04 +08:00
|
|
|
|
z-index: 510;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2019-12-05 16:48:23 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.header-right {
|
2019-12-02 16:16:26 +08:00
|
|
|
|
float: right;
|
|
|
|
|
|
padding-right: 5px;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2019-12-05 16:48:23 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.header-user-con {
|
2019-12-02 16:16:26 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
height: 50px;
|
|
|
|
|
|
align-items: center;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2019-12-05 16:48:23 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.user-avator {
|
2019-12-05 16:48:23 +08:00
|
|
|
|
padding: 0 5px 3px 0;
|
2019-12-02 16:16:26 +08:00
|
|
|
|
margin-left: 20px;
|
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
|
cursor: pointer;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2019-12-05 16:48:23 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.user-avator:hover {
|
2019-12-02 16:16:26 +08:00
|
|
|
|
border-radius: 2px;
|
2019-12-05 16:48:23 +08:00
|
|
|
|
background: rgba(255, 255, 255, .3);
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2019-12-05 16:48:23 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.user-avator span {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
margin: 0 5px;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
}
|
2019-12-05 16:48:23 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.user-avator i.iconfont {
|
2019-12-02 16:16:26 +08:00
|
|
|
|
color: #fff;
|
|
|
|
|
|
font-size: 25px;
|
|
|
|
|
|
transform: translateY(2.5px);
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
line-height: 30px;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2019-12-05 16:48:23 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.userout {
|
2019-12-02 16:16:26 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: space-between;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2019-12-05 16:48:23 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.userout > div {
|
2019-12-02 16:16:26 +08:00
|
|
|
|
width: 33.3%;
|
|
|
|
|
|
color: rgba(51, 137, 185, 1);
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
text-align: center;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2019-12-05 16:48:23 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.sign-out {
|
2019-12-02 16:16:26 +08:00
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 30px;
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
|
background: rgba(51, 137, 185, 1);
|
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
|
cursor: pointer;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2019-12-05 16:48:23 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.sign-out:hover {
|
2019-12-02 16:16:26 +08:00
|
|
|
|
opacity: .8;
|
2019-12-26 16:31:53 +08:00
|
|
|
|
}
|
2019-12-05 16:48:23 +08:00
|
|
|
|
|
2019-12-27 17:53:17 +08:00
|
|
|
|
.nz-menu > li:first-of-type {
|
2019-12-26 16:31:53 +08:00
|
|
|
|
position: fixed;
|
|
|
|
|
|
left: 40%;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.menu-create {
|
|
|
|
|
|
line-height: 15px;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
padding-top: 15px;
|
|
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.menu-create .el-icon-plus {
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
line-height: 12px;
|
|
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
2019-12-26 16:31:53 +08:00
|
|
|
|
.menu-edit {
|
|
|
|
|
|
line-height: 36px;
|
|
|
|
|
|
float: right;
|
|
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
2019-12-26 17:39:30 +08:00
|
|
|
|
.pop-window-assetType-content {
|
2019-12-27 17:53:17 +08:00
|
|
|
|
padding: 1px 15px 15px 20px;
|
2019-12-26 17:39:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.pop-window {
|
2019-12-27 17:53:17 +08:00
|
|
|
|
height: 370px;
|
|
|
|
|
|
width: 400px;
|
2019-12-26 17:39:30 +08:00
|
|
|
|
}
|
2019-12-27 17:53:17 +08:00
|
|
|
|
|
2019-12-26 17:39:30 +08:00
|
|
|
|
.sidebar-pop-input {
|
2019-12-27 17:53:17 +08:00
|
|
|
|
position: absolute;
|
|
|
|
|
|
right: 50px;
|
|
|
|
|
|
width: 200px;
|
|
|
|
|
|
height: 26px;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
border: 1px solid #DCDFE6;
|
|
|
|
|
|
color: #606266;
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
padding: 0px 15px;
|
2019-12-26 17:39:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sidebar-pop-input-select {
|
2019-12-27 17:53:17 +08:00
|
|
|
|
position: absolute;
|
|
|
|
|
|
right: 83px;
|
|
|
|
|
|
width: 200px;
|
|
|
|
|
|
height: 26px;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
border: 1px solid #DCDFE6;
|
|
|
|
|
|
color: #606266;
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
padding: 0px 15px;
|
2019-12-26 17:39:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.right-box-top-btn {
|
2019-12-27 17:53:17 +08:00
|
|
|
|
border-radius: 0 0 9px 9px;
|
|
|
|
|
|
float: right;
|
|
|
|
|
|
color: #656565;
|
|
|
|
|
|
height: 30px;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
padding: 3px 8px 1px 8px;
|
|
|
|
|
|
border: 1px solid #aaaaaa;
|
|
|
|
|
|
border-top: none;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
margin-left: 20px;
|
2019-12-26 17:39:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.right-box-bottom-btns {
|
2019-12-27 17:53:17 +08:00
|
|
|
|
position: absolute;
|
|
|
|
|
|
bottom: 0px;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
text-align: center;
|
2019-12-26 17:39:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.right-box-bottom-btn-cancel {
|
2019-12-27 17:53:17 +08:00
|
|
|
|
background-color: #DADADA;
|
|
|
|
|
|
color: #656565;
|
|
|
|
|
|
width: 50%;
|
|
|
|
|
|
border-bottom-left-radius: 8px;
|
2019-12-26 17:39:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.right-box-top-btn-full {
|
2019-12-27 17:53:17 +08:00
|
|
|
|
background-color: #656565;
|
|
|
|
|
|
border: 1px solid #656565;
|
|
|
|
|
|
border-top: none;
|
|
|
|
|
|
color: white;
|
2019-12-26 17:39:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.right-box-bottom-btn-50 {
|
2019-12-27 17:53:17 +08:00
|
|
|
|
width: 50%;
|
|
|
|
|
|
float: right;
|
|
|
|
|
|
border-bottom-right-radius: 8px;
|
2019-12-26 17:39:30 +08:00
|
|
|
|
}
|
2019-12-05 18:07:58 +08:00
|
|
|
|
</style>
|
2020-01-08 09:16:34 +08:00
|
|
|
|
<style>
|
|
|
|
|
|
.menu-edit {
|
|
|
|
|
|
line-height: 36px;
|
|
|
|
|
|
float: right;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|