1 |
- var G=Object.defineProperty,R=Object.defineProperties;var V=Object.getOwnPropertyDescriptors;var U=Object.getOwnPropertySymbols;var H=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;var _=(a,c,d)=>c in a?G(a,c,{enumerable:!0,configurable:!0,writable:!0,value:d}):a[c]=d,E=(a,c)=>{for(var d in c||(c={}))H.call(c,d)&&_(a,d,c[d]);if(U)for(var d of U(c))J.call(c,d)&&_(a,d,c[d]);return a},O=(a,c)=>R(a,V(c));var v=(a,c,d)=>new Promise((s,p)=>{var l=m=>{try{y(d.next(m))}catch(h){p(h)}},o=m=>{try{y(d.throw(m))}catch(h){p(h)}},y=m=>m.done?s(m.value):Promise.resolve(m.value).then(l,o);y((d=d.apply(a,c)).next())});import{T as Q}from"./index.a0bcdc8a.js";import{k as W}from"./knowledgeTypeData.3b15dd0b.js";import{d as A,ai as j,u as P,a as I,r as X,B as q,U as Y,i as e,l as b,aj as B,N as Z,a0 as ee,_ as te,a9 as C,p as S,k,cg as z,ao as ae,b as ne,q as K,di as $,db as x,ae as ie,bn as se,e as le,c as oe,H as L,at as re,dm as de,aa as ce,dp as F,bC as N}from"./index.789dd106.js";import{q as ue,r as pe,s as ge,t as me,v as fe}from"./api.cd91a8fe.js";import{S as ye}from"./index.b24e8dc3.js";import{P as he}from"./index.70371ae0.js";import{f as we}from"./api.ac6a3c33.js";import{N as Te}from"./Cascader.85b68ac2.js";import{N as ke}from"./PageHeader.0c76ed3e.js";import"./tabsView.ce4b9104.js";import"./searchs.b637f0d6.js";const ve={VIDEO:"\u89C6\u9891",IMG:"\u89C6\u9891",SONG:"\u66F2\u76EE"},Se=A({name:"addMaterialTraining",props:{parentData:{type:Object,default:()=>{}}},emits:["close","handleSuccess"],setup(a,{emit:c}){console.log("\u{1F680} ~ props",a.parentData.id),j();const d=P(),s=I({loading:!1,saveLoading:!1,pagination:{page:1,rows:10,pageTotal:10},dataList:[],checkList:[],selectCheckList:[]}),p=I({keyword:"",knowledgePointIds:null}),l=I({list:[],index:-1,loading:!1}),o=()=>v(this,null,function*(){try{const{data:t}=yield we({courseTypeCode:a.parentData.courseTypeCode,page:1,rows:1e3});console.log(t);const i=t.rows||[];l.list=i}catch(t){}}),y=()=>[{type:"selection",disabled(t){return!t.knowledgePointId}},{title:"\u7D20\u6750\u540D\u79F0",key:"materialName",fixed:"left"},{title:"\u7D20\u6750\u7C7B\u578B",key:"materialCategoryName",render(t){return ve[t.type]}},{title:"\u5206\u6BB5\u7F16\u53F7",key:"sn"},{title:"\u8BFE\u7A0B\u7C7B\u578B",key:"courseTypeName",width:200,ellipsis:!0,render(t){return e(ae,{placement:"left-start"},{default:()=>t.courseTypeName,trigger:()=>t.courseTypeName})}},{title:"\u77E5\u8BC6\u70B9\u5206\u7C7B",key:"knowledgePointName"}],m=X(),h=()=>{s.pagination.page=1,g()},n=()=>{var t;(t=m.value)==null||t.submit()},f=()=>{p.knowledgePointIds=null,p.keyword="",n()},g=()=>v(this,null,function*(){try{s.loading=!0;const t=O(E({lessonTrainingId:a.parentData.id},p),{courseTypeCode:a.parentData.courseTypeCode,page:s.pagination.page,rows:s.pagination.rows,knowledgePointId:null}),{data:i}=yield ue(t);s.loading=!1,s.pagination.pageTotal=Number(i.total),s.dataList=i.rows||[]}catch(t){s.loading=!1}});q(()=>v(this,null,function*(){yield o(),Y(()=>v(this,null,function*(){yield g()}))}));const r=()=>v(this,null,function*(){s.saveLoading=!0;const t=s.checkList.map(i=>{const D=s.selectCheckList.find(w=>w.materialId===i);return{materialId:i,knowledgePointId:D.knowledgePointId,lessonTrainingId:a.parentData.id}});try{const i=yield pe(t);d.success("\u4FDD\u5B58\u6210\u529F"),c("handleSuccess")}catch(i){}s.saveLoading=!1});return()=>e(B,null,[e(ye,{style:{padding:0,boxShadow:"none"},ref:m,"label-width":"",model:p,onSubmit:h,onSetModel:t=>Object.assign(p,t),saveKey:"addMaterialTraining-abc-key-class"},{default:()=>[e(b,{label:"\u77E5\u8BC6\u70B9\u5206\u7C7B",path:"knowledgePointIds"},{default:()=>[e(Te,{value:p.knowledgePointIds,"onUpdate:value":t=>p.knowledgePointIds=t,options:l.list,multiple:!0,clearable:!0,filterable:!0,childrenField:"children",expandTrigger:"hover",valueField:"id",labelField:"name",checkStrategy:"all",cascade:!0,showPath:!0,maxTagCount:"responsive"},{empty:()=>l.loading?e(B,null,[e(Z,{description:"\u52A0\u8F7D\u4E2D"},{icon:()=>e(ee,{size:"30"},{default:()=>[e("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},[e("path",{d:"M988 548c-19.9 0-36-16.1-36-36c0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9a437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3c.1 19.9-16 36-35.9 36z",fill:"currentColor"},null)])]})})]):null})]}),e(b,{label:"\u7D20\u6750\u540D\u79F0/\u7F16\u53F7",path:"keyword"},{default:()=>[e(te,{value:p.keyword,"onUpdate:value":t=>p.keyword=t,onKeydown:t=>{t.code==="Enter"&&h()},clearable:!0},null)]}),e(b,null,{default:()=>[e(C,null,{default:()=>[e(S,{type:"primary",onClick:n},{default:()=>[k("\u641C\u7D22")]}),e(S,{type:"default",onClick:f},{default:()=>[k("\u91CD\u7F6E")]})]})]})]}),e(z,{loading:s.loading,maxHeight:"calc(100vh - 270px)",rowKey:t=>t.materialId,columns:y(),data:s.dataList,checkedRowKeys:s.checkList,"onUpdate:checkedRowKeys":[t=>s.checkList=t,(t,i,D)=>{const w=[];s.selectCheckList.forEach(u=>{s.checkList.includes(u.materialId)&&w.push(u)}),s.checkList.forEach(u=>{const T=s.dataList.find(M=>M.materialId===u);s.selectCheckList.findIndex(M=>M.materialId===u)<=-1&&w.push(T)}),s.selectCheckList=[...w]}]},null),e(he,{page:s.pagination.page,"onUpdate:page":t=>s.pagination.page=t,pageTotal:s.pagination.pageTotal,"onUpdate:pageTotal":t=>s.pagination.pageTotal=t,pageSize:s.pagination.rows,"onUpdate:pageSize":t=>s.pagination.rows=t,onList:g,sync:!0,saveKey:"addMaterialTraining-abc-key-class"},null),e(S,{type:"primary",disabled:!s.checkList.length,loading:s.saveLoading,onClick:()=>r()},{default:()=>[k("\u786E\u8BA4")]})])}});function De(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!se(a)}const be=A({name:"addTrainStandard",props:{item:{type:Object,default:()=>{}}},emits:["handleAdd","close"],setup(a,{emit:c}){var h,n,f;console.log("\u{1F680} ~ props",a.item);const d=ne(),p=(/(localhost|192)/.test(location.host)?"https://ponline.colexiu.com":location.origin)+`/orchestra-music-score/?_t=${Date.now()}&id=${a.item.content}&modelType=practice&Authorization=${d.getToken}`,l=P(),o=I({current:1,list:[{id:1,name:"\u5355\u56E2\u5B66\u751F",materialType:(h=a.item)==null?void 0:h.type,practiceTimes:"",startSection:"",endSection:"",speed:"",practiceDuration:""},{id:2,name:"\u53CC\u56E2\u5B66\u751F",materialType:(n=a.item)==null?void 0:n.type,practiceTimes:"",startSection:"",endSection:"",speed:"",practiceDuration:""},{id:3,name:"\u591A\u56E2\u5B66\u751F",materialType:(f=a.item)==null?void 0:f.type,practiceTimes:"",startSection:"",endSection:"",speed:"",practiceDuration:""}]});(()=>{var g;if(Array.isArray((g=a==null?void 0:a.item)==null?void 0:g.standards))for(let r=0;r<a.item.standards.length;r++){let t={};try{t=JSON.parse(a.item.standards[r].trainingConfigJson)}catch(i){}o.list[r].practiceTimes=t.practiceTimes,o.list[r].startSection=t.startSection,o.list[r].endSection=t.endSection,o.list[r].speed=t.speed,o.list[r].practiceDuration=t.practiceDuration}})();const m=()=>v(this,null,function*(){var r,t;if(((r=a.item)==null?void 0:r.type)=="VIDEO")for(let i=0;i<o.list.length;i++){if(!o.list[i].practiceTimes){l.error(`\u8BF7\u5B8C\u5584${o.list[i].name}\u7684\u89C2\u770B\u6B21\u6570`);return}if(!/^\+?[1-9]\d*$/.test(o.list[i].practiceTimes)){l.error(`\u8BF7\u8F93\u5165${o.list[i].name}\u6B63\u786E\u7684\u6570\u5B57\u89C2\u770B\u6B21\u6570`);return}}if(((t=a.item)==null?void 0:t.type)=="SONG")for(let i=0;i<o.list.length;i++){if(!o.list[i].startSection||!o.list[i].endSection||!o.list[i].speed||!o.list[i].practiceDuration){l.error(`\u8BF7\u5B8C\u5584${o.list[i].name}\u7684\u8BAD\u7EC3\u8981\u6C42`);return}if(!/^\+?[1-9]\d*$/.test(o.list[i].startSection)||!/^\+?[1-9]\d*$/.test(o.list[i].endSection)||!/^\+?[1-9]\d*$/.test(o.list[i].speed)||!/^\+?[1-9]\d*$/.test(o.list[i].practiceDuration)){l.error(`\u8BF7\u8F93\u5165${o.list[i].name}\u6B63\u786E\u7684\u6570\u5B57`);return}}let g=o.list.map((i,D)=>{var w,u;return{studentLevel:D+1,lessonTrainingId:(w=a.item)==null?void 0:w.lessonTrainingId,lessonTrainingDetailId:(u=a.item)==null?void 0:u.id,trainingConfigJson:JSON.stringify({materialType:i.materialType,practiceTimes:i.practiceTimes,startSection:i.startSection,endSection:i.endSection,speed:i.speed,practiceDuration:i.practiceDuration})}});console.log("\u{1F680} ~ list",g);try{const i=yield ge(g);l.success("\u4FDD\u5B58\u6210\u529F")}catch(i){}c("handleAdd")});return window.addEventListener("message",g=>{console.log(g.data);const r=g.data;r.api==="admin-selectMusicMeasure"&&o.list.forEach(t=>{t.startSection=t.startSection&&!r.change?t.startSection:r.start+"",t.endSection=t.endSection&&!r.change?t.endSection:r.end+"",t.speed=t.speed&&!r.change?t.speed:r.speed+""})}),console.log(o.list,"state.list"),()=>{var r,t,i,D,w;let g;return e("div",null,[e("div",null,[(r=a.item)==null?void 0:r.materialName]),((t=a.item)==null?void 0:t.type)=="VIDEO"&&e("div",null,[e("video",{style:{width:"100%"},src:a.item.content,controls:!0},null),o.list.map(u=>e(K,{labelPlacement:"left"},{default:()=>[e($,{title:u.name,showIcon:!1,bordered:!0,style:{marginBottom:"12px"}},null),e(b,{required:!0,label:"\u89C2\u770B\u6B21\u6570"},{default:()=>[e(x,{placeholder:"\u8BF7\u8F93\u5165\u89C2\u770B\u6B21\u6570",showButton:!1,value:u.practiceTimes,"onUpdate:value":T=>u.practiceTimes=T,min:0},null)]})]}))]),((i=a.item)==null?void 0:i.type)==="SONG"&&e("div",null,[e("iframe",{width:"667px",height:"375px",frameborder:"0",src:p},null),e(K,{labelPlacement:"left"},De(g=o.list.map(u=>e(B,null,[e($,{title:u.name,showIcon:!1,bordered:!0,style:{marginBottom:"12px"}},null),e(b,{required:!0,label:"\u7EC3\u4E60\u5C0F\u8282"},{default:()=>[e(x,{showButton:!1,placeholder:"\u5F00\u59CB\u5C0F\u8282",value:u.startSection,"onUpdate:value":T=>u.startSection=T,min:0,style:{width:"180px"}},null),k("~"),e(x,{showButton:!1,placeholder:"\u7ED3\u675F\u5C0F\u8282",value:u.endSection,"onUpdate:value":T=>u.endSection=T,min:0,style:{width:"180px"}},null)]}),e(b,{label:"\u7EC3\u4E60\u901F\u5EA6",required:!0},{default:()=>[e(x,{showButton:!1,placeholder:"\u7EC3\u4E60\u901F\u5EA6",value:u.speed,"onUpdate:value":T=>u.speed=T,min:0,style:{width:"180px"}},null)]}),e(b,{label:"\u7EC3\u4E60\u65F6\u957F",required:!0},{default:()=>[e(x,{value:u.practiceDuration,"onUpdate:value":T=>u.practiceDuration=T,showButton:!1,min:0,style:{width:"180px"}},{suffix:()=>"\u5206\u949F"})]})])))?g:{default:()=>[g]})]),((D=a.item)==null?void 0:D.type)==="IMG"&&e("div",null,[e(ie,{width:200,height:200,src:(w=a==null?void 0:a.item)==null?void 0:w.content},null)]),e(C,{justify:"end"},{default:()=>[e(S,{onClick:()=>c("close")},{default:()=>[k("\u53D6\u6D88")]}),e(S,{type:"primary",onClick:()=>m()},{default:()=>[k("\u786E\u8BA4")]})]})])}}}),Ce={VIDEO:"\u89C6\u9891",IMG:"\u56FE\u7247",SONG:"\u66F2\u76EE"},$e=A({name:"after-class-training-detail",setup(){const a=P(),c=j(),d=le(),s=oe(),p=I({name:d.query.name||"\u65B0\u5EFA\u8BFE\u540E\u4F5C\u4E1A",id:d.query.id,courseTypeCode:d.query.courseTypeCode}),l=I({pagination:{page:1,rows:10,pageTotal:0},hasUpdate:!1,loading:!1,dataList:[],checkList:[],isMover:!1,visiableKnowledge:!1,trainModel:!1,trainItem:null,modalType:"add",detailData:{}}),o=()=>[{type:"selection"},{title:"\u7D20\u6750\u540D\u79F0",key:"materialName",render(n){return e(Q,{to:{path:"/educationalManage/educationalManage",query:{id:n.materialId}}},{default:()=>[n.materialName]})}},{title:"\u8BFE\u7A0B\u7C7B\u578B",key:"courseTypeCode",render(n){var f;return((f=n==null?void 0:n.courseTypeCode)==null?void 0:f.split(",").map(g=>W[g]).join(","))||""}},{title:"\u7D20\u6750\u7C7B\u578B",key:"type",render(n){return Ce[n.type]}},{title:"\u7EC3\u4E60\u6807\u51C6",key:"standards",render(n){return Array.isArray(n.standards)&&n.standards.length?e(C,{size:"small",align:"center"},{default:()=>[e(F,{dot:!0,type:"success"},null),e("span",null,[k("\u5DF2\u8BBE\u7F6E")])]}):e(C,{size:"small",align:"center"},{default:()=>[e(F,{dot:!0,type:"error"},null),e("span",null,[k("\u672A\u8BBE\u7F6E")])]})}},{title:"\u64CD\u4F5C",key:"operation",fixed:"right",render(n,f){return e(C,null,{default:()=>[L(e(S,{text:!0,type:"primary",onClick:()=>{l.trainModel=!0,l.trainItem=n}},{default:()=>[Array.isArray(n.standards)&&n.standards.length?"\u4FEE\u6539\u8BAD\u7EC3\u6807\u51C6":"\u8BBE\u7F6E\u8BAD\u7EC3\u6807\u51C6"]}),[[N("auth"),"lessonTrainingDetailTemp/batchUpSet1750902708004454402"]]),L(e(S,{text:!0,type:"primary",onClick:()=>m(n)},{default:()=>[k("\u5220\u9664")]}),[[N("auth"),"lessonTrainingDetail/remove1608722927511257089"]])]})}}],y=()=>v(this,null,function*(){if(!!p.id){l.loading=!0;try{const{data:n}=yield me({lessonTrainingId:p.id,page:1,rows:1e3});Array.isArray(n==null?void 0:n.rows)&&(l.dataList=n.rows,l.pagination.pageTotal=n.total)}catch(n){}l.loading=!1}});q(()=>{y()});const m=n=>{if(l.hasUpdate){a.error("\u8FD8\u6709\u6CA1\u4FDD\u5B58\u7684\u5185\u5BB9,\u8BF7\u5148\u4FDD\u5B58");return}const f=c.warning({title:"\u8B66\u544A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\u8FD9\u4E9B\u7D20\u6750\u5173\u8054?",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>v(this,null,function*(){f.loading=!0;const g=n?[n.id]:l.checkList;try{const r=yield fe({ids:g.join(","),trainingId:p.id});(r==null?void 0:r.code)===200&&(l.checkList=[],a.success("\u5220\u9664\u6210\u529F"),y())}catch(r){}f.loading=!1})})},h=()=>{const n=l.dataList.find(f=>!f.standards.length);console.log("\u{1F680} ~ isOk",n),n?c.warning({title:"\u8B66\u544A",content:"\u8FD8\u6709\u7D20\u6750\u6CA1\u6709\u8BBE\u7F6E\u8BAD\u7EC3\u6807\u51C6,\u662F\u5426\u8FD4\u56DE?",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>{s.push("/afterClassTrainingManage")}}):s.push("/afterClassTrainingManage")};return()=>e("div",{class:"section-container"},[e(ke,{"on-back":()=>h(),title:p.name},null),e(C,{style:{padding:"15px 0"}},{default:()=>[L(e(S,{type:"primary",onClick:()=>l.visiableKnowledge=!0},{default:()=>[k("\u65B0\u589E\u8BAD\u7EC3\u5185\u5BB9")]}),[[N("auth"),"lessonTrainingDetail/batchInsert1609121819994202113"]]),L(e(S,{type:"error",disabled:!l.checkList.length,onClick:()=>m()},{default:()=>[k("\u6279\u91CF\u5220\u9664")]}),[[N("auth"),"lessonTrainingDetail/remove1608722927511257089"]])]}),e(z,{loading:l.loading,rowKey:n=>n.id,columns:o(),data:l.dataList,onUpdateCheckedRowKeys:n=>{l.checkList=n}},null),e(re,{width:"80vw",show:l.visiableKnowledge,"onUpdate:show":n=>l.visiableKnowledge=n},{default:()=>[e(de,{title:"\u65B0\u589E\u7D20\u6750\u5173\u8054",closable:!0},{default:()=>[e(Se,{parentData:p,onHandleSuccess:()=>{l.visiableKnowledge=!1,y()},onClose:n=>{l.visiableKnowledge=!1}},null)]})]}),e(ce,{show:l.trainModel,"onUpdate:show":n=>l.trainModel=n,preset:"dialog",showIcon:!1,title:"\u8BAD\u7EC3\u6807\u51C6\u8BBE\u7F6E",style:{width:"723px"}},{default:()=>[e(be,{item:l.trainItem,onClose:()=>l.trainModel=!1,onHandleAdd:()=>{l.trainModel=!1,y()}},null)]})])}});export{$e as default};
|