feat:权限完善,修复了一些bug

This commit is contained in:
陈劲松
2020-12-15 21:13:07 +08:00
committed by chenjinsong
parent f8e1e544cd
commit b7b238bb1e
36 changed files with 281 additions and 299 deletions

View File

@@ -29,13 +29,13 @@
<ul slot="dropdown" v-show="dropdownMenuShow" v-if="data.editable" :id="'dropdownUl'+chartIndex" class="el-dropdown-menu nz-chart-dropdown" style="position: absolute; top: 30px; left: calc(50% - 79px); transform-origin: center top; z-index: 1000;" >
<li @click="refreshChart" class="el-dropdown-menu__item">
<i class="global-active-color el-icon-refresh-right" style="font-size: 16px;"></i><span>{{$t('dashboard.refresh')}}</span></li>
<li @click="editChart" class="el-dropdown-menu__item">
<li @click="editChart" class="el-dropdown-menu__item" v-has="`${from}_chart_toEdit`">
<i class="nz-icon nz-icon-edit" style="font-size: 14px; margin-right: 11px; margin-left: 1px;"></i>{{$t('dashboard.edit')}}</li>
<li @click="removeChart" class="el-dropdown-menu__item">
<li @click="removeChart" class="el-dropdown-menu__item" v-has="`${from}_chart_delete`">
<i class="nz-icon nz-icon-delete" style="font-size: 16px;"></i>{{$t('dashboard.delete')}}</li>
<li @click="showAllScreen" class="el-dropdown-menu__item">
<i class="el-icon-full-screen" style="font-size: 16px;"></i>{{$t('dashboard.screen')}}</li>
<li @click="duplicate" class="el-dropdown-menu__item">
<li @click="duplicate" class="el-dropdown-menu__item" v-has="`${from}_chart_duplicate`">
<i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}</li>
</ul>
</el-dropdown>
@@ -150,7 +150,8 @@ export default {
default: 0,
},
chartInfo:{},
id:''
id:'',
from: {type: String}
},
data() {
return {

View File

@@ -432,7 +432,7 @@
from: params.from
};
//alert-rule单独处理
if (param.from == "alertRule") {
if (param.from == this.$CONSTANTS.fromRoute.rule) {
this.dataList = [];
this.dataList.push({
id: -10,
@@ -478,7 +478,7 @@
return;
}
//endpoint单独处理
if (param.from == "endpoint") {
if (param.from == this.$CONSTANTS.fromRoute.endpoint) {
this.dataList = [];
// this.dataList.push({
// id: -8,
@@ -571,12 +571,12 @@
this.dataList.forEach((item,index) => {
this.setChartSize(item, index);//设置该图表宽度
this.$set(item, "from", params.from);
if (param.from == "asset") {
if (param.from == this.$CONSTANTS.fromRoute.asset) {
if (item.type == "assetInfo") {
this.$set(item, "draggable", true);
this.$set(item, "resizable", true);
}
} else if (param.from == "project") {
} else if (param.from == this.$CONSTANTS.fromRoute.project) {
if (item.type == "projectInfo") {
this.$set(item, "draggable", true);
this.$set(item, "resizable", true);
@@ -690,7 +690,7 @@
const chartItem = chartInfo;
const index = pos; // 指标
if(chartItem.type === 'assetInfo'){
if (chartItem.from != 'endpoint') {
if (chartItem.from != this.$CONSTANTS.fromRoute.endpoint) {
this.$set(chartItem, "draggable", true);
this.$set(chartItem, "resizable", true);
}

View File

@@ -29,13 +29,13 @@
<ul slot="dropdown" v-show="dropdownMenuShow" :id="'dropdownUl'+chartIndex" class="el-dropdown-menu nz-chart-dropdown" style="position: absolute; top: 30px; left: calc(50% - 79px); transform-origin: center top; z-index: 1000;" >
<li @click="refreshChart" class="el-dropdown-menu__item">
<i class="global-active-color el-icon-refresh-right" style="font-size: 16px;"></i><span>{{$t('dashboard.refresh')}}</span></li>
<li @click="editChart" class="el-dropdown-menu__item">
<li @click="editChart" class="el-dropdown-menu__item" v-has="`${from}_chart_toEdit`">
<i class="nz-icon nz-icon-edit" style="font-size: 14px; margin-right: 11px; margin-left: 1px;"></i>{{$t('dashboard.edit')}}</li>
<li @click="removeChart" class="el-dropdown-menu__item">
<li @click="removeChart" class="el-dropdown-menu__item" v-has="`${from}_chart_delete`">
<i class="nz-icon nz-icon-delete" style="font-size: 16px;"></i>{{$t('dashboard.delete')}}</li>
<li @click="showAllScreen" class="el-dropdown-menu__item">
<i class="el-icon-full-screen" style="font-size: 16px;"></i>{{$t('dashboard.screen')}}</li>
<li @click="duplicate" class="el-dropdown-menu__item">
<li @click="duplicate" class="el-dropdown-menu__item" v-has="`${from}_chart_duplicate`">
<i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}</li>
</ul>
</el-dropdown>
@@ -100,7 +100,8 @@ export default {
chartIndex:{
type: Number,
default: 0,
}
},
from: {type: String}
},
data() {
return {

View File

@@ -34,16 +34,16 @@
<li @click="refreshChart" class="el-dropdown-menu__item">
<i class="global-active-color el-icon-refresh-right" style="font-size: 16px;"></i><span>{{$t('dashboard.refresh')}}</span>
</li>
<li @click="editChart" class="el-dropdown-menu__item">
<li @click="editChart" class="el-dropdown-menu__item" v-has="`${from}_chart_toEdit`">
<i class="nz-icon nz-icon-edit" style="font-size: 14px; margin-right: 11px; margin-left: 1px;"></i>{{$t('dashboard.edit')}}
</li>
<li @click="removeChart" class="el-dropdown-menu__item">
<li @click="removeChart" class="el-dropdown-menu__item" v-has="`${from}_chart_delete`">
<i class="nz-icon nz-icon-delete" style="font-size: 16px;"></i>{{$t('dashboard.delete')}}
</li>
<li @click="showAllScreen" class="el-dropdown-menu__item">
<i class="el-icon-full-screen" style="font-size: 16px;"></i>{{$t('dashboard.screen')}}
</li>
<li @click="duplicate" class="el-dropdown-menu__item">
<li @click="duplicate" class="el-dropdown-menu__item" v-has="`${from}_chart_duplicate`">
<i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}
</li>
</ul>
@@ -140,7 +140,8 @@
chartIndex: {
type: Number,
default: 0,
}
},
from: {type: String}
},
data() {
return {

View File

@@ -17,13 +17,13 @@
<ul slot="dropdown" v-show="dropdownMenuShow" :id="'dropdownUl'+chartIndex" class="el-dropdown-menu nz-chart-dropdown" style="position: absolute; top: 30px; left: calc(50% - 79px); transform-origin: center top; z-index: 1000;" >
<li @click="refreshChart" class="el-dropdown-menu__item">
<i class="global-active-color el-icon-refresh-right" style="font-size: 16px;"></i><span>{{$t('dashboard.refresh')}}</span></li>
<li @click="editChart" class="el-dropdown-menu__item">
<li @click="editChart" class="el-dropdown-menu__item" v-has="`${from}_chart_toEdit`">
<i class="nz-icon nz-icon-edit" style="font-size: 14px; margin-right: 11px; margin-left: 1px;"></i>{{$t('dashboard.edit')}}</li>
<li @click="removeChart" class="el-dropdown-menu__item">
<li @click="removeChart" class="el-dropdown-menu__item" v-has="`${from}_chart_delete`">
<i class="nz-icon nz-icon-delete" style="font-size: 16px;"></i>{{$t('dashboard.delete')}}</li>
<li @click="showAllScreen" class="el-dropdown-menu__item">
<i class="el-icon-full-screen" style="font-size: 16px;"></i>{{$t('dashboard.screen')}}</li>
<li @click="duplicate" class="el-dropdown-menu__item">
<li @click="duplicate" class="el-dropdown-menu__item" v-has="`${from}_chart_duplicate`">
<i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}</li>
</ul>
</el-dropdown>
@@ -86,7 +86,7 @@ export default {
type: Number,
default: 0,
},
from: {type: String}
},
data() {
return {

View File

@@ -25,6 +25,7 @@
}
.legend-container{
width: calc(100% - 30px);
overflow: auto;
max-height:80px;
min-height:25px;
font-size:12px;

View File

@@ -7,7 +7,7 @@
<div class="resize-box resize-box-echarts" ref="resizeBox">
<div class="line-chart-block" :id="'lineChartDiv'+chartIndex" @mouseenter="mouseEnterChart" @mouseleave="mouseLeaveChart">
<loading :ref="'localLoading'+chartIndex"></loading>
<div class="clearfix chartTitle" :class="{'drag-disabled': this.filter.from == 'alertRule'}" :id="'chartTitle'+chartIndex" >
<div :class="{'drag-disabled': this.filter.from == $CONSTANTS.fromRoute.rule}" :id="'chartTitle'+chartIndex" class="clearfix chartTitle" >
<el-popover
v-if="isError"
placement="top-start"
@@ -38,9 +38,9 @@
<el-dropdown-menu style="display: none"></el-dropdown-menu>
<span class="el-dropdown-link chart-title" @click.stop="dropdownMenuShow=!dropdownMenuShow">
<span class="chart-title-text">{{chartData.title}}</span>
<span class="chart-title-icon" v-if="filter.from != 'alertRule'"><i class="nz-icon nz-icon-xialaxuanze " :class="{'visible':caretShow,'hidden':!caretShow}"></i></span>
<span class="chart-title-icon" v-if="filter.from != $CONSTANTS.fromRoute.rule"><i :class="{'visible':caretShow,'hidden':!caretShow}" class="nz-icon nz-icon-xialaxuanze "></i></span>
</span>
<ul v-if="filter.from != 'alertRule'" slot="dropdown" v-show="dropdownMenuShow" :id="'dropdownUl'+chartIndex" :class="{'el-dropdown-menu nz-chart-dropdown':!isExplore,'el-dropdown-menu nz-chart-dropdown-one':isExplore}" style="position: absolute; top: 30px; left: calc(50% - 79px); transform-origin: center top; z-index: 1000;" >
<ul :class="{'el-dropdown-menu nz-chart-dropdown':!isExplore,'el-dropdown-menu nz-chart-dropdown-one':isExplore}" :id="'dropdownUl'+chartIndex" slot="dropdown" style="position: absolute; top: 30px; left: calc(50% - 79px); transform-origin: center top; z-index: 1000;" v-if="filter.from != $CONSTANTS.fromRoute.rule" v-show="dropdownMenuShow" >
<li v-show="!isExplore" @click="refreshChart" class="el-dropdown-menu__item">
<i class="global-active-color el-icon-refresh-right" style="font-size: 16px;"></i><span>{{$t('dashboard.refresh')}}</span></li>
<li @click="editChart" class="el-dropdown-menu__item" v-has="`${from}_chart_toEdit`" v-show="!isExplore">
@@ -174,7 +174,7 @@
<loading :ref="'localLoadingScreen'+chartIndex"></loading>
</el-dialog>
</div>
<span class="vue-resizable-handle" @mousedown="startResize" v-if="filter.from != 'alertRule'"></span>
<span @mousedown="startResize" class="vue-resizable-handle" v-if="filter.from != $CONSTANTS.fromRoute.rule"></span>
</div>
</div>
</template>

View File

@@ -17,13 +17,13 @@
<ul slot="dropdown" v-show="dropdownMenuShow" :id="'dropdownUl'+chartIndex" class="el-dropdown-menu nz-chart-dropdown" style="position: absolute; top: 30px; left: calc(50% - 79px); transform-origin: center top; z-index: 1000;" >
<li @click="refreshChart" class="el-dropdown-menu__item">
<i class="global-active-color el-icon-refresh-right" style="font-size: 16px;"></i><span>{{$t('dashboard.refresh')}}</span></li>
<li @click="editChart" class="el-dropdown-menu__item">
<li @click="editChart" class="el-dropdown-menu__item" v-has="`${from}_chart_toEdit`">
<i class="nz-icon nz-icon-edit" style="font-size: 14px; margin-right: 11px; margin-left: 1px;"></i>{{$t('dashboard.edit')}}</li>
<li @click="removeChart" class="el-dropdown-menu__item">
<li @click="removeChart" class="el-dropdown-menu__item" v-has="`${from}_chart_delete`">
<i class="nz-icon nz-icon-delete" style="font-size: 16px;"></i>{{$t('dashboard.delete')}}</li>
<li @click="showAllScreen" class="el-dropdown-menu__item">
<i class="el-icon-full-screen" style="font-size: 16px;"></i>{{$t('dashboard.screen')}}</li>
<li @click="duplicate" class="el-dropdown-menu__item">
<li @click="duplicate" class="el-dropdown-menu__item" v-has="`${from}_chart_duplicate`">
<i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}</li>
</ul>
</el-dropdown>
@@ -83,7 +83,8 @@
chartIndex:{
type: Number,
default: 0,
}
},
from: {type: String}
},
data() {
return {

View File

@@ -161,7 +161,7 @@
</template>
</el-table-column>
</el-table>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollWrap)" class="to-top" v-show="tools.showTopBtn && bottomBox.mainResizeShow &&showTopBtn"><i class="nz-icon nz-icon-top"></i></button>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollbarWrap)" class="to-top" v-show="tools.showTopBtn && bottomBox.mainResizeShow &&showTopBtn"><i class="nz-icon nz-icon-top"></i></button>
<!--<弹窗>-->
<!--导出-->
<div class="export-xlsx">
@@ -350,24 +350,11 @@
width: 90
}
],
viewRuleData: {
id: '',
alertName: '',
type: '',
linkObject: {id: '', name: ''},
linkId: '',
expr: '',
last: '',
severity: '',
summary: '',
description: '',
receiver: '',
},
viewProjectData: {id: '', name: '', remark: ''},
viewModuleData: {id: '', name: '', project: {}, port: '', path: '', param: '', paramObj: []},
viewAssetState: false,
scrollWrap: null,
scrollbarWrap: null,
}
},
computed: {
@@ -568,10 +555,10 @@
this.graphShow = false;
},
getAlertList() {
if (!this.scrollWrap) {
if (!this.scrollbarWrap) {
this.$nextTick(() => {
this.scrollWrap = this.$refs.alertListTable.bodyWrapper;
this.toTopBtnHandler(this.scrollWrap);
this.scrollbarWrap = this.$refs.alertListTable.bodyWrapper;
this.toTopBtnHandler(this.scrollbarWrap);
});
}
},
@@ -778,40 +765,6 @@
return "";
}
},
viewRule(id) {
this.closeViews();
this.$get('alert/rule', {"id": id}).then(response => {
if (response.code == 200) {
this.viewRuleData = response.data.list[0];
this.$refs.alertConfigBox.show(true);
}
})
},
viewAlertType: function (type, typeObj) {
this.closeViews();
switch (type) {
case 1:
this.viewProjectData = JSON.parse(JSON.stringify(typeObj));
this.$refs.projectBox.show(true);
break;
case 2:
// this.fillProject(typeObj);
let tempObj = JSON.parse(typeObj.param)
this.$set(typeObj, 'paramObj', []);
for (let k in tempObj) {
typeObj.paramObj.push({key: k, value: tempObj[k]});
}
this.viewModuleData = JSON.parse(JSON.stringify(typeObj));
this.$refs.moduleBox.show(true);
break;
case 3:
this.viewAssetState = true;
this.$refs.assetEditUnit.getAssetData(typeObj);
this.$refs.assetEditUnit.tabView = true;
break;
}
},
fillProject: function (module) {
this.$get('project', {"id": module.projectId}).then(response => {
if (response.code == 200) {

View File

@@ -9,8 +9,8 @@
</div><div
@click="changeTab(from == $CONSTANTS.fromRoute.asset || from == $CONSTANTS.fromRoute.rule || from == $CONSTANTS.fromRoute.endpoint? 'panel' : 'detail')" class="sub-list-tab">{{$t("overall.detail")}}</div><div
class="sub-list-tab sub-list-tab-active">{{$t("asset.tableTitle.alerts")}}</div><div v-if="from == $CONSTANTS.fromRoute.asset"
class="sub-list-tab" @click="changeTab('endpoint')">{{$t("asset.tableTitle.modules")}}</div>
<div @click="changeTab('endpointQuery')" class="sub-list-tab" v-if="from == $CONSTANTS.fromRoute.endpoint">{{$t("overall.query")}}</div>
@click="changeTab('endpoint')" class="sub-list-tab" v-has="'asset_endpoint_view'">{{$t("asset.tableTitle.modules")}}</div>
<div @click="changeTab('endpointQuery')" class="sub-list-tab" v-has="'project_endpoint_query_chart_view'" v-if="from == $CONSTANTS.fromRoute.endpoint">{{$t("overall.query")}}</div>
</div>
<div class="top-tool-right">
<pick-time :refresh-data-func="getAlertList" v-model="searchTime" :use-chart-unit="false" :use-refresh="false" :default-pick="defaultPick" :show-empty="true"></pick-time>

View File

@@ -205,6 +205,10 @@
this.rightBox.show = true;
},
getTableData() {
if (!this.hasButton('dc_cabinet_view')) {
this.$message.error(this.$t("tip.noAccess"));
return;
}
this.tableData = [];
this.loading = true;
this.$set(this.searchLabel, "pageNo", 1);

View File

@@ -99,7 +99,7 @@
min-width="180">
</pl-table-column>
</pl-table>
<button class="to-top" v-show="showTopBtn" :class="{'to-top-is-hover': tableHover}" @click="$toTop('ps', 1)"><i class="nz-icon nz-icon-top"></i></button>
<button :class="{'to-top-is-hover': tools.tableHover}" @click="toTop(scrollbarWrap)" class="to-top" v-show="tools.showTopBtn"><i class="nz-icon nz-icon-top"></i></button>
<el-dialog class="line-chart-block-modal nz-dialog endpoint-dialog"
:title="$t('project.endpoint.dialogTitle')"
@@ -149,10 +149,12 @@
return {
chart: {},
tableShow: true,
tableHover: false,
dropdownShow: false,
loading: false,
tools: {
showTopBtn: false, //主列表top按钮
tableHover: false,
},
currentEndpoint: {},
queryData: [],//endpoint 查询列表数据
tableData:[],
@@ -172,6 +174,7 @@
rightBox: {show: false},
plTableSHow:true,
scrollTop:0,
scrollbarWrap: null,
}
},
methods: {
@@ -252,6 +255,13 @@
this.tableData = this.handlerTableData(results);
this.tableDataCopy = JSON.stringify(this.tableData);
this.$nextTick(this.$refs.endpointQueryTable.doLayout());
if (!this.scrollbarWrap) {
this.$nextTick(() => {
this.scrollbarWrap = this.$refs.endpointQueryTable.$refs.singleTable.bodyWrapper;
console.info(this.scrollbarWrap)
this.toTopBtnHandler(this.scrollbarWrap);
});
}
}
});
}, 450);

View File

@@ -4,7 +4,7 @@
<div class="sub-list-tabs">
<div class="sub-list-tab-title">{{obj.host}}</div><div
class="sub-list-tab" @click="changeTab('panel')">{{$t("overall.detail")}}</div><div
class="sub-list-tab" @click="changeTab('alertMessage')">{{$t("asset.tableTitle.alerts")}}</div><div
@click="changeTab('alertMessage')" class="sub-list-tab" v-has="'asset_alerts_view'">{{$t("asset.tableTitle.alerts")}}</div><div
class="sub-list-tab sub-list-tab-active">{{$t("asset.tableTitle.modules")}}</div>
</div>
<div class="top-tool-right">

View File

@@ -1,7 +1,7 @@
<template>
<div class="panel">
<!--model和asset的工具栏-->
<div class="sub-top-tools" v-if="from != 'project'">
<div class="sub-top-tools" v-if="from != this.$CONSTANTS.fromRoute.project">
<div class="sub-list-tabs">
<div class="sub-list-tab-title">
<template v-if="from == $CONSTANTS.fromRoute.model">{{obj.name}}</template>
@@ -10,15 +10,15 @@
<template v-else-if="from == $CONSTANTS.fromRoute.endpoint">{{$t("project.endpoint.endpointId")}}: {{obj.id}}</template>
</div><div class="sub-list-tab sub-list-tab-active" v-if="from == $CONSTANTS.fromRoute.model">{{$t("dashboard.panel.title")}}</div><template v-if="from == $CONSTANTS.fromRoute.asset"><div
class="sub-list-tab sub-list-tab-active">{{$t("overall.detail")}}</div><div
class="sub-list-tab" @click="changeTab('alertMessage')">{{$t("asset.tableTitle.alerts")}}</div><div
class="sub-list-tab" @click="changeTab('endpoint')">{{$t("asset.tableTitle.modules")}}</div>
</template><template v-if="from == 'alertRule'"><div
@click="changeTab('alertMessage')" class="sub-list-tab" v-has="'asset_alerts_view'">{{$t("asset.tableTitle.alerts")}}</div><div
@click="changeTab('endpoint')" class="sub-list-tab" v-has="'asset_endpoint_view'">{{$t("asset.tableTitle.modules")}}</div>
</template><template v-if="from == $CONSTANTS.fromRoute.rule"><div
class="sub-list-tab sub-list-tab-active">{{$t("overall.detail")}}</div><div
class="sub-list-tab" @click="changeTab('alertMessage')">{{$t("asset.tableTitle.alerts")}}</div>
@click="changeTab('alertMessage')" class="sub-list-tab" v-has="'rule_alerts_view'">{{$t("asset.tableTitle.alerts")}}</div>
</template><template v-if="from == $CONSTANTS.fromRoute.endpoint"><div
class="sub-list-tab sub-list-tab-active">{{$t("overall.detail")}}</div><div
class="sub-list-tab " @click="changeTab('alertMessage')">{{$t("asset.tableTitle.alerts")}}</div><div
class="sub-list-tab" @click="changeTab('endpointQuery')">{{$t("overall.query")}}</div>
@click="changeTab('alertMessage')" class="sub-list-tab " v-has="'project_endpoint_alerts_view'">{{$t("asset.tableTitle.alerts")}}</div><div
@click="changeTab('endpointQuery')" class="sub-list-tab" v-has="'project_endpoint_query_chart_view'">{{$t("overall.query")}}</div>
</template>
</div>
<div class="top-tool-right">
@@ -326,7 +326,7 @@
},
//公用操作
getTableData(linkId) {
if (this.from == "alertRule" || this.from == "endpoint") {
if (this.from == this.$CONSTANTS.fromRoute.rule || this.from == this.$CONSTANTS.fromRoute.endpoint) {
this.getData(this.filter);
} else {
this.$get('panel', {type: this.from, link: linkId}).then(response => {
@@ -482,6 +482,7 @@
beforeDestroy(){
document.querySelector("#tableList").removeEventListener("mouseenter", this.tableListEnter);
document.querySelector("#tableList").removeEventListener("mouseleave", this.tableListLeave);
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
}
}
</script>

View File

@@ -54,16 +54,16 @@
<div :class="{'menu-active' : route == '/asset'}" @click="jumpToAsset()" v-else>{{$t(menu.i18n)}}</div>
</template>
<template>
<el-menu-item index="3-0" v-if="assetData.length == 0"><div @click="createBox({type: 6})" v-has="'asset_toAdd'"><i class="nz-icon nz-icon-create-square header-dropdown-add"></i>&nbsp;&nbsp;{{$t("overall.createDatacenter")}}</div></el-menu-item>
<el-menu-item index="3-0" v-has="'asset_toAdd'" v-if="assetData.length == 0"><div @click="createBox({type: 6})"><i class="nz-icon nz-icon-create-square header-dropdown-add"></i>&nbsp;&nbsp;{{$t("overall.createDatacenter")}}</div></el-menu-item>
<template v-else>
<div style='height: 360px; overflow: auto;' v-if="assetData.length>10">
<div style='height: 360px; overflow: auto;' v-has="'asset_view'" v-if="assetData.length>10">
<el-menu-item :index="'3-' + index" :key="index" v-for="(item, index) in assetData">
<div :class="{'menu-item-active': route == '/asset' && activeItemIndex == item.id}" @click="jumpToAsset(item)" @mouseenter="hoverItemIndex = '3-' + index" @mouseleave="hoverItemIndex = ''">
<span class="too-long-split" style="width: 130px;">{{item.name}}</span>
</div>
</el-menu-item>
</div>
<el-menu-item :index="'3-' + index" :key="index" v-else v-for="(item, index) in assetData">
<el-menu-item :index="'3-' + index" :key="index" v-else v-for="(item, index) in assetData" v-has="'asset_view'">
<div :class="{'menu-item-active': route == '/asset' && activeItemIndex == item.id}" @click="jumpToAsset(item)" @mouseenter="hoverItemIndex = '3-' + index" @mouseleave="hoverItemIndex = ''">
<span class="too-long-split" style="width: 130px;">{{item.name}}</span>
</div>
@@ -77,9 +77,9 @@
<div :class ="route == '/project' ? 'menu-active' :''" @click="jumpToProject(projectData[0])" v-else >{{$t(menu.i18n)}}</div>
</template>
<template>
<el-menu-item index="2-0" v-if="projectData.length == 0"><div @click="createBox({type: 1})" v-has="'project_toAdd'"><i class="nz-icon nz-icon-create-square header-dropdown-add"></i>&nbsp;&nbsp;{{$t("overall.createProject")}}</div></el-menu-item>
<el-menu-item index="2-0" v-has="'project_toAdd'" v-if="projectData.length == 0"><div @click="createBox({type: 1})"><i class="nz-icon nz-icon-create-square header-dropdown-add"></i>&nbsp;&nbsp;{{$t("overall.createProject")}}</div></el-menu-item>
<template v-else>
<div style="height: 360px; overflow: auto;" v-if="projectData.length>10">
<div style="height: 360px; overflow: auto;" v-has="'project_view'" v-if="projectData.length>10">
<el-menu-item :index="'2-' + index" :key="index" v-for="(item, index) in projectData">
<div :class="{'menu-item-active': route == '/project' && activeItemIndex == item.id}" @click="jumpToProject(item)" @mouseenter="hoverItemIndex = '2-' + index" @mouseleave="hoverItemIndex = ''">
<span class="too-long-split" style="width: 135px;">{{item.name}}</span>
@@ -87,7 +87,7 @@
</div>
</el-menu-item>
</div>
<el-menu-item :index="'2-' + index" :key="index" v-else v-for="(item, index) in projectData">
<el-menu-item :index="'2-' + index" :key="index" v-else v-for="(item, index) in projectData" v-has="'project_view'">
<div :class="{'menu-item-active': route == '/project' && activeItemIndex == item.id}" @click="jumpToProject(item)" @mouseenter="hoverItemIndex = '2-' + index" @mouseleave="hoverItemIndex = ''">
<span class="too-long-split" style="width: 135px;">{{item.name}}</span>
<div @click.stop="toEditProject(item)" class="menu-edit" v-has="'project_toEdit'" v-show="hoverItemIndex == '2-' + index && item.buildIn != 1"><i class="nz-icon nz-icon-edit"></i></div>
@@ -357,6 +357,9 @@
this.jumpTo("/asset");
},
jumpToProject(p) {
if (!this.hasButton('project_view')) {
return;
}
this.currentProject = p;
this.$store.commit("currentProjectChange", p);
this.activeItemIndex = p.id;

View File

@@ -1106,6 +1106,7 @@ const cn = {
},
buttons: {
panel: {
view: "View panel",
toAdd: "Add panel",
toEdit: "Edit panel",
delete: "Delete panel",
@@ -1121,10 +1122,12 @@ const cn = {
}
},
explore: {
view: "View explore",
toAdd: "Add chart",
save: "Save chart",
},
asset: {
view: "View asset",
toAdd: "Add asset",
toEdit: "Edit asset",
toBatchEdit: "Batch edit asset",
@@ -1163,6 +1166,7 @@ const cn = {
}
},
project: {
view: "View project",
toEdit: "Edit project",
delete: "Delete project",
save: "Save project",
@@ -1195,10 +1199,12 @@ const cn = {
}
},
message: {
view: "View alerts",
delete: "Delete alerts",
export: "Export alerts",
},
rule: {
view: "View rule",
toAdd: "Add rule",
toEdit: "Edit rule",
delete: "Delete rule",
@@ -1210,24 +1216,28 @@ const cn = {
},
},
account: {
view: "View account",
toAdd: "Add account",
toEdit: "Edit account",
delete: "Delete account",
save: "Save account",
},
role: {
view: "View role",
toAdd: "Add role",
toEdit: "Edit role",
delete: "Delete role",
save: "Save role",
},
prom: {
view: "View prom",
toAdd: "Add prom",
toEdit: "Edit prom",
delete: "Delete prom",
save: "Save prom",
},
dc: {
view: "View data center",
toAdd: "Add data center",
toEdit: "Edit data center",
delete: "Delete data center",
@@ -1235,6 +1245,7 @@ const cn = {
trafficSetting: "Traffic setting",
trafficSettingSave: "Save traffic setting",
cabinet: {
view: "View cabinet",
toAdd: "Add cabinet",
toEdit: "Edit cabinet",
delete: "Delete cabinet",
@@ -1242,12 +1253,14 @@ const cn = {
}
},
model: {
view: "View model",
toAdd: "Add model",
toEdit: "Edit model",
delete: "Delete model",
save: "Save model",
panel: "View panel",
chart: {
view: "View chart",
toAdd: "Add chart",
toEdit: "Edit chart",
delete: "Delete chart",
@@ -1259,12 +1272,14 @@ const cn = {
},
},
snmp: {
view: "View mib file",
toAdd: "Add mib file",
toEdit: "Edit mib file",
delete: "Delete mib file",
save: "Save mib file",
download: "Download mib file",
browserExport: "Export mib browser",
browserView: "View mib browser"
},
system: {
basic: "Basic save",

View File

@@ -992,6 +992,7 @@ const en = {
},
buttons: {
panel: {
view: "View panel",
toAdd: "Add panel",
toEdit: "Edit panel",
delete: "Delete panel",
@@ -1007,10 +1008,12 @@ const en = {
}
},
explore: {
view: "View explore",
toAdd: "Add chart",
save: "Save chart",
},
asset: {
view: "View asset",
toAdd: "Add asset",
toEdit: "Edit asset",
toBatchEdit: "Batch edit asset",
@@ -1049,6 +1052,7 @@ const en = {
}
},
project: {
view: "View project",
toEdit: "Edit project",
delete: "Delete project",
save: "Save project",
@@ -1081,10 +1085,12 @@ const en = {
}
},
message: {
view: "View alerts",
delete: "Delete alerts",
export: "Export alerts",
},
rule: {
view: "View rule",
toAdd: "Add rule",
toEdit: "Edit rule",
delete: "Delete rule",
@@ -1096,24 +1102,28 @@ const en = {
},
},
account: {
view: "View account",
toAdd: "Add account",
toEdit: "Edit account",
delete: "Delete account",
save: "Save account",
},
role: {
view: "View role",
toAdd: "Add role",
toEdit: "Edit role",
delete: "Delete role",
save: "Save role",
},
prom: {
view: "View prom",
toAdd: "Add prom",
toEdit: "Edit prom",
delete: "Delete prom",
save: "Save prom",
},
dc: {
view: "View data center",
toAdd: "Add data center",
toEdit: "Edit data center",
delete: "Delete data center",
@@ -1121,6 +1131,7 @@ const en = {
trafficSetting: "Traffic setting",
trafficSettingSave: "Save traffic setting",
cabinet: {
view: "View cabinet",
toAdd: "Add cabinet",
toEdit: "Edit cabinet",
delete: "Delete cabinet",
@@ -1128,12 +1139,14 @@ const en = {
}
},
model: {
view: "View model",
toAdd: "Add model",
toEdit: "Edit model",
delete: "Delete model",
save: "Save model",
panel: "View panel",
chart: {
view: "View chart",
toAdd: "Add chart",
toEdit: "Edit chart",
delete: "Delete chart",
@@ -1145,12 +1158,14 @@ const en = {
},
},
snmp: {
view: "View mib file",
toAdd: "Add mib file",
toEdit: "Edit mib file",
delete: "Delete mib file",
save: "Save mib file",
download: "Download mib file",
browserExport: "Export mib browser",
browserView: "View mib browser"
},
system: {
basic: "Basic save",

View File

@@ -724,7 +724,7 @@
box-sizing: border-box;
}
.sub-side-bar-menu-edit{
margin-right: 18px;
margin-right: 13px;
}
.sidebar-info-item-project.sidebar-info-item{

View File

@@ -2,7 +2,7 @@
<div class="right-box right-box-menu" v-clickoutside="clickOutside">
<!-- begin--顶部按钮-->
<div class="right-box-top-btns right-box-form-delete">
<button @click="del" class="nz-btn nz-btn-size-normal nz-btn-size-alien" id="menus-edit-del"
<button @click="del" class="nz-btn nz-btn-size-normal nz-btn-size-alien" id="menus-edit-del" v-has="'menu_delete'"
type="button"
v-if="editMenu.id">
<span class="right-box-top-btn-icon"><i class="nz-icon nz-icon-delete"></i></span>
@@ -64,11 +64,11 @@
<!-- end--表单-->
<!--底部按钮-->
<div class="right-box-bottom-btns">
<button @click="esc" class="nz-btn nz-btn-size-normal-new nz-btn-style-light-new"
<button @click="esc(false)" class="nz-btn nz-btn-size-normal-new nz-btn-style-light-new"
id="menus-esc">
<span>{{$t('overall.cancel')}}</span>
</button>
<button @click="save" class="nz-btn nz-btn-size-normal-new nz-btn-style-normal-new"
<button @click="save" class="nz-btn nz-btn-size-normal-new nz-btn-style-normal-new" v-has="'menu_save'"
id="menus-save">
<span>{{$t('overall.save')}}</span>
</button>

View File

@@ -30,10 +30,9 @@
<div class="main-modal"></div>
<div class="top-tools" v-show="bottomBox.mainResizeShow">
<div class="top-tool-main-right" :class="{'top-tool-main-right-to-left': bottomBox.showSubList}">
<div class="top-tool-search float-right">
<div class="top-tool-search float-right margin-r-20">
<search-input :searchMsg="searchMsg" @search="search" :inTransform="bottomBox.inTransform"></search-input>
</div>
<pick-time :refresh-data-func="getTableData" :showTimePicker="false" :use-chart-unit="false" class="float-right pickTime margin-l-20" ref="pickTime" v-model="searchTime"></pick-time>
<export-excel
export-file-name="AlertRule"
export-url="/alert/rule/export"
@@ -130,7 +129,7 @@
</template>
</el-table-column>
</el-table>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollWrap)" class="to-top" v-show="tools.showTopBtn && bottomBox.mainResizeShow"><i class="nz-icon nz-icon-top"></i></button>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollbarWrap)" class="to-top" v-show="tools.showTopBtn && bottomBox.mainResizeShow"><i class="nz-icon nz-icon-top"></i></button>
<div class="pagination-bottom" v-show="!bottomBox.showSubList">
<Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
</div>
@@ -289,11 +288,14 @@
viewModuleData: {},
viewAsset: false,
searchTime: bus.getTimezontDateRange(),
scrollWrap: null,
scrollbarWrap: null,
}
},
methods: {
queryMessage(alertRule) {
if (!this.hasButton('rule_alerts_view')) {
return;
}
this.bottomBox.alertRule = alertRule;
this.bottomBox.showSubList = true;
this.bottomBox.targetTab = 'alertMessage';
@@ -355,6 +357,10 @@
return '';
},
getTableData() {
if (!this.hasButton('rule_view')) {
this.$message.error(this.$t("tip.noAccess"));
return;
}
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
this.tools.loading = true;
@@ -372,10 +378,10 @@
});
this.tableData = response.data.list;
this.pageObj.total = response.data.total;
if (!this.scrollWrap) {
if (!this.scrollbarWrap) {
this.$nextTick(() => {
this.scrollWrap = this.$refs.alertRuleTable.bodyWrapper;
this.toTopBtnHandler(this.scrollWrap);
this.scrollbarWrap = this.$refs.alertRuleTable.bodyWrapper;
this.toTopBtnHandler(this.scrollbarWrap);
});
}
}
@@ -434,45 +440,6 @@
let vm = this;
this.$bottomBoxWindow.listResize(vm, e);
},
viewAlertType(type, typeObj) {
this.closeViews();
switch (type) {
case 1:
this.viewProjectData = JSON.parse(JSON.stringify(typeObj));
this.$refs.projectBox.show(true);
break;
case 2:
// this.fillProject(typeObj);
if (typeObj.param) {
let tempObj = JSON.parse(typeObj.param);
this.$set(typeObj, 'paramObj', []);
for (let k in tempObj) {
typeObj.paramObj.push({key: k, value: tempObj[k]});
}
}
this.viewModuleData = JSON.parse(JSON.stringify(typeObj));
this.$refs.moduleBox.show(true);
break;
case 3:
this.viewAsset = true;
this.$refs.assetEditUnit.getAssetData(typeObj);
this.$refs.assetEditUnit.tabView = true;
break;
}
},
fillProject: function (module) {
this.$get('project', {"id": module.projectId}).then(response => {
if (response.code == 200) {
module.project = response.data.list[0];
}
})
},
closeViews: function () {
this.$refs.alertConfigBox.show(false, false);
this.$refs.projectBox.show(false, false);
this.$refs.moduleBox.show(false, false);
this.viewAsset = false;
},
convertToDetail(obj) {
let detail = {
id: obj.id,

View File

@@ -22,10 +22,9 @@
<div class="top-tools" v-show="bottomBox.mainResizeShow">
<div class="top-tool-main-right" :class="{'top-tool-main-right-to-left': bottomBox.showSubList}">
<pick-time :refresh-data-func="getAlertList" v-model="searchTime" :use-chart-unit="false" :use-refresh="false" :default-pick="12" :show-empty="true"></pick-time>
<div class="top-tool-search">
<div class="top-tool-search margin-r-20">
<search-input :searchMsg="searchMsg" @search="search" :bottomBox.inTransform="bottomBox.inTransform"></search-input>
</div>
<pick-time :showTimePicker="false" class="float-right pickTime margin-l-20" :refresh-data-func="getAlertList" v-model="searchTimeSelect" :use-chart-unit="false" ref="pickTime"></pick-time>
<button :title="$t('overall.exportExcelLower')" @click="showExportDialog" type="button" v-has="'message_export'"
class="nz-btn nz-btn-size-normal nz-btn-style-light" id="alert-list-export">
<i class="nz-icon nz-icon-download1"></i>
@@ -290,21 +289,6 @@
},
tableData: [],
requestIndex:0,
viewRuleData: {
id: '',
alertName: '',
type: '',
linkObject: {id: '', name: ''},
linkId: '',
expr: '',
last: '',
severity: '',
summary: '',
description: '',
receiver: '',
},
viewProjectData: {id: '', name: '', remark: ''},
viewModuleData: {id: '', name: '', project: {}, port: '', path: '', param: '', paramObj: []},
viewAssetState: false,
}
},
@@ -350,7 +334,11 @@
return result;
},
getAlertList: function () {
getAlertList() {
if (!this.hasButton('message_view')) {
this.$message.error(this.$t("tip.noAccess"));
return;
}
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
if(this.searchTime&& this.searchTime.length>1){
@@ -649,40 +637,6 @@
this.$refs.alertMessageTable.$refs.alertListTable.bodyWrapper.scrollTop = 0;
this.getAlertList();
},
viewRule: function (id) {
this.closeViews();
this.$get('alert/rule', {"id": id}).then(response => {
if (response.code == 200) {
this.viewRuleData = response.data.list[0];
this.$refs.alertConfigBox.show(true);
}
})
},
viewAlertType: function (type, typeObj) {
this.closeViews();
switch (type) {
case 1:
this.viewProjectData = JSON.parse(JSON.stringify(typeObj));
this.$refs.projectBox.show(true);
break;
case 2:
// this.fillProject(typeObj);
let tempObj = JSON.parse(typeObj.param)
this.$set(typeObj, 'paramObj', []);
for (let k in tempObj) {
typeObj.paramObj.push({key: k, value: tempObj[k]});
}
this.viewModuleData = JSON.parse(JSON.stringify(typeObj));
this.$refs.moduleBox.show(true);
break;
case 3:
this.viewAssetState = true;
this.$refs.assetEditUnit.getAssetData(typeObj);
this.$refs.assetEditUnit.tabView = true;
break;
}
},
fillProject: function (module) {
this.$get('project', {"id": module.projectId}).then(response => {
if (response.code == 200) {

View File

@@ -173,7 +173,7 @@
</template>
</el-table-column>
</el-table>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollWrap)" class="to-top" v-show="tools.showTopBtn && bottomBox.mainResizeShow"><i class="nz-icon nz-icon-top"></i></button>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollbarWrap)" class="to-top" v-show="tools.showTopBtn && bottomBox.mainResizeShow"><i class="nz-icon nz-icon-top"></i></button>
<div class="pagination-bottom" v-show="!bottomBox.showSubList">
<Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
</div>
@@ -392,7 +392,7 @@
assetPingSwitch: localStorage.getItem('nz-sys-asset-ping-switch'),
tagKeys:[],
scrollWrap: null
scrollbarWrap: null
}
},
computed:{
@@ -450,6 +450,9 @@
this.$store.commit('addConsole', consoleParam);
},
jumpToAlertMsg(asset) {
if (!this.hasButton('asset_alerts_view')) {
return;
}
this.bottomBox.targetTab = 'alertMessage';
this.bottomBox.asset = JSON.parse(JSON.stringify(asset));
this.bottomBox.showSubList = true;
@@ -483,10 +486,10 @@
this.pageObj.total = response.data.total;
bus.$emit('asset-property-change');
if (!this.scrollWrap) {
if (!this.scrollbarWrap) {
this.$nextTick(() => {
this.scrollWrap = this.$refs.assetTable.bodyWrapper;
this.toTopBtnHandler(this.scrollWrap);
this.scrollbarWrap = this.$refs.assetTable.bodyWrapper;
this.toTopBtnHandler(this.scrollbarWrap);
});
}
}
@@ -559,6 +562,9 @@
})
},
showEndpoint(asset) {
if (!this.hasButton('asset_endpoint_view')) {
return;
}
this.bottomBox.asset = Object.assign({}, asset);
this.bottomBox.targetTab = "endpoint";
this.bottomBox.showSubList = true;
@@ -582,7 +588,6 @@
}
},
afterTableListChange:function(){
// this.getTableData();
bus.$emit('asset-list-change')
},
pageNo(val) {

View File

@@ -108,7 +108,7 @@
active-value="1"
inactive-value="0"
active-color="#ee9d3f"
:disabled="isCurrentUser(scope.row.username) || !hasButton('account_toEdit')"
:disabled="isCurrentUser(scope.row.username) || !hasButton('account_toEdit') || !hasButton('account_save')"
@change="(val)=>{statusChange(scope.row)}">
</el-switch>
</span>
@@ -127,7 +127,7 @@
</template>
</el-table-column>
</el-table>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollWrap)" class="to-top" v-show="tools.showTopBtn && bottomBox.mainResizeShow"><i class="nz-icon nz-icon-top"></i></button>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollbarWrap)" class="to-top" v-show="tools.showTopBtn && bottomBox.mainResizeShow"><i class="nz-icon nz-icon-top"></i></button>
<div class="pagination-bottom" v-show="!bottomBox.showSubList">
<Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
</div>
@@ -249,7 +249,7 @@
}],
},
searchLabel: {}, //搜索参数
scrollWrap: null,
scrollbarWrap: null,
}
},
methods: {
@@ -309,6 +309,10 @@
});
},
getTableData() {
if (!this.hasButton('account_view')) {
this.$message.error(this.$t("tip.noAccess"));
return;
}
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
this.tools.loading = true;
@@ -320,10 +324,10 @@
}
this.tableData = response.data.list;
this.pageObj.total = response.data.total;
if (!this.scrollWrap) {
if (!this.scrollbarWrap) {
this.$nextTick(() => {
this.scrollWrap = this.$refs.accountTable.bodyWrapper;
this.toTopBtnHandler(this.scrollWrap);
this.scrollbarWrap = this.$refs.accountTable.bodyWrapper;
this.toTopBtnHandler(this.scrollbarWrap);
});
}
}

View File

@@ -82,7 +82,7 @@
v-model="scope.row.state"
active-value="ON"
inactive-value="OFF"
:disabled="!hasButton('dc_toEdit')"
:disabled="!hasButton('dc_toEdit') || !hasButton('dc_save')"
active-color="#ee9d3f"
@change="(val)=>{statusChange(scope.row)}"
/>
@@ -124,7 +124,7 @@
</template>
</el-table-column>
</el-table>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollWrap)" class="to-top" v-show="tools.showTopBtn && bottomBox.mainResizeShow"><i class="nz-icon nz-icon-top"></i></button>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollbarWrap)" class="to-top" v-show="tools.showTopBtn && bottomBox.mainResizeShow"><i class="nz-icon nz-icon-top"></i></button>
<div class="pagination-bottom" v-show="!bottomBox.showSubList">
<Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
</div>
@@ -267,7 +267,7 @@
},
searchLabel: {}, //搜索参数
tabShow: 1, // 控制显示一级页面和二级页面 1 dc 2cabinet
scrollWrap: null,
scrollbarWrap: null,
}
},
methods: {
@@ -396,6 +396,10 @@
});
},
getTableData() {
if (!this.hasButton('dc_view')) {
this.$message.error(this.$t("tip.noAccess"));
return;
}
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
this.tools.loading = true;
@@ -404,10 +408,10 @@
if (response.code === 200) {
this.tableData = response.data.list;
this.pageObj.total = response.data.total;
if (!this.scrollWrap) {
if (!this.scrollbarWrap) {
this.$nextTick(() => {
this.scrollWrap = this.$refs.dcTable.bodyWrapper;
this.toTopBtnHandler(this.scrollWrap);
this.scrollbarWrap = this.$refs.dcTable.bodyWrapper;
this.toTopBtnHandler(this.scrollbarWrap);
});
}
}

View File

@@ -15,11 +15,11 @@
<div class="top-tool-search">
<search-input :searchMsg="searchMsg" @search="search" ref="searchInput" ></search-input>
</div>
<button :title="$t('overall.createMenus')" @click="add" class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20"
<button :title="$t('overall.createMenus')" @click="add" class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" v-has="'menu_toAdd'"
id="menus-add" type="button">
<i class="nz-icon-create-square nz-icon"></i>
</button>
<delete-button :delete-objs="batchDeleteObjs" :filter-function="(arr)=>{return '?ids='+arr.map(t=>t.id).join(',')}" @after="getTableData" api="sys/menu"></delete-button>
<delete-button :delete-objs="batchDeleteObjs" :filter-function="(arr)=>{return '?ids='+arr.map(t=>t.id).join(',')}" @after="getTableData" api="sys/menu" v-has="'menu_delete'"></delete-button>
</div>
<!-- 顶部分页组件,当打开底部上滑框时出现 -->
<div class="pagination-top pagination-top-hide display-none"></div>
@@ -69,9 +69,9 @@
</template>
<template :column="item" slot-scope="scope">
<div class="content-right-options" v-if="item.prop == 'option'">
<span :id="'menus-edit-'+scope.row.id" :title="$t('overall.edit')" @click="edit(scope.row)" class="content-right-option"><i :class="{'gray-filter':scope.row.buildIn == 1}" class="nz-icon nz-icon-edit"></i></span>
<span :id="'menus-edit-'+scope.row.id" :title="$t('overall.edit')" @click="edit(scope.row)" class="content-right-option" v-has="'menu_toEdit'"><i :class="{'gray-filter':scope.row.buildIn == 1}" class="nz-icon nz-icon-edit"></i></span>
&nbsp;
<span :id="'menus-del-'+scope.row.id" :title="$t('overall.delete')" @click="del(scope.row)" class="content-right-option"><i :class="{'gray-filter':scope.row.buildIn == 1}" class="nz-icon nz-icon-delete"></i></span>
<span :id="'menus-del-'+scope.row.id" :title="$t('overall.delete')" @click="del(scope.row)" class="content-right-option" v-has="'menu_delete'"><i :class="{'gray-filter':scope.row.buildIn == 1}" class="nz-icon nz-icon-delete"></i></span>
</div>
<template v-if="item.prop == 'name'">
<template v-if="scope.row.i18n">
@@ -98,7 +98,7 @@
</template>
</el-table-column>
</el-table>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="$toTop('ps', 0)" class="to-top" v-show="tools.showTopBtn "><i class="nz-icon nz-icon-top"></i></button>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollbarWrap)" class="to-top" v-show="tools.showTopBtn "><i class="nz-icon nz-icon-top"></i></button>
</div>
<transition name="right-box">
<menu-box :menu="menu" @close="closeRightBox" v-if="rightBox.show"></menu-box>
@@ -108,6 +108,7 @@
<script>
import deleteButton from "../../common/deleteButton";
import menuBox from '../../common/rightBox/menuBox';
import bus from "../../../libs/bus";
export default {
name: "menus",
@@ -204,6 +205,7 @@
}],
},
searchLabel: {}, //搜索参数
scrollbarWrap: null,
}
},
methods: {
@@ -249,6 +251,12 @@
this.tableData = response.data.list;
this.pageObj.total = response.data.total
this.tools.loading = false;
if (!this.scrollbarWrap) {
this.$nextTick(() => {
this.scrollbarWrap = this.$refs.menusTable.bodyWrapper;
this.toTopBtnHandler(this.scrollbarWrap);
});
}
}
})
},
@@ -311,5 +319,8 @@
: this.tableTitle;
this.getTableData();
},
beforeDestroy() {
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
}
}
</script>

View File

@@ -11,7 +11,7 @@
<div class="nz-tab-item-box" id="module-type-1">
<div class="nz-tab-item nz-tab-item-active">{{$t("config.mib.mibFiles")}}</div>
</div>
<div @click="showTab = 'browser'" class="nz-tab-item-box" id="module-type-2">
<div @click="showTab = 'browser'" class="nz-tab-item-box" id="module-type-2" v-has="'snmp_browser_view'">
<div class="nz-tab-item">{{$t("config.mib.mibBrowser")}}</div>
</div>
</div>
@@ -51,7 +51,7 @@
<template slot-scope="scope" :column="item">
<template v-if="item.prop == 'updateUser'" >{{scope.row[item.prop].name}}</template>
<template v-else-if="item.prop == 'fileName' && scope.row[item.prop]" >
<span @click="downloadMib(scope.row)" class="link" v-has="'snmp_file_download'">{{scope.row[item.prop]}}</span>
<span @click="downloadMib(scope.row)" class="link">{{scope.row[item.prop]}}</span>
</template>
<template v-else-if="item.prop == 'modelsDetail' && scope.row['modelsDetail'] && scope.row['modelsDetail'].length >0" >
<div style="height: 100%">
@@ -101,7 +101,7 @@
</template>
</el-table-column>
</el-table>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollWrap)" class="to-top" v-show="tools.showTopBtn"><i class="nz-icon nz-icon-top"></i></button>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollbarWrap)" class="to-top" v-show="tools.showTopBtn"><i class="nz-icon nz-icon-top"></i></button>
<Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
</template>
<mib-browser :show-tab="showTab" v-if="showTab == 'browser'" @toFileTab="showTab = 'file'"></mib-browser>
@@ -204,7 +204,7 @@
}],
},
searchLabel: {}, //搜索参数
scrollWrap: null,
scrollbarWrap: null,
}
},
methods: {
@@ -254,6 +254,10 @@
});
},
getTableData() {
if (!this.hasButton('snmp_file_view')) {
this.$message.error(this.$t("tip.noAccess"));
return;
}
this.tableData = [];
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
@@ -263,10 +267,10 @@
if (response.code === 200) {
this.tableData = response.data.list;
this.pageObj.total = response.data.total;
if (!this.scrollWrap) {
if (!this.scrollbarWrap) {
this.$nextTick(() => {
this.scrollWrap = this.$refs.mibTable.bodyWrapper;
this.toTopBtnHandler(this.scrollWrap);
this.scrollbarWrap = this.$refs.mibTable.bodyWrapper;
this.toTopBtnHandler(this.scrollbarWrap);
});
}
}
@@ -302,6 +306,9 @@
this.getTableData();
},
downloadMib(mib) {
if (!this.hasButton("snmp_file_download")) {
return;
}
axios.get('/mib/download?id='+mib.id,{responseType: 'blob'}).then(data=>{
let fileName = new Date().getTime()+'.txt';
let disposition=data.headers['content-disposition'];

View File

@@ -72,7 +72,7 @@
</el-popover>
</template>
<div v-else-if="item.prop == 'option'" class="content-right-options">
<span :id="'model-panel-'+scope.row.id" :title="$t('dashboard.panel.title')" @click="panel(scope.row)" class="content-right-option" v-has="'model_panel'"><i class="nz-icon nz-icon-template"></i></span>
<span :id="'model-panel-'+scope.row.id" :title="$t('dashboard.panel.title')" @click="panel(scope.row)" class="content-right-option" v-has="'model_chart_view'"><i class="nz-icon nz-icon-template"></i></span>
<span :id="'model-edit-'+scope.row.id" :title="$t('overall.edit')" @click="edit(scope.row)" class="content-right-option" v-has="'model_toEdit'"><i class="nz-icon nz-icon-edit"></i></span>
<span :id="'model-del-'+scope.row.id" :title="$t('overall.delete')" @click="del(scope.row)" class="content-right-option" v-has="'model_delete'"><i class="nz-icon nz-icon-delete"></i></span>
</div>
@@ -88,7 +88,7 @@
</template>
</el-table-column>
</el-table>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollWrap)" class="to-top" v-show="tools.showTopBtn"><i class="nz-icon nz-icon-top"></i></button>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollbarWrap)" class="to-top" v-show="tools.showTopBtn"><i class="nz-icon nz-icon-top"></i></button>
<div class="pagination-bottom" v-show="!bottomBox.showSubList">
<Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
</div>
@@ -203,7 +203,7 @@
}],
},
searchLabel: {}, //搜索参数
scrollWrap: null,
scrollbarWrap: null,
}
},
methods: {
@@ -214,6 +214,9 @@
return "";
},
panel(obj) {
if (!this.hasButton('model_chart_view')) {
return;
}
this.bottomBox.showSubList = true;
this.bottomBox.model = obj;
this.bottomBox.targetTab = "panel";
@@ -276,6 +279,10 @@
});
},
getTableData() {
if (!this.hasButton('model_view')) {
this.$message.error(this.$t("tip.noAccess"));
return;
}
this.tableData = [];
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
@@ -286,10 +293,10 @@
if (response.code === 200) {
this.tableData = response.data.list;
this.pageObj.total = response.data.total;
if (!this.scrollWrap) {
if (!this.scrollbarWrap) {
this.$nextTick(() => {
this.scrollWrap = this.$refs.modelTable.bodyWrapper;
this.toTopBtnHandler(this.scrollWrap);
this.scrollbarWrap = this.$refs.modelTable.bodyWrapper;
this.toTopBtnHandler(this.scrollbarWrap);
});
}
}

View File

@@ -8,7 +8,7 @@
<div class="top-tools">
<div></div>
<div>
<div class="top-tool-search float-right">
<div class="top-tool-search margin-r-5">
<search-input :searchMsg="searchMsg" @search="search"></search-input>
</div>
</div>
@@ -60,7 +60,7 @@
</template>
</el-table-column>
</el-table>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollWrap)" class="to-top" v-show="tools.showTopBtn"><i class="nz-icon nz-icon-top"></i></button>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollbarWrap)" class="to-top" v-show="tools.showTopBtn"><i class="nz-icon nz-icon-top"></i></button>
<Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
</div>
</template>
@@ -192,7 +192,7 @@
],
},
searchLabel: {}, //搜索参数
scrollWrap: null,
scrollbarWrap: null,
}
},
methods: {
@@ -215,10 +215,10 @@
if (response.code === 200) {
this.tableData = response.data.list;
this.pageObj.total = response.data.total;
if (!this.scrollWrap) {
if (!this.scrollbarWrap) {
this.$nextTick(() => {
this.scrollWrap = this.$refs.operationLogTable.bodyWrapper;
this.toTopBtnHandler(this.scrollWrap);
this.scrollbarWrap = this.$refs.operationLogTable.bodyWrapper;
this.toTopBtnHandler(this.scrollbarWrap);
});
}
}

View File

@@ -82,7 +82,7 @@
</template>
</el-table-column>
</el-table>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollWrap)" class="to-top" v-show="tools.showTopBtn && bottomBox.mainResizeShow"><i class="nz-icon nz-icon-top"></i></button>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollbarWrap)" class="to-top" v-show="tools.showTopBtn && bottomBox.mainResizeShow"><i class="nz-icon nz-icon-top"></i></button>
<div class="pagination-bottom" v-show="!bottomBox.showSubList">
<Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
</div>
@@ -223,7 +223,7 @@
},
searchLabel: {}, //搜索参数
promServerType:null,
scrollWrap: null,
scrollbarWrap: null,
}
},
methods: {
@@ -310,6 +310,10 @@
});
},
getTableData() {
if (!this.hasButton('prom_view')) {
this.$message.error(this.$t("tip.noAccess"));
return;
}
this.tableData = [];
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
@@ -327,10 +331,10 @@
}
this.tableData = response.data.list;
this.pageObj.total = response.data.total;
if (!this.scrollWrap) {
if (!this.scrollbarWrap) {
this.$nextTick(() => {
this.scrollWrap = this.$refs.promTable.bodyWrapper;
this.toTopBtnHandler(this.scrollWrap);
this.scrollbarWrap = this.$refs.promTable.bodyWrapper;
this.toTopBtnHandler(this.scrollbarWrap);
});
}
}

View File

@@ -97,7 +97,7 @@
</template>
</el-table-column>
</el-table>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollWrap)" class="to-top" v-show="tools.showTopBtn "><i class="nz-icon nz-icon-top"></i></button>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollbarWrap)" class="to-top" v-show="tools.showTopBtn "><i class="nz-icon nz-icon-top"></i></button>
</div>
<transition name="right-box">
<role-box :detail="rightBox.detail" :role="role" @close="closeRightBox" v-if="rightBox.show"></role-box>
@@ -178,7 +178,7 @@
}],
},
searchLabel: {}, //搜索参数
scrollWrap: null,
scrollbarWrap: null,
}
},
methods: {
@@ -216,6 +216,10 @@
});
},
getTableData() {
if (!this.hasButton('role_view')) {
this.$message.error(this.$t("tip.noAccess"));
return;
}
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
this.tools.loading = true;
@@ -225,10 +229,10 @@
this.tableData = response.data.list;
this.pageObj.total = response.data.total
this.tools.loading = false;
if (!this.scrollWrap) {
if (!this.scrollbarWrap) {
this.$nextTick(() => {
this.scrollWrap = this.$refs.rolesTable.bodyWrapper;
this.toTopBtnHandler(this.scrollWrap);
this.scrollbarWrap = this.$refs.rolesTable.bodyWrapper;
this.toTopBtnHandler(this.scrollbarWrap);
});
}
}

View File

@@ -216,7 +216,7 @@
<el-input v-model="item.filePath" width="460px" />
</el-form-item>
<el-form-item prop="btn">
<button @click="notificationUpdate(item)" class="linkBtn nz-btn nz-btn-size-small-new nz-btn-style-normal-new" type="button" v-has="'system_notification_update'">Update</button>
<button @click="notificationUpdate(item)" class="linkBtn nz-btn nz-btn-size-small-new nz-btn-style-normal-new" type="button" v-has="'system_notification_save'">Update</button>
<button type="button" class="linkBtn nz-btn nz-btn-size-small-new nz-btn-style-light-new" @click="notificationCancel(item)">Cancel</button>
</el-form-item>
</el-form>
@@ -230,7 +230,7 @@
<!--</span>-->
</div>
<div class="linkFormBtn">
<i @click.stop="notificationEdit(item)" class="nz-icon nz-icon-edit" v-has="'system_notification_edit'"></i>
<i @click.stop="notificationEdit(item)" class="nz-icon nz-icon-edit" v-has="'system_notification_toEdit'"></i>
<i @click="notificationDel(item)" class="nz-icon nz-icon-delete" v-has="'system_notification_delete'"></i>
</div>
</div>
@@ -282,19 +282,19 @@
<el-input v-model="item.url" width="460px" />
</el-form-item>
<el-form-item prop="btn">
<button @click="linkUpdate(item)" class="linkBtn nz-btn nz-btn-size-small-new nz-btn-style-normal-new" type="button" v-has="'system_link_update'">Update</button>
<button @click="linkUpdate(item)" class="linkBtn nz-btn nz-btn-size-small-new nz-btn-style-normal-new" type="button" v-has="'system_link_save'">Update</button>
<button type="button" class="linkBtn nz-btn nz-btn-size-small-new nz-btn-style-light-new" @click="linkCancel(item)">Cancel</button>
</el-form-item>
</el-form>
<div class="linkFormContent" v-else>
<div class="linkTitleName" :title="item.name">{{item.name}}</div>
<div class="linkTitleUrl">
<span @click="openUrl(item)" @dblclick.stop="linkEdit(item)" class="linkTitleUrlContent" v-has="'system_link_edit'">
<span @click="openUrl(item)" @dblclick.stop="linkEdit(item)" class="linkTitleUrlContent" v-has="'system_link_toEdit'">
<span>{{item.url}}</span>
</span>
</div>
<div class="linkFormBtn">
<i @click.stop="linkEdit(item)" class="nz-icon nz-icon-edit" v-has="'system_link_edit'" v-if="item.buildIn=='0'"></i>
<i @click.stop="linkEdit(item)" class="nz-icon nz-icon-edit" v-has="'system_link_toEdit'" v-if="item.buildIn=='0'"></i>
<i @click="linkDel(item)" class="nz-icon nz-icon-delete" v-has="'system_link_delete'" v-if="item.buildIn=='0'"></i>
</div>
</div>

View File

@@ -8,7 +8,7 @@
<div class="top-tools">
<div></div>
<div>
<div class="top-tool-search float-right">
<div class="top-tool-search margin-r-5">
<search-input :searchMsg="searchMsg" @search="search"></search-input>
</div>
</div>
@@ -64,7 +64,7 @@
</template>
</el-table-column>
</el-table>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollWrap)" class="to-top" v-show="tools.showTopBtn"><i class="nz-icon nz-icon-top"></i></button>
<button :class="{'to-top-is-hover': tools.tableHover}" :style="{top: tools.toTopBtnTop}" @click="toTop(scrollbarWrap)" class="to-top" v-show="tools.showTopBtn"><i class="nz-icon nz-icon-top"></i></button>
<Pagination :tableId="tableId" :pageObj="pageObj" @pageNo='pageNo' @pageSize='pageSize' ref="Pagination"></Pagination>
</div>
</template>
@@ -214,7 +214,7 @@
],
},
searchLabel: {}, //搜索参数
scrollWrap: null,
scrollbarWrap: null,
}
},
methods: {
@@ -230,10 +230,10 @@
}
this.tableData = response.data.list;
this.pageObj.total = response.data.total;
if (!this.scrollWrap) {
if (!this.scrollbarWrap) {
this.$nextTick(() => {
this.scrollWrap = this.$refs.terminalLogTable.bodyWrapper;
this.toTopBtnHandler(this.scrollWrap);
this.scrollbarWrap = this.$refs.terminalLogTable.bodyWrapper;
this.toTopBtnHandler(this.scrollbarWrap);
});
}
}

View File

@@ -349,6 +349,9 @@
},
// 获取数据,用在子页面
getData(params) {
if (!this.hasButton('panel_view')) {
return;
}
if (params.start_time === '' || params.end_time === '') {
let now = bus.getTimezontDateRange();
let endTimeTmp = bus.timeFormate(now[1].getTime(), 'yyyy-MM-dd hh:mm:ss');
@@ -407,6 +410,9 @@
});
},
panelReloadOnlyPanel() { //仅刷新panel数据
if (!this.hasButton('panel_view')) {
return;
}
this.$get('panel').then(response => {
if (response.code === 200) {
this.panelData = response.data.list;

View File

@@ -168,7 +168,7 @@
</el-table>
<button class="to-top" :style="{top: tools.toTopBtnTop}"
:class="{'to-top-is-hover': tools.tableHover}"
@click="toTop(scrollWrap)" v-show="tools.showTopBtn && bottomBox.mainResizeShow"><i
@click="toTop(scrollbarWrap)" v-show="tools.showTopBtn && bottomBox.mainResizeShow"><i
class="nz-icon nz-icon-top"></i></button>
<div class="pagination-bottom" v-show="!bottomBox.showSubList">
<Pagination :tableId="tableId" v-cloak :pageObj="endpointPageObj" @pageNo='endpointPageNo'
@@ -379,7 +379,7 @@
readonly:true,
}],
},
scrollWrap: null
scrollbarWrap: null
}
},
methods:{
@@ -428,10 +428,10 @@
}
this.endpointTableData=response.data.list;
this.endpointPageObj.total=response.data.total;
if (!this.scrollWrap) {
if (!this.scrollbarWrap) {
this.$nextTick(() => {
this.scrollWrap = this.$refs.endpointTable.bodyWrapper;
this.toTopBtnHandler(this.scrollWrap);
this.scrollbarWrap = this.$refs.endpointTable.bodyWrapper;
this.toTopBtnHandler(this.scrollbarWrap);
});
}
}
@@ -562,6 +562,9 @@
});
},
jumpToAlertMsg(endpoint){
if (!this.hasButton('project_endpoint_alerts_view')) {
return;
}
this.endpoint=Object.assign({},endpoint);
this.bottomBox.targetTab='alertMessage';
this.bottomBox.showSubList=true;

View File

@@ -9,23 +9,24 @@ import VueResource from 'vue-resource'
Vue.use(VueResource);
const loginWhiteList = ['/login']; // 免登陆白名单
const permissionWhiteList = ['/login']; // 权限白名单
const permissionWhiteList = ['/menu', ...loginWhiteList]; // 权限白名单
router.beforeEach((to, from, next) => {
if (sessionStorage.getItem('nz-token')) {
if (loginWhiteList.indexOf(to.path) !== -1) {
if (permissionWhiteList.indexOf(to.path) !== -1) {
next();
} else {
let configUrl = "static/config.json?Timestamp=" + new Date().getTime();
let result = Vue.http.get(configUrl).then(res => {
new Promise(resolve => {
if (store.getters.menuList.length === 0) {
let configUrl = "static/config.json?Timestamp=" + new Date().getTime();
Vue.http.get(configUrl).then(res => {
post(res.body.baseUrl + "/sys/user/permissions", {token: sessionStorage.getItem("nz-token")}).then(res => {
store.commit("setMenuList", sortByOrderNum(res.data.menus));
store.commit("setButtonList", res.data.buttons);
store.commit("setRoleList", res.data.roles);
resolve();
});
});
} else {
resolve();
}
@@ -38,10 +39,9 @@ router.beforeEach((to, from, next) => {
}
}
});
});
}
} else {
if (permissionWhiteList.indexOf(to.path) !== -1) {
if (loginWhiteList.indexOf(to.path) !== -1) {
next();
} else {
next({path: '/login'})

View File

@@ -49,7 +49,7 @@ const user = {
bus.$emit("login");
router.push({
path: menuList.find(menu => {return menu.route && menu.route != "/menu" && menu.route != "/header"}).route,
path: menuList.find(menu => {return menu.route && menu.route != "/header"}).route,
query: {
t: +new Date()
}