ludc
2024-04-08 92f39340c7bce9a640ccf616290dae7888b93531
Merge remote-tracking branch 'origin/master'
已修改5个文件
130 ■■■■■ 文件已修改
Source/ProjectWeb/src/api/base/region.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/page/index/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/base/UIContentViewer.vue 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/api/base/region.js
@@ -51,3 +51,12 @@
  })
}
export const getUIContent = (query) => {
  return request({
    url: '/api/webUIController/getUIContentByBtmTypeAndId',
    method: 'get',
    params: query,
  });
}
Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue
@@ -81,8 +81,7 @@
  },
  data() {
    return {
      form: {},
      ruleForm:{}
      form: {}
    }
  },
  mounted() {
@@ -107,7 +106,7 @@
      },
      immediate: true,
    },
    ruleForm: {
    form: {
      handler(val) {
        if (val) {
          if (Array.isArray(val)) { // 检查 val 是否为数组
@@ -228,7 +227,7 @@
        if (code.type == "refer") {
          if (code.referConfig && code.referConfig.useFormKey) {
            if (verifyNull(code.referConfig.formValuesKey)) {
              code.referConfig.formValuesKey = "ruleForm";
              code.referConfig.formValuesKey = "form";
            }
            code.referConfig.formValues = this[code.referConfig.formValuesKey];
          }
@@ -249,8 +248,8 @@
    },
    setReferValue(data) {
      if (data && data.prop) {
        this.ruleForm[data.prop] = data.value || "";
        this.ruleForm[data.showProp] = data.text || "";
        this.form[data.prop] = data.value || "";
        this.form[data.showProp] = data.text || "";
        if (data.propMap) {
          //说明需要映射
          for (let key in data.propMap) {
@@ -278,7 +277,7 @@
                value.push(temp);
              }
            });
            this.ruleForm[key] = value.join(",");
            this.form[key] = value.join(",");
          }
        }
      }
Source/ProjectWeb/src/page/index/index.vue
@@ -66,7 +66,7 @@
  created() {
    //实时检测刷新token
    this.refreshToken();
    //this.refreshToken();
  },
  mounted() {
Source/ProjectWeb/src/views/base/UIContentViewer.vue
@@ -2,43 +2,47 @@
  <!--UI上下文的展示器-->
  <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"
      <UIContentArea :key="'northArea-'+uiDefineVO.oid" :areasData="uiDefineVO.northAreas"
                     :dataStore="checkedData.northArea"
                     :inDialog="inDialog"
                     :sourceData="sourceData"
                     :dataStore="checkedData.northArea"
                     areas-name="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' || uiDefineVO.westAreas[0].componentVOs[0].uiComponentType=='TreeTable'?'420px':'320px'" height="100%">
        <UIContentArea :key="'westArea-'+uiDefineVO.oid" areas-name="westArea"
                       cradStyle=""
                       :areasData="uiDefineVO.westAreas"
    <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' || uiDefineVO.westAreas[0].componentVOs[0].uiComponentType=='TreeTable'?'420px':'320px'"
                height="100%">
        <UIContentArea :key="'westArea-'+uiDefineVO.oid" :areasData="uiDefineVO.westAreas"
                       :dataStore="checkedData.westArea"
                       :inDialog="inDialog"
                       :sourceData="sourceData"
                       :dataStore="checkedData.westArea"
                       areas-name="westArea"
                       cradStyle=""
                       @setDataStore="setDataStore">
        </UIContentArea>
      </el-aside>
      <el-container style="height: 100%">
        <el-main v-if="uiDefineVO.centerAreas && uiDefineVO.centerAreas.length>0" :style="'height: '+centerHeight">
          <UIContentArea :key="'centerArea-'+uiDefineVO.oid" areas-name="centerArea"
                         cradStyle=""
                         :areasData="uiDefineVO.centerAreas"
          <UIContentArea :key="'centerArea-'+uiDefineVO.oid" :areasData="uiDefineVO.centerAreas"
                         :dataStore="checkedData.centerArea"
                         :inDialog="inDialog"
                         :sourceData="checkedData.westArea[checkedData.westArea.length-1]"
                         :dataStore="checkedData.centerArea"
                         areas-name="centerArea"
                         cradStyle=""
                         @setDataStore="setDataStore">
          </UIContentArea>
        </el-main>
        <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"
        <el-footer v-if="uiDefineVO.southAreas && uiDefineVO.southAreas.length>0" height="35%"
                   style="max-height: 300px">
          <UIContentArea :key="'southArea-'+uiDefineVO.oid" :areasData="uiDefineVO.southAreas"
                         :dataStore="checkedData.southArea"
                         :inDialog="inDialog"
                         :sourceData="checkedData.centerArea[checkedData.centerArea.length-1]"
                         :dataStore="checkedData.southArea"
                         areas-name="southArea"
                         cradStyle=""
                         @setDataStore="setDataStore">
          </UIContentArea>
        </el-footer>
@@ -48,9 +52,9 @@
</template>
<script>
import { verifyNull } from "@/util/validate";
import {verifyNull} from "@/util/validate";
import UIContentArea from "@/views/base/UIContentArea"
import {uiDefineVOData} from "@/views/base/uiDefineVO"
import {getUIContent} from '@/api/base/region'
export default {
  name: "UIContentViewer",
@@ -73,22 +77,37 @@
      sourceData: {},
    }
  },
  watch: {},
  computed: {},
  watch: {
    typeAContent:{
      handler(newV,oldV){
        if(oldV!=newV && !verifyNull(newV)){
          this.initUI();
        }
      },
      immediate: true,
    }
  },
  computed: {
    typeAContent(){
      return this.btmType+this.content;
    }
  },
  created() {
    if (verifyNull(this.$route.query.type) || (verifyNull(this.$route.query.context) && verifyNull(this.$route.query.content))) {
      this.$message.error("配置的信息错误,请参考bs=组件name?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();
    this.btmType = this.$route.query.type;
    this.content = this.$route.query.context || this.$route.query.content;
    this.sourceData = this.$route.query;
  },
  methods: {
    initUI() {
      this.uiDefineVO = uiDefineVOData;
      getUIContent({btmType: this.btmType, id: this.content}).then(res => {
        console.log(res.data.obj)
        this.uiDefineVO = res.data.obj;
        this.initContent();
      })
    },
    initContent() {
      if (this.uiDefineVO.southAreas && this.uiDefineVO.southAreas.length > 0) {
@@ -105,13 +124,15 @@
</script>
<style scoped>
.el-container{
.el-container {
  padding: 0 !important;
}
.el-header,.el-aside,.el-main,.el-footer{
.el-header, .el-aside, .el-main, .el-footer {
  padding: 0;
}
.el-header{
.el-header {
  margin-bottom: 10px;
}
</style>
Source/ProjectWeb/src/views/base/UIContentViewerInDialog.vue
@@ -53,8 +53,8 @@
<script>
import UIContentArea from "@/views/base/UIContentArea"
import {uiDefineVOData} from "@/views/base/uiDefineVOInDialog"
import {verifyNull} from "@/util/validate";
import {getUIContent} from '@/api/base/region'
export default {
  name: "UIContentViewerInDialog",
@@ -99,22 +99,33 @@
    }
  },
  watch: {
    typeAContent:{
      handler(newV,oldV){
        if(oldV!=newV && !verifyNull(newV)){
          this.initUI();
        }
      },
      immediate: true,
    }
  },
  computed: {
    typeAContent(){
      return this.btmType+this.content;
    }
  },
  created() {
    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() {
      this.uiDefineVO = uiDefineVOData;
      getUIContent({btmType: this.btmType, id: this.content}).then(res => {
        console.log(res.data.obj)
        this.uiDefineVO = res.data.obj;
        this.initContent();
      })
    },
    initContent() {
      if (this.uiDefineVO.southAreas && this.uiDefineVO.southAreas.length > 0) {