新增:优化单张图片

pull/57/head
李强 2022-05-16 09:38:03 +08:00
parent be5b443d01
commit dcb96daafb
2 changed files with 7 additions and 4 deletions

View File

@ -36,7 +36,10 @@ def _get_all_system_config():
system_config_obj = SystemConfig.objects.filter(status=True, parent_id__isnull=False).values(
'parent__key', 'key', 'value', 'form_item_type').order_by('sort')
for system_config in system_config_obj:
data[f"{system_config.get('parent__key')}.{system_config.get('key')}"] = system_config.get('value') or ''
value = system_config.get('value') or ''
if value and system_config.get('form_item_type') == 7:
value = value[0].get('url')
data[f"{system_config.get('parent__key')}.{system_config.get('key')}"] = value
return data

View File

@ -7,7 +7,7 @@
</el-row>
<el-form ref="form" :model="form" label-width="140px" label-position="left" style="margin-top: 20px">
<el-form-item :label="item.title" :prop="['array'].indexOf(item.form_item_type_label) >-1?'':item.key"
:key="index" :rules="item.rule"
:key="index" :rules="item.rule || []"
v-for="(item,index) in formList"
>
@ -118,7 +118,7 @@
:on-error="handleError"
:on-exceed="handleExceed"
:before-remove="(file, fileList)=>{beforeRemove(file, fileList, item.key)}"
:limit="item.form_item_type_label==='img'?1:5"
:limit="5"
:ref="'fileUpload_'+item.key"
:data-keyname="item.key"
:file-list="item.value"
@ -416,7 +416,7 @@ export default {
this.$message.error('只允许上传图片')
} else {
const uploadImgKey = that.form[imgKey]
if (!uploadImgKey) {
if (!uploadImgKey || uploadImgKey === '') {
that.form[imgKey] = []
}
// console.log(len)