| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["Instructor"],{"1f27":function(e,t,a){"use strict";a.r(t);a("ac1f"),a("841c"),a("498a");var r=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.pictLoading,expression:"pictLoading"}],staticClass:"view",attrs:{id:"web_live","element-loading-background":"rgba(43, 48, 67, 0.65)","element-loading-spinner":"el-icon-loading"}},[t("div",{staticClass:"crm_search"},[t("el-form",{ref:"form",attrs:{"label-position":"",model:e.search,"label-width":""}},[t("el-row",[t("el-col",{attrs:{span:24,md:24,lg:24}},[t("el-form-item",[t("el-input",{staticClass:"crm-border-radius-no",attrs:{size:"small",clearable:"",placeholder:e.$t("Placeholder.Input")+e.$t("Placeholder.FirstName")},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.toSearch.apply(null,arguments)}},model:{value:e.search.instructorName,callback:function(t){e.$set(e.search,"instructorName","string"===typeof t?t.trim():t)},expression:"search.instructorName"}})],1),t("el-form-item",[t("el-button",{staticClass:"crm-border-radius-no crm-border-left-no",attrs:{size:"small",icon:"el-icon-search"},on:{click:e.toSearch}})],1)],1)],1),t("el-form-item",[t("div",{staticClass:"search_action_btn"},[t("span",{staticClass:"crm-cursor",on:{click:function(t){return e.toNew(1)}}},[t("i",{staticClass:"el-icon-plus"}),e.display["R-Instructor-Add"].show?t("span",{directives:[{name:"t",rawName:"v-t",value:"Btn.Add",expression:"'Btn.Add'"}]}):e._e()]),e.display["R-Instructor-Delete"].show?t("span",{staticClass:"crm-cursor delete",class:{active:this.multipleSelection.length},on:{click:e.toDeleteBatch}},[t("i",{staticClass:"el-icon-minus"}),t("span",{directives:[{name:"t",rawName:"v-t",value:"Btn.Delete",expression:"'Btn.Delete'"}]})]):e._e()])])],1)],1),t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.mock_tableData,stripe:""},on:{"selection-change":e.handleSelectionChange}},[t("el-table-column",{attrs:{align:"left",type:"selection",width:"55"}}),t("el-table-column",{attrs:{prop:"",label:e.$t("Placeholder.FirstName")},scopedSlots:e._u([{key:"default",fn:function(a){return[a.row.instructorName?t("span",[e._v(e._s(a.row.instructorName||"--"))]):t("span",[e._v(e._s("--"))])]}}])}),t("el-table-column",{attrs:{prop:"",label:e.$t("card.Form.f8")},scopedSlots:e._u([{key:"default",fn:function(a){return[t("span",[e._v(e._s(1==a.row.gender?e.$t("card.Form.v1"):e.$t("card.Form.v2")))])]}}])}),t("el-table-column",{attrs:{prop:"",label:e.$t("card.Form.f12")},scopedSlots:e._u([{key:"default",fn:function(a){return[a.row.occupation?t("span",[e._v(e._s(a.row.occupation||"--"))]):t("span",[e._v(e._s("--"))])]}}])}),t("el-table-column",{attrs:{prop:"addTime",align:"left",label:e.$i18n.t("Label.Date")}}),t("el-table-column",{attrs:{prop:"",align:"center",label:e.$i18n.t("Label.Action")},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-dropdown",{attrs:{trigger:"click"},on:{command:e.handleCommand}},[t("span",{staticClass:"el-dropdown-link crm-cursor"},[t("i",{staticClass:"iconfont iconcaidan",staticStyle:{"font-weight":"bold","font-size":"20px"}})]),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e.display["R-Instructor-Update"].show?t("el-dropdown-item",{attrs:{command:{type:"editor",row:a.row}}},[t("i",{staticClass:"iconfont iconbianji3"}),t("span",{directives:[{name:"t",rawName:"v-t",value:"Btn.Editor",expression:"'Btn.Editor'"}]})]):e._e(),e.display["R-Instructor-Delete"].show?t("el-dropdown-item",{attrs:{command:{type:"delete",id:a.row.id}}},[t("i",{staticClass:"iconfont iconshanchu"}),t("span",{directives:[{name:"t",rawName:"v-t",value:"Btn.Delete",expression:"'Btn.Delete'"}]})]):e._e()],1)],1)]}}])})],1),e.pagerInfo.rowTotal?t("div",{staticClass:"crm_pagination"},[t("div",{staticClass:"crm_page_total"},[t("span",{directives:[{name:"t",rawName:"v-t",value:"Page.total.item1",expression:"'Page.total.item1'"}]}),t("span",[e._v(e._s(e.pagerInfo.rowTotal))]),t("span",{directives:[{name:"t",rawName:"v-t",value:"Page.total.item2",expression:"'Page.total.item2'"}]})]),t("el-pagination",{staticClass:"page",attrs:{background:"",layout:"sizes, prev, pager, next","page-sizes":[10,20,50,100],"page-size":e.pagerInfo.row,total:e.pagerInfo.rowTotal},on:{"current-change":e.handleCurrentChange,"size-change":e.handleSizeChange}})],1):e._e(),e.dialogVisible?t("el-dialog",{attrs:{title:e.isAdd?"新增":"编辑",visible:e.dialogVisible,rules:e.rules,width:"700px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("el-form",{ref:"form",staticClass:"business-edit-form",attrs:{rules:e.rules,model:e.form,"label-width":"130px","label-position":"right"}},[t("el-form-item",{attrs:{prop:"instructorName",label:e.$t("Placeholder.FirstName")}},[t("el-input",{attrs:{placeholder:e.$t("Placeholder.Input")+e.$t("Placeholder.FirstName")},model:{value:e.form.instructorName,callback:function(t){e.$set(e.form,"instructorName",t)},expression:"form.instructorName"}})],1),t("el-form-item",{attrs:{prop:"occupation",label:e.$t("card.Form.f12")}},[t("el-input",{attrs:{placeholder:e.$t("Ucard.PaymentTransfer.ms27")},model:{value:e.form.occupation,callback:function(t){e.$set(e.form,"occupation",t)},expression:"form.occupation"}})],1),t("el-form-item",{attrs:{prop:"gender",label:e.$t("card.Form.f8")}},[t("el-select",{attrs:{placeholder:e.$t("card.vaildate.v9")},model:{value:e.form.gender,callback:function(t){e.$set(e.form,"gender",t)},expression:"form.gender"}},[t("el-option",{attrs:{label:e.$t("card.Form.v1"),value:1}}),t("el-option",{attrs:{label:e.$t("card.Form.v2"),value:2}})],1)],1),t("el-form-item",{attrs:{label:e.$t("Label.Cover"),prop:"instructorImage"}},[t("el-upload",{staticClass:"id-uploader",attrs:{action:e.imgUrl+"/web/live/instructor/upload",headers:e.AccessToken,"show-file-list":!1,"on-success":e.handleAvatarSuccessBankEn2,"before-upload":e.beforeAvatarUpload,accept:"image/*"}},[e.form.instructorImage?t("img",{staticClass:"avatar",attrs:{src:e.imgUrl+e.form.instructorImage}}):t("i",{staticClass:"el-icon-upload"},[t("span",{directives:[{name:"t",rawName:"v-t",value:"vaildate.img.empty",expression:"'vaildate.img.empty'"}]})])])],1)],1),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[t("span",{directives:[{name:"t",rawName:"v-t",value:"Ucard.Business.p32",expression:"'Ucard.Business.p32'"}]})]),t("el-button",{attrs:{type:"primary",loading:e.isOk},on:{click:e.save}},[e._v("提交")])],1)],1):e._e()],1)},n=[],s=a("c7eb"),i=a("5530"),o=a("1da1"),c=(a("14d9"),a("b0c0"),a("e9f5"),a("7d54"),a("b64b"),a("d3b7"),a("159b"),a("c554")),l=a("f121"),u=a.n(l),p=u.a.Code,d={name:"Info",data:function(){return{pictLoading:!1,dialogVisible:!1,mock_tableData:[],imgUrl:u.a.Host85,options:[],isOk:!1,action:"",search:{occupation:"",instructorName:""},multipleSelection:[],form:{instructorName:"",occupation:"",gender:"",instructorImage:""},rules:{instructorName:[{required:!0,message:this.$i18n.t("vaildate.input.empty"),trigger:"blur"}],occupation:[{required:!0,message:this.$i18n.t("vaildate.input.empty"),trigger:"blur"}],gender:[{required:!0,message:this.$i18n.t("vaildate.select.empty"),trigger:"blur"}],instructorImage:[{required:!0,message:this.$i18n.t("vaildate.img.empty"),trigger:"change"}]},pagerInfo:{row:10,current:1,pageTotal:0,rowTotal:0}}},computed:{display:function(){return JSON.parse(this.Session.Get("display",!0))},AccessToken:function(){var e=this.Session.Get("access_token");return e?{"Access-Token":e}:{}}},methods:{handleCommand:function(e){"delete"==e.type?this.toDelete(e.id):"editor"==e.type&&this.toNew(2,e.row)},accountOpen:function(e){this.$router.push({path:"/web/info/single",query:{id:e.id,type:"info"}})},searchFunc:function(){var e=this;return Object(o["a"])(Object(s["a"])().mark((function t(){var a;return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.pictLoading=!0,e.display["R-Instructor-Search"].show){t.next=5;break}return e.$pigeon.MessageWarning(e.$i18n.t("Msg.NotDisplay")),e.pictLoading=!1,t.abrupt("return");case 5:return t.next=7,c["a"].getInstructorList(Object(i["a"])(Object(i["a"])({},e.search),{},{page:{current:e.pagerInfo.current,row:e.pagerInfo.row}}));case 7:a=t.sent,a.code==p.StatusOK?(e.mock_tableData=a.data,null!=a.page?(e.pagerInfo.rowTotal=a.page.rowTotal,e.pagerInfo.pageTotal=a.page.pageTotal):e.pagerInfo.rowTotal=0,e.$pigeon.MessageOK(e.$i18n.t("Msg.SearchSuccess")),e.pictLoading=!1):(e.$pigeon.MessageError(a.msg),e.pictLoading=!1);case 9:case"end":return t.stop()}}),t)})))()},save:function(){var e=this;return Object(o["a"])(Object(s["a"])().mark((function t(){var a,r;return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.isOk){t.next=2;break}return t.abrupt("return");case 2:return e.isOk=!0,t.prev=3,t.next=6,e.$refs.form.validate();case 6:if(a=t.sent,a){t.next=10;break}return e.isOk=!1,t.abrupt("return");case 10:if(e.isAdd){t.next=16;break}return t.next=13,c["a"].webInstructorUpdate(e.form);case 13:r=t.sent,t.next=19;break;case 16:return t.next=18,c["a"].webInstructorAdd(e.form);case 18:r=t.sent;case 19:r.code==p.StatusOK?(e.$pigeon.MessageOK(e.$i18n.t("Msg.Success")),e.toSearch(),e.isOk=!1,e.dialogVisible=!1):(e.isOk=!1,e.$pigeon.MessageError(r.msg)),t.next=26;break;case 22:t.prev=22,t.t0=t["catch"](3),console.log(t.t0),e.isOk=!1;case 26:case"end":return t.stop()}}),t,null,[[3,22]])})))()},handleAvatarSuccessBankEn2:function(e){200==e.code?(this.$pigeon.MessageOK(this.$i18n.t("Msg.Success")),this.form.instructorImage=e.data):this.$pigeon.MessageError(e.code)},beforeAvatarUpload:function(e){var t=-1!=["jpeg","JPEG","png","PNG","jpg","JPG"].indexOf(e.name.split(".")[1]),a=e.size/1024/1024<2;return t||this.$pigeon.MessageError("Msg.JPG1"),a||this.$pigeon.MessageError("上传头像图片大小不能超过 2MB!"),t&&a},getSearchDate:function(e){this.search.date=e},toSearch:function(){this.pagerInfo.current=1,this.searchFunc()},getDate:function(){var e,t,a=2,r=(new Date).getTimezoneOffset(),n=(new Date).getTime(),s=new Date(n+60*r*1e3+60*a*60*1e3),i=s.getFullYear(),o=s.getMonth()+1,c=s.getDate();o<10&&(o="0"+o),c<10&&(c="0"+c),e=i+"-"+o+"-01";var l=s.getMonth(),u=++l,p=new Date(s.getFullYear(),u,1),d=864e5,m=new Date(p-d),g=m.getDate();g<10&&(g="0"+g),t=i+"-"+o+"-"+g,this.search.date=[e,t]},toNew:function(e,t){this.dialogVisible=!0,2==e?(this.isAdd=!1,this.form=t):(this.isAdd=!0,this.form={instructorName:"",instructorNameEn:"",instructorImage:"",occupation:"",gender:""})},toCheck:function(e){this.$router.push({path:"/web/live/add",query:{id:e,type:"check"}}).catch((function(e){return e}))},toUpdate:function(e){this.$router.push({path:"/web/live/add",query:{id:e,type:"update"}}).catch((function(e){return e}))},toDelete:function(){var e=Object(o["a"])(Object(s["a"])().mark((function e(t){var a;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:a=this,this.$pigeon.MessageConfirm(this.$i18n.t("Msg.Delete"),this.$i18n.t("Msg.SystemPrompt"),this.$i18n.t("Btn.Confirm"),this.$i18n.t("Btn.Cancel"),Object(o["a"])(Object(s["a"])().mark((function e(){var r,n;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=[],r.push(t),e.next=4,c["a"].webInstructorDelete({ids:r});case 4:n=e.sent,n.code==p.StatusOK?(a.$pigeon.MessageOK(a.$i18n.t("Msg.DeleteSuccess")),a.searchFunc()):a.$pigeon.MessageError(n.msg);case 6:case"end":return e.stop()}}),e)}))),(function(){}));case 2:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),toDeleteBatch:function(){var e=Object(o["a"])(Object(s["a"])().mark((function e(){var t;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.multipleSelection.length){e.next=2;break}return e.abrupt("return");case 2:t=this,this.$pigeon.MessageConfirm(this.$i18n.t("Msg.Delete"),this.$i18n.t("Msg.SystemPrompt"),this.$i18n.t("Btn.Confirm"),this.$i18n.t("Btn.Cancel"),Object(o["a"])(Object(s["a"])().mark((function e(){var a;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,c["a"].webInstructorDelete({ids:t.multipleSelection});case 2:a=e.sent,a.code==p.StatusOK?(t.$pigeon.MessageOK(t.$i18n.t("Msg.DeleteSuccess")),t.searchFunc()):t.$pigeon.MessageError(a.msg);case 4:case"end":return e.stop()}}),e)}))),(function(){}));case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),handleSelectionChange:function(e){var t=this;this.multipleSelection=[],e.forEach((function(e){t.multipleSelection.push(e.id)}))},handleSizeChange:function(e){this.pagerInfo.row=e,this.searchFunc()},handleCurrentChange:function(e){this.pagerInfo.current=e,this.searchFunc()}},mounted:function(){this.searchFunc()}},m=d,g=(a("898a"),a("2877")),h=Object(g["a"])(m,r,n,!1,null,"fe5c83dc",null);t["default"]=h.exports},"898a":function(e,t,a){"use strict";a("aa69")},aa69:function(e,t,a){}}]);
|