|
|
@@ -373,21 +373,23 @@ const getConfig = async (typeValue)=>{
|
|
|
formData[item] = resultPHP.data.configs[item]
|
|
|
})
|
|
|
|
|
|
- console.log(formData);
|
|
|
const presetSizes = mainImageSizeList.value.map(item => item.value);
|
|
|
const receivedSizes = formData.basic_configs.main_image_size ? [...formData.basic_configs.main_image_size] : [];
|
|
|
|
|
|
// 分离自定义值
|
|
|
const customValues = receivedSizes.filter(v => !presetSizes.includes(v));
|
|
|
- if (customValues.length > 0) {
|
|
|
+ if (customValues.length > 0 && activeIndex.value == 0) {
|
|
|
customInput.value = customValues[0]; // 保留第一个自定义值
|
|
|
// 更新选中状态
|
|
|
+ console.log('111')
|
|
|
formData.basic_configs.main_image_size = receivedSizes
|
|
|
.filter(v => presetSizes.includes(v))
|
|
|
.concat('custom');
|
|
|
} else {
|
|
|
+ console.log('222')
|
|
|
formData.basic_configs.main_image_size = receivedSizes;
|
|
|
}
|
|
|
+ console.log(formData.basic_configs.main_image_size);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -460,9 +462,7 @@ const saveSetting = async (index) => {
|
|
|
if(! cameraConfigRef.value.save()) return false;
|
|
|
}
|
|
|
}
|
|
|
- const submitData = {
|
|
|
- ...formData
|
|
|
- };
|
|
|
+ const submitData = JSON.parse(JSON.stringify(formData));
|
|
|
if(index === 0) {
|
|
|
if (formData.basic_configs.main_image_size.length === 0) {
|
|
|
ElMessage.error('请选择主图尺寸!');
|