| | |
| | | :sourceData="sourceData" |
| | | :dataStore="dataStore" |
| | | :areasName="areasName" |
| | | :paramVOS="urlParams"></component> |
| | | :paramVOS="urlParams" |
| | | @setData="setData" |
| | | @setDataStore="setDataStore"></component> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | } |
| | | }, |
| | | watch: { |
| | | sourceData: { |
| | | sourceData:{ |
| | | handler(newval) { |
| | | //源数据有变化时变更当前区域数据 |
| | | console.log(this.areasName); |
| | | console.log(newval); |
| | | this.sourceDataMap(); |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | |
| | | }, |
| | | 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) => { |
| | |
| | | } else { |
| | | this.getHeight(el.$parent); |
| | | } |
| | | }, |
| | | setDataStore(value) { |
| | | this.$emit("setDataStore", value); |
| | | this.dataStore = value.dataStore; |
| | | }, |
| | | setData(value) { |
| | | this.$emit("setData", value); |
| | | } |
| | | } |
| | | } |