1 |
- var me=Object.defineProperty,ye=Object.defineProperties;var he=Object.getOwnPropertyDescriptors;var R=Object.getOwnPropertySymbols;var ne=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var le=(o,f,s)=>f in o?me(o,f,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[f]=s,F=(o,f)=>{for(var s in f||(f={}))ne.call(f,s)&&le(o,s,f[s]);if(R)for(var s of R(f))oe.call(f,s)&&le(o,s,f[s]);return o},S=(o,f)=>ye(o,he(f));var H=(o,f)=>{var s={};for(var r in o)ne.call(o,r)&&f.indexOf(r)<0&&(s[r]=o[r]);if(o!=null&&R)for(var r of R(o))f.indexOf(r)<0&&oe.call(o,r)&&(s[r]=o[r]);return s};var L=(o,f,s)=>new Promise((r,l)=>{var w=n=>{try{d(s.next(n))}catch(h){l(h)}},i=n=>{try{d(s.throw(n))}catch(h){l(h)}},d=n=>n.done?r(n.value):Promise.resolve(n.value).then(w,i);d((s=s.apply(o,f)).next())});import{d as N,f as G,g as $,o as Y,u as K,e as M,a as I,B,i as e,a9 as x,_,p as y,k as p,cg as V,ao as A,ai as pe,aa as P,c as W,r as q,l as T,cf as ge,F as we,dk as Q,q as X,ce as J,di as Ce,ac as ve,aj as se,ad as re,dv as ie,a0 as z,N as ke,at as Te,dm as be,bn as Ee,M as Le,dw as xe,W as ue,d7 as De,d8 as de}from"./index.fd264fea.js";import{E as Ie,F as _e,G as Fe,H as Ne,I as Ue,n as Se,J as qe,K as Be,u as Ae,L as ce,M as Me,N as Pe,O as Ke,P as Oe,Q as Re,R as je,S as Ve,T as He}from"./api.fe2aadc7.js";import{P as Z}from"./index.c2964e13.js";import{S as fe}from"./index.e6fc9d6c.js";import{g as ze,f as Ge}from"./dateUtil.134dfe1f.js";import{g as $e,l as Ye}from"./knowledgeTypeData.3b15dd0b.js";import{T as We}from"./index.6a3b15c1.js";import{D as Qe}from"./DeleteFilled.986af0ae.js";import{U as Xe}from"./index.e4e636de.js";import{u as Je}from"./tabsView.32a1a432.js";import{N as Ze}from"./PageHeader.d177eb6d.js";import"./searchs.b637f0d6.js";import"./dayjs.min.bd923176.js";const ea={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},aa=$("path",{d:"M880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32zm-622.3-84c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 0 0 0-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 0 0 9.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9z",fill:"currentColor"},null,-1),ta=[aa],la=N({name:"EditFilled",render:function(f,s){return Y(),G("svg",ea,ta)}}),na={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},oa=$("path",{d:"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM540 701v53c0 4.4-3.6 8-8 8h-40c-4.4 0-8-3.6-8-8v-53a48.01 48.01 0 1 1 56 0zm152-237H332V240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224z",fill:"currentColor"},null,-1),sa=[oa],ra=N({name:"LockFilled",render:function(f,s){return Y(),G("svg",na,sa)}}),ia={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},ua=$("path",{d:"M832 464H332V240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v68c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-68c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM540 701v53c0 4.4-3.6 8-8 8h-40c-4.4 0-8-3.6-8-8v-53a48.01 48.01 0 1 1 56 0z",fill:"currentColor"},null,-1),da=[ua],ca=N({name:"UnlockFilled",render:function(f,s){return Y(),G("svg",ia,da)}}),pa="_createWrap_17l09_1",ga="_createCourseware_17l09_4",fa="_courseConfiguration_17l09_8",ma="_title_17l09_11",j={createWrap:pa,createCourseware:ga,courseConfiguration:fa,title:ma},ya=N({name:"AddseKnowledge",emits:["close","handleSuccess"],props:{item:{type:Object,default:()=>{}},courseTypeCode:{type:String,default:""}},setup(o,{emit:f}){const s=K();M();const r=I({pagination:{page:1,rows:10,pageTotal:0},searchForm:{lessonCoursewareDetailId:"",keyword:""},loading:!1,dataList:[],checkList:[],addLoading:!1}),l=()=>[{type:"selection",disabled(d){return d.totalMaterialNum<=0}},{title:"\u77E5\u8BC6\u70B9\u540D\u79F0",key:"name"},{title:"\u8BFE\u7A0B\u7C7B\u578B",key:"courseTypeName",width:200,ellipsis:!0,render(d){return e(A,{placement:"top-start"},{default:()=>d.courseTypeName,trigger:()=>d.courseTypeName})}},{title:"\u7D20\u6750\u6570\u91CF",key:"totalMaterialNum"},{title:"\u5EFA\u8BAE\u5B66\u4E60\u65F6\u957F",key:"totalMaterialTimeSecond",render(d){return d.totalMaterialTimeSecond+"s"}}],w=()=>L(this,null,function*(){r.loading=!0;try{const{data:d}=yield Ie(S(F({},r.searchForm),{lessonCoursewareDetailId:o.item.id,courseTypeCode:o.courseTypeCode,page:r.pagination.page,rows:r.pagination.rows}));Array.isArray(d==null?void 0:d.rows)&&(r.dataList=d.rows,r.pagination.pageTotal=d.total)}catch(d){}r.loading=!1});B(()=>{w()});const i=()=>L(this,null,function*(){r.addLoading=!0;const d=yield _e({id:o.item.id,knowledgePointIds:r.checkList.join(",")});(d==null?void 0:d.code)===200&&(s.success("\u4FDD\u5B58\u6210\u529F"),f("handleSuccess")),r.addLoading=!1});return()=>e("div",null,[e(x,{style:{paddingBottom:"12px"}},{default:()=>[e(_,{placeholder:"\u77E5\u8BC6\u70B9\u540D\u79F0",value:r.searchForm.keyword,"onUpdate:value":d=>r.searchForm.keyword=d},null),e(y,{type:"primary",onClick:()=>{r.pagination.page=1,w()}},{default:()=>[p("\u641C\u7D22")]}),e(y,{onClick:()=>{r.searchForm.keyword=""}},{default:()=>[p("\u91CD\u7F6E")]})]}),e(V,{loading:r.loading,rowKey:d=>d.id,columns:l(),data:r.dataList,onUpdateCheckedRowKeys:(d,n)=>{let h=[];n.forEach(D=>{D.children&&D.children.length>0||h.push(D.id)}),r.checkList=h}},null),e(Z,{page:r.pagination.page,"onUpdate:page":d=>r.pagination.page=d,pageSize:r.pagination.rows,"onUpdate:pageSize":d=>r.pagination.rows=d,pageTotal:r.pagination.pageTotal,"onUpdate:pageTotal":d=>r.pagination.pageTotal=d,onList:w,sync:!0},null),e(x,{justify:"end",style:{paddingTop:"12px"}},{default:()=>[e(y,{onClick:()=>f("close")},{default:()=>[p("\u53D6\u6D88")]}),e(y,{type:"primary",disabled:!r.checkList.length,loading:r.addLoading,onClick:()=>i()},{default:()=>[p("\u786E\u8BA4")]})]})])}}),ha=N({name:"CourseKnowledgePoint",props:{item:{type:Object,default:()=>{}},courseTypeCode:{type:String,default:""}},emits:["handleSuccess"],setup(o,{emit:f}){const s=K(),r=pe();M();const l=I({pagination:{page:1,rows:1e3,pageTotal:0},searchForm:{keyword:"",knowledgePointId:""},loading:!1,dataList:[],checkList:[],visiableKnowledge:!1}),w=[{type:"selection"},{title:"\u77E5\u8BC6\u70B9\u540D\u79F0",key:"name"},{title:"\u8BFE\u7A0B\u7C7B\u578B",key:"courseTypeName",width:200,ellipsis:!0,render(t){return e(A,{placement:"top-start"},{default:()=>t.courseTypeName,trigger:()=>t.courseTypeName})}},{title:"\u7D20\u6750\u6570\u91CF",key:"totalMaterialNum"},{title:"\u5EFA\u8BAE\u5B66\u4E60\u65F6\u957F",key:"totalMaterialTimeSecond",render(t){return t.totalMaterialTimeSecond+"s"}},{title:"\u64CD\u4F5C",key:"operation",fixed:"right",render(t,c){return e(x,null,{default:()=>[e(y,{text:!0,type:"primary",disabled:t.relOrder===1,onClick:()=>h("up",t)},{default:()=>[p("\u4E0A\u79FB")]}),e(y,{text:!0,type:"primary",disabled:n(t),onClick:()=>h("down",t)},{default:()=>[p("\u4E0B\u79FB")]})]})}}],i=()=>L(this,null,function*(){var t;l.loading=!0;try{const{data:c}=yield Fe(S(F({},l.searchForm),{lessonCoursewareDetailId:(t=o.item)==null?void 0:t.id,page:l.pagination.page,rows:l.pagination.rows}));Array.isArray(c==null?void 0:c.rows)&&(l.dataList=c.rows.map((u,m)=>S(F({},u),{relOrder:m+1,parentId:0})),l.dataList.forEach(u=>{u.children&&u.children.length>0&&u.children.forEach((m,C)=>{m.relOrder=C+1,m.parentId=u.id})}),console.log(l.dataList,"dataList"))}catch(c){}l.loading=!1});B(()=>{i()});const d=()=>{const t=r.warning({title:"\u8B66\u544A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\u77E5\u8BC6\u70B9\u5173\u8054?",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>L(this,null,function*(){var c;t.loading=!0,console.log(o.item);try{const u=yield Ne({id:(c=o.item)==null?void 0:c.id,knowledgePointIds:l.checkList.join(",")});s.success("\u5220\u9664\u6210\u529F"),l.checkList=[],i(),f("handleSuccess")}catch(u){}t.loading=!1})})},n=t=>{const c=l.dataList||[];if(t.parentId>0){const u=c.find(m=>m.id===t.parentId);return t.relOrder===u.children.length}else return t.relOrder===c.length},h=(t,c)=>{if(l.loading)return;const u=c.relOrder-1;c.parentId>0?l.dataList:l.dataList.find(v=>v.id===c.parentId),t==="up"?c.parentId<=0?l.dataList[u]=l.dataList.splice(u-1,1,l.dataList[u])[0]:l.dataList.forEach(v=>{v.id===c.parentId&&(v.children[u]=v.children.splice(u-1,1,v.children[u])[0])}):c.parentId<=0?l.dataList[u]=l.dataList.splice(u+1,1,l.dataList[u])[0]:l.dataList.forEach(v=>{v.id===c.parentId&&(v.children[u]=v.children.splice(u+1,1,v.children[u])[0])});const m=[];let C=0;l.dataList.forEach((v,g)=>{v.relOrder=g+1,v.children&&v.children.length>0?v.children.forEach((b,a)=>{b.relOrder=a+1,b.parentId=v.id,C=C+1,m.push({sortNo:C,id:b.id})}):(C=C+1,m.push({sortNo:C,id:v.id}))}),console.log(m),D(m)},D=t=>L(this,null,function*(){try{yield Ue(t)}catch(c){}});return()=>e("div",null,[e(x,{style:{paddingBottom:"12px"}},{default:()=>[e(y,{type:"primary",onClick:()=>l.visiableKnowledge=!0},{default:()=>[p("\u5173\u8054\u77E5\u8BC6\u70B9")]}),e(y,{type:"error",disabled:!l.checkList.length,onClick:()=>d()},{default:()=>[p("\u6279\u91CF\u5220\u9664")]})]}),e(x,{style:{paddingBottom:"12px"}},{default:()=>[e(_,{placeholder:"\u77E5\u8BC6\u70B9\u540D\u79F0",value:l.searchForm.keyword,"onUpdate:value":t=>l.searchForm.keyword=t},null),e(y,{type:"primary",onClick:()=>{l.pagination.page=1,i()}},{default:()=>[p("\u641C\u7D22")]}),e(y,{onClick:()=>{l.searchForm.keyword="",l.pagination.page=1,i()}},{default:()=>[p("\u91CD\u7F6E")]})]}),e(V,{loading:l.loading,rowKey:t=>t.id,columns:w,"onUpdate:columns":t=>w=t,data:l.dataList,onUpdateCheckedRowKeys:(t,c)=>{let u=[];c.forEach(m=>{m.children&&m.children.length>0||u.push(m.id)}),l.checkList=u}},null),e(P,{preset:"dialog",show:l.visiableKnowledge,"onUpdate:show":t=>l.visiableKnowledge=t,title:"\u6DFB\u52A0\u77E5\u8BC6\u70B9",showIcon:!1,style:{width:"1000px"}},{default:()=>[e(ya,{courseTypeCode:o.courseTypeCode,item:o.item,onClose:()=>{l.visiableKnowledge=!1},onHandleSuccess:()=>{l.visiableKnowledge=!1,i(),f("handleSuccess")}},null)]})])}}),wa=N({name:"after-class-training-manage",emits:["handleSuccess"],props:{courseTypeCode:{type:String,default:""}},setup(o,{emit:f}){W();const s=I({loading:!1,pagination:{page:1,rows:10,pageTotal:0},dataList:[]}),r=I({keyword:"",time:null,operatorId:null}),l=()=>L(this,null,function*(){try{s.loading=!0;const t=r,{time:c}=t,u=H(t,["time"]),{data:m}=yield Se(S(F(F({},u),ze(r.time,["startUpdateTime","endUpdateTime"])),{enableFlag:!0,courseType:o.courseTypeCode,page:s.pagination.page,rows:s.pagination.rows}));s.loading=!1,s.pagination.pageTotal=Number(m.total),s.dataList=m.rows||[]}catch(c){s.loading=!1}});B(()=>{l()});const w=t=>{f("handleSuccess",t)},i=()=>[{title:"\u8BAD\u7EC3\u540D\u79F0",key:"name",fixed:"left"},{title:"\u7F16\u53F7",key:"id"},{title:"\u8BFE\u7A0B\u7C7B\u578B",key:"courseTypeName",width:200,ellipsis:!0,render(t){return e(A,{placement:"top-start"},{default:()=>t.courseTypeName,trigger:()=>t.courseTypeName})}},{title:"\u8BAD\u7EC3\u6761\u6570",key:"trainingNum"},{title:"\u66F4\u65B0\u65F6\u95F4",key:"updateTime"},{title:"\u66F4\u65B0\u4EBA",key:"operatorName"},{title:"\u64CD\u4F5C",key:"operation",fixed:"right",render(t){return e(x,null,{default:()=>[e(y,{type:"primary",size:"small",text:!0,onClick:()=>w(t)},{default:()=>[p("\u6DFB\u52A0")]})]})}}],d=q(),n=()=>{s.pagination.page=1,l()},h=()=>{var t;(t=d.value)==null||t.submit()},D=()=>{var t;(t=d.value)==null||t.reset()};return()=>e("div",null,[e(fe,{ref:d,model:r,onSubmit:n,onSetModel:t=>Object.assign(r,t),saveKey:"selectAfterClassTraining-key"},{default:()=>[e(T,{path:"search"},{default:()=>[e(_,{value:r.keyword,"onUpdate:value":t=>r.keyword=t,placeholder:"\u8BAD\u7EC3\u540D\u79F0/\u7F16\u53F7",clearable:!0},null)]}),e(T,{path:"time"},{default:()=>[e(ge,{"value-format":"yyyy-MM-dd HH:mm:dd",value:r.time,"onUpdate:value":t=>r.time=t,type:"daterange",clearable:!0},null)]}),e(T,null,{default:()=>[e(x,null,{default:()=>[e(y,{type:"primary",onClick:h},{default:()=>[p("\u641C\u7D22")]}),e(y,{type:"default",onClick:D},{default:()=>[p("\u91CD\u7F6E")]})]})]})]}),e(V,{scrollX:1300,loading:s.loading,columns:i(),data:s.dataList,childrenKey:"children","default-expand-all":!1,"row-key":t=>t.id},null),e(Z,{saveKey:"selectAfterClassTraining-key",page:s.pagination.page,"onUpdate:page":t=>s.pagination.page=t,pageSize:s.pagination.rows,"onUpdate:pageSize":t=>s.pagination.rows=t,pageTotal:s.pagination.pageTotal,"onUpdate:pageTotal":t=>s.pagination.pageTotal=t,onList:l,sync:!0},null)])}}),Ca=N({name:"AddUnitTest",props:{courseTypeCode:{type:String,default:""},list:{type:Array,default:()=>[]},item:{type:Object,default:()=>{}}},emits:["close"],setup(o,{emit:f}){const s=K(),l=M().query,w=q(!1),i=q(),d=we(()=>o.list.map(a=>({label:a.name,value:a.id}))),n=I({id:null,name:"",desc:"",lessonCoursewareId:l.id,parentCoursewareDetailId:null,details:[{level:1,unitExaminationId:"",unitExaminationName:"",lessonCoursewareExaminationMapperId:""},{level:2,unitExaminationId:"",unitExaminationName:"",lessonCoursewareExaminationMapperId:""},{level:3,unitExaminationId:"",unitExaminationName:"",lessonCoursewareExaminationMapperId:""}]}),h={name:[{required:!0,message:"\u8BF7\u586B\u5199\u6D4B\u9A8C\u540D\u79F0",trigger:["blur","change"]}],desc:[{required:!0,message:"\u8BF7\u586B\u5199\u6D4B\u9A8C\u63CF\u8FF0",trigger:["blur","change"]}],parentCoursewareDetailId:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E0A\u4E00\u8282\u8BFE\u7A0B",trigger:["blur","change"]}]},D=()=>L(this,null,function*(){if(!!o.item.id){w.value=!0;try{const a=yield qe(o.item.id);(a==null?void 0:a.code)==200&&Object.keys(n).map(k=>{if(k=="details")for(let E=0;E<n.details.length;E++)a.data.details[E]&&(n.details[E]=a.data.details[E]);else n[k]=a.data[k]})}catch(a){}w.value=!1}}),t=()=>{i.value.validate(a=>L(this,null,function*(){if(!a){const k=F({},n);console.log("\u{1F680} ~ body",k);try{(yield Be(k)).code==200&&(s.success("\u4FDD\u5B58\u6210\u529F"),f("close",!0))}catch(E){}}}))},c=I({open:!1,active:0}),u=I({pagination:{page:1,rows:10,total:0},loading:!1,active:"",list:[]}),m=q(),C=I({time:null,keyword:null,courseTypeCode:o.courseTypeCode}),v=()=>L(this,null,function*(){var k;u.loading=!0;try{const a=C,{time:E}=a,O=H(a,["time"]),U=yield Ae(S(F(F({page:u.pagination.page,rows:u.pagination.rows,enableFlag:!0},O),Ge(E,["updateStartTime","updateEndTime"])),{courseTypeCode:o.courseTypeCode}));Array.isArray((k=U==null?void 0:U.data)==null?void 0:k.rows)&&(u.list=U.data.rows,u.pagination.total=U.data.total)}catch(E){}u.loading=!1}),g=()=>{u.pagination.page=1,v()};B(()=>{D(),v()});const b=()=>[{title:"\u6D4B\u9A8C\u540D\u79F0",key:"name",width:230,render(a){return e("div",null,[e("div",null,[a.name]),e("div",null,[p("\u7F16\u53F7:"),a.id])])}},{title:"\u8BFE\u7A0B\u7C7B\u578B",key:"courseTypeCode",render(a){return $e(a.courseTypeCode)}},{title:"\u6D4B\u9A8C\u65F6\u957F",key:"timeMinutes",render(a){return a.timeMinutes+"\u5206\u949F"}},{title:"\u66F4\u65B0\u65F6\u95F4",key:"updateTime"},{title:"\u66F4\u65B0\u4EBA",key:"operatorName"},{title:"\u64CD\u4F5C",key:"action",render(a){return e(y,{text:!0,type:"primary",onClick:()=>{n.details[c.active].unitExaminationName=a.name,n.details[c.active].unitExaminationId=a.id,c.open=!1}},{default:()=>[p("\u9009\u62E9")]})}}];return()=>e("div",null,[e(Q,{show:w.value},{default:()=>[e(X,{ref:i,model:n,rules:h},{default:()=>[e(T,{label:"\u6D4B\u9A8C\u540D\u79F0",path:"name",required:!0},{default:()=>[e(_,{value:n.name,"onUpdate:value":a=>n.name=a},null)]}),e(T,{label:"\u6D4B\u9A8C\u63CF\u8FF0",path:"desc",required:!0},{default:()=>[e(_,{type:"textarea",rows:3,maxlength:100,showCount:!0,value:n.desc,"onUpdate:value":a=>n.desc=a},null)]}),e(T,{label:"\u6D4B\u9A8C\u8BFE\u7A0B",path:"parentCoursewareDetailId",required:!0},{default:()=>[e(J,{options:d.value,value:n.parentCoursewareDetailId,"onUpdate:value":a=>n.parentCoursewareDetailId=a},null)]}),e(T,{label:"\u5355\u56E2\u5B66\u751F\u9636\u6BB5\u81EA\u6D4B",path:"details[0].unitExaminationId",required:!0,rule:{required:!0,message:"\u8BF7\u9009\u62E9\u5355\u56E2\u9636\u6BB5\u81EA\u6D4B",trigger:["blur","blur"]}},{default:()=>[e(_,{placeholder:"\u8BF7\u9009\u62E9\u9636\u6BB5\u81EA\u6D4B",readonly:!0,onClick:()=>{c.open=!0,c.active=0},value:n.details[0].unitExaminationName,"onUpdate:value":a=>n.details[0].unitExaminationName=a},null)]}),e(T,{label:"\u53CC\u56E2\u5B66\u751F\u9636\u6BB5\u81EA\u6D4B",path:"details[1].unitExaminationId",required:!0,rule:{required:!0,message:"\u8BF7\u9009\u62E9\u53CC\u56E2\u9636\u6BB5\u81EA\u6D4B",trigger:["blur","blur"]}},{default:()=>[e(_,{placeholder:"\u8BF7\u9009\u62E9\u9636\u6BB5\u81EA\u6D4B",readonly:!0,onClick:()=>{c.open=!0,c.active=1},value:n.details[1].unitExaminationName,"onUpdate:value":a=>n.details[1].unitExaminationName=a},null)]}),e(T,{label:"\u591A\u56E2\u5B66\u751F\u9636\u6BB5\u81EA\u6D4B",path:"details[2].unitExaminationId",required:!0,rule:{required:!0,message:"\u8BF7\u9009\u62E9\u591A\u56E2\u9636\u6BB5\u81EA\u6D4B",trigger:["blur","blur"]}},{default:()=>[e(_,{placeholder:"\u8BF7\u9009\u62E9\u9636\u6BB5\u81EA\u6D4B",readonly:!0,onClick:()=>{c.open=!0,c.active=2},value:n.details[2].unitExaminationName,"onUpdate:value":a=>n.details[2].unitExaminationName=a},null)]}),e(x,{justify:"end"},{default:()=>[e(y,{onClick:()=>f("close")},{default:()=>[p("\u53D6\u6D88")]}),e(y,{type:"primary",onClick:t},{default:()=>[p("\u4FDD\u5B58")]})]})]})]}),e(P,{showIcon:!1,title:"\u9009\u62E9\u9636\u6BB5\u81EA\u6D4B",preset:"dialog",style:{width:"80vw"},show:c.open,"onUpdate:show":a=>c.open=a},{default:()=>[e(fe,{style:{padding:0},ref:m,"label-width":"",model:C,onSubmit:g,onSetModel:a=>Object.assign(C,a),saveKey:"AddUnitTest-key"},{default:()=>[e(x,null,{default:()=>[e(T,{path:"keyword",label:"\u5173\u952E\u5B57"},{default:()=>[e(_,{placeholder:"\u8BF7\u8F93\u5165\u7F16\u53F7/\u6D4B\u9A8C\u540D\u79F0",value:C.keyword,"onUpdate:value":a=>C.keyword=a,onKeydown:a=>{a.code==="Enter"&&g()},clearable:!0},null)]}),e(T,{path:"time",label:"\u65F6\u95F4"},{default:()=>[e(ge,{value:C.time,"onUpdate:value":a=>C.time=a,type:"daterange",clearable:!0},null)]}),e(T,null,{default:()=>[e(x,null,{default:()=>[e(y,{type:"primary",onClick:()=>{var a;return(a=m.value)==null?void 0:a.submit()}},{default:()=>[p("\u641C\u7D22")]}),e(y,{type:"default",onClick:()=>{var a;return(a=m.value)==null?void 0:a.reset()}},{default:()=>[p("\u91CD\u7F6E")]})]})]})]})]}),e(V,{scrollX:800,maxHeight:"500px",loading:u.loading,columns:b(),data:u.list,"row-key":a=>a.categoryId},null),e(x,{style:{padding:"10px 0"},justify:"space-between",align:"center",wrapItem:!1},{default:()=>[e(Z,{style:{margin:0},page:u.pagination.page,"onUpdate:page":a=>u.pagination.page=a,pageSize:u.pagination.rows,"onUpdate:pageSize":a=>u.pagination.rows=a,pageTotal:u.pagination.total,"onUpdate:pageTotal":a=>u.pagination.total=a,onList:v,sync:!0,saveKey:"AddUnitTest-key"},null)]})]})])}});function va(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!Ee(o)}const ka=N({name:"courseConfiguration",props:{course:{type:Object,default:()=>{}}},setup(o,f){const s=K(),r=pe(),l=M(),w=q(),i=I({open:!1,id:"",name:"",lessonTargetDesc:"",lessonTrainingId:"",lockEnable:"true"}),d=()=>{w.value.validate(g=>L(this,null,function*(){if(!g){const b={lessonCoursewareId:l.query.id,name:i.name,lessonTargetDesc:i.lessonTargetDesc,lockEnable:i.lockEnable};let a;if(i.id)try{a=yield ce(S(F({},b),{id:i.id}))}catch(k){}else try{a=yield Me(b)}catch(k){}(a==null?void 0:a.code)==200&&(s.success("\u4FDD\u5B58\u6210\u529F"),i.open=!1,h())}}))},n=I({dataList:[],mapperList:[]}),h=()=>L(this,null,function*(){try{const{data:g}=yield Pe({lessonCoursewareId:l.query.id,page:1,rows:1e3});Array.isArray(g==null?void 0:g.rows)&&(n.dataList=g.rows)}catch(g){}}),D=()=>L(this,null,function*(){try{const{data:g}=yield Ke(l.query.id);Array.isArray(g)&&(n.mapperList=g)}catch(g){}});B(()=>{h(),D()});const t=g=>{const b=r.warning({title:"\u8B66\u544A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\u6B64\u8BFE\u65F6?",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>L(this,null,function*(){b.loading=!0;try{const a=yield Oe(g.id);(a==null?void 0:a.code)==200&&(s.success("\u5220\u9664\u6210\u529F"),h())}catch(a){}b.loading=!1})})},c=I({open:!1,id:""}),u=g=>L(this,null,function*(){console.log("\u{1F680} ~ row",g);const b={id:i.id,lessonTrainingId:g.id,name:i.name,lessonTargetDesc:i.lessonTargetDesc};try{const a=yield ce(b);(a==null?void 0:a.code)==200&&(s.success("\u4FDD\u5B58\u6210\u529F"),c.open=!1,h())}catch(a){}}),m=I({open:!1,title:"",item:null}),C=I({open:!1,model:{}}),v=g=>{const b=r.warning({title:"\u8B66\u544A",content:`\u662F\u5426\u786E\u8BA4${g.lockFlag?"\u89E3\u9501":"\u9501\u5B9A"}\u6B64\u8BFE\u65F6?`,positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>L(this,null,function*(){b.loading=!0;try{const a=yield Re({id:g.id,lockFlag:!g.lockFlag});s.success("\u64CD\u4F5C\u6210\u529F"),h()}catch(a){}b.loading=!1})})};return()=>{var b;let g;return e("div",{class:j.courseConfiguration},[e(x,null,{default:()=>[e(y,{disabled:!!l.query.isLook,type:"primary",onClick:()=>{i.name="",i.lessonTargetDesc="",i.lessonTrainingId="",i.id="",i.lockEnable="",i.open=!0}},{default:()=>[p("\u6DFB\u52A0\u8BFE\u7A0B")]}),e(y,{type:"primary",disabled:!!l.query.isLook,onClick:()=>{C.open=!0,C.model={}}},{default:()=>[p("\u6DFB\u52A0\u9636\u6BB5\u81EA\u6D4B")]})]}),e(Ce,{class:j.title,title:"\u6559\u5B66\u5185\u5BB9"},null),e(ve,{xGap:12,yGap:8,cols:3},va(g=n.dataList.map(a=>{const k=n.mapperList.find(E=>E.parentCoursewareDetailId==a.id);return e(se,null,[e(re,null,{default:()=>[e(ie,{title:a.name,style:{"--n-padding-top":"5px","--n-padding-bottom":"5px",height:"100%"}},{default:()=>{var E;return e("div",null,[e("div",{style:{paddingBottom:"12px"}},[a.lessonTargetDesc]),e("table",{style:{width:"100%"}},[e("tr",null,[e("td",null,[p("\u5EFA\u8BAE\u5B66\u4E60\u65F6\u957F")]),e("td",{style:{"text-align":"right"}},[a.lessonDurationSecond||"0",p("s")])]),e("tr",null,[e("td",null,[p("\u77E5\u8BC6\u70B9")]),e("td",{style:{"text-align":"right"}},[((E=a.knowledgePointIds)==null?void 0:E.split(",").filter(Boolean).length)||0,p("\u4E2A")])]),e("tr",null,[e("td",null,[p("\u8BFE\u540E\u4F5C\u4E1A")]),e("td",{style:{"text-align":"right"}},[a.lessonTrainingId?e(We,{to:{path:"/afterClassTrainingManage",query:{id:a.lessonTrainingId}}},{default:()=>[a.lessonTrainingName]}):"\u65E0"])])])])},"header-extra":()=>e(se,null,[e(A,null,{default:()=>a.lockFlag?"\u89E3\u9501":"\u9501\u5B9A",trigger:()=>e(y,{disabled:!!l.query.isLook,quaternary:!0,circle:!0,onClick:()=>v(a)},{default:()=>[e(z,{component:a.lockFlag?e(ra,null,null):e(ca,null,null)},null)]})}),e(A,null,{default:()=>"\u7F16\u8F91",trigger:()=>e(y,{disabled:!!l.query.isLook,quaternary:!0,circle:!0,onClick:()=>{i.name=a.name,i.lessonTargetDesc=a.lessonTargetDesc,i.id=a.id,i.lockEnable=a.lockEnable+"",i.open=!0}},{default:()=>[e(z,{component:e(la,null,null)},null)]})}),e(A,null,{default:()=>"\u5220\u9664",trigger:()=>e(y,{disabled:!!l.query.isLook,quaternary:!0,circle:!0,onClick:()=>t(a)},{default:()=>[e(z,{component:e(Qe,null,null)},null)]})})]),action:()=>e(x,{justify:"space-around"},{default:()=>[e(y,{text:!0,disabled:!!l.query.isLook,onClick:()=>{m.title=a.name,m.open=!0,m.item=a}},{default:()=>[p("\u9009\u62E9\u77E5\u8BC6\u70B9")]}),e(y,{text:!0,disabled:!!l.query.isLook,onClick:()=>{i.id=a.id,i.lessonTargetDesc=a.lessonTargetDesc,i.name=a.name,c.open=!0}},{default:()=>[p("\u9009\u62E9\u8BFE\u540E\u4F5C\u4E1A")]})]})})]}),k&&e(re,null,{default:()=>[e(ie,{title:k.name,style:{"--n-padding-top":"5px","--n-padding-bottom":"5px","--n-color":"rgba(238,243,254,1)","--n-action-color":"rgba(238,243,254,1)",height:"100%"}},{default:()=>{var E,O,U,ee,ae,te;return e("div",null,[e("div",{style:{paddingBottom:"12px"}},[k.desc]),e("table",{style:{width:"100%"}},[e("tr",null,[e("td",null,[p("\u5355\u56E2\u5B66\u751F")]),e("td",{style:{"text-align":"right"}},[((O=(E=k==null?void 0:k.details)==null?void 0:E[0])==null?void 0:O.unitExaminationName)||"\u65E0"])]),e("tr",null,[e("td",null,[p("\u53CC\u56E2\u5B66\u751F")]),e("td",{style:{"text-align":"right"}},[((ee=(U=k==null?void 0:k.details)==null?void 0:U[1])==null?void 0:ee.unitExaminationName)||"\u65E0"])]),e("tr",null,[e("td",null,[p("\u591A\u56E2\u5B66\u751F")]),e("td",{style:{"text-align":"right"}},[((te=(ae=k==null?void 0:k.details)==null?void 0:ae[2])==null?void 0:te.unitExaminationName)||"\u65E0"])])])])},action:()=>e(x,{justify:"space-around"},{default:()=>[e(y,{text:!0,disabled:!!l.query.isLook,onClick:()=>{C.open=!0,C.model=k}},{default:()=>[p("\u7F16\u8F91\u9636\u6BB5\u81EA\u6D4B")]})]})})]})])}))?g:{default:()=>[g]}),n.dataList.length?null:e(ke,null,null),e(P,{preset:"dialog",show:i.open,"onUpdate:show":a=>i.open=a,title:i.id?"\u7F16\u8F91\u8BFE\u7A0B":"\u6DFB\u52A0\u8BFE\u7A0B",showIcon:!1},{default:()=>[e(X,{ref:w,model:i},{default:()=>[e(T,{label:"\u8BFE\u7A0B\u540D\u79F0",required:!0,path:"name",rule:[{required:!0,message:"\u8BF7\u586B\u5199\u8BFE\u7A0B\u540D\u79F0",trigger:["blur","change"]}]},{default:()=>[e(_,{value:i.name,"onUpdate:value":a=>i.name=a},null)]}),e(T,{label:"\u662F\u5426\u9700\u8981\u89E3\u9501",required:!0,path:"lockEnable",rule:[{required:!0,message:"\u8BF7\u9009\u62E9\u662F\u5426\u89E3\u9501",trigger:["blur","change"]}]},{default:()=>[e(J,{value:i.lockEnable,"onUpdate:value":a=>i.lockEnable=a,options:[{label:"\u662F",value:"true"},{label:"\u5426",value:"false"}],clearable:!0},null)]}),e(T,{label:"\u6559\u5B66\u76EE\u6807",required:!0,path:"lessonTargetDesc",rule:[{required:!0,message:"\u8BF7\u586B\u5199\u6559\u5B66\u76EE\u6807",trigger:["blur","change"]}]},{default:()=>[e(_,{type:"textarea",rows:3,value:i.lessonTargetDesc,"onUpdate:value":a=>i.lessonTargetDesc=a,maxlength:500,showCount:!0},null)]}),e(x,{justify:"end"},{default:()=>[e(y,{onClick:()=>i.open=!1},{default:()=>[p("\u53D6\u6D88")]}),e(y,{type:"primary",onClick:()=>d()},{default:()=>[p("\u786E\u8BA4")]})]})]})]}),e(P,{preset:"dialog",show:c.open,"onUpdate:show":a=>c.open=a,title:"\u9009\u62E9\u8BFE\u540E\u4F5C\u4E1A",showIcon:!1,style:{width:"80vw"}},{default:()=>{var a;return[e(wa,{courseTypeCode:(a=o.course)==null?void 0:a.courseTypeCode,onHandleSuccess:u},null)]}}),e(Te,{show:m.open,"onUpdate:show":a=>m.open=a,width:"80vw"},{default:()=>[e(be,{title:m.title,closable:!0},{default:()=>{var a;return e(ha,{courseTypeCode:(a=o.course)==null?void 0:a.courseTypeCode,item:m.item,onHandleSuccess:()=>{h()}},null)},footer:()=>e(x,null,{default:()=>[e(y,{onClick:()=>m.open=!1},{default:()=>[p("\u53D6\u6D88")]}),e(y,{type:"primary",onClick:()=>m.open=!1},{default:()=>[p("\u786E\u8BA4")]})]})})]}),e(P,{preset:"dialog",show:C.open,"onUpdate:show":a=>C.open=a,title:(b=C.model)!=null&&b.id?"\u7F16\u8F91\u9636\u6BB5\u81EA\u6D4B":"\u65B0\u589E\u9636\u6BB5\u81EA\u6D4B",showIcon:!1,style:{width:"500px"}},{default:()=>{var a;return[e(Ca,{courseTypeCode:(a=o.course)==null?void 0:a.courseTypeCode,list:n.dataList,item:C.model,onClose:k=>{k&&(h(),D()),C.open=!1}},null)]}})])}}}),Ta=N({name:"createCourseware",emits:["next"],props:{course:{type:Object,default:()=>{}}},setup(o,{emit:f}){const s=K(),r=M(),l=W(),w=r.query,i=q(!1),d=q(),n=I({coverImg:"",orchestraType:"SINGLE_DELIVERY",lessonTargetDesc:"",name:"",courseTypeCode:""}),h={coverImg:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u8BFE\u4EF6\u5C01\u9762",trigger:["blur","change"]}],lessonTargetDesc:[{required:!0,message:"\u8BF7\u586B\u5199\u8BFE\u4EF6\u76EE\u6807",trigger:["blur","change"]}],name:[{required:!0,message:"\u8BF7\u586B\u5199\u8BFE\u4EF6\u540D\u79F0",trigger:["blur","change"]}],courseTypeCode:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B\u7C7B\u578B",trigger:["blur","change"]}]};B(()=>{o.course&&(n.coverImg=o.course.coverImg,n.orchestraType=o.course.orchestraType,n.lessonTargetDesc=o.course.lessonTargetDesc,n.name=o.course.name,n.courseTypeCode=o.course.courseTypeCode,n.enableFlag=o.course.enableFlag),console.log("\u{1F680} ~ props",o.course)}),Le(()=>n.coverImg,(t,c)=>{d.value.validate()});const D=t=>{d.value.validate(c=>L(this,null,function*(){var u,m;if(console.log(c),!c){const C=F({},n);let v="";if(w.id){v=C.id=w.id;try{(yield je(C)).code===200&&s.success("\u4FDD\u5B58\u6210\u529F"),t&&f("next")}catch(g){}}else try{const g=yield Ve(C);(u=g==null?void 0:g.data)!=null&&u.id&&(s.success("\u4FDD\u5B58\u6210\u529F"),v=(m=g==null?void 0:g.data)==null?void 0:m.id,l.push({path:"coursewareDetail",query:{id:v}}))}catch(g){}}}))};return()=>e("div",{class:j.createCourseware},[e(Q,{show:i.value,"onUpdate:show":t=>i.value=t},{default:()=>[e(X,{ref:d,model:n,rules:h,disabled:!!w.isLook},{default:()=>[e(T,{label:"\u8BFE\u4EF6\u540D\u79F0",path:"name",required:!0},{default:()=>[e(_,{value:n.name,"onUpdate:value":t=>n.name=t},null)]}),e(T,{label:"\u4E50\u56E2\u7C7B\u578B",path:"orchestraType",required:!0},{default:()=>[e(x,null,{default:()=>[e(y,{disabled:!!w.isLook,type:n.orchestraType=="SINGLE_DELIVERY"?"primary":"default",onClick:()=>n.orchestraType="SINGLE_DELIVERY"},{default:()=>[p("\u5355\u4EA4\u4ED8\u56E2")]}),e(y,{disabled:!!w.isLook,type:n.orchestraType=="MULTIPLE_DELIVERY"?"primary":"default",onClick:()=>n.orchestraType="MULTIPLE_DELIVERY"},{default:()=>[p("\u591A\u4EA4\u4ED8\u5E38\u89C4\u56E2")]}),e(y,{disabled:!!w.isLook,type:n.orchestraType=="MULTIPLE_DELIVERY_SCHOOL"?"primary":"default",onClick:()=>n.orchestraType="MULTIPLE_DELIVERY_SCHOOL"},{default:()=>[p("\u591A\u4EA4\u4ED8\u6821\u56E2")]})]})]}),e(T,{label:"\u8BFE\u7A0B\u7C7B\u578B",path:"courseTypeCode",required:!0},{default:()=>[e(J,{disabled:!!r.query.id,placeholder:"\u8BFE\u7A0B\u7C7B\u578B",clearable:!0,value:n.courseTypeCode,"onUpdate:value":t=>n.courseTypeCode=t,options:Ye},null)]}),e(T,{label:"\u6559\u5B66\u76EE\u6807",path:"lessonTargetDesc",required:!0},{default:()=>[e(_,{type:"textarea",rows:4,maxlength:500,value:n.lessonTargetDesc,"onUpdate:value":t=>n.lessonTargetDesc=t,showCount:!0},null)]}),e(T,{label:"\u6559\u6750\u5C01\u9762",path:"coverImg",required:!0},{default:()=>[e(Xe,{disabled:!!w.isLook,path:"courseware/",fileList:n.coverImg,"onUpdate:fileList":t=>n.coverImg=t},null)]}),e(x,null,{default:()=>[e(y,{disabled:!!w.isLook,type:"primary",onClick:()=>D()},{default:()=>[p("\u4FDD \u5B58")]}),w.id&&e(y,{onClick:()=>{D("next")}},{default:()=>[p("\u4E0B\u4E00\u6B65")]})]})]})]})])}}),Ma=N({name:"courseware-detail",setup(o,f){const s=M(),r=W(),l=I({loading:!0,current:1,course:null}),w=h=>{l.current=h},i=Je(),d=()=>{i.closeCurrentTab(s),r.push({path:"/coursewareManage"})},n=()=>L(this,null,function*(){if(!s.query.id){l.loading=!1;return}w(2),l.loading=!0;try{const{data:h}=yield He(s.query.id);l.course=h}catch(h){}l.loading=!1});return B(()=>{n()}),()=>e("div",{class:"system-menu-container"},[e(Ze,{"on-back":()=>d(),title:l.course?l.course.name:"\u65B0\u5EFA\u8BFE\u4EF6"},null),e("div",{class:["section-container"]},[e("div",null,[e(xe,{current:l.current,onUpdateCurrent:w},{default:()=>[e(ue("n-step"),{title:"\u57FA\u7840\u4FE1\u606F",description:"\u57FA\u7840\u4FE1\u606F\u8BBE\u7F6E"},null),e(ue("n-step"),{title:"\u8BFE\u7A0B\u914D\u7F6E",description:"\u8BFE\u4EF6\u53CA\u8BAD\u7EC3\u3001\u6D4B\u9A8C\u914D\u7F6E",disabled:!s.query.id},null)]}),e(Q,{show:l.loading,"onUpdate:show":h=>l.loading=h},{default:()=>[e(De,{class:j.createWrap,type:"line",value:l.current,"onUpdate:value":h=>l.current=h},{default:()=>[e(de,{name:1},{default:()=>[!l.loading&&e(Ta,{course:l.course,onNext:()=>{n(),w(2)}},null)]}),e(de,{name:2},{default:()=>[!l.loading&&e(ka,{course:l.course},null)]})]})]})])])])}});export{Ma as default};
|