| | |
| | | <div> |
| | | <BasicTable @register="registerTable"> |
| | | <template #toolbar> |
| | | <a-button color="primary" @click="addTool"> 添加 </a-button> |
| | | <a-button ghost color="primary" @click="aoaToExcel"> 导出 </a-button> |
| | | <a-button color="primary" @click="addTool" preIcon="add_02|svg"> 新增 </a-button> |
| | | <a-button ghost color="success" @click="aoaToExcel" preIcon="excel-export|svg"> |
| | | 导出 |
| | | </a-button> |
| | | </template> |
| | | <template #action="{ record }"> |
| | | <TableAction :actions="[ |
| | | <TableAction |
| | | :actions="[ |
| | | { |
| | | icon: 'clarity:note-edit-line', |
| | | tooltip: '修改', |
| | |
| | | { |
| | | icon: 'ant-design:delete-outlined', |
| | | tooltip: '删除', |
| | | color: 'error', |
| | | popConfirm: { |
| | | title: '是否确认删除?', |
| | | placement: 'left', |
| | | confirm: handleDelete.bind(null, record), |
| | | }, |
| | | }, |
| | | ]" /> |
| | | ]" |
| | | /> |
| | | </template> |
| | | </BasicTable> |
| | | <Loading :loading="compState.loading" :tip="compState.tip" /> |
| | |
| | | }, |
| | | ellipsis: true, |
| | | useSearchForm: true, |
| | | showTableSetting: false, |
| | | showTableSetting: true, |
| | | bordered: true, |
| | | showIndexColumn: false, |
| | | }); |
| | | let arr: any[] = []; |
| | | //导出 |
| | | function aoaToExcel() { |
| | | const totals = getPaginationRef().total |
| | | const totals = getPaginationRef().total; |
| | | if (totals < 30000) { |
| | | arr = []; |
| | | compState.loading = true; |
| | | const col = getForm().getFieldsValue() |
| | | const col = getForm().getFieldsValue(); |
| | | getListByPage(col).then((res) => { |
| | | res.items.forEach(element => { |
| | | res.items.forEach((element) => { |
| | | arr.push({ |
| | | '飞达类型编码': element.TYPE_CODE, |
| | | '飞达类型名称': element.TYPE_NAME, |
| | | '备注': element.REMARK, |
| | | '创建人': element.CREATE_USER, |
| | | '创建时间': element.CREATE_TIME, |
| | | 飞达类型编码: element.TYPE_CODE, |
| | | 飞达类型名称: element.TYPE_NAME, |
| | | 备注: element.REMARK, |
| | | 创建人: element.CREATE_USER, |
| | | 创建时间: element.CREATE_TIME, |
| | | }); |
| | | }); |
| | | const arrHeader = columns.map((column) => column.title); |
| | |
| | | } |
| | | |
| | | compState.loading = false; |
| | | |
| | | }) |
| | | |
| | | }); |
| | | } else { |
| | | createMessage.error(t('导出数据不能超过三万条,如需要更多的请联系管理员')); |
| | | } |
| | | |
| | | |
| | | } |
| | | //添加 |
| | | function addTool() { |
| | |
| | | function handleEdit(record: any) { |
| | | openDrawer(true, { |
| | | isUpdate: true, |
| | | record |
| | | record, |
| | | }); |
| | | } |
| | | function handleSuccess() { |