diff --git a/nezha-fronted/src/assets/css/components/common/globalSearch/globalSearch.scss b/nezha-fronted/src/assets/css/components/common/globalSearch/globalSearch.scss index 90d508e37..acf2cc085 100644 --- a/nezha-fronted/src/assets/css/components/common/globalSearch/globalSearch.scss +++ b/nezha-fronted/src/assets/css/components/common/globalSearch/globalSearch.scss @@ -96,6 +96,7 @@ } .list-item{ height: 64px; + position: relative; display: flex; align-items: center; flex-direction: column; @@ -115,6 +116,18 @@ vertical-align: middle } } + .is-jump{ + position: absolute; + right: 20px; + top: 20px; + padding: 0; + width: 24px; + height: 24px; + display: none; + .el-loading-mask{ + transform: scale(0.5); + } + } .list-item-content{ overflow: hidden; white-space: nowrap; @@ -137,6 +150,9 @@ } .lise-item-active { background: $--table-row-hover-background-color; + .is-jump{ + display: inline-block; + } } } .global-search-footer { diff --git a/nezha-fronted/src/assets/css/components/common/globalSearch/searchItemInfo.scss b/nezha-fronted/src/assets/css/components/common/globalSearch/searchItemInfo.scss index 63ff0c80f..8c771b6b4 100644 --- a/nezha-fronted/src/assets/css/components/common/globalSearch/searchItemInfo.scss +++ b/nezha-fronted/src/assets/css/components/common/globalSearch/searchItemInfo.scss @@ -43,7 +43,7 @@ display: flex; height: 47px; .search-item-key{ - width: 100px; + width: 120px; font-size: 14px; line-height: 47px; color:$--color-text-regular; @@ -52,12 +52,15 @@ } .search-item-value-box{ line-height: 47px; - width: calc(100% - 100px); + width: calc(100% - 120px); display: flex; .nz-icon{ line-height: 47px; margin-right: 10px; } + .nz-icon-guzhangshuju{ + color: $--color-primary; + } .search-item-value{ width: calc(100% - 30px); font-size: 14px; diff --git a/nezha-fronted/src/components/chart/chart/grid/GridLayout.vue b/nezha-fronted/src/components/chart/chart/grid/GridLayout.vue index ef2f1be52..f6c23bf34 100644 --- a/nezha-fronted/src/components/chart/chart/grid/GridLayout.vue +++ b/nezha-fronted/src/components/chart/chart/grid/GridLayout.vue @@ -260,11 +260,8 @@ export default { layoutUpdate () { if (this.layout !== undefined && this.originalLayout !== null) { if (this.layout.length !== this.originalLayout.length) { - // console.log("### LAYOUT UPDATE!", this.layout.length, this.originalLayout.length); - const diff = this.findDifference(this.layout, this.originalLayout) if (diff.length > 0) { - // console.log(diff); if (this.layout.length > this.originalLayout.length) { this.originalLayout = this.originalLayout.concat(diff) } else { diff --git a/nezha-fronted/src/components/chart/chartList.vue b/nezha-fronted/src/components/chart/chartList.vue index bc8a8d584..ad23a09eb 100644 --- a/nezha-fronted/src/components/chart/chartList.vue +++ b/nezha-fronted/src/components/chart/chartList.vue @@ -219,7 +219,6 @@ export default { }, changeGroupHeight (copyList, group, flag) { const height = getGroupHeight(copyList) - // console.log(this.$refs.layout) const groupFind = this.copyDataList.find(item => item.id == group.id) if (group && groupFind) { groupFind.height = groupFind.h = height + this.headerHPadding @@ -279,7 +278,6 @@ export default { panelId: this.panelId, charts: charts } - // console.log(this.copyDataList) this.$put('/visual/panel/chart/weights', params).then(() => { const position = getLayoutPosition(this.copyDataList) this.$store.commit('setChartLastPosition', position) diff --git a/nezha-fronted/src/components/common/ChartDiagram/diagram.vue b/nezha-fronted/src/components/common/ChartDiagram/diagram.vue index c64fe12c5..196a5da18 100644 --- a/nezha-fronted/src/components/common/ChartDiagram/diagram.vue +++ b/nezha-fronted/src/components/common/ChartDiagram/diagram.vue @@ -1748,7 +1748,6 @@ export default { imgArr.push({ ...item }) }) Promise.all(promiseArr).then((res2, header) => { - // console.log(res2) this.iconArray = [...res.data.list] this.iconArray.forEach((item, index) => { item.image = res2[index].data diff --git a/nezha-fronted/src/components/common/globalSearch/globalSearch.vue b/nezha-fronted/src/components/common/globalSearch/globalSearch.vue index 9e4a515b4..a352a92fc 100644 --- a/nezha-fronted/src/components/common/globalSearch/globalSearch.vue +++ b/nezha-fronted/src/components/common/globalSearch/globalSearch.vue @@ -57,6 +57,9 @@
{{ item.sub }}
+
+ +
  • @@ -133,6 +136,7 @@ export default { searchStr: '', loading: false, nextLoading: false, + jumpLoading: false, selectIndex: '', tableData: [], isNoData: false, @@ -192,6 +196,7 @@ export default { this.firstShow = true this.selectIndex = 0 this.pageObj.pageNo = 1 + this.jumpLoading = false this.tableData = [] this.$store.commit('setGlobalShow', false) this.scope.forEach((item) => { @@ -200,7 +205,6 @@ export default { this.unbindEvent() }, selectIcon (item) { - // console.log(item) switch (item.type) { case 'asset' : return 'nz-icon-overview-project' case 'datacenter' : return 'nz-icon-model' @@ -228,7 +232,6 @@ export default { const offsetTop = liBox.offsetTop - ulBox.offsetTop const scrollTop = ulBox.scrollTop // liBox.focus() - // console.log(height, liHeight, offsetTop, scrollTop) if (offsetTop - scrollTop < 0) { ulBox.scrollTop = offsetTop } else if (offsetTop - scrollTop >= height - liHeight) { @@ -236,6 +239,9 @@ export default { } }, changeSelectIndex (index) { + if (this.jumpLoading) { + return + } if (this.isKeyDown) { this.getItemInfo() return @@ -244,7 +250,9 @@ export default { this.getItemInfo() }, keyDown (e) { - // console.log(e, e.target, e.keyCode) + if (this.jumpLoading) { + return + } if (e.keyCode === 13) { this.jumpTo() } @@ -281,12 +289,61 @@ export default { }, 300) }, jumpTo () { - + this.jumpLoading = true + const routerPath = this.getRouterPath() + const params = { + table: this.tableData[this.selectIndex].type, + id: this.tableData[this.selectIndex].id, + pageSize: routerPath.pageSize + } + this.$get('/stat/rownum', params).then(res => { + if (res.code === 200) { + this.close() + this.$router.push({ + path: routerPath.route, + query: { + pageNo: res.data.pageNo, + pageSize: res.data.pageSize, + rownum: res.data.rownum + } + }) + } else { + this.$message.error(res.msg) + this.jumpLoading = false + } + }) + }, + getRouterPath () { + const type = this.tableData[this.selectIndex].type + let tableId = '' + let route = '/' + if (type === 'datacenter') { + tableId = 'dcTable' + route += 'dc' + } else if (type === 'alertRule') { + tableId = 'alertRuleTable' + route += 'alertRule' + } else if (type === 'asset') { + tableId = type + 'Table' + route += 'asset' + } else { + tableId = type + 'Table' + route += 'monitor/' + type + } + let pageSize = localStorage.getItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + tableId) + if (!(pageSize && pageSize !== 'undefined')) { + pageSize = 20 + } + return { + pageSize, + route + } }, getItemInfo () { this.obj = {} }, searchAll () { + // this.getSeverityData() if (this.searchTimer) { clearInterval(this.searchTimer) this.searchTimer = null @@ -371,6 +428,9 @@ export default { }) } }, + mounted () { + this.getSeverityData() + }, destroyed () { window.removeEventListener('keydown', this.keyDown) } diff --git a/nezha-fronted/src/components/common/globalSearch/searchItemInfo.vue b/nezha-fronted/src/components/common/globalSearch/searchItemInfo.vue index f1698f2d6..3799efb21 100644 --- a/nezha-fronted/src/components/common/globalSearch/searchItemInfo.vue +++ b/nezha-fronted/src/components/common/globalSearch/searchItemInfo.vue @@ -59,7 +59,7 @@ {{ $t('overall.disabled') }}
    - + {{getPathContent(item.key)}} @@ -72,6 +72,7 @@