修改完成
This commit is contained in:
@@ -124,7 +124,7 @@
|
||||
if (recordContent !== undefined) body.recordContent = recordContent;
|
||||
if (recordDate !== undefined) body.recordDate = recordDate;
|
||||
if (remindTime !== undefined) body.remindTime = remindTime;
|
||||
if (mediaOssIds !== undefined) body.mediaOssIds = mediaOssIds;
|
||||
if (source.mediaOssIds !== undefined) body.mediaOssIds = mediaOssIds || '';
|
||||
if (sortOrderText !== undefined) {
|
||||
body.sortOrder = toSafeInteger(sortOrderText);
|
||||
if (body.sortOrder === undefined) body.invalidSortOrder = true;
|
||||
@@ -136,7 +136,7 @@
|
||||
function validateGrowthRecordBody(body) {
|
||||
if (!body || !body.recordTitle) return '请填写记录标题';
|
||||
if (body.lineagePersonId !== undefined && !normalizeId(body.lineagePersonId)) return '请选择有效的世系人物';
|
||||
if (body.mediaOssIds !== undefined && !/^[1-9][0-9]*(,[1-9][0-9]*)*$/.test(body.mediaOssIds)) {
|
||||
if (body.mediaOssIds !== undefined && body.mediaOssIds !== '' && !/^[1-9][0-9]*(,[1-9][0-9]*)*$/.test(body.mediaOssIds)) {
|
||||
return '附件上传结果无效';
|
||||
}
|
||||
if (body.invalidSortOrder || (Object.prototype.hasOwnProperty.call(body, 'sortOrder') && !Number.isSafeInteger(body.sortOrder))) {
|
||||
@@ -554,7 +554,6 @@
|
||||
setFieldValue('recordContent', record.recordContent);
|
||||
setFieldValue('recordDate', toDateInputValue(record.recordDate));
|
||||
setFieldValue('remindTime', toDateTimeInputValue(record.remindTime));
|
||||
setFieldValue('mediaOssIds', record.mediaOssIds);
|
||||
setFieldValue('sortOrder', record.sortOrder);
|
||||
setFieldValue('status', '0');
|
||||
contentField = query('[data-growth-form] [name="recordContent"]');
|
||||
@@ -564,11 +563,6 @@
|
||||
editorInstance.editor.setHtml(record.recordContent || '');
|
||||
}
|
||||
}
|
||||
if (query('[data-growth-media-status]')) {
|
||||
query('[data-growth-media-status]').textContent = record.mediaOssIds
|
||||
? '已保留 ' + attachmentCount(record.mediaOssIds) + ' 个附件,可继续选择追加'
|
||||
: '未选择文件';
|
||||
}
|
||||
}
|
||||
|
||||
function applyLineageOptions(data, selectedId, fallbackName) {
|
||||
@@ -603,6 +597,7 @@
|
||||
applyLineageOptions(result[0], record && record.lineagePersonId, record && record.lineagePersonName);
|
||||
if (record) {
|
||||
fillGrowthForm(record);
|
||||
root.AttachmentEditor.setFiles('#growthMediaOssIds', result[1].mediaFiles || []);
|
||||
if (query('[data-growth-editor-title]')) query('[data-growth-editor-title]').textContent = '编辑成长记录';
|
||||
}
|
||||
setEditorEnabled(true);
|
||||
@@ -683,13 +678,7 @@
|
||||
}
|
||||
|
||||
function clearMediaSelection() {
|
||||
var target = query('[data-growth-form] [name="mediaOssIds"]');
|
||||
var status = query('[data-growth-media-status]');
|
||||
var fileInput = query('[data-growth-media-input]');
|
||||
|
||||
if (target) target.value = '';
|
||||
if (fileInput) fileInput.value = '';
|
||||
if (status) status.textContent = '未选择文件';
|
||||
root.AttachmentEditor.clear('#growthMediaOssIds');
|
||||
}
|
||||
|
||||
function bindActions() {
|
||||
|
||||
Reference in New Issue
Block a user