wangting
2024-04-29 33855a1961d581727cfbf59230085e6b95cc549c
Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue
@@ -1,15 +1,18 @@
<template>
  <div :id="'UI-dynamic-'+areasName+componentVO.oid" class="UI-dynamic">
    <dynamic-button v-if="componentVO && componentVO.buttons" :componentVO="componentVO" :butttonList="componentVO.buttons" :dataStore="[form]" :sourceData="sourceData" type="form"></dynamic-button>
    <basic-form :span="this.componentVO.formDefineVO.columnOneRow?(24/this.componentVO.formDefineVO.columnOneRow) : 12"
    <dynamic-button v-if="componentVO && componentVO.buttons" :key="areasName+'buttons-'+componentVO.oid"
                    :componentVO="componentVO" :butttonList="componentVO.buttons" :dataStore="[form]" :sourceData="sourceData" type="form"></dynamic-button>
    <basic-form :key="areasName+'basicForm-'+componentVO.oid"
                :span="this.componentVO.formDefineVO.columnOneRow?(24/this.componentVO.formDefineVO.columnOneRow) : 12"
                :formItems="this.componentVO.formDefineVO && this.componentVO.formDefineVO.items"
                :disabled="!inDialog"
                :isEdit="canEdit"
                :formData="form">
    </basic-form>
  </div>
</template>
<script>
import {dataForm} from "@/api/base/ui";
export default {
@@ -30,6 +33,11 @@
    inDialog: {
      type: Boolean,
      default: false
    },
    canEdit:{
      //内容是否可编辑
      type:Boolean,
      default:false
    },
    areasName: {
      type: String,
@@ -128,8 +136,6 @@
        btmname: this.currentDefineVO.btmType,
        btmType:this.currentDefineVO.btmType,
        formDefineId: this.currentDefineVO.id,
        componentOid: this.componentVO.oid,
        uiDefineId: this.uiContext,
        oid:this.currentDefineVO.oid
      };
      if(this.dataStore[0] && this.dataStore[0].oid) {
@@ -138,8 +144,10 @@
      const sourceDataMapList = this.sourceDataMapParams;
      this.params = Object.assign({},formParams, sourceDataMapList);
      console.log(this.params)
    },
    onLoad:function () {
      debugger;
      if (Object.keys(this.sourceData).length>0 && this.isShow) {
        this.loading = true;
        dataForm(this.params).then(res => {
@@ -151,8 +159,9 @@
        });
      }
    },
    handleRefresh(){
    handleRefresh() {
      this.form={}
      this.onLoad();
    }
  }
}