feat: 客户管理和项目管理导入支持
This commit is contained in:
@@ -20,6 +20,7 @@ import { $t } from '#/locales';
|
||||
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
import Form from './modules/form.vue';
|
||||
import ImportForm from './modules/import-form.vue';
|
||||
import Progress from './modules/progress.vue';
|
||||
|
||||
const [FormModal, formModalApi] = useVbenModal({
|
||||
@@ -32,6 +33,11 @@ const [ProgressDrawer, progressDrawerApi] = useVbenDrawer({
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
const [ImportModal, importModalApi] = useVbenModal({
|
||||
connectedComponent: ImportForm,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
/** 刷新表格 */
|
||||
function onRefresh() {
|
||||
gridApi.query();
|
||||
@@ -78,6 +84,11 @@ async function onExport() {
|
||||
});
|
||||
}
|
||||
|
||||
/** 导入项目 */
|
||||
function handleImport() {
|
||||
importModalApi.open();
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
function onActionClick({ code, row }: OnActionClickParams<ProjectApi.Project>) {
|
||||
switch (code) {
|
||||
@@ -139,6 +150,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
<Page auto-content-height>
|
||||
<FormModal @success="onRefresh" />
|
||||
<ProgressDrawer @success="onRefresh" />
|
||||
<ImportModal @success="onRefresh" />
|
||||
|
||||
<Grid :table-title="$t('project.list')">
|
||||
<template #toolbar-tools>
|
||||
@@ -158,6 +170,13 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
auth: ['license:project:export'],
|
||||
onClick: onExport,
|
||||
},
|
||||
{
|
||||
label: $t('ui.actionTitle.import', [$t('project.project')]),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.UPLOAD,
|
||||
auth: ['license:project:export'],
|
||||
onClick: handleImport,
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user