wangting
2024-03-29 1d6d5056c496fdb15b2722bf034de633bf268c93
Source/ProjectWeb/src/views/base/UIContentViewer.vue
@@ -6,8 +6,7 @@
                     :areasData="uiDefineVO.northAreas"
                     :inDialog="inDialog"
                     :sourceData="sourceData"
                     :dataStore="checkedData.northArea[0]"
                     :paramVOS="paramVOS"
                     :dataStore="checkedData.northArea"
                     @setDataStore="setDataStore">
      </UIContentArea>
    </el-header>
@@ -18,8 +17,7 @@
                       :areasData="uiDefineVO.westAreas"
                       :inDialog="inDialog"
                       :sourceData="sourceData"
                       :dataStore="checkedData.westArea[0]"
                       :paramVOS="paramVOS"
                       :dataStore="checkedData.westArea"
                       @setDataStore="setDataStore">
        </UIContentArea>
      </el-aside>
@@ -29,9 +27,8 @@
                         cradStyle=""
                         :areasData="uiDefineVO.centerAreas"
                         :inDialog="inDialog"
                         :sourceData="checkedData.westArea[0]"
                         :dataStore="checkedData.centerArea[0]"
                         :paramVOS="paramVOS"
                         :sourceData="checkedData.westArea[checkedData.westArea.length-1]"
                         :dataStore="checkedData.centerArea"
                         @setDataStore="setDataStore">
          </UIContentArea>
        </el-main>
@@ -40,9 +37,8 @@
                         cradStyle=""
                         :areasData="uiDefineVO.southAreas"
                         :inDialog="inDialog"
                         :sourceData="checkedData.centerArea[0]"
                         :dataStore="checkedData.southArea[0]"
                         :paramVOS="paramVOS"
                         :sourceData="checkedData.centerArea[checkedData.centerArea.length-1]"
                         :dataStore="checkedData.southArea"
                         @setDataStore="setDataStore">
          </UIContentArea>
        </el-footer>
@@ -52,61 +48,54 @@
</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: {}
    },
    paramVOS:{
      type:Object,
      default: {}
    }
  },
  components: {UIContentArea},
  data() {
    return {
      btmType:'',//业务类型(或链接类型)
      content:'',//UI上下文的名称
      checkedData:{
      btmType: '',//业务类型(或链接类型)
      content: '',//UI上下文的名称
      checkedData: {
        //各区域选中数据
        northArea:[],
        westArea:[],
        centerArea:[],
        southArea:[]
        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;