feat: 导入调整

This commit is contained in:
caiyuchao
2025-08-25 10:48:46 +08:00
parent 41bc7d149e
commit 6e0409bd42
4 changed files with 22 additions and 17 deletions

View File

@@ -150,13 +150,13 @@ const [Grid, gridApi] = useVbenVxeGrid({
auth: ['license:customer:export'], auth: ['license:customer:export'],
onClick: onExport, onClick: onExport,
}, },
{ // {
label: $t('ui.actionTitle.import', [$t('customer.customer')]), // label: $t('ui.actionTitle.import', [$t('customer.customer')]),
type: 'primary', // type: 'primary',
icon: ACTION_ICON.UPLOAD, // icon: ACTION_ICON.UPLOAD,
auth: ['license:customer:import'], // auth: ['license:customer:import'],
onClick: handleImport, // onClick: handleImport,
}, // },
]" ]"
/> />
</template> </template>

View File

@@ -96,7 +96,7 @@ const columns = [
color: 'red', color: 'red',
}, },
}, },
` ${data.value.new}`, ` ${data.value.new ? '→' : ''} ${data.value.new}`,
); );
return h('div', {}, [data.value.old, after]); return h('div', {}, [data.value.old, after]);
} }
@@ -210,7 +210,9 @@ const handleUpload = async (record: any) => {
</template> </template>
<template <template
v-else-if=" v-else-if="
props.formData?.status === 3 && props.formData?.showUpload props.formData?.status === 3 &&
props.formData?.showUpload &&
false
" "
> >
<div <div

View File

@@ -97,6 +97,9 @@ export function useFormSchema(): VbenFormSchema[] {
}, },
dependencies: { dependencies: {
trigger(values, form) { trigger(values, form) {
if (values.id) {
return;
}
const projectCode = projectList.value.find((project) => { const projectCode = projectList.value.find((project) => {
return project.id === values.projectId; return project.id === values.projectId;
})?.code; })?.code;
@@ -109,7 +112,7 @@ export function useFormSchema(): VbenFormSchema[] {
); );
}, },
// 只有指定的字段改变时,才会触发 // 只有指定的字段改变时,才会触发
triggerFields: ['customerId', 'projectId'], triggerFields: ['customerId', 'projectId', 'id'],
}, },
rules: z.string().refine( rules: z.string().refine(
async (value: string) => { async (value: string) => {

View File

@@ -171,13 +171,13 @@ const [Grid, gridApi] = useVbenVxeGrid({
auth: ['license:project:export'], auth: ['license:project:export'],
onClick: onExport, onClick: onExport,
}, },
{ // {
label: $t('ui.actionTitle.import', [$t('project.project')]), // label: $t('ui.actionTitle.import', [$t('project.project')]),
type: 'primary', // type: 'primary',
icon: ACTION_ICON.UPLOAD, // icon: ACTION_ICON.UPLOAD,
auth: ['license:project:import'], // auth: ['license:project:import'],
onClick: handleImport, // onClick: handleImport,
}, // },
]" ]"
/> />
</template> </template>