fix: 修复前端若干类型报错

This commit is contained in:
ah--desktop
2026-03-31 23:44:37 +08:00
parent 7f5803ddda
commit 6b434fbf63
38 changed files with 383 additions and 1981 deletions
@@ -14,9 +14,7 @@ import {
deleteImportMappingApi,
getImportMappingPageApi,
} from '#/api/ecommerce/import-mapping';
import {
ImportMappingType,
} from '#/api/ecommerce/import-mapping/types/types.enum';
import { ImportMappingType } from '#/api/ecommerce/import-mapping/types/types.enum';
import ImportMappingFormModal from '../import-mapping/components/ImportMappingFormModal.vue';
@@ -30,7 +28,12 @@ const formModalRef = ref();
const gridOptions: VxeGridProps<any> = {
columns: [
{ type: 'seq', width: 80, title: '序号' },
{ field: 'name', title: '模板名称', minWidth: 'auto', showOverflow: 'tooltip' },
{
field: 'name',
title: '模板名称',
minWidth: 'auto',
showOverflow: 'tooltip',
},
{ field: 'type', title: '类型', width: 120, slots: { default: 'type' } },
{
title: '映射字段数',
@@ -65,7 +68,7 @@ const gridOptions: VxeGridProps<any> = {
filters: { type: ImportMappingType.ORDER },
});
return { items: result.records || [], total: result.total || 0 };
} catch (error) {
} catch {
message.error('获取字段映射模板列表失败');
return { items: [], total: 0 };
} finally {
@@ -76,7 +79,11 @@ const gridOptions: VxeGridProps<any> = {
},
};
const [Grid, gridApi] = useVbenVxeGrid({ gridOptions, showSearchForm: false, tableTitle: '字段映射模板' });
const [Grid, gridApi] = useVbenVxeGrid({
gridOptions,
showSearchForm: false,
tableTitle: '字段映射模板',
});
function refresh() {
gridApi?.reload();
@@ -95,7 +102,7 @@ async function handleDelete(row: ImportMappingVO.ImportMappingInfoVO) {
await deleteImportMappingApi(row.id);
message.success('删除成功');
refresh();
} catch (error) {
} catch {
message.error('删除失败');
}
}
@@ -141,7 +148,9 @@ function getTypeName(type: ImportMappingType): string {
<Tag color="blue">{{ getTypeName(row.type) }}</Tag>
</template>
<template #mappingCount="{ row }: { row: ImportMappingVO.ImportMappingInfoVO }">
<template
#mappingCount="{ row }: { row: ImportMappingVO.ImportMappingInfoVO }"
>
<Tag color="green">{{ getMappingCount(row.mapping) }} 个字段</Tag>
</template>