mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-15 19:28:11 +00:00
1 line
4.9 KiB
JavaScript
Vendored
1 line
4.9 KiB
JavaScript
Vendored
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[152],{20322:(e,t,n)=>{n.d(t,{Z:()=>r});var i=n(1519),o=n.n(i)()((function(e){return e[1]}));o.push([e.id,".component-only-office[data-v-5805e3e2]{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.component-only-office .placeholder[data-v-5805e3e2]{flex:1;height:100%;width:100%}.component-only-office .office-loading[data-v-5805e3e2]{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:2}",""]);const r=o},81249:(e,t,n)=>{n.d(t,{Z:()=>r});var i=n(1519),o=n.n(i)()((function(e){return e[1]}));o.push([e.id,".component-only-office .load-error{align-items:center;display:flex;left:50%;padding:8px;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:1}.component-only-office .load-error .ivu-alert-icon{margin-left:4px;margin-right:8px;position:static}",""]);const r=o},30152:(e,t,n)=>{n.r(t),n.d(t,{default:()=>h});var i=n(20629);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const l={name:"OnlyOffice",props:{id:{type:String,default:function(){return"office_"+Math.round(1e4*Math.random())}},code:{type:String,default:""},value:{type:[Object,Array],default:function(){return{}}},readOnly:{type:Boolean,default:!1},documentKey:Function},data:function(){return{loadIng:0,loadError:!1,docEditor:null}},mounted:function(){},beforeDestroy:function(){null!==this.docEditor&&(this.docEditor.destroyEditor(),this.docEditor=null)},computed:r(r({},(0,i.rn)(["userToken","userInfo","themeIsDark"])),{},{fileType:function(){return this.getType(this.value.type)},fileName:function(){return this.value.name}}),watch:{"value.id":{handler:function(e){var t=this;e&&(this.loadIng++,this.loadError=!1,$A.loadScript($A.apiUrl("../office/web-apps/apps/api/documents/api.js"),(function(e){if(t.loadIng--,null===e)if(t.documentKey){var n=t.documentKey();n&&n.then?n.then(t.loadFile):t.loadFile()}else t.handleClose();else t.loadError=!0})))},immediate:!0}},methods:{getType:function(e){switch(e){case"word":return"docx";case"excel":return"xlsx";case"ppt":return"pptx"}return e},loadFile:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";null!==this.docEditor&&(this.docEditor.destroyEditor(),this.docEditor=null);var n="zh";switch(this.getLanguage()){case"CN":case"TC":n="zh";break;default:n="en"}var i=this.code||this.value.id,o=$A.strExists(this.fileName,".")?this.fileName:this.fileName+"."+this.fileType,r={document:{fileType:this.fileType,key:"".concat(this.fileType,"-").concat(i,"-").concat(t),title:o,url:"http://nginx/api/file/content/?id=".concat(i,"&token=").concat(this.userToken)},editorConfig:{mode:"edit",lang:n,user:{id:String(this.userInfo.userid),name:this.userInfo.nickname},customization:{uiTheme:this.themeIsDark?"theme-dark":"theme-classic-light"},callbackUrl:"http://nginx/api/file/content/office?id=".concat(i,"&token=").concat(this.userToken)}};if(/\/hideenOfficeTitle\//.test(window.navigator.userAgent)&&(r.document.title=" "),$A.leftExists(i,"msgFile_")?r.document.url="http://nginx/api/dialog/msg/download/?msg_id=".concat($A.leftDelete(i,"msgFile_"),"&token=").concat(this.userToken):$A.leftExists(i,"taskFile_")&&(r.document.url="http://nginx/api/project/task/filedown/?file_id=".concat($A.leftDelete(i,"taskFile_"),"&token=").concat(this.userToken)),this.readOnly&&(r.editorConfig.mode="view",r.editorConfig.callbackUrl=null,!r.editorConfig.user.id)){var a=$A.getStorageInt("viewer");a||(a=$A.randNum(1e3,99999),$A.setStorage("viewer",a)),r.editorConfig.user.id="viewer_"+a,r.editorConfig.user.name="Viewer_"+a}this.$nextTick((function(){e.docEditor=new DocsAPI.DocEditor(e.id,r)}))}}};var c=n(93379),s=n.n(c),d=n(20322),u={insert:"head",singleton:!1};s()(d.Z,u);d.Z.locals;var f=n(81249),p={insert:"head",singleton:!1};s()(f.Z,p);f.Z.locals;const h=(0,n(51900).Z)(l,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"component-only-office"},[e.loadError?n("Alert",{staticClass:"load-error",attrs:{type:"error","show-icon":""}},[e._v(e._s(e.$L("组件加载失败!")))]):e._e(),e._v(" "),n("div",{staticClass:"placeholder",attrs:{id:e.id}}),e._v(" "),e.loadIng>0?n("div",{staticClass:"office-loading"},[n("Loading")],1):e._e()],1)}),[],!1,null,"5805e3e2",null).exports}}]); |