[fix 83044] 跳转待办参数补充

This commit is contained in:
danshihao
2024-03-26 10:26:50 +08:00
parent 732d5b9a8f
commit 4eaae1f3d1
2 changed files with 25 additions and 4 deletions
@@ -16,6 +16,7 @@
<component <component
:is="comp" :is="comp"
ref="compModel" ref="compModel"
:useRouteQuery="useRouteQuery"
v-if="comp"> v-if="comp">
</component> </component>
</keep-alive> </keep-alive>
@@ -31,6 +32,7 @@ export default {
return { return {
comp: null, comp: null,
activeTab: '', activeTab: '',
useRouteQuery: true,
tabList: [ tabList: [
{ // 待办流程 { // 待办流程
component: 'TodoList', component: 'TodoList',
@@ -60,6 +62,8 @@ export default {
this.comp = resolve => require([`@views/workCenter/processCenter/table/${this.activeTab}.vue`], resolve) this.comp = resolve => require([`@views/workCenter/processCenter/table/${this.activeTab}.vue`], resolve)
setTimeout(() => { setTimeout(() => {
this.$refs.compModel.loadData() this.$refs.compModel.loadData()
// 切换tab后就不使用路由参数,页面会有缓存
this.useRouteQuery = false
}, 100) }, 100)
} }
}, },
@@ -77,9 +81,16 @@ export default {
// }, // },
activated () { activated () {
console.log('---------activated') console.log('---------activated')
if (this.$refs.compModel && this.$refs.compModel.loadData) { // 如果有路由参数,则使用路由参数跳转对应页签
this.$refs.compModel.loadData() if (this.$route.query.activeTab) {
this.activeTab = this.$route.query.activeTab
this.comp = resolve => require([`@views/workCenter/processCenter/table/${this.activeTab}.vue`], resolve)
} }
this.$nextTick(() => {
if (this.$refs.compModel && this.$refs.compModel.loadData) {
this.$refs.compModel.loadData()
}
})
} }
} }
</script> </script>
@@ -121,6 +121,14 @@ export default {
name: 'TodoList', name: 'TodoList',
components: { JTable, UserSelectModal }, components: { JTable, UserSelectModal },
mixins: [JeroListMixin], mixins: [JeroListMixin],
props: {
// 从路由中读取参数
useRouteQuery: {
type: Boolean,
required: false,
default: false
}
},
data () { data () {
return { return {
labelCol: { labelCol: {
@@ -272,9 +280,11 @@ export default {
disableMixinCreated: true disableMixinCreated: true
} }
}, },
mounted () { activated () {
// 初始化查询参数 // 初始化查询参数
this.initQueryParam() if (this.useRouteQuery) {
this.initQueryParam()
}
}, },
methods: { methods: {
// 初始化查询参数 // 初始化查询参数