修复上传时问题
This commit is contained in:
parent
c32efbf3ac
commit
aa9ad3f045
|
|
@ -121,10 +121,17 @@ export default function VditorComponent(
|
|||
>
|
||||
{t('common::action.cancel')}
|
||||
</Button>
|
||||
<Commit
|
||||
entity={oakEntity}
|
||||
oakPath={oakFullpath}
|
||||
afterCommit={() => {
|
||||
{/* 如果没有被commit,是没有实际记录,所以无法关联到file,就无法点击 */}
|
||||
{isCreation ? (
|
||||
<Button
|
||||
type='primary'
|
||||
onClick={() => {
|
||||
if (!item.content) {
|
||||
message.error(
|
||||
t('error.contentCannotBeEmpty')
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (!item?.title) {
|
||||
message.error(
|
||||
t('error.titleCannotBeEmpty')
|
||||
|
|
@ -135,8 +142,36 @@ export default function VditorComponent(
|
|||
execute();
|
||||
navigateBack();
|
||||
}}
|
||||
>
|
||||
{t('common::action.save')}
|
||||
</Button>
|
||||
) : (
|
||||
<Commit
|
||||
entity={oakEntity}
|
||||
oakPath={oakFullpath}
|
||||
beforeCommit={() => {
|
||||
if (!item.content) {
|
||||
message.error(
|
||||
t('error.contentCannotBeEmpty')
|
||||
);
|
||||
return false;
|
||||
}
|
||||
if (!item?.title) {
|
||||
message.error(
|
||||
t('error.titleCannotBeEmpty')
|
||||
);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}}
|
||||
afterCommit={() => {
|
||||
setShowTitleEdit(false);
|
||||
execute();
|
||||
navigateBack();
|
||||
}}
|
||||
executeText={t('common::action.save')}
|
||||
></Commit>
|
||||
)}
|
||||
</div>
|
||||
}
|
||||
>
|
||||
|
|
@ -152,6 +187,7 @@ export default function VditorComponent(
|
|||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label={t('essay:attr.images')}>
|
||||
{item && (
|
||||
<Crop
|
||||
entity={oakEntity}
|
||||
entityId={item.id}
|
||||
|
|
@ -172,6 +208,7 @@ export default function VditorComponent(
|
|||
minWidth={1280}
|
||||
minHeight={720}
|
||||
></Crop>
|
||||
)}
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
|
|
|||
Loading…
Reference in New Issue