| | |
| | | :showTableColumnSetting="false" |
| | | > |
| | | <template #fileBusinessType="{ row }"> |
| | | {{ FourStreamsMaterialFileBusinessTypeEnumText[row.fileBusinessType] }} |
| | | {{ BusinessTypeEnumText[row.fileBusinessType] }} |
| | | </template> |
| | | <template #operationBtn-uploadBtn="{ data, row }"> |
| | | <BlFileUpload |
| | |
| | | </BlFileUpload> |
| | | </template> |
| | | </ProTableV2> |
| | | <FourStreamsBatchMaterialFileDialog |
| | | v-bind="dialogProps" |
| | | :name="''" |
| | | :zipName="`${BusinessTypeEnumText[currentFourStreamsMaterialFileTableItem.fileBusinessType as any]}`" |
| | | v-model:fileList="currentFourStreamsMaterialFileTableItem.fileList" |
| | | :showDeleteBtn="showDeleteBtn" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | <script setup lang="ts" generic="T"> |
| | | import { |
| | | FourStreamsMaterialFileTableProps, |
| | | FourStreamsMaterialFileTableItem, |
| | | FourStreamsMaterialFileBusinessTypeEnumText, |
| | | BaseMaterialFileTableItem, |
| | | } from './types'; |
| | | import { |
| | | ProTableV2, |
| | | defineColumns, |
| | | defineOperationBtns, |
| | | BlFileUpload, |
| | | bolePreview, |
| | | useDialog, |
| | | } from '@bole-core/components'; |
| | | import FourStreamsBatchMaterialFileDialog from './FourStreamsBatchMaterialFileDialog.vue'; |
| | | import { downloadFileByUrl } from '@/utils'; |
| | | import { Message, isFileCanPreview } from '@bole-core/core'; |
| | | import { useDefineColumns } from '@/hooks'; |
| | |
| | | showDownloadBtn: true, |
| | | showDeleteBtn: true, |
| | | downloadBtnText: '下载', |
| | | BusinessTypeEnumText: () => FourStreamsMaterialFileBusinessTypeEnumText, |
| | | }); |
| | | |
| | | const list = defineModel<FourStreamsMaterialFileTableItem[]>('list'); |
| | | const list = defineModel<BaseMaterialFileTableItem<T>[]>('list'); |
| | | |
| | | const columns = defineColumns([ |
| | | { |
| | |
| | | } catch (error) {} |
| | | } |
| | | |
| | | const currentFourStreamsMaterialFileTableItem = ref<BaseMaterialFileTableItem<T>>({ |
| | | fileBusinessType: 0 as any, |
| | | fileList: [], |
| | | }); |
| | | const { dialogProps, dialogState } = useDialog(); |
| | | |
| | | async function handlePreview(row: FourStreamsMaterialFileTableItem) { |
| | | if (row.fileList.length > 1) { |
| | | // currentEnterpriseMaterialFileTableItem.value = row; |