From 6928489ffd5055f1b5a8b9e0432d36448bd8e4c1 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期五, 15 十一月 2024 16:15:35 +0800
Subject: [PATCH] 修改action
---
Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-custom.vue | 77 ++++++++++++++++++++++----------------
1 files changed, 44 insertions(+), 33 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-custom.vue b/Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-custom.vue
index 360191b..213bcff 100644
--- a/Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-custom.vue
+++ b/Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-custom.vue
@@ -18,7 +18,9 @@
:sourceData="sourceData"
:dataStore="dataStore"
:areasName="areasName"
- :paramVOS="urlParams"></component>
+ :paramVOS="urlParams"
+ @setData="setData"
+ @setDataStore="setDataStore"></component>
</div>
</template>
@@ -86,11 +88,10 @@
}
},
watch: {
- sourceData: {
+ sourceData:{
handler(newval) {
//婧愭暟鎹湁鍙樺寲鏃跺彉鏇村綋鍓嶅尯鍩熸暟鎹�
- console.log(this.areasName);
- console.log(newval);
+ this.sourceDataMap();
},
deep: true,
immediate: true
@@ -98,40 +99,43 @@
},
computed: {},
created() {
- this.customClass=this.componentVO.customClass;
- this.componentVO.customClass.split(';').forEach(item=>{
- if(item.indexOf('web=')==0){
- this.customClass=item.split('web=')[1];
- }
- })
- let urlParams = {};
- // 濡傛灉璺緞涓瓨鍦� '?'锛屽垯鍙栭棶鍙峰墠闈㈤儴鍒嗙粰 parts
- if (this.customClass.includes('?')) {
- this.ComponentUrl = this.customClass.split("?")[0];
- urlParams = queryStringToObject(this.customClass);
- } else {
- this.ComponentUrl = this.customClass; // 涓嶅瓨鍦� '?' 鏁存潯璺緞灏辨槸 parts
- }
- if(validatenull(this.ComponentUrl) || ['ui', 'UI', 'base','bs'].includes(this.ComponentUrl)){
- this.ComponentUrl='views/base/UIContentViewerInDialog';
- }else if(this.ComponentUrl.indexOf('views/')===-1){
- this.ComponentUrl='views/custom-ui/'+this.ComponentUrl;
- }
-
- if (this.ComponentUrl=='base/UIContentViewerInDialog' && (!urlParams.type || !urlParams.context)) {
- this.isError = true;
- return;
- }
-
- this.btmType = urlParams.type;
- this.context = urlParams.context;
- this.urlParams = Object.assign({},this.paramVOS, urlParams)
- this.loadCompoent();
+ this.sourceDataMap();
},
mounted() {
//this.getHeight(this.$parent);
},
methods: {
+ sourceDataMap: function () {
+ this.customClass=this.componentVO.customClass;
+ this.componentVO.customClass.split(';').forEach(item=>{
+ if(item.indexOf('web=')==0){
+ this.customClass=item.split('web=')[1];
+ }
+ })
+ let urlParams = {};
+ // 濡傛灉璺緞涓瓨鍦� '?'锛屽垯鍙栭棶鍙峰墠闈㈤儴鍒嗙粰 parts
+ if (this.customClass.includes('?')) {
+ this.ComponentUrl = this.customClass.split("?")[0];
+ urlParams = queryStringToObject(this.customClass);
+ } else {
+ this.ComponentUrl = this.customClass; // 涓嶅瓨鍦� '?' 鏁存潯璺緞灏辨槸 parts
+ }
+ if(validatenull(this.ComponentUrl) || ['ui', 'UI', 'base','bs'].includes(this.ComponentUrl)){
+ this.ComponentUrl='views/base/UIContentViewerInDialog';
+ }else if(this.ComponentUrl.indexOf('views/')===-1){
+ this.ComponentUrl='views/custom-ui/'+this.ComponentUrl;
+ }
+
+ if (this.ComponentUrl=='base/UIContentViewerInDialog' && (!urlParams.type || !urlParams.context)) {
+ this.isError = true;
+ return;
+ }
+
+ this.btmType = urlParams.type;
+ this.context = urlParams.context;
+ this.urlParams = Object.assign({},this.paramVOS, urlParams)
+ this.loadCompoent();
+ },
loadCompoent(){
// 鍔ㄦ�佸鍏ョ粍浠�
import(`@/${this.ComponentUrl}.vue`).then((module) => {
@@ -148,6 +152,13 @@
} else {
this.getHeight(el.$parent);
}
+ },
+ setDataStore(value) {
+ this.$emit("setDataStore", value);
+ this.dataStore = value.dataStore;
+ },
+ setData(value) {
+ this.$emit("setData", value);
}
}
}
--
Gitblit v1.9.3