(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-fbbdd47a"],{"5e0c":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return WebOffice2015}));var core_js_modules_es6_array_find__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("7514"),core_js_modules_es6_array_find__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es6_array_find__WEBPACK_IMPORTED_MODULE_0__),core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("28a5"),core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es6_regexp_split__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("6b54"),core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es6_regexp_to_string__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("a481"),core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_3__),D_lcjyjOA_LCJYJOASystemWeb_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("ade3"),core_js_modules_es6_typed_uint8_array__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("34ef"),core_js_modules_es6_typed_uint8_array__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es6_typed_uint8_array__WEBPACK_IMPORTED_MODULE_5__);function base64toBlob(t,e){e=e||"";for(var i=1024,s=atob(t),o=s.length,n=Math.ceil(o/i),a=new Array(n),r=0;rM",!1},this.WebSave=function(t){this.Status="";var e=this.obj.Http;if(e.Clear(),this.WebSetMsgByName("USERNAME",this.UserName),this.WebSetMsgByName("RECORDID",this.RecordID),this.WebSetMsgByName("TEMPLATE",this.Template),this.WebSetMsgByName("SUBJECT",this.Subject),this.WebSetMsgByName("AUTHOR",this.Author),this.WebSetMsgByName("HTMLPATH",this.HTMLPath),this.WebSetMsgByName("FILETYPE",this.FileType),this.WebSetMsgByName("OPTION","SAVEFILE"),this.WebSetMsgByName("DATABASE",this.DataBase),this.WebSetMsgByName("FILENAME",this.FileName),this.WebSetAllowEmpty()){this.GetSingleFileName(this.FileName);var i=this.getFilePath()+1e5*Math.random()+this.SingleFileName,s=this.WebSaveLocalFile(i);if(0!=s)return this.Status="保存本地文档失败!错误代码为:"+s,!1}else alert("文档没有内容,是否确定保存");if(this.sendMode="SaveFile",this.WebSetMaxFileSize(i)){if(this.SAVEFILE(e,i,t)){e.status;return this.Status="成功将文档保存到服务器",!0}return!1}return this.Status="保存失败:MaxFileSize只能允许保存:<"+this.MaxFileSize/1024+">M",!1},this.WebClose=function(){return!!this.Close()},this.WebSetMsgByName=function(t,e){this.ht.Add(t,e)},this.WebGetMsgByName=function(t){return this.ht.Get(t)},this.WebSendMessage=function(){var t=this.obj.Http;return t.Clear(),this.WebSetMsgByName("OPTION","SENDMESSAGE"),this.sendMode="SendMessage",t.ShowProgressUI=this.ShowWindow,t.AddForm("FormData",this.GetMessageString()),t.Open(this.HttpMethod.Post,this.WebUrl,!1)?t.Send()?(this.GetDataToSend(),t.Clear(),this.Status=this.WebGetMsgByName("STATUS"),!0):(this.Status=this.WebGetMsgByName("STATUS"),!1):(this.Status="网络通信异常",!1)},this.WebClearMessage=function(){this.ht.Clear()},this.WebSavePDF=function(){var t=this.obj.Http;return t.Clear(),this.WebSetMsgByName("RECORDID",this.RecordID),this.WebSetMsgByName("OPTION","SAVEPDF"),this.WebSetMsgByName("FILENAME",this.RecordID+".pdf"),this.SaveAsPdf(this.getFilePath()+this.RecordID+".pdf"),this.SAVEFILE(t,this.getFilePath()+this.RecordID+".pdf")?(this.Status="保存PDF文件成功",!0):(this.Status="保存PDF文件失败",!1)},this.WebSaveAsHtml=function(){if(this.SaveAsHtml(this.getFilePath()+this.RecordID+".html")){var t=this.getFilePath()+this.RecordID+".files",e=this.obj.FileSystem.FindToDirAsFileEx(t),i=e.split("\r\n"),s=this.obj.Http;s.Clear(),this.WebSetMsgByName("RECORDID",this.RecordID),this.WebSetMsgByName("OPTION","SAVEHTML"),this.WebSetMsgByName("DIRECTORY",this.RecordID+".files");for(var o=0;o=1 有多个合法印章)"),this.Status=t.Status,!0},this.WebShowSignature=function(){var t=this.obj.FuncExtModule;return t.SetServerType(1),1!=this.Charset&&t.SetCharset("UTF-8"),t.WebUrl=this.WebUrl,t.UserName=this.UserName,t.FileName=this.FileName,t.RecordID=this.RecordID,t.FileType=this.FileType,t.SetDocument(this.obj.ActiveDocument),t.WebShowSignature(),this.Status=t.Status,!0},this.WebGetFile=function(t,e){var i=this.obj.Http;return i.Clear(),this.WebSetMsgByName("RECORDID",this.RecordID),this.WebSetMsgByName("LOCALFILE",t),this.WebSetMsgByName("REMOTEFILE",e),this.WebSetMsgByName("OPTION","GETFILE"),i.AddForm("FormData",this.GetMessageString()),this.WebClearMessage(),i.ShowProgressUI=!0,i.Open(this.HttpMethod.Post,this.WebUrl,!1)?i.Send()?"404"==i.GetResponseHeader("MsgError")?(this.Status="后台未找到对应文档",i.Clear(),!1):(i.ResponseSaveToFile(t),this.Status="文档下载到本地成功",i.Clear(),!0):(this.Status="数据包发送失败",!1):(this.Status="打开连接失败",i.Clear(),!1)},this.WebPutFile=function(t,e){var i=this.obj.Http;return i.Clear(),this.WebSetMsgByName("REMOTEFILE",e),this.WebSetMsgByName("OPTION","PUTFILE"),i.AddForm("FormData",this.GetMessageString()),i.AddFile("FileData",t),this.WebClearMessage(),i.ShowProgressUI=!1,i.Open(this.HttpMethod.Post,this.WebUrl,!1)?i.Send()?(this.Status="文档上传成功",i.Clear(),!0):(this.Status="文档上传失败",i.Clear(),!1):(this.Status="打开链接失败",i.Clear(),!1)},this.WebDelFile=function(t,e){if(""==t){if(""!=e){var i=this.obj.Http;return i.Clear(),this.WebSetMsgByName("REMOTEFILE",e),this.WebSetMsgByName("OPTION","DELFILE"),i.AddForm("FormData",this.GetMessageString()),this.WebClearMessage(),i.ShowProgressUI=!1,i.Open(this.HttpMethod.Post,this.WebUrl,!1)?i.Send()?"成功"==this.WebGetMsgByName("DelFileState")?(this.Status="文档删除成功",i.Clear(),!0):(this.Status="文档不存在",i.Clear(),!1):(this.Status="向后台发送数据包失败",i.Clear(),!1):(this.Status="打开链接失败",!1)}return this.Status="文件名为空,请输入要删除的文件名",!1}var s=this.obj.FileSystem;return s.DeleteFile(t)?(this.Status="删除本地文件成功",!0):(this.Status="该文档不存在或者没有权限删除",!1)},this.CreateFile=function(){var t=this.getDocType(this.FileType);switch(t){case this.DocType.WORD:this.obj.CreateNew("Word.Document"),this.Status="新建WORD成功";break;case this.DocType.EXECL:this.obj.CreateNew("Excel.Sheet"),this.Status="新建EXECL成功";break;case this.DocType.PICTURE:this.obj.CreateNew("iWebPicture.iWebPictureMain"),this.Status="新建TIF成功";break;case this.DocType.PPT:this.obj.CreateNew("PowerPoint.Show"),this.Status="新建PPT成功";break;default:this.obj.CreateNew("Word.Document"),this.Status="新建WORD成功";break}},this.FullSize=function(t){this.obj.FullSize=t},this.WebSaveLocal=function(){var t;if(".doc"==this.FileType||".docx"==this.FileType){var i="所有支持的文件格式(*.docx;*.doc)|*.docx;*.doc";i+="|Word 文档(*.docx)|*.docx",i+="|Word 97-2003文档(*.doc)|*.doc",i+="||"}else if(".xls"==this.FileType||".xlsx"==this.FileType){i="所有支持的文件格式(*.xlsx;*.xls)|*.xlsx;*.xls";i+="|Excel 工作簿(*.xlsx)|*.xlsx",i+="|Excel 97-2003工作簿(*.xls)|*.xls",i+="||"}t=this.obj.FileSystem.FileSaveAs(i,this.FileName);t.substring(t.length-3,t.length);if(""==t)return!0;try{this.obj.Save(t,0)}catch(e){return this.Status=e.description,alert(e.description),!1}return!0},this.WebOpenLocal=function(){this.setShowDialog(this.ShowDialog.DialogOpen,this.getOpenDocSuffix(this.FileType)),this.Status="打开本地文档成功"},this.WebSaveLocalFile=function(t){try{if(this.WebDelLocalFile(t),".pdf"!=this.FileType)var i=this.Save(t,this.getOfficeVersion(),this.FileType.substring(1).toUpperCase());else i=this.Save(t,0,this.FileType.substring(1).toUpperCase());return i}catch(e){return this.Status=e.description,this.Status="保存本地文档失败",-1}},this.WebOpenLocalFile=function(t){if(this.getDocType(this.FileType)==this.DocType.PICTURE)try{return this.obj.ActiveDocument.WebOpenLocalFile(t),this.Status="打开本地文档成功",0}catch(e){return this.Status="打开本地文档失败",-1}return this.obj.Open(t)},this.WebGetBookMarks=function(t){return this.obj.ActiveDocument.BookMarks.Exists(t)?this.obj.ActiveDocument.Bookmarks.Item(t).Range.Text:(this.Status="名称为"+t+"的书签在文档中不存在","")},this.WebAddBookMarks=function(t,e){if(".doc"==this.FileType||".docx"==this.FileType){if("-1"==this.obj.ActiveDocument.ProtectionType){if(this.obj.ActiveDocument.BookMarks.Exists(t))return this.Status="名称为"+t+"的书签在文档中已存在",this.WebFindBookMarks(t),!1;var i=e.length;this.obj.ActiveDocument.Application.Selection.TypeText(e),this.obj.ActiveDocument.Application.Selection.MoveLeft(Unit=1,Count=i);var s=this.obj.ActiveDocument.Application.Selection.Start,o=this.obj.ActiveDocument.Application.Selection.Start+i;return this.obj.ActiveDocument.Range(Start=s,End=o).Select(),this.obj.ActiveDocument.Bookmarks.Add(t),this.Status="光标处添加书签成功",!0}return this.Status="文档被锁定,操作失败",!1}return this.Status="非Word文档,操作失败",!1},this.WebFindBookMarks=function(t){if(".doc"==this.FileType||".docx"==this.FileType){if("-1"==this.obj.ActiveDocument.ProtectionType){if(this.obj.ActiveDocument.BookMarks.Exists(t)){var e=this.obj.Range;return e=this.obj.ActiveDocument.Bookmarks.Item(t).Range,e.Select(),this.Status="已定位到书签",!0}return this.Status="名称为"+t+"的书签在文档中不存在",!1}return this.Status="文档被锁定,操作失败",!1}return this.Status="非Word文档,操作失败",!1},this.WebDelBookMarks=function(t){return".doc"==this.FileType||".docx"==this.FileType?"-1"==this.obj.ActiveDocument.ProtectionType?this.obj.ActiveDocument.BookMarks.Exists(t)?(this.obj.ActiveDocument.Bookmarks.Item(t).Delete(),this.Status="删除书签成功",!0):(this.Status="名称为"+t+"的书签在文档中不存在",!1):(this.Status="文档被锁定,操作失败",!1):(this.Status="非Word文档,操作失败",!1)},this.WebSetBookmarks=function(t,i){if(".doc"!=this.FileType&&".docx"!=this.FileType&&".wps"!=this.FileType)return this.Status="非Word文档,插入失败",!1;if("-1"!=this.obj.ActiveDocument.ProtectionType)return this.Status="插入失败,文档被锁定",!1;try{if(this.obj.ActiveDocument.BookMarks.Exists(t)){var s=this.obj.ActiveDocument.Bookmarks.Item(t).Range;return s.text=i,this.obj.ActiveDocument.Bookmarks.Add(t,s),this.Status="书签赋值成功",!0}return this.Status="名称为"+t+"的书签在文档中不存在",!1}catch(e){return this.Status=e.description,!1}},this.SetBookMarksFont=function(t,e,i,s,o,n){this.WebObject.ActiveDocument.Bookmarks.Item(t).Range.Select();var a=this.WebObject.ActiveDocument.Application.Selection;a.Font.Color=e,a.Font.Size=i,a.Font.Name=s,a.Font.Bold=o,a.Font.Italic=n},this.WebToolsVisible=function(t,e){return this.Status="该功能暂未提供!",!1},this.WebToolsEnable=function(t,e,i){return this.Status="该功能暂未提供!",!1},this.WebOpenPrint=function(){this.setShowDialog(this.ShowDialog.DialogPrint)},this.WebOpenPicture=function(){if(".doc"==this.FileType||".docx"==this.FileType||".wps"==this.FileType){var t=this.obj.ActiveDocument.Application.Dialogs.Item(163);t.Show()}else if(".xls"==this.FileType||".xlsx"==this.FileType||".et"==this.FileType){t=this.obj.ActiveDocument.Application.Dialogs.Item(342);t.Show()}},this.WebRefresh=function(){this.obj.Activate(!0)},this.WebSetRevision=function(t,e,i,s){var o;return o=' ',this.getDocType(this.FileType)==this.DocType.WORD&&"-1"==this.obj.ActiveDocument.ProtectionType?(this.obj.ActiveDocument.TrackRevisions=e,this.obj.ActiveDocument.ShowRevisions=t,this.obj.ActiveDocument.PrintRevisions=i,s?(this.obj.RibbonCustomUI=o,this.Status="设置痕迹成功",!0):(this.Status="设置痕迹成功",!0)):(this.Status="非word文档,无法执行",!1)},this.WebSetProtect=function(t,e){var i=this.getDocType(this.FileType);""==e&&(e=this.PASSWORD),t?this.VBAProtectDocument(i,e):this.VBAUnProtectDocument(i,e)},this.WebDownLoadFile=function(t,e){var i=0,s=this.obj.Http;s.Clear(),s.ShowProgressUI=!0,s.Hidden=!1;var o=s.Open(i,t,!1);if(o){var n=s.Send();return n?200==s.Status?(s.ResponseSaveToFile(e),this.Status="下载成功",!0):(this.Status="下载失败请检查URL是否正确",!1):(this.Status="数据包发送失败",!1)}return this.Status="打开连接失败",s.Clear(),!1},this.WebMkDirectory=function(t){var e=this.obj.FileSystem;return e.CreateDirectory(t)?(this.Status="创建目录成功",!0):(this.Status="创建目录失败检查是否已经有此目录或者路径不对",!1)},this.WebRmDirectory=function(t){var e=this.obj.FileSystem;return e.ClearDirectory(t),this.Status="删除目录成功",!0},this.WebFileExists=function(t){return this.Status="该功能暂未提供!",!1},this.WebFileSize=function(t){var e=this.obj.FileSystem,i=e.GetFileSize(t);return 0==i?(this.Status="请检查文件路径是否有误",0):(this.Status="获取成功大小为"+i+"字节",i)},this.WebFileDate=function(t){return this.Status="该功能暂未提供!",!1},this.DisableMenu=function(t){var e=this.obj.CustomMenu;return e.DisableMenu(MenuFile,t)},this.EnableMenu=function(t){var e=this.obj.CustomMenu;return e.EnableMenu(MenuFile,t)},this.DisableKey=function(t){return this.Status="该功能暂未提供!",!1},this.WebOpenKey=function(t,e){root=t,rootValue=e;var i=this.obj.Register,s=i.QueryStringValue(root,rootValue,"");return s?(this.Status="建立注册对象成功",!0):(i.SetStringValue(root,rootValue,"",""),this.Status="建立注册对象失败,已新建注册表对象",s)},this.WebWriteString=function(t,e){var i=this.obj.Register;if(void 0!=root&&void 0!=rootValue){var s=i.SetStringValue(root,rootValue,t,e);return this.Status="写入注册表成功",s}return this.Status="写入注册表失败,请先调用WebOpenKey接口",!1},this.WebReadString=function(t){var e=this.obj.Register;if(void 0!=root&&void 0!=rootValue){var i=e.QueryStringValue(root,rootValue,t);return null!=i||""!=i?(this.Status="读取注册表成功",i):(this.Status="读取失败,没有对应的注册表",i)}return this.Status="读取注册表失败,请先调用WebOpenKey接口",!1},this.WebWriteInteger=function(t,e){var i=this.obj.Register;if(void 0!=root&&void 0!=rootValue){var s=i.SetDWordValue(root,rootValue,t,e);return this.Status="写入注册表成功",s}return this.Status="写入注册表失败,请先调用WebOpenKey接口",!1},this.WebReadInteger=function(t){var e=this.obj.Register;if(void 0!=root&&void 0!=rootValue){var i=e.QueryDWORDValue(root,rootValue,t);return null!=i||""!=i?(this.Status="读取注册表成功",i):(this.Status="读取失败,没有对应的注册表",i)}return this.Status="读取注册表失败,请先调用WebOpenKey接口",!1},this.ShowDate=function(t,e){return this.Status="该功能暂未提供!",!1},this.SignatureColor=function(t){return this.Status="该功能暂未提供!",!1},this.SignatureCount=function(t){return this.Status="该功能暂未提供!",0},this.GetSignature=function(t){return this.Status="该功能暂未提供!",!1},this.ClearRevisions=function(){if(this.getDocType(this.FileType)!=this.DocType.WORD||"-1"!=this.obj.ActiveDocument.ProtectionType)return this.Status="痕迹接受失败,错误原因:"+e.description,!1;try{return this.obj.Activate(!0),this.obj.ActiveDocument.AcceptAllRevisions(),this.obj.ActiveDocument.Revisions.AcceptAll(),this.Status="痕迹接受成功",this.obj.ActiveDocument.Revisions.Count>=0}catch(e){return this.Status="痕迹接受失败,错误原因:"+e.description,!1}},this.WebDelTree=function(t){var e=this.obj.FileSystem;return e.ClearDirectory(t),!0},this.Version=function(){return this.obj.Version},this.VersionEx=function(){return this.Status="该功能暂未提供!",!1},this.PrintByCopies=function(t,e){var i,s;return parseInt(t),s=this.obj.ActiveDocument.Application.Name,"Microsoft Word"==s?(i=this.obj.ActiveDocument.Application.Dialogs.Item(88),e?(i.NumCopies=t,-1==i.Display?(i.Execute,this.Status="打印成功",!0):(this.Status="启用打印机窗口失败",!1)):(i.NumCopies=t,i.Execute,this.Status="打印成功",!0)):(this.Status="文档不是word类型",!1)},this.WebGetCpuID=function(){return this.Status="该功能暂未提供!",!1},this.WebGetIdeID=function(){return this.Status="该功能暂未提供!",!1},this.BuildContentFromHTML=function(t){return this.Status="该功能暂未提供!",!1},this.WebRunMacro=function(t,i){try{var s=i,o=this.obj.ActiveDocument.VBProject.VBComponents.Add(1);return o.CodeModule.AddFromString(s),this.obj.ActiveDocument.Application.Run(t),!0}catch(e){return!1}},this.WebDocumentCompare=function(t,e){this.Status="";this.obj.FileSystem;var i=this.DownFilePath(),s=i+Math.round(1e8*Math.random())+".doc";if(null==t||""==t){if(null==e||""===e)return this.Status="【FileName2】不能为空!",!1;if(this.WebDownloadFile_int(e)){t=this.FileName,this.WebSaveLocalFile(i+t),this.WebClose();var o=this.obj.FuncExtModule.WebDocumentCompare(i+t,this.DownloadedFileTempPathName,s);return 1==o?(this.obj.Open(s),this.obj.ActiveDocument.Application.ActiveWindow.View.type=3,this.obj.ActiveDocument.Application.ActiveWindow.View.SplitSpecial=20,!0):(this.Status="文档对比失败,请确认待对比的文档是否能够正常打开!",!1)}return this.Status="文件【"+e+"】下载失败,该文档可能在服务器不存在!",!1}if(null==e||""==e)return this.Status="【FileName2】不能为空!",!1;if(this.WebDownloadFile_int(t)){if(this.WebDownloadFile_int(e)){this.WebClose();o=this.obj.FuncExtModule.WebDocumentCompare(i+t,i+e,s);return 1==o?(this.obj.Open(s),this.obj.ActiveDocument.Application.ActiveWindow.View.type=3,this.obj.ActiveDocument.Application.ActiveWindow.View.SplitSpecial=20,!0):(this.Status="文档对比失败,请确认待对比的文档是否能够正常打开!",!1)}return this.Status="文件【"+e+"】下载失败,该文档可能在服务器不存在!",!1}return this.Status="文件【"+t+"】下载失败,该文档可能在服务器不存在!",!1},this.WebSetSkin=function(t,i,s,o,n,a,r){this.Status="";var h=this.obj.Style;try{return h.TitleBarColor=t,h.TitleBarTextColor=void 0==r||""==r?0:r,t=15923711,a=15923711,i=15923711,s=9489396,o=9489396,n=9489396,h.MenuBarStartColor=i,h.MenuBarEndColor=16777215,h.MenuBarTextColor=0,h.MenuBarHighlightTextColor=0,h.MenuBarButtonStartColor=s,h.MenuBarButtonEndColor=o,h.MenuBarButtonFrameColor=n,h.CustomToolbarStartColor=a,h.CustomToolbarEndColor=a,h.Invalidate(),!0}catch(e){return this.Status="皮肤设置错误,错误信息为:"+e.description,!1}},this.WebEnableCopy=function(t){switch(t){case 0:case!1:case"0":this.obj.CopyEnabled=!1,this.Status="禁止复制";break;case 1:case"1":case!0:this.obj.CopyEnabled=!0,this.Status="允许复制";break;default:return}},this.VBAShowRevisions=function(t){return this.getDocType(this.FileType)==this.DocType.WORD&&"-1"==this.obj.ActiveDocument.ProtectionType?(this.obj.ActiveDocument.TrackRevisions=t,this.obj.ActiveDocument.ShowRevisions=t,this.Status="隐藏痕迹成功",!0):(this.Status="非Office文档或文档已被锁定,无法执行操作",!1)},this.VBAProtectDocument=function(t,e){return t==this.DocType.WORD?"-1"==this.obj.ActiveDocument.ProtectionType?(this.obj.ActiveDocument.Protect(2,!1,e),this.Status="文档已被锁定",!0):(this.Status="文档锁定失败",!1):t!=this.DocType.EXECL?(this.Status="非Office文档,无法执行锁定操作",!1):this.obj.ActiveDocument.Application.Sheets(1).ProtectContents?(this.Status="文档已锁定",!1):(this.obj.ActiveDocument.Application.Sheets(1).Protect(e),void(this.Status="文档锁定成功"))},this.VBAUnProtectDocument=function(t,e){t=this.getDocType(this.FileType);return t==this.DocType.WORD?(this.obj.ActiveDocument.Unprotect(e),this.Status="WORD解除保护",!0):t==this.DocType.EXECL?(this.obj.ActiveDocument.Application.Sheets(1).Unprotect(e),this.Status="解除保护",!0):(this.Status="非Office文档,无法执行解锁操作",!1)},this.VBAInsertFile=function(t,i){try{var s=this.getDocType(this.FileType);return s==this.DocType.WORD?(this.obj.Activate(!0),this.obj.ActiveDocument.BookMarks.Exists(t)&&setTimeout(this.obj.ActiveDocument.Application.Selection.GoTo(-1,0,0,t),200),this.obj.Activate(!0),this.obj.ActiveDocument.Application.Selection.InsertFile(i,"",!1,!1,!1),!0):(this.Status="非Office文档,无法执行插入文档操作",!1)}catch(e){return this.Status="插入文档失败,错误原因:"+e.description,!1}},this.WebAcceptAllRevisions=function(t){return this.obj.FuncExtModule.WebAcceptAllRevisions(t),this.Status="接受所有痕迹成功!",!1},this.VBASetUserName=function(t){if(".ppt"!=this.FileType&&".pptx"!=this.FileType)try{this.obj.ActiveDocument.Application.UserName=t,".xls"!=this.FileType&&".xlsx"!=this.FileType&&(this.WebObject.ActiveDocument.Application.Options.UseLocalUserInfo=!0,this.obj.ActiveDocument.Application.UserInitials=t)}catch(e){this.OfficeUserName=this.obj.ActiveDocument.Application.UserName,this.obj.ActiveDocument.Application.UserName=t,".xls"!=this.FileType&&".xlsx"!=this.FileType&&(this.obj.ActiveDocument.Application.UserInitials=t)}},this.ShowField=function(){try{return this.obj.ActiveDocument.ActiveWindow.View.ShowDrawings=!0,this.obj.ActiveDocument.ActiveWindow.View.ShowFieldCodes=!1,!0}catch(e){return this.Status="设置域失败,错误原因:"+e.description,!1}},this.WebAreaProtect=function(t){if(".doc"==this.FileType||".docx"==this.FileType){if("-1"==this.obj.ActiveDocument.ProtectionType){for(var e=t.split(","),i="",s=0;s<=e.length;s++)if(this.obj.ActiveDocument.BookMarks.Exists(e[s])){var o=this.obj.Range;o=this.obj.ActiveDocument.Bookmarks.Item(e[s]).Range,o.Select(),this.obj.ActiveDocument.bookmarks.Item(e[s]).range.editors.add(-1)}else i+=e[s];return this.obj.ActiveDocument.Protect(3,!1,"123",!1,!1),this.obj.ActiveDocument.Application.Selection.MoveLeft(Unit=1,Count=1),this.obj.ActiveDocument.ActiveWindow.View.ShadeEditableRanges=!1,this.Status=""!=i?i+"书签名不存在":"操作成功,书签区域可编辑",!0}return this.Status="文档以被保护,请解除保护后操作!",!1}return this.Status="非Office文档,无法执行区域保护操作!",!1},this.WebAreaUnprotect=function(t){if(".doc"!=this.FileType&&".docx"!=this.FileType)return this.Status="非Office文档,无法执行取消区域保护操作!",!1;for(var i=t.split(","),s=0;s<=i.length;s++){if(!this.obj.ActiveDocument.BookMarks.Exists(i[s]))return this.Status="文档中不存在<"+i[s]+">的书签",!1;try{this.obj.ActiveDocument.Unprotect("123");var o=this.obj.Range;return o=this.obj.ActiveDocument.Bookmarks.Item(i[s]).Range,o.Select(),this.obj.ActiveDocument.DeleteAllEditableRanges(-1),this.Status="书签区域"+i[s]+"可以编辑",!0}catch(e){return this.Status="执行取消区域保护时出现错误,错误原因:"+e.description,!1}}},this.Activate=function(t){this.obj.Activate(t)},this.WebPageCode=function(){this.obj.ActiveDocument.Application.Dialogs.Item(294).Show()},this.ShowTitleBar=function(t){var e=this.obj.Style;e.ShowTitleBar=t},this.ShowCustomToolBar=function(t){var e=this.obj.Style;e.ShowCustomToolbar=t},this.ShowMenuBar=function(t){var e=this.obj.Style;switch(t){case 0:case!1:case"0":e.ShowMenuBar=!1;break;case 1:case"1":case!0:e.ShowMenuBar=!0;break;default:return}},this.ShowToolBars=function(t){var e=this.obj.Style;e.ShowToolBars=t,e.ShowToolSpace=t},this.ShowStatusBar=function(t){var e=this.obj.Style;e.ShowStatusBar=t},this.ShowCustomToolbar=function(t){this.obj.Style.ShowCustomToolbar=t},this.WebShow=function(t){this.getDocType(this.FileType)==this.DocType.WORD&&this.VBAShowRevisions(t)},this.SaveEnabled=function(t){this.obj.SaveEnabled=t},this.PrintEnabled=function(t){this.obj.PrintEnabled=t},this.HookEnabled=function(){this.getDocType(this.FileType)==this.DocType.WORD&&(this.obj.Style.ShowToolSpace=!0,this.obj.SelectionInformationEnabled=!1),void 0!=window.ActiveXObject||null!=window.ActiveXObject||"ActiveXObject"in window||(this.obj.HookEnabled=!1)},this.ClearDirectory=function(){var t=this.obj.FileSystem;t.ClearDirectory(this.DownFilePath()),t.ClearDirectory(this.getFilePath())},this.WebDelLocalFile=function(t){var e=this.obj.FileSystem;e.DeleteFile(t)},this.GetMessageString=function(){return this.ht.toString()},this.WebSetRibbonUIXML=function(t){this.obj.RibbonCustomUI=t},this.WebSetMaxFileSize=function(t){return!(this.WebFileSize(t)>1024*this.MaxFileSize)},this.DownFilePath=function(){var t,e=this.obj.FileSystem;return t=this.HiddenDirectory?e.GetSpecialFolderLocation(32)+this.DOWN+e.GetFolderEncryptCode(1)+"\\":e.GetSpecialFolderPath(26)+this.DOWN,t},this.getFilePath=function(){var t,e=this.obj.FileSystem;return t=this.HiddenDirectory?e.GetSpecialFolderLocation(32)+this.UP+e.GetFolderEncryptCode(1)+"\\":e.GetSpecialFolderLocation(26)+this.UP,e.CreateDirectory(t),this.FilePath=t,this.FilePath},this.WebSetAllowEmpty=function(){if(".doc"==this.FileType||".docx"==this.FileType){var t=this.WebObject.ActiveDocument.Content.Text;return 1!=t.length}return!0},this.NewCopyType=function(t){switch(t){case 0:case!1:case"0":this.obj.CopyEnabled=!1;break;case 1:case"1":case!0:this.obj.CopyEnabled=!0;break;default:return}},this.NewShowToolBar=function(t){var e=this.obj.Style;switch(t){case!1:case 0:e.ShowCustomToolbar=!1,e.ShowToolBars=!0;break;case!0:case 1:e.ShowCustomToolbar=!0,e.ShowToolBars=!0;break;case 2:e.ShowCustomToolbar=!1,e.ShowToolBars=!1;break;case 3:e.ShowCustomToolbar=!0,e.ShowToolBars=!1;break}},this.NewUIControl=function(t){var e;switch(t){case!1:e=' \t\t\t \t\t\t \t \t \t\t\t \t \t\t \t\t\t \t\t \t\t';break;case!0:e=' \t\t\t\t \t\t\t\t \t \t \t\t\t\t \t \t\t \t\t\t\t \t\t\t\t\t';break}this.obj.RibbonCustomUI=e},this.ModifyReview=function(){var t=' \t \t \t \t \t\t \t \t \t \t \t\t\t\t \t \t \t \t\t \t \t ';for(i=1;i<=this.obj.ActiveDocument.Application.CommandBars.Item("Track Changes").Controls.Count;i++)1715==this.obj.ActiveDocument.Application.CommandBars.Item("Track Changes").Controls.Item(i).ID&&(this.obj.ActiveDocument.Application.CommandBars.Item("Track Changes").Controls.Item(i).Enabled=!1),1716==this.obj.ActiveDocument.Application.CommandBars.Item("Track Changes").Controls.Item(i).ID&&(this.obj.ActiveDocument.Application.CommandBars.Item("Track Changes").Controls.Item(i).Enabled=!1),2041==this.obj.ActiveDocument.Application.CommandBars.Item("Track Changes").Controls.Item(i).ID&&(this.obj.ActiveDocument.Application.CommandBars.Item("Track Changes").Controls.Item(i).Enabled=!1);this.obj.RibbonCustomUI=t},this.OfficeFastUI=function(){var t=' \t \t\t\t\t \t \t \t \t \t \t \t \t\t \t \t \t\t \t \t \t\t \t \t \t\t \t \t \t\t \t \t \t\t \t \t\t';this.obj.RibbonCustomUI=t},this.WebSetRibbonUIXML=function(){var t=' \t\t \t\t\t \t\t \t\t \t\t\t\t \t\t\t\t \t\t\t \t\t \t\t';this.obj.RibbonCustomUI=t},this.ShowDialog={DialogNew:0,DialogOpen:1,DialogSaveAs:2,DialogSaveCopyAs:3,DialogPrint:4,DialogPageSetup:5,DialogProperties:6},this.setObj=function(t){return this.obj=t,this.WebObject=this.obj,!0},this.DocType={WORD:0,EXECL:1,PPT:2,PDF:3,OFD:4},this.HttpMethod={Get:0,Post:1},this.SaveAsPdf=function(t){var i=this.obj.ActiveDocument.Application.Version;if("11.0"!=i){if(".doc"==this.FileType||".docx"==this.FileType||".wps"==this.FileType)try{return this.obj.ActiveDocument.ExportAsFixedFormat(t,17,!1,0,0,1,1,0,!0,!0,0,!0,!0,!0),this.Status="保存PDF到本地成功",!0}catch(e){return this.Status=e.description,alert("保存PDF异常,可能Office没有保存PDF功能,建议安装SaveAsPDFandXPS插件"),!1}else if(".xls"==this.FileType||".xlsx"==this.FileType||".et"==this.FileType)try{return this.obj.ActiveDocument.Application.ActiveSheet.ExportAsFixedFormat(0,t,0),this.Status="保存PDF到本地成功",!0}catch(e){return this.Status=e.description,alert("保存PDF异常,可能Office没有保存PDF功能,建议安装SaveAsPDFandXPS插件"),!1}}else this.Status="保存PDF异常,Office没有保存PDF功能",alert("保存PDF异常,Office没有保存PDF功能")},this.SaveAsHtml=function(t){if(".doc"==this.FileType||".docx"==this.FileType||".wps"==this.FileType)try{this.obj.ActiveDocument.SaveAs(t,8,!1,"",!1,"",!1,!1,!1,!1,!1,0);return this.obj.ActiveDocument.Application.ActiveWindow.View.type=3,!0}catch(e){return this.Status=e.description,!1}},this.ArrayList=function(){this.ObjArr={},this.Count=0,this.Add=function(t,e){return this.ObjArr[t]=e,this.Count++,!0},this.Get=function(t){return this.ObjArr[t]},this.Clear=function(){this.ObjArr={},this.Count=0},this.toString=function(){var t=new Array,e=0;for(var e in this.ObjArr)t.push("'"+e+"':'"+this.ObjArr[e]+"'");return"{"+t+"}"}},this.ht=new this.ArrayList,this.getOpenDocSuffix=function(t){var e;return 5==t.length&&(t=t.substring(0,4)),e="",!this.isWPS()&&this.getOfficeVersion()||(e+="*"+t+"x|*"+t+"x|"),e+="*"+t+"|*"+t+"|",e+=this.getOpenSuffixName(t)+"(*"+t,!this.isWPS()&&this.getOfficeVersion()||(e+=";*"+t+"x"),e+=")|*"+t,!this.isWPS()&&this.getOfficeVersion()||(e+=";*"+t+"x"),e+="|",e},this.WebDownloadFile_int=function(t){this.Status="";var e=this.obj.Http;if(e.Clear(),this.WebSetMsgByName("USERNAME",this.UserName),this.WebSetMsgByName("FILENAME",t),this.WebSetMsgByName("FILETYPE",this.FileType),this.WebSetMsgByName("RECORDID",this.RecordID),this.WebSetMsgByName("OPTION","LOADFILE"),e.AddForm("FormData",this.GetMessageString()),this.WebClearMessage(),e.ShowProgressUI=this.ShowWindow,e.Open(this.HttpMethod.Post,this.WebUrl,!1)&&e.Send())return"404"==e.GetResponseHeader("MsgError")?(this.Status="文档【"+t+"】下载失败,请确认该文档在服务器上是否存在",e.Clear(),!1):(e.Clear(),this.hiddenSaveLocal(e,this,!1,!1,t)?(this.Status="文档下载成功",!0):(this.Status="文档下载失败",!1))},this.SAVEFILE=function(t,e,i){return t.AddFile("file",e),this.WebClearMessage(),t.ShowProgressUI=this.ShowWindow,this.WebUrl=this.ServerUrl+this.SaveServlet,t.Open(this.HttpMethod.Post,this.WebUrl,!1)?(t.setRequestHeader("Authorization",i),t.Send()?(this.Status=t.status,this.getResultJson=JSON.parse(t.responseText),console.log(this.getResultJson),"302"!=this.getResultJson.code):(this.Status=t.status,!1)):(this.Status=t.status,!1)},this.LOADFILE=function(t){if(this.Status="",t.ShowProgressUI=this.ShowWindow,this.WebUrl=this.ServerUrl+this.FileName,t.Clear(),t.Open(this.HttpMethod.Get,encodeURI(this.WebUrl,"utf-8"),!1)){if(t.Send()){var e=t.status;if(404==e)return this.CreateFile(),this.getOfficeVersion(),t.Clear(),!0;if(405==e)return this.CreateFile(),this.getOfficeVersion(),t.Clear(),!0;if(t.Clear(),this.hiddenSaveLocal(t,this,!1,!1)){var i=this.WebOpenLocalFile(this.DownloadedFileTempPathName);return 0==i?(this.getOfficeVersion(),!0):1==i?(this.obj.FuncExtModule.Alert("可能当前授权码错误,请确认iWebOffice2015.js的授权是否正确(或乱码)!"),this.Status="可能当前授权码错误,请确认iWebOffice2015.js的授权是否正确(或乱码)",window.close(),!1):2==i?(this.obj.FuncExtModule.Alert("没有找到文档,请确认WebOpenLocalFile打开文档的路径是否正确!"),this.Status="有找到文档,请确认WebOpenLocalFile打开文档的路径是否正确",window.close(),!1):3==i?(this.obj.FuncExtModule.Alert("没有权限导致文档打开失败,请用管理员身份运行浏览器后重试!"),this.Status="没有权限导致文档打开失败,请用管理员身份运行浏览器后重试",window.close(),!1):4==i?(this.obj.FuncExtModule.Alert("文件可能损坏,请确定服务器文档是否已经损坏!"),this.Status="文件可能损坏,请确定服务器文档是否已经损坏",window.close(),!1):5==i?(this.obj.FuncExtModule.Alert("未安装Office或者注册表有损坏!"),this.Status="未安装Office或者注册表有损坏",window.close(),!1):6==i?(this.obj.FuncExtModule.Alert("文件被占用,请结束Office进程后重试!"),this.Status="文件被占用,请结束Office进程后重试",window.close(),!1):(this.obj.FuncExtModule.Alert("打开文档时未知错误!错误码为: "+i),this.Status="打开文档时未知错误!错误码为: "+i,window.close(),!1)}return this.Status="保存文档到本地 失败",!1}return alert("数据包发送失败!请检查链接<"+this.WebUrl+">是否正确或网络是否畅通。"),this.Status="数据包发送失败!请检查链接<"+this.WebUrl+">是否正确或网络是否畅通。",!1}return alert("打开链接<"+this.WebUrl+">失败!请检查网络是否畅通。"),this.Status="打开链接<"+this.WebUrl+">失败!请检查网络是否畅通。",!1},this.hiddenSaveLocal=function(t,i,s,o,n){try{this.Status="",s&&(t.Hidden=!0);var a="",r=i.obj.FileSystem,h=this.DownFilePath();return r.CreateDirectory(h),this.FilePath=h,void 0!=o&&1!=o||(a="temp"+i.RecordID,this.tempInsertName=a+this.FileName),void 0!=n&&""!=n||(n=this.FileName,n=1e5*Math.random()+this.FileType),this.DownloadedFileTempPathName=h+a+n,t.ResponseSaveToFile(this.DownloadedFileTempPathName),t.Clear(),!0}catch(e){return!1}},this.Save=function(FileName,is2003,FileType){if(this.getDocType(this.FileType)==this.DocType.PICTURE)return this.obj.ActiveDocument.WebSaveLocalFile(FileName)?0:-1;if(is2003)return this.obj.Save(FileName);var SaveFalg=this.obj.Save(FileName,eval("this.DocTypeValue."+FileType),!0);return 80==SaveFalg?"文件路径无效":81==SaveFalg?"参数无效":82==SaveFalg?"文件创建失败":SaveFalg},this.blnIE=function(){return void 0!=window.ActiveXObject||null!=window.ActiveXObject||"ActiveXObject"in window},this.isWPS=function(){return".WPS"==this.FileType.toUpperCase()||".ET"==this.FileType.toUpperCase()},this.getOfficeVersion=function(){var t=0;try{return-1==this.setVersion?(t=parseFloat(this.obj.ActiveDocument.Application.Version),this.setVersion=t):t=this.setVersion,11==t?this.OfficeVersion.v2003:this.OfficeVersion.vOther}catch(e){return this.OfficeVersion.v2003}},this.getDocType=function(t){return".doc"==t||".docx"==t||".wps"==t?this.DocType.WORD:".xls"==t||".xlsx"==t||".et"==t?this.DocType.EXECL:".tif"==t||".jpg"==t?this.DocType.PICTURE:".ppt"==t||".pptx"==t?this.DocType.PPT:".pdf"==t?this.DocType.PDF:".ofd"==t?this.DocType.OFD:void 0},this.getOpenSuffixName=function(t){var e;switch(t){case this.DocType.WORD:e="Word Files";break;case this.DocType.EXECL:e="Excel Files";break;default:e="Word Files";break}return e},this.setShowDialog=function(t,e){switch(t){case this.ShowDialog.DialogOpen:this.obj.ShowDialog(t,e,0);break;case this.ShowDialog.DialogNew:case this.ShowDialog.DialogPageSetup:case this.ShowDialog.DialogPrint:case this.ShowDialog.DialogProperties:case this.ShowDialog.DialogSaveCopyAs:case this.ShowDialog.DialogSaveAs:this.obj.ShowDialog(t);break;default:break}},this.setEditType=function(t){try{switch(t){case 0:case"0":this.VBAProtectDocument(this.getDocType(this.FileType),"123");break;case 1:case"1":this.WebShow(!1);break;case 2:case"2":this.WebShow(!0);break;default:}}catch(e){return!1}},this.getEditVersion=function(){return this.obj.AppName},this.SetUser=function(t){this.obj.User=t},this.CheckFile=function(t){this.obj.bCheckFile=t},this.EnableSignature=function(t){try{this.obj.ActiveDocument.Application.COMAddIns.Item("iSignatureWord.WordApp").Connect=t}catch(e){return}},this.AddWaterMark=function(t){if(".doc"==this.FileType||".docx"==this.FileType){if(this.blnIE())var i=this.WebObject.ActiveDocument.Application.ActiveDocument.BuiltInDocumentProperties(14);else i=this.WebObject.ActiveDocument.Application.ActiveDocument.BuiltInDocumentProperties.Item(14).Value();intPage=parseInt(i);var s=this.WebObject.ActiveDocument.Application.Selection;if("-1"==this.obj.ActiveDocument.ProtectionType){this.DelWaterMark(t);for(var o=1;o<=intPage;o++){s.GoTo(What=1,Which=1,Count=o);try{this.WebObject.ActiveDocument.ActiveWindow.ActivePane.View.SeekView=9,this.WebObject.ActiveDocument.Application.Selection.ClearFormatting(),s.HeaderFooter.Shapes.AddTextEffect(0,"金格科技","宋体",36,!1,!1,0,0).Select();var n=s.ShapeRange;n.Name=t+o,n.TextEffect.NormalizedHeight=!1,n.Line.Visible=!1,n.Fill.Visible=!0,n.Fill.Solid(),n.Fill.ForeColor.RGB=255,n.Fill.Transparency=.5,n.Rotation=-45,n.LockAspectRatio=!0,n.Height=144,n.Width=576,n.WrapFormat.AllowOverlap=!0,n.WrapFormat.Side=3,n.WrapFormat.type=3,n.RelativeHorizontalPosition=0,n.RelativeVerticalPosition=0,n.Left=-999995,n.Top=-999995,this.WebObject.ActiveDocument.ActiveWindow.ActivePane.View.SeekView=0,this.Status="插入水印成功"}catch(e){return this.Status="插入水印失败"+e.description,!1}}return!0}return this.Status="文档被锁定,插入水印失败",!1}return this.Status="非Word文档,插入水印失败",!1},this.DelWaterMark=function(t){if(".doc"==this.FileType||".docx"==this.FileType){if("-1"==this.obj.ActiveDocument.ProtectionType){this.WebObject.ActiveDocument.ActiveWindow.ActivePane.View.SeekView=9;var e=this.WebObject.ActiveDocument.Application.Selection,i=e.HeaderFooter.Shapes.Count;if(i>0)for(var s=i;s>=1;s--)(e.HeaderFooter.Shapes.Item(s).Name=t+s)&&e.HeaderFooter.Shapes.Item(s).Delete();return this.WebObject.ActiveDocument.ActiveWindow.ActivePane.View.SeekView=0,this.Status="删除水印成功",!0}return this.Status="文档被锁定,删除水印失败",!1}return this.Status="非Word文档,删除水印失败",!1},this.AddGraphicWaterMark=function(t){if(".doc"==this.FileType||".docx"==this.FileType){if(this.blnIE())var i=this.WebObject.ActiveDocument.Application.ActiveDocument.BuiltInDocumentProperties(14);else i=this.WebObject.ActiveDocument.Application.ActiveDocument.BuiltInDocumentProperties.Item(14).Value();intPage=parseInt(i);var s=this.WebObject.ActiveDocument.Application.Selection;if("-1"==this.obj.ActiveDocument.ProtectionType){this.DelWaterMark(t);for(var o=1;o<=intPage;o++){s.GoTo(What=1,Which=1,Count=o);try{this.WebObject.ActiveDocument.ActiveWindow.ActivePane.View.SeekView=9,this.WebObject.ActiveDocument.Application.Selection.ClearFormatting();var n=this.DownFilePath(),a="WaterMark.jpg";this.DownloadToFile(a,n),s.HeaderFooter.Shapes.AddPicture(n+a,!1,!0).Select();var r=s.ShapeRange;r.Name=t+o,r.PictureFormat.Brightness=.85,r.PictureFormat.Contrast=.15,r.LockAspectRatio=!0,r.Height=60.95*72,r.Width=2925.36,r.WrapFormat.AllowOverlap=!0,r.WrapFormat.Side=3,r.WrapFormat.Type=3,r.RelativeHorizontalPosition=0,r.RelativeVerticalPosition=0,r.Left=-999995,r.Top=-999995,this.WebObject.ActiveDocument.ActiveWindow.ActivePane.View.SeekView=0,this.Status="水印添加成功"}catch(e){return this.Status="水印添加成功"+e.description,!1}}return!0}return this.Status="文档被锁定,插入水印失败",!1}return this.Status="非Word文档,插入水印失败",!1},this.ParagraphSettings=function(){var t=this.WebObject.ActiveDocument.Application.Selection.ParagraphFormat;t.Alignment=3,t.OutlineLevel=10,t.CharacterUnitLeftIndent=0,t.CharacterUnitRightIndent=0,t.CharacterUnitFirstLineIndent=0,t.MirrorIndents=!1,t.AutoAdjustRightIndent=!0,t.LineUnitBefore=0,t.LineUnitAfter=0,t.LineSpacingRule=1,t.DisableLineHeightGrid=!1,t.WidowControl=!1,t.KeepWithNext=!1,t.KeepTogether=!1,t.PageBreakBefore=!1,t.NoLineNumber=!1,t.Hyphenation=!0,t.FarEastLineBreakControl=!0,t.WordWrap=!0,t.HangingPunctuation=!0,t.HalfWidthPunctuationOnTopOfLine=!1,t.AddSpaceBetweenFarEastAndAlpha=!0,t.AddSpaceBetweenFarEastAndDigit=!0,t.BaseLineAlignment=4,this.WebObject.ActiveDocument.Application.Selection.MoveLeft(Unit=1,Count=1)},this.CleanBackground=function(){this.WebObject.ActiveDocument.Application.Selection.WholeStory();var t=this.WebObject.ActiveDocument.Application.Selection.Font.Shading;t.Texture=0,t.ForegroundPatternColor=-16777216,t.BackgroundPatternColor=-16777216;var e=this.WebObject.ActiveDocument.Application.Selection.ParagraphFormat.Shading;e.Texture=0,e.ForegroundPatternColor=-16777216,e.BackgroundPatternColor=-16777216,this.WebObject.ActiveDocument.Application.Selection.MoveLeft(Unit=1,Count=1)},this.WordFontSet=function(){if(".doc"==this.FileType||".docx"==this.FileType){var t=this.WebObject.ActiveDocument.Application.Selection.Font;t.Name="微软雅黑",t.Size=10.5,t.Bold=!1,t.Italic=!1,t.Underline=0,t.UnderlineColor=0,t.StrikeThrough=!1,t.DoubleStrikeThrough=!1,t.Hidden=!1,t.SmallCaps=!1,t.AllCaps=!1,t.Color=-16777216,t.Superscript=!1,t.Subscript=!1,t.Spacing=0,t.Scaling=100,t.Position=0,t.DisableCharacterSpaceGrid=!1,t.EmphasisMark=0,t.Ligatures=0,t.NumberSpacing=0,t.NumberForm=0,t.StylisticSet=0,t.ContextualAlternates=0,this.WebObject.ActiveDocument.Application.Selection.MoveLeft(Unit=1,Count=1)}else this.Status="文档不是word类型"},this.HyperDelete=function(){if(".doc"==this.FileType||".docx"==this.FileType){var t=this.WebObject.ActiveDocument.Application.Selection;t.WholeStory();for(var e=this.WebObject.ActiveDocument.Hyperlinks.Count,i=1;i<=e;i++)this.WebObject.ActiveDocument.Hyperlinks.Item(1).Delete();t.MoveLeft(Unit=1,Count=1)}else".xls"!=this.FileType&&".xlsx"!=this.FileType||this.WebObject.ActiveDocument.Application.Cells.Hyperlinks.Delete()},this.Close=function(){return 0==this.obj.Close()},this.WebPageSetup=function(){this.setShowDialog(this.ShowDialog.DialogPageSetup)},this.WebOpenPrint=function(){this.setShowDialog(this.ShowDialog.DialogPrint)},this.PrintPreview=function(){this.obj.PrintPreview()},this.PrintPreviewExit=function(){this.obj.PrintPreviewExit(),this.obj.ActiveDocument.ActiveWindow.View.ShowFieldCodes=!1},this.AppendTools=function(t,e,i){parseInt(t);var s=this.obj.CustomToolbar;s.AddToolButton(t,e,i,e,0)},this.DisableTools=function(t,e){var i=this.obj.CustomToolbar;i.DisableToolsButton(t,e),this.obj.Style.Invalidate()},this.VisibleTools=function(t,e){var i=this.obj.CustomToolbar;i.VisibleToolsButton(t,e),this.obj.Style.Invalidate()},this.AppendMenu=function(t,e){var i=this.obj.CustomMenu;void 0!=MenuFile&&null!=MenuFile||(i.Clear(),MenuFile=i.CreatePopupMenu(),i.Add(MenuFile,"文件(&F)")),i.AppendMenu(MenuFile,t,!1,e),i.Update()},this.AddCustomMenu=function(){var t=this.obj.CustomMenu,e=t.CreatePopupMenu(),i=t.CreatePopupMenu();t.AppendMenu(i,6,!1,"自定义二级菜单一"),t.AppendMenu(i,7,!1,"自定义二级菜单二"),t.AppendMenu(i,0,!1,"-");var s=t.CreatePopupMenu();t.AppendMenu(s,8,!1,"自定义三级菜单一"),t.AppendMenu(s,0,!1,"-"),t.AppendMenu(s,9,!1,"自定义三级菜单二"),t.AppendMenu(i,s,!0,"自定义三级菜单"),t.AppendMenu(i,10,!1,"自定义二级菜单三"),t.AppendMenu(e,i,!0,"自定义二级菜单"),t.AppendMenu(e,17,!1,"启用保存"),t.AppendMenu(e,18,!1,"禁止保存"),t.AppendMenu(e,0,!1,"-"),t.AppendMenu(e,19,!1,"启用打印"),t.AppendMenu(e,20,!1,"禁止打印"),t.Add(e,"编辑(&E)"),t.Update()},this.WebGetDocSuffix=function(){try{var t=this.getDocType(this.FileType),i=0;return t==this.DocType.WORD&&(this.Activate(!0),i=this.obj.ActiveDocument.SaveFormat),t==this.DocType.EXECL&&(this.obj.ExitExcelEditMode(),i=this.obj.ActiveDocument.FileFormat,i<0&&(i=56)),this.DocSuffixType[i]}catch(e){return this.FileType}},this.WebFullName=function(){return this.obj.FullName},this.InsertImageByBookMark=function(t,e){this.obj.ActiveDocument.BookMarks.Exists(this.BookMark)&&this.obj.ActiveDocument.Bookmarks.Item(this.BookMark).Select();var i=this.obj.ActiveDocument.Application.Selection.InlineShapes.AddPicture(this.DownloadedFileTempPathName);i.Select(),i.PictureFormat.TransparentBackground=t;var s=i.ConvertToShape();return s.WrapFormat.Type=3,s.ZOrder(e),!0},this.DownloadToFile=function(t,e){var i=this.obj.Http,s=this.WebUrl.substring(0,this.WebUrl.lastIndexOf("/"));return i.ShowProgressUI=this.ShowWindow,i.Open(this.HttpMethod.Get,s+"/Document/"+t,!1)&&i.Send()&&200==i.Status?(i.ResponseSaveToFile(e+t),i.Clear(),!0):(i.Close(),!1)},this.HandWriting=function(t,e){var i=this.obj.Handwritting,s=i.DrawingSetting;s.PenThicker=e,s.PenColor=t,i.AnnotateDraw(),this.ShowMenuBar(!1),this.ShowToolBars(!1)},this.StopHandWriting=function(){var t=this.obj.Handwritting;t.StopAnnotate(),this.ShowMenuBar(!0),this.ShowToolBars(!0)},this.TextWriting=function(){var t=this.obj.Handwritting,e=t.TextSetting;e.TextSize=32,e.TextColor=12255487,e.FontName="宋体",t.AnnotateText(),this.ShowMenuBar(!1),this.ShowToolBars(!1)},this.ShapeWriting=function(){var t=this.obj.Handwritting,e=t.ShapeSetting;e.ShapeType=0,e.BackgroundColor=16777215,e.BorderColor=16711680,e.BorderWidth=6,t.AnnotateShape(),this.ShowMenuBar(!1),this.ShowToolBars(!1)},this.RemoveLastWriting=function(){var t=this.obj.Handwritting;t.RemoveLast()},this.ShowWritingUser=function(bVal,username){var strxml=this.obj.GetAnnotations(),json=eval("("+strxml+")");if(""!=username&&null!=username&&void 0!=username){for(var i=0;i'):"chrome"==o?(m+=' clsid="CLSID:D89F482C-5045-4DB5-8C53-D2C9EE71D025"',m+=' type="application/kg-plugin"',m+=' OnReady="OnReady"',m+=' OnCommand="OnCommand"',m+=' OnRightClickedWhenAnnotate="OnRightClickedWhenAnnotate"',m+=' OnSending="OnSending"',m+=' OnSendEnd="OnSendEnd"',m+=' OnRecvStart="OnRecvStart"',m+=' OnRecving="OnRecving"',m+=' OnRecvEnd="OnRecvEnd"',m+=' OnFullSizeBefore="OnFullSizeBefore"',m+=' OnFullSizeAfter="OnFullSizeAfter"',m+=' Copyright="'+v+'"',m+=">"):"firefox"==o&&(m+=' clsid="CLSID:D89F482C-5045-4DB5-8C53-D2C9EE71D025"',m+=' type="application/kg-activex"',m+=' OnCommand="OnCommand"',m+=' OnReady="OnReady"',m+=' OnOLECommand="OnOLECommand"',m+=' OnExecuteScripted="OnExecuteScripted"',m+=' OnQuit="OnQuit"',m+=' OnSendStart="OnSendStart"',m+=' OnSending="OnSending"',m+=' OnSendEnd="OnSendEnd"',m+=' OnRecvStart="OnRecvStart"',m+=' OnRecving="OnRecving"',m+=' OnRecvEnd="OnRecvEnd"',m+=' OnRightClickedWhenAnnotate="OnRightClickedWhenAnnotate"',m+=' OnFullSizeBefore="OnFullSizeBefore"',m+=' OnFullSizeAfter="OnFullSizeAfter"',m+=' Copyright="'+v+'"',m+=">"),m+="";var O=m,D=O,w=s("5e0c"),A=s("5f87"),g={props:{fileData:{}},data:function(){return{webOffice:null,webOfficeObj:null,headers:"Bearer "+Object(A["a"])(),saveResult:""}},beforeCreate:function(){},mounted:function(){var t=this;this.$nextTick((function(){t.initWebOffice(),t.initWebOfficeObject()}))},created:function(){},beforeDestroy:function(){},methods:{openlocal:function(){this.webOfficeObj.WebOpenLocal()},OnUnLoad:function(){this.webOfficeObj.WebClose()},initWebOffice:function(){this.webOffice=new h.a({template:D}).$mount("#office")},initWebOfficeObject:function(){var t=this;this.webOfficeObj=new w["a"],this.webOfficeObj.setObj(document.getElementById("WebOffice"));try{setTimeout((function(){t.webOfficeObj.ServerUrl="http://"+document.location.hostname+"/prod-api",t.webOfficeObj.UserName=t.fileData.user,t.webOfficeObj.FileName=t.fileData.filePath,t.webOfficeObj.getResultJson={},t.webOfficeObj.SaveServlet="/content/upload",t.webOfficeObj.FileType="."+t.fileData.filePath.split(".")[t.fileData.filePath.split(".").length-1],t.webOfficeObj.ShowWindow=!1,t.webOfficeObj.EditType=t.fileData.EditType,t.webOfficeObj.ShowMenu=0,t.webOfficeObj.ShowToolBar=0,t.webOfficeObj.SetCaption(t.webOfficeObj.UserName+"正在编辑文档"),t.webOfficeObj.WebSetSkin(14408667,15395562,15395562,14408667,14408667,14408667,0)||t.msgError("插件加载失败,请新打开!"),t.webOfficeObj.WebOpen()&&t.msgSuccess(t.webOfficeObj.Status),t.webOfficeObj.AppendMenu("1","打开本地文件(&L)"),t.webOfficeObj.AppendMenu("2","保存本地文件(&S)"),t.webOfficeObj.AppendMenu("3","-"),t.webOfficeObj.AppendMenu("4","打印预览(&C)"),t.webOfficeObj.AppendMenu("5","退出打印预览(&E)"),t.webOfficeObj.AddCustomMenu(),t.webOfficeObj.HookEnabled()}),2e3)}catch(e){console.log("catch"),console.log(e.description)}},closeWindow:function(){top.window.opener=top,top.window.open("","_self",""),top.window.close()},StatusMsg:function(t){try{this.msgSuccess(t)}catch(e){return!1}},SaveDocument:function(t){this.webOfficeObj.WebSave(this.headers)?(this.$emit("func",this.webOfficeObj.getResultJson.fileName),this.webOfficeObj.FileName=this.webOfficeObj.getResultJson.fileName,this.webOfficeObj.WebClose()):(this.webOfficeObj.Alert(this.webOfficeObj.Status),this.StatusMsg(this.webOfficeObj.Status))},closeOffice:function(t,e){this.webOfficeObj.WebClose(),this.msgSuccess("关闭插件")},WebSetProtect:function(t,e){this.webOfficeObj.WebSetProtect(t,e),this.msgSuccess(this.webOfficeObj.Status)},WebEnableCopy:function(t){this.webOfficeObj.WebEnableCopy(t),this.msgSuccess(this.webOfficeObj.Status)},WebAreaProtect:function(){this.webOfficeObj.HidePlugin(0);var t=window.prompt("文档里需要先设置保护的书签,示例文档默认添加了KingGrid的书签,请输入书签名称","KingGrid","");null!=t&&this.webOfficeObj.WebAreaProtect(t),this.webOfficeObj.HidePlugin(1)},WebAreaUnProtect:function(){this.webOfficeObj.HidePlugin(0);var t=window.prompt("需要和保护的书签对应,示例文档默认添加了KingGrid的书签,请输入书签名称","KingGrid","");null!=t&&this.webOfficeObj.WebAreaUnprotect(t),this.webOfficeObj.HidePlugin(1)},OnCommand:function(t,e,i){switch(t){case 1:WebOpenLocal();break;case 2:this.webOfficeObj.WebSaveLocal();break;case 4:this.webOfficeObj.PrintPreview();break;case 5:this.webOfficeObj.PrintPreviewExit(),this.webOfficeObj.ShowField();break;case 17:this.webOfficeObj.SaveEnabled(!0),this.StatusMsg("启用保存");break;case 18:this.webOfficeObj.SaveEnabled(!1),this.StatusMsg("关闭保存");break;case 19:this.webOfficeObj.PrintEnabled(!0),this.StatusMsg("启用打印");break;case 20:this.webOfficeObj.PrintEnabled(!1),this.StatusMsg("关闭打印");break;case 301:this.webOfficeObj.HandWriting("255","4"),this.StatusMsg("手写签批");break;case 302:this.webOfficeObj.StopHandWriting(),this.StatusMsg("停止手写签批");break;case 303:this.webOfficeObj.TextWriting(),this.StatusMsg("文字签名");break;case 304:this.webOfficeObj.ShapeWriting(),this.StatusMsg("图形签批");break;case 305:this.webOfficeObj.RemoveLastWriting(),this.StatusMsg("取消上一次签批");break;case 306:this.webOfficeObj.ShowWritingUser(!1,this.webOfficeObj.UserName),this.StatusMsg("显示签批用户");break;default:return}},LoadServlet:function(){this.webOfficeObj=new w["a"];try{this.webOfficeObj.ServerUrl="/prod-api";var t="profile/doc/web.docx";this.webOfficeObj.ShowMenu=1,this.webOfficeObj.ShowToolBar=0,this.SetGraySkin(),this.webOfficeObj.WebOpen3(t)&&this.StatusMsg(this.webOfficeObj.Status)}catch(e){this.StatusMsg(e.description)}},LoadURL:function(){try{this.webOfficeObj.ServerUrl="/prod-api",this.webOfficeObj.ShowMenu=1,this.webOfficeObj.ShowToolBar=0,this.webOfficeObj.UserName="xqx",this.webOfficeObj.FileName="web.docx",this.webOfficeObj.FileType=".docx",this.webOfficeObj.ShowWindow=!0,this.webOfficeObj.EditType="1",this.webOfficeObj.setObj(document.getElementById("WebOffice")),this.webOfficeObj.WebSetSkin(14408667,15395562,15395562,14408667,14408667,14408667,0)||alert(this.webOfficeObj.Status),this.webOfficeObj.WebOpen2("/profile/doc/web.docx")&&this.StatusMsg(this.webOfficeObj.Status)}catch(e){this.StatusMsg(e.description)}},SetGraySkin:function(){this.webOfficeObj.WebSetSkin(14408667,15395562,15395562,14408667,14408667,14408667,0)||this.webOfficeObj.Alert(this.webOfficeObj.Status)}}},F=g,j=s("2877"),W=Object(j["a"])(F,n,a,!1,null,null,null);i["default"]=W.exports}}]);