Commit 2ae12971 authored by 杨硕's avatar 杨硕

路由离开前存储筛选条件

parent 3afade40
// export default {
import store from '@/store'
// 路由离开前存储筛选条件
export function setDataCache(path,param) {
store.dispatch('searchSave/searchParamsSet', {
path: path,
param: {
...param
}
}).then(r => {} )
// console.log('store.getters.searchParams', store.getters.searchParams)
}
// 获取缓存的筛选条件 分页参数需统一,如需自定义分页参数,在列表页自行修改
export function getDataCache(routerPath) {
if (store.getters.searchParams[routerPath]) {
const { searchParams } = store.getters;
const path = routerPath
const param = searchParams[path] // 保留着的查询条件
if (param){
return param
} else {
const paramNew = '{"page":1,"rows":10}'
return paramNew
}
} else {
const paramNew = '{"page":1,"rows":10}'
return paramNew
}
}
// }
...@@ -150,6 +150,8 @@ export default { ...@@ -150,6 +150,8 @@ export default {
}) })
}, },
closeSelectedTag(view) { closeSelectedTag(view) {
// 关闭标签页清除存储的筛选条件数据
this.$store.dispatch('searchSave/clearOneParams',this.$route.path)
this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => { this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
if (this.isActive(view)) { if (this.isActive(view)) {
this.toLastView(visitedViews, view) this.toLastView(visitedViews, view)
......
...@@ -18,7 +18,8 @@ const mutations = { ...@@ -18,7 +18,8 @@ const mutations = {
state.searchParams = {} state.searchParams = {}
}, },
CLEAR_ONE_PARAMS: (state, path) => { CLEAR_ONE_PARAMS: (state, path) => {
path && state.searchParams[path] && delete state.searchParams[path] // path && state.searchParams[path] && delete state.searchParams[path]
state.searchParams[path] = ''
} }
} }
...@@ -32,7 +33,10 @@ const actions = { ...@@ -32,7 +33,10 @@ const actions = {
commit('RSET_SEARCH_PARAMS') commit('RSET_SEARCH_PARAMS')
}, },
clearOneParams({ commit }, path) { clearOneParams({ commit }, path) {
commit('CLEAR_ONE_PARAMS', path) // 延时清除缓存数据,防止路由离开前重新赋值
setTimeout(() => {
commit('CLEAR_ONE_PARAMS', path)
}, 1000)
} }
} }
......
...@@ -273,6 +273,7 @@ ...@@ -273,6 +273,7 @@
import { list, delErrLog, cleanErrLog, exportErrLog } from '@/api/monitor/errorLog' import { list, delErrLog, cleanErrLog, exportErrLog } from '@/api/monitor/errorLog'
import Coolbutton from '@/components/coolbutton' import Coolbutton from '@/components/coolbutton'
import { cleanOperLog, exportOperLog } from '@/api/monitor/operLog' import { cleanOperLog, exportOperLog } from '@/api/monitor/operLog'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
export default { export default {
name: 'Operlog', name: 'Operlog',
...@@ -353,20 +354,25 @@ export default { ...@@ -353,20 +354,25 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
this.$store.dispatch('searchSave/searchParamsSet', { // this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path, // path: this.$route.path,
param: { // param: {
...this.queryParams // ...this.queryParams
} // }
}) // })
setDataCache(this.$route.path, this.queryParams)
next() next()
}, },
created() { created() {
if (this.$store.getters.searchParams[this.$route.path]) { // const filterData = getDataCache(this.$route.path)
const { searchParams } = this.$store.getters; const { path } = this.$route // if (filterData) {
const param = JSON.parse(searchParams[path]) // 保留着的查询条件 // // const { searchParams } = this.$store.getters; const { path } = this.$route
this.queryParams = { ...param } // // const param = JSON.parse(searchParams[path]) // 保留着的查询条件
} // const param = JSON.parse(filterData)
// this.queryParams = { ...param }
// }
// 分页参数初始化为{"page":1,"rows":10},如需自定义分页参数,自行修改
this.queryParams = JSON.parse(getDataCache(this.$route.path))
// this.queryParams.operTime = this.$parseDate(new Date(), 'YYYY-MM') // this.queryParams.operTime = this.$parseDate(new Date(), 'YYYY-MM')
this.getList() this.getList()
// this.getDicts('sys_oper_type'.toUpperCase()).then(response => { // this.getDicts('sys_oper_type'.toUpperCase()).then(response => {
......
...@@ -224,6 +224,7 @@ import { list, delLogininfo, cleanLogininfo, exportLogininfo } from '@/api/monit ...@@ -224,6 +224,7 @@ import { list, delLogininfo, cleanLogininfo, exportLogininfo } from '@/api/monit
import dictCons from '@/utils/dictCons' import dictCons from '@/utils/dictCons'
// import Template from '@/views/instance/Template' // import Template from '@/views/instance/Template'
import Coolbutton from '@/components/coolbutton' import Coolbutton from '@/components/coolbutton'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
export default { export default {
name: 'LoginInfo', name: 'LoginInfo',
components: { Coolbutton }, components: { Coolbutton },
...@@ -296,20 +297,25 @@ export default { ...@@ -296,20 +297,25 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
this.$store.dispatch('searchSave/searchParamsSet', { // this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path, // path: this.$route.path,
param: { // param: {
...this.queryParams // ...this.queryParams
} // }
}) // })
setDataCache(this.$route.path, this.queryParams)
next() next()
}, },
created() { created() {
if (this.$store.getters.searchParams[this.$route.path]) { // const filterData = getDataCache(this.$route.path)
const { searchParams } = this.$store.getters; const { path } = this.$route // if (filterData) {
const param = JSON.parse(searchParams[path]) // 保留着的查询条件 // // const { searchParams } = this.$store.getters; const { path } = this.$route
this.queryParams = { ...param } // // const param = JSON.parse(searchParams[path]) // 保留着的查询条件
} // const param = JSON.parse(filterData)
// this.queryParams = { ...param }
// }
// 分页参数初始化为{"page":1,"rows":10},如需自定义分页参数,自行修改
this.queryParams = JSON.parse(getDataCache(this.$route.path))
// this.queryParams.loginTime = this.$parseDate(new Date(), 'YYYY-MM-DD HH:mm:ss') // this.queryParams.loginTime = this.$parseDate(new Date(), 'YYYY-MM-DD HH:mm:ss')
this.getList() this.getList()
// this.getDicts(dictCons['COMMON_STATUS']).then(response => { // this.getDicts(dictCons['COMMON_STATUS']).then(response => {
......
...@@ -272,6 +272,7 @@ ...@@ -272,6 +272,7 @@
import { list, delOperLog, cleanOperLog, exportOperLog } from '@/api/monitor/operLog' import { list, delOperLog, cleanOperLog, exportOperLog } from '@/api/monitor/operLog'
import Coolbutton from '@/components/coolbutton' import Coolbutton from '@/components/coolbutton'
import { cleanLogininfo, exportLogininfo } from '@/api/monitor/loginInfo' import { cleanLogininfo, exportLogininfo } from '@/api/monitor/loginInfo'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
export default { export default {
name: 'Operlog', name: 'Operlog',
...@@ -353,20 +354,23 @@ export default { ...@@ -353,20 +354,23 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
this.$store.dispatch('searchSave/searchParamsSet', { // this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path, // path: this.$route.path,
param: { // param: {
...this.queryParams // ...this.queryParams
} // }
}) // })
setDataCache(this.$route.path, this.queryParams)
next() next()
}, },
created() { created() {
if (this.$store.getters.searchParams[this.$route.path]) { // const filterData = getDataCache(this.$route.path)
const { searchParams } = this.$store.getters; const { path } = this.$route // if (filterData) {
const param = JSON.parse(searchParams[path]) // 保留着的查询条件 // const param = JSON.parse(filterData)
this.queryParams = { ...param } // this.queryParams = { ...param }
} // }
// 分页参数初始化为{"page":1,"rows":10},如需自定义分页参数,自行修改
this.queryParams = JSON.parse(getDataCache(this.$route.path))
// this.queryParams.operTime = this.$parseDate(new Date(), 'YYYY-MM') // this.queryParams.operTime = this.$parseDate(new Date(), 'YYYY-MM')
this.getList() this.getList()
// this.getDicts('sys_oper_type'.toUpperCase()).then(response => { // this.getDicts('sys_oper_type'.toUpperCase()).then(response => {
......
...@@ -207,6 +207,7 @@ import { addDept, delDept, getDept, listDept, listDeptExcludeChild, updateDept } ...@@ -207,6 +207,7 @@ import { addDept, delDept, getDept, listDept, listDeptExcludeChild, updateDept }
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import Coolbutton from '@/components/coolbutton' import Coolbutton from '@/components/coolbutton'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
export default { export default {
name: 'Dept', name: 'Dept',
components: { Treeselect, Coolbutton }, components: { Treeselect, Coolbutton },
...@@ -294,20 +295,23 @@ export default { ...@@ -294,20 +295,23 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
this.$store.dispatch('searchSave/searchParamsSet', { // this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path, // path: this.$route.path,
param: { // param: {
...this.queryParams // ...this.queryParams
} // }
}) // })
setDataCache(this.$route.path, this.queryParams)
next() next()
}, },
created() { created() {
if (this.$store.getters.searchParams[this.$route.path]) { // const filterData = getDataCache(this.$route.path)
const { searchParams } = this.$store.getters; const { path } = this.$route // if (filterData) {
const param = JSON.parse(searchParams[path]) // 保留着的查询条件 // const param = JSON.parse(filterData)
this.queryParams = { ...param } // this.queryParams = { ...param }
} // }
// 分页参数初始化为{"page":1,"rows":10},如需自定义分页参数,自行修改
this.queryParams = JSON.parse(getDataCache(this.$route.path))
this.getList() this.getList()
// this.getDicts('sys_normal_disable'.toUpperCase()).then(response => { // this.getDicts('sys_normal_disable'.toUpperCase()).then(response => {
// this.statusOptions = response.data // this.statusOptions = response.data
......
...@@ -241,6 +241,7 @@ import dictCons from '@/utils/dictCons' ...@@ -241,6 +241,7 @@ import dictCons from '@/utils/dictCons'
import Coolbutton from '@/components/coolbutton' import Coolbutton from '@/components/coolbutton'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import { uploadFalseFile } from '@/api/system/user' import { uploadFalseFile } from '@/api/system/user'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
export default { export default {
name: 'Data', name: 'Data',
...@@ -368,7 +369,25 @@ export default { ...@@ -368,7 +369,25 @@ export default {
manageLoading: false manageLoading: false
} }
}, },
/** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) {
// this.$store.dispatch('searchSave/searchParamsSet', {
// path: this.$route.path,
// param: {
// ...this.queryParams
// }
// })
setDataCache(this.$route.path, this.queryParams)
next()
},
created() { created() {
// const filterData = getDataCache(this.$route.path)
// if (filterData) {
// const param = JSON.parse(filterData)
// this.queryParams = { ...param }
// }
// 分页参数初始化为{"page":1,"rows":10},如需自定义分页参数,自行修改
this.queryParams = JSON.parse(getDataCache(this.$route.path))
const dictId = this.$route.params && this.$route.params.dictId const dictId = this.$route.params && this.$route.params.dictId
this.getType(dictId) this.getType(dictId)
this.getTypeList() this.getTypeList()
......
...@@ -247,6 +247,7 @@ import { listType, ...@@ -247,6 +247,7 @@ import { listType,
import dictCons from '@/utils/dictCons' import dictCons from '@/utils/dictCons'
// import Template from '@/views/instance/Template' // import Template from '@/views/instance/Template'
import Coolbutton from '@/components/coolbutton' import Coolbutton from '@/components/coolbutton'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
export default { export default {
name: 'Dict', name: 'Dict',
components: { Coolbutton }, components: { Coolbutton },
...@@ -385,20 +386,23 @@ export default { ...@@ -385,20 +386,23 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
this.$store.dispatch('searchSave/searchParamsSet', { // this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path, // path: this.$route.path,
param: { // param: {
...this.queryParams // ...this.queryParams
} // }
}) // })
setDataCache(this.$route.path, this.queryParams)
next() next()
}, },
created() { created() {
if (this.$store.getters.searchParams[this.$route.path]) { // const filterData = getDataCache(this.$route.path)
const { searchParams } = this.$store.getters; const { path } = this.$route // if (filterData) {
const param = JSON.parse(searchParams[path]) // 保留着的查询条件 // const param = JSON.parse(filterData)
this.queryParams = { ...param } // this.queryParams = { ...param }
} // }
// 分页参数初始化为{"page":1,"rows":10},如需自定义分页参数,自行修改
this.queryParams = JSON.parse(getDataCache(this.$route.path))
this.getList() this.getList()
this.getDicts(dictCons['NORMAL_DISABLE']).then(response => { this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
this.statusOptions = response.data this.statusOptions = response.data
......
...@@ -265,6 +265,7 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css' ...@@ -265,6 +265,7 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import IconSelect from '@/components/IconSelect' import IconSelect from '@/components/IconSelect'
import dictCons from '@/utils/dictCons' import dictCons from '@/utils/dictCons'
import Coolbutton from '@/components/coolbutton' import Coolbutton from '@/components/coolbutton'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
export default { export default {
name: 'Menu', name: 'Menu',
components: { Treeselect, IconSelect,Coolbutton }, components: { Treeselect, IconSelect,Coolbutton },
...@@ -375,23 +376,25 @@ export default { ...@@ -375,23 +376,25 @@ export default {
// }, // },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
this.$store.dispatch('searchSave/searchParamsSet', { // this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path, // path: this.$route.path,
param: { // param: {
...this.queryParams // ...this.queryParams
} // }
}) // })
setDataCache(this.$route.path, this.queryParams)
next() next()
}, },
created() { created() {
if (this.$store.getters.searchParams[this.$route.path]) { // const filterData = getDataCache(this.$route.path)
const { searchParams } = this.$store.getters; const { path } = this.$route // if (filterData) {
const param = JSON.parse(searchParams[path]) // 保留着的查询条件 // const param = JSON.parse(filterData)
this.queryParams = { ...param } // this.queryParams = { ...param }
this.handleQuery() // this.handleQuery()
} else { // }
this.getList() // 分页参数初始化为{"page":1,"rows":10},如需自定义分页参数,自行修改
} this.queryParams = JSON.parse(getDataCache(this.$route.path))
this.getList()
this.getDicts(dictCons['SHOW_HIDE']).then(response => { this.getDicts(dictCons['SHOW_HIDE']).then(response => {
this.visibleOptions = response.data this.visibleOptions = response.data
}) })
......
...@@ -131,6 +131,7 @@ ...@@ -131,6 +131,7 @@
</template> </template>
<script> <script>
import { treeselect, queryUserByDeptId, queryUserWithoutDept, transformDept, queryUserByName } from '../../../api/system/dept' import { treeselect, queryUserByDeptId, queryUserWithoutDept, transformDept, queryUserByName } from '../../../api/system/dept'
import { getDataCache } from '@/assets/js/filterData'
export default { export default {
name: 'Otree', name: 'Otree',
data() { data() {
......
...@@ -228,6 +228,7 @@ import dictCons from '@/utils/dictCons' ...@@ -228,6 +228,7 @@ import dictCons from '@/utils/dictCons'
import { listDept } from '@/api/system/dept' import { listDept } from '@/api/system/dept'
import { listRole } from '@/api/system/role' import { listRole } from '@/api/system/role'
import {updateType} from "@/api/system/dict/type"; import {updateType} from "@/api/system/dict/type";
import { getDataCache, setDataCache } from '@/assets/js/filterData'
export default { export default {
name: 'Post', name: 'Post',
components: { Treeselect }, components: { Treeselect },
...@@ -337,7 +338,25 @@ export default { ...@@ -337,7 +338,25 @@ export default {
} }
} }
}, },
/** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) {
// this.$store.dispatch('searchSave/searchParamsSet', {
// path: this.$route.path,
// param: {
// ...this.queryParams
// }
// })
setDataCache(this.$route.path, this.queryParams)
next()
},
created() { created() {
// const filterData = getDataCache(this.$route.path)
// if (filterData) {
// const param = JSON.parse(filterData)
// this.queryParams = { ...param }
// }
// 分页参数初始化为{"page":1,"rows":10},如需自定义分页参数,自行修改
this.queryParams = JSON.parse(getDataCache(this.$route.path))
this.getList() this.getList()
this.getDicts(dictCons.NORMAL_DISABLE).then(response => { this.getDicts(dictCons.NORMAL_DISABLE).then(response => {
this.statusOptions = response.data this.statusOptions = response.data
......
...@@ -263,6 +263,7 @@ import { roleMenuTreeselectMC, treeselect as menuTreeselect, roleMenuTreeselect ...@@ -263,6 +263,7 @@ import { roleMenuTreeselectMC, treeselect as menuTreeselect, roleMenuTreeselect
import { treeselect as deptTreeselect, roleDeptTreeselect } from '@/api/system/dept' import { treeselect as deptTreeselect, roleDeptTreeselect } from '@/api/system/dept'
// import { getRolesByInsId } from '../../../api/businessManage/template' // import { getRolesByInsId } from '../../../api/businessManage/template'
import Coolbutton from '@/components/coolbutton' import Coolbutton from '@/components/coolbutton'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
export default { export default {
name: 'Role', name: 'Role',
components: { Coolbutton }, components: { Coolbutton },
...@@ -384,20 +385,23 @@ export default { ...@@ -384,20 +385,23 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
this.$store.dispatch('searchSave/searchParamsSet', { // this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path, // path: this.$route.path,
param: { // param: {
...this.queryParams // ...this.queryParams
} // }
}) // })
setDataCache(this.$route.path, this.queryParams)
next() next()
}, },
created() { created() {
if (this.$store.getters.searchParams[this.$route.path]) { // const filterData = getDataCache(this.$route.path)
const { searchParams } = this.$store.getters; const { path } = this.$route // if (filterData) {
const param = JSON.parse(searchParams[path]) // 保留着的查询条件 // const param = JSON.parse(filterData)
this.queryParams = { ...param } // this.queryParams = { ...param }
} // }
// 分页参数初始化为{"page":1,"rows":10},如需自定义分页参数,自行修改
this.queryParams = JSON.parse(getDataCache(this.$route.path))
this.getList() this.getList()
// this.getDicts(dictCons['NORMAL_DISABLE']).then(response => { // this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
// this.statusOptions = response.data; // this.statusOptions = response.data;
......
...@@ -59,22 +59,22 @@ ...@@ -59,22 +59,22 @@
<!-- icon="el-icon-plus"--> <!-- icon="el-icon-plus"-->
<!-- @click="handleAdd"--> <!-- @click="handleAdd"-->
<!-- >新增</el-button>--> <!-- >新增</el-button>-->
<coolbutton :type="typePrimary" :name="addName" :size="smallSize" :icon="addIcon" :haspermi="addHaspermi" @btn-click="handleAdd" /> <coolbutton :type="typePrimary" :name="addName" :size="smallSize" :icon="addIcon" :haspermi="addHaspermi" @btn-click="handleAdd" />
<el-button <el-button
type="warning" type="warning"
icon="el-icon-upload" icon="el-icon-upload"
size="small" size="small"
@click="handleImport" @click="handleImport"
>导入</el-button> >导入</el-button>
<!-- <el-button--> <!-- <el-button-->
<!-- v-hasPermi="['sys:user:export']"--> <!-- v-hasPermi="['sys:user:export']"-->
<!-- style="padding: 8px 7px;"--> <!-- style="padding: 8px 7px;"-->
<!-- type="success"--> <!-- type="success"-->
<!-- size="small"--> <!-- size="small"-->
<!-- icon="el-icon-download"--> <!-- icon="el-icon-download"-->
<!-- @click="handleExport"--> <!-- @click="handleExport"-->
<!-- >导出</el-button>--> <!-- >导出</el-button>-->
<coolbutton :type="typeSuccess" :name="exportName" :size="smallSize" :icon="exportIcon" :haspermi="addHaspermi" @btn-click="handleExport" /> <coolbutton :type="typeSuccess" :name="exportName" :size="smallSize" :icon="exportIcon" :haspermi="addHaspermi" @btn-click="handleExport" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -396,6 +396,7 @@ import TreeSelect from '@riophae/vue-treeselect' ...@@ -396,6 +396,7 @@ import TreeSelect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { getlistRole } from '@/api/system/role' import { getlistRole } from '@/api/system/role'
import Coolbutton from '@/components/coolbutton' import Coolbutton from '@/components/coolbutton'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
export default { export default {
name: 'User', name: 'User',
components: { TreeSelect, Coolbutton }, components: { TreeSelect, Coolbutton },
...@@ -621,12 +622,13 @@ export default { ...@@ -621,12 +622,13 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
this.$store.dispatch('searchSave/searchParamsSet', { // this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path, // path: this.$route.path,
param: { // param: {
...this.queryParams // ...this.queryParams
} // }
}) // })
setDataCache(this.$route.path, this.queryParams)
next() next()
}, },
watch: { watch: {
...@@ -636,11 +638,15 @@ export default { ...@@ -636,11 +638,15 @@ export default {
} }
}, },
created() { created() {
if (this.$store.getters.searchParams[this.$route.path]) { // const filterData = getDataCache(this.$route.path)
const { searchParams } = this.$store.getters; const { path } = this.$route // if (filterData) {
const param = JSON.parse(searchParams[path]) // 保留着的查询条件 // // const { searchParams } = this.$store.getters; const { path } = this.$route
this.queryParams = { ...param } // // const param = JSON.parse(searchParams[path]) // 保留着的查询条件
} // const param = JSON.parse(filterData)
// this.queryParams = { ...param }
// }
// 分页参数初始化为{"page":1,"rows":10},如需自定义分页参数,自行修改
this.queryParams = JSON.parse(getDataCache(this.$route.path))
this.getList() this.getList()
this.getTreeSelect() this.getTreeSelect()
this.getRole() this.getRole()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment