You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
80 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-829dafb8"],{"0ccb":function(e,t,i){var a=i("50c4"),s=i("1148"),n=i("1d80"),o=Math.ceil,l=function(e){return function(t,i,l){var r,c,u=String(n(t)),d=u.length,p=void 0===l?" ":String(l),f=a(i);return f<=d||""==p?u:(r=f-d,c=s.call(p,o(r/p.length)),c.length>r&&(c=c.slice(0,r)),e?u+c:c+u)}};e.exports={start:l(!1),end:l(!0)}},"16cd":function(e,t,i){"use strict";i("20e4")},"19cc":function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("xy-dialog",{ref:"dialog",attrs:{width:50,"is-show":e.isShow,type:"form",title:"二维码",form:e.form,rules:e.rules},on:{"update:isShow":function(t){e.isShow=t},"update:is-show":function(t){e.isShow=t}},scopedSlots:e._u([{key:"settings",fn:function(){return[i("div",{staticClass:"xy-table-item"},[i("div",{staticClass:"xy-table-item-label",staticStyle:{"font-weight":"bold",width:"0"}},[i("span",{staticStyle:{color:"red","font-weight":"bold","padding-right":"4px"}})]),i("div",{staticClass:"xy-table-item-content",staticStyle:{"flex-grow":"1"}},[i("div",{staticClass:"txl"},[i("div",[i("div",[e._v("课程名称:"+e._s(e.row.name))]),i("div",[e._v("开课日期:"+e._s(e.row.start_date?e.row.start_date+"至"+e.row.end_date:""))]),i("div",[e._v("课程体系:"+e._s(e.row.type_value))])])]),i("div",{staticClass:"code"},[e.imgSrc?i("div",[i("img",{attrs:{src:e.imgSrc}})]):i("div",{staticClass:"empty-code"},[i("p",[e._v(e._s(e.loading?"加载中...":"暂无二维码"))]),e.loading?e._e():i("el-button",{attrs:{type:"primary",loading:e.generating},on:{click:e.generateCode}},[e._v("生成二维码")])],1)])])])]},proxy:!0},{key:"footerContent",fn:function(){return[i("el-button",{staticStyle:{"margin-left":"5px","margin-bottom":"5px"},attrs:{type:"primary",plain:""},on:{click:function(t){e.isShow=!1}}},[e._v("关闭")])]},proxy:!0}])})],1)},s=[],n=i("c14f"),o=i("1da1"),l=(i("99af"),i("d3b7"),i("bc08")),r={components:{},data:function(){return{isShow:!1,form:{settings:""},row:{},rules:{},imgSrc:"",loading:!1,generating:!1}},created:function(){},methods:{fallbackQrUrl:function(){return"/storage/course_qrcode/".concat(this.row.id,".png?t=").concat(Date.now())},checkImage:function(e){return new Promise((function(t){var i=new Image;i.onload=function(){return t(!0)},i.onerror=function(){return t(!1)},i.src=e}))},getCode:function(){var e=this;return Object(o["a"])(Object(n["a"])().m((function t(){var i,a;return Object(n["a"])().w((function(t){while(1)switch(t.p=t.n){case 0:if(e.row.id){t.n=1;break}return e.imgSrc="",t.a(2);case 1:return e.loading=!0,e.imgSrc="",t.p=2,t.n=3,Object(l["getQrCode"])({id:e.row.id,generate:0},!1);case 3:i=t.v,e.imgSrc=i.msg||"",t.n=5;break;case 4:t.p=4,t.v,e.imgSrc="";case 5:if(e.imgSrc){t.n=7;break}return a=e.fallbackQrUrl(),t.n=6,e.checkImage(a);case 6:if(!t.v){t.n=7;break}e.imgSrc=a;case 7:e.loading=!1;case 8:return t.a(2)}}),t,null,[[2,4]])})))()},generateCode:function(){var e=this;return Object(o["a"])(Object(n["a"])().m((function t(){var i,a;return Object(n["a"])().w((function(t){while(1)switch(t.p=t.n){case 0:if(e.row.id&&!e.generating){t.n=1;break}return t.a(2);case 1:return e.generating=!0,t.p=2,t.n=3,Object(l["getQrCode"])({id:e.row.id,generate:1});case 3:i=t.v,e.imgSrc=i.msg||"",e.imgSrc&&e.$message.success("二维码生成成功"),t.n=6;break;case 4:return t.p=4,t.v,a=e.fallbackQrUrl(),t.n=5,e.checkImage(a);case 5:if(!t.v){t.n=6;break}e.imgSrc=a,e.$message.success("二维码已生成");case 6:return t.p=6,e.generating=!1,t.f(6);case 7:return t.a(2)}}),t,null,[[2,4,6,7]])})))()}},watch:{isShow:function(e){e?this.getCode():(this.row={},this.imgSrc="",this.loading=!1,this.generating=!1)}}},c=r,u=(i("df47"),i("2877")),d=Object(u["a"])(c,a,s,!1,null,"57e49803",null);t["default"]=d.exports},"1fcf":function(e,t,i){},"20e4":function(e,t,i){},"21b3":function(e,t,i){"use strict";i("804a")},3112:function(e,t,i){"use strict";i.d(t,"e",(function(){return n})),i.d(t,"f",(function(){return o})),i.d(t,"c",(function(){return l})),i.d(t,"d",(function(){return r})),i