| | |
| | | import { message } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { deleteForm, getFormPage } from '#/api/bpm/form'; |
| | | import { |
| | | deleteForm, |
| | | getFormPage, |
| | | importForm, |
| | | importFormTemplate, |
| | | } from '#/api/bpm/form'; |
| | | import { router } from '#/router'; |
| | | |
| | | import ImportModalComponent from '#/components/import-modal'; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from './data'; |
| | | import Detail from './modules/detail.vue'; |
| | | |
| | | defineOptions({ name: 'BpmForm' }); |
| | | |
| | | const [ImportModal, importModalApi] = useVbenModal({ |
| | | connectedComponent: ImportModalComponent, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | | /** 刷新表格 */ |
| | | function handleRefresh() { |
| | | gridApi.query(); |
| | | } |
| | | |
| | | /** 导入流程表单 */ |
| | | function handleImport() { |
| | | importModalApi |
| | | .setData({ |
| | | title: $t('ui.actionTitle.import', ['流程表单']), |
| | | fileName: '动态表单导入模板.xls', |
| | | importFn: importForm, |
| | | templateFn: importFormTemplate, |
| | | }) |
| | | .open(); |
| | | } |
| | | |
| | | /** 新增表单 */ |
| | |
| | | |
| | | <template> |
| | | <Page auto-content-height><DetailModal /> |
| | | <ImportModal @success="handleRefresh" /> |
| | | <Grid table-title="流程表单"> |
| | | <template #toolbar-tools> |
| | | <TableAction |
| | |
| | | auth: ['bpm:form:create'], |
| | | onClick: handleCreate, |
| | | }, |
| | | { |
| | | label: $t('ui.actionTitle.import', ['流程表单']), |
| | | type: 'primary', |
| | | icon: ACTION_ICON.UPLOAD, |
| | | auth: ['bpm:form:import'], |
| | | onClick: handleImport, |
| | | }, |
| | | ]" |
| | | /> |
| | | </template> |