feat: 增加 snmp => credential , mib file

This commit is contained in:
@changcode
2021-12-23 20:24:18 +08:00
parent df7cdd72f4
commit e5f8c42dff
13 changed files with 157 additions and 60 deletions

View File

@@ -5,7 +5,7 @@ import routerPathParams from '@/components/common/mixin/routerPathParams'
export default { export default {
mixins: [routerPathParams], mixins: [routerPathParams],
props: { props: {
showTab: { switchTab: {
type: String, type: String,
default: '' default: ''
} }
@@ -87,17 +87,15 @@ export default {
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.tools.loading = true this.tools.loading = true
if (this.$route.fullPath.match(/\/(\S*)\?/)[1] !== 'snmp') { const dataListParam = {
const dataListParam = { ...this.searchLabel,
...this.searchLabel, ...this.searchCheckBox
...this.searchCheckBox
}
if (this.showTab) {
dataListParam.showTab = this.showTab
}
const path = this.$route.fullPath.match(/\/(\S*)\?/)[1]
this.updatePath(dataListParam, path)
} }
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.$get(this.url, { ...this.searchLabel, ...this.searchCheckBox }).then(response => {
this.tools.loading = false this.tools.loading = false
if (response.code === 200) { if (response.code === 200) {
@@ -669,7 +667,7 @@ export default {
jsonKey: 'val' jsonKey: 'val'
} }
} }
} else if (path === 'template' && this.$route.query.showTab) { } else if (path === 'template' && this.switchTab) {
searchKeys = { searchKeys = {
// key: path 键 // key: path 键
// value: vue set 参数 // value: vue set 参数
@@ -717,6 +715,90 @@ export default {
jsonKey: 'val' 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) this.initQueryFromPath(searchKeys)
}, },

View File

@@ -374,7 +374,7 @@ export default {
valString: '', valString: '',
listStr: 'severitySelect' listStr: 'severitySelect'
}, },
jsonKey: 'valnum', jsonKey: 'valnum'
}, },
type: { type: {
target: this.searchLabel, target: this.searchLabel,
@@ -392,7 +392,7 @@ export default {
valnum: '', valnum: '',
valString: '' valString: ''
}, },
jsonKey: 'valnum', jsonKey: 'valnum'
}, },
name: { name: {
target: this.searchLabel, target: this.searchLabel,

View File

@@ -1,7 +1,7 @@
<template> <template>
<div style="height: 100%"> <div style="height: 100%">
<nz-data-list <nz-data-list
v-show="showTab === 'credentials'" v-show="switchTab === 'credentials'"
ref="dataList" ref="dataList"
:api="url" :api="url"
:custom-table-title.sync="tools.customTableTitle" :custom-table-title.sync="tools.customTableTitle"
@@ -11,13 +11,13 @@
@search="search" @search="search"
> >
<template v-slot:top-tool-left> <template v-slot:top-tool-left>
<div id="module-type-7" class="nz-tab-item-box" @click="toBrowserTab"><!--v-has="'snmp_browser_view'"--> <div id="module-type-7" class="nz-tab-item-box" @click="clickTab(['mib','browser'],'browser')"><!--v-has="'snmp_browser_view'"-->
<div class="nz-tab-item">{{$t("config.mib.mibBrowser")}}</div> <div class="nz-tab-item">{{$t("config.mib.mibBrowser")}}</div>
</div> </div>
<div id="module-type-8" class="nz-tab-item-box" > <div id="module-type-8" class="nz-tab-item-box">
<div class="nz-tab-item nz-tab-item-active">{{$t("config.mib.credentials")}}</div> <div class="nz-tab-item nz-tab-item-active">{{$t("config.mib.credentials")}}</div>
</div> </div>
<div id="module-type-6" class="nz-tab-item-box" @click="toFileTab"> <div id="module-type-6" class="nz-tab-item-box" @click="clickTab(['mib','file'],'file')">
<div class="nz-tab-item ">{{$t("config.mib.mibFiles")}}</div> <div class="nz-tab-item ">{{$t("config.mib.mibFiles")}}</div>
</div> </div>
</template> </template>
@@ -64,7 +64,7 @@ import snmpCredentialBox from '../../common/rightBox/snmpCredentialBox'
export default { export default {
name: 'credentials', name: 'credentials',
props: { props: {
showTab: String switchTab: String
}, },
components: { components: {
deleteButton, deleteButton,
@@ -115,6 +115,9 @@ export default {
toBrowserTab () { toBrowserTab () {
this.$emit('toBrowserTab') this.$emit('toBrowserTab')
}, },
toCredentialTab () {
this.$emit('toCredentialTab')
},
closeSnmpBox (refresh) { closeSnmpBox (refresh) {
this.rightBox.show = false this.rightBox.show = false
if (refresh) { if (refresh) {

View File

@@ -1,7 +1,7 @@
<template> <template>
<div style="height: 100%"> <div style="height: 100%">
<nz-data-list <nz-data-list
v-if="showTab === 'file'" v-if="switchTab === 'file'"
ref="dataList" ref="dataList"
:api="url" :api="url"
:custom-table-title.sync="tools.customTableTitle" :custom-table-title.sync="tools.customTableTitle"
@@ -70,7 +70,7 @@ export default {
}, },
mixins: [dataListMixin], mixins: [dataListMixin],
props: { props: {
showTab: String switchTab: String
}, },
data () { data () {
return { return {

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="mib-browser" style="height: 100%"> <div class="mib-browser" style="height: 100%">
<nz-data-list <nz-data-list
v-if="showTab === 'browser'" v-if="switchTab === 'browser'"
ref="dataList" ref="dataList"
> >
<template v-slot:top-tool-left> <template v-slot:top-tool-left>
@@ -171,7 +171,7 @@ import xlsx from 'xlsx'
export default { export default {
name: 'mibBrowser', name: 'mibBrowser',
props: { props: {
showTab: String switchTab: String
}, },
components: { components: {
nzDataList nzDataList

View File

@@ -1,8 +1,8 @@
<template> <template>
<div> <div>
<mib-file v-if="showTab === 'file'" :show-tab="showTab" @changeShowTab="changeShowTab" @toBrowserTab="changeTab(['mib','browser'],'browser')" @toCredentialTab="changeTab(['mib','credentials'],'credentials')"></mib-file> <mib-file v-if="switchTab === 'file'" :switch-tab="switchTab" @changeShowTab="changeShowTab" @toBrowserTab="changeTab(['mib','browser'],'browser')" @toCredentialTab="changeTab(['mib','credentials'],'credentials')"></mib-file>
<mib-browser v-if="showTab === 'browser'" :show-tab="showTab" @changeShowTab="changeShowTab" @toCredentialTab="changeTab(['mib','credentials'],'credentials')" @toFileTab="changeTab(['mib','file'],'file')"></mib-browser> <mib-browser v-if="switchTab === 'browser'" :switch-tab="switchTab" @changeShowTab="changeShowTab" @toCredentialTab="changeTab(['mib','credentials'],'credentials')" @toFileTab="changeTab(['mib','file'],'file')"></mib-browser>
<credentials v-if="showTab === 'credentials'" :show-tab="showTab" @changeShowTab="changeShowTab" @toBrowserTab="changeTab(['mib','browser'],'browser')" @toFileTab="changeTab(['mib','file'],'file')"></credentials> <credentials v-if="switchTab === 'credentials'" :switch-tab="switchTab" @changeShowTab="changeShowTab" @toBrowserTab="changeTab(['mib','browser'],'browser')" @toFileTab="changeTab(['mib','file'],'file')"></credentials>
</div> </div>
</template> </template>
@@ -10,6 +10,7 @@
import mibBrowser from './mibBrowser' import mibBrowser from './mibBrowser'
import credentials from './credentials' import credentials from './credentials'
import mibFile from './mib' import mibFile from './mib'
import routerPathParams from '@/components/common/mixin/routerPathParams'
export default { export default {
name: 'snmp', name: 'snmp',
components: { components: {
@@ -17,9 +18,10 @@ export default {
mibBrowser, mibBrowser,
mibFile mibFile
}, },
mixins: [routerPathParams],
data () { data () {
return { return {
showTab: 'browser' switchTab: 'browser'
} }
}, },
methods: { methods: {
@@ -33,7 +35,7 @@ export default {
} else { } else {
path = paths path = paths
} */ } */
this.showTab = tab // 此处需要组建中有showTab 属性 this.switchTab = tab // 此处需要组建中有showTab 属性
// this.toPath(path) // this.toPath(path)
}, },
toPath: function (path) { toPath: function (path) {
@@ -44,8 +46,14 @@ export default {
} }
}) })
}, },
changeShowTab (showTab) { changeShowTab (switchTab) {
this.showTab = showTab this.switchTab = switchTab
if (switchTab !== 'browser') {
this.updatePath({ switchTab })
} else {
const t = +new Date()
this.updatePath({ t })
}
} }
}, },
watch: { watch: {
@@ -53,10 +61,13 @@ export default {
immediate: true, immediate: true,
handler (n, o) { handler (n, o) {
if (n.indexOf('mib') != -1 && this.$route.params.tab) { if (n.indexOf('mib') != -1 && this.$route.params.tab) {
this.$set(this, 'showTab', this.$route.params.tab) this.$set(this, 'switchTab', this.$route.params.tab)
} }
} }
} }
},
created () {
this.switchTab = this.$route.query.switchTab || 'browser'
} }
} }
</script> </script>

View File

@@ -1,8 +1,8 @@
<template> <template>
<div class="system"> <div class="system">
<el-tabs v-model="activeTab" :class="{'full-table':activeTab == 'notification'||activeTab == 'link'||activeTab === 'apiKey'}" class="system-tabs" style="overflow: auto" type="border-card" @tab-click="selectTab"> <el-tabs v-model="switchTab" :class="{'full-table':switchTab == 'notification'||switchTab == 'link'||switchTab === 'apiKey'}" class="system-tabs" style="overflow: auto" type="border-card" @tab-click="selectTab">
<el-tab-pane :label="$t('config.system.basic.basic')" name="basic"> <el-tab-pane :label="$t('config.system.basic.basic')" name="basic">
<div class="system-config-form basicForm" v-if="activeTab === 'basic'"> <div class="system-config-form basicForm" v-if="switchTab === 'basic'">
<el-form :model="basic" label-width="180px" size="small" ref="basicForm" :rules="basicRules" :validate-on-rule-change="false"> <el-form :model="basic" label-width="180px" size="small" ref="basicForm" :rules="basicRules" :validate-on-rule-change="false">
<div class="system-title">{{$t('config.system.basic.title')}}</div> <div class="system-title">{{$t('config.system.basic.title')}}</div>
<el-form-item :label="$t('config.system.basic.language')" prop="language"> <el-form-item :label="$t('config.system.basic.language')" prop="language">
@@ -112,7 +112,7 @@
</div > </div >
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('config.system.monitor.monitor')" name="monitor"> <el-tab-pane :label="$t('config.system.monitor.monitor')" name="monitor">
<div class="system-config-form basicForm" v-if="activeTab === 'monitor'"> <div class="system-config-form basicForm" v-if="switchTab === 'monitor'">
<div class="system-title">{{$t('config.system.basic.title')}}</div> <div class="system-title">{{$t('config.system.basic.title')}}</div>
<el-form :model="monitor" label-width="180px" size="small" ref="monitorForm" :rules="monitorRules" :validate-on-rule-change="false"> <el-form :model="monitor" label-width="180px" size="small" ref="monitorForm" :rules="monitorRules" :validate-on-rule-change="false">
<el-form-item :label="$t('config.system.monitor.prometheusFederation')" prop="prometheus_federation_enabled"> <el-form-item :label="$t('config.system.monitor.prometheusFederation')" prop="prometheus_federation_enabled">
@@ -224,7 +224,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('config.system.email.email')" name="email" > <el-tab-pane :label="$t('config.system.email.email')" name="email" >
<div class="system-config-form" v-if="activeTab === 'email'"> <div class="system-config-form" v-if="switchTab === 'email'">
<div class="system-title">{{$t('config.system.basic.title')}}</div> <div class="system-title">{{$t('config.system.basic.title')}}</div>
<el-form :model="email" label-width="180px" size="small" ref="emailForm" :rules="email.email_enable=='on'?emailRules:{}" :validate-on-rule-change="false"> <el-form :model="email" label-width="180px" size="small" ref="emailForm" :rules="email.email_enable=='on'?emailRules:{}" :validate-on-rule-change="false">
<el-form-item :label="$t('config.system.email.enable')" prop="email_enable"> <el-form-item :label="$t('config.system.email.enable')" prop="email_enable">
@@ -272,7 +272,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('config.system.terminal.terminal')" name="terminal"> <el-tab-pane :label="$t('config.system.terminal.terminal')" name="terminal">
<div class="system-config-form terminal" v-if="activeTab === 'terminal'"> <div class="system-config-form terminal" v-if="switchTab === 'terminal'">
<div class="system-title">{{$t('config.system.basic.title')}}</div> <div class="system-title">{{$t('config.system.basic.title')}}</div>
<el-form :model="terminal" label-width="180px" size="small" ref="terminalForm" :rules="terminalRules"> <el-form :model="terminal" label-width="180px" size="small" ref="terminalForm" :rules="terminalRules">
<!-- <el-form-item :label="$t('config.system.terminal.timeout')" prop="terminal_timeout">--> <!-- <el-form-item :label="$t('config.system.terminal.timeout')" prop="terminal_timeout">-->
@@ -298,7 +298,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('config.system.ldap.ldap')" name="ldap"> <el-tab-pane :label="$t('config.system.ldap.ldap')" name="ldap">
<div class="system-config-form" v-if="activeTab === 'ldap'"> <div class="system-config-form" v-if="switchTab === 'ldap'">
<div class="system-title">{{$t('config.system.basic.title')}}</div> <div class="system-title">{{$t('config.system.basic.title')}}</div>
<el-form :model="ldap" label-width="180px" size="small" ref="ldapForm" :rules="ldap.ldap_enable == 'on'?ldapRules:{}" :validate-on-rule-change="false"> <el-form :model="ldap" label-width="180px" size="small" ref="ldapForm" :rules="ldap.ldap_enable == 'on'?ldapRules:{}" :validate-on-rule-change="false">
<el-form-item :label="$t('config.system.ldap.active')" prop="ldap_enable"> <el-form-item :label="$t('config.system.ldap.active')" prop="ldap_enable">
@@ -340,16 +340,16 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('config.system.notification.notification')" name="notification" style="height: 100%;"><!--$t('config.system.reset.reset')--> <el-tab-pane :label="$t('config.system.notification.notification')" name="notification" style="height: 100%;"><!--$t('config.system.reset.reset')-->
<notify-method v-if="activeTab === 'notification'" :active-tab="activeTab"></notify-method> <notify-method v-if="switchTab === 'notification'" :switch-tab="switchTab"></notify-method>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('config.system.link.link')" name="link" style="height: 100%;"><!--$t('config.system.reset.reset')--> <el-tab-pane :label="$t('config.system.link.link')" name="link" style="height: 100%;"><!--$t('config.system.reset.reset')-->
<link-tab v-if="activeTab === 'link'" :active-tab="activeTab"></link-tab> <link-tab v-if="switchTab === 'link'" :switch-tab="switchTab"></link-tab>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('config.system.apiKey.apiKey')" name="apiKey" style="height: 100%;"><!--$t('config.system.reset.reset')--> <el-tab-pane :label="$t('config.system.apiKey.apiKey')" name="apiKey" style="height: 100%;"><!--$t('config.system.reset.reset')-->
<api-key-tab v-if="activeTab === 'apiKey'" :active-tab="activeTab"></api-key-tab> <api-key-tab v-if="switchTab === 'apiKey'" :switch-tab="switchTab"></api-key-tab>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('config.system.reset.reset')" name="reset"> <el-tab-pane :label="$t('config.system.reset.reset')" name="reset">
<div class="system-config-form" v-if="activeTab === 'reset'"> <div class="system-config-form" v-if="switchTab === 'reset'">
<div class="system-title">{{$t('config.system.basic.title')}}</div> <div class="system-title">{{$t('config.system.basic.title')}}</div>
<el-form :model="reset" label-width="180px" size="small" ref="resetForm" :rules="resetRules" :validate-on-rule-change="false" class="reset-form"> <el-form :model="reset" label-width="180px" size="small" ref="resetForm" :rules="resetRules" :validate-on-rule-change="false" class="reset-form">
<el-form-item prop="type" :label="$t('config.system.reset.type')"> <el-form-item prop="type" :label="$t('config.system.reset.type')">
@@ -369,7 +369,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('config.system.license.license')" name="license"> <el-tab-pane :label="$t('config.system.license.license')" name="license">
<license v-if="activeTab === 'license'"></license> <license v-if="switchTab === 'license'"></license>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
@@ -575,7 +575,7 @@ export default {
value: 'sysconfig' value: 'sysconfig'
} }
], ],
activeTab: 'basic', switchTab: 'basic',
languageList: [ languageList: [
{ value: 'en', label: 'English' }, { value: 'en', label: 'English' },
{ value: 'zh', label: '简体中文' } { value: 'zh', label: '简体中文' }
@@ -1045,11 +1045,11 @@ export default {
} }
}, },
mounted () { mounted () {
this.querySetInfo(this.activeTab) this.querySetInfo(this.switchTab)
this.queryTimezone() this.queryTimezone()
}, },
created () { created () {
this.activeTab = this.$route.query.activeTab || 'basic' this.switchTab = this.$route.query.switchTab || 'basic'
} }
} }
</script> </script>

View File

@@ -49,7 +49,7 @@ export default {
components: { nzDataList, apiKeyTable }, components: { nzDataList, apiKeyTable },
mixins: [dataListMixin, parentTableCommon], mixins: [dataListMixin, parentTableCommon],
props: { props: {
activeTab: String switchTab: String
}, },
data () { data () {
return { return {

View File

@@ -49,7 +49,7 @@ export default {
components: { nzDataList, linkTable }, components: { nzDataList, linkTable },
mixins: [dataListMixin, parentTableCommon], mixins: [dataListMixin, parentTableCommon],
props: { props: {
activeTab: String switchTab: String
}, },
data () { data () {
return { return {

View File

@@ -86,7 +86,7 @@ export default {
components: { nzDataList, notifyMethodTable }, components: { nzDataList, notifyMethodTable },
mixins: [dataListMixin, parentTableCommon], mixins: [dataListMixin, parentTableCommon],
props: { props: {
activeTab: String switchTab: String
}, },
data () { data () {
return { return {

View File

@@ -96,7 +96,7 @@ export const tableCommon = {
export const parentTableCommon = { export const parentTableCommon = {
mixins: [routerPathParams], mixins: [routerPathParams],
props: { props: {
activeTab: { switchTab: {
type: String, type: String,
default: '' default: ''
} }
@@ -108,8 +108,8 @@ export const parentTableCommon = {
const systemParam = { const systemParam = {
...this.searchLabel ...this.searchLabel
} }
if (this.activeTab) { if (this.switchTab) {
systemParam.activeTab = this.activeTab systemParam.switchTab = this.switchTab
} }
const path = this.$route.fullPath.match(/\/(\S*)\?/)[1] const path = this.$route.fullPath.match(/\/(\S*)\?/)[1]
this.updatePath(systemParam, path) this.updatePath(systemParam, path)

View File

@@ -217,7 +217,7 @@ export default {
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.tools.loading = true this.tools.loading = true
this.updatePath({ ...this.searchLabel, ...this.searchCheckBox, showTab: this.showTab }) this.updatePath({ ...this.searchLabel, ...this.searchCheckBox, switchTab: this.switchTab })
this.$get(this.url, { ...this.searchLabel, ...this.searchCheckBox, panelId: 0, returnChildren: 0, groupId: 0 }).then(response => { this.$get(this.url, { ...this.searchLabel, ...this.searchCheckBox, panelId: 0, returnChildren: 0, groupId: 0 }).then(response => {
this.tools.loading = false this.tools.loading = false
if (response.code === 200) { if (response.code === 200) {

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="temp"> <div class="temp">
<exprTemp class="template-tab" :show-tab="showTab" v-if="showTab == 'exprTemp'" @changeShowTab="changeShowTab"></exprTemp> <exprTemp class="template-tab" :switch-tab="switchTab" v-if="switchTab == 'exprTemp'" @changeShowTab="changeShowTab"></exprTemp>
<chartTemp class="template-tab" :show-tab="showTab" v-if="showTab == 'chartTemp'" @changeShowTab="changeShowTab"></chartTemp> <chartTemp class="template-tab" :switch-tab="switchTab" v-if="switchTab == 'chartTemp'" @changeShowTab="changeShowTab"></chartTemp>
</div> </div>
</template> </template>
@@ -18,7 +18,7 @@ export default {
mixins: [routerPathParams], mixins: [routerPathParams],
data () { data () {
return { return {
showTab: 'exprTemp' switchTab: 'exprTemp'
} }
}, },
methods: { methods: {
@@ -32,7 +32,7 @@ export default {
} else { } else {
path = paths path = paths
} }
this.showTab = tab // 此处需要组建中有showTab 属性 this.switchTab = tab // 此处需要组建中有showTab 属性
this.toPath(path) this.toPath(path)
}, },
toPath: function (path) { toPath: function (path) {
@@ -43,13 +43,14 @@ export default {
} }
}) })
}, },
changeShowTab (showTab) { changeShowTab (switchTab) {
this.showTab = showTab this.switchTab = switchTab
this.updatePath({ showTab }) this.updatePath({ switchTab })
} }
}, },
created () { created () {
this.showTab = this.$route.query.showTab || 'exprTemp' console.log(this.$route.query)
this.switchTab = this.$route.query.switchTab || 'exprTemp'
}, },
mounted () { mounted () {
} }