| 1 |
- import{cQ as U,gT as j,gS as K,fL as O,gs as b,fV as i,fW as Q,ft as l,cs as n,cp as t,cw as a,gx as d,g$ as m,h0 as G,cv as x,ae as H,am as J,aq as P,at as X,av as Y,ax as Z,ay as ee,az as te,aA as se,aB as oe,cr as le,fM as f,eS as L,c9 as ne,z as ae,y as ie}from"./builder-DygomDiV.js";const ce={class:"upload-document p-12-24"},re={class:"flex align-center mb-16"},de={style:{display:"inline-block"}},me={class:"upload-document__main flex"},ue={class:"upload-document__component main-calc-height"},_e={class:"upload-component p-24",style:{"min-width":"850px"}},pe={class:"title-decoration-1 mb-8"},he={class:"mt-16 mb-16"},fe={class:"update-info flex p-8-12 border-r-6 mb-16"},ge={class:"mt-4"},ve={class:"ml-16 lighter"},ye={class:"card-never border-r-6 mb-16"},ke={style:{height:"calc(100vh - 450px)"}},be={class:"flex align-center lighter"},xe={key:0,src:H,alt:"",height:"20"},we={key:1,src:J,alt:"",height:"22"},Ce={key:2,src:P,alt:"",height:"22"},Ve={key:3,src:X,alt:"",height:"22"},We={key:4,src:Y,alt:"",height:"22"},Ne={key:5,src:Z,alt:"",height:"22"},Le={key:6,src:ee,alt:"",height:"22"},Te={key:7,src:te,alt:"",height:"22"},$e={key:8,src:se,alt:"",height:"22"},De={key:9,src:oe,alt:"",height:"22"},Me={class:"ml-4"},ze={class:"upload-document__footer text-right border-t"},Re=U({__name:"ImportLarkDocument",setup(Se){const T=j(),y=K(),{params:{folderId:qe},query:{id:w,folder_token:$}}=y,C=ne(()=>y.path.includes("shared")?"systemShare":y.path.includes("resource-management")?"systemManage":"workspace"),u=f(!1),p=f(!1),V=f(!1),_=f(null),k=f({fileType:"txt",fileList:[]}),D=O({fileList:[{required:!0,message:b("views.document.upload.requiredMessage"),trigger:"change"}]}),M={label:"name",children:"zones",isLeaf:e=>e.type!=="folder",disabled:e=>e.is_exist},z=(e,r)=>{const c=e.level===0?$:e.data.token;L({type:"document",systemType:C.value}).getLarkDocumentList(w,c,{},u).then(s=>{const g=s.data.files;r(g),g.forEach(v=>{v.is_exist&&_.value?.setChecked(v.token,!0,!1)})}).catch(s=>{console.error("Failed to load tree nodes:",s)})},S=e=>{e?Object.values(_.value?.store.nodesMap||{}).forEach(c=>{c.disabled||_.value?.setChecked(c.data,!0,!1)}):_.value?.setCheckedKeys([])};function q(){u.value=!0,p.value=!0;const c=(_.value?.getCheckedNodes()||[]).filter(s=>!s.is_exist).map(s=>({name:s.name,token:s.token,type:s.type}));if(c.length===0){p.value=!1,ae(b("views.document.feishu.errorMessage1")),u.value=!1;return}L({type:"document",systemType:C.value}).importLarkDocument(w,c,u).then(()=>{ie(b("views.document.tip.importMessage")),p.value=!1,W()}).catch(s=>{console.error("Failed to load tree nodes:",s)}).finally(()=>{p.value=!1}),u.value=!1}function W(){T.go(-1)}return(e,r)=>{const c=i("back-button"),s=i("el-radio-button"),g=i("el-radio-group"),v=i("AppIcon"),A=i("el-checkbox"),R=i("el-tree"),B=i("el-scrollbar"),I=i("el-form"),E=i("el-card"),N=i("el-button"),F=Q("loading");return l(),n("div",ce,[t("div",re,[a(c,{to:"-1",style:{"margin-left":"-4px"}}),t("h3",de,d(e.$t("views.document.importDocument")),1)]),a(E,{style:{"--el-card-padding":"0"}},{default:m(()=>[G((l(),n("div",me,[t("div",ue,[t("div",_e,[t("h4",pe,d(e.$t("views.document.feishu.selectDocument")),1),a(I,{ref:"FormRef",model:k.value,rules:D,"label-position":"top","require-asterisk-position":"right"},{default:m(()=>[t("div",he,[a(g,{modelValue:k.value.fileType,"onUpdate:modelValue":r[0]||(r[0]=h=>k.value.fileType=h),class:"app-radio-button-group"},{default:m(()=>[a(s,{value:"txt"},{default:m(()=>[x(d(e.$t("views.document.fileType.txt.label")),1)]),_:1})]),_:1},8,["modelValue"])]),t("div",fe,[t("div",ge,[a(v,{iconName:"app-warning-colorful",style:{"font-size":"16px"}})]),t("div",ve,[t("p",null,d(e.$t("views.document.feishu.tip1")),1),t("p",null,d(e.$t("views.document.feishu.tip2")),1)])]),t("div",ye,[a(A,{modelValue:V.value,"onUpdate:modelValue":r[1]||(r[1]=h=>V.value=h),label:e.$t("common.allCheck"),size:"large",class:"ml-24",onChange:S},null,8,["modelValue","label"])]),t("div",ke,[a(B,null,{default:m(()=>[a(R,{props:M,load:z,lazy:"","show-checkbox":"","node-key":"token",ref_key:"treeRef",ref:_},{default:m(({node:h,data:o})=>[t("div",be,[o.type==="folder"?(l(),n("img",xe)):o.type==="docx"||o.name.endsWith(".docx")?(l(),n("img",we)):o.type==="sheet"||o.name.endsWith(".xlsx")?(l(),n("img",Ce)):o.name.endsWith("xls")?(l(),n("img",Ve)):o.name.endsWith("csv")?(l(),n("img",We)):o.name.endsWith(".pdf")?(l(),n("img",Ne)):o.name.endsWith(".html")?(l(),n("img",Le)):o.name.endsWith(".txt")?(l(),n("img",Te)):o.name.endsWith(".zip")?(l(),n("img",$e)):o.name.endsWith(".md")?(l(),n("img",De)):le("",!0),t("span",Me,d(h.label),1)])]),_:1},512)]),_:1})])]),_:1},8,["model","rules"])])])])),[[F,u.value]])]),_:1}),t("div",ze,[a(N,{onClick:W},{default:m(()=>[x(d(e.$t("common.cancel")),1)]),_:1}),a(N,{onClick:q,type:"primary",disabled:p.value},{default:m(()=>[x(d(e.$t("views.document.buttons.import")),1)]),_:1},8,["disabled"])])])}}});export{Re as default};
|