@@ -385,9 +385,11 @@ import linkTab from './system/linkTab'
import apiKeyTab from './system/apiKeyTab'
import moment from 'moment-timezone'
import License from './system/license'
+import routerPathParams from '@/components/common/mixin/routerPathParams'
export default {
name: 'system',
components: { draggable, latlngPicker, notifyMethod, linkTab, apiKeyTab, License },
+ mixins: [routerPathParams],
data () {
return {
imageFormatErr: false,
@@ -612,6 +614,10 @@ export default {
console.error('type is required')
return
}
+ if (type !== 'link' && type !== 'notification' && type !== 'apiKey') {
+ const t = +new Date()
+ this.updatePath({ t })
+ }
if (type == 'reset' || type == 'link' || type == 'notification' || type == 'apiKey' || type == 'license') {
return
}
@@ -1041,6 +1047,9 @@ export default {
mounted () {
this.querySetInfo(this.activeTab)
this.queryTimezone()
+ },
+ created () {
+ this.activeTab = this.$route.query.activeTab || 'basic'
}
}
diff --git a/nezha-fronted/src/components/page/config/system/apiKeyTab.vue b/nezha-fronted/src/components/page/config/system/apiKeyTab.vue
index 5342ea164..32bc9eacc 100644
--- a/nezha-fronted/src/components/page/config/system/apiKeyTab.vue
+++ b/nezha-fronted/src/components/page/config/system/apiKeyTab.vue
@@ -48,6 +48,9 @@ export default {
name: 'apiKeyTab',
components: { nzDataList, apiKeyTable },
mixins: [dataListMixin, parentTableCommon],
+ props: {
+ activeTab: String
+ },
data () {
return {
url: '/sys/apiKey',
diff --git a/nezha-fronted/src/components/page/config/system/linkTab.vue b/nezha-fronted/src/components/page/config/system/linkTab.vue
index fea352578..2d68d85f5 100644
--- a/nezha-fronted/src/components/page/config/system/linkTab.vue
+++ b/nezha-fronted/src/components/page/config/system/linkTab.vue
@@ -48,6 +48,9 @@ export default {
name: 'linkTab',
components: { nzDataList, linkTable },
mixins: [dataListMixin, parentTableCommon],
+ props: {
+ activeTab: String
+ },
data () {
return {
url: '/link',
diff --git a/nezha-fronted/src/components/page/config/system/notifyMethodTab.vue b/nezha-fronted/src/components/page/config/system/notifyMethodTab.vue
index 05382ef3c..014b8bcea 100644
--- a/nezha-fronted/src/components/page/config/system/notifyMethodTab.vue
+++ b/nezha-fronted/src/components/page/config/system/notifyMethodTab.vue
@@ -85,6 +85,9 @@ export default {
name: 'notifyMethodTab',
components: { nzDataList, notifyMethodTable },
mixins: [dataListMixin, parentTableCommon],
+ props: {
+ activeTab: String
+ },
data () {
return {
url: 'alert/notify/method',
diff --git a/nezha-fronted/src/components/page/config/system/systemCommon.js b/nezha-fronted/src/components/page/config/system/systemCommon.js
index 26e5c5585..c7161caf1 100644
--- a/nezha-fronted/src/components/page/config/system/systemCommon.js
+++ b/nezha-fronted/src/components/page/config/system/systemCommon.js
@@ -1,4 +1,5 @@
import { file } from '@topology/core/src/middles/nodes/file'
+import routerPathParams from '@/components/common/mixin/routerPathParams'
export const tableCommon = {
data () {
@@ -93,10 +94,25 @@ export const tableCommon = {
}
}
export const parentTableCommon = {
+ mixins: [routerPathParams],
+ props: {
+ activeTab: {
+ type: String,
+ default: ''
+ }
+ },
methods: {
getTableData: function () {
this.searchLabel.pageSize = -1
this.tools.loading = true
+ const systemParam = {
+ ...this.searchLabel
+ }
+ if (this.activeTab) {
+ systemParam.activeTab = this.activeTab
+ }
+ const path = this.$route.fullPath.match(/\/(\S*)\?/)[1]
+ this.updatePath(systemParam, path)
this.$get(this.url, this.searchLabel).then(response => {
this.tools.loading = false
if (response.code === 200) {
@@ -111,5 +127,128 @@ export const parentTableCommon = {
}
})
}
+ },
+ created () {
+ const path = this.$route.fullPath.match(/\/(\S*)\?/)[1]
+ let searchKeys = {}
+ if (path === 'system' && this.$route.query.activeTab == 'link') {
+ 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'
+ }
+ }
+ } else if (path === 'system' && this.$route.query.activeTab == 'apiKey') {
+ 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'
+ }
+ }
+ } else if (path === 'system' && this.$route.query.activeTab == 'notification') {
+ 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/config/template/chartTemp.vue b/nezha-fronted/src/components/page/config/template/chartTemp.vue
index 0ddfdf2f1..a927a4636 100644
--- a/nezha-fronted/src/components/page/config/template/chartTemp.vue
+++ b/nezha-fronted/src/components/page/config/template/chartTemp.vue
@@ -95,7 +95,6 @@
diff --git a/nezha-fronted/src/components/page/config/template/index.vue b/nezha-fronted/src/components/page/config/template/index.vue
index 2e170b653..af282fdb3 100644
--- a/nezha-fronted/src/components/page/config/template/index.vue
+++ b/nezha-fronted/src/components/page/config/template/index.vue
@@ -8,15 +8,17 @@