| | |
| | | import { computed, nextTick, reactive, ref, watch } from 'vue'; |
| | | import { useRouter } from 'vue-router'; |
| | | |
| | | import { useVbenModal } from '../../../../../packages/effects/common-ui/src'; |
| | | import { useVbenModal } from '@vben/common-ui'; |
| | | import { |
| | | BpmCandidateStrategyEnum, |
| | | BpmModelFormType, |
| | |
| | | BpmTaskOperationButtonTypeEnum, |
| | | BpmTaskStatusEnum, |
| | | OPERATION_BUTTON_NAME, |
| | | } from '../../../../../packages/constants/src'; |
| | | import { IconifyIcon } from '../../../../../packages/icons/src'; |
| | | import { useUserStore } from '../../../../../packages/stores/src'; |
| | | import { isEmpty } from '../../../../../packages/utils/src'; |
| | | } from '@vben/constants'; |
| | | import { IconifyIcon } from '@vben/icons'; |
| | | import { useUserStore } from '@vben/stores'; |
| | | import { isEmpty } from '@vben/utils'; |
| | | |
| | | import { FilePreviewModal, useFilePreview } from '#/components/file-preview'; |
| | | |
| | | import FormCreate from '@form-create/ant-design-vue'; |
| | | import { until, useDebounceFn } from '@vueuse/core'; |
| | |
| | | const imagePreviewVisible = ref(false); |
| | | const imagePreviewUrl = ref(''); |
| | | |
| | | const { openPreview: openFilePreview, previewState: filePreviewState } = useFilePreview(); |
| | | |
| | | /** 判断文件是否为图片类型 */ |
| | | function isImageUrl(url: string) { |
| | | return /\.(jpg|jpeg|png|gif|bmp|webp|svg)$/i.test( |
| | |
| | | imagePreviewUrl.value = url; |
| | | imagePreviewVisible.value = true; |
| | | } else { |
| | | window.open(url, '_blank'); |
| | | openFilePreview(url, file?.name); |
| | | } |
| | | } |
| | | |
| | |
| | | :src="imagePreviewUrl" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- 文件预览(PDF/Word/Excel/PPT) --> |
| | | <FilePreviewModal |
| | | v-model:visible="filePreviewState.visible.value" |
| | | :file-url="filePreviewState.fileUrl.value" |
| | | :file-name="filePreviewState.fileName.value" |
| | | /> |
| | | </template> |