| | |
| | | } from '@bole-core/components'; |
| | | import { format, downloadFileByUrl, formatFileSize } from '@/utils'; |
| | | import { downloadWithZip, Message, isFileCanPreview } from '@bole-core/core'; |
| | | import { CustomerApplyFileTypeListItem, EnterpriseApplyFileUtils } from './utils'; |
| | | import { FourStreamsExtraMaterialFileSearchType, SearchType } from '@/constants'; |
| | | |
| | | defineOptions({ |
| | | name: 'FourStreamsBatchMaterialFileDialog', |
| | |
| | | name?: string; |
| | | zipName?: string; |
| | | showDeleteBtn?: boolean; |
| | | showMaterialExtraFileDeleteBtn?: boolean; |
| | | fileSearchTypeId?: string; |
| | | }; |
| | | |
| | | const props = withDefaults(defineProps<Props>(), { |
| | | showDeleteBtn: true, |
| | | showMaterialExtraFileDeleteBtn: false, |
| | | }); |
| | | |
| | | const visible = defineModel<boolean>('visible'); |
| | |
| | | ]); |
| | | |
| | | const operationBtns = defineOperationBtns([ |
| | | // { |
| | | // data: { |
| | | // enCode: 'detailBtn', |
| | | // name: '查看', |
| | | // }, |
| | | // emits: { |
| | | // onClick: (row) => handlePreview(row), |
| | | // }, |
| | | // extraProps: { |
| | | // hide: (row: UploadUserFile) => !isFileCanPreview(row.path), |
| | | // }, |
| | | // }, |
| | | { |
| | | data: { |
| | | enCode: 'detailBtn', |
| | | name: '查看', |
| | | }, |
| | | emits: { |
| | | onClick: (row) => handlePreview(row), |
| | | }, |
| | | extraProps: { |
| | | hide: (row: UploadUserFile) => !isFileCanPreview(row.path), |
| | | }, |
| | | }, |
| | | { |
| | | data: { |
| | | enCode: 'downloadBtn', |
| | | name: '查看', |
| | | name: '下载', |
| | | }, |
| | | emits: { |
| | | onClick: (row) => handleDownload(row), |
| | |
| | | onClick: (row) => handleDelete(row), |
| | | }, |
| | | extraProps: { |
| | | hide: (row) => !props.showDeleteBtn, |
| | | hide: (row: API.CustomerUploadMonthApplyFileTypeDto) => { |
| | | if (EnterpriseApplyFileUtils.isApplyUploadExtraFileSearchTypeId(props.fileSearchTypeId)) { |
| | | return !props.showMaterialExtraFileDeleteBtn; |
| | | } else { |
| | | return !props.showDeleteBtn; |
| | | } |
| | | }, |
| | | }, |
| | | }, |
| | | ]); |
| | |
| | | const res: UploadUserFile[] = proTable.value.innerTableRef.getSelectionRows(); |
| | | if (res.length > 0) { |
| | | downloadWithZip( |
| | | res.map((item) => ({ data: item.url })), |
| | | res.map((item) => ({ data: `${item.url}?${new Date().getTime()}` })), |
| | | props.zipName |
| | | ); |
| | | } else { |