diff --git a/.env.development b/.env.development index 39a9b0c..a536a4e 100644 --- a/.env.development +++ b/.env.development @@ -9,3 +9,4 @@ VITE_APP_BASE_API = '/dev-api' VITE_APP_BASE_URL = 'http://myvuetest.net' VITE_APP_TOKEN_KEY = 'offlineAccessSystemAppToken' VITE_APP_SJZT_URL = 'http://172.20.5.86/prod-api' +VITE_OFFICE_HOST="http://192.168.56.101:8012" diff --git a/.env.production b/.env.production index 0513524..7beba05 100644 --- a/.env.production +++ b/.env.production @@ -5,3 +5,4 @@ VITE_APP_PORT = 17777 VITE_APP_BASE_API = '' VITE_APP_TOKEN_KEY = 'onlineAccessSystemAppToken' VITE_APP_SJZT_URL = 'http://120.224.6.6:29911/prod-api' +VITE_OFFICE_HOST='' \ No newline at end of file diff --git a/.env.staging b/.env.staging index f1e5275..811581d 100644 --- a/.env.staging +++ b/.env.staging @@ -4,3 +4,4 @@ NODE_ENV='staging' VITE_APP_TITLE = '数通智联化工云平台' VITE_APP_PORT = 3000 VITE_APP_BASE_API = '/prod--api' +VITE_OFFICE_HOST='' \ No newline at end of file diff --git a/src/views/doc/preview.vue b/src/views/doc/preview.vue new file mode 100644 index 0000000..f2f0d7f --- /dev/null +++ b/src/views/doc/preview.vue @@ -0,0 +1,35 @@ + + + + \ No newline at end of file diff --git a/src/views/doc/share.vue b/src/views/doc/share.vue index c9b30ab..a69a064 100644 --- a/src/views/doc/share.vue +++ b/src/views/doc/share.vue @@ -16,16 +16,19 @@ import { Folder, Share, Avatar, + View, } from '@element-plus/icons-vue' import {ElText } from "element-plus"; import {getFileIcon,checkExpirTime } from "./tools" import sharePermission from './sharePermission.vue'; +import preview from './preview.vue'; const route = useRoute() const userStore = useUserStore(); const uid=btoa("p0"+userStore.userInfoCont.userId); const siteHost=document.location.origin; const apiURL=import.meta.env.VITE_APP_BASE_API+"/hxpan/api" +const officeHost=import.meta.env.VITE_OFFICE_HOST const matterList = ref() //文件列表 const browerMode=ref(false) //share模式 1)self-list(default) 2)brower const currentHoverRow=ref("") //当前选择的table行 @@ -98,6 +101,18 @@ function onShareMember(row:matterInfo){ }) } +//文件预览 +function onShareView(row:matterInfo){ + if(row.name.endsWith('...')){ + row.name="archive.zip" + } + let _url=`${siteHost}${apiURL}/share/zip?shareUuid=${row.uuid}&code=${row.code}&puuid=root&rootUuid=root&fullfilename=${row.name}` + dynamicVNode.value=h(preview,{ + url:`${officeHost}/onlinePreview?url=`+encodeURIComponent(btoa(_url)), + closeFunc:()=>dynamicVNode.value=null + }) +} + //加载文件列表 function onLoadShareList(){ let _page: matterPage = { @@ -156,7 +171,8 @@ onMounted(() => {