From c8d8a511f45c96ed3a5123a88e48de2ffdbf632a Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期日, 03 十二月 2023 20:00:47 +0800
Subject: [PATCH] 6
---
web/src/components/config-uploader/src/config-uploader.vue | 27 ++++++++++++++++++++-------
1 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/web/src/components/config-uploader/src/config-uploader.vue b/web/src/components/config-uploader/src/config-uploader.vue
index 1e5fe8e..bae704a 100644
--- a/web/src/components/config-uploader/src/config-uploader.vue
+++ b/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>
@@ -82,13 +82,13 @@
fields() {
let arr = []
if (this.dataForm.files && this.dataForm.files.groups) {
+ console.log(this.dataForm,"fields this.dataForm")
this.dataForm.files.groups.forEach(group => {
group.fields.forEach(field => {
let arrType = []
if (field.fileTypes) {
arrType = field.fileTypes.split(',')
}
- //this.$set(field, 'fileTypeArr', arrType)
field.fileTypeArr = arrType
arr.push(field)
})
@@ -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>
--
Gitblit v1.9.1