| | |
| | | deleteToolType, |
| | | exportToolType, |
| | | getToolTypePage, |
| | | importToolType, |
| | | importToolTypeTemplate, |
| | | } from '#/api/mes/tm/tool/type'; |
| | | import { $t } from '#/locales'; |
| | | |
| | | import ImportModalComponent from '#/components/import-modal'; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from './data'; |
| | | import Form from './modules/form.vue'; |
| | |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | | const [ImportModal, importModalApi] = useVbenModal({ |
| | | connectedComponent: ImportModalComponent, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | | /** 刷新表格 */ |
| | | function handleRefresh() { |
| | | gridApi.query(); |
| | | } |
| | | |
| | | /** 导入工具类型 */ |
| | | function handleImport() { |
| | | importModalApi |
| | | .setData({ |
| | | title: $t('ui.actionTitle.import', ['工具类型']), |
| | | fileName: '工具类型导入模板.xls', |
| | | importFn: importToolType, |
| | | templateFn: importToolTypeTemplate, |
| | | }) |
| | | .open(); |
| | | } |
| | | |
| | | /** 创建工具类型 */ |
| | |
| | | |
| | | <template> |
| | | <Page auto-content-height><FormModal @success="handleRefresh" /> |
| | | <ImportModal @success="handleRefresh" /> |
| | | <Grid table-title="工具类型列表"> |
| | | <template #toolbar-tools> |
| | | <TableAction |
| | |
| | | auth: ['mes:tm-tool-type:export'], |
| | | onClick: handleExport, |
| | | }, |
| | | { |
| | | label: $t('ui.actionTitle.import', ['工具类型']), |
| | | type: 'primary', |
| | | icon: ACTION_ICON.UPLOAD, |
| | | auth: ['mes:tm-tool-type:import'], |
| | | onClick: handleImport, |
| | | }, |
| | | ]" |
| | | /> |
| | | </template> |