田源
2024-03-31 7d6fdd87d9cbb948baeacdadf547b19bd26eb232
Merge remote-tracking branch 'origin/master'
已修改5个文件
已重命名2个文件
183 ■■■■ 文件已修改
Source/ProjectWeb/src/components/dynamic-components/dynamic-custom.vue 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/base/UIContentViewer.vue 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/base/uiDefineVO.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/custom-ui/test.vue 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/custom-ui/test2.vue 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/dynamic-custom.vue
@@ -1,15 +1,16 @@
<template>
  <div class="UI-dynamic" :id="'UI-dynamic-'+areasName+componentVO.oid">
    <div v-if="isError" style="color: #F56C6C">这个自定义页面的地址格式不正确。推荐使用UI:type#content?param=xxx这种形式</div>
    <div v-if="isError" style="color: #F56C6C">这个自定义页面的地址格式不正确。推荐使用bs=?type=xxx&context=yyy&pparam=zzz这种形式</div>
    <component v-else :is="currentComponent"
               :customOptions="customOptions"
               :btmType="customOptions.btmType"
               :content="customOptions.content"
               :inDialog="true"
               :key="areasName+'customCom-'+componentVO.oid"
               :componentVO="componentVO"
               :sourceData="sourceData"
               :dataStore="dataStore"
               :areasName="areasName"
               :paramVOS="paramVOS"></component>
               :paramVOS="customOptions.paramVOS"></component>
  </div>
</template>
@@ -18,8 +19,8 @@
  name: "dynamic-custom",
  components:{
    'UI':()=>import('@/views/base/UIContentViewerInDialog'),
    'test':()=>import('@/components/custom-ui/test'),
    'test2':()=>import('@/components/custom-ui/test2'),
    'test':()=>import('@/views/custom-ui/test'),
    'test2':()=>import('@/views/custom-ui/test2'),
  },
  props:{
    componentVO:{
@@ -35,7 +36,7 @@
      default:''
    },
    sourceData:{
      //菜单源数据或者弹窗时按钮所属区域的上一区域选中数据
      //所属区域的上一区域选中数据
      type:Object,
      default: {}
    },
@@ -57,7 +58,7 @@
  data() {
    return {
      height:'300px',
      customClass:this.componentVO.customClass, //UI:type#content?param=xxx或者 组件name:type#content?param=xxx
      customClass:this.componentVO.customClass, //bs=?type=xxx&context=yyy&param=zzz  或者 bs=组件name?type=xxx&context=yyy&param=zzz
      isError:false, //路径解析失败
      currentComponent: 'UI',//组件name
    }
@@ -73,45 +74,36 @@
  },
  computed:{
    customOptions() {
      if(this.customClass.indexOf(":") <0){
      if(this.customClass.indexOf("bs=") <0){
        this.isError=true;
        return ;
      }
      if(this.customClass.split(':')[0]!='UI' && this.customClass.split(':')[0]!='ui'){
        this.currentComponent=this.customClass.split(':')[0];
      this.customClass=this.componentVO.customClass.split("bs=")[1];
      if(this.customClass.indexOf("?") <0 || this.customClass.indexOf("type=") <0 || this.customClass.indexOf("context=") <0){
        this.isError=true;
        return ;
      }
      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=''
      if(this.customClass.split(':')[1].indexOf("?") <0){
        btmType=this.customClass.split(':')[1].split('#')[0];
        content=this.customClass.split(':')[1].split('#')[1];
      }else {
        let split1 = this.customClass.split(':')[1].split('?')[0];
        let split2 = this.customClass.split(':')[1].split('?')[1];
        btmType=split1.split('#')[0];
        content=split1.split('#')[1];
        let paramsArray = split2.split("&");
        paramsArray.forEach(item=>{
          var preParam =item.split("=");
          if(preParam[0]=='btmname'){
            urlParams['btmType']=preParam[1];
          }else if(preParam[0]=='imagetype'){
            urlParams['imageType']=preParam[1];
            if(preParam[1]=='fileobject'){
            }
          }else{
            urlParams[preParam[0]] = preParam[1];
          }
        })
      }
      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];
        }
      })
      return {
        btmType:btmType,
        content:content,
        urlParams: urlParams
        paramVOS:Object.assign(this.paramVOS,urlParams)
      }
    }
  },
Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue
@@ -60,7 +60,7 @@
      default: ''
    },
    sourceData:{
      //菜单源数据或者弹窗时按钮所属区域的上一区域选中数据
      //所属区域的上一区域选中数据
      type:Object,
      default: {}
    },
Source/ProjectWeb/src/views/base/UIContentViewer.vue
@@ -7,7 +7,6 @@
                     :inDialog="inDialog"
                     :sourceData="sourceData"
                     :dataStore="checkedData.northArea"
                     :paramVOS="paramVOS"
                     @setDataStore="setDataStore">
      </UIContentArea>
    </el-header>
@@ -19,7 +18,6 @@
                       :inDialog="inDialog"
                       :sourceData="sourceData"
                       :dataStore="checkedData.westArea"
                       :paramVOS="paramVOS"
                       @setDataStore="setDataStore">
        </UIContentArea>
      </el-aside>
@@ -31,7 +29,6 @@
                         :inDialog="inDialog"
                         :sourceData="checkedData.westArea[checkedData.westArea.length-1]"
                         :dataStore="checkedData.centerArea"
                         :paramVOS="paramVOS"
                         @setDataStore="setDataStore">
          </UIContentArea>
        </el-main>
@@ -42,7 +39,6 @@
                         :inDialog="inDialog"
                         :sourceData="checkedData.centerArea[checkedData.centerArea.length-1]"
                         :dataStore="checkedData.southArea"
                         :paramVOS="paramVOS"
                         @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;
Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue
@@ -54,17 +54,24 @@
<script>
import UIContentArea from "@/views/base/UIContentArea"
import {uiDefineVOData} from "@/views/base/uiDefineVOInDialog"
import {verifyNull} from "@/util/validate";
export default {
  name: "UIContentViewerInDialog",
  components:{UIContentArea},
  props:{
    btmType:{
      type: String,
    },
    content:{
      type: String,
    },
    inDialog: {
      type: Boolean,
      default: false
    },
    sourceData:{
      //菜单源数据或者弹窗时按钮所属区域的上一区域选中数据
      //所属区域的上一区域选中数据
      type:Object,
      default: {}
    },
@@ -76,16 +83,10 @@
    paramVOS:{
      type:Object,
      default: {}
    },
    customOptions:{
      type:Object,
      default: {}
    }
  },
  data() {
    return {
      btmType:this.customOptions.btmType,//业务类型(或链接类型)
      content:this.customOptions.content,//UI上下文的名称
      checkedData:{
        //各区域选中数据
        northAreaInDialog:[{}],
@@ -93,7 +94,7 @@
        centerAreaInDialog:[{}],
        southAreaInDialog:[{}]
      },
      uiDefineVO: uiDefineVOData,
      uiDefineVO: {},
      centerHeight:'100%'
    }
  },
@@ -104,18 +105,23 @@
  },
  created() {
    if (this.uiDefineVO.southAreas && this.uiDefineVO.southAreas.length > 0) {
      this.centerHeight = 'calc(100% - 310px)';
    } else {
      this.centerHeight = '100%';
    if (verifyNull(this.btmType) || verifyNull(this.content) ) {
      this.$message.error("自定义组件配置的信息错误,请参考bs=name?type=xxx&context=yyy&param=zzz这种形式。其中type是业务类型(或链接类型),context是UI上下文的名称,name为组件名称,空值时默认展示UI引擎");
      return false;
    }
    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;
Source/ProjectWeb/src/views/base/uiDefineVO.js
@@ -1828,7 +1828,7 @@
          "copyFromVersion": null,
          "createTime": null,
          "creator": null,
          "customClass": "test2:processreview#DepartmentProcessReview_web?param=xxx",
          "customClass": "bs=test2?type=processreview&context=DepartmentProcessReview_web&param=xxx",
          "data": null,
          "description": "",
          "extendAttr": "",
@@ -2883,7 +2883,7 @@
          "copyFromVersion": null,
          "createTime": null,
          "creator": null,
          "customClass": "test:processreview#DepartmentProcessReview_web?param=xxx",
          "customClass": "bs=?type=processreview&context=DepartmentProcessReview_web&param=xxx",
          "data": null,
          "description": "",
          "extendAttr": "",
Source/ProjectWeb/src/views/custom-ui/test.vue
Source/ProjectWeb/src/views/custom-ui/test2.vue