ludc
2024-04-08 61ced6bdf40951b41a1cd70d8f7440961d117cb1
Source/ProjectWeb/src/components/dynamic-components/dynamic-custom.vue
@@ -1,6 +1,6 @@
<template>
  <div class="UI-dynamic" :id="'UI-dynamic-'+areasName+componentVO.oid">
    <div v-if="isError" style="color: #F56C6C">这个自定义页面的地址格式不正确。推荐使用bs=?type=xxx&context=yyy&pparam=zzz这种形式</div>
    <div v-if="isError" style="color: #F56C6C">这个自定义页面的地址格式不正确。推荐使用bs=组件name?type=xxx&context=yyy&pparam=zzz这种形式</div>
    <component v-else :is="currentComponent"
               :btmType="btmType"
               :content="content"
@@ -15,6 +15,7 @@
</template>
<script>
import {queryStringToObject} from '@/util/util'
export default {
  name: "dynamic-custom",
  components:{
@@ -75,8 +76,7 @@
      }
    }
  },
  computed:{
  },
  computed: {},
  created() {
  },
@@ -93,24 +93,12 @@
    if(this.customClass.split('?')[0]!='' && this.customClass.split('?')[0]!='UI' && this.customClass.split('?')[0]!='ui'){
      this.currentComponent=this.customClass.split('?')[0];
    }
    this.customClass=this.componentVO.customClass.split("?")[1].split('&');
    let urlParams={};
    let btmType=''
    let content=''
    this.customClass.forEach(item=>{
      var preParam =item.split("=");
      if(preParam[0]=='type'){
        btmType=preParam[1];
      }else if(preParam[0]=='context'){
        content=preParam[1];
      }else{
        urlParams[preParam[0]] = preParam[1];
      }
    })
    let urlParams = queryStringToObject(this.customClass);
    let btmType = urlParams.type;
    let content = urlParams.context;
      this.btmType=btmType,
      this.content=content,
    this.btmType = btmType;
    this.content = content;
      this.urlParams=Object.assign(this.paramVOS,urlParams)
    //this.getHeight(this.$parent);