| | |
| | | |
| | | import { computed, ref } from 'vue'; |
| | | |
| | | import { isAiEnable } from '@vben/hooks'; |
| | | |
| | | import { confirm, Page, useVbenModal } from '#/packages/effects/common-ui/src'; |
| | | import { downloadFileFromBlobPart, isEmpty } from '#/packages/utils/src'; |
| | | |
| | |
| | | import { $t } from '#/locales'; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from './data'; |
| | | import AgentImport from './modules/agent-import.vue'; |
| | | import Form from './modules/form.vue'; |
| | | import ImportForm from './modules/import-form.vue'; |
| | | |
| | |
| | | |
| | | const [ImportModal, importModalApi] = useVbenModal({ |
| | | connectedComponent: ImportForm, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | | const [AgentImportModal, agentImportModalApi] = useVbenModal({ |
| | | connectedComponent: AgentImport, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | |
| | | importModalApi.open(); |
| | | } |
| | | |
| | | /** 智能体导入物料 */ |
| | | function handleAgentImport() { |
| | | agentImportModalApi.open(); |
| | | } |
| | | |
| | | /** 工具栏按钮:智能体导入受 AI 总开关控制 */ |
| | | /** 工具栏按钮 */ |
| | | const toolbarActions = computed(() => [ |
| | | { |
| | | label: $t('ui.actionTitle.create', ['物料']), |
| | |
| | | auth: ['mdm:item:import'], |
| | | onClick: handleImport, |
| | | }, |
| | | ...(isAiEnable() |
| | | ? [ |
| | | { |
| | | label: '智能体导入', |
| | | type: 'primary' as const, |
| | | icon: ACTION_ICON.UPLOAD, |
| | | auth: ['mdm:item:import'], |
| | | onClick: handleAgentImport, |
| | | }, |
| | | ] |
| | | : []), |
| | | { |
| | | label: $t('ui.actionTitle.export'), |
| | | type: 'primary' as const, |
| | |
| | | <Page auto-content-height> |
| | | <FormModal @success="handleRefresh" /> |
| | | <ImportModal @success="handleRefresh" /> |
| | | <AgentImportModal @success="handleRefresh" /> |
| | | <Grid table-title="物料列表"> |
| | | <template #toolbar-tools> |
| | | <TableAction :actions="toolbarActions" /> |