perf: doc2x plugins (#3162)

This commit is contained in:
Archer
2024-11-14 21:56:13 +08:00
committed by GitHub
parent be59c2f6a7
commit 3f72f88591
10 changed files with 158 additions and 285 deletions

View File

@@ -215,6 +215,7 @@ const FieldEditModal = ({
);
const onSubmitError = useCallback(
(e: Object) => {
console.log('e', e);
for (const item of Object.values(e)) {
if (item.message) {
toast({

View File

@@ -511,22 +511,14 @@ const InputTypeConfig = ({
<FormLabel flex={'0 0 132px'} fontWeight={'medium'}>
{t('app:document_upload')}
</FormLabel>
<Switch
{...register('canSelectFile', {
required: true
})}
/>
<Switch {...register('canSelectFile')} />
</Flex>
<Box w={'full'} minH={'40px'}>
<Flex alignItems={'center'}>
<FormLabel flex={'0 0 132px'} fontWeight={'medium'}>
{t('app:image_upload')}
</FormLabel>
<Switch
{...register('canSelectImg', {
required: true
})}
/>
<Switch {...register('canSelectImg')} />
</Flex>
<Flex color={'myGray.500'}>
<Box fontSize={'xs'}>{t('app:image_upload_tip')}</Box>

View File

@@ -115,6 +115,16 @@ const NodeCard = (props: Props) => {
}
},
{
onSuccess(res) {
if (!res) return;
// Execute forcibly updates the courseUrl field
onChangeNode({
nodeId,
type: 'attr',
key: 'courseUrl',
value: res?.courseUrl
});
},
manual: false
}
);