{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-fvue\\src\\views\\WebOffice.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\src\\views\\WebOffice.vue","mtime":1667327529872},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\babel.config.js","mtime":1667327525434},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"D:/jenkins/workspace/xq-web-fvue/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\n//\n//\n//\n//\n//\n//\n//\nimport Vue from \"vue\";\nimport webOfficeTpl from \"../../public/static/webOffice/iWebOffice2015\";\nimport WebOffice2015 from \"../../public/static/webOffice/WebOffice\";\nimport portal from \"@/api/portal.js\";\nexport default {\n  name: \"web-office\",\n  props: {\n    fileId: String,\n    isRevision: {\n      type: String,\n      default: \"0\"\n    },\n    inputWriteable: {\n      type: String,\n      default: \"1\"\n    }\n  },\n  data: function data() {\n    return {\n      webOffice: null,\n      webOfficeTpl: null,\n      loading: false,\n      canInput: \"1\"\n    };\n  },\n  mounted: function mounted() {\n    var _this = this;\n\n    this.$nextTick(function () {\n      _this.initWebOffice();\n\n      _this.initWebOfficeObject();\n    });\n  },\n  methods: {\n    initWebOffice: function initWebOffice() {\n      this.webOffice = new Vue({\n        template: webOfficeTpl\n      }).$mount('#office');\n    },\n    initWebOfficeObject: function () {\n      var _initWebOfficeObject = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n        var url, file, extensionName;\n        return regeneratorRuntime.wrap(function _callee$(_context) {\n          while (1) {\n            switch (_context.prev = _context.next) {\n              case 0:\n                this.webOfficeObj = new WebOffice2015();\n                this.webOfficeObj.setObj(document.getElementById('WebOffice'));\n                _context.prev = 2;\n                this.webOfficeObj.ServerUrl = \"http://localhost:8083/goldgrid\";\n                url = \"http://192.168.1.174:8088/system/file/v1/downloadFile?fileId=\".concat(this.fileId);\n                _context.next = 7;\n                return portal.getFile(this.fileId);\n\n              case 7:\n                file = _context.sent;\n                extensionName = file.data.extensionName ? file.data.extensionName : \"doc\";\n                this.webOfficeObj.UserName = this.getCurrentUsername();\n                this.webOfficeObj.FileName = \"\".concat(this.fileId, \".\").concat(extensionName);\n                this.webOfficeObj.FileType = \".\".concat(extensionName);\n                this.webOfficeObj.ShowWindow = true;\n                this.webOfficeObj.SetCaption(this.webOfficeObj.UserName + \"正在编辑文档\");\n                this.webOfficeObj.EditType = this.isRevision === \"1\" ? \"2\" : \"1\";\n                this.webOfficeObj.ShowToolBar = true;\n\n                if (!this.webOfficeObj.WebSetSkin(0xdbdbdb, 0xeaeaea, 0xeaeaea, 0xdbdbdb, 0xdbdbdb, 0xdbdbdb, 0x000000)) {\n                  this.webOfficeObj.Alert(this.webOfficeObj.Status);\n                }\n\n                if (this.webOfficeObj.WebOpen3(url)) {\n                  if (this.isRevision === \"1\") {\n                    this.webOfficeObj.WebShow(true);\n                    this.webOfficeObj.VBASetUserName(this.getCurrentUsername());\n                  } else {\n                    this.webOfficeObj.WebShow(false);\n                  }\n                } else {\n                  this.webOfficeObj.Alert(this.webOfficeObj.Status);\n                }\n\n                _context.next = 23;\n                break;\n\n              case 20:\n                _context.prev = 20;\n                _context.t0 = _context[\"catch\"](2);\n                this.webOfficeObj.Alert(this.webOfficeObj.Status);\n\n              case 23:\n              case \"end\":\n                return _context.stop();\n            }\n          }\n        }, _callee, this, [[2, 20]]);\n      }));\n\n      function initWebOfficeObject() {\n        return _initWebOfficeObject.apply(this, arguments);\n      }\n\n      return initWebOfficeObject;\n    }(),\n    save: function save() {\n      var _this2 = this;\n\n      this.loading = true;\n      var fileData = this.webOfficeObj.GetCurrentFile();\n      var formData = new FormData();\n      formData.append(\"file\", fileData);\n      portal.fileUpload(formData, this.fileId).then(function (resp) {\n        if (resp.status === 200) {// this.$message.success(\"保存成功\");\n        }\n      }).finally(function () {\n        _this2.loading = false;\n      });\n    },\n    getCurrentUsername: function getCurrentUsername() {\n      var currentUser = JSON.parse(window.sessionStorage.getItem(\"currentUser\"));\n      return currentUser.username;\n    }\n  }\n};",null]}