chunk-258158d6.bc0ab7c0.js 15 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-258158d6"],{"09f4":function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),Math.easeInOutQuad=function(e,t,r,a){return e/=a/2,e<1?r/2*e*e+t:(e--,-r/2*(e*(e-2)-1)+t)};var a=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function n(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function o(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function s(e,t,r){var s=o(),c=e-s,i=20,l=0;t="undefined"===typeof t?500:t;var u=function e(){l+=i;var o=Math.easeInOutQuad(l,s,c,t);n(o),l<t?a(e):r&&"function"===typeof r&&r()};u()}},"0a47":function(e,t,r){"use strict";var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("el-alert",{staticClass:"alert",attrs:{title:"教材信息",closable:!1,type:"info"}}),e._v(" "),r("el-form",{ref:"form",staticClass:"form",attrs:{model:e.form,"label-width":"120px"}},[r("el-form-item",{attrs:{label:"教材名称",prop:"name",rules:[{required:!0,message:"请输入教材名称",trigger:"blur"}]}},[r("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入教材名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),e._v(" "),e.level<=1&&1==e.level&&"create"!=e.type?r("el-form-item",{attrs:{label:"音源设置",prop:"soundResource",rules:[{required:!0,message:"请选择音源设置",trigger:"change"}]}},[r("el-select",{staticStyle:{width:"100% !important"},attrs:{filterable:"",placeholder:"请选择音源设置",clearable:""},model:{value:e.form.soundResource,callback:function(t){e.$set(e.form,"soundResource",t)},expression:"form.soundResource"}},[r("el-option",{attrs:{label:"NotePerformer音源",value:"NOTEPERFORMER"}}),e._v(" "),r("el-option",{attrs:{label:"标准音源",value:"TANG"}}),e._v(" "),r("el-option",{attrs:{label:"官方音源",value:"OFFICIAL"}})],1)],1):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"教材封面图",prop:"coverImg",rules:[{required:!(e.level>1),message:"请上传教材封面图",trigger:"blur"}],"label-width":"120px"}},[r("image-cropper",{attrs:{options:e.cropperOptions,bucket_name:"cloud-coach",imgSize:2,imageUrl:e.form.coverImg,showSize:""},on:{"crop-upload-success":e.cropSuccess}}),e._v(" "),r("p",{staticStyle:{color:"red"}},[e._v("大小2M以内,格式为jpg、png、gif图片")])],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){return e.$listeners.close()}}},[e._v("取 消")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:e.addSubmit}},[e._v("确 定")])],1)],1)},n=[],o=r("db72"),s=r("a8db"),c=(r("6762"),r("2fdb"),r("75fc")),i=r("2d63"),l=r("c80c"),u=(r("7f7f"),r("c5f6"),r("28a5"),r("96cf"),r("3b8d")),p=r("c7f0"),d=r("896b"),f=r("ee26"),m=["organId"],b={props:["type","activeRow"],components:{Upload:p["a"],ImageCropper:d["a"]},data:function(){return{imageWidthM:350,imageHeightM:140,form:{organId:[],name:null,coverImg:"",soundResource:null,sysMusicScoreCategoriesList:[]},index:0,treeProps:{children:"sysMusicScoreCategoriesList",label:"name"},level:0,cropperOptions:{autoCrop:!0,autoCropWidth:350,autoCropHeight:140,fixedBox:!0,previewsCircle:!1,full:!0,enlarge:2,title:"教材封面图"}}},mounted:function(){var e=Object(u["a"])(Object(l["a"])().mark((function e(){var t,r,a,n;return Object(l["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.$store.dispatch("setBranchs");case 2:if(null===(t=this.activeRow)||void 0===t||!t.id){e.next=15;break}return 0==(null===(r=this.activeRow)||void 0===r?void 0:r.parentId)&&"create"!=this.type||(this.cropperOptions.autoCropWidth=210,this.cropperOptions.autoCropHeight=268),console.log(this.activeRow,"level"),this.level=(null===(a=this.activeRow)||void 0===a?void 0:a.level)||0,e.prev=6,e.next=9,Object(f["c"])({id:this.activeRow.id});case 9:n=e.sent,"create"==this.type?this.form.organId=n.data.organId.split(",").map((function(e){return Number(e)})):"update"==this.type&&(this.form.name=n.data.name,this.form.organId=n.data.organId.split(",").map((function(e){return Number(e)})),this.form.coverImg=n.data.coverImg,this.form.soundResource=n.data.soundResource),e.next=15;break;case 13:e.prev=13,e.t0=e["catch"](6);case 15:case"end":return e.stop()}}),e,this,[[6,13]])})));function t(){return e.apply(this,arguments)}return t}(),methods:{formatParentId:function(e,t){var r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=Object(i["a"])(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;if(o.sysMusicScoreCategoriesList){var s=this.formatParentId(e,o.sysMusicScoreCategoriesList,[].concat(Object(c["a"])(a),[o.id]));if(s.includes(e))return s}if(o.id===e)return[].concat(Object(c["a"])(a),[e])}}catch(l){n.e(l)}finally{n.f()}return a},addSubmit:function(){var e=this;this.$refs.form.validate(function(){var t=Object(u["a"])(Object(l["a"])().mark((function t(r){var a,n,c,i,u,p,d,b;return Object(l["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=25;break}if(a=e.form,n=a.organId,c=Object(s["a"])(a,m),i=0,"create"==e.type?i=(null===(u=e.activeRow)||void 0===u?void 0:u.id)||0:"update"==e.type&&(i=(null===(p=e.activeRow)||void 0===p?void 0:p.parentId)||0),d=Object(o["a"])(Object(o["a"])({},c),{},{parentId:i,organId:n.join(",")}),t.prev=5,"update"!=e.type){t.next=15;break}return d.id=null===(b=e.activeRow)||void 0===b?void 0:b.id,t.next=10,Object(f["f"])(d);case 10:e.$message.success("修改成功"),e.$emit("getList"),e.$emit("close"),t.next=20;break;case 15:return t.next=17,Object(f["a"])(d);case 17:e.$message.success("添加成功"),e.$emit("getList"),e.$emit("close");case 20:t.next=25;break;case 22:t.prev=22,t.t0=t["catch"](5),console.log(t.t0);case 25:case"end":return t.stop()}}),t,null,[[5,22]])})));return function(e){return t.apply(this,arguments)}}())},uploadImg:function(){this.$refs.uploadImg.$refs.upload.submit()},cropClose:function(){console.log("上传操作结束")},cropSuccess:function(e){this.form.coverImg=e.data.url,console.log(this.form.coverImg)}},computed:{}},h=b,v=(r("4491"),r("2877")),g=Object(v["a"])(h,a,n,!1,null,"56401610",null);t["a"]=g.exports},"3ea2":function(e,t,r){},4491:function(e,t,r){"use strict";r("6b14")},"6b14":function(e,t,r){},a062:function(e,t,r){"use strict";r("3ea2")},e012:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"m-container"},[e._m(0),e._v(" "),r("div",{staticClass:"m-core"},[r("save-form",{ref:"searchForm",attrs:{inline:!0,model:e.searchForm},on:{submit:e.search,reset:e.onReSet}},[r("el-form-item",{attrs:{prop:"search"}},[r("el-input",{attrs:{clearable:"",placeholder:"教材编号/名称"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:function(t){t.target.blur(),e.$refs.searchForm.save(),e.search()}(t)}},model:{value:e.searchForm.search,callback:function(t){e.$set(e.searchForm,"search","string"===typeof t?t.trim():t)},expression:"searchForm.search"}})],1),e._v(" "),r("el-form-item",{attrs:{prop:"enable"}},[r("el-select",{attrs:{placeholder:"教材状态",clearable:""},model:{value:e.searchForm.enable,callback:function(t){e.$set(e.searchForm,"enable","string"===typeof t?t.trim():t)},expression:"searchForm.enable"}},[r("el-option",{attrs:{label:"启用",value:"1"}}),e._v(" "),r("el-option",{attrs:{label:"停用",value:"0"}})],1)],1),e._v(" "),r("el-form-item",[r("el-button",{attrs:{"native-type":"submit",type:"primary"}},[e._v("搜索")]),e._v(" "),r("el-button",{attrs:{"native-type":"reset",type:"danger"}},[e._v("重置")])],1)],1),e._v(" "),r("div",{staticClass:"btnList"},[r("auth",{attrs:{auths:"sysMusicScoreCategories/save"}},[r("el-button",{attrs:{type:"primary"},on:{click:e.addRoot}},[e._v("新增教材")])],1)],1),e._v(" "),r("div",{staticClass:"tableWrap"},[r("el-table",{staticStyle:{width:"100%"},attrs:{"header-cell-style":{background:"#EDEEF0",color:"#444"},data:e.tableList}},[r("el-table-column",{attrs:{align:"center",prop:"id",label:"教材编号"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"name",label:"教材名称"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"organNames",label:"可见分部"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("div",[r("overflow-text",{attrs:{text:e.row.organNames}})],1)]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"musicScoreNum",label:"曲目数量"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"musicScoreNum",label:"使用音源"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(e._f("formatSoundReSource")(t.row.soundResource))+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"updateTime",label:"最后更新时间"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"studentId",label:"教材状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("div",[e._v("\n "+e._s(t.row.enable?"启用":"停用")+"\n ")])]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"studentId",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("div",[r("auth",{attrs:{auths:"/accompaniment"}},[r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.lookMusic(t.row)}}},[e._v("查看")])],1),e._v(" "),r("auth",{attrs:{auths:"sysMusicScoreCategories/update"}},[t.row.enable?e._e():r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.resetTeach(t.row)}}},[e._v("修改")])],1),e._v(" "),r("auth",{attrs:{auths:"sysMusicScoreCategories/enable"}},[t.row.enable?r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.stopTeach(t.row)}}},[e._v("停用")]):e._e(),e._v(" "),t.row.enable?e._e():r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.stopTeach(t.row)}}},[e._v("启用")])],1),e._v(" "),r("auth",{attrs:{auths:"sysMusicScoreCategories/delete"}},[t.row.enable?e._e():r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.removeTeach(t.row)}}},[e._v("删除")])],1)],1)]}}])})],1),e._v(" "),r("pagination",{attrs:{sync:"",total:e.rules.total,page:e.rules.page,limit:e.rules.limit,"page-sizes":e.rules.page_size},on:{"update:total":function(t){return e.$set(e.rules,"total",t)},"update:page":function(t){return e.$set(e.rules,"page",t)},"update:limit":function(t){return e.$set(e.rules,"limit",t)},pagination:e.getList}})],1)],1),e._v(" "),e.teachVisible?r("el-dialog",{attrs:{title:"新增教材",visible:e.teachVisible,width:"600px"},on:{"update:visible":function(t){e.teachVisible=t}}},[e.teachVisible?r("addRoot",{ref:"addRoot",attrs:{activeRow:e.activeRow},on:{close:function(t){e.teachVisible=!1},getList:e.getList}}):e._e(),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.teachVisible=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:e.submitAdd}},[e._v("确 定")])],1)],1):e._e()],1)},n=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("h2",[r("div",{staticClass:"squrt"}),e._v("\n 教材分类\n ")])}],o=(r("7f7f"),r("386d"),r("c80c")),s=r("db72"),c=r("a8db"),i=(r("96cf"),r("3b8d")),l=(r("bc3a"),r("5f87"),r("333d")),u=(r("3908"),r("0a47")),p=r("ee26"),d=["organId"],f={components:{pagination:l["a"],addRoot:u["a"]},data:function(){return{searchForm:{search:null,enable:null},tableList:[],organList:[],rules:{limit:10,page:1,total:0,page_size:[10,20,40,50]},teachVisible:!1,activeRow:null}},created:function(){},mounted:function(){this.$store.dispatch("setBranchs"),this.getList()},filters:{formatSoundReSource:function(e){var t={NOTEPERFORMER:"NotePerformer音源",TANG:"标准音源",OFFICIAL:"官方音源"};return t[e]}},methods:{getList:function(){var e=Object(i["a"])(Object(o["a"])().mark((function e(){var t,r,a;return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=this.searchForm,t.organId,r=Object(c["a"])(t,d),e.prev=1,e.next=4,Object(p["d"])(Object(s["a"])(Object(s["a"])({},r),{},{parentId:0,page:this.rules.page,rows:this.rules.limit}));case 4:a=e.sent,this.rules.total=a.data.total,this.tableList=a.data.rows,e.next=12;break;case 9:e.prev=9,e.t0=e["catch"](1),console.log(e.t0);case 12:case"end":return e.stop()}}),e,this,[[1,9]])})));function t(){return e.apply(this,arguments)}return t}(),search:function(){this.rules.page=1,this.getList()},onReSet:function(){this.$refs.searchForm.resetFields(),this.search()},addRoot:function(){this.activeRow=null,this.teachVisible=!0},submitAdd:function(){this.$refs.addRoot.addSubmit()},resetTeach:function(e){this.activeRow=e,this.teachVisible=!0},stopTeach:function(){var e=Object(i["a"])(Object(o["a"])().mark((function e(t){var r,a=this;return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:r="",r=t.enable?"是否停用".concat(t.name,"该教材"):"是否启用".concat(t.name,"该教材"),this.$confirm(r,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(i["a"])(Object(o["a"])().mark((function e(){return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(p["b"])({categoriesId:t.id});case 3:e.sent,t.enable?a.$message.success("停用成功"):a.$message.success("启用成功"),a.getList(),e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),console.log(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).catch((function(e){console.log(e)}));case 3:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),removeTeach:function(){var e=Object(i["a"])(Object(o["a"])().mark((function e(t){var r=this;return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.$confirm("是否删除".concat(t.name),"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(i["a"])(Object(o["a"])().mark((function e(){return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(p["e"])({id:t.id});case 3:e.sent,r.$message.success("删除成功"),r.getList(),e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),console.log(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).catch((function(e){console.log(e)}));case 1:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),lookMusic:function(e){this.$router.push({name:"accompaniment",params:{categoriesId:e.id}})}}},m=f,b=(r("a062"),r("2877")),h=Object(b["a"])(m,a,n,!1,null,"1dd6d196",null);t["default"]=h.exports},ee26:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"d",(function(){return o})),r.d(t,"c",(function(){return s})),r.d(t,"f",(function(){return c})),r.d(t,"b",(function(){return i})),r.d(t,"e",(function(){return l}));var a=r("829b"),n=function(e){return Object(a["a"])({url:"/api-web/sysMusicScoreCategories/save",data:e,method:"post",requestType:"json"})},o=function(e){return Object(a["a"])({url:"/api-web/sysMusicScoreCategories/queryPage",params:e,method:"get"})},s=function(e){return Object(a["a"])({url:"/api-web/sysMusicScoreCategories/get",params:e,method:"get"})},c=function(e){return Object(a["a"])({url:"/api-web/sysMusicScoreCategories/update",data:e,method:"post",requestType:"json"})},i=function(e){return Object(a["a"])({url:"/api-web/sysMusicScoreCategories/enable",params:e,method:"get"})},l=function(e){return Object(a["a"])({url:"/api-web/sysMusicScoreCategories/delete",data:e,method:"post",requestType:"form"})}}}]);