diff --git a/nezha-fronted/src/assets/css/components/page/config/system.scss b/nezha-fronted/src/assets/css/components/page/config/system.scss index c3414e6c2..0eb90356e 100644 --- a/nezha-fronted/src/assets/css/components/page/config/system.scss +++ b/nezha-fronted/src/assets/css/components/page/config/system.scss @@ -322,7 +322,6 @@ border: 1px solid $--border-color-light; border-radius: 2px; width: 700px; - height: 370px; margin: 10px; } .license-left { @@ -412,7 +411,6 @@ } .license-left-body { margin-left: 40px; - min-height: 280px; .license-left-boyd-title { font-family: Roboto-Medium; font-size: 14px; @@ -429,7 +427,7 @@ letter-spacing: 0; line-height: 22px; font-weight: 400; - margin: 15px 0 25px 10px; + margin: 15px; } } .license-left-footer { diff --git a/nezha-fronted/src/components/common/mixin/dataList.js b/nezha-fronted/src/components/common/mixin/dataList.js index c47ef6142..bc758dcdb 100644 --- a/nezha-fronted/src/components/common/mixin/dataList.js +++ b/nezha-fronted/src/components/common/mixin/dataList.js @@ -81,12 +81,14 @@ export default { this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.tools.loading = true - const dataListParam = { - ...this.searchLabel, - ...this.searchCheckBox + if (this.$route.fullPath.match(/\/(\S*)\?/)[1] !== 'snmp' || this.$route.fullPath.match(/\/(\S*)\?/)[1] !== 'template') { + const dataListParam = { + ...this.searchLabel, + ...this.searchCheckBox + } + const path = this.$route.fullPath.match(/\/(\S*)\?/)[1] + this.updatePath(dataListParam, path) } - const path = this.$route.fullPath.match(/\/(\S*)\?/)[1] - this.updatePath(dataListParam, path) this.$get(this.url, { ...this.searchLabel, ...this.searchCheckBox }).then(response => { this.tools.loading = false if (response.code === 200) { @@ -376,55 +378,6 @@ export default { jsonKey: 'val' } } - } else if (path === 'template') { - searchKeys = { - // key: path 键 - // value: vue set 参数 - pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, - pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, - orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, - ids: { - target: this.searchLabel, - propertyName: 'ids', - type: 'string', - defaultJson: { - disabled: false, - id: 'ids', - label: 'ids', - name: 'ID', - type: 'input', - val: '' - }, - jsonKey: 'val' - }, - name: { - target: this.searchLabel, - propertyName: 'name', - type: 'string', - defaultJson: { - disabled: false, - id: 'name', - label: 'name', - name: 'Name', - type: 'input', - val: '' - }, - jsonKey: 'val' - }, - gname: { - target: this.searchLabel, - propertyName: 'gname', - type: 'string', - defaultJson: { - disabled: false, - label: 'gname', - name: 'Group', - type: 'input', - val: '' - }, - jsonKey: 'val' - } - } } else if (path === 'i18n') { searchKeys = { // key: path 键 @@ -536,7 +489,7 @@ export default { jsonKey: 'val' } } - } else if (path === 'operationLog' || path === 'profile') { + } else if (path === 'operationLog') { searchKeys = { // key: path 键 // value: vue set 参数 diff --git a/nezha-fronted/src/components/common/mixin/routerPathParams.js b/nezha-fronted/src/components/common/mixin/routerPathParams.js index 980c2b271..475ec78ae 100644 --- a/nezha-fronted/src/components/common/mixin/routerPathParams.js +++ b/nezha-fronted/src/components/common/mixin/routerPathParams.js @@ -12,14 +12,19 @@ export default { setTimeout(() => { this.setSearchInput(val, qv) }, 200) - console.log() qv && this.$set(val.target, val.propertyName, qv) }) }, // 更新path,包含请求参数 updatePath (param, path) { console.log(param) - this.$router.replace({ path: path, query: param }).catch(err => {}) + const params = lodash.cloneDeep(param) + Object.keys(params).forEach(key => { + if (!params[key]) { + delete params[key] + } + }) + this.$router.replace({ path: path, query: params }).catch(err => {}) }, setSearchInput (val, qv) { let dataList = '' @@ -35,7 +40,6 @@ export default { console.log(obj[val.jsonKey]) if (val.strKey) { this.$refs[dataList].$refs.searchInput[val.listStr].map((e) => { - console.log(e) obj[val.strKey] = e.name }) } diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue index 52c9de29d..8470840c5 100644 --- a/nezha-fronted/src/components/page/alert/alertRule.vue +++ b/nezha-fronted/src/components/page/alert/alertRule.vue @@ -401,7 +401,6 @@ export default { target: this.searchLabel, propertyName: 'name', type: 'string', - defaultJson: { disabled: false, id: 2, @@ -413,9 +412,6 @@ export default { jsonKey: 'val' } } - Object.keys(this.$route.query).forEach(key => { - this.$set(searchKeys[key].target, key, this.$route.query[key]) - }) this.initQueryFromPath(searchKeys) }, mounted () { diff --git a/nezha-fronted/src/components/page/alert/alertSilence.vue b/nezha-fronted/src/components/page/alert/alertSilence.vue index af034cdd0..4a026b476 100644 --- a/nezha-fronted/src/components/page/alert/alertSilence.vue +++ b/nezha-fronted/src/components/page/alert/alertSilence.vue @@ -163,12 +163,12 @@ export default { this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.tools.loading = true - const assetParam = { + const alertRuleParam = { ...this.searchLabel, ...this.searchCheckBox } const path = this.fromRoute.alertSilence - this.updatePath(assetParam, path) + this.updatePath(alertRuleParam, path) this.$get(this.url, { ...this.searchLabel, ...this.searchCheckBox }).then(response => { this.tools.loading = false this.nowTime = this.utcTimeToTimezoneStr(response.time) diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 62c81731b..4b25ab4d0 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -839,7 +839,12 @@ export default { val: '' }, jsonKey: 'val' - } + }, + dcIds: { target: this.searchCheckBox, propertyName: 'dcIds', type: 'string' }, + fields: { target: this.searchCheckBox, propertyName: 'fields', type: 'json' }, + ping: { target: this.searchCheckBox, propertyName: 'ping', type: 'string' }, + modelIds: { target: this.searchCheckBox, propertyName: 'modelIds', type: 'string' }, + typeIds: { target: this.searchCheckBox, propertyName: 'typeIds', type: 'string' } } this.initQueryFromPath(searchKeys) }, diff --git a/nezha-fronted/src/components/page/config/system/license.vue b/nezha-fronted/src/components/page/config/system/license.vue index 2f2bec608..c1e4883e2 100644 --- a/nezha-fronted/src/components/page/config/system/license.vue +++ b/nezha-fronted/src/components/page/config/system/license.vue @@ -15,8 +15,16 @@
-
{{$t('license.id')}}
-
{{ licenseList.id ? licenseList.id : '-'}}
+
{{$t('license.type')}}
+
{{ licenseMark.type ? licenseMark.type : '-'}}
+
+
+
{{$t('license.organization')}}
+
{{ licenseMark.organization ? licenseMark.organization : '-'}}
+
+
+
{{$t('license.id')}}
+
{{ licenseMark.supportID ? licenseMark.supportID : '-'}}
{{$t('license.proDate')}}
@@ -27,11 +35,10 @@
{{$t('license.expDate')}}
-
+
{{formatDate(expData.license.exp_date)}} {{$t('license.permanent')}} - - + {{formatDate(this.stateItem)}} ~ {{ formatDate(this.endItem)}} -
@@ -93,6 +100,7 @@ export default { data () { return { licenseList: {}, + licenseMark: {}, tableData: [], tableTitle: [ { @@ -108,17 +116,22 @@ export default { uploadFileList: [], uploadFile: { file: '' }, active: 0, - loading: true + loading: true, + stateItem: '', + endItem: '' } }, methods: { licenseGetData () { this.$get('/sys/license/detail').then(res => { if (res.code === 200) { + this.licenseMark = res.data.license this.licenseList = res.data.license.hasp this.licenseList.feature.map(e => { if (e.id === '20001') { this.expData = e + this.stateItem = e.time_start + this.endItem = e.end_time * 1 + e.time_start * 1 // this.expData.license.end_time = this.expData.license.time_start * 1 + this.expData.license.total_time * 1 } }) diff --git a/nezha-fronted/src/components/page/config/terminalLog.vue b/nezha-fronted/src/components/page/config/terminalLog.vue index ed4fcc550..d08a25516 100644 --- a/nezha-fronted/src/components/page/config/terminalLog.vue +++ b/nezha-fronted/src/components/page/config/terminalLog.vue @@ -302,7 +302,6 @@ export default { name: 'Protocol', readonly: true, type: 'selectString', - val: '' }, jsonKey: 'val' diff --git a/nezha-fronted/src/components/page/dashboard/panel.vue b/nezha-fronted/src/components/page/dashboard/panel.vue index cb0385c0b..eb536cc22 100644 --- a/nezha-fronted/src/components/page/dashboard/panel.vue +++ b/nezha-fronted/src/components/page/dashboard/panel.vue @@ -158,10 +158,12 @@ import topToolMoreOptions from '@/components/common/popBox/topToolMoreOptions' import { fromRoute } from '@/components/common/js/constants' import { randomcolor } from '@/components/common/js/radomcolor/randomcolor' import { lineChartMove } from '@/components/common/js/common' +import routerPathParams from '@/components/common/mixin/routerPathParams' // import chartData from './testData' export default { name: 'panel', + mixins: [routerPathParams], data () { return { fromRoute, @@ -312,8 +314,14 @@ export default { this.showPanel = val this.showPanel.type = 'dashboard' this.filter.panelId = this.showPanel.id + this.panelId = this.showPanel.id + const param = { + panelId: this.panelId + } // this.dateChange() // this.getTableData() + const path = this.fromRoute.panel + this.updatePath(param, path) this.getData(this.filter) this.$refs.chartList.cleanData() }, @@ -600,7 +608,6 @@ export default { getTableData (clearShowPanel) { const vm = this - this.$get('visual/panel?type=dashboard&pageSize=-1').then(response => { if (response.code === 200) { this.panelData = response.data.list @@ -785,6 +792,16 @@ export default { } }, created () { + const searchKeys = { + // key: path 键 + // value: vue set 参数 + panelId: { target: this, propertyName: 'panelId', type: 'number' } + } + setTimeout(() => { + this.showPanel.id = this.panelId + this.filter.panelId = this.panelId + }) + this.initQueryFromPath(searchKeys) this.getTableData() this.$store.dispatch('dispatchPanelTime', { time: this.searchTime,