1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1f456443"],{"0045":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:"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:function(t){return e.operationTeachClass("create")}}},[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,"row-key":"id","expand-row-keys":e.expands,"tree-props":{children:"sysMusicScoreCategoriesList",hasChildren:"hasChildren"}}},[r("el-table-column",{attrs:{align:"left",prop:"name",label:"教材名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.name)+"("+e._s(t.row.id)+")\n ")]}}])}),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.level<4?r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.operationTeachClass("create",t.row)}}},[e._v("添加")]):e._e()],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.operationTeachClass("update",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)],1)],1),e._v(" "),e.teachClassVisible?r("el-dialog",{attrs:{title:"create"==e.type?"新增教材":"修改教材",visible:e.teachClassVisible,width:"600px"},on:{"update:visible":function(t){e.teachClassVisible=t}}},[e.teachClassVisible?r("teachClass",{ref:"teachClass",attrs:{type:e.type,activeRow:e.activeRow},on:{close:function(t){e.teachClassVisible=!1},getList:e.getList}}):e._e()],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 ")])}],s=(r("7f7f"),r("6762"),r("2fdb"),r("75fc")),o=(r("386d"),r("c80c")),c=r("db72"),i=(r("96cf"),r("3b8d")),u=r("2d63"),l=r("333d"),d=r("0a47"),p=r("f716"),f=r("ee26"),m=function e(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=Object(u["a"])(t);try{for(n.s();!(r=n.n()).done;){var s=r.value;s.level=a,s.sysMusicScoreCategoriesList&&s.sysMusicScoreCategoriesList.length&&e(s.sysMusicScoreCategoriesList,a+1)}}catch(o){n.e(o)}finally{n.f()}return t},b={components:{pagination:l["a"],teachClass:d["a"]},data:function(){return{searchForm:{search:null,enable:null,organId:null},tableList:[],organList:[],activeRow:null,type:"create",teachClassVisible:!1,expands:[]}},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=Object.assign({},this.searchForm),e.prev=1,e.next=4,Object(p["h"])(Object(c["a"])({},t));case 4:r=e.sent,console.log(r),a=m(r.data),console.log(a),this.tableList=a,e.next=13;break;case 11:e.prev=11,e.t0=e["catch"](1);case 13:case"end":return e.stop()}}),e,this,[[1,11]])})));function t(){return e.apply(this,arguments)}return t}(),search:function(){this.getList()},onReSet:function(){this.$refs.searchForm.resetFields(),this.search()},operationTeachClass:function(e,t){this.type=e;var r=0;if(t){console.log(t.id,"id");var a=this.formatParentId(t.id,this.tableList);console.log(a.indexOf(t.id)),r=a.indexOf(t.id),console.log(t,t.id,this.formatParentId(t.id,this.tableList),"tableList"),t.level=r}this.activeRow=t||null,this.teachClassVisible=!0},formatParentId:function(e,t){var r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=Object(u["a"])(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;if(o.sysMusicScoreCategoriesList){var c=this.formatParentId(e,o.sysMusicScoreCategoriesList,[].concat(Object(s["a"])(a),[o.id]));if(c.includes(e))return c}if(o.id===e)return[].concat(Object(s["a"])(a),[e])}}catch(i){n.e(i)}finally{n.f()}return a},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(f["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(f["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}})}}},h=b,v=(r("ec76"),r("2877")),g=Object(v["a"])(h,a,n,!1,null,"05b76a98",null);t["default"]=g.exports},"09f4":function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),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 s(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function o(e,t,r){var o=s(),c=e-o,i=20,u=0;t="undefined"===typeof t?500:t;var l=function e(){u+=i;var s=Math.easeInOutQuad(u,o,c,t);n(s),u<t?a(e):r&&"function"===typeof r&&r()};l()}},"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=[],s=r("db72"),o=r("a8db"),c=(r("6762"),r("2fdb"),r("75fc")),i=r("2d63"),u=r("c80c"),l=(r("7f7f"),r("c5f6"),r("28a5"),r("96cf"),r("3b8d")),d=r("c7f0"),p=r("896b"),f=r("ee26"),m=["organId"],b={props:["type","activeRow"],components:{Upload:d["a"],ImageCropper:p["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(l["a"])(Object(u["a"])().mark((function e(){var t,r,a,n;return Object(u["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 s=r.value;if(s.sysMusicScoreCategoriesList){var o=this.formatParentId(e,s.sysMusicScoreCategoriesList,[].concat(Object(c["a"])(a),[s.id]));if(o.includes(e))return o}if(s.id===e)return[].concat(Object(c["a"])(a),[e])}}catch(u){n.e(u)}finally{n.f()}return a},addSubmit:function(){var e=this;this.$refs.form.validate(function(){var t=Object(l["a"])(Object(u["a"])().mark((function t(r){var a,n,c,i,l,d,p,b;return Object(u["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(o["a"])(a,m),i=0,"create"==e.type?i=(null===(l=e.activeRow)||void 0===l?void 0:l.id)||0:"update"==e.type&&(i=(null===(d=e.activeRow)||void 0===d?void 0:d.parentId)||0),p=Object(s["a"])(Object(s["a"])({},c),{},{parentId:i,organId:n.join(",")}),t.prev=5,"update"!=e.type){t.next=15;break}return p.id=null===(b=e.activeRow)||void 0===b?void 0:b.id,t.next=10,Object(f["f"])(p);case 10:e.$message.success("修改成功"),e.$emit("getList"),e.$emit("close"),t.next=20;break;case 15:return t.next=17,Object(f["a"])(p);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},4491:function(e,t,r){"use strict";r("6b14")},"6b14":function(e,t,r){},"841d":function(e,t,r){},ec76:function(e,t,r){"use strict";r("841d")},ee26:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"d",(function(){return s})),r.d(t,"c",(function(){return o})),r.d(t,"f",(function(){return c})),r.d(t,"b",(function(){return i})),r.d(t,"e",(function(){return u}));var a=r("829b"),n=function(e){return Object(a["a"])({url:"/api-web/sysMusicScoreCategories/save",data:e,method:"post",requestType:"json"})},s=function(e){return Object(a["a"])({url:"/api-web/sysMusicScoreCategories/queryPage",params:e,method:"get"})},o=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"})},u=function(e){return Object(a["a"])({url:"/api-web/sysMusicScoreCategories/delete",data:e,method:"post",requestType:"form"})}},f716:function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"e",(function(){return o})),r.d(t,"a",(function(){return c})),r.d(t,"f",(function(){return i})),r.d(t,"d",(function(){return u})),r.d(t,"g",(function(){return l})),r.d(t,"b",(function(){return d})),r.d(t,"h",(function(){return p}));var a=r("829b"),n=r("b775"),s=function(e){return Object(a["a"])({url:"/api-web/sysMusicScore/queryPage",data:{},params:e,requestType:"form"})},o=function(e){return Object(a["a"])({url:"/api-web/sysMusicScore/transcod",data:{},params:{sysMusicScoreId:e.id},requestType:"json",method:"post"})},c=function(e){return Object(a["a"])({url:"/api-web/sysMusicScore/add",method:"post",data:e,params:{}})},i=function(e){return Object(n["a"])({url:"/api-web/sysMusicScore/update",method:"post",data:e,params:{}})},u=function(e){return Object(a["a"])({url:"/api-web/sysMusicScore/show",method:"post",data:e,requestType:"form"})},l=function(e){return Object(a["a"])({url:"/api-web/sysMusicScoreAccompaniment/queryPage",method:"get",params:e})},d=function(e){return Object(a["a"])({url:"/api-web/sysMusicScore/del",method:"post",data:{},params:{id:e},requestType:"form"})},p=function(e){return Object(a["a"])({url:"/api-web/sysMusicScoreCategories/queryTree",method:"get",data:{},params:e,requestType:"form"})}}}]);
|