ludc
2024-11-14 76b8440971955fa1ad27f37d263746baa6dca3a2
Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue
@@ -1,6 +1,6 @@
<template>
  <!--动态模板-->
  <avue-form ref="form" :option="option" v-model="form">
  <avue-form ref="form" :option="option" v-model="form" v-loading="loading">
    <template v-for="item in allColumn" :slot="item.prop+ ''">
      <vciWebRefer
        v-if="item.type === 'refer'"
@@ -83,6 +83,7 @@
  },
  data() {
    return {
      loading:false,
      form: this.formData,
      option: {
        menuBtn:false,
@@ -121,6 +122,7 @@
          Object.assign(this.form, this.initValue);
        }
      },
      deep:true,
      immediate: true,
    },
    formData: {
@@ -185,13 +187,14 @@
    initItem(item){
      const type=this.columnType[item.type] || item.type;
      item.text=item.text || item.label;
      const col= {
      let col= {
        ...item,
        label: item.text,
        prop: item.field,
        showProp:item.showField,
        type: type,
        labelWidth: this.labelWidth || (item.text.length >= 6 ? 115 : 90),
        disabled: !this.isEdit || item.readOnly || this.disabled,
        disabled: item.readOnly || this.disabled,
        span: item.span
          ? item.span
          : item.type === "textarea"
@@ -221,11 +224,11 @@
          required: item.required|| false,
          message: `请输入${item.text}!`,
          trigger: "submit"
        }]):[],
        ...item
        }]):[]
      };
      if(!this.isEdit){
        col.placeholder=col.label;
        col.disabled=true;
      }
      if(col.type === 'richText'){
        this.subitemName = col.field;