diff --git a/nezha-fronted/src/assets/stylus/main.scss b/nezha-fronted/src/assets/stylus/main.scss index d4b8ddc47..e307bc069 100644 --- a/nezha-fronted/src/assets/stylus/main.scss +++ b/nezha-fronted/src/assets/stylus/main.scss @@ -13,7 +13,7 @@ li{ list-style-type:none ; } .content-box { - height: calc(100% - 53px); + height: calc(100% - 50px); } .nz-icon-gear:before { @@ -643,20 +643,51 @@ li{ position: relative; } .main-list.main-list-with-sub { - height: calc(50% - 4px); + height: 50%; +} +.sub-box { + height: 50%; + position: relative; } .sub-list { height: calc(100% - 9px); - position: relative; + position: absolute; + width: 100%; + z-index: 1; + top: 9px; } .main-and-sub-transition { transition: .4s height; } -.sub-list-resize { +.main-modal { + position: absolute; + height: 100%; + width: 100%; + display: none; + z-index: 100; +} +.resize-modal { + width: 100%; + opacity: 0.6; + background-color: #f5f9ff; + border: 1px solid #a7d0f7; + box-sizing: border-box; + position: fixed; margin: 0 -6px; + cursor: ns-resize; + display: none; + z-index: 20; + vertical-align: bottom; + bottom: 0; +} +.sub-list-resize, .sub-list-resize-copy { border-top: 1px solid #aaa; background-color: #eaeaea; height: 9px; + margin-left: -6px; + width: calc(100% + 12px); + position: absolute; + z-index: 1; box-sizing: border-box; user-select: none; color: #5f6368; @@ -665,6 +696,11 @@ li{ justify-content: center; cursor: ns-resize; } +.sub-list-resize-copy { + border-top: 1px solid #a7d0f7; + margin-left: 0; + width: calc(100% - 198px); +} .sub-list-window-control { display: flex; align-items: center; @@ -672,7 +708,7 @@ li{ position: absolute; right: 0; top: 5px; - z-index: 1; + z-index: 2; } .window-control-btn { cursor: pointer; @@ -848,8 +884,6 @@ li{ } } @keyframes slide-out-to-right { - /*from {right: 0px} - to {right: -550px}*/ from { transform: scaleX(1); transform-origin: right; @@ -859,15 +893,6 @@ li{ transform-origin: right; } } -/*.right-box-enter-active{ - transition: transform 0.4s; -} -.right-box-leave-active { - transition: transform 0.4s; -} -.right-box-enter, .right-box-leave-to { - transform: translateX(100%); -}*/ .right-box-enter-active, .right-box-leave-active { transform: scaleX(1); opacity: 1; @@ -880,25 +905,6 @@ li{ opacity: 0; transform: scaleX(0); } -.right-box-580-enter-active{ - transition: transform 0.4s; -} -.right-box-580-leave-active { - transition: transform 0.4s; -} -.right-box-580-enter,.right-box-580-leave-to { - transform: translateX(100%); -} - -.right-box-840-enter-active{ - transition: transform 0.4s; -} -.right-box-840-leave-active { - transition: transform 0.4s; -} -.right-box-840-enter,.right-box-840-leave-to { - transform: translateX(100%); -} /* end--右弹框滑入滑出动画*/ /* begin--右子弹框动画*/ @@ -933,7 +939,7 @@ li{ /*此处自定义弹框尺寸,不同功能可能需要的尺寸不一样,需自行添加*/ .right-box-account, .right-box-prom, .right-box-alert-config, .right-box-project, .right-box-module, .right-box-cabinet, -.right-box-edit-endpoint, .right-box-panel, .right-box-dc, .right-box-model,.right-box-mib, .right-box-add-asset, .right-box-add-chart { +.right-box-edit-endpoint, .right-box-panel, .right-box-dc, .right-box-model, .right-box-mib, .right-box-asset, .right-box-add-chart { width: 850px; } .right-box-chart .el-input__inner, .right-box-chart input { diff --git a/nezha-fronted/src/components/charts/chart-detail.vue b/nezha-fronted/src/components/charts/chart-detail.vue index e3a5b5df8..b0b4ef2d4 100644 --- a/nezha-fronted/src/components/charts/chart-detail.vue +++ b/nezha-fronted/src/components/charts/chart-detail.vue @@ -41,7 +41,7 @@
- {{value == 1 ? $t('asset.createAssetTab.inStock') : $t('asset.createAssetTab.outStock')}} + {{value == 1 ? $t('asset.inStock') : $t('asset.outStock')}} {{value + ' ' + $t('overall.active')}}
-
+
- + + +
@@ -124,8 +127,9 @@ { - this.loading = false; + this.tools.loading = false; if (response.code === 200) { for (let i = 0; i < response.data.list.length; i++) { response.data.list[i].status = response.data.list[i].status + ""; @@ -392,13 +400,13 @@ } }, watch: { - user: { + 'bottomBox.user': { deep: true, handler(n) { - this.userDetail = this.convertToDetail(n); + this.bottomBox.userDetail = this.convertToDetail(n); } }, - showSubList(n) { + 'bottomBox.showSubList': function(n) { let vm = this; this.$bottomBoxWindow.showSubListWatch(vm, n); } @@ -417,23 +425,23 @@ if (el._ps_) { el.addEventListener("ps-scroll-y", () => { if (el._ps_.scrollbarYTop > 50) { - this.showTopBtn = true; + this.tools.showTopBtn = true; } else { - this.showTopBtn = false; + this.tools.showTopBtn = false; } }); el.addEventListener("mouseenter", () => { - this.tableHover = true; + this.tools.tableHover = true; }); el.addEventListener("mouseleave", () => { - this.tableHover = false; + this.tools.tableHover = false; }); } }); - this.tablelable = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) + 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.dropCol = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) + 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/dc.vue b/nezha-fronted/src/components/page/config/dc.vue index 095fd8565..0d2c6c180 100644 --- a/nezha-fronted/src/components/page/config/dc.vue +++ b/nezha-fronted/src/components/page/config/dc.vue @@ -37,11 +37,12 @@
-
-
-
+
+
+
+
- - +
- +   - +  
@@ -109,23 +109,26 @@
- +
- + + +
@@ -142,14 +145,19 @@ data() { return { showTab: 'file', //file/browser - loading: false, - - toTopBtnTop: this.$tableHeight.toTopBtnTop, //to-top按钮的top属性 - tableHover: false, //控制滚动条和top按钮同时出现 - + rightBox: {show: false}, + tools: { + loading: false, //是否显示table加载动画 + toTopBtnTop: this.$tableHeight.toTopBtnTop, //to-top按钮的top属性 + tableHover: false, //控制滚动条和top按钮同时出现 + showElementSet: false, //自定义列弹框是否显示 + showTopBtn: false, //显示To top按钮 + tablelable: [], //从缓存中加载的table header + dropCol: [], //自定义列工具的数据 + }, tableId: 'mibTable', //需要分页的table的id,用于记录每页数量 - showTopBtn: false, - mib: { + mib: {}, + blankMib: { id: null, name: '', remark:'', @@ -198,8 +206,6 @@ width: 120 } ], - tablelable: [], - dropCol: [], tableData: [], searchMsg: { //给搜索框子组件传递的信息 zheze_none: true, @@ -222,25 +228,28 @@ }, methods: { elementsetShow(s, e) { - var eventfixed = { - shezhi: 0, - screen: 0 - }; - eventfixed[s] = 1; - e.preventDefault(); - this.$store.commit('setHeaderTable', this.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}); + 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() { //悬浮点击空白隐藏 @@ -249,16 +258,22 @@ tablelabelEmit(data) { //获取子组件传过来的参数 this.$store.commit('setHeaderTable', data); - this.tablelable = data; + this.tools.tablelable = data; }, - clickos() { + clickOutside() { this.rightBox.show = false; }, - toEdit: function (u) { - this.mib = Object.assign({}, u); - this.$refs.mibBox.show(true, true); + edit(u) { + this.mib = JSON.parse(JSON.stringify(u)); + this.rightBox.show = true; }, - del: function (u) { + closeRightBox(refresh) { + this.rightBox.show = false; + if (refresh) { + this.getTableData(); + } + }, + del(u) { this.$confirm(this.$t("tip.confirmDelete"), { confirmButtonText: this.$t("tip.yes"), cancelButtonText: this.$t("tip.no"), @@ -268,23 +283,18 @@ if (response.code === 200) { this.$message({duration: 1000, type: 'success', message: this.$t("tip.deleteSuccess")}); this.getTableData(); - this.rightBox.show = false; } else { this.$message.error(response.msg); } }) }); }, - detail: function (u) { - this.mib = Object.assign({}, u); - this.$refs.mibBox.show(true, false); + add() { + this.mib = this.newMib(); + this.rightBox.show = true; }, - toAdd: function () { - this.cleanMib(); - this.$refs.mibBox.show(true, true); - }, - esc: function () { - this.rightBox.show = false; + newMib() { + return JSON.parse(JSON.stringify(this.blankMib)); }, jumpTo(data, id) { bus.$emit("menu-change", data); @@ -295,13 +305,13 @@ } }); }, - getTableData: function () { + getTableData() { this.tableData = []; this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo); this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize); - this.loading = true; + this.tools.loading = true; this.$get('mib', this.searchLabel).then(response => { - this.loading = false; + this.tools.loading = false; if (response.code === 200) { this.tableData = response.data.list; this.pageObj.total = response.data.total @@ -317,7 +327,7 @@ localStorage.setItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId, val); this.getTableData(); }, - search: function (searchObj) { + search(searchObj) { let orderBy=''; if(this.searchLabel.orderBy){ orderBy=this.searchLabel.orderBy @@ -334,8 +344,8 @@ } this.getTableData(); }, - downloadMib:function(mibId){ - axios.get('/mib/download?id='+mibId,{responseType: 'blob'}).then(data=>{ + downloadMib(mib) { + axios.get('/mib/download?id='+mib.id,{responseType: 'blob'}).then(data=>{ let fileName = new Date().getTime()+'.txt'; let disposition=data.headers['content-disposition']; if(disposition){ @@ -358,17 +368,6 @@ } }) }, - cleanMib() { - this.mib = { - id: null, - name: '', - remark:'', - file:'', - models:'', - file:null, - }; - this.$refs.mibBox.clearData(); - }, //是否需要排序 sortableShow(prop){ switch(prop){ @@ -403,7 +402,7 @@ this.getTableData(); }, }, - mounted: function () { + mounted() { //是否存在分页缓存 let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId); if (pageSize != 'undefined' && pageSize != null) { @@ -417,39 +416,32 @@ if (el._ps_) { el.addEventListener("ps-scroll-y", () => { if (el._ps_.scrollbarYTop > 50) { - this.showTopBtn = true; + this.tools.showTopBtn = true; } else { - this.showTopBtn = false; + this.tools.showTopBtn = false; } }); el.addEventListener("mouseenter", () => { - this.tableHover = true; + this.tools.tableHover = true; }); el.addEventListener("mouseleave", () => { - this.tableHover = false; + this.tools.tableHover = false; }); } }); - this.tablelable = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) + 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.dropCol = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) + 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: { - - } } -
+
- + + +
- - + - - +
@@ -187,7 +187,6 @@ import bus from '../../../libs/bus' import panelTab from '../../common/bottomBox/tabs/panelTab' - var vm; export default { name: "project2", components: { @@ -196,28 +195,41 @@ 'panel-tab': panelTab }, data() { - vm = this; return { - loading: false, - ready: false, - assetDetail: {}, //asset详情 - endpointDetail: [], - targetTab: '', + /*二级页面相关*/ + bottomBox: { + endpoint: {}, //asset详情 + endpointDetail: [], + mainResizeShow: true, //dom高度改变时部分内容是否展示 + subResizeShow: true, + isFullScreen: false, //是否是全屏,用来控制拖动条是否展示, + showSubList: false, + targetTab: '', + }, + mainTableHeight: this.$tableHeight.normal, //主列表table高度 - toTopBtnTop: this.$tableHeight.toTopBtnTop, //to-top按钮的top属性 - isFullScreen: false, //是否是全屏,用来控制拖动条是否展示 + ready: false, + + /*工具参数*/ + tools: { + loading: false, //是否显示table加载动画 + toTopBtnTop: this.$tableHeight.toTopBtnTop, //to-top按钮的top属性 + tableHover: false, //控制滚动条和top按钮同时出现 + showElementSet: false, //自定义列弹框是否显示 + showTopBtn: false, //显示To top按钮 + tablelable: [], //从缓存中加载的table header + dropCol: [], //自定义列工具的数据 + }, + + tableId: 'projectTable', //需要分页的table的id,用于记录每页数量 - mainResizeShow: true, //dom高度改变时部分内容是否展示 - subResizeShow: true, - mainListHeight: '', //主列表dom的高度 - showSubList: false, + endpointEditInfos:{ project:null, module:null, }, userData: [], - showTopBtn: false, //主列表top按钮 - tableHover: false, //控制滚动条和top按钮同时出现 + editEndpoint: {id: '', host: '', port: '', param: '', path: '', asset: {}, project: {}, module: {}, moduleId: '', assetId: '', paramObj: []}, endpointTableTitle: [ { @@ -272,9 +284,8 @@ pageSize: 50, total:0 }, - curEndpoint: {}, - tablelable: [], - dropCol: [], + currentEndpoint: {}, + currentProjectTitle:'', moduleList: [], projectList: [], @@ -299,21 +310,22 @@ disabled: false }], }, - /*viewAssetState:false,*/ - selectedEndpoints:[],//选中的metric{label='value'} } }, methods: { // 全屏 fullScreen() { + let vm = this; this.$bottomBoxWindow.fullScreen(vm); }, // 退出全屏 exitFullScreen() { + let vm = this; this.$bottomBoxWindow.exitFullScreen(vm); }, // 鼠标拖动二级列表 listResize(e) { + let vm = this; this.$bottomBoxWindow.listResize(vm, e); }, elementsetShow(s, e) { @@ -323,7 +335,7 @@ }; eventfixed[s] = 1; e.preventDefault(); - this.$store.commit('setHeaderTable', this.tablelable); + this.$store.commit('setHeaderTable', this.tools.tablelable); this.$store.commit('setEventfixed', eventfixed); const h = document.documentElement.clientHeight; const w = document.documentElement.clientWidth; @@ -339,12 +351,12 @@ }, elementsetHide() { //悬浮点击空白隐藏 - this.$refs.elementset.elementsetHide(); + this.tools.showElementSet = false; }, tablelabelEmit(data) { //获取子组件传过来的参数 this.$store.commit('setHeaderTable', data); - this.tablelable = data; + this.tools.tablelable = data; }, getEndpointTableData() { if(this.currentModule&&this.currentModule.id){ @@ -352,9 +364,9 @@ this.endpointSearchLabel.moduleId = this.currentModule.id; this.$set(this.endpointSearchLabel, 'pageNo', this.endpointPageObj.pageNo); this.$set(this.endpointSearchLabel, 'pageSize', this.endpointPageObj.pageSize); - this.loading = true; + this.tools.loading = true; this.$get('endpoint', this.endpointSearchLabel).then(response => { - this.loading = false; + this.tools.loading = false; if (response.code === 200) { for (let i = 0; i < response.data.list.length; i++) { try { @@ -501,9 +513,8 @@ this.currentModule = module; this.endpointSearchLabel = {moduleId: ''}; this.$refs.projectSearch.clearSearch(); - this.showSubList = false; - this.selectedEndpoints=[]; - this.currentProject={}; + this.bottomBox.showSubList = false; + this.currentProject = {}; }, //弹出endpoint编辑页 @@ -528,9 +539,9 @@ //查看endpoint详情 detail(endpoint) { - this.curEndpoint = Object.assign({}, endpoint); - this.targetTab = "panel"; - this.showSubList = true; + this.currentEndpoint = Object.assign({}, endpoint); + this.bottomBox.targetTab = "panel"; + this.bottomBox.showSubList = true; }, initSnmpParam(module) { this.$set(module, 'walk', []); @@ -649,17 +660,17 @@ return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds; }, viewAsset(endpoint) { - this.curEndpoint = Object.assign({}, endpoint); - this.targetTab = 'assetDetail'; - this.showSubList = true; + this.currentEndpoint = Object.assign({}, endpoint); + this.bottomBox.targetTab = 'assetDetail'; + this.bottomBox.showSubList = true; /*this.viewAssetState=true; this.$refs.assetEditUnit.getAssetData(id); this.$refs.assetEditUnit.tabView=true;*/ }, showEndpoint(endpoint) { - this.curEndpoint = Object.assign({}, endpoint); - this.targetTab = 'endpointQuery'; - this.showSubList = true; + this.currentEndpoint = Object.assign({}, endpoint); + this.bottomBox.targetTab = 'endpointQuery'; + this.bottomBox.showSubList = true; }, getStateContent:function(row){ if(row){ @@ -712,7 +723,7 @@ }, assetConvertToDetail(obj) { let detail = JSON.parse(JSON.stringify(obj)); - detail.state = obj.state == 1 ? this.$t('asset.createAssetTab.inStock'): this.$t('asset.createAssetTab.notInStock'); + detail.state = obj.state == 1 ? this.$t('asset.inStock'): this.$t('asset.notInStock'); detail.assetType = obj.model.type.value; detail.vendorModel = obj.model.vendor.value + " " + obj.model.name; detail.dataCenter = obj.idc ? obj.idc.name : ""; @@ -728,47 +739,47 @@ detail.account = account.user; let loginType = ""; if (account.authType == 1) { - loginType = this.$t('asset.createAssetTab.password'); + loginType = this.$t('asset.password'); } else if (account.authType == 2) { - loginType = this.$t('asset.createAssetTab.ssh'); + loginType = this.$t('asset.ssh'); } detail.loginType = loginType; detail.port = account.port; } - /*detail.push({label: this.$t("asset.createAssetTab.sn"), value: obj.sn}); - detail.push({label: this.$t("asset.createAssetTab.host"), value: obj.host}); - detail.push({label: this.$t("asset.createAssetTab.state"), value: obj.state == 1 ? this.$t('asset.createAssetTab.inStock'): this.$t('asset.createAssetTab.notInStock')}); + /*detail.push({label: this.$t("asset.sn"), value: obj.sn}); + detail.push({label: this.$t("asset.host"), value: obj.host}); + detail.push({label: this.$t("asset.state"), value: obj.state == 1 ? this.$t('asset.inStock'): this.$t('asset.notInStock')}); detail.push({label: this.$t("asset.tableTitle.modules"), value: obj.endpointNum}); detail.push({label: this.$t("asset.tableTitle.alerts"), value: obj.alertNum}); - detail.push({label: this.$t("asset.createAssetTab.assetType"), value: obj.model.type.value}); - detail.push({label: this.$t("asset.createAssetTab.vendorModel"), value: obj.model.vendor.value + " " + obj.model.name}); - detail.push({label: this.$t("asset.createAssetTab.assetType"), value: obj.model.type.value}); - detail.push({label: this.$t("asset.createAssetTab.purchaseDate"), value: obj.purchaseDate}); - detail.push({label: this.$t("asset.createAssetTab.dcName"), value: obj.idc ? obj.idc.name : ""}); - detail.push({label: this.$t("asset.createAssetTab.location"), value: obj.idc ? obj.idc.location : ""}); - detail.push({label: this.$t("asset.createAssetTab.principal"), value: obj.idc ? this.getPrincipalName(obj.idc.principal) : ""}); - detail.push({label: this.$t("asset.createAssetTab.location"), value: obj.idc ? obj.idc.location : ""}); - detail.push({label: this.$t("asset.createAssetTab.tel"), value: obj.idc ? obj.idc.tel : ""}); - detail.push({label: this.$t("asset.createAssetTab.cabinet"), value: obj.cabinet ? obj.cabinet.name : ""}); + detail.push({label: this.$t("asset.assetType"), value: obj.model.type.value}); + detail.push({label: this.$t("asset.vendorModel"), value: obj.model.vendor.value + " " + obj.model.name}); + detail.push({label: this.$t("asset.assetType"), value: obj.model.type.value}); + detail.push({label: this.$t("asset.purchaseDate"), value: obj.purchaseDate}); + detail.push({label: this.$t("asset.dcName"), value: obj.idc ? obj.idc.name : ""}); + detail.push({label: this.$t("asset.location"), value: obj.idc ? obj.idc.location : ""}); + detail.push({label: this.$t("asset.principal"), value: obj.idc ? this.getPrincipalName(obj.idc.principal) : ""}); + detail.push({label: this.$t("asset.location"), value: obj.idc ? obj.idc.location : ""}); + detail.push({label: this.$t("asset.tel"), value: obj.idc ? obj.idc.tel : ""}); + detail.push({label: this.$t("asset.cabinet"), value: obj.cabinet ? obj.cabinet.name : ""}); detail.push({label: this.$t("asset.editAssetTab.uSize"), value: obj.cabinet ? obj.cabinet.uSize : ""}); detail.push({label: this.$t("asset.editAssetTab.remark"), value: obj.idc ? obj.idc.remark : ""}); if (obj.accounts.length > 0) { let account = obj.accounts[0]; if (account.protocol == 'SSH') { - detail.push({label: this.$t("asset.createAssetTab.protocol"), value: 'SSH'}); - detail.push({label: this.$t("asset.createAssetTab.account"), value: account.user}); + detail.push({label: this.$t("asset.protocol"), value: 'SSH'}); + detail.push({label: this.$t("asset.account"), value: account.user}); let loginType = ""; if (account.authType == 1) { - loginType = this.$t('asset.createAssetTab.password'); + loginType = this.$t('asset.password'); } else if (account.authType == 2) { - loginType = this.$t('asset.createAssetTab.ssh'); + loginType = this.$t('asset.ssh'); } - detail.push({label: this.$t("asset.createAssetTab.loginType"), value: loginType}); + detail.push({label: this.$t("asset.loginType"), value: loginType}); } else if (account.protocol == 'TELNET') { - detail.push({label: this.$t("asset.createAssetTab.protocol"), value: 'TELNET'}); - detail.push({label: this.$t("asset.createAssetTab.account"), value: account.user}); + detail.push({label: this.$t("asset.protocol"), value: 'TELNET'}); + detail.push({label: this.$t("asset.account"), value: account.user}); } - detail.push({label: this.$t("asset.createAssetTab.port"), value: account.port}); + detail.push({label: this.$t("asset.port"), value: account.port}); }*/ return detail; }, @@ -842,17 +853,17 @@ if (el._ps_) { el.addEventListener("ps-scroll-y", () => { if (el._ps_.scrollbarYTop > 50) { - this.showTopBtn = true; + this.tools.showTopBtn = true; } else { - this.showTopBtn = false; + this.tools.showTopBtn = false; } }); el.addEventListener("mouseenter", () => { - this.tableHover = true; + this.tools.tableHover = true; }); el.addEventListener("mouseleave", () => { - this.tableHover = false; + this.tools.tableHover = false; }); } }); @@ -862,10 +873,10 @@ _this.$refs.leftScrollbar.update(); } - this.tablelable = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) + 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.dropCol = localStorage.getItem("nz-tableTitle-" + localStorage.getItem("nz-username") + "-" + this.$route.path) + 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; @@ -925,16 +936,17 @@ // this.getModuleList(this.currentProject.id); this.getAllModuleList(); }, - showSubList(n) { + "bottomBox.showSubList": function(n) { + let vm = this; this.$bottomBoxWindow.showSubListWatch(vm, n); }, - curEndpoint: { + currentEndpoint: { deep: true, handler(n) { - this.endpointDetail = this.convertToDetail(n); + this.bottomBox.endpointDetail = this.convertToDetail(n); this.$get('asset', {id: n.assetId}).then(response => { if (response.code === 200) { - this.assetDetail = this.assetConvertToDetail(response.data.list[0]); + this.bottomBox.assetDetail = this.assetConvertToDetail(response.data.list[0]); } }); } diff --git a/nezha-fronted/src/main.js b/nezha-fronted/src/main.js index ecc4aa3cf..aecbcc412 100644 --- a/nezha-fronted/src/main.js +++ b/nezha-fronted/src/main.js @@ -32,8 +32,6 @@ import projectBox from './components/common/rightBox/projectBox'; //project弹 import moduleBox from './components/common/rightBox/moduleBox'; //module弹框组件 import editEndpointBox from './components/common/rightBox/editEndpointBox'; //endpoint弹框组件 import addEndpointBox from './components/common/rightBox/addEndpointBox'; //endpoint弹框组件 -import assetAddUnit from "./components/page/asset/assetAddUnit"; //资产添加组件 -import assetEditUnit from "./components/page/asset/assetEditUnit"; //资产添加组件 import assetBox from "./components/common/rightBox/assetBox"; //资产添加组件 import alertConfigBox from "./components/common/rightBox/alertConfigBox"; //告警规则弹框组件 import dcConfigBox from "./components/common/popBox/dcConfig"; //idc配置弹框组件 @@ -56,8 +54,6 @@ Vue.component("module-box", moduleBox); Vue.component("edit-endpoint-box", editEndpointBox); Vue.component("add-endpoint-box", addEndpointBox); Vue.component("asset-box", assetBox); -Vue.component("assetAddUnit", assetAddUnit); -Vue.component("assetEditUnit", assetEditUnit); Vue.component("alert-config-box", alertConfigBox); Vue.component("idc-config-box", dcConfigBox); Vue.component("panel-box", panelBox);