iking-web-ui-pro 0.2.0 → 0.2.2
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.
- package/dist/IKDetailPreviewFiles/ik.index.es.js +329 -373
- package/dist/IKDetailPreviewFiles/ik.index.umd.js +1 -1
- package/dist/IKPreviewFile/ik.index.es.js +381 -425
- package/dist/IKPreviewFile/ik.index.umd.js +1 -1
- package/dist/IkApprovalProcessDetail/ik.index.es.js +231 -275
- package/dist/IkApprovalProcessDetail/ik.index.umd.js +1 -1
- package/dist/IkApprovalProcessDetail/style.css +1 -1
- package/dist/IkDescription/ik.index.es.js +422 -466
- package/dist/IkDescription/ik.index.umd.js +1 -1
- package/dist/IkOnlyOffice/ik.index.es.js +80 -127
- package/dist/IkOnlyOffice/ik.index.umd.js +1 -1
- package/dist/IkPreviewFileDialog/ik.index.es.js +144 -188
- package/dist/IkPreviewFileDialog/ik.index.umd.js +1 -1
- package/dist/IkTemplateOfficeConfig/ik.index.es.js +194 -241
- package/dist/IkTemplateOfficeConfig/ik.index.umd.js +1 -1
- package/dist/IkUploadFile/ik.index.es.js +314 -352
- package/dist/IkUploadFile/ik.index.umd.js +1 -1
- package/dist/IkUploadFile/style.css +1 -1
- package/dist/index.es.js +5064 -5102
- package/dist/index.umd.js +56 -56
- package/dist/src/components/IkOnlyOffice/index.d.ts +0 -18
- package/dist/src/components/IkOnlyOffice/src/IkOnlyOffice.vue.d.ts +0 -18
- package/dist/src/components/IkUploadFile/index.d.ts +19 -0
- package/dist/src/components/IkUploadFile/src/index.vue.d.ts +9 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -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 D=(t,n)=>{if(t.install=o=>{for(const a of[t,...Object.values(n??{})])o.component(a.name,a)},n)for(const[o,a]of Object.entries(n))t[o]=a;return t};function O(t,n,o,a){function s(i){return i instanceof o?i:new o(function(d){d(i)})}return new(o||(o=Promise))(function(i,d){function f(u){try{r(a.next(u))}catch(h){d(h)}}function _(u){try{r(a.throw(u))}catch(h){d(h)}}function r(u){u.done?i(u.value):s(u.value).then(f,_)}r((a=a.apply(t,n||[])).next())})}function T(t,n){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,s,i,d;return d={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function f(r){return function(u){return _([r,u])}}function _(r){if(a)throw new TypeError("Generator is already executing.");for(;d&&(d=0,r[0]&&(o=0)),o;)try{if(a=1,s&&(i=r[0]&2?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[r[0]&2,i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(r[0]===6&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=n.call(t,o)}catch(u){r=[6,u],s=0}finally{a=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}}typeof SuppressedError=="function"&&SuppressedError;var V=function(t,n){return O(void 0,void 0,void 0,function(){return T(this,function(o){return[2,new Promise(function(a,s){try{if(window.DocsAPI)return a(null);var i=document.getElementById(n);if(i)var d=setInterval(function(){var _=i.getAttribute("loading");if(!_){if(clearInterval(d),window.DocsAPI)return a(null);var r=b(n,t,a,s);i.remove(),document.body.appendChild(r)}},500);else{var f=b(n,t,a,s);document.body.appendChild(f)}}catch(_){console.error(_)}})]})})},b=function(t,n,o,a){var s=document.createElement("script");return s.id=t,s.type="text/javascript",s.src=n,s.async=!0,s.onload=function(){s.removeAttribute("loading"),o(null)},s.onerror=function(i){s.removeAttribute("loading"),a(i)},s.setAttribute("loading",""),s},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");V(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 a=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||{}),s=window.DocsAPI.DocEditor(o,a);window.DocEditor.instances[o]=s}catch(i){console.error(i),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,a,s,i){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:""},mode:{type:String,default:""},configOptions:{type:Object,default:()=>{}},officeHeight:{type:String,default:"100%"},token:{type:String,default:""}},setup(t){var s,i,d,f;const n=t,o=e.ref({width:"100%",height:"100%",document:(s=n.configOptions)==null?void 0:s.document,documentType:(i=n.configOptions)==null?void 0:i.documentType,editorConfig:{callbackUrl:(f=(d=n.configOptions)==null?void 0:d.editorConfig)==null?void 0:f.callbackUrl,lang:"zh-CN",mode:n.mode,customization:{forcesave:!0,autosave:!0}},permissions:{comment:!0,commentGroups:{edit:["Group1"],remove:["Group1"],view:""},copy:!0,deleteCommentAuthorOnly:!0,download:!0,edit:!0,editCommentAuthorOnly:!0,fillForms:!0,modifyContentControl:!0,modifyFilter:!0,print:!0,review:!0,reviewGroups:["Group1","Group2","Group3"],userInfoGroups:["Group1"]},mode:n.mode,token:n.token}),a=()=>{console.info("文档加载完成")};return(_,r)=>(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:a},null,8,["id","document-server-url","config"])],4))}}),re="",S=(t,n)=>{const o=t.__vccOpts||t;for(const[a,s]of n)o[a]=s;return o},x=D(S(N,[["__scopeId","data-v-ea0a8f6d"]])),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"},U=["onClick"],H=B(()=>e.createElementVNode("i",{class:"icon-icon_particulars iconfont tips"},null,-1)),j=B(()=>e.createElementVNode("p",null,"鼠标右键选择操作的数据类型",-1)),G={class:"flex data-block"},z={class:"operate-btn"},K=["onClick"],W=["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,a=n,s=c=>{a("handleTitleEdit",c)},i=c=>{a("handleTitleDel",c)},d=c=>{a("handleGetTitleData",c)},f=c=>{a("handleDataBlockEdit",c)},_=c=>{a("handleDataBlockDel",c)},r=(c,g)=>{for(const y of m.value)y.children.forEach(p=>p.isChoose=!1);g.isChoose=!0,a("handleChooseDataBlock",c,g)},u=(c,g)=>{a("handleDifferentTypeDataBlock",c,g)},h=c=>{let g=c.map(y=>({name:y[o.defaultProps.name],children:y[o.defaultProps.children].map(p=>({childName:p[o.defaultProps.childName],childId:p[o.defaultProps.childId]}))}));m.value=g},m=e.ref(o.data);return e.watch(()=>o.data,c=>{h(c)},{immediate:!0}),document.addEventListener("contextmenu",c=>{o.isShowTitleOperate&&c.preventDefault()}),(c,g)=>{const y=e.resolveComponent("el-popover");return e.openBlock(),e.createElementBlock("div",F,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(p,E)=>(e.openBlock(),e.createElementBlock("div",{key:E,class:"mt-4"},[t.isShowTitleOperate?(e.openBlock(),e.createBlock(y,{key:0,"popper-class":"sort-popper",placement:"right",width:"60",trigger:"contextmenu"},{reference:e.withCtx(()=>[e.createElementVNode("span",L,e.toDisplayString(p.name),1)]),default:e.withCtx(()=>[e.createElementVNode("div",A,[e.createElementVNode("p",{class:"point",style:{margin:"0"},onClick:l=>s(p)},"编辑",8,P),e.createElementVNode("p",{style:{color:"var(--ik-error)",margin:"0"},class:"point",onClick:l=>i(p)}," 删除 ",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=>d(p)},e.toDisplayString(p.name),9,U),p.resultType==="LIST"?(e.openBlock(),e.createBlock(y,{key:0,placement:"right",width:210,trigger:"hover"},{reference:e.withCtx(()=>[H]),default:e.withCtx(()=>[j]),_:1})):e.createCommentVNode("v-if",!0)])],2112)),e.createCommentVNode(" 标题下的内容 "),e.createElementVNode("div",G,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.children,(l,v)=>(e.openBlock(),e.createElementBlock("div",{key:v,style:{"flex-grow":"1"}},[o.isShowContentOperate&&p.resultType==="LIST"?(e.openBlock(),e.createBlock(y,{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",z,[e.createElementVNode("p",{class:"point",style:{margin:"0"},onClick:w=>u(l,"TABLE")},"表格",8,K),e.createElementVNode("p",{class:"point",style:{margin:"0"},onClick:w=>u(l,"LIST")},"列表",8,W)])]),_:2},1024)):e.createCommentVNode("v-if",!0),o.isShowContentOperate?(e.openBlock(),e.createBlock(y,{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=>r(p,l)},e.toDisplayString(l.childName),11,Y)]),default:e.withCtx(()=>[e.createElementVNode("div",J,[e.createElementVNode("p",{class:"point",style:{margin:"0"},onClick:w=>f(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=>r(p,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(h=>({f1632ab6:t.contentHeight}));const a=t,s=o,i=e.ref(a.tabsData[0].id),d=h=>{f.value="",i.value=h,h&&s("handleSearchDataBlock","",i.value)},f=e.ref(""),_=()=>{s("handleSearchDataBlock",f.value,i.value)},r=(h,m)=>{s("handleClickBlockData",h,m)};return n({handleSendMessage:h=>{window[0][0].postMessage(JSON.stringify({type:"INSERT_TEXT",text:h}),"*")}}),(h,m)=>{const c=e.resolveComponent("el-tab-pane"),g=e.resolveComponent("el-tabs"),y=e.resolveComponent("el-input"),p=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(p,{span:6},{default:e.withCtx(()=>[e.createElementVNode("div",oe,[a.isShowTabs?(e.openBlock(),e.createBlock(g,{key:0,modelValue:i.value,"onUpdate:modelValue":m[0]||(m[0]=l=>i.value=l),onTabClick:m[1]||(m[1]=l=>d(l.props.name))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tabsData,(l,v)=>(e.openBlock(),e.createBlock(c,{key:v,label:l.label,name:l.id},null,8,["label","name"]))),128))]),_:1},8,["modelValue"])):e.createCommentVNode("v-if",!0),a.isShowSearchCondition?(e.openBlock(),e.createBlock(y,{key:1,modelValue:f.value,"onUpdate:modelValue":m[2]||(m[2]=l=>f.value=l),placeholder:"请输入关键字",clearable:"",onInput:m[3]||(m[3]=l=>_())},null,8,["modelValue"])):e.createCommentVNode("v-if",!0),e.createVNode(te,{data:a.tableData,type:i.value,defaultProps:a.defaultProps,onHandleChooseDataBlock:r,isShowTitleOperate:a.isShowTitleOperate,isShowContentOperate:a.isShowContentOperate},null,8,["data","type","defaultProps","isShowTitleOperate","isShowContentOperate"])])]),_:1}),e.createVNode(p,{span:18},{default:e.withCtx(()=>[e.createElementVNode("div",ie,[a.visible?(e.openBlock(),e.createBlock(e.unref(x),{key:0,"config-options":a.onlyOfficeConfig,documentServerUrl:a.documentServerUrl,token:a.jwtToken},null,8,["config-options","documentServerUrl","token"])):e.createCommentVNode("v-if",!0)])]),_:1})]),_:1})])}}}),de="",R=D(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||{}}),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"}})});
|