diff --git a/nezha-fronted/src/components/common/alert/alertMessageTable.vue b/nezha-fronted/src/components/common/alert/alertMessageTable.vue index b2a95ee3f..66c279373 100644 --- a/nezha-fronted/src/components/common/alert/alertMessageTable.vue +++ b/nezha-fronted/src/components/common/alert/alertMessageTable.vue @@ -8,17 +8,27 @@ + + + + diff --git a/nezha-fronted/src/components/page/config/dc.vue b/nezha-fronted/src/components/page/config/dc.vue index dce1278cb..eb2ff5370 100644 --- a/nezha-fronted/src/components/page/config/dc.vue +++ b/nezha-fronted/src/components/page/config/dc.vue @@ -20,6 +20,16 @@ + + + + - @@ -120,10 +122,9 @@ loading: false, //是否显示table加载动画 toTopBtnTop: this.$tableHeight.toTopBtnTop, //to-top按钮的top属性 tableHover: false, //控制滚动条和top按钮同时出现 - showElementSet: false, //自定义列弹框是否显示 showTopBtn: false, //显示To top按钮 - tablelable: [], //从缓存中加载的table header - dropCol: [], //自定义列工具的数据 + showCustomTableTitle: false, //自定义列弹框是否显示 + customTableTitle: [], //自定义列工具的数据 }, tableId: 'mibTable', //需要分页的table的id,用于记录每页数量 mib: {}, @@ -197,39 +198,6 @@ } }, methods: { - elementsetShow(s, e) { - this.tools.showElementSet = true; - this.$nextTick(() => { - var eventfixed = { - shezhi: 0, - screen: 0 - }; - eventfixed[s] = 1; - e.preventDefault(); - this.$store.commit('setHeaderTable', this.tools.tablelable); - this.$store.commit('setEventfixed', eventfixed); - const h = document.documentElement.clientHeight; - const w = document.documentElement.clientWidth; - const dw = this.$refs.elementset.$el.offsetWidth; - const dh = this.$refs.elementset.$el.offsetHeight; - let positionx = - e.clientX + dw <= w - 10 ? e.clientX + 14 : e.clientX + 14 - dw; - let positiony = - e.clientY + dh <= h - 10 - ? e.clientY + 20 - : e.clientY + 20 - (e.clientY + dh - h); - this.$store.commit('setPosition', {positionx, positiony}); - }); - }, - elementsetHide() { - //悬浮点击空白隐藏 - this.$refs.elementset.elementsetHide(); - }, - tablelabelEmit(data) { - //获取子组件传过来的参数 - this.$store.commit('setHeaderTable', data); - this.tools.tablelable = data; - }, clickOutside() { this.rightBox.show = false; }, @@ -373,6 +341,10 @@ }, }, mounted() { + //初始化表头 + this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) + ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) + : this.tableTitle; //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize != 'undefined' && pageSize != null) { @@ -399,12 +371,6 @@ }); } }); - this.tools.tablelable = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) - ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) - : this.tableTitle; - this.tools.dropCol = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) - ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) - : this.tableTitle; }, } diff --git a/nezha-fronted/src/components/page/config/model.vue b/nezha-fronted/src/components/page/config/model.vue index 2f07f9b1b..1c9476664 100644 --- a/nezha-fronted/src/components/page/config/model.vue +++ b/nezha-fronted/src/components/page/config/model.vue @@ -19,6 +19,16 @@ + + + + @@ -83,14 +93,6 @@ - @@ -120,10 +122,9 @@ loading: false, //是否显示table加载动画 toTopBtnTop: this.$tableHeight.toTopBtnTop, //to-top按钮的top属性 tableHover: false, //控制滚动条和top按钮同时出现 - showElementSet: false, //自定义列弹框是否显示 showTopBtn: false, //显示To top按钮 - tablelable: [], //从缓存中加载的table header - dropCol: [], //自定义列工具的数据 + showCustomTableTitle: false, //自定义列弹框是否显示 + customTableTitle: [], //自定义列工具的数据 }, tableId: 'modelTable', //需要分页的table的id,用于记录每页数量 @@ -196,45 +197,12 @@ } }, methods: { - elementsetShow(s, e) { - this.tools.showElementSet = true; - this.$nextTick(() => { - let eventfixed = { - shezhi: 0, - screen: 0 - }; - eventfixed[s] = 1; - e.preventDefault(); - this.$store.commit('setHeaderTable', this.tools.tablelable); - this.$store.commit('setEventfixed', eventfixed); - const h = document.documentElement.clientHeight; - const w = document.documentElement.clientWidth; - const dw = this.$refs.elementset.$el.offsetWidth; - const dh = this.$refs.elementset.$el.offsetHeight; - let positionx = - e.clientX + dw <= w - 10 ? e.clientX + 14 : e.clientX + 14 - dw; - let positiony = - e.clientY + dh <= h - 10 - ? e.clientY + 20 - : e.clientY + 20 - (e.clientY + dh - h); - this.$store.commit('setPosition', {positionx, positiony}); - }); - }, - elementsetHide() { - //悬浮点击空白隐藏 - this.$refs.elementset.elementsetHide(); - }, assetStatClassName(param) { if (param.column.label == this.$t("config.model.assets")) { return "asset-state"; } return ""; }, - tablelabelEmit(data) { - //获取子组件传过来的参数 - this.$store.commit('setHeaderTable', data); - this.tools.tablelable = data; - }, panel(obj) { this.bottomBox.showSubList = true; this.bottomBox.model = obj; @@ -372,6 +340,10 @@ }, }, mounted() { + //初始化表头 + this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) + ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) + : this.tableTitle; //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize != 'undefined' && pageSize != null) { @@ -398,12 +370,6 @@ }); } }); - this.tools.tablelable = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) - ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) - : this.tableTitle; - this.tools.dropCol = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) - ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) - : this.tableTitle; }, watch: { 'bottomBox.showSubList': function(n) { diff --git a/nezha-fronted/src/components/page/config/operationlog.vue b/nezha-fronted/src/components/page/config/operationlog.vue index bf2542959..0fb63bf18 100644 --- a/nezha-fronted/src/components/page/config/operationlog.vue +++ b/nezha-fronted/src/components/page/config/operationlog.vue @@ -13,13 +13,23 @@ + + + + - diff --git a/nezha-fronted/src/components/page/config/promServer.vue b/nezha-fronted/src/components/page/config/promServer.vue index ad787fb7a..fbe5fd047 100644 --- a/nezha-fronted/src/components/page/config/promServer.vue +++ b/nezha-fronted/src/components/page/config/promServer.vue @@ -19,10 +19,20 @@ + + + + - @@ -77,14 +87,6 @@ - @@ -120,10 +122,9 @@ loading: false, //是否显示table加载动画 toTopBtnTop: this.$tableHeight.toTopBtnTop, //to-top按钮的top属性 tableHover: false, //控制滚动条和top按钮同时出现 - showElementSet: false, //自定义列弹框是否显示 showTopBtn: false, //显示To top按钮 - tablelable: [], //从缓存中加载的table header - dropCol: [], //自定义列工具的数据 + showCustomTableTitle: false, //自定义列弹框是否显示 + customTableTitle: [], //自定义列工具的数据 }, tableId: 'promTable', //需要分页的table的id,用于记录每页数量 @@ -252,37 +253,6 @@ }); return detail; }, - elementsetShow(s, e) { - this.tools.showElementSet = true; - var eventfixed = { - shezhi: 0, - screen: 0 - }; - eventfixed[s] = 1; - e.preventDefault(); - this.$store.commit('setHeaderTable', this.tools.tablelable); - this.$store.commit('setEventfixed', eventfixed); - const h = document.documentElement.clientHeight; - const w = document.documentElement.clientWidth; - const dw = this.$refs.elementset.$el.offsetWidth; - const dh = this.$refs.elementset.$el.offsetHeight; - let positionx = - e.clientX + dw <= w - 10 ? e.clientX + 14 : e.clientX + 14 - dw; - let positiony = - e.clientY + dh <= h - 10 - ? e.clientY + 20 - : e.clientY + 20 - (e.clientY + dh - h); - this.$store.commit('setPosition', {positionx, positiony}); - }, - elementsetHide() { - //悬浮点击空白隐藏 - this.$refs.elementset.elementsetHide(); - }, - tablelabelEmit(data) { - //获取子组件传过来的参数 - this.$store.commit('setHeaderTable', data); - this.tools.tablelable = data; - }, edit(u) { this.promServer = JSON.parse(JSON.stringify(u)); this.rightBox.show = true; @@ -426,11 +396,15 @@ this.getTableData(); }, }, - mounted: function () { + mounted() { //初始化数据 Promise.all([this.getDcData()]).then(response => { this.getTableData(); }); + //初始化表头 + this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) + ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) + : this.tableTitle; //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize != 'undefined' && pageSize != null) { @@ -456,12 +430,6 @@ }); } }); - this.tools.tablelable = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) - ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) - : this.tableTitle; - this.tools.dropCol = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) - ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) - : this.tableTitle; }, watch: { diff --git a/nezha-fronted/src/components/page/config/terminallog.vue b/nezha-fronted/src/components/page/config/terminallog.vue index 3aec2422a..7bcc90a7b 100644 --- a/nezha-fronted/src/components/page/config/terminallog.vue +++ b/nezha-fronted/src/components/page/config/terminallog.vue @@ -13,6 +13,16 @@ + + + + - diff --git a/nezha-fronted/src/components/page/project/project.vue b/nezha-fronted/src/components/page/project/project.vue index 82906ae70..34587b98a 100644 --- a/nezha-fronted/src/components/page/project/project.vue +++ b/nezha-fronted/src/components/page/project/project.vue @@ -43,6 +43,16 @@ + + + + @@ -117,21 +127,12 @@ + - - - @@ -180,23 +181,17 @@ loading: false, //是否显示table加载动画 toTopBtnTop: this.$tableHeight.toTopBtnTop, //to-top按钮的top属性 tableHover: false, //控制滚动条和top按钮同时出现 - showElementSet: false, //自定义列弹框是否显示 showTopBtn: false, //显示To top按钮 - tablelable: [], //从缓存中加载的table header - dropCol: [], //自定义列工具的数据 + showCustomTableTitle: false, //自定义列弹框是否显示 + customTableTitle: [], //自定义列工具的数据 }, tableId: 'projectTable', //需要分页的table的id,用于记录每页数量 - - endpoint:{ - project:null, - module:null, - }, userData: [], endpoint: {id: '', host: '', port: '', param: '', path: '', asset: {}, project: {}, module: {}, moduleId: '', assetId: '', paramObj: []}, - endpointTableTitle: [ + tableTitle: [ { label: this.$t("project.endpoint.endpointId"), prop: 'id', @@ -249,7 +244,6 @@ pageSize: 50, total:0 }, - endpoint: {}, currentProjectTitle:'', moduleList: [], @@ -294,36 +288,6 @@ let vm = this; this.$bottomBoxWindow.listResize(vm, e); }, - elementsetShow(s, e) { - var eventfixed = { - shezhi: 0, - screen: 0 - }; - eventfixed[s] = 1; - e.preventDefault(); - this.$store.commit('setHeaderTable', this.tools.tablelable); - this.$store.commit('setEventfixed', eventfixed); - const h = document.documentElement.clientHeight; - const w = document.documentElement.clientWidth; - const dw = this.$refs.elementset.$el.offsetWidth; - const dh = this.$refs.elementset.$el.offsetHeight; - let positionx = - e.clientX + dw <= w - 10 ? e.clientX + 14 : e.clientX + 14 - dw; - let positiony = - e.clientY + dh <= h - 10 - ? e.clientY + 20 - : e.clientY + 20 - (e.clientY + dh - h); - this.$store.commit('setPosition', { positionx, positiony }); - }, - elementsetHide() { - //悬浮点击空白隐藏 - this.tools.showElementSet = false; - }, - tablelabelEmit(data) { - //获取子组件传过来的参数 - this.$store.commit('setHeaderTable', data); - this.tools.tablelable = data; - }, getEndpointTableData() { if(this.currentModule && this.currentModule.id) { this.pageType = 'endpoint'; @@ -493,9 +457,6 @@ this.endpoint = Object.assign({}, endpoint); this.bottomBox.targetTab = 'assetDetail'; this.bottomBox.showSubList = true; - /*this.viewAssetState=true; - this.$refs.assetEditUnit.getAssetData(id); - this.$refs.assetEditUnit.tabView=true;*/ }, query(endpoint) { this.endpoint = Object.assign({}, endpoint); @@ -507,7 +468,6 @@ if(row.state == 1){ return 'up'; }else{ - // return 'down'+'['+this.getStateErrorMsg(row)+']'; return `down:${this.getStateErrorMsg(row)}` } } @@ -647,6 +607,10 @@ this.getProjectList(); }, mounted() { + //初始化表头 + this.tools.customTableTitle = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) + ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) + : this.tableTitle; //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize) { @@ -663,13 +627,6 @@ window.onresize = function() { vm.$refs.leftScrollbar.update(); }; - - this.tools.tablelable = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) - ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) - : this.endpointTableTitle; - this.tools.dropCol = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) - ? JSON.parse(localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path)) - : this.endpointTableTitle; }, computed: { itemTip() { diff --git a/nezha-fronted/src/main.js b/nezha-fronted/src/main.js index aecbcc412..9df955c34 100644 --- a/nezha-fronted/src/main.js +++ b/nezha-fronted/src/main.js @@ -34,7 +34,6 @@ import editEndpointBox from './components/common/rightBox/editEndpointBox'; //en import addEndpointBox from './components/common/rightBox/addEndpointBox'; //endpoint弹框组件 import assetBox from "./components/common/rightBox/assetBox"; //资产添加组件 import alertConfigBox from "./components/common/rightBox/alertConfigBox"; //告警规则弹框组件 -import dcConfigBox from "./components/common/popBox/dcConfig"; //idc配置弹框组件 import panelBox from "./components/common/rightBox/panelBox"; //面板弹框组件 import moduleListPop from "./components/page/asset/moduleListPop"; //面板弹框组件 import cabinetConfigBox from "./components/common/popBox/cabinetConfig"; //面板弹框组件 @@ -55,7 +54,6 @@ Vue.component("edit-endpoint-box", editEndpointBox); Vue.component("add-endpoint-box", addEndpointBox); Vue.component("asset-box", assetBox); Vue.component("alert-config-box", alertConfigBox); -Vue.component("idc-config-box", dcConfigBox); Vue.component("panel-box", panelBox); Vue.component("module-list-pop", moduleListPop); Vue.component("cabinet-config-box", cabinetConfigBox); diff --git a/nezha-fronted/src/store/index.js b/nezha-fronted/src/store/index.js index 705caee86..0f3e09c52 100644 --- a/nezha-fronted/src/store/index.js +++ b/nezha-fronted/src/store/index.js @@ -1,46 +1,23 @@ import Vue from 'vue' import Vuex from 'vuex' -Vue.use(Vuex) +Vue.use(Vuex); const store = new Vuex.Store({ state: { - assetForAlertList: 0, //asset页跳转alertList时传递的assetId - - assetItemId:'' , //复选框ID - assetAllId:[] , //复选框allID - - dcList: 0, //监听此值,改变则刷新dc列表 /* 监听对象变化,用于顶部菜单与底部内容的同步 */ currentProject: {id: "", name: "", remark: ""}, - currentModule: {id: ""}, - currentAsset: {id: ""}, - currentDcList: [], projectListChange: 0, - moduleListChange: 0, - endpointListChange: 0, - assetListChange: 0, - dcListChange: 0, - alertConfigListChange: 0, - eventfixed: { - shezhi: 0, - screen: 0 - }, - tablelable: [], //获取头部信息 - position: { - event_positiony: 0, - event_positionx: -200 - }, showPanel:{ id: 0, name: '', type: "dashboard" }, - consoleShow:false,//是否显示console窗口 - consoleCount:0,//当前console窗口数 - isAddConsole:false,//是否增加窗口 - consoleParam:{},//新开console窗口参数 - linkData:[],//导航数据 + consoleShow: false,//是否显示console窗口 + consoleCount: 0,//当前console窗口数 + isAddConsole: false,//是否增加窗口 + consoleParam: {},//新开console窗口参数 + linkData: [],//导航数据 }, getters: { getLinkData(state){ @@ -52,85 +29,46 @@ const store = new Vuex.Store({ projectListChange(state) { state.projectListChange++; }, - moduleListChange(state) { - state.moduleListChange++; - }, - endpointListChange(state) { - state.endpointListChange++; - }, - assetListChange(state) { - state.assetListChange++; - }, - alertConfigListChange(state) { - state.alertConfigListChange++; - }, - dcListChange(state) { - state.dcListChange++; - }, currentProjectChange(state, project) { state.currentProject = project; }, - currentDcListChange(state, dcList) { - state.currentDcList = dcList; - }, - currentAssetChange(state, asset) { - state.currentAsset = asset; - }, panelShowPanelChange(state, panel) { //用来panel页控制初始panel的 state.showPanel.id = panel.id; state.showPanel.name = panel.name; }, - setHeaderTable(state, data) { //设置table头部 - state.tablelable = data; - }, - assetItemIdChange(state,data){ //修改复选框 - state.assetItemId = data - }, - assetAllIdChange(state,data){ //修改复选框 - state.assetAllId = data - }, - setEventfixed(state, data) { //设置坐标 - state.eventfixed = data; - }, - setPosition(state, data) { //设置坐标 - state.position = data; - }, - assetForAlertListChange(state, data) { //asset跳转alertmsg时 - state.assetForAlertList = data; - }, - openConsole(state){//打开console,如果当前窗口数为0,则默认新建一个console - state.consoleShow=true; - if(state.consoleCount===0){ + openConsole(state) {//打开console,如果当前窗口数为0,则默认新建一个console + state.consoleShow = true; + if(state.consoleCount === 0){ state.consoleCount++; state.isAddConsole = true; }else { state.isAddConsole = false; } }, - addConsole(state,data){//打开console,并新建一个console - state.consoleShow=true; + addConsole(state,data) {//打开console,并新建一个console + state.consoleShow = true; state.consoleCount++; state.isAddConsole = true; state.consoleParam = data; }, - addConsoleNum(state){ + addConsoleNum(state) { state.consoleCount++; }, - removeConsole(state){//移除一个console,如果是最后一个,则关闭窗口,否则不关闭窗口 + removeConsole(state) {//移除一个console,如果是最后一个,则关闭窗口,否则不关闭窗口 state.consoleCount--; - if(state.consoleCount===0){ - state.consoleShow=false; + if(state.consoleCount === 0){ + state.consoleShow = false; } }, - closeConsole(state){//关闭console窗口 - state.consoleShow=false; + closeConsole(state) {//关闭console窗口 + state.consoleShow = false; state.consoleCount = 0; state.consoleParam ={}; }, - minConsole(state){//最小化窗口 - state.consoleShow=false; + minConsole(state) {//最小化窗口 + state.consoleShow = false; }, setLinkData(state, data) { state.linkData = data;