index.64779757.js 5.0 KB

1
  1. var j=Object.defineProperty;var g=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable;var _=(e,s,i)=>s in e?j(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i,y=(e,s)=>{for(var i in s||(s={}))I.call(s,i)&&_(e,i,s[i]);if(g)for(var i of g(s))L.call(s,i)&&_(e,i,s[i]);return e};import{d as S,r as b,c as t,f as h,B as C,b2 as E,a as N,s as r,i as p,t as m,A as w,P as F,D as q}from"./base.d7a641ab.js";import{I as k}from"./index.7852928e.js";import{E as B}from"./index.6829aadf.js";const x="_container_1e2y6_1",M="_subjectcontent_1e2y6_24",P="_subjectlist_1e2y6_30",T="_subjectItem_1e2y6_38",A="_active_1e2y6_50",$="_button_1e2y6_55";var d={container:x,subjectcontent:M,subjectlist:P,subjectItem:T,active:A,button:$},v=S({name:"choosePartName",props:{isRem:{type:Boolean,default:!0},partNames:{type:Array,default:()=>[]},onSelectedPartName:{type:Function,default:e=>{}}},async mounted(){try{const e=await b.post("/subject/list");this.subjectList=e.data||[]}catch{}},data(){return{selectedPart:{},subjectList:[]}},methods:{onDetail(e){console.log(e),this.subjectList.forEach(s=>{s.checked=!1}),e.checked=!0,this.selectedPart=e}},render(){return t("div",{class:d.container},[t("h3",null,[h("\u8BF7\u9009\u62E9\u60A8\u7EC3\u4E60\u7684\u58F0\u90E8")]),t("div",{class:d.subjectcontent},[t("div",{class:d.subjectlist},[this.subjectList.map(e=>t("div",{key:e.id,onClick:()=>this.onDetail(e),class:[d.subjectItem,e.checked?d.active:null]},[e.name]))])]),t(C,{class:d.button,type:"primary",round:!0,block:!0,color:"#01C1B5",onClick:()=>this.onSelectedPartName(this.selectedPart)},{default:()=>[h("\u786E\u5B9A")]})])}});const D="_headerTips_1b9xq_1",O="_btn_1b9xq_23",R="_container_1b9xq_34",V="_content_1b9xq_39",H="_items_1b9xq_44",J="_inner_1b9xq_55",K="_img_1b9xq_59";var l={headerTips:D,btn:O,container:R,content:V,items:H,inner:J,img:K};const U=q();var X=S({name:"baseClass",components:{ChooseSubjectName:v},data(){return{list:[],show:!0,closeStatus:!0,courseNum:0}},mounted(){document.addEventListener("visibilitychange",this.visibilitychange,!1),localStorage.setItem("behaviorId",E()),this.FetchList(),N(["_trackEvent","\u4E91\u6559\u7EC3","\u5207\u6362\u9875\u9762","\u5206\u7C7B\u9875\u9762"]),r.subjectId=r.origanSubjectId,p()==="/api-student"&&this.FetchCourseInfo()},unmounted(){document.removeEventListener("visibilitychange",this.visibilitychange,!1)},computed:{chooseShow(){return!!(p()==="/api-student"&&!r.subjectLoading&&r.subjectId===0&&this.closeStatus)}},methods:{visibilitychange(){document.visibilityState!=="hidden"&&this.courseNum>0&&this.FetchCourseInfo()},async FetchCourseInfo(){try{const e=await b("/activityUserMapper/getStudentNoCourseInfo");this.courseNum=e.data.courseNum}catch{}},async FetchList(){try{const e=await b.get("/sysMusicScoreCategories/queryTree");this.list=await this.filterList(e.data||[])||[],this.show=this.list.length>0}catch{}},filterList(e){const s=r.tenantId,i=r.organId;let n=[];if(p()==="/api-web"){let a=String(i).split(",");a=a?a.map(c=>Number(c)):[],n=a}else n.push(i);if(s!=1)return e;e.forEach(a=>{const c=a.sysMusicScoreCategoriesList||[];let u=[];a.id===38?n.includes(55)?u=c:n.includes(59)?c.forEach(o=>{o.id==30&&u.push(o)}):!n.includes(55)&&!n.includes(59)&&c.forEach(o=>{o.id!=30&&u.push(o)}):a.id===40?n.includes(59)?c.forEach(o=>{o.id!=47&&u.push(o)}):n.includes(59)||c.forEach(o=>{u.push(o)}):u=c,a.sysMusicScoreCategoriesList=u});let f=[];return e.forEach(a=>{a.id==40&&a.sysMusicScoreCategoriesList&&a.sysMusicScoreCategoriesList.length>0&&f.push(a),a.id!=40&&f.push(a)}),f},onClickLeft(){U.isApp&&m({api:"back"})},toDetail(e){var i;const s=e.sysMusicScoreCategoriesList?e.sysMusicScoreCategoriesList.length:0;sessionStorage.setItem("musicScoreList",JSON.stringify(e.sysMusicScoreCategoriesList)),s>1?this.$router.push({path:"/classify",query:y({parentId:e.id},this.$route.query)}):this.$router.push({path:"/list/"+(s==1?(i=e.sysMusicScoreCategoriesList[0])==null?void 0:i.id:e.id),query:y({},this.$route.query)})},audition(){m({api:"openWebView",content:{url:location.origin+"/#/auditionLive",orientation:1,isHideTitle:!1,statusBarTextColor:!1,isOpenLight:!1}})},async onSelectedPartName(e){if(!e.id){w("\u8BF7\u9009\u62E9\u58F0\u90E8");return}try{await b.post("/student/updateSubject",{data:{subjectId:e.id}}),this.chooseShow=!1,r.subjectId=e.id,r.origanSubjectId=e.id}catch{}}},render(){return t("div",{class:l.container},[t(F,{show:this.chooseShow,teleport:"body",style:{borderRadius:"8px"}},{default:()=>[t(v,{onSelectedPartName:this.onSelectedPartName},null)]}),t("div",{class:l.content},[p()==="/api-student"&&this.courseNum>0&&t("div",{class:l.headerTips},[t("p",null,[h("\u968F\u5FC3\u5B66\u771F\u4EBA\u8F85\u5BFC\u8BFE\u5269\u4F59 "),t("span",null,[this.courseNum]),h(" \u8282")]),t(C,{class:l.btn,onClick:this.audition},{default:()=>[h("\u7ACB\u5373\u7EA6\u8BFE")]})]),t("div",{class:l.items},[this.show?this.list.map(e=>t("div",{key:e.id,onClick:()=>this.toDetail(e)},[t("div",{class:l.inner},[t(k,{src:e.coverImg,class:l.img},null)])])):t(B,{description:"\u6682\u65E0\u6570\u636E"},null)])])])}});export{X as default};