diff --git a/src/views/manage/point/PointManage.vue b/src/views/manage/point/PointManage.vue index 6be67ea..7bab1d9 100644 --- a/src/views/manage/point/PointManage.vue +++ b/src/views/manage/point/PointManage.vue @@ -316,10 +316,15 @@ function OnFileListChange(files: UploadFileInfo[]) { } function onUpdateClick(item: ResponsePointGoodModel) { + const copiedItem = JSON.parse(JSON.stringify(item)) + // 确保 setting 对象存在 + if (!copiedItem.setting) { + copiedItem.setting = { + allowGuardLevel: 0, + } + } currentGoodsModel.value = { - goods: JSON.parse(JSON.stringify({ - ...item, - })), + goods: copiedItem, fileList: item.cover ? [ { @@ -949,6 +954,9 @@ onMounted(() => { }) :checked="currentGoodsModel.goods.setting?.guardFree != undefined" @update:checked=" (v) => { + if (!currentGoodsModel.goods.setting) { + currentGoodsModel.goods.setting = { allowGuardLevel: 0 }; + } // @ts-ignore currentGoodsModel.goods.setting.guardFree = v ? { year: undefined, month: undefined } : undefined; } @@ -978,12 +986,22 @@ onMounted(() => { }) :gap="8" > @@ -1009,7 +1027,15 @@ onMounted(() => { }) - + 不限