You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
6.6 KiB
2 lines
6.6 KiB
|
4 months ago
|
import{d as Y,u as J,x as K,r as y,G as X,a as s,f,q as g,h as t,c as C,b as u,e as l,A as z,bi as ee,t as E,Y as te,ab as d,bx as oe,bp as F,bk as ne,bl as ae,bn as ie,Z as le,$ as S,F as q,g as se,O as re,I as ue,ae as B,bo as r,aF as R,ak as de,b3 as ce,b4 as pe,av as fe,aQ as me,p as _e,m as he,_ as ye}from"./index-e450010e.js";import{d as N,e as $e,f as ge}from"./index-a1529bac.js";import{g as xe,c as ve,f as H}from"./tools-446dc38a.js";import{_ as be}from"./sharePermission.vue_vue_type_script_setup_true_lang-850bb9dd.js";import{_ as ke}from"./preview.vue_vue_type_style_index_0_lang-2ef83b9d.js";import{_ as we}from"./recentVisited.vue_vue_type_script_setup_true_lang-667d8e2b.js";const Ce=x=>(_e("data-v-58ad06bd"),x=x(),he(),x),Se={class:"app_container"},Ue={style:{display:"flex","align-items":"center"}},Ie={style:{"margin-left":"10px"}},Te={key:0},ze=Ce(()=>g("span",null,"文档成员列表",-1)),Ee={key:0,style:{"line-height":"26px"}},Be={key:1},Re={key:0,style:{height:"inherit"}},De=Y({__name:"share",setup(x){const A=J(),D=K(),c=btoa("d"+D.userInfoCont.department),p=btoa("p0"+D.userInfoCont.userId),v=document.location.origin,b="/hxpan/api",O="https://gyhlw.hxgk.group/kkapi",L=y(),k=y(!1),U=y(""),m=y(!1),$=y(""),_=y(null);function M(e){let o=`${v}/#/doc/share?uuid=${e.uuid}&code=${e.code}`;B({title:"分享详情",customStyle:{"--el-messagebox-width":"800px",padding:"40px"},message:()=>r("div",{style:{display:"flex","flex-direction":"column","line-height":"34px",width:"600px"}},[r(R,{style:{"align-self":"flex-start"}},()=>e.name),r(R,{style:{"align-self":"flex-start"}},()=>"失效时间:"+e.expireTime),r(R,{style:{"align-self":"flex-start"}},()=>"链接:"+o),r("div",[r(d,{type:"primary",style:{width:"100px"},onClick:()=>{let a=b+`/share/zip?shareUuid=${e.uuid}&code=${e.code}&dprt=${c}&puuid=root&rootUuid=root`;window.open(a)}},()=>"下载"),r(d,{type:"primary",style:{width:"100px",margin:"0 10px"},onClick:()=>{V(e)}},()=>"预览")])]),confirmButtonText:"复制分享链接",showCancelButton:!0}).then(()=>{navigator.clipboard||alert("clipboard 不可用"),navigator.clipboard.writeText(o)}).catch(()=>{k.value&&(location.href="/#/doc/share")})}function Z(e){e.uuid&&B.confirm("确认要取消此文件分享!","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{$e(p,{uuid:e.uuid}).then(()=>I())})}function j(e){_.value=r(be,{uid:p,uuid:e.uuid,closeFunc:o=>{_.value=null,o&&($.value="",m.value=!1,I())}})}function V(e){const o=H(e.name);if(o!==""){const a=btoa(encodeURIComponent(`${e.name}`)),i=`${v}${b}/share/zip?shareUuid=${e.uuid}&code=${e.code}&uid=${p}&dprt=${c}&puuid=root&rootUuid=root`;window.open(`/#/onlyoffice?name=${e.name}&dtype=${o}&info=${a}&fileurl=`+encodeURIComponent(i),"_blank")}else{let a=e.name??"";a.endsWith("...")&&(a=`${e.uuid}-${e.code}.zip`),a=a.match("(.[a-zA-Z]+)$"),a&&a.length>0?a=`${e.uuid}-${e.code}${a[0]}`:a=`${e.uuid}${e.name}`;let i=`${v}${b}/share/zip?shareUuid=${e.uuid}&code=${e.code}&uid=${p}&dprt=${c}&puuid=root&rootUuid=root&fullfilename=${a}`;_.value=r(ke,{url:`${O}/kkpreview/onlinePreview?url=`+window.btoa(encodeURIComponent(i)),closeFunc:()=>_.value=null})}}async function G(e){const o=H(e.name);if(o===""){alert("暂不支持该类型编辑");return}let a="";await N("",{shareUuid:e.uuid,code:e.code,puuid:"root",rootUuid:"root",dprt:c}).then(i=>{console.log(i.data,"<<<<<<<<<<<"),a=i.data.matters[0].path}),B.confirm("线上资源有限,确定继续线上编辑吗","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{const i=btoa(e.uuid.match(/(\w+-\w+)/)[0]+"true"),h=btoa(encodeURIComponent(`${e.userUuid}/root${a}`)),w=`${v}${b}/share/zip?shareUuid=${e.uuid}&code=${e.code}&uid=${p}&dprt=${c}&puuid=root&rootUuid=root`;window.open(`/#/onlyoffice?name=${e.name}&dtype=${o}&info=${h}&verify=${i}&fileurl=`+encodeURIComponent(w),"_blank")})}function I(){ge(p,{page:0,pageSize:100,orderCreateTime:"DESC",orderDir:"DESC"}).then(o=>{L.value=o.data.data})}function P(e){U.value=e.uuid}function Q(e){let o=parseInt(e.split
|