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..15e9a80 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='https://gyhlw.hxgk.group/kkpreview' \ 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/api/doc/index.ts b/src/api/doc/index.ts index d144cda..86ca4bb 100644 --- a/src/api/doc/index.ts +++ b/src/api/doc/index.ts @@ -17,7 +17,7 @@ export function getShareList( uid:string,data?: matterPage): AxiosPromise + +/** + * 获取行政组织树 + */ + export function getOrgTreeList(data: {orgid?:number}): AxiosPromise{ + return request({ + url: '/hrapi/org/govnewthreeing', + method: 'post', + data: data + }); +} + +/** + * 获取人员档案 + */ + export function getArchivesListPage(data?: parsArchList): AxiosPromise { + return request({ + url: '/hrapi/staff/archiveslistcont', + method: 'post', + data: data + }); +} + +/** + * 获取文档成员权限列表 + */ +export function getPermitedList(uid:string,data:{uuid:string}): AxiosPromise<{permited:string[],infos:string[]}> { + return request({ + url: '/hxpan/api/share/permits', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * 保存文档成员权限修改 + */ +export function postPermitedList(uid:string,data?:{permitList:string,permitInfos:string, update:string,uid:string,uuid:string,len:number}){ + return request({ + url: '/hxpan/api/share/permits', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} diff --git a/src/views/doc/manage.vue b/src/views/doc/manage.vue index 239f3db..365fdc9 100644 --- a/src/views/doc/manage.vue +++ b/src/views/doc/manage.vue @@ -5,6 +5,7 @@ --> + + + \ No newline at end of file diff --git a/src/views/doc/share.vue b/src/views/doc/share.vue index ce611bc..1f8f95f 100644 --- a/src/views/doc/share.vue +++ b/src/views/doc/share.vue @@ -15,18 +15,29 @@ import { Delete, Folder, Share, + Avatar, + View, } from '@element-plus/icons-vue' import {ElText } from "element-plus"; -import { getExpirTime, getFileIcon,checkExpirTime } from "./tools" +import {getFileIcon,checkExpirTime } from "./tools" +import sharePermission from './sharePermission.vue'; +import preview from './preview.vue'; const route = useRoute() const userStore = useUserStore(); -const uid="p0"+userStore.userInfoCont.userId; +const uid=btoa("p0"+userStore.userInfoCont.userId); const siteHost=document.location.origin; const apiURL=import.meta.env.VITE_APP_BASE_API+"/hxpan/api" -const matterList = ref() +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("") +const currentHoverRow=ref("") //当前选择的table行 +const drawerModel=ref(false) //右侧隐藏抽屉组件的状态控制 +const permitListRef=ref("") //右侧抽屉组件中文档成员列表的key数组字符串 + +import type { VNode } from 'vue' +const dynamicVNode = ref(null) //permission 组件的父组件 + function showShareMessage(row:{uuid:string,code:string,name:string,expireTime:string}){ @@ -38,14 +49,23 @@ function showShareMessage(row:{uuid:string,code:string,name:string,expireTime:st h(ElText,{style:{'align-self':'flex-start'}},()=>row.name), h(ElText,{style:{'align-self':'flex-start'}},()=>"失效时间:"+row.expireTime), h(ElText,{style:{'align-self':'flex-start'}},()=>"链接:"+_shareURL), - h(ElButton, { - type: 'primary', - style: { width: '20%' }, - onClick: () => { - let _url=apiURL+`/share/zip?shareUuid=${row.uuid}&code=${row.code}&puuid=root&rootUuid=root` - window.open(_url) - } - },()=>'下载') + h('div',[ + h(ElButton, { + type: 'primary', + style: { width: '100px' }, + onClick: () => { + let _url=apiURL+`/share/zip?shareUuid=${row.uuid}&code=${row.code}&puuid=root&rootUuid=root` + window.open(_url) + } + },()=>'下载'), + h(ElButton, { + type: 'primary', + style: { width: '100px',margin:'0 10px' }, + onClick: () => { + onShareView(row) + } + },()=>'预览') + ]) ]), confirmButtonText: '复制分享链接', showCancelButton: true @@ -74,6 +94,44 @@ function onShareDelete(row:matterInfo){ } } +//编辑分享成员 +function onShareMember(row:matterInfo){ + dynamicVNode.value=h(sharePermission,{ + uid:uid, + uuid:row.uuid, + closeFunc:(refresh?:boolean)=>{ + dynamicVNode.value=null + if (refresh) { + permitListRef.value="" + drawerModel.value=false + onLoadShareList() + } + } + }) +} + +//文件预览 +function onShareView(row:matterInfo){ + let a = row.name ?? ''; + if(a.endsWith('...')){ + a=`${row.uuid}-${row.code}.zip` + } + + //由于预览服务在缓存文件时,直接按文件名缓存,所以同名文件就会出现覆盖错乱的问题 + a=a.match("(\.[a-zA-Z]+)$") + if (a && a.length>0) { + a=`${row.uuid}-${row.code}${a[0]}` + }else{ + a=`${row.uuid}${row.name}` + } + + let _url=`${siteHost}${apiURL}/share/zip?shareUuid=${row.uuid}&code=${row.code}&uid=${uid}&puuid=root&rootUuid=root&fullfilename=${a}` + dynamicVNode.value=h(preview,{ + url:`${officeHost}/onlinePreview?url=`+window.btoa(unescape(encodeURIComponent(_url))), + closeFunc:()=>dynamicVNode.value=null + }) +} + //加载文件列表 function onLoadShareList(){ let _page: matterPage = { @@ -89,7 +147,7 @@ function onLoadShareList(){ } function handleMouseEnter(row:any){ - currentHoverRow.value=row.name + currentHoverRow.value=row.uuid } onMounted(() => { @@ -99,8 +157,8 @@ onMounted(() => { browerMode.value=true getShareBrowse("",{shareUuid:query.uuid,code:query.code,puuid:'root',rootUuid:'root'}).then((resp)=>{ showShareMessage(resp.data) + return }) - return } browerMode.value=false onLoadShareList() @@ -115,7 +173,7 @@ onMounted(() => { :data="matterList" :header-cell-style="{ background: '#f5f8fd' }" style="width: 100%" - row-key="value" + row-key="uuid" :row-style ="() => ({ height: '55px' })" @cell-mouse-enter="handleMouseEnter"> @@ -131,7 +189,9 @@ onMounted(() => {