| | |
| | | name: 'ConfigUploader', |
| | | components: {}, |
| | | props: { |
| | | busiTypeVarName: { |
| | | type : String, |
| | | default:'files' |
| | | }, |
| | | lineHeight:{ |
| | | type:Boolean, |
| | | default:false |
| | |
| | | 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) { |
| | |
| | | ...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 |
| | |
| | | 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: { |
| | |
| | | }, |
| | | 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 |