修改完成

This commit is contained in:
2026-09-13 19:41:13 +08:00
parent 15b301b358
commit d040507cb8
27 changed files with 2238 additions and 551 deletions
+6 -3
View File
@@ -166,6 +166,7 @@
if (latitude !== undefined) body.latitude = latitude;
else body.invalidLatitude = true;
}
if (source.coverOssId === null) body.coverOssId = null;
if (source.coverOssId !== undefined && source.coverOssId !== null && source.coverOssId !== '') {
if (coverOssId) body.coverOssId = coverOssId;
else body.invalidCoverOssId = true;
@@ -615,7 +616,7 @@
function getFormValues(form) {
var values = {};
queryAll('[name]', form).forEach(function (field) { values[field.name] = field.value; });
queryAll('[name]', form).forEach(function (field) { values[field.name] = root.AttachmentEditor ? root.AttachmentEditor.readField(field) : field.value; });
return values;
}
@@ -630,7 +631,7 @@
var contentEditor;
if (!ceremony || ceremony.status !== '0') throw new Error('停用活动无法通过当前 PC 接口重新读取或编辑');
['ceremonyType', 'ceremonyTitle', 'ceremonyDesc', 'location', 'locationAddress', 'longitude', 'latitude', 'coverOssId', 'sortOrder'].forEach(function (name) {
['ceremonyType', 'ceremonyTitle', 'ceremonyDesc', 'location', 'locationAddress', 'longitude', 'latitude', 'sortOrder'].forEach(function (name) {
setFieldValue('[data-ceremony-form]', name, ceremony[name]);
});
setFieldValue('[data-ceremony-form]', 'ceremonyTime', toDateTimeInputValue(ceremony.ceremonyTime));
@@ -662,9 +663,11 @@
await loadCapability(api, genealogyId);
if (!canEditContent) throw { status: 403, message: '当前账号无权维护该家谱的祭祀活动。' };
if (ceremonyId) {
ceremony = normalizeCeremony(await api.ceremonyDetail(genealogyId, ceremonyId));
var ceremonyResponse = await api.ceremonyDetail(genealogyId, ceremonyId);
ceremony = normalizeCeremony(ceremonyResponse);
if (!ceremony || ceremony.ceremonyId !== ceremonyId) throw new Error('活动详情响应缺少稳定 ceremonyId');
fillCeremonyForm(ceremony);
root.AttachmentEditor.setFiles('#giftCoverOssId', ceremonyResponse.coverFile ? [ceremonyResponse.coverFile] : []);
if (query('[data-ceremony-editor-title]')) query('[data-ceremony-editor-title]').textContent = '编辑祭祀活动';
}
setEditorEnabled(true);