1 |
- import{d as H,ag as D,r as M,$ as I,c as s,aj as Y,F as E,q as m,ai as l,o as c,B as x,P as b,m as f,g as B}from"./index.5f7ffb46.js";import{O as L}from"./index.59b9f984.js";import{O as V}from"./index.7790de2a.js";import{f as _}from"./index.b28db9f5.js";import{v as P}from"./toolsValidate.4388d7ee.js";import{f as r}from"./create.b465b523.js";import{P as S}from"./index.b4d1f58a.js";import{C as k}from"./index.052b3caa.js";import{F as p}from"./index.6438a25f.js";import{C as N}from"./index.abd668f7.js";import{T as A}from"./index.b9737213.js";import"./icon_teacher.df08d662.js";import"./index.9ef28852.js";import"./use-tab-status.69b57a37.js";import"./index.d979c853.js";import"./index.13900508.js";import"./Checker.40bdbb46.js";import"./index.276a5d68.js";import"./index.ab2541bb.js";import"./index.adf0b8fc.js";import"./index.de1f78a6.js";import"./Picker.148c9d83.js";import"./index.6bbd7daa.js";import"./index.99e0cf1f.js";import"./index.61ab9823.js";import"./utils.0f86fc1f.js";const v="_title_wbqc3_1",w="_cellGroup_wbqc3_17",G="_tips_wbqc3_29";var n={title:v,cellGroup:w,tips:G},dt=H({name:"practice-detail",setup(){const T=D(),e=M({selectItem:{},currentTime:[],minHour:0,minMinute:0,maxHour:24,maxMinute:60,firstTime:null,lastTime:null}),g=async()=>{const{data:t}=await f.get("/api-school/sysParamConfig/queryByParamNameList",{params:{paramNames:"course_start_time,course_end_time"}});(t||[]).forEach(o=>{console.log(o.paramValue,"paramValue");const i=l(r.trainStartDate).format("YYYY-MM-DD");if(o.paramName==="course_start_time"){const u=l(i+" "+o.paramValue);e.minHour=Number(u.format("HH")),e.minMinute=Number(u.format("mm")),e.firstTime=u}else if(o.paramName==="course_end_time"){const u=l(i+" "+o.paramValue);e.maxHour=Number(u.format("HH")),e.lastTime=u}})},h=t=>{if(t.columnIndex===1)return;const a=Number(t.selectedValues[0]);a===e.minHour?(e.minMinute=Number(e.firstTime.format("mm")),e.maxMinute=60):a===e.maxHour?(console.log(a,"hour"),e.minMinute=0,e.maxMinute=Number(e.lastTime.format("mm"))):(e.minMinute=0,e.maxMinute=60)},F=t=>{const a=l(l(e.lastTime).format("YYYY-MM-DD")+" "+t.selectedValues.join(":")+":00").add(e.selectItem.trainTimer,"minute");if(a.isAfter(e.lastTime)){c("\u5F00\u59CB\u65F6\u95F4\u8D85\u8FC7\u53EF\u9009\u65F6\u95F4\u8303\u56F4");return}e.selectItem.startTime=l(l(e.lastTime).format("YYYY-MM-DD")+" "+t.selectedValues.join(":")+":00").format("YYYY-MM-DD HH:mm:ss"),e.selectItem.endTime=a.format("YYYY-MM-DD HH:mm:ss"),r.timerStatus=!1},y=()=>{const t=r.classPracticeList;let a=!1,o="";return t.forEach(i=>{console.log(i),!a&&!i.trainTimer&&(a=!0,o="\u8BF7\u8F93\u5165\u8BAD\u7EC3\u65F6\u957F"),!a&&!i.startTime&&(a=!0,o="\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4"),!a&&!i.times&&(a=!0,o="\u8BF7\u8F93\u5165\u8BFE\u65F6\u6570"),!a&&i.classIdList.length<=0&&(a=!0,o="\u8BF7\u9009\u62E9\u8BAD\u7EC3\u73ED\u7EA7")}),a&&c(o),a},C=async()=>{if(!y())try{const t=r.classPracticeList,a=[];t.forEach(u=>{a.push({classGroupIdList:u.classIdList,courseNum:u.times,startTime:l(u.startTime).format("HH:mm:ss"),endTime:l(u.endTime).format("HH:mm:ss"),singleCourseTime:u.trainTimer})});const o={week:r.week,schoolId:B.user.data.school.id,skipHoliday:!!r.skipHoliday,type:"PRACTISE",startDate:l(r.trainStartDate).format("YYYY-MM-DD"),trainingPlanClassList:a};console.log(o);const{data:i}=await f.post("/api-school/orchestra/trainingPlanList",{hideLoading:!1,data:{...o}});r.selectOrchestraId=null,r.selectClassGroupId=null,r.planList={orchestra:[],classes:{},course:{}},console.log(i,"date"),T.push({path:"/course-preview",query:{cacheId:i}})}catch{}},d=t=>t&&t>=1?P(t):"";return I(()=>{g()}),()=>s("div",{class:n.practiceDetail},[s(Y,null,null),r.classPracticeList.map(t=>s(E,null,[s("div",{class:n.title},[s("i",null,null),_[t.classType]]),s(k,{inset:!0,class:n.cellGroup},{default:()=>[s(p,{label:"\u8BAD\u7EC3\u65F6\u957F",placeholder:"\u8BF7\u8F93\u5165\u8BAD\u7EC3\u65F6\u957F",inputAlign:"right",modelValue:t.trainTimer,"onUpdate:modelValue":[a=>t.trainTimer=a,a=>{console.log(a),t.startTime=null}],formatter:d,maxlength:3,type:"tel",center:!0},{extra:()=>s("span",{style:{paddingLeft:"6px"}},[m("\u5206\u949F")])}),s(p,{label:"\u5F00\u59CB\u65F6\u95F4",placeholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4",inputAlign:"right",readonly:!0,isLink:!0,center:!0,modelValue:t.startTime?l(t.startTime).format("HH:mm"):"",onClick:()=>{if(!t.trainTimer){c("\u8BF7\u8F93\u5165\u8BAD\u7EC3\u65F6\u957F");return}e.selectItem=t,r.timerStatus=!0}},null),s(p,{label:"\u8BFE\u65F6\u6570",placeholder:"\u8BF7\u8F93\u5165\u8BFE\u65F6\u6570",inputAlign:"right",modelValue:t.times,"onUpdate:modelValue":a=>t.times=a,formatter:d,maxlength:2,center:!0,type:"tel"},{extra:()=>s("span",{style:{paddingLeft:"6px"}},[m("\u8BFE\u65F6")])}),s(N,{title:"\u8BAD\u7EC3\u73ED\u7EA7",isLink:!0,center:!0,onClick:()=>{e.selectItem=t,r.classStatus=!0}},{value:()=>s("div",{class:n.value},[t.classIdList.length<=0?s("div",{class:n.tips},[m("\u8BF7\u9009\u62E9\u8BAD\u7EC3\u73ED\u7EA7")]):s("div",null,[m("\u5DF2\u9009"),s("span",{style:{padding:"0 4px"}},[t.classIdList.length]),m("\u4E2A\u73ED\u7EA7")])])})]})])),s(V,{position:"bottom"},{default:()=>[s("div",{class:"btnGroup"},[s(x,{type:"primary",block:!0,round:!0,onClick:C},{default:()=>[m("\u4E0B\u4E00\u6B65")]})])]}),s(L,{modelValue:r.classStatus,"onUpdate:modelValue":t=>r.classStatus=t,position:"bottom",style:{background:"#f6f6f6"},destroy:!0},{default:()=>[s(S,{onClose:()=>r.classStatus=!1,classType:e.selectItem.classType,selectItem:e.selectItem.classIdList,onConfirm:t=>{e.selectItem.classIdList=t}},null)]}),s(b,{show:r.timerStatus,"onUpdate:show":t=>r.timerStatus=t,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[s(A,{modelValue:e.currentTime,"onUpdate:modelValue":t=>e.currentTime=t,minHour:e.minHour,minMinute:e.minMinute,maxHour:e.maxHour,maxMinute:e.maxMinute,onChange:h,onCancel:()=>r.timerStatus=!1,onConfirm:t=>F(t)},null)]})])}});export{dt as default};
|