iking-web-ui-pro 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/IKDetailPreviewFiles/ik.index.es.js +191 -191
  2. package/dist/IKDetailPreviewFiles/ik.index.umd.js +1 -1
  3. package/dist/IKPreviewFile/ik.index.es.js +188 -188
  4. package/dist/IKPreviewFile/ik.index.umd.js +1 -1
  5. package/dist/IkApprovalProcess/ik.index.es.js +1 -0
  6. package/dist/IkApprovalProcess/ik.index.umd.js +1 -1
  7. package/dist/IkApprovalProcess/style.css +1 -1
  8. package/dist/IkApprovalProcessDetail/ik.index.es.js +119 -118
  9. package/dist/IkApprovalProcessDetail/ik.index.umd.js +1 -1
  10. package/dist/IkApprovalProcessDetail/style.css +1 -1
  11. package/dist/IkDescription/ik.index.es.js +189 -189
  12. package/dist/IkDescription/ik.index.umd.js +1 -1
  13. package/dist/IkDescription/style.css +1 -1
  14. package/dist/IkOnlyOffice/ik.index.es.js +59 -58
  15. package/dist/IkOnlyOffice/ik.index.umd.js +1 -1
  16. package/dist/IkPreviewFileDialog/ik.index.es.js +121 -121
  17. package/dist/IkPreviewFileDialog/ik.index.umd.js +1 -1
  18. package/dist/IkTemplateOfficeConfig/ik.index.es.js +12 -11
  19. package/dist/IkTemplateOfficeConfig/ik.index.umd.js +1 -1
  20. package/dist/IkUploadFile/ik.index.es.js +218 -218
  21. package/dist/IkUploadFile/ik.index.umd.js +1 -1
  22. package/dist/index.es.js +2579 -2578
  23. package/dist/index.umd.js +36 -36
  24. package/dist/src/components/IkUploadFile/index.d.ts +3 -3
  25. package/dist/src/components/IkUploadFile/src/index.vue.d.ts +1 -1
  26. package/dist/src/components/IkUploadImage/index.d.ts +3 -3
  27. package/dist/src/components/IkUploadImage/src/index.vue.d.ts +1 -1
  28. package/dist/style.css +1 -1
  29. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("iking-utils-pro")):typeof define=="function"&&define.amd?define(["exports","vue","iking-utils-pro"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f.index={},f.vue,f["iking-utils-pro"]))})(this,function(f,e,C){"use strict";const w=(o,t)=>{if(o.install=i=>{for(const l of[o,...Object.values(t??{})])i.component(l.name,l)},t)for(const[i,l]of Object.entries(t))o[i]=l;return o},S=(o,t)=>t?t.startsWith("http")?t:`${o||location.origin}${t}`:"",k=(o,t)=>{const i=o.__vccOpts||o;for(const[l,n]of t)i[l]=n;return i},I=(o,t)=>{var s,a,d,p;const i=(s=o==null?void 0:o.response)!=null&&s.data?B((d=(a=o==null?void 0:o.response)==null?void 0:a.data)==null?void 0:d.suffix):((p=o.raw)==null?void 0:p.type)||B(o[t.suffix]),l=i==null?void 0:i.toLowerCase(),n={sheet:"excel",excel:"excel",zip:"zip","application/x-compressed":"zip",image:"image",video:"video",audio:"audio",pdf:"pdf",text:"txt",txt:"txt",word:"word",ppt:"ppt",exe:"exe",json:"json"};for(let r in n)if(typeof l=="string"&&(l.includes(r)||l===r))return n[r];return"unknown"},D={".doc":"word",".docx":"word",".docxf":"word",".docm":"word",".dot":"word",".dotm":"word",".dotx":"word",".epub":"word",".fodt":"word",".htm":"word",".html":"word",".mht":"word",".odt":"word",".ott":"word",".rtf":"word",".djvu":"word",".oxps":"word",".oform":"word",".fb2":"word",".xml":"word",".xps":"word",".csv":"excel",".xls":"excel",".xlsx":"excel",".fods":"excel",".ods":"excel",".ots":"excel",".xlsb":"excel",".xlsm":"excel",".xlt":"excel",".xltm":"excel",".xltx":"excel",".fodp":"ppt",".odp":"ppt",".otp":"ppt",".pot":"ppt",".potm":"ppt",".potx":"ppt",".pps":"ppt",".ppsm":"ppt",".ppsx":"ppt",".ppt":"ppt",".pptm":"ppt",".pptx":"ppt",".zip":"zip",".rar":"zip",".7z":"zip",".apz":"zip",".ar":"zip",".bz":"zip",".car":"zip",".dar":"zip",".cpgz":"zip",".f":"zip",".ha":"zip",".hbc":"zip",".hbc2":"zip",".hbe":"zip",".hpk":"zip",".hyp":"zip",".png":"image",".jpg":"image",".jpeg":"image",".bmp":"image",".gif":"image",".webp":"image",".psd":"image",".svg":"image",".tiff":"image",".avi":"video",".wmv":"video",".mpeg":"video",".mp4":"video",".mpm4v":"video",".mov":"video",".asf":"video",".flv":"video",".f4v":"video",".rmvb":"video",".rm":"video",".3gp":"video",".vob":"video",".txt":"txt",".pdf":"pdf"},B=o=>{const t=o==null?void 0:o.toLocaleLowerCase(),i=t!=null&&t.startsWith(".")?t:`.${t}`;return i&&D[i]||"unknow"},q=o=>{let t="",i=["doc","docx"],l=["xls","xlsx"],n=["ppt","pptx"],s=["pdf"];return i.includes(o)&&(t="word"),l.includes(o)&&(t="cell"),n.includes(o)&&(t="slide"),s.includes(o)&&(t="text-pdf"),t},V={key:0,class:"ik-svg-icon ik-icon inline-block inline-flex justify-center box-content line-height-[0]"},F={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},O=["xlink:href"],$=["src"],T={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},A=["xlink:href"],M=["src"],P=e.defineComponent({name:"IkSvgIcon",__name:"index",props:{name:{},flip:{},rotate:{},color:{},colorLight:{},opacity:{default:.5},size:{default:""},width:{},bg:{type:Boolean,default:!1},showBg:{type:Boolean,default:!1},padding:{default:"6px"},primary:{type:Boolean},warning:{type:Boolean},success:{type:Boolean},error:{type:Boolean},notip:{type:Boolean,default:!1},title:{},type:{},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tableIconType:{default:"icon"}},setup(o){const t=o,i=e.computed(()=>{var n,s,a;return/^http?:\/\//.test(t.name)?"img":/i-[^:]+:[^:]+/.test(t.name)?"unocss":(n=t.name)!=null&&n.startsWith("iksig")?"iksig":(s=t.name)!=null&&s.includes(":")?"iconify":(a=t.name)!=null&&a.startsWith("iksvg")?"svg":"i"}),l=e.computed(()=>{const n=[];if(t.flip)switch(t.flip){case"horizontal":n.push("rotateY(180deg)");break;case"vertical":n.push("rotateX(180deg)");break;case"both":n.push("rotateX(180deg)"),n.push("rotateY(180deg)");break}t.rotate&&n.push(`rotate(${t.rotate%360}deg)`);const s={...t.color&&{color:t.color},...t.size&&{fontSize:typeof t.size=="number"?`${t.size}px`:t.size},...n.length&&{transform:n.join(" ")},padding:t.showBg||t.bg?t.padding:0,...t.color&&i.value!=="iksig"?{"--ik-color-icon-dark":t.color,"--ik-color-icon-light":t.colorLight||C.ikColor.setOpacity(t.color,t.opacity)}:{}};return t.width&&(s.width=s.height=typeof t.width=="number"?`${t.width}px`:t.width),s});return(n,s)=>{const a=e.resolveComponent("el-tooltip"),d=e.resolveComponent("el-button");return n.tableIconType==="icon"?(e.openBlock(),e.createElementBlock("span",V,[n.notip||!n.title?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[n.name]:i.value==="unocss","show-bg":n.showBg||n.bg,default:n.size==="default",small:n.size==="small",big:n.size==="big",warning:n.warning||t.type==="warning",primary:n.primary||t.type==="primary",success:n.success||t.type==="success",error:n.error||t.type==="error",active:n.active,disabled:n.disabled}]),style:e.normalizeStyle(l.value)},[e.createCommentVNode(` <Icon v-if="outputType === 'iconify'" :icon="name" /> `),i.value==="iksig"?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(`iksig ${n.name}`),style:e.normalizeStyle(l.value)},null,6)):i.value==="svg"?(e.openBlock(),e.createElementBlock("svg",F,[e.createElementVNode("use",{"xlink:href":`#${n.name}`},null,8,O)])):i.value==="img"?(e.openBlock(),e.createElementBlock("img",{key:2,src:n.name,class:"h-[1em] w-[1em]"},null,8,$)):(e.openBlock(),e.createElementBlock("i",{key:3,class:e.normalizeClass(n.name),style:e.normalizeStyle(l.value)},null,6))],6)):(e.openBlock(),e.createBlock(a,{key:1,content:n.title,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[n.name]:i.value==="unocss","show-bg":n.showBg||n.bg,default:n.size==="default",small:n.size==="small",big:n.size==="big",warning:n.warning||t.type==="warning",primary:n.primary||t.type==="primary",success:n.success||t.type==="success",error:n.error||t.type==="error",active:n.active}]),style:e.normalizeStyle(l.value)},[i.value==="iksig"?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(`iksig ${n.name}`),style:e.normalizeStyle(l.value)},null,6)):i.value==="svg"?(e.openBlock(),e.createElementBlock("svg",T,[e.createElementVNode("use",{"xlink:href":`#${n.name}`},null,8,A)])):i.value==="img"?(e.openBlock(),e.createElementBlock("img",{key:2,src:n.name,class:"h-[1em] w-[1em]"},null,8,M)):(e.openBlock(),e.createElementBlock("i",{key:3,class:e.normalizeClass(n.name),style:e.normalizeStyle(l.value)},null,6))],6)]),_:1},8,["content"]))])):(e.openBlock(),e.createBlock(d,{key:1,type:["warning","error"].includes(n.type)?"danger":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.title),1)]),_:1},8,["type"]))}}}),ne="",v=w(k(P,[["__scopeId","data-v-7d95dbf5"]])),j={key:0,class:"exit-main-page-maximize"},N=e.defineComponent({__name:"CloseIcon",props:{showBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},setup(o){return(t,i)=>(e.openBlock(),e.createElementBlock("div",null,[o.showBg&&o.fullscreen?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(e.unref(v),{name:"iksvg_guanbidanchuang",title:"关闭",size:20,error:""})])):(e.openBlock(),e.createBlock(e.unref(v),{key:1,error:"",name:"iksvg_guanbidanchuang",title:"关闭",size:20}))]))}}),ie="",L=k(N,[["__scopeId","data-v-79f49df8"]]),U={class:"base-header"},H=e.defineComponent({__name:"IkBaseDialog",props:e.mergeModels({title:{default:""},cancelText:{default:"取消"},confirmText:{default:"确认"},noHeader:{type:Boolean},noFooter:{type:Boolean},showCloseBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1,noHeader:!1,noFooter:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,i=e.useModel(o,"modelValue"),l=e.ref(t.fullscreen),n=()=>{l.value=!l.value},s=e.defineComponent({setup(){return()=>e.h(L,{showBg:t.showCloseBg,fullscreen:t.fullscreen})}});return(a,d)=>{const p=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(p,e.mergeProps({modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=r=>i.value=r)},a.$attrs,{"close-icon":e.unref(s),class:`ik-base-dialog ${a.noHeader?"no-header":""} ${a.noFooter?"no-footer":""}`,fullscreen:l.value,"modal-class":"baseDialog"}),e.createSlots({icon:e.withCtx(()=>[e.renderSlot(a.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(a.title),1)])]),header:e.withCtx(()=>[e.createElementVNode("div",U,[e.renderSlot(a.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(a.title),1)])]),a.$attrs.showClose?(e.openBlock(),e.createBlock(e.unref(v),{key:0,onClick:n,name:l.value?"iksvg_tuichuquanping":"iksvg_quanping-daohang",class:"absolute! top-[18px] right-[50px] icon-dialog-full",title:l.value?"退出全屏":"全屏"},null,8,["name","title"])):e.createCommentVNode("v-if",!0)]),default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:2},[a.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"footer")]),key:"0"}:void 0]),1040,["modelValue","close-icon","class","fullscreen"])}}}),se="",W=w(H);function K(o,t,i,l){function n(s){return s instanceof i?s:new i(function(a){a(s)})}return new(i||(i=Promise))(function(s,a){function d(c){try{r(l.next(c))}catch(m){a(m)}}function p(c){try{r(l.throw(c))}catch(m){a(m)}}function r(c){c.done?s(c.value):n(c.value).then(d,p)}r((l=l.apply(o,t||[])).next())})}function X(o,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},l,n,s,a;return a={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function d(r){return function(c){return p([r,c])}}function p(r){if(l)throw new TypeError("Generator is already executing.");for(;a&&(a=0,r[0]&&(i=0)),i;)try{if(l=1,n&&(s=r[0]&2?n.return:r[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,r[1])).done)return s;switch(n=0,s&&(r=[r[0]&2,s.value]),r[0]){case 0:case 1:s=r;break;case 4:return i.label++,{value:r[1],done:!1};case 5:i.label++,n=r[1],r=[0];continue;case 7:r=i.ops.pop(),i.trys.pop();continue;default:if(s=i.trys,!(s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){i.label=r[1];break}if(r[0]===6&&i.label<s[1]){i.label=s[1],s=r;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(r);break}s[2]&&i.ops.pop(),i.trys.pop();continue}r=t.call(o,i)}catch(c){r=[6,c],n=0}finally{l=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}}typeof SuppressedError=="function"&&SuppressedError;var Y=function(o,t){return K(void 0,void 0,void 0,function(){return X(this,function(i){return[2,new Promise(function(l,n){try{if(window.DocsAPI)return l(null);var s=document.getElementById(t);if(s)var a=setInterval(function(){var p=s.getAttribute("loading");if(!p){if(clearInterval(a),window.DocsAPI)return l(null);var r=R(t,o,l,n);s.remove(),document.body.appendChild(r)}},500);else{var d=R(t,o,l,n);document.body.appendChild(d)}}catch(p){console.error(p)}})]})})},R=function(o,t,i,l){var n=document.createElement("script");return n.id=o,n.type="text/javascript",n.src=t,n.async=!0,n.onload=function(){n.removeAttribute("loading"),i(null)},n.onerror=function(s){n.removeAttribute("loading"),l(s)},n.setAttribute("loading",""),n},_=e.defineComponent({name:"DocumentEditor",props:{id:{type:String,required:!0},documentServerUrl:{type:String,required:!0},config:{type:Object,required:!0},document_fileType:String,document_title:String,documentType:String,editorConfig_lang:String,height:String,type:String,width:String,onLoadComponentError:Function,events_onAppReady:Function,events_onDocumentStateChange:Function,events_onMetaChange:Function,events_onDocumentReady:Function,events_onInfo:Function,events_onWarning:Function,events_onError:Function,events_onRequestSharingSettings:Function,events_onRequestRename:Function,events_onMakeActionLink:Function,events_onRequestInsertImage:Function,events_onRequestSaveAs:Function,events_onRequestMailMergeRecipients:Function,events_onRequestCompareFile:Function,events_onRequestEditRights:Function,events_onRequestHistory:Function,events_onRequestHistoryClose:Function,events_onRequestHistoryData:Function,events_onRequestRestore:Function,events_onRequestSelectSpreadsheet:Function,events_onRequestSelectDocument:Function},mounted:function(){var o=this,t=this.documentServerUrl;t.endsWith("/")||(t+="/");var i="".concat(t,"web-apps/apps/api/documents/api.js");Y(i,"onlyoffice-api-script").then(function(){return o.onLoad()}).catch(function(){o.onError(-2)})},unmounted:function(){var o,t=this.id||"";!((o=window==null?void 0:window.DocEditor)===null||o===void 0)&&o.instances[t]&&(window.DocEditor.instances[t].destroyEditor(),window.DocEditor.instances[t]=void 0)},watch:{config:{handler:function(o,t){this.onChangeProps()},deep:!0},document_fileType:function(o,t){this.onChangeProps()},document_title:function(o,t){this.onChangeProps()},documentType:function(o,t){this.onChangeProps()},editorConfig_lang:function(o,t){this.onChangeProps()},height:function(o,t){this.onChangeProps()},type:function(o,t){this.onChangeProps()},width:function(o,t){this.onChangeProps()}},methods:{onLoad:function(){var o,t;try{var i=this.id||"";if(window.DocsAPI||this.onError(-3),!((o=window==null?void 0:window.DocEditor)===null||o===void 0)&&o.instances[i]){console.log("Skip loading. Instance already exists",i);return}!((t=window==null?void 0:window.DocEditor)===null||t===void 0)&&t.instances||(window.DocEditor={instances:{}});var l=Object.assign({document:{fileType:this.document_fileType,title:this.document_title},documentType:this.documentType,editorConfig:{lang:this.editorConfig_lang},events:{onAppReady:this.onAppReady,onDocumentStateChange:this.events_onDocumentStateChange,onMetaChange:this.events_onMetaChange,onDocumentReady:this.events_onDocumentReady,onInfo:this.events_onInfo,onWarning:this.events_onWarning,onError:this.events_onError,onRequestSharingSettings:this.events_onRequestSharingSettings,onRequestRename:this.events_onRequestRename,onMakeActionLink:this.events_onMakeActionLink,onRequestInsertImage:this.events_onRequestInsertImage,onRequestSaveAs:this.events_onRequestSaveAs,onRequestMailMergeRecipients:this.events_onRequestMailMergeRecipients,onRequestCompareFile:this.events_onRequestCompareFile,onRequestEditRights:this.events_onRequestEditRights,onRequestHistory:this.events_onRequestHistory,onRequestHistoryClose:this.events_onRequestHistoryClose,onRequestHistoryData:this.events_onRequestHistoryData,onRequestRestore:this.events_onRequestRestore,onRequestSelectSpreadsheet:this.events_onRequestSelectSpreadsheet,onRequestSelectDocument:this.events_onRequestSelectDocument},height:this.height,type:this.type,width:this.width},this.config||{}),n=window.DocsAPI.DocEditor(i,l);window.DocEditor.instances[i]=n}catch(s){console.error(s),this.onError(-1)}},onError:function(o){var t;switch(o){case-2:t="Error load DocsAPI from "+this.documentServerUrl;break;case-3:t="DocsAPI is not defined";break;default:t="Unknown error loading component",o=-1}typeof this.onLoadComponentError>"u"?console.error(t):this.onLoadComponentError(o,t)},onAppReady:function(){var o=this.id||"";this.events_onAppReady(window.DocEditor.instances[o])},onChangeProps:function(){var o,t=this.id||"";!((o=window==null?void 0:window.DocEditor)===null||o===void 0)&&o.instances[t]&&(window.DocEditor.instances[t].destroyEditor(),window.DocEditor.instances[t]=void 0,console.log("Important props have been changed. Load new Editor."),this.onLoad())}}});const G=["id"];function J(o,t,i,l,n,s){return e.openBlock(),e.createElementBlock("div",{id:o.id},null,8,G)}_.render=J,_.__file="src/components/DocumentEditor.vue";const Q=e.defineComponent({__name:"IkOnlyOffice",props:{documentServerUrl:{type:String,default:""},configOptions:{type:Object,default:()=>{}},officeHeight:{type:String,default:"100%"}},setup(o){const t=o,i=e.ref({width:"100%",height:"100%",...t.configOptions||{}}),l=()=>{console.info("文档加载完成",t.configOptions)};return(n,s)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({height:t.officeHeight})},[e.createVNode(e.unref(_),{id:`${new Date().getTime()}`,ref:"editorRef","document-server-url":o.documentServerUrl,config:i.value,events_onDocumentReady:l},null,8,["id","document-server-url","config"])],4))}}),le="",Z=w(k(Q,[["__scopeId","data-v-fe959cd8"]])),ee=e.defineComponent({__name:"IkPreviewFileDialog",props:e.mergeModels({file:{type:Object,default:()=>[]},loadUrl:{type:String,default:""},onlyOfficeAccept:{type:String,default:".pdf,.docx,.doc.ppt,.pptx,.xlsx,.xls,"},onlyofficeServer:{type:String,default:""},onlyOfficeConfig:{type:Object,default:()=>({})},field:{type:Object,default:()=>({})}},{show:{default:!1},showModifiers:{}}),emits:["update:show"],setup(o){const t=o,i=e.useModel(o,"show"),l=e.computed(()=>({name:"name",url:"url",suffix:"suffix",size:"fileSize",...t.field})),n=e.ref(null),s=e.ref(null),a=e.reactive({image:!1,office:!1,video:!1}),d=r=>{var c,m,g,h,y,E;try{const u=((c=r==null?void 0:r.response)==null?void 0:c.data)||r,x=u[l.value.url]||(u==null?void 0:u.id)||u.attachmentId,b=(m=u[l.value.suffix]||u.attachmentSuffix)==null?void 0:m.toLowerCase(),te=u[l.value.name]||(u==null?void 0:u.attachmentName);if(s.value={...r,name:r[l.value.name],url:S(t.loadUrl,x)},r&&I(r,l.value)==="image"){a.image=!0;return}else if(t.onlyOfficeAccept.includes(b)){a.office=!0,n.value={...t.onlyOfficeConfig,editorConfig:{...((g=t.onlyOfficeConfig)==null?void 0:g.editorConfig)||{},customization:{...((y=(h=t.onlyOfficeConfig)==null?void 0:h.editorConfig)==null?void 0:y.customization)||{},review:{reviewDisplay:"final"}}},document:{key:C.buildUUID(),title:te,url:S(t.loadUrl,x),fileType:b,...((E=t.onlyOfficeConfig)==null?void 0:E.document)||{}},documentType:q(b)};return}}catch(u){console.info("预览错误: ",u)}};e.watch([i,t.file],([r,c])=>{r&&e.nextTick(()=>{d(t.file)})});const p=()=>{i.value=!1,a.office=!1,a.image=!1,a.video=!1};return(r,c)=>{var g,h;const m=e.resolveComponent("el-image-viewer");return i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(g=s.value)!=null&&g.url&&a.image?(e.openBlock(),e.createBlock(m,{key:0,onClose:c[0]||(c[0]=y=>{s.value=null,a.image=!1}),ref:"previewImgRef","url-list":[(h=s.value)==null?void 0:h.url]},null,8,["url-list"])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" 文档类 "),e.createVNode(e.unref(W),{modelValue:a.office,"onUpdate:modelValue":c[1]||(c[1]=y=>a.office=y),draggable:"","no-footer":"","no-header":"",fullscreen:"","show-close-bg":"","destroy-on-close":"","close-on-click-modal":"","close-on-press-escape":!1,"append-to-body":"",onClose:p,"modal-class":"ik-only-preview-dialog"},{default:e.withCtx(()=>[e.createVNode(e.unref(Z),{configOptions:n.value,documentServerUrl:o.onlyofficeServer,mode:"view"},null,8,["configOptions","documentServerUrl"])]),_:1},8,["modelValue"])],64)):e.createCommentVNode("v-if",!0)}}}),ae="",z=w(ee);f.IkPreviewFileDialog=z,f.default=z,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("iking-utils-pro")):typeof define=="function"&&define.amd?define(["exports","vue","iking-utils-pro"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f.index={},f.vue,f["iking-utils-pro"]))})(this,function(f,e,C){"use strict";const w=(o,t)=>{if(o.install=i=>{for(const r of[o,...Object.values(t??{})])i.component(r.name,r)},t)for(const[i,r]of Object.entries(t))o[i]=r;return o},S=(o,t)=>t?t.startsWith("http")?t:`${o||location.origin}${t}`:"",k=(o,t)=>{const i=o.__vccOpts||o;for(const[r,n]of t)i[r]=n;return i},D=(o,t)=>{var s,a,d,u;const i=(s=o==null?void 0:o.response)!=null&&s.data?B((d=(a=o==null?void 0:o.response)==null?void 0:a.data)==null?void 0:d.suffix):((u=o.raw)==null?void 0:u.type)||B(o[t.suffix]),r=i==null?void 0:i.toLowerCase(),n={sheet:"excel",excel:"excel",zip:"zip","application/x-compressed":"zip",image:"image",video:"video",audio:"audio",pdf:"pdf",text:"txt",txt:"txt",word:"word",ppt:"ppt",exe:"exe",json:"json"};for(let l in n)if(typeof r=="string"&&(r.includes(l)||r===l))return n[l];return"unknown"},q={".doc":"word",".docx":"word",".docxf":"word",".docm":"word",".dot":"word",".dotm":"word",".dotx":"word",".epub":"word",".fodt":"word",".htm":"word",".html":"word",".mht":"word",".odt":"word",".ott":"word",".rtf":"word",".djvu":"word",".oxps":"word",".oform":"word",".fb2":"word",".xml":"word",".xps":"word",".csv":"excel",".xls":"excel",".xlsx":"excel",".fods":"excel",".ods":"excel",".ots":"excel",".xlsb":"excel",".xlsm":"excel",".xlt":"excel",".xltm":"excel",".xltx":"excel",".fodp":"ppt",".odp":"ppt",".otp":"ppt",".pot":"ppt",".potm":"ppt",".potx":"ppt",".pps":"ppt",".ppsm":"ppt",".ppsx":"ppt",".ppt":"ppt",".pptm":"ppt",".pptx":"ppt",".zip":"zip",".rar":"zip",".7z":"zip",".apz":"zip",".ar":"zip",".bz":"zip",".car":"zip",".dar":"zip",".cpgz":"zip",".f":"zip",".ha":"zip",".hbc":"zip",".hbc2":"zip",".hbe":"zip",".hpk":"zip",".hyp":"zip",".png":"image",".jpg":"image",".jpeg":"image",".bmp":"image",".gif":"image",".webp":"image",".psd":"image",".svg":"image",".tiff":"image",".avi":"video",".wmv":"video",".mpeg":"video",".mp4":"video",".mpm4v":"video",".mov":"video",".asf":"video",".flv":"video",".f4v":"video",".rmvb":"video",".rm":"video",".3gp":"video",".vob":"video",".txt":"txt",".pdf":"pdf"},B=o=>{const t=o==null?void 0:o.toLocaleLowerCase(),i=t!=null&&t.startsWith(".")?t:`.${t}`;return i&&q[i]||"unknow"},V=o=>{let t="",i=["doc","docx"],r=["xls","xlsx"],n=["ppt","pptx"],s=["pdf"];return i.includes(o)&&(t="word"),r.includes(o)&&(t="cell"),n.includes(o)&&(t="slide"),s.includes(o)&&(t="text-pdf"),t},F={key:0,class:"ik-svg-icon ik-icon inline-block inline-flex justify-center box-content line-height-[0]"},O={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},$=["xlink:href"],T=["src"],A={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},M=["xlink:href"],P=["src"],j=e.defineComponent({name:"IkSvgIcon",__name:"index",props:{name:{},flip:{},rotate:{},color:{},colorLight:{},opacity:{default:.5},size:{default:""},width:{},bg:{type:Boolean,default:!1},showBg:{type:Boolean,default:!1},padding:{default:"6px"},primary:{type:Boolean},warning:{type:Boolean},success:{type:Boolean},error:{type:Boolean},notip:{type:Boolean,default:!1},title:{},type:{},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tableIconType:{default:"icon"}},setup(o){const t=o,i=e.computed(()=>{var n,s,a;return/^http?:\/\//.test(t.name)?"img":/i-[^:]+:[^:]+/.test(t.name)?"unocss":(n=t.name)!=null&&n.startsWith("iksig")?"iksig":(s=t.name)!=null&&s.includes(":")?"iconify":(a=t.name)!=null&&a.startsWith("iksvg")?"svg":"i"}),r=e.computed(()=>{const n=[];if(t.flip)switch(t.flip){case"horizontal":n.push("rotateY(180deg)");break;case"vertical":n.push("rotateX(180deg)");break;case"both":n.push("rotateX(180deg)"),n.push("rotateY(180deg)");break}t.rotate&&n.push(`rotate(${t.rotate%360}deg)`);const s={...t.color&&{color:t.color},...t.size&&{fontSize:typeof t.size=="number"?`${t.size}px`:t.size},...n.length&&{transform:n.join(" ")},padding:t.showBg||t.bg?t.padding:0,...t.color&&i.value!=="iksig"?{"--ik-color-icon-dark":t.color,"--ik-color-icon-light":t.colorLight||C.ikColor.setOpacity(t.color,t.opacity)}:{}};return t.width&&(s.width=s.height=typeof t.width=="number"?`${t.width}px`:t.width),s});return(n,s)=>{const a=e.resolveComponent("el-tooltip"),d=e.resolveComponent("el-button");return n.tableIconType==="icon"?(e.openBlock(),e.createElementBlock("span",F,[n.notip||!n.title?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[n.name]:i.value==="unocss","show-bg":n.showBg||n.bg,default:n.size==="default",small:n.size==="small",big:n.size==="big",warning:n.warning||t.type==="warning",primary:n.primary||t.type==="primary",success:n.success||t.type==="success",error:n.error||t.type==="error",active:n.active,disabled:n.disabled}]),style:e.normalizeStyle(r.value)},[e.createCommentVNode(` <Icon v-if="outputType === 'iconify'" :icon="name" /> `),i.value==="iksig"?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(`iksig ${n.name}`),style:e.normalizeStyle(r.value)},null,6)):i.value==="svg"?(e.openBlock(),e.createElementBlock("svg",O,[e.createElementVNode("use",{"xlink:href":`#${n.name}`},null,8,$)])):i.value==="img"?(e.openBlock(),e.createElementBlock("img",{key:2,src:n.name,class:"h-[1em] w-[1em]"},null,8,T)):(e.openBlock(),e.createElementBlock("i",{key:3,class:e.normalizeClass(n.name),style:e.normalizeStyle(r.value)},null,6))],6)):(e.openBlock(),e.createBlock(a,{key:1,content:n.title,placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[n.name]:i.value==="unocss","show-bg":n.showBg||n.bg,default:n.size==="default",small:n.size==="small",big:n.size==="big",warning:n.warning||t.type==="warning",primary:n.primary||t.type==="primary",success:n.success||t.type==="success",error:n.error||t.type==="error",active:n.active}]),style:e.normalizeStyle(r.value)},[i.value==="iksig"?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(`iksig ${n.name}`),style:e.normalizeStyle(r.value)},null,6)):i.value==="svg"?(e.openBlock(),e.createElementBlock("svg",A,[e.createElementVNode("use",{"xlink:href":`#${n.name}`},null,8,M)])):i.value==="img"?(e.openBlock(),e.createElementBlock("img",{key:2,src:n.name,class:"h-[1em] w-[1em]"},null,8,P)):(e.openBlock(),e.createElementBlock("i",{key:3,class:e.normalizeClass(n.name),style:e.normalizeStyle(r.value)},null,6))],6)]),_:1},8,["content"]))])):(e.openBlock(),e.createBlock(d,{key:1,type:["warning","error"].includes(n.type)?"danger":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.title),1)]),_:1},8,["type"]))}}}),oe="",v=w(k(j,[["__scopeId","data-v-7d95dbf5"]])),N={key:0,class:"exit-main-page-maximize"},L=e.defineComponent({__name:"CloseIcon",props:{showBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},setup(o){return(t,i)=>(e.openBlock(),e.createElementBlock("div",null,[o.showBg&&o.fullscreen?(e.openBlock(),e.createElementBlock("div",N,[e.createVNode(e.unref(v),{name:"iksvg_guanbidanchuang",title:"关闭",size:20,error:""})])):(e.openBlock(),e.createBlock(e.unref(v),{key:1,error:"",name:"iksvg_guanbidanchuang",title:"关闭",size:20}))]))}}),se="",U=k(L,[["__scopeId","data-v-79f49df8"]]),H={class:"base-header"},W=e.defineComponent({__name:"IkBaseDialog",props:e.mergeModels({title:{default:""},cancelText:{default:"取消"},confirmText:{default:"确认"},noHeader:{type:Boolean},noFooter:{type:Boolean},showCloseBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1,noHeader:!1,noFooter:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,i=e.useModel(o,"modelValue"),r=e.ref(t.fullscreen),n=()=>{r.value=!r.value},s=e.defineComponent({setup(){return()=>e.h(U,{showBg:t.showCloseBg,fullscreen:t.fullscreen})}});return(a,d)=>{const u=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(u,e.mergeProps({modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=l=>i.value=l)},a.$attrs,{"close-icon":e.unref(s),class:`ik-base-dialog ${a.noHeader?"no-header":""} ${a.noFooter?"no-footer":""}`,fullscreen:r.value,"modal-class":"baseDialog"}),e.createSlots({icon:e.withCtx(()=>[e.renderSlot(a.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(a.title),1)])]),header:e.withCtx(()=>[e.createElementVNode("div",H,[e.renderSlot(a.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(a.title),1)])]),a.$attrs.showClose?(e.openBlock(),e.createBlock(e.unref(v),{key:0,onClick:n,name:r.value?"iksvg_tuichuquanping":"iksvg_quanping-daohang",class:"absolute! top-[18px] right-[50px] icon-dialog-full",title:r.value?"退出全屏":"全屏"},null,8,["name","title"])):e.createCommentVNode("v-if",!0)]),default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:2},[a.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"footer")]),key:"0"}:void 0]),1040,["modelValue","close-icon","class","fullscreen"])}}}),re="",K=w(W);function X(o,t,i,r){function n(s){return s instanceof i?s:new i(function(a){a(s)})}return new(i||(i=Promise))(function(s,a){function d(c){try{l(r.next(c))}catch(m){a(m)}}function u(c){try{l(r.throw(c))}catch(m){a(m)}}function l(c){c.done?s(c.value):n(c.value).then(d,u)}l((r=r.apply(o,t||[])).next())})}function Y(o,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,a;return a={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function d(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(s=i.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){i.label=l[1];break}if(l[0]===6&&i.label<s[1]){i.label=s[1],s=l;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(l);break}s[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(o,i)}catch(c){l=[6,c],n=0}finally{r=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}typeof SuppressedError=="function"&&SuppressedError;var G=function(o,t){return X(void 0,void 0,void 0,function(){return Y(this,function(i){return[2,new Promise(function(r,n){try{if(window.DocsAPI)return r(null);var s=document.getElementById(t);if(s)var a=setInterval(function(){var u=s.getAttribute("loading");if(!u){if(clearInterval(a),window.DocsAPI)return r(null);var l=R(t,o,r,n);s.remove(),document.body.appendChild(l)}},500);else{var d=R(t,o,r,n);document.body.appendChild(d)}}catch(u){console.error(u)}})]})})},R=function(o,t,i,r){var n=document.createElement("script");return n.id=o,n.type="text/javascript",n.src=t,n.async=!0,n.onload=function(){n.removeAttribute("loading"),i(null)},n.onerror=function(s){n.removeAttribute("loading"),r(s)},n.setAttribute("loading",""),n},_=e.defineComponent({name:"DocumentEditor",props:{id:{type:String,required:!0},documentServerUrl:{type:String,required:!0},config:{type:Object,required:!0},document_fileType:String,document_title:String,documentType:String,editorConfig_lang:String,height:String,type:String,width:String,onLoadComponentError:Function,events_onAppReady:Function,events_onDocumentStateChange:Function,events_onMetaChange:Function,events_onDocumentReady:Function,events_onInfo:Function,events_onWarning:Function,events_onError:Function,events_onRequestSharingSettings:Function,events_onRequestRename:Function,events_onMakeActionLink:Function,events_onRequestInsertImage:Function,events_onRequestSaveAs:Function,events_onRequestMailMergeRecipients:Function,events_onRequestCompareFile:Function,events_onRequestEditRights:Function,events_onRequestHistory:Function,events_onRequestHistoryClose:Function,events_onRequestHistoryData:Function,events_onRequestRestore:Function,events_onRequestSelectSpreadsheet:Function,events_onRequestSelectDocument:Function},mounted:function(){var o=this,t=this.documentServerUrl;t.endsWith("/")||(t+="/");var i="".concat(t,"web-apps/apps/api/documents/api.js");G(i,"onlyoffice-api-script").then(function(){return o.onLoad()}).catch(function(){o.onError(-2)})},unmounted:function(){var o,t=this.id||"";!((o=window==null?void 0:window.DocEditor)===null||o===void 0)&&o.instances[t]&&(window.DocEditor.instances[t].destroyEditor(),window.DocEditor.instances[t]=void 0)},watch:{config:{handler:function(o,t){this.onChangeProps()},deep:!0},document_fileType:function(o,t){this.onChangeProps()},document_title:function(o,t){this.onChangeProps()},documentType:function(o,t){this.onChangeProps()},editorConfig_lang:function(o,t){this.onChangeProps()},height:function(o,t){this.onChangeProps()},type:function(o,t){this.onChangeProps()},width:function(o,t){this.onChangeProps()}},methods:{onLoad:function(){var o,t;try{var i=this.id||"";if(window.DocsAPI||this.onError(-3),!((o=window==null?void 0:window.DocEditor)===null||o===void 0)&&o.instances[i]){console.log("Skip loading. Instance already exists",i);return}!((t=window==null?void 0:window.DocEditor)===null||t===void 0)&&t.instances||(window.DocEditor={instances:{}});var r=Object.assign({document:{fileType:this.document_fileType,title:this.document_title},documentType:this.documentType,editorConfig:{lang:this.editorConfig_lang},events:{onAppReady:this.onAppReady,onDocumentStateChange:this.events_onDocumentStateChange,onMetaChange:this.events_onMetaChange,onDocumentReady:this.events_onDocumentReady,onInfo:this.events_onInfo,onWarning:this.events_onWarning,onError:this.events_onError,onRequestSharingSettings:this.events_onRequestSharingSettings,onRequestRename:this.events_onRequestRename,onMakeActionLink:this.events_onMakeActionLink,onRequestInsertImage:this.events_onRequestInsertImage,onRequestSaveAs:this.events_onRequestSaveAs,onRequestMailMergeRecipients:this.events_onRequestMailMergeRecipients,onRequestCompareFile:this.events_onRequestCompareFile,onRequestEditRights:this.events_onRequestEditRights,onRequestHistory:this.events_onRequestHistory,onRequestHistoryClose:this.events_onRequestHistoryClose,onRequestHistoryData:this.events_onRequestHistoryData,onRequestRestore:this.events_onRequestRestore,onRequestSelectSpreadsheet:this.events_onRequestSelectSpreadsheet,onRequestSelectDocument:this.events_onRequestSelectDocument},height:this.height,type:this.type,width:this.width},this.config||{}),n=window.DocsAPI.DocEditor(i,r);window.DocEditor.instances[i]=n}catch(s){console.error(s),this.onError(-1)}},onError:function(o){var t;switch(o){case-2:t="Error load DocsAPI from "+this.documentServerUrl;break;case-3:t="DocsAPI is not defined";break;default:t="Unknown error loading component",o=-1}typeof this.onLoadComponentError>"u"?console.error(t):this.onLoadComponentError(o,t)},onAppReady:function(){var o=this.id||"";this.events_onAppReady(window.DocEditor.instances[o])},onChangeProps:function(){var o,t=this.id||"";!((o=window==null?void 0:window.DocEditor)===null||o===void 0)&&o.instances[t]&&(window.DocEditor.instances[t].destroyEditor(),window.DocEditor.instances[t]=void 0,console.log("Important props have been changed. Load new Editor."),this.onLoad())}}});const J=["id"];function Q(o,t,i,r,n,s){return e.openBlock(),e.createElementBlock("div",{id:o.id},null,8,J)}_.render=Q,_.__file="src/components/DocumentEditor.vue";const Z=e.defineComponent({__name:"IkOnlyOffice",props:{documentServerUrl:{type:String,default:""},configOptions:{type:Object,default:()=>{}},officeHeight:{type:String,default:"100%"}},setup(o){const t=o,i=e.ref({width:"100%",height:"100%",...t.configOptions||{},...t.configOptions}),r=()=>{console.info("文档加载完成",t.configOptions)};return(n,s)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({height:t.officeHeight})},[e.createVNode(e.unref(_),{id:`${new Date().getTime()}`,ref:"editorRef","document-server-url":o.documentServerUrl,config:i.value,events_onDocumentReady:r},null,8,["id","document-server-url","config"])],4))}}),le="",ee=w(k(Z,[["__scopeId","data-v-98d51ef9"]])),te=e.defineComponent({__name:"IkPreviewFileDialog",props:e.mergeModels({file:{type:Object,default:()=>[]},loadUrl:{type:String,default:""},onlyOfficeAccept:{type:String,default:".pdf,.docx,.doc.ppt,.pptx,.xlsx,.xls,"},onlyofficeServer:{type:String,default:""},onlyOfficeConfig:{type:Object,default:()=>({})},field:{type:Object,default:()=>({})}},{show:{default:!1},showModifiers:{}}),emits:["update:show"],setup(o){const t=o,i=e.useModel(o,"show"),r=e.computed(()=>({name:"name",url:"url",suffix:"suffix",size:"fileSize",...t.field})),n=e.ref(null),s=e.ref(null),a=e.reactive({image:!1,office:!1,video:!1}),d=l=>{var c,m,g,h,y,E,x;try{const p=((c=l==null?void 0:l.response)==null?void 0:c.data)||l,I=p[r.value.url]||(p==null?void 0:p.id)||p.attachmentId,b=(m=p[r.value.suffix]||p.attachmentSuffix)==null?void 0:m.toLowerCase(),ne=p[r.value.name]||(p==null?void 0:p.attachmentName)||(p==null?void 0:p.originName);if(s.value={...l,name:l[r.value.name],url:S(t.loadUrl,I)},l&&D(l,r.value)==="image"){a.image=!0;return}else if((((g=t.onlyOfficeConfig)==null?void 0:g.accept)||t.onlyOfficeAccept).includes(b)){a.office=!0,n.value={...t.onlyOfficeConfig,editorConfig:{...((h=t.onlyOfficeConfig)==null?void 0:h.editorConfig)||{},customization:{...((E=(y=t.onlyOfficeConfig)==null?void 0:y.editorConfig)==null?void 0:E.customization)||{},review:{reviewDisplay:"final"}}},document:{key:C.buildUUID(),title:ne,url:S(t.loadUrl,I),fileType:b,...((x=t.onlyOfficeConfig)==null?void 0:x.document)||{}},documentType:V(b)};return}}catch(p){console.info("预览错误: ",p)}};e.watch([i,t.file],([l,c])=>{l&&e.nextTick(()=>{d(t.file)})});const u=()=>{i.value=!1,a.office=!1,a.image=!1,a.video=!1};return(l,c)=>{var g,h;const m=e.resolveComponent("el-image-viewer");return i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(g=s.value)!=null&&g.url&&a.image?(e.openBlock(),e.createBlock(m,{key:0,onClose:c[0]||(c[0]=y=>{s.value=null,a.image=!1}),ref:"previewImgRef","url-list":[(h=s.value)==null?void 0:h.url]},null,8,["url-list"])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" 文档类 "),e.createVNode(e.unref(K),{modelValue:a.office,"onUpdate:modelValue":c[1]||(c[1]=y=>a.office=y),draggable:"","no-footer":"","no-header":"",fullscreen:"","show-close-bg":"","destroy-on-close":"","close-on-click-modal":"","close-on-press-escape":!1,"append-to-body":"",onClose:u,"modal-class":"ik-only-preview-dialog"},{default:e.withCtx(()=>[e.createVNode(e.unref(ee),{"config-options":n.value,"document-server-url":o.onlyOfficeConfig.serverUrl||o.onlyofficeServer},null,8,["config-options","document-server-url"])]),_:1},8,["modelValue"])],64)):e.createCommentVNode("v-if",!0)}}}),ce="",z=w(te);f.IkPreviewFileDialog=z,f.default=z,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,4 +1,4 @@
1
- import { defineComponent as I, openBlock as d, createElementBlock as w, ref as O, normalizeStyle as H, createVNode as E, unref as $, watch as U, resolveComponent as D, Fragment as T, renderList as F, createBlock as k, withCtx as m, createElementVNode as c, toDisplayString as R, createCommentVNode as C, normalizeClass as A, pushScopeId as N, popScopeId as j, useCssVars as W } from "vue";
1
+ import { defineComponent as I, openBlock as d, createElementBlock as w, ref as T, normalizeStyle as H, createVNode as E, unref as $, watch as U, resolveComponent as D, Fragment as O, renderList as F, createBlock as k, withCtx as m, createElementVNode as c, toDisplayString as R, createCommentVNode as C, normalizeClass as A, pushScopeId as N, popScopeId as j, useCssVars as W } from "vue";
2
2
  const L = (e, t) => {
3
3
  if (e.install = (n) => {
4
4
  for (const i of [e, ...Object.values(t ?? {})])
@@ -331,10 +331,11 @@ const Q = /* @__PURE__ */ I({
331
331
  }
332
332
  },
333
333
  setup(e) {
334
- const t = e, n = O({
334
+ const t = e, n = T({
335
335
  width: "100%",
336
336
  height: "100%",
337
- ...t.configOptions || {}
337
+ ...t.configOptions || {},
338
+ ...t.configOptions
338
339
  }), i = () => {
339
340
  console.info("文档加载完成", t.configOptions);
340
341
  };
@@ -362,7 +363,7 @@ const P = (e, t) => {
362
363
  for (const [i, s] of t)
363
364
  n[i] = s;
364
365
  return n;
365
- }, Y = /* @__PURE__ */ P(Q, [["__scopeId", "data-v-fe959cd8"]]), Z = L(Y), ee = Z, M = (e) => (N("data-v-af8d674c"), e = e(), j(), e), te = { class: "template-data" }, ne = { class: "operate-btn" }, oe = ["onClick"], ie = ["onClick"], ae = { class: "m-12 point" }, se = { class: "flex" }, re = ["onClick"], le = /* @__PURE__ */ M(() => /* @__PURE__ */ c(
366
+ }, Y = /* @__PURE__ */ P(Q, [["__scopeId", "data-v-98d51ef9"]]), Z = L(Y), ee = Z, M = (e) => (N("data-v-af8d674c"), e = e(), j(), e), te = { class: "template-data" }, ne = { class: "operate-btn" }, oe = ["onClick"], ie = ["onClick"], ae = { class: "m-12 point" }, se = { class: "flex" }, re = ["onClick"], le = /* @__PURE__ */ M(() => /* @__PURE__ */ c(
366
367
  "i",
367
368
  { class: "icon-icon_particulars iconfont tips" },
368
369
  null,
@@ -426,7 +427,7 @@ const P = (e, t) => {
426
427
  }))
427
428
  }));
428
429
  v.value = S;
429
- }, v = O(n.data);
430
+ }, v = T(n.data);
430
431
  return U(
431
432
  () => n.data,
432
433
  (l) => {
@@ -439,7 +440,7 @@ const P = (e, t) => {
439
440
  const y = D("el-popover");
440
441
  return d(), w("div", te, [
441
442
  (d(!0), w(
442
- T,
443
+ O,
443
444
  null,
444
445
  F(v.value, (u, q) => (d(), w("div", {
445
446
  key: q,
@@ -484,7 +485,7 @@ const P = (e, t) => {
484
485
  1024
485
486
  /* DYNAMIC_SLOTS */
486
487
  )) : (d(), w(
487
- T,
488
+ O,
488
489
  { key: 1 },
489
490
  [
490
491
  C(" 不能操作的标题 "),
@@ -516,7 +517,7 @@ const P = (e, t) => {
516
517
  C(" 标题下的内容 "),
517
518
  c("div", de, [
518
519
  (d(!0), w(
519
- T,
520
+ O,
520
521
  null,
521
522
  F(u.children, (r, B) => (d(), w("div", {
522
523
  key: B,
@@ -692,9 +693,9 @@ const we = /* @__PURE__ */ P(ye, [["__scopeId", "data-v-af8d674c"]]), Se = { cla
692
693
  W((_) => ({
693
694
  f1632ab6: e.contentHeight
694
695
  }));
695
- const i = e, s = n, o = O(i.tabsData[0].id), p = (_) => {
696
+ const i = e, s = n, o = T(i.tabsData[0].id), p = (_) => {
696
697
  f.value = "", o.value = _, _ && s("handleSearchDataBlock", "", o.value);
697
- }, f = O(""), g = () => {
698
+ }, f = T(""), g = () => {
698
699
  s("handleSearchDataBlock", f.value, o.value);
699
700
  }, a = (_, v) => {
700
701
  s("handleClickBlockData", _, v);
@@ -717,7 +718,7 @@ const we = /* @__PURE__ */ P(ye, [["__scopeId", "data-v-af8d674c"]]), Se = { cla
717
718
  }, {
718
719
  default: m(() => [
719
720
  (d(!0), w(
720
- T,
721
+ O,
721
722
  null,
722
723
  F(i.tabsData, (r, B) => (d(), k(l, {
723
724
  key: B,
@@ -1 +1 @@
1
- (function(k,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(k=typeof globalThis<"u"?globalThis:k||self,e(k.index={},k.vue))})(this,function(k,e){"use strict";const v=(t,n)=>{if(t.install=o=>{for(const i of[t,...Object.values(n??{})])o.component(i.name,i)},n)for(const[o,i]of Object.entries(n))t[o]=i;return t};function O(t,n,o,i){function r(a){return a instanceof o?a:new o(function(p){p(a)})}return new(o||(o=Promise))(function(a,p){function h(f){try{s(i.next(f))}catch(u){p(u)}}function _(f){try{s(i.throw(f))}catch(u){p(u)}}function s(f){f.done?a(f.value):r(f.value).then(h,_)}s((i=i.apply(t,n||[])).next())})}function V(t,n){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,r,a,p;return p={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function h(s){return function(f){return _([s,f])}}function _(s){if(i)throw new TypeError("Generator is already executing.");for(;p&&(p=0,s[0]&&(o=0)),o;)try{if(i=1,r&&(a=s[0]&2?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(s[0]===6&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(t,o)}catch(f){s=[6,f],r=0}finally{i=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}typeof SuppressedError=="function"&&SuppressedError;var T=function(t,n){return O(void 0,void 0,void 0,function(){return V(this,function(o){return[2,new Promise(function(i,r){try{if(window.DocsAPI)return i(null);var a=document.getElementById(n);if(a)var p=setInterval(function(){var _=a.getAttribute("loading");if(!_){if(clearInterval(p),window.DocsAPI)return i(null);var s=b(n,t,i,r);a.remove(),document.body.appendChild(s)}},500);else{var h=b(n,t,i,r);document.body.appendChild(h)}}catch(_){console.error(_)}})]})})},b=function(t,n,o,i){var r=document.createElement("script");return r.id=t,r.type="text/javascript",r.src=n,r.async=!0,r.onload=function(){r.removeAttribute("loading"),o(null)},r.onerror=function(a){r.removeAttribute("loading"),i(a)},r.setAttribute("loading",""),r},C=e.defineComponent({name:"DocumentEditor",props:{id:{type:String,required:!0},documentServerUrl:{type:String,required:!0},config:{type:Object,required:!0},document_fileType:String,document_title:String,documentType:String,editorConfig_lang:String,height:String,type:String,width:String,onLoadComponentError:Function,events_onAppReady:Function,events_onDocumentStateChange:Function,events_onMetaChange:Function,events_onDocumentReady:Function,events_onInfo:Function,events_onWarning:Function,events_onError:Function,events_onRequestSharingSettings:Function,events_onRequestRename:Function,events_onMakeActionLink:Function,events_onRequestInsertImage:Function,events_onRequestSaveAs:Function,events_onRequestMailMergeRecipients:Function,events_onRequestCompareFile:Function,events_onRequestEditRights:Function,events_onRequestHistory:Function,events_onRequestHistoryClose:Function,events_onRequestHistoryData:Function,events_onRequestRestore:Function,events_onRequestSelectSpreadsheet:Function,events_onRequestSelectDocument:Function},mounted:function(){var t=this,n=this.documentServerUrl;n.endsWith("/")||(n+="/");var o="".concat(n,"web-apps/apps/api/documents/api.js");T(o,"onlyoffice-api-script").then(function(){return t.onLoad()}).catch(function(){t.onError(-2)})},unmounted:function(){var t,n=this.id||"";!((t=window==null?void 0:window.DocEditor)===null||t===void 0)&&t.instances[n]&&(window.DocEditor.instances[n].destroyEditor(),window.DocEditor.instances[n]=void 0)},watch:{config:{handler:function(t,n){this.onChangeProps()},deep:!0},document_fileType:function(t,n){this.onChangeProps()},document_title:function(t,n){this.onChangeProps()},documentType:function(t,n){this.onChangeProps()},editorConfig_lang:function(t,n){this.onChangeProps()},height:function(t,n){this.onChangeProps()},type:function(t,n){this.onChangeProps()},width:function(t,n){this.onChangeProps()}},methods:{onLoad:function(){var t,n;try{var o=this.id||"";if(window.DocsAPI||this.onError(-3),!((t=window==null?void 0:window.DocEditor)===null||t===void 0)&&t.instances[o]){console.log("Skip loading. Instance already exists",o);return}!((n=window==null?void 0:window.DocEditor)===null||n===void 0)&&n.instances||(window.DocEditor={instances:{}});var i=Object.assign({document:{fileType:this.document_fileType,title:this.document_title},documentType:this.documentType,editorConfig:{lang:this.editorConfig_lang},events:{onAppReady:this.onAppReady,onDocumentStateChange:this.events_onDocumentStateChange,onMetaChange:this.events_onMetaChange,onDocumentReady:this.events_onDocumentReady,onInfo:this.events_onInfo,onWarning:this.events_onWarning,onError:this.events_onError,onRequestSharingSettings:this.events_onRequestSharingSettings,onRequestRename:this.events_onRequestRename,onMakeActionLink:this.events_onMakeActionLink,onRequestInsertImage:this.events_onRequestInsertImage,onRequestSaveAs:this.events_onRequestSaveAs,onRequestMailMergeRecipients:this.events_onRequestMailMergeRecipients,onRequestCompareFile:this.events_onRequestCompareFile,onRequestEditRights:this.events_onRequestEditRights,onRequestHistory:this.events_onRequestHistory,onRequestHistoryClose:this.events_onRequestHistoryClose,onRequestHistoryData:this.events_onRequestHistoryData,onRequestRestore:this.events_onRequestRestore,onRequestSelectSpreadsheet:this.events_onRequestSelectSpreadsheet,onRequestSelectDocument:this.events_onRequestSelectDocument},height:this.height,type:this.type,width:this.width},this.config||{}),r=window.DocsAPI.DocEditor(o,i);window.DocEditor.instances[o]=r}catch(a){console.error(a),this.onError(-1)}},onError:function(t){var n;switch(t){case-2:n="Error load DocsAPI from "+this.documentServerUrl;break;case-3:n="DocsAPI is not defined";break;default:n="Unknown error loading component",t=-1}typeof this.onLoadComponentError>"u"?console.error(n):this.onLoadComponentError(t,n)},onAppReady:function(){var t=this.id||"";this.events_onAppReady(window.DocEditor.instances[t])},onChangeProps:function(){var t,n=this.id||"";!((t=window==null?void 0:window.DocEditor)===null||t===void 0)&&t.instances[n]&&(window.DocEditor.instances[n].destroyEditor(),window.DocEditor.instances[n]=void 0,console.log("Important props have been changed. Load new Editor."),this.onLoad())}}});const I=["id"];function q(t,n,o,i,r,a){return e.openBlock(),e.createElementBlock("div",{id:t.id},null,8,I)}C.render=q,C.__file="src/components/DocumentEditor.vue";const N=e.defineComponent({__name:"IkOnlyOffice",props:{documentServerUrl:{type:String,default:""},configOptions:{type:Object,default:()=>{}},officeHeight:{type:String,default:"100%"}},setup(t){const n=t,o=e.ref({width:"100%",height:"100%",...n.configOptions||{}}),i=()=>{console.info("文档加载完成",n.configOptions)};return(r,a)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({height:n.officeHeight})},[e.createVNode(e.unref(C),{id:`${new Date().getTime()}`,ref:"editorRef","document-server-url":t.documentServerUrl,config:o.value,events_onDocumentReady:i},null,8,["id","document-server-url","config"])],4))}}),se="",S=(t,n)=>{const o=t.__vccOpts||t;for(const[i,r]of n)o[i]=r;return o},x=v(S(N,[["__scopeId","data-v-fe959cd8"]])),B=t=>(e.pushScopeId("data-v-af8d674c"),t=t(),e.popScopeId(),t),F={class:"template-data"},A={class:"operate-btn"},P=["onClick"],$=["onClick"],L={class:"m-12 point"},M={class:"flex"},H=["onClick"],j=B(()=>e.createElementVNode("i",{class:"icon-icon_particulars iconfont tips"},null,-1)),U=B(()=>e.createElementVNode("p",null,"鼠标右键选择操作的数据类型",-1)),z={class:"flex data-block"},K={class:"operate-btn"},W=["onClick"],G=["onClick"],J={class:"operate-btn"},X=["onClick"],Q=["onClick"],Y=["onClick"],Z=["onClick"],ee=e.defineComponent({__name:"templateOfficeData",props:{data:{type:Array,default:()=>[]},isShowTitleOperate:{type:Boolean,default:!1},isShowContentOperate:{type:Boolean,default:!1},defaultProps:{type:Object,default:()=>{}}},emits:["handleTitleEdit","handleTitleDel","handleGetTitleData","handleDataBlockEdit","handleDataBlockDel","handleChooseDataBlock","handleDifferentTypeDataBlock"],setup(t,{emit:n}){const o=t,i=n,r=c=>{i("handleTitleEdit",c)},a=c=>{i("handleTitleDel",c)},p=c=>{i("handleGetTitleData",c)},h=c=>{i("handleDataBlockEdit",c)},_=c=>{i("handleDataBlockDel",c)},s=(c,y)=>{for(const g of m.value)g.children.forEach(d=>d.isChoose=!1);y.isChoose=!0,i("handleChooseDataBlock",c,y)},f=(c,y)=>{i("handleDifferentTypeDataBlock",c,y)},u=c=>{let y=c.map(g=>({name:g[o.defaultProps.name],children:g[o.defaultProps.children].map(d=>({childName:d[o.defaultProps.childName],childId:d[o.defaultProps.childId]}))}));m.value=y},m=e.ref(o.data);return e.watch(()=>o.data,c=>{u(c)},{immediate:!0}),document.addEventListener("contextmenu",c=>{o.isShowTitleOperate&&c.preventDefault()}),(c,y)=>{const g=e.resolveComponent("el-popover");return e.openBlock(),e.createElementBlock("div",F,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(d,E)=>(e.openBlock(),e.createElementBlock("div",{key:E,class:"mt-4"},[t.isShowTitleOperate?(e.openBlock(),e.createBlock(g,{key:0,"popper-class":"sort-popper",placement:"right",width:"60",trigger:"contextmenu"},{reference:e.withCtx(()=>[e.createElementVNode("span",L,e.toDisplayString(d.name),1)]),default:e.withCtx(()=>[e.createElementVNode("div",A,[e.createElementVNode("p",{class:"point",style:{margin:"0"},onClick:l=>r(d)},"编辑",8,P),e.createElementVNode("p",{style:{color:"var(--ik-error)",margin:"0"},class:"point",onClick:l=>a(d)}," 删除 ",8,$)])]),_:2},1024)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createCommentVNode(" 不能操作的标题 "),e.createElementVNode("div",M,[e.createElementVNode("p",{class:"mb-2 point",onClick:l=>p(d)},e.toDisplayString(d.name),9,H),d.resultType==="LIST"?(e.openBlock(),e.createBlock(g,{key:0,placement:"right",width:210,trigger:"hover"},{reference:e.withCtx(()=>[j]),default:e.withCtx(()=>[U]),_:1})):e.createCommentVNode("v-if",!0)])],2112)),e.createCommentVNode(" 标题下的内容 "),e.createElementVNode("div",z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.children,(l,D)=>(e.openBlock(),e.createElementBlock("div",{key:D,style:{"flex-grow":"1"}},[o.isShowContentOperate&&d.resultType==="LIST"?(e.openBlock(),e.createBlock(g,{key:0,"popper-class":"operate-popper",placement:"bottom-end",width:"60",trigger:"contextmenu"},{reference:e.withCtx(()=>[e.createElementVNode("p",{class:e.normalizeClass([{"choose-item":l.isChoose},"item-block"]),title:"鼠标右键选择操作的数据类型"},e.toDisplayString(l.chileName),3)]),default:e.withCtx(()=>[e.createElementVNode("div",K,[e.createElementVNode("p",{class:"point",style:{margin:"0"},onClick:w=>f(l,"TABLE")},"表格",8,W),e.createElementVNode("p",{class:"point",style:{margin:"0"},onClick:w=>f(l,"LIST")},"列表",8,G)])]),_:2},1024)):e.createCommentVNode("v-if",!0),o.isShowContentOperate?(e.openBlock(),e.createBlock(g,{key:1,"popper-class":"operate-popper",placement:"bottom-end",width:"60",trigger:"contextmenu"},{reference:e.withCtx(()=>[e.createElementVNode("p",{class:e.normalizeClass([{"choose-item":l.isChoose},"item-block"]),onClick:w=>s(d,l)},e.toDisplayString(l.childName),11,Y)]),default:e.withCtx(()=>[e.createElementVNode("div",J,[e.createElementVNode("p",{class:"point",style:{margin:"0"},onClick:w=>h(l)},"编辑",8,X),e.createElementVNode("p",{style:{color:"var(--ik-error)",cursor:"pointer",margin:"0"},onClick:w=>_(l)}," 删除 ",8,Q)])]),_:2},1024)):(e.openBlock(),e.createElementBlock("p",{key:2,class:e.normalizeClass([{"choose-item":l.isChoose},"item-block"]),onClick:w=>s(d,l)},e.toDisplayString(l.childName),11,Z))]))),128))])]))),128))])}}}),ce="",te=S(ee,[["__scopeId","data-v-af8d674c"]]),ne={class:"template-config"},oe={class:"template-config-data"},ie={class:"template-panel"},ae=e.defineComponent({__name:"IkTemplateOfficeConfig",props:{title:{type:String,default:"模板配置"},visible:{type:Boolean,default:!1},onlyOfficeConfig:{type:Object,default:()=>{}},isShowTabs:{type:Boolean,default:!0},isShowSearchCondition:{type:Boolean,default:!0},tabsData:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},documentServerUrl:{type:String,default:""},jwtToken:{type:String,default:""},contentHeight:{type:String,default:"650px"},defaultProps:{type:Object,default:()=>{}},isShowTitleOperate:{type:Boolean,default:!1},isShowContentOperate:{type:Boolean,default:!1}},emits:["handleSearchDataBlock","handleClickBlockData"],setup(t,{expose:n,emit:o}){e.useCssVars(u=>({f1632ab6:t.contentHeight}));const i=t,r=o,a=e.ref(i.tabsData[0].id),p=u=>{h.value="",a.value=u,u&&r("handleSearchDataBlock","",a.value)},h=e.ref(""),_=()=>{r("handleSearchDataBlock",h.value,a.value)},s=(u,m)=>{r("handleClickBlockData",u,m)};return n({handleSendMessage:u=>{window[0][0].postMessage(JSON.stringify({type:"INSERT_TEXT",text:u}),"*")}}),(u,m)=>{const c=e.resolveComponent("el-tab-pane"),y=e.resolveComponent("el-tabs"),g=e.resolveComponent("el-input"),d=e.resolveComponent("el-col"),E=e.resolveComponent("el-row");return e.openBlock(),e.createElementBlock("div",ne,[e.createVNode(E,{gutter:10},{default:e.withCtx(()=>[e.createVNode(d,{span:6},{default:e.withCtx(()=>[e.createElementVNode("div",oe,[i.isShowTabs?(e.openBlock(),e.createBlock(y,{key:0,modelValue:a.value,"onUpdate:modelValue":m[0]||(m[0]=l=>a.value=l),onTabClick:m[1]||(m[1]=l=>p(l.props.name))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tabsData,(l,D)=>(e.openBlock(),e.createBlock(c,{key:D,label:l.label,name:l.id},null,8,["label","name"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("v-if",!0),i.isShowSearchCondition?(e.openBlock(),e.createBlock(g,{key:1,modelValue:h.value,"onUpdate:modelValue":m[2]||(m[2]=l=>h.value=l),placeholder:"请输入关键字",clearable:"",onInput:m[3]||(m[3]=l=>_())},null,8,["modelValue"])):e.createCommentVNode("v-if",!0),e.createVNode(te,{data:i.tableData,type:a.value,defaultProps:i.defaultProps,onHandleChooseDataBlock:s,isShowTitleOperate:i.isShowTitleOperate,isShowContentOperate:i.isShowContentOperate},null,8,["data","type","defaultProps","isShowTitleOperate","isShowContentOperate"])])]),_:1}),e.createVNode(d,{span:18},{default:e.withCtx(()=>[e.createElementVNode("div",ie,[i.visible?(e.openBlock(),e.createBlock(e.unref(x),{key:0,"config-options":i.onlyOfficeConfig,documentServerUrl:i.documentServerUrl,token:i.jwtToken},null,8,["config-options","documentServerUrl","token"])):e.createCommentVNode("v-if",!0)])]),_:1})]),_:1})])}}}),de="",R=v(S(ae,[["__scopeId","data-v-d31d0157"]]));k.IkTemplateOfficeConfig=R,k.default=R,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(k,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(k=typeof globalThis<"u"?globalThis:k||self,e(k.index={},k.vue))})(this,function(k,e){"use strict";const v=(t,n)=>{if(t.install=o=>{for(const i of[t,...Object.values(n??{})])o.component(i.name,i)},n)for(const[o,i]of Object.entries(n))t[o]=i;return t};function O(t,n,o,i){function r(a){return a instanceof o?a:new o(function(p){p(a)})}return new(o||(o=Promise))(function(a,p){function h(f){try{s(i.next(f))}catch(u){p(u)}}function _(f){try{s(i.throw(f))}catch(u){p(u)}}function s(f){f.done?a(f.value):r(f.value).then(h,_)}s((i=i.apply(t,n||[])).next())})}function V(t,n){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,r,a,p;return p={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function h(s){return function(f){return _([s,f])}}function _(s){if(i)throw new TypeError("Generator is already executing.");for(;p&&(p=0,s[0]&&(o=0)),o;)try{if(i=1,r&&(a=s[0]&2?r.return:s[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;switch(r=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(s[0]===6&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(t,o)}catch(f){s=[6,f],r=0}finally{i=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}typeof SuppressedError=="function"&&SuppressedError;var T=function(t,n){return O(void 0,void 0,void 0,function(){return V(this,function(o){return[2,new Promise(function(i,r){try{if(window.DocsAPI)return i(null);var a=document.getElementById(n);if(a)var p=setInterval(function(){var _=a.getAttribute("loading");if(!_){if(clearInterval(p),window.DocsAPI)return i(null);var s=b(n,t,i,r);a.remove(),document.body.appendChild(s)}},500);else{var h=b(n,t,i,r);document.body.appendChild(h)}}catch(_){console.error(_)}})]})})},b=function(t,n,o,i){var r=document.createElement("script");return r.id=t,r.type="text/javascript",r.src=n,r.async=!0,r.onload=function(){r.removeAttribute("loading"),o(null)},r.onerror=function(a){r.removeAttribute("loading"),i(a)},r.setAttribute("loading",""),r},C=e.defineComponent({name:"DocumentEditor",props:{id:{type:String,required:!0},documentServerUrl:{type:String,required:!0},config:{type:Object,required:!0},document_fileType:String,document_title:String,documentType:String,editorConfig_lang:String,height:String,type:String,width:String,onLoadComponentError:Function,events_onAppReady:Function,events_onDocumentStateChange:Function,events_onMetaChange:Function,events_onDocumentReady:Function,events_onInfo:Function,events_onWarning:Function,events_onError:Function,events_onRequestSharingSettings:Function,events_onRequestRename:Function,events_onMakeActionLink:Function,events_onRequestInsertImage:Function,events_onRequestSaveAs:Function,events_onRequestMailMergeRecipients:Function,events_onRequestCompareFile:Function,events_onRequestEditRights:Function,events_onRequestHistory:Function,events_onRequestHistoryClose:Function,events_onRequestHistoryData:Function,events_onRequestRestore:Function,events_onRequestSelectSpreadsheet:Function,events_onRequestSelectDocument:Function},mounted:function(){var t=this,n=this.documentServerUrl;n.endsWith("/")||(n+="/");var o="".concat(n,"web-apps/apps/api/documents/api.js");T(o,"onlyoffice-api-script").then(function(){return t.onLoad()}).catch(function(){t.onError(-2)})},unmounted:function(){var t,n=this.id||"";!((t=window==null?void 0:window.DocEditor)===null||t===void 0)&&t.instances[n]&&(window.DocEditor.instances[n].destroyEditor(),window.DocEditor.instances[n]=void 0)},watch:{config:{handler:function(t,n){this.onChangeProps()},deep:!0},document_fileType:function(t,n){this.onChangeProps()},document_title:function(t,n){this.onChangeProps()},documentType:function(t,n){this.onChangeProps()},editorConfig_lang:function(t,n){this.onChangeProps()},height:function(t,n){this.onChangeProps()},type:function(t,n){this.onChangeProps()},width:function(t,n){this.onChangeProps()}},methods:{onLoad:function(){var t,n;try{var o=this.id||"";if(window.DocsAPI||this.onError(-3),!((t=window==null?void 0:window.DocEditor)===null||t===void 0)&&t.instances[o]){console.log("Skip loading. Instance already exists",o);return}!((n=window==null?void 0:window.DocEditor)===null||n===void 0)&&n.instances||(window.DocEditor={instances:{}});var i=Object.assign({document:{fileType:this.document_fileType,title:this.document_title},documentType:this.documentType,editorConfig:{lang:this.editorConfig_lang},events:{onAppReady:this.onAppReady,onDocumentStateChange:this.events_onDocumentStateChange,onMetaChange:this.events_onMetaChange,onDocumentReady:this.events_onDocumentReady,onInfo:this.events_onInfo,onWarning:this.events_onWarning,onError:this.events_onError,onRequestSharingSettings:this.events_onRequestSharingSettings,onRequestRename:this.events_onRequestRename,onMakeActionLink:this.events_onMakeActionLink,onRequestInsertImage:this.events_onRequestInsertImage,onRequestSaveAs:this.events_onRequestSaveAs,onRequestMailMergeRecipients:this.events_onRequestMailMergeRecipients,onRequestCompareFile:this.events_onRequestCompareFile,onRequestEditRights:this.events_onRequestEditRights,onRequestHistory:this.events_onRequestHistory,onRequestHistoryClose:this.events_onRequestHistoryClose,onRequestHistoryData:this.events_onRequestHistoryData,onRequestRestore:this.events_onRequestRestore,onRequestSelectSpreadsheet:this.events_onRequestSelectSpreadsheet,onRequestSelectDocument:this.events_onRequestSelectDocument},height:this.height,type:this.type,width:this.width},this.config||{}),r=window.DocsAPI.DocEditor(o,i);window.DocEditor.instances[o]=r}catch(a){console.error(a),this.onError(-1)}},onError:function(t){var n;switch(t){case-2:n="Error load DocsAPI from "+this.documentServerUrl;break;case-3:n="DocsAPI is not defined";break;default:n="Unknown error loading component",t=-1}typeof this.onLoadComponentError>"u"?console.error(n):this.onLoadComponentError(t,n)},onAppReady:function(){var t=this.id||"";this.events_onAppReady(window.DocEditor.instances[t])},onChangeProps:function(){var t,n=this.id||"";!((t=window==null?void 0:window.DocEditor)===null||t===void 0)&&t.instances[n]&&(window.DocEditor.instances[n].destroyEditor(),window.DocEditor.instances[n]=void 0,console.log("Important props have been changed. Load new Editor."),this.onLoad())}}});const I=["id"];function q(t,n,o,i,r,a){return e.openBlock(),e.createElementBlock("div",{id:t.id},null,8,I)}C.render=q,C.__file="src/components/DocumentEditor.vue";const N=e.defineComponent({__name:"IkOnlyOffice",props:{documentServerUrl:{type:String,default:""},configOptions:{type:Object,default:()=>{}},officeHeight:{type:String,default:"100%"}},setup(t){const n=t,o=e.ref({width:"100%",height:"100%",...n.configOptions||{},...n.configOptions}),i=()=>{console.info("文档加载完成",n.configOptions)};return(r,a)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({height:n.officeHeight})},[e.createVNode(e.unref(C),{id:`${new Date().getTime()}`,ref:"editorRef","document-server-url":t.documentServerUrl,config:o.value,events_onDocumentReady:i},null,8,["id","document-server-url","config"])],4))}}),se="",S=(t,n)=>{const o=t.__vccOpts||t;for(const[i,r]of n)o[i]=r;return o},x=v(S(N,[["__scopeId","data-v-98d51ef9"]])),B=t=>(e.pushScopeId("data-v-af8d674c"),t=t(),e.popScopeId(),t),F={class:"template-data"},A={class:"operate-btn"},P=["onClick"],$=["onClick"],L={class:"m-12 point"},M={class:"flex"},H=["onClick"],j=B(()=>e.createElementVNode("i",{class:"icon-icon_particulars iconfont tips"},null,-1)),U=B(()=>e.createElementVNode("p",null,"鼠标右键选择操作的数据类型",-1)),z={class:"flex data-block"},K={class:"operate-btn"},W=["onClick"],G=["onClick"],J={class:"operate-btn"},X=["onClick"],Q=["onClick"],Y=["onClick"],Z=["onClick"],ee=e.defineComponent({__name:"templateOfficeData",props:{data:{type:Array,default:()=>[]},isShowTitleOperate:{type:Boolean,default:!1},isShowContentOperate:{type:Boolean,default:!1},defaultProps:{type:Object,default:()=>{}}},emits:["handleTitleEdit","handleTitleDel","handleGetTitleData","handleDataBlockEdit","handleDataBlockDel","handleChooseDataBlock","handleDifferentTypeDataBlock"],setup(t,{emit:n}){const o=t,i=n,r=c=>{i("handleTitleEdit",c)},a=c=>{i("handleTitleDel",c)},p=c=>{i("handleGetTitleData",c)},h=c=>{i("handleDataBlockEdit",c)},_=c=>{i("handleDataBlockDel",c)},s=(c,y)=>{for(const g of m.value)g.children.forEach(d=>d.isChoose=!1);y.isChoose=!0,i("handleChooseDataBlock",c,y)},f=(c,y)=>{i("handleDifferentTypeDataBlock",c,y)},u=c=>{let y=c.map(g=>({name:g[o.defaultProps.name],children:g[o.defaultProps.children].map(d=>({childName:d[o.defaultProps.childName],childId:d[o.defaultProps.childId]}))}));m.value=y},m=e.ref(o.data);return e.watch(()=>o.data,c=>{u(c)},{immediate:!0}),document.addEventListener("contextmenu",c=>{o.isShowTitleOperate&&c.preventDefault()}),(c,y)=>{const g=e.resolveComponent("el-popover");return e.openBlock(),e.createElementBlock("div",F,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(d,E)=>(e.openBlock(),e.createElementBlock("div",{key:E,class:"mt-4"},[t.isShowTitleOperate?(e.openBlock(),e.createBlock(g,{key:0,"popper-class":"sort-popper",placement:"right",width:"60",trigger:"contextmenu"},{reference:e.withCtx(()=>[e.createElementVNode("span",L,e.toDisplayString(d.name),1)]),default:e.withCtx(()=>[e.createElementVNode("div",A,[e.createElementVNode("p",{class:"point",style:{margin:"0"},onClick:l=>r(d)},"编辑",8,P),e.createElementVNode("p",{style:{color:"var(--ik-error)",margin:"0"},class:"point",onClick:l=>a(d)}," 删除 ",8,$)])]),_:2},1024)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createCommentVNode(" 不能操作的标题 "),e.createElementVNode("div",M,[e.createElementVNode("p",{class:"mb-2 point",onClick:l=>p(d)},e.toDisplayString(d.name),9,H),d.resultType==="LIST"?(e.openBlock(),e.createBlock(g,{key:0,placement:"right",width:210,trigger:"hover"},{reference:e.withCtx(()=>[j]),default:e.withCtx(()=>[U]),_:1})):e.createCommentVNode("v-if",!0)])],2112)),e.createCommentVNode(" 标题下的内容 "),e.createElementVNode("div",z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.children,(l,D)=>(e.openBlock(),e.createElementBlock("div",{key:D,style:{"flex-grow":"1"}},[o.isShowContentOperate&&d.resultType==="LIST"?(e.openBlock(),e.createBlock(g,{key:0,"popper-class":"operate-popper",placement:"bottom-end",width:"60",trigger:"contextmenu"},{reference:e.withCtx(()=>[e.createElementVNode("p",{class:e.normalizeClass([{"choose-item":l.isChoose},"item-block"]),title:"鼠标右键选择操作的数据类型"},e.toDisplayString(l.chileName),3)]),default:e.withCtx(()=>[e.createElementVNode("div",K,[e.createElementVNode("p",{class:"point",style:{margin:"0"},onClick:w=>f(l,"TABLE")},"表格",8,W),e.createElementVNode("p",{class:"point",style:{margin:"0"},onClick:w=>f(l,"LIST")},"列表",8,G)])]),_:2},1024)):e.createCommentVNode("v-if",!0),o.isShowContentOperate?(e.openBlock(),e.createBlock(g,{key:1,"popper-class":"operate-popper",placement:"bottom-end",width:"60",trigger:"contextmenu"},{reference:e.withCtx(()=>[e.createElementVNode("p",{class:e.normalizeClass([{"choose-item":l.isChoose},"item-block"]),onClick:w=>s(d,l)},e.toDisplayString(l.childName),11,Y)]),default:e.withCtx(()=>[e.createElementVNode("div",J,[e.createElementVNode("p",{class:"point",style:{margin:"0"},onClick:w=>h(l)},"编辑",8,X),e.createElementVNode("p",{style:{color:"var(--ik-error)",cursor:"pointer",margin:"0"},onClick:w=>_(l)}," 删除 ",8,Q)])]),_:2},1024)):(e.openBlock(),e.createElementBlock("p",{key:2,class:e.normalizeClass([{"choose-item":l.isChoose},"item-block"]),onClick:w=>s(d,l)},e.toDisplayString(l.childName),11,Z))]))),128))])]))),128))])}}}),ce="",te=S(ee,[["__scopeId","data-v-af8d674c"]]),ne={class:"template-config"},oe={class:"template-config-data"},ie={class:"template-panel"},ae=e.defineComponent({__name:"IkTemplateOfficeConfig",props:{title:{type:String,default:"模板配置"},visible:{type:Boolean,default:!1},onlyOfficeConfig:{type:Object,default:()=>{}},isShowTabs:{type:Boolean,default:!0},isShowSearchCondition:{type:Boolean,default:!0},tabsData:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},documentServerUrl:{type:String,default:""},jwtToken:{type:String,default:""},contentHeight:{type:String,default:"650px"},defaultProps:{type:Object,default:()=>{}},isShowTitleOperate:{type:Boolean,default:!1},isShowContentOperate:{type:Boolean,default:!1}},emits:["handleSearchDataBlock","handleClickBlockData"],setup(t,{expose:n,emit:o}){e.useCssVars(u=>({f1632ab6:t.contentHeight}));const i=t,r=o,a=e.ref(i.tabsData[0].id),p=u=>{h.value="",a.value=u,u&&r("handleSearchDataBlock","",a.value)},h=e.ref(""),_=()=>{r("handleSearchDataBlock",h.value,a.value)},s=(u,m)=>{r("handleClickBlockData",u,m)};return n({handleSendMessage:u=>{window[0][0].postMessage(JSON.stringify({type:"INSERT_TEXT",text:u}),"*")}}),(u,m)=>{const c=e.resolveComponent("el-tab-pane"),y=e.resolveComponent("el-tabs"),g=e.resolveComponent("el-input"),d=e.resolveComponent("el-col"),E=e.resolveComponent("el-row");return e.openBlock(),e.createElementBlock("div",ne,[e.createVNode(E,{gutter:10},{default:e.withCtx(()=>[e.createVNode(d,{span:6},{default:e.withCtx(()=>[e.createElementVNode("div",oe,[i.isShowTabs?(e.openBlock(),e.createBlock(y,{key:0,modelValue:a.value,"onUpdate:modelValue":m[0]||(m[0]=l=>a.value=l),onTabClick:m[1]||(m[1]=l=>p(l.props.name))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tabsData,(l,D)=>(e.openBlock(),e.createBlock(c,{key:D,label:l.label,name:l.id},null,8,["label","name"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("v-if",!0),i.isShowSearchCondition?(e.openBlock(),e.createBlock(g,{key:1,modelValue:h.value,"onUpdate:modelValue":m[2]||(m[2]=l=>h.value=l),placeholder:"请输入关键字",clearable:"",onInput:m[3]||(m[3]=l=>_())},null,8,["modelValue"])):e.createCommentVNode("v-if",!0),e.createVNode(te,{data:i.tableData,type:a.value,defaultProps:i.defaultProps,onHandleChooseDataBlock:s,isShowTitleOperate:i.isShowTitleOperate,isShowContentOperate:i.isShowContentOperate},null,8,["data","type","defaultProps","isShowTitleOperate","isShowContentOperate"])])]),_:1}),e.createVNode(d,{span:18},{default:e.withCtx(()=>[e.createElementVNode("div",ie,[i.visible?(e.openBlock(),e.createBlock(e.unref(x),{key:0,"config-options":i.onlyOfficeConfig,documentServerUrl:i.documentServerUrl,token:i.jwtToken},null,8,["config-options","documentServerUrl","token"])):e.createCommentVNode("v-if",!0)])]),_:1})]),_:1})])}}}),de="",R=v(S(ae,[["__scopeId","data-v-d31d0157"]]));k.IkTemplateOfficeConfig=R,k.default=R,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});