webpackJsonp([24],{439:function(t,s,o){function e(t){o(646)}var a=o(1)(o(532),o(703),e,"data-v-f259c4f6",null);t.exports=a.exports},532:function(t,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default={data:function(){return{soft:{},download:!1,downProgress:0,downSpeed:0,downSpeedTip:"下载进度",unzip:!1,unzipProgress:0,unzipTip:"升级进度",showReloadTip:!1,fs:_require("fs")}},watch:{downProgress:function(t){this.downSpeedTip=100===t?"下载完成":"正在下载（ "+this.downSpeed+" KB/s）"}},created:function(){var t=this;this.$http.get(this.$appConfig.update+"version.json?rand="+(new Date).getTime()).then(function(s){if(200!==s.status)throw new Error(s.data.message);t.soft=s.data}).catch(function(){t.$toast({type:"danger",content:"软件版本信息读取有误，请检查您的网络连接后再次重试！"})})},methods:{submit:function(){var t=this,s=this.$appConfig.update+this.soft.version+"/update.zip",o=nw.App.dataPath+"/update-temp/update.zip";this.download=!0,this.unzip=!1,this.$api.update.download(s,o,function(s){t.downProgress=s.progress,t.downSpeed=s.speed},function(){t.downProgress=100,t.unzip=!0,t.unzipTip="软件升级中...",t.$api.update.unzip(o,function(s){t.unzipTip="升级成功...",t.unzipProgress=100,setTimeout(function(){t.showReloadTip=!0},1e3)},function(t){console.log("解压缩失败",t)})},function(t){console.error(t)})},reloadApp:function(){this.$appFrame.exit()}}}},590:function(t,s,o){s=t.exports=o(378)(!1),s.push([t.i,".page-update .card-block[data-v-f259c4f6]{padding:1rem;height:35vh;overflow:scroll}.page-update>.container[data-v-f259c4f6]{margin-top:2rem}.page-update .progress-bar[data-v-f259c4f6]{text-indent:1rem;text-shadow:0 1px #000,1px 0 #000,-1px 0 #000,0 -1px #000;text-align:left}.page-update .page-foot[data-v-f259c4f6]{position:fixed;left:0;bottom:5vh;right:0}",""])},646:function(t,s,o){var e=o(590);"string"==typeof e&&(e=[[t.i,e,""]]),e.locals&&(t.exports=e.locals);o(379)("1c635f20",e,!0)},703:function(t,s){t.exports={render:function(){var t=this,s=t.$createElement,o=t._self._c||s;return o("div",{staticClass:"page-update"},[o("div",{staticClass:"g-hd"}),t._v(" "),o("div",{staticClass:"container"},[o("div",{staticClass:"card"},[o("div",{staticClass:"card-header"},[o("h4",{staticClass:"card-title",domProps:{textContent:t._s(t.soft.version)}})]),t._v(" "),o("div",{staticClass:"card-block"},[o("h4",{staticClass:"mb-2 text-muted"},[t._v("更新说明")]),t._v(" "),o("div",{staticClass:"card-text",domProps:{innerHTML:t._s(t.soft.description)}})]),t._v(" "),o("div",{staticClass:"card-footer"},[o("h5",{staticClass:"download-tip",domProps:{textContent:t._s(t.downSpeedTip)}}),t._v(" "),o("div",{staticClass:"progress progress-download"},[o("div",{staticClass:"progress-bar progress-bar-success progress-bar-striped",style:"width:"+t.downProgress+"%",domProps:{textContent:t._s(t.downProgress+"%")}})])]),t._v(" "),o("div",{staticClass:"card-footer"},[o("h5",{staticClass:"unzip-tip",domProps:{textContent:t._s(t.unzipTip)}}),t._v(" "),o("div",{staticClass:"progress progress-unzip"},[o("div",{staticClass:"progress-bar progress-bar-success progress-bar-striped",style:"width:"+t.unzipProgress+"%",domProps:{textContent:t._s(t.unzipProgress+"%")}})])])]),t._v(" "),o("div",{staticClass:"page-foot text-center"},[t.showReloadTip?t._e():o("button",{staticClass:"btn btn-danger btn-lg",attrs:{disabled:t.download},domProps:{textContent:t._s(t.download?"升级中...":"开始升级")},on:{click:function(s){s.stopPropagation(),t.submit(s)}}})]),t._v(" "),o("v-modal",{staticClass:"add-supplier-model",on:{ok:t.reloadApp,esc:!1},model:{value:t.showReloadTip,callback:function(s){t.showReloadTip=s},expression:"showReloadTip"}},[o("template",{attrs:{slot:"modal-header"},slot:"modal-header"},[o("h5",{staticClass:"modal-title"},[t._v("提示")])]),t._v(" "),o("template",{attrs:{slot:"modal-body"},slot:"modal-body"},[t._v('\n        程序升级成功，请重新运行"灵兽"\n      ')]),t._v(" "),o("template",{attrs:{slot:"modal-footer"},slot:"modal-footer"},[o("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:function(s){s.preventDefault(),s.stopPropagation(),t.reloadApp(s)}}},[t._v("确定")])])],2)],1)])},staticRenderFns:[]}}});