修复上传时问题
This commit is contained in:
parent
c32efbf3ac
commit
aa9ad3f045
|
|
@ -121,22 +121,57 @@ export default function VditorComponent(
|
|||
>
|
||||
{t('common::action.cancel')}
|
||||
</Button>
|
||||
<Commit
|
||||
entity={oakEntity}
|
||||
oakPath={oakFullpath}
|
||||
afterCommit={() => {
|
||||
if (!item?.title) {
|
||||
message.error(
|
||||
t('error.titleCannotBeEmpty')
|
||||
);
|
||||
return;
|
||||
}
|
||||
setShowTitleEdit(false);
|
||||
execute();
|
||||
navigateBack();
|
||||
}}
|
||||
executeText={t('common::action.save')}
|
||||
></Commit>
|
||||
{/* 如果没有被commit,是没有实际记录,所以无法关联到file,就无法点击 */}
|
||||
{isCreation ? (
|
||||
<Button
|
||||
type='primary'
|
||||
onClick={() => {
|
||||
if (!item.content) {
|
||||
message.error(
|
||||
t('error.contentCannotBeEmpty')
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (!item?.title) {
|
||||
message.error(
|
||||
t('error.titleCannotBeEmpty')
|
||||
);
|
||||
return;
|
||||
}
|
||||
setShowTitleEdit(false);
|
||||
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,26 +187,28 @@ export default function VditorComponent(
|
|||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label={t('essay:attr.images')}>
|
||||
<Crop
|
||||
entity={oakEntity}
|
||||
entityId={item.id}
|
||||
oakPath={`${oakFullpath}.extraFile$entity`}
|
||||
maxNumber={1}
|
||||
accept='image/*'
|
||||
tag1='cover'
|
||||
enableCrop
|
||||
showRest
|
||||
showGrid
|
||||
rotationSlider
|
||||
aspectSlider
|
||||
aspect={16 / 9}
|
||||
cropQuality={0.8}
|
||||
enableCompross
|
||||
maxWidth={1920}
|
||||
maxHeight={1080}
|
||||
minWidth={1280}
|
||||
minHeight={720}
|
||||
></Crop>
|
||||
{item && (
|
||||
<Crop
|
||||
entity={oakEntity}
|
||||
entityId={item.id}
|
||||
oakPath={`${oakFullpath}.extraFile$entity`}
|
||||
maxNumber={1}
|
||||
accept='image/*'
|
||||
tag1='cover'
|
||||
enableCrop
|
||||
showRest
|
||||
showGrid
|
||||
rotationSlider
|
||||
aspectSlider
|
||||
aspect={16 / 9}
|
||||
cropQuality={0.8}
|
||||
enableCompross
|
||||
maxWidth={1920}
|
||||
maxHeight={1080}
|
||||
minWidth={1280}
|
||||
minHeight={720}
|
||||
></Crop>
|
||||
)}
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
|
|
|||
Loading…
Reference in New Issue