wangting
2024-03-29 1d6d5056c496fdb15b2722bf034de633bf268c93
Source/ProjectWeb/src/views/base/UIContentViewer.vue
@@ -1,24 +1,24 @@
<template>
  <!--UI上下文的展示器-->
  <div style="height:calc(100% - 4px) ">
  <div style="height:calc(100% - 4px);min-width:1200px">
    <el-header v-if="uiDefineVO.northAreas && uiDefineVO.northAreas.length>0">
      <UIContentArea :key="'northArea-'+uiDefineVO.oid" areas-name="northArea"
                     :areasData="uiDefineVO.northAreas"
                     :inDialog="inDialog"
                     :sourceData="sourceData"
                     :dataStore="dataStore"
                     :paramVOS="paramVOS">
                     :dataStore="checkedData.northArea"
                     @setDataStore="setDataStore">
      </UIContentArea>
    </el-header>
    <el-container :style="'height: '+(uiDefineVO.northAreas && uiDefineVO.northAreas.length>0?'calc(100% - 70px)':'100%')">
      <el-aside v-if="uiDefineVO.westAreas && uiDefineVO.westAreas.length>0" :width="uiDefineVO.westAreas[0].componentVOs[0].uiComponentType=='table'?'400px':'320px'" height="100%">
      <el-aside v-if="uiDefineVO.westAreas && uiDefineVO.westAreas.length>0" :width="uiDefineVO.westAreas[0].componentVOs[0].uiComponentType=='table' || uiDefineVO.westAreas[0].componentVOs[0].uiComponentType=='TreeTable'?'420px':'320px'" height="100%">
        <UIContentArea :key="'westArea-'+uiDefineVO.oid" areas-name="westArea"
                       cradStyle=""
                       :areasData="uiDefineVO.westAreas"
                       :inDialog="inDialog"
                       :sourceData="sourceData"
                       :dataStore="dataStore"
                       :paramVOS="paramVOS">
                       :dataStore="checkedData.westArea"
                       @setDataStore="setDataStore">
        </UIContentArea>
      </el-aside>
      <el-container style="height: 100%">
@@ -27,19 +27,19 @@
                         cradStyle=""
                         :areasData="uiDefineVO.centerAreas"
                         :inDialog="inDialog"
                         :sourceData="checkedData.westAreas[0]"
                         :dataStore="checkedData.centerAreas[0]"
                         :paramVOS="paramVOS">
                         :sourceData="checkedData.westArea[checkedData.westArea.length-1]"
                         :dataStore="checkedData.centerArea"
                         @setDataStore="setDataStore">
          </UIContentArea>
        </el-main>
        <el-footer v-if="uiDefineVO.southAreas && uiDefineVO.southAreas.length>0" height="300px" style="max-height: 300px">
        <el-footer v-if="uiDefineVO.southAreas && uiDefineVO.southAreas.length>0" height="35%" style="max-height: 300px">
          <UIContentArea :key="'southArea-'+uiDefineVO.oid" areas-name="southArea"
                         cradStyle=""
                         :areasData="uiDefineVO.southAreas"
                         :inDialog="inDialog"
                         :sourceData="checkedData.centerAreas[0]"
                         :dataStore="checkedData.southAreas[0]"
                         :paramVOS="paramVOS">
                         :sourceData="checkedData.centerArea[checkedData.centerArea.length-1]"
                         :dataStore="checkedData.southArea"
                         @setDataStore="setDataStore">
          </UIContentArea>
        </el-footer>
      </el-container>
@@ -48,66 +48,58 @@
</template>
<script>
import { verifyNull } from "@/util/validate";
import UIContentArea from "@/views/base/UIContentArea"
import {uiDefineVOData} from "@/views/base/uiDefineVO"
export default {
  name: "UIContentViewer",
  components:{UIContentArea},
  props:{
    inDialog: {
      type: Boolean,
      default: false
    },
    sourceData:{
      //菜单源数据或者弹窗时按钮所属区域的上一区域选中数据
      type:Object,
      default: {}
    },
    dataStore:{
      //弹窗时按钮所属区域选中数据
      type:Array,
      default: []
    },
    paramVOS:{
      type:Object,
      default: {}
    }
  },
  components: {UIContentArea},
  data() {
    return {
      btmType:'',//业务类型(或链接类型)
      content:'',//UI上下文的名称
      checkedData:{
      btmType: '',//业务类型(或链接类型)
      content: '',//UI上下文的名称
      checkedData: {
        //各区域选中数据
        westAreas:[],
        centerAreas:[],
        southAreas:[]
        northArea: [{}],
        westArea: [{}],
        centerArea: [{}],
        southArea: [{}]
      },
      uiDefineVO: uiDefineVOData,
      centerHeight:'100%'
      uiDefineVO: {},
      centerHeight: '100%',
      inDialog: false,
      //菜单源数据
      sourceData: {},
    }
  },
  watch: {
  },
  computed: {
  },
  watch: {},
  computed: {},
  created() {
    if (this.uiDefineVO.southAreas && this.uiDefineVO.southAreas.length > 0) {
      this.centerHeight = 'calc(100% - 310px)';
    } else {
      this.centerHeight = '100%';
    if (verifyNull(this.$route.query.type) || (verifyNull(this.$route.query.context) && verifyNull(this.$route.query.content))) {
      this.$message.error("配置的信息错误,请参考bs=?type=xxx&context=yyy&param=zzz这种形式。其中type是业务类型(或链接类型),context是UI上下文的名称");
      return false;
    }
    this.btmType=this.$route.query.type;
    this.content=this.$route.query.context ||this.$route.query.content;
    this.sourceData=this.$route.query;
    this.initUI();
    this.initContent();
  },
  methods: {
    initUI(){
    initUI() {
      this.uiDefineVO = uiDefineVOData;
    },
    initContent(){
    initContent() {
      if (this.uiDefineVO.southAreas && this.uiDefineVO.southAreas.length > 0) {
        this.centerHeight = 'calc(100% - 310px)';
      } else {
        this.centerHeight = '100%';
      }
    },
    setDataStore(value) {
      this.checkedData[value.area] = value.dataStore;
    }
  }
}
</script>