| 1 |
- (self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[26],{26:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return u}});var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{padding:"16px"}},[a("el-button",{staticStyle:{"margin-bottom":"16px"},attrs:{type:"primary",size:"small",icon:"el-icon-upload"},on:{click:function(t){e.dialogUploadVisible=!0}}},[e._v("上传web端代码 ")]),a("el-dialog",{attrs:{title:"文件上传",visible:e.dialogUploadVisible,width:"500px","append-to-body":"","close-on-click-modal":!1,"before-close":e.clearFiles},on:{"update:visible":function(t){e.dialogUploadVisible=t}}},[a("p",{staticStyle:{"margin-bottom":"10px"}},[e._v("更新信息:")]),a("el-input",{staticStyle:{"margin-bottom":"16px"},attrs:{size:"small",type:"textarea",placeholder:"输入更新信息",rows:10},model:{value:e.fnotes,callback:function(t){e.fnotes=t},expression:"fnotes"}}),a("el-upload",{ref:"my-upload",staticClass:"upload-demo",staticStyle:{width:"100%"},attrs:{action:"#",accept:".zip","auto-upload":!1,"show-file-list":!1,"on-change":e.handleChange,drag:"",multiple:""}},[a("i",{staticClass:"el-icon-upload"}),a("div",{staticClass:"el-upload__text"},[e._v("将文件拖到此处,或"),a("em",[e._v("点击上传")])])]),a("p",{staticClass:"tips",staticStyle:{padding:"16px 0",color:"red"}},[e._v("压缩包结构必须是在构建后的文件目录下打包")]),e._l(e.filelist,(function(t){return a("div",{key:t.uid,staticClass:"progress_panel"},[a("div",[100===t.progress?a("p",{staticStyle:{float:"right"}},[a("span",{staticStyle:{color:"#67C23A"}},[e._v("●")]),e._v("上传成功")]):e._e(),a("p",[e._v(e._s(t.raw?t.raw.name:"暂无上传文件"))]),a("el-progress",{attrs:{percentage:t.progress,"show-text":!1}})],1)])})),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.dialogUploadVisible=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.webUpdate(e.attachmentids)}}},[e._v("确 定")])],1)],2),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.loglist,stripe:""}},[a("el-table-column",{attrs:{prop:"rowindex",label:"行",width:"50",align:"center"}}),a("el-table-column",{attrs:{prop:"fnotes",label:"更新内容"}}),a("el-table-column",{attrs:{prop:"createdate",label:"更新时间",width:"180"}}),a("el-table-column",{attrs:{prop:"createby",label:"创建人",width:"90"}}),a("el-table-column",{attrs:{label:"操作",width:"150"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.returnToVersion(t.row)}}},[e._v("回滚至此版本")])]}}])})],1)],1)},r=[],s=a(6198),o=(a(5666),a(8309),a(1539),a(4747),{components:{},data:function(){return{dialogUploadVisible:!1,params:{classname:"system.attachment.huawei.OBS",method:"getFileName",content:{filename:"",filetype:"",parentid:0}},file:{},filelist:[],loglist:[],fnotes:"",attachmentids:null}},mounted:function(){this.queryUpdateLog()},methods:{handleChange:function(e,t){this.filelist=t;var a=e.raw.name.lastIndexOf("."),n=e.name.substr(a+1);this.params.content.filename=e.raw.name,this.params.content.filetype=n,this.getUploadUrl(e,n)},getUploadUrl:function(e,t){var a=this;return(0,s.Z)(regeneratorRuntime.mark((function n(){var r,s,o;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,a.$api.requested(a.params);case 2:r=n.sent,s=r.data.uploadurl,o=r.data.serialfilename,a.upoladFileToServer(s,e,t,o);case 6:case"end":return n.stop()}}),n)})))()},upoladFileToServer:function(e,t,a,n){var r=this;return(0,s.Z)(regeneratorRuntime.mark((function s(){var o,i;return regeneratorRuntime.wrap((function(s){while(1)switch(s.prev=s.next){case 0:return o=r,i={headers:{"Content-Type":"application/octet-stream"},onUploadProgress:function(e){var n=e.loaded/e.total*100;o.filelist.forEach((function(e){e.uid===t.uid&&(o.$set(e,"type",a.toUpperCase()),o.$set(e,"progress",n))}))}},s.next=4,r.$upload.hw_upload(e,t.raw,i);case 4:s.sent,r.createFileRecord(n);case 6:case"end":return s.stop()}}),s)})))()},createFileRecord:function(e){var t=this;return(0,s.Z)(regeneratorRuntime.mark((function a(){var n,r,s;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n={serialfilename:e},r={classname:"system.attachment.huawei.OBS",method:"uploadSuccess",content:n},a.next=4,t.$api.requested(r);case 4:s=a.sent,1===s.code&&(t.attachmentids=s.data.attachmentids[0]);case 6:case"end":return a.stop()}}),a)})))()},webUpdate:function(e){var t=this;return(0,s.Z)(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(!(t.fnotes.length<20)){a.next=4;break}t.$message({message:"请输入不少于20个字的更新信息!"}),a.next=13;break;case 4:if(0!==t.filelist.length){a.next=8;break}t.$message({message:"请上传web更新包!"}),a.next=13;break;case 8:return a.next=10,t.$api.requested({classname:"sysmanage.develop.hotupdate.webupdate",method:"webUpdate",content:{attachmentid:e,fnotes:t.fnotes}});case 10:n=a.sent,1!==n.code?t.$message({message:n.msg+n.data}):t.queryUpdateLog(),t.dialogUploadVisible=!1;case 13:case"end":return a.stop()}}),a)})))()},queryUpdateLog:function(){var e=this;return(0,s.Z)(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$api.requested({classname:"sysmanage.develop.hotupdate.webupdate",method:"queryUpdateLog",content:{}});case 2:a=t.sent,e.loglist=a.data;case 4:case"end":return t.stop()}}),t)})))()},clearFiles:function(){this.$refs["my-upload"].clearFiles(),this.filelist=[],this.dialogUploadVisible=!1},returnToVersion:function(e){var t=this;return(0,s.Z)(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,t.$api.requested({classname:"sysmanage.develop.hotupdate.webupdate",method:"webUpdate",content:{attachmentid:e.attinfos[0].attachmentid,fnotes:"版本回退至"+e.createdate}});case 2:n=a.sent,1!==n.code?t.$message({message:n.msg+n.data}):t.queryUpdateLog();case 4:case"end":return a.stop()}}),a)})))()}}}),i=o,l=a(1001),c=(0,l.Z)(i,n,r,!1,null,"3fde7b02",null),u=c.exports},8533:function(e,t,a){"use strict";var n=a(2092).forEach,r=a(9341),s=r("forEach");e.exports=s?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},2092:function(e,t,a){var n=a(9974),r=a(1702),s=a(8361),o=a(7908),i=a(6244),l=a(5417),c=r([].push),u=function(e){var t=1==e,a=2==e,r=3==e,u=4==e,p=6==e,d=7==e,f=5==e||p;return function(m,h,g,v){for(var w,b,y=o(m),x=s(y),_=n(h,g),k=i(x),U=0,S=v||l,R=t?S(m,k):a||d?S(m,0):void 0;k>U;U++)if((f||U in x)&&(w=x[U],b=_(w,U,y),e))if(t)R[U]=b;else if(b)switch(e){case 3:return!0;case 5:return w;case 6:return U;case 2:c(R,w)}else switch(e){case 4:return!1;case 7:c(R,w)}return p?-1:r||u?u:R}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},9341:function(e,t,a){"use strict";var n=a(7293);e.exports=function(e,t){var a=[][e];return!!a&&n((function(){a.call(null,t||function(){return 1},1)}))}},7475:function(e,t,a){var n=a(7854),r=a(3157),s=a(4411),o=a(111),i=a(5112),l=i("species"),c=n.Array;e.exports=function(e){var t;return r(e)&&(t=e.constructor,s(t)&&(t===c||r(t.prototype))?t=void 0:o(t)&&(t=t[l],null===t&&(t=void 0))),void 0===t?c:t}},5417:function(e,t,a){var n=a(7475);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},8309:function(e,t,a){var n=a(9781),r=a(6530).EXISTS,s=a(1702),o=a(3070).f,i=Function.prototype,l=s(i.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,u=s(c.exec),p="name";n&&!r&&o(i,p,{configurable:!0,get:function(){try{return u(c,l(this))[1]}catch(e){return""}}})},4747:function(e,t,a){var n=a(7854),r=a(8324),s=a(8509),o=a(8533),i=a(8880),l=function(e){if(e&&e.forEach!==o)try{i(e,"forEach",o)}catch(t){e.forEach=o}};for(var c in r)r[c]&&l(n[c]&&n[c].prototype);l(s)}}]);
|