jinlin
2024-01-10 cdf29a8f6fb9990f82ccc1d3f47bfba48cfaf4fc
web/src/components/config-uploader/src/config-uploader.vue
@@ -69,6 +69,10 @@
    name: 'ConfigUploader',
    components: {},
    props: {
      busiTypeVarName: {
        type : String,
        default:'files'
      },
      lineHeight:{
        type:Boolean,
        default:false
@@ -86,9 +90,9 @@
    computed: {
      fields() {
        let arr = []
        if (this.dataForm.files && this.dataForm.files.groups) {
        if (this.value && this.value.groups) {
          console.log(this.dataForm,"fields this.dataForm")
          this.dataForm.files.groups.forEach(group => {
          this.value.groups.forEach(group => {
            group.fields.forEach(field => {
              let arrType = []
              if (field.fileTypes) {
@@ -109,9 +113,8 @@
            ...this.getOss(),
            ...(val || {})
          }
          // this.dataForm.files = this.oss
          this.$set(this.dataForm, 'files', this.oss)
          this.$set(this.dataForm, this.busiTypeVarName, this.oss)
          console.log(this.fields, 'watch this.fields')
          // 分解到每个字段给dataForm赋值
          this.fields.forEach(field => {
            // this.dataForm[field.busiField] = field.files
@@ -126,8 +129,7 @@
        this.oss.groups.forEach(group => {
          this.activeNames.push(group.busiFieldGroup)
        })
        // this.dataForm.files = this.oss
        this.$set(this.dataForm, 'files', this.oss)
        this.$set(this.dataForm, this.busiTypeVarName, this.oss)
      }
    },
    methods: {
@@ -156,7 +158,11 @@
        }
      },
      change(busiField) {
        console.log(busiField, 'config_uploader change(busiField) busiField')
        console.log(busiField,this.uploadList, 'config_uploader change(busiField) busiField')
        console.log(this.fields, 'change this.fields')
        if (!Array.isArray(this.dataForm[busiField])) {
          this.$set(this.dataForm, busiField, [])
        }
        this.fields.forEach(field => {
          if (field.busiField === busiField) {
            field.files.length = 0
@@ -167,6 +173,7 @@
            if (this.dataForm) {
              this.dataForm.hasUploadFinsh = 100
            }
            console.log(this.dataForm[busiField], 'config_uploader change(busiField) this.dataForm[busiField]')
          }
        })
        console.log(this.dataForm, 'config_uploader change(busiField)')