"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[157,911,942],{85916:(e,t,i)=>{i.d(t,{Z:()=>r});var n=i(1519),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".component-only-office[data-v-1ec144f0]{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.component-only-office .placeholder[data-v-1ec144f0]{flex:1;height:100%;width:100%}.component-only-office .office-loading[data-v-1ec144f0]{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:2}",""]);const r=o},42586:(e,t,i)=>{i.d(t,{Z:()=>r});var n=i(1519),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".single-file-task[data-v-3847fd5e]{align-items:center;display:flex}.single-file-task .ace_editor[data-v-3847fd5e],.single-file-task .no-support[data-v-3847fd5e],.single-file-task .preview-iframe[data-v-3847fd5e]{border:0;height:100%;left:0;margin:0;outline:0;padding:0;position:absolute;top:0;width:100%}.single-file-task .preview-iframe[data-v-3847fd5e]{background:0 0;float:none;max-width:none}.single-file-task .no-support[data-v-3847fd5e],.single-file-task .view-editor[data-v-3847fd5e]{align-items:center;display:flex;justify-content:center}",""]);const r=o},3911:(e,t,i)=>{i.r(t),i.d(t,{default:()=>f});var n=i(20629);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function s(e){for(var t=1;te.length)&&(t=e.length);for(var i=0,n=new Array(t);i{i.r(t),i.d(t,{default:()=>u});var n=i(20629);function o(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function r(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"";null!==this.docEditor&&(this.docEditor.destroyEditor(),this.docEditor=null);var i="zh";switch(this.getLanguage()){case"CN":case"TC":i="zh";break;default:i="en"}var n=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(n,"-").concat(t),title:o,url:"http://nginx/api/file/content/?id=".concat(n,"&token=").concat(this.userToken)},editorConfig:{mode:"edit",lang:i,user:{id: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(n,"&token=").concat(this.userToken)}};if(/\/hideenOfficeTitle\//.test(window.navigator.userAgent)&&(r.document.title=" "),$A.leftExists(n,"msgFile_")?r.document.url="http://nginx/api/dialog/msg/download/?msg_id=".concat($A.leftDelete(n,"msgFile_"),"&token=").concat(this.userToken):$A.leftExists(n,"taskFile_")&&(r.document.url="http://nginx/api/project/task/filedown/?file_id=".concat($A.leftDelete(n,"taskFile_"),"&token=").concat(this.userToken)),this.readOnly&&(r.editorConfig.mode="view",r.editorConfig.callbackUrl=null,!r.editorConfig.user.id)){var s=$A.getStorageInt("viewer");s||(s=$A.randNum(1e3,99999),$A.setStorage("viewer",s)),r.editorConfig.user.id="viewer_"+s,r.editorConfig.user.name="Viewer_"+s}this.$nextTick((function(){e.docEditor=new DocsAPI.DocEditor(e.id,r)}))}}};var l=i(93379),c=i.n(l),d=i(85916),f={insert:"head",singleton:!1};c()(d.Z,f);d.Z.locals;const u=(0,i(51900).Z)(a,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"component-only-office"},[i("div",{staticClass:"placeholder",attrs:{id:this.id}}),e._v(" "),e.loadIng>0?i("div",{staticClass:"office-loading"},[i("Loading")],1):e._e()])}),[],!1,null,"1ec144f0",null).exports},98157:(e,t,i)=>{i.r(t),i.d(t,{default:()=>c});var n=i(3911);const o={components:{OnlyOffice:i(17942).default,AceEditor:n.default},data:function(){return{loadIng:0,fileDetail:{}}},mounted:function(){},watch:{$route:{handler:function(){this.getInfo()},immediate:!0}},computed:{fileId:function(){return $A.runNum(this.$route.params.id)},title:function(){var e=this.fileDetail.name;return e||"Loading..."},isCode:function(){return 1==this.fileDetail.file_mode},codeContent:function(){return this.isCode?this.fileDetail.content:""},codeExt:function(){return this.isCode?this.fileDetail.ext:"txt"},isOffice:function(){return 2==this.fileDetail.file_mode},officeContent:function(){return{id:this.isOffice?this.fileDetail.id:0,type:this.fileDetail.ext,name:this.title}},officeCode:function(){return this.isOffice?"taskFile_"+this.fileDetail.id:""},isPreview:function(){return 3==this.fileDetail.file_mode},previewUrl:function(){return this.isPreview?$A.apiUrl("../fileview/onlinePreview?url="+encodeURIComponent(this.fileDetail.url)):""}},methods:{getInfo:function(){var e=this;this.fileId<=0||(this.loadIng++,this.$store.dispatch("call",{url:"project/task/filedetail",data:{file_id:this.fileId}}).then((function(t){var i=t.data;e.loadIng--,e.fileDetail=i})).catch((function(t){var i=t.msg;e.loadIng--,$A.modalError({content:i,onOk:function(){e.$Electron&&window.close()}})})))},documentKey:function(){var e=this;return new Promise((function(t){e.$store.dispatch("call",{url:"project/task/filedetail",data:{file_id:e.fileId,only_update_at:"yes"}}).then((function(e){var i=e.data;t($A.Date(i.update_at,!0))})).catch((function(){t(0)}))}))}}};var r=i(93379),s=i.n(r),a=i(42586),l={insert:"head",singleton:!1};s()(a.Z,l);a.Z.locals;const c=(0,i(51900).Z)(o,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"single-file-task"},[i("PageTitle",{attrs:{title:e.title}}),e._v(" "),e.loadIng>0?i("Loading"):[e.isCode?i("AceEditor",{staticClass:"view-editor",attrs:{ext:e.codeExt,readOnly:""},model:{value:e.codeContent,callback:function(t){e.codeContent=t},expression:"codeContent"}}):e.isOffice?i("OnlyOffice",{attrs:{code:e.officeCode,documentKey:e.documentKey,readOnly:""},model:{value:e.officeContent,callback:function(t){e.officeContent=t},expression:"officeContent"}}):e.isPreview?i("iframe",{staticClass:"preview-iframe",attrs:{src:e.previewUrl}}):i("div",{staticClass:"no-support"},[e._v(e._s(e.$L("不支持单独查看此消息")))])]],2)}),[],!1,null,"3847fd5e",null).exports}}]);