From 9af08e2cbc17e6785ea531ee24b92d8737336888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E9=98=94?= Date: Sat, 2 Nov 2024 11:15:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PreViewFile/index.ts | 3 + .../PreViewFile/src/PreViewFile.vue | 60 +++++++++++++++++++ src/router/index.ts | 11 ++++ .../reporting/RepTemplate/RepTemplate.vue | 23 ++++++- 4 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 src/components/PreViewFile/index.ts create mode 100644 src/components/PreViewFile/src/PreViewFile.vue diff --git a/src/components/PreViewFile/index.ts b/src/components/PreViewFile/index.ts new file mode 100644 index 0000000..82deb06 --- /dev/null +++ b/src/components/PreViewFile/index.ts @@ -0,0 +1,3 @@ +import PreViewFile from './src/PreViewFile.vue' + +export { PreViewFile } diff --git a/src/components/PreViewFile/src/PreViewFile.vue b/src/components/PreViewFile/src/PreViewFile.vue new file mode 100644 index 0000000..a91a9a1 --- /dev/null +++ b/src/components/PreViewFile/src/PreViewFile.vue @@ -0,0 +1,60 @@ + + + + + + + + diff --git a/src/router/index.ts b/src/router/index.ts index d57743d..33c8873 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -86,6 +86,17 @@ export const constantRouterMap: AppRouteRecordRaw[] = [ noTagsView: true, }, }, + /* ----------------------在线Word的预览开始------------------------- */ + { + path: '/PreViewFile', + component: () => import('@/components/PreViewFile/src/PreViewFile.vue'), + name: 'PreViewFile', + meta: { + title: '文件预览', + hidden:true + }, + }, + /* ----------------------在线Word的预览结束------------------------- */ // 可疑案例处理界面 { path: '/caseManageT', diff --git a/src/views/reporting/RepTemplate/RepTemplate.vue b/src/views/reporting/RepTemplate/RepTemplate.vue index bbe1932..bcd2cbc 100644 --- a/src/views/reporting/RepTemplate/RepTemplate.vue +++ b/src/views/reporting/RepTemplate/RepTemplate.vue @@ -22,7 +22,9 @@ import { Dialog } from '@/components/Dialog' import { getWidth, transfDictList } from '@/utils'; import Detail from './components/Detail.vue' import { REPORTING_STATUS_LIST } from './constants' +import { useRouter } from 'vue-router'; +const router = useRouter() const { t } = useI18n() const ids = ref([]) @@ -115,6 +117,9 @@ const tableColumns = reactive([ default: (data: any) => { return ( <> + ShowPreViewFile(data.row)}> + 预览 + action(data.row, 'edit')}> {t('tableDemo.edit')} @@ -134,6 +139,7 @@ const tableColumns = reactive([ }} onConfirm={() => delData(data.row)} > + ) } @@ -171,7 +177,20 @@ const searchSchema = reactive([ component: 'DatePicker' } ]) - +/** 预览 **/ +const ShowPreViewFile = (data)=>{ + const routeData = router.resolve({ + name:'PreViewFile', + query:{ + fileData:data.fileFlow, + } + }) + router.push({name:'PreViewFile', + query:{ + fileData:data.fileFlow, + }}); + // window.open(routeData.href,'_blank') +} const searchParams = ref({}) const setSearchParams = (data: any) => { searchParams.value = data @@ -207,7 +226,7 @@ const action = async (row: TableData, type: string) => { } const AddAction = () => { - dialogTitle.value = t('tableDemo.add') + dialogTitle.value = "上传模板"; currentRow.value = undefined dialogVisible.value = true actionType.value = 'add'