| | |
| | | <template> |
| | | <FYTable |
| | | id="fyTable" |
| | | @search="onSearch" |
| | | :data="tableData" |
| | | :pagination="false" |
| | |
| | | </el-descriptions> |
| | | </template> |
| | | <template #buttons> |
| | | <el-button |
| | | icon="Download" |
| | | type="primary" |
| | | plain |
| | | @click="download" |
| | | :loading="dlLoading" |
| | | <FYDownloadTableButton |
| | | label="下载清单" |
| | | table-id="fyTable" |
| | | :file-name="fileName" |
| | | :disabled="downloadDisabled" |
| | | >下载清单</el-button |
| | | > |
| | | ></FYDownloadTableButton> |
| | | </template> |
| | | <template #table-column="{ size }"> |
| | | <el-table-column fixed="left" label="序号" width="53"> |
| | |
| | | import evaluateApi from '@/api/fysp/evaluateApi'; |
| | | import problemApi from '@/api/fysp/problemApi'; |
| | | import sceneApi from '@/api/fysp/sceneApi'; |
| | | import { conversionFromTable } from "@/utils/excel"; |
| | | import { envCreditCode } from '@/constants/index'; |
| | | import { useTablePaste } from '@/composables/tablePaste'; |
| | | import { useCloned } from '@vueuse/core'; |
| | | import { useMessageBoxTip } from '@/composables/messageBox'; |
| | | import * as XLSX from 'xlsx'; |
| | | import FileSaver from 'file-saver'; |
| | | |
| | | export default { |
| | | setup() { |
| | |
| | | }); |
| | | return b; |
| | | } |
| | | }, |
| | | fileName() { |
| | | const { locations, scenetype, time } = this.formSearch; |
| | | return `${locations.dName}${dayjs(time).format( |
| | | 'YYYY年MM月' |
| | | )}联合执法清单`; |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | const property = column['property']; |
| | | return row[property] === value; |
| | | }, |
| | | download() { |
| | | // const workbook = XLSX.utils.book_new(); |
| | | // const worksheet = XLSX.utils.json_to_sheet(this.tableData); |
| | | // XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1'); |
| | | // const excelData = XLSX.write(workbook, { |
| | | // bookType: 'xlsx', |
| | | // type: 'array' |
| | | // }); |
| | | // const blob = new Blob([excelData], { |
| | | // type: 'application/vnd.openxmlformats-officedocumnet.spreadsheetml.sheet' |
| | | // }); |
| | | const { locations, scenetype, time } = this.formSearch; |
| | | const name = `${locations.dName}${dayjs(time).format( |
| | | 'YYYY年MM月' |
| | | )}联合执法清单.xlsx`; |
| | | // FileSaver.saveAs(blob, name); |
| | | conversionFromTable('fyTable', name) |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.addRefreshEvent(this.$refs.tableRef.doLayout); |