diff --git a/nezha-fronted/src/components/common/mixin/dataList.js b/nezha-fronted/src/components/common/mixin/dataList.js index 0d944a17a..17e305a87 100644 --- a/nezha-fronted/src/components/common/mixin/dataList.js +++ b/nezha-fronted/src/components/common/mixin/dataList.js @@ -5,7 +5,7 @@ import routerPathParams from '@/components/common/mixin/routerPathParams' export default { mixins: [routerPathParams], props: { - showTab: { + switchTab: { type: String, default: '' } @@ -87,17 +87,15 @@ export default { this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.tools.loading = true - if (this.$route.fullPath.match(/\/(\S*)\?/)[1] !== 'snmp') { - const dataListParam = { - ...this.searchLabel, - ...this.searchCheckBox - } - if (this.showTab) { - dataListParam.showTab = this.showTab - } - const path = this.$route.fullPath.match(/\/(\S*)\?/)[1] - this.updatePath(dataListParam, path) + const dataListParam = { + ...this.searchLabel, + ...this.searchCheckBox } + if (this.switchTab) { + dataListParam.switchTab = this.switchTab + } + 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) { @@ -669,7 +667,7 @@ export default { jsonKey: 'val' } } - } else if (path === 'template' && this.$route.query.showTab) { + } else if (path === 'template' && this.switchTab) { searchKeys = { // key: path 键 // value: vue set 参数 @@ -717,6 +715,90 @@ export default { jsonKey: 'val' } } + } else if (path === 'snmp' && this.switchTab == 'credentials') { + 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, + 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' + }, + type: { + target: this.searchLabel, + propertyName: 'type', + type: 'string', + defaultJson: { + disabled: false, + label: 'credentialType', + name: 'Type', + readonly: true, + type: 'select', + val: '' + }, + jsonKey: 'val' + } + } + } else if (path === 'snmp' && this.switchTab == 'file') { + 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, + 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' + } + } } this.initQueryFromPath(searchKeys) }, diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue index 175027ec5..2b306136d 100644 --- a/nezha-fronted/src/components/page/alert/alertRule.vue +++ b/nezha-fronted/src/components/page/alert/alertRule.vue @@ -374,7 +374,7 @@ export default { valString: '', listStr: 'severitySelect' }, - jsonKey: 'valnum', + jsonKey: 'valnum' }, type: { target: this.searchLabel, @@ -392,7 +392,7 @@ export default { valnum: '', valString: '' }, - jsonKey: 'valnum', + jsonKey: 'valnum' }, name: { target: this.searchLabel, diff --git a/nezha-fronted/src/components/page/config/credentials.vue b/nezha-fronted/src/components/page/config/credentials.vue index 2e85579c1..333c03d10 100644 --- a/nezha-fronted/src/components/page/config/credentials.vue +++ b/nezha-fronted/src/components/page/config/credentials.vue @@ -1,7 +1,7 @@