6
jinlin
2023-12-04 35d048aa5c0eecd6a737c04278779b0720b0e3db
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: {
@@ -157,6 +159,7 @@
      },
      change(busiField) {
        console.log(busiField, 'config_uploader change(busiField) busiField')
        console.log(this.fields, 'change this.fields')
        this.fields.forEach(field => {
          if (field.busiField === busiField) {
            field.files.length = 0