Commit ab9138db authored by 王纵's avatar 王纵

低代码增加可配置路由参数

parent 7f2823df
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-07-30 09:41:54 * @Date: 2024-07-30 09:41:54
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-19 14:40:12 * @LastEditTime: 2024-09-06 15:54:06
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: * @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -50,10 +50,11 @@ const ConfigRenderComponent = { ...@@ -50,10 +50,11 @@ const ConfigRenderComponent = {
}, },
inject: ['dynamicInfo'], inject: ['dynamicInfo'],
created() { created() {
this.queryParams = { // this.queryParams = {
...this.$route.params, // ...this.$route.params,
...this.$route.query // ...this.$route.query
} // }
this.queryParams = this.dynamicInfo().queryParams;
}, },
mounted() { mounted() {
this.configInfo = this.dynamicInfo().config; this.configInfo = this.dynamicInfo().config;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com * @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56 * @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com * @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-09-06 15:26:18 * @LastEditTime: 2024-09-06 15:53:19
* @Version: 1.0.0 * @Version: 1.0.0
* @Description: * @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing * @Copyright: Copyright (c) 2021, Hand-RongJing
...@@ -98,6 +98,10 @@ export default { ...@@ -98,6 +98,10 @@ export default {
dataLoadHandle: { dataLoadHandle: {
type: Function, type: Function,
default: () => {} default: () => {}
},
routeParams: {
type: Object,
default: null
} }
}, },
data () { data () {
...@@ -126,23 +130,26 @@ export default { ...@@ -126,23 +130,26 @@ export default {
}; };
}, },
created() { created() {
this.params = { this.init();
...this.$route.params,
...this.$route.query
}
}, },
activated() { activated() {
this.params = { this.init();
...this.$route.params,
...this.$route.query
}
console.log('activated', this.params)
this.layoutCodeQuery(); this.layoutCodeQuery();
}, },
beforeMount() { beforeMount() {
this.layoutCodeQuery(); this.layoutCodeQuery();
}, },
methods: { methods: {
init() {
if (this.routeParams) {
this.params = {...this.routeParams};
} else {
this.params = {
...this.$route.params,
...this.$route.query
}
}
},
// 获取页面布局配置 // 获取页面布局配置
async layoutCodeQuery() { async layoutCodeQuery() {
// const {disabled} = this.props; // const {disabled} = this.props;
......
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