6
jinlin
2023-12-01 68981c58ea61ff4edc0479facfb8b76181d2a582
web/src/components/config-uploader/src/config-uploader.vue
@@ -27,7 +27,7 @@
        </el-table>
      </el-collapse-item>
    </el-collapse>
    <div v-else class="config-uploader" v-model="activeNames" >
    <div v-else class="config-uploader" v-model="activeNames">
      <div v-for="group in (oss.groups || [])" :key="group.busiFieldGroup">
        <!-- <zt-form-item :label="field.busiFieldName" :prop="field.busiField" v-for="field in group.fields"
                       :key="field.busiField" :rules="field.isRequired ? 'required':''" style="width: 100%;">
@@ -53,7 +53,7 @@
              <zt-uploader v-model="dataForm[scope.row.busiField]" :dataForm="dataForm" multiple
                           :limit="scope.row.fileLimit" :file-type="scope.row.fileTypeArr"
                           :showFileList2="false" :accept="scope.row.accept" :file-size="scope.row.fileSize"
                           @input="change(scope.row.busiField)"/>
                           @input="change(scope.row.busiField)" @getUploaderImg="getUploaderImg"/>
            </template>
          </el-table-column>
        </el-table>
@@ -139,21 +139,33 @@
              field.fileTypeArr = arrType
            })
          })
          console.log(JSON.parse(JSON.stringify(arr[0])),'JSON.parse(JSON.stringify(arr[0]))')
          console.log(JSON.parse(JSON.stringify(arr[0])), 'JSON.parse(JSON.stringify(arr[0]))')
          return JSON.parse(JSON.stringify(arr[0]))
        }
        return null
      },
      getUploaderImg(list) {
        // this.imageList = list
        if (list[0].url) {
          this.$emit('getImageUrl', list[0].url)
        }
      },
      change(busiField) {
        console.log(busiField, 'config_uploader change(busiField) busiField')
        this.fields.forEach(field => {
          if (field.busiField === busiField) {
            field.files.length = 0
            this.dataForm[busiField].forEach(file => field.files.push(file))
            this.dataForm[busiField].forEach(file => {
                field.files.push(file)
              }
            )
            if (this.dataForm) {
              this.dataForm.hasUploadFinsh = 100
            }
          }
        })
        console.log(this.dataForm, 'config_uploader change(busiField)')
        this.$emit('getImageUrl')
      }
    }
  }
@@ -162,7 +174,8 @@
  .config-uploader label {
    width: 260px !important;
  }
   .zt .el-upload-list__item .el-progress{
    top:15px !important;
  .zt .el-upload-list__item .el-progress {
    top: 15px !important;
  }
</style>