1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1cd8468e"],{"0045":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"m-container"},[e._m(0),e._v(" "),n("div",{staticClass:"m-core"},[n("save-form",{attrs:{inline:!0,model:e.searchForm},on:{submit:e.search,reset:e.onReSet}},[n("el-form-item",{attrs:{prop:"search"}},[n("el-input",{attrs:{clearable:"",placeholder:"教材编号、名称"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null: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(" "),n("el-form-item",{attrs:{prop:"enable"}},[n("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"}},[n("el-option",{attrs:{label:"启动",value:"1"}}),e._v(" "),n("el-option",{attrs:{label:"停用",value:"0"}})],1)],1),e._v(" "),n("el-form-item",[n("el-button",{attrs:{"native-type":"submit",type:"primary"}},[e._v("搜索")]),e._v(" "),n("el-button",{attrs:{"native-type":"reset",type:"danger"}},[e._v("重置")])],1)],1),e._v(" "),n("div",{staticClass:"btnList"},[n("auth",{attrs:{auths:"sysMusicScoreCategories/save"}},[n("el-button",{attrs:{type:"primary"},on:{click:e.addTeach}},[e._v("新增教材")])],1)],1),e._v(" "),n("div",{staticClass:"tableWrap"},[n("el-table",{staticStyle:{width:"100%"},attrs:{"header-cell-style":{background:"#EDEEF0",color:"#444"},data:e.tableList}},[n("el-table-column",{attrs:{align:"center",prop:"id",label:"教材编号"}}),e._v(" "),n("el-table-column",{attrs:{align:"center",prop:"name",label:"教材名称"}}),e._v(" "),n("el-table-column",{attrs:{align:"center",prop:"organNames",label:"可见分部"}}),e._v(" "),n("el-table-column",{attrs:{align:"center",prop:"studentId",label:"曲目数量"}}),e._v(" "),n("el-table-column",{attrs:{align:"center",prop:"updateTime",label:"最后更新时间"}}),e._v(" "),n("el-table-column",{attrs:{align:"center",prop:"studentId",label:"教材状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("div",[e._v("\n "+e._s(t.row.enable?"启用":"停用")+"\n ")])]}}])}),e._v(" "),n("el-table-column",{attrs:{align:"center",prop:"studentId",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("div",[n("auth",{attrs:{auths:"/accompaniment"}},[n("el-button",{attrs:{type:"text"},on:{click:function(n){return e.lookMusic(t.row)}}},[e._v("查看")])],1),e._v(" "),n("auth",{attrs:{auths:"sysMusicScoreCategories/update"}},[t.row.enable?e._e():n("el-button",{attrs:{type:"text"},on:{click:function(n){return e.resetTeach(t.row)}}},[e._v("修改")])],1),e._v(" "),n("auth",{attrs:{auths:"sysMusicScoreCategories/enable"}},[t.row.enable?n("el-button",{attrs:{type:"text"},on:{click:function(n){return e.stopTeach(t.row)}}},[e._v("停用")]):e._e(),e._v(" "),t.row.enable?e._e():n("el-button",{attrs:{type:"text"},on:{click:function(n){return e.stopTeach(t.row)}}},[e._v("启用")])],1),e._v(" "),n("auth",{attrs:{auths:"sysMusicScoreCategories/delete"}},[t.row.enable?e._e():n("el-button",{attrs:{type:"text"},on:{click:function(n){return e.removeTeach(t.row)}}},[e._v("删除")])],1)],1)]}}])})],1),e._v(" "),n("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?n("el-dialog",{attrs:{title:"新增教材",visible:e.teachVisible,width:"800px"},on:{"update:visible":function(t){e.teachVisible=t}}},[e.teachVisible?n("addTeach",{ref:"addTeach",attrs:{activeRow:e.activeRow},on:{close:function(t){e.teachVisible=!1},getList:e.getList}}):e._e(),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.teachVisible=!1}}},[e._v("取 消")]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:e.submitAdd}},[e._v("确 定")])],1)],1):e._e()],1)},a=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("h2",[n("div",{staticClass:"squrt"}),e._v("\n 教材列表\n ")])}],s=(n("7f7f"),n("386d"),n("5530")),o=(n("96cf"),n("1da1")),i=(n("bc3a"),n("5f87"),n("333d")),c=(n("3908"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-alert",{staticClass:"alert",attrs:{title:"教材信息",closable:!1,type:"info"}}),e._v(" "),n("el-form",{ref:"form",staticClass:"form",attrs:{model:e.form,inline:!0,"label-width":"120px"}},[n("el-row",[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"教材名称",prop:"name",rules:[{required:!0,message:"请输入教材名称",trigger:"blur"}]}},[n("el-input",{staticStyle:{width:"260px"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1)],1),e._v(" "),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"适用分部",prop:"organId",rules:[{required:!0,message:"请选择适用分部",trigger:"change"}]}},[n("select-all",{staticClass:"organSelect",staticStyle:{width:"260px"},attrs:{filterable:"",placeholder:"请选择分部",multiple:"",clearable:""},model:{value:e.form.organId,callback:function(t){e.$set(e.form,"organId","string"===typeof t?t.trim():t)},expression:"form.organId"}},e._l(e.selects.branchs,(function(e,t){return n("el-option",{key:t,attrs:{label:e.name,value:e.id}})})),1)],1)],1)],1),e._v(" "),n("el-row",[n("el-form-item",{attrs:{label:"教材封面图",prop:"coverImg",rules:[{required:!0,message:"请上传教材封面图",trigger:"blur"}],"label-width":"120px"}},[n("upload",{ref:"uploadImg",staticClass:"uploadImg",attrs:{imageWidthM:210,imageHeightM:268},model:{value:e.form.coverImg,callback:function(t){e.$set(e.form,"coverImg",t)},expression:"form.coverImg"}}),e._v(" "),n("p",{staticStyle:{color:"red"}},[e._v("\n 请上传210*268像素,大小2M以内,格式为jpg、png、gif图片\n ")])],1)],1),e._v(" "),n("el-alert",{staticClass:"alert",attrs:{title:"教材曲目分类",closable:!1,type:"info"}}),e._v(" "),n("div",{staticClass:"treeWrap"},[n("el-button",{staticClass:"addCateBtn",attrs:{type:"primary"},on:{click:e.addCate}},[e._v("添加分类")]),e._v(" "),n("el-tree",{ref:"tree",attrs:{data:e.form.sysMusicScoreCategoriesList,"node-key":"index","default-expand-all":"","expand-on-click-node":!1,draggable:"",accordion:"",props:e.treeProps,"allow-drop":e.allowDrop},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.node,a=t.data;return n("span",{staticClass:"custom-tree-node"},[n("span",{class:1==r.level?"title":""},[e._v(e._s(r.label))]),e._v(" "),n("span",[n("i",{staticClass:"el-icon-edit",on:{click:function(){return e.editItem(a)}}}),e._v(" "),n("i",{staticClass:"el-icon-remove-outline",on:{click:function(){return e.removeItem(r,a)}}}),e._v(" "),1==r.level?n("i",{staticClass:"el-icon-circle-plus-outline",on:{click:function(){return e.appendItem(a)}}}):e._e()])])}}])},[e._v("\n >\n ")])],1)],1)],1)}),l=[],u=n("15fd"),p=(n("20d6"),n("c5f6"),n("28a5"),n("c7f0")),d=n("829b"),m=function(e){return Object(d["a"])({url:"/api-web/sysMusicScoreCategories/save",data:e,method:"post",requestType:"json"})},f=function(e){return Object(d["a"])({url:"/api-web/sysMusicScoreCategories/queryPage",params:e,method:"get"})},h=function(e){return Object(d["a"])({url:"/api-web/sysMusicScoreCategories/get",params:e,method:"get"})},v=function(e){return Object(d["a"])({url:"/api-web/sysMusicScoreCategories/update",data:e,method:"post",requestType:"json"})},g=function(e){return Object(d["a"])({url:"/api-web/sysMusicScoreCategories/enable",params:e,method:"get"})},b=function(e){return Object(d["a"])({url:"/api-web/sysMusicScoreCategories/delete",data:e,method:"post",requestType:"form"})},y={props:["activeRow"],components:{Upload:p["a"]},data:function(){return{form:{organId:[],name:null,coverImg:"",sysMusicScoreCategoriesList:[]},index:0,treeProps:{children:"sysMusicScoreCategoriesList",label:"name"}}},mounted:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.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 e.prev=3,e.next=6,h({id:this.activeRow.id});case 6:n=e.sent,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.sysMusicScoreCategoriesList=this.recursionDate(n.data.sysMusicScoreCategoriesList),e.next=15;break;case 13:e.prev=13,e.t0=e["catch"](3);case 15:case"end":return e.stop()}}),e,this,[[3,13]])})));function t(){return e.apply(this,arguments)}return t}(),methods:{recursionDate:function(e){if(e.length>0){for(var t=[],n=0;n<e.length;n++){var r=Object(s["a"])(Object(s["a"])({},e[n]),{},{index:e[n].id});e[n].sysMusicScoreCategoriesList&&e[n].sysMusicScoreCategoriesList.length>0&&(r.sysMusicScoreCategoriesList=this.recursionDate(e[n].sysMusicScoreCategoriesList)),t.push(r)}return t}},appendItem:function(e){var t=this;console.log(e),this.$prompt("请输入教材名称","提示",{confirmButtonText:"确定",cancelButtonText:"取消",closeOnClickModal:!1,inputPattern:/^.{1,30}$/,inputErrorMessage:"请输入1到15个汉字或字符"}).then((function(n){var r=n.value;t.index+=1;var a={index:"xxx".concat(t.index),name:r,sysMusicScoreCategoriesList:[]};e.sysMusicScoreCategoriesList||t.$set(e,"sysMusicScoreCategoriesList",[]),e.sysMusicScoreCategoriesList.push(a)})).catch((function(){}))},removeItem:function(e,t){var n=e.parent,r=n.data.sysMusicScoreCategoriesList||n.data,a=r.findIndex((function(e){return e.id===t.id}));r.splice(a,1)},editItem:function(e){this.$prompt("请输入修改的教材曲目名称","提示",{confirmButtonText:"确定",cancelButtonText:"取消",closeOnClickModal:!1,inputValue:e.name,inputPattern:/^.{1,30}$/,inputErrorMessage:"请输入1到15个汉字或字符"}).then((function(t){var n=t.value;e.name=n})).catch((function(){}))},addCate:function(){var e=this;this.$prompt("请输入教材曲目名称","提示",{confirmButtonText:"确定",cancelButtonText:"取消",closeOnClickModal:!1,inputPattern:/^.{1,30}$/,inputErrorMessage:"请输入1到15个汉字或字符"}).then((function(t){var n=t.value;e.index+=1,e.form.sysMusicScoreCategoriesList.push({index:"xxx".concat(e.index),name:n})})).catch((function(){}))},addSubmit:function(){var e=this;this.$refs.form.validate(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(n){var r,a,o,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!n){t.next=23;break}if(r=e.form,a=r.organId,o=Object(u["a"])(r,["organId"]),i=Object(s["a"])(Object(s["a"])({},o),{},{organId:a.join(",")}),t.prev=3,!e.activeRow.id){t.next=12;break}return i.id=e.activeRow.id,t.next=8,v(i);case 8:t.sent,e.$$message.success("修改成功"),t.next=18;break;case 12:return t.next=14,m(i);case 14:t.sent,e.$$message.success("添加成功"),e.$emit("getList"),e.$emit("close");case 18:t.next=23;break;case 20:t.prev=20,t.t0=t["catch"](3),console.log(t.t0);case 23:case"end":return t.stop()}}),t,null,[[3,20]])})));return function(e){return t.apply(this,arguments)}}()),console.log("提交")},uploadImg:function(){this.$refs.uploadImg.$refs.upload.submit()},allowDrop:function(e,t,n){return 1==t.level}},computed:{}},w=y,x=(n("c1d4"),n("2877")),_=Object(x["a"])(w,c,l,!1,null,"6391aa74",null),k=_.exports,C={components:{pagination:i["a"],addTeach:k},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.init()},methods:{init:function(){this.getList()},getList:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f(Object(s["a"])(Object(s["a"])({},this.searchForm),{},{page:this.rules.page,rows:this.rules.limit}));case 3:t=e.sent,this.rules.total=t.data.total,this.tableList=t.data.rows,e.next=10;break;case 8:e.prev=8,e.t0=e["catch"](0);case 10:case"end":return e.stop()}}),e,this,[[0,8]])})));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()},addTeach:function(){this.activeRow=null,this.teachVisible=!0},submitAdd:function(){this.$refs.addTeach.addSubmit()},resetTeach:function(e){this.activeRow=e,this.teachVisible=!0},stopTeach:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){var n,r=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:n="",n=t.enable?"是否停用".concat(t.name,"该教材"):"是否启用".concat(t.name,"该教材"),this.$confirm(n,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,g({categoriesId:t.id});case 3:e.sent,t.enable?r.$message.success("停用成功"):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 3:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),removeTeach:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){var n=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.$confirm("是否删除".concat(t.name),"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,b({id:t.id});case 3:e.sent,n.$message.success("删除成功"),n.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}})}}},S=C,M=(n("841e"),Object(x["a"])(S,r,a,!1,null,"d2af5fb8",null));t["default"]=M.exports},"09f4":function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),Math.easeInOutQuad=function(e,t,n,r){return e/=r/2,e<1?n/2*e*e+t:(e--,-n/2*(e*(e-2)-1)+t)};var r=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function a(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,n){var o=s(),i=e-o,c=20,l=0;t="undefined"===typeof t?500:t;var u=function e(){l+=c;var s=Math.easeInOutQuad(l,o,i,t);a(s),l<t?r(e):n&&"function"===typeof n&&n()};u()}},"15fd":function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,a={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}function a(e,t){if(null==e)return{};var n,a,s=r(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}n.d(t,"a",(function(){return a}))},"40c1":function(e,t,n){},"841e":function(e,t,n){"use strict";n("99a9")},"99a9":function(e,t,n){},c1d4:function(e,t,n){"use strict";n("40c1")}}]);
|