| | |
| | | import { message, Tag } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { deletePlan, getPlanPage, publishPlan } from '#/api/mes/pro/emergencyplan'; |
| | | import { |
| | | deletePlan, |
| | | getPlanPage, |
| | | importPlan, |
| | | importPlanTemplate, |
| | | publishPlan, |
| | | } from '#/api/mes/pro/emergencyplan'; |
| | | import ImportModalComponent from '#/components/import-modal'; |
| | | import { $t } from '#/locales'; |
| | | |
| | | import { PLAN_STATUS, useGridColumns, useGridFormSchema } from './data'; |
| | |
| | | |
| | | const [FormModal, formModalApi] = useVbenModal({ |
| | | connectedComponent: Form, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | | const [ImportModal, importModalApi] = useVbenModal({ |
| | | connectedComponent: ImportModalComponent, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | |
| | | await publishPlan(row.id!); |
| | | message.success('已发布'); |
| | | handleRefresh(); |
| | | } |
| | | |
| | | /** 导入应急处置预案 */ |
| | | function handleImport() { |
| | | importModalApi |
| | | .setData({ |
| | | title: $t('ui.actionTitle.import', ['应急处置预案']), |
| | | fileName: '应急处置预案导入模板.xls', |
| | | importFn: importPlan, |
| | | templateFn: importPlanTemplate, |
| | | }) |
| | | .open(); |
| | | } |
| | | |
| | | const checkedIds = ref<number[]>([]); |
| | |
| | | <template> |
| | | <Page auto-content-height> |
| | | <FormModal @success="handleRefresh" /> |
| | | <ImportModal @success="handleRefresh" /> |
| | | <Grid table-title="应急处置预案列表"> |
| | | <template #toolbar-tools> |
| | | <TableAction |
| | |
| | | onClick: handleCreate, |
| | | }, |
| | | { |
| | | label: $t('ui.actionTitle.import', ['应急处置预案']), |
| | | icon: ACTION_ICON.UPLOAD, |
| | | auth: ['mes:pro-emergency-plan:import'], |
| | | onClick: handleImport, |
| | | }, |
| | | { |
| | | label: '批量删除', |
| | | type: 'primary', |
| | | danger: true, |