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