wangting
2024-04-08 8be3182372eb774dce8f9c97a0b51c03bda165c7
Source/ProjectWeb/src/components/dynamic-components/index.vue
@@ -1,37 +1,62 @@
<template>
  <div>
    <dynamic-table v-if="componentVO.uiComponentType=='table'"
                   :inDialog="inDialog"
                   :componentVO="componentVO"
                   :sourceData="sourceData"
                   :areasName="areasName"
                   :paramVOS="paramVOS">
  <dynamic-table v-if="componentVO.uiComponentType=='table'"
                 :key="areasName+'table-'+componentVO.oid"
                 :inDialog="inDialog"
                 :componentVO="componentVO"
                 :sourceData="sourceData"
                 :dataStore="dataStore"
                 :areasName="areasName"
                 :paramVOS="paramVOS"
                 @setDataStore="setDataStore"
                 :isShow="isShow">
    </dynamic-table>
    <dynamic-form v-else-if="componentVO.uiComponentType=='form'"
                  :inDialog="inDialog"
  </dynamic-table>
  <dynamicTreeTable v-else-if="componentVO.uiComponentType=='TreeTable'"
                 :key="areasName+'table-'+componentVO.oid"
                 :inDialog="inDialog"
                 :componentVO="componentVO"
                 :sourceData="sourceData"
                    :dataStore="dataStore"
                 :areasName="areasName"
                 :paramVOS="paramVOS"
                    @setDataStore="setDataStore"
                 :isShow="isShow">
  </dynamicTreeTable>
  <dynamic-form v-else-if="componentVO.uiComponentType=='form'"
                :key="areasName+'form-'+componentVO.oid"
                :inDialog="inDialog"
                :componentVO="componentVO"
                :sourceData="sourceData"
                :dataStore="dataStore"
                :areasName="areasName"
                :paramVOS="paramVOS"
                @setDataStore="setDataStore"
                :isShow="isShow">
  </dynamic-form>
  <dynamic-tree v-else-if="componentVO.uiComponentType=='tree'"
                :key="areasName+'tree-'+componentVO.oid"
                :inDialog="inDialog"
                :componentVO="componentVO"
                :sourceData="sourceData"
                :dataStore="dataStore"
                :areasName="areasName"
                :paramVOS="paramVOS"
                @setDataStore="setDataStore"
                :isShow="isShow">
  </dynamic-tree>
  <dynamic-custom v-else-if="componentVO.uiComponentType=='customer'"  :inDialog="inDialog"
                  :key="areasName+'custom-'+componentVO.oid"
                  :componentVO="componentVO"
                  :sourceData="sourceData"
                  :dataStore="dataStore"
                  :areasName="areasName"
                  :paramVOS="paramVOS">
                  :paramVOS="paramVOS"
                  @setDataStore="setDataStore"
                  :isShow="isShow">
    </dynamic-form>
    <dynamic-tree v-else-if="componentVO.uiComponentType=='tree'"
                  :inDialog="inDialog"
                  :componentVO="componentVO"
                  :sourceData="sourceData"
                  :areasName="areasName"
                  :paramVOS="paramVOS">
    </dynamic-tree>
    <dynamic-custom v-else-if="componentVO.uiComponentType=='custom'"  :inDialog="inDialog"
                    :componentVO="componentVO"
                    :sourceData="sourceData"
                    :areasName="areasName"
                    :paramVOS="paramVOS">
    </dynamic-custom>
  </div>
  </dynamic-custom>
</template>
<script>
@@ -39,9 +64,10 @@
import dynamicForm from "@/components/dynamic-components/dynamic-form"
import dynamicTree from "@/components/dynamic-components/dynamic-tree"
import dynamicCustom from "@/components/dynamic-components/dynamic-custom"
import dynamicTreeTable from "@/components/dynamic-components/dynamic-TreeTable"
export default {
  name: "dynamicIndex",
  components:{dynamicCustom, dynamicTree, dynamicForm, dynamicTable},
  components:{dynamicCustom, dynamicTree, dynamicForm, dynamicTable,dynamicTreeTable  },
  props:{
    componentVO:{
      type:Object,
@@ -60,11 +86,29 @@
      type:Object,
      default: {}
    },
    dataStore:{
      //弹窗时按钮所属区域选中数据
      type:Array,
      default: []
    },
    paramVOS:{
      type:Object,
      default: {}
    }
    },
    isShow: {
      //所在区域是否已显示,针对tab和collapse
      type: Boolean,
      default: true
    },
  },
  created() {
  },
  methods:{
    setDataStore(value) {
      this.$emit("setDataStore", value);
      this.dataStore = value.dataStore;
    }
  }
}
</script>