1 |
- import{d as I,ag as Y,r as C,$ as x,c as s,aj as D,F as b,q as n,ai as m,o as c,B as L,P as V,m as f,g as _}from"./index.332c7f08.js";import{O as E}from"./index.ed5fc819.js";import{O as P}from"./index.d7c1b6ac.js";import{f as S}from"./index.b28db9f5.js";import{v as k}from"./toolsValidate.4388d7ee.js";import{f as r}from"./create.c8105ce9.js";import{P as N}from"./index.ec737d57.js";import{C as v}from"./index.324108a5.js";import{F as p}from"./index.1ed6273e.js";import{C as w}from"./index.91135ff9.js";import{T as F}from"./index.165ec231.js";import"./icon_teacher.df08d662.js";import"./index.b186dfda.js";import"./use-tab-status.9d769af8.js";import"./index.4b720f43.js";import"./index.2e331ab5.js";import"./Checker.1af5496e.js";import"./index.96a8db5e.js";import"./index.98482791.js";import"./index.5e198b6f.js";import"./index.656e257f.js";import"./Picker.e56f94bd.js";import"./index.7c580591.js";import"./index.1e2dfe6e.js";import"./index.4aa8e076.js";import"./utils.4b86e8c9.js";const A="_title_wbqc3_1",B="_cellGroup_wbqc3_17",G="_tips_wbqc3_29";var u={title:A,cellGroup:B,tips:G},dt=I({name:"practice-detail",setup(){const T=Y(),e=C({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 l=m(r.trainStartDate).format("YYYY-MM-DD");if(o.paramName==="course_start_time"){const i=m(l+" "+o.paramValue);e.minHour=Number(i.format("HH")),e.minMinute=Number(i.format("mm")),e.firstTime=i}else if(o.paramName==="course_end_time"){const i=m(l+" "+o.paramValue);e.maxHour=Number(i.format("HH")),e.lastTime=i}})},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)},y=t=>{const a=m(m(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=m(m(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},H=()=>{const t=r.classPracticeList;let a=!1,o="";return t.forEach(l=>{console.log(l),!a&&!l.trainTimer&&(a=!0,o="\u8BF7\u8F93\u5165\u8BAD\u7EC3\u65F6\u957F"),!a&&!l.startTime&&(a=!0,o="\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4"),!a&&!l.times&&(a=!0,o="\u8BF7\u8F93\u5165\u8BFE\u65F6\u6570"),!a&&l.classIdList.length<=0&&(a=!0,o="\u8BF7\u9009\u62E9\u8BAD\u7EC3\u73ED\u7EA7")}),a&&c(o),a},M=async()=>{if(!H())try{const t=r.classPracticeList,a=[];t.forEach(i=>{a.push({classGroupIdList:i.classIdList,courseNum:i.times,startTime:m(i.startTime).format("HH:mm:ss"),endTime:m(i.endTime).format("HH:mm:ss"),singleCourseTime:i.trainTimer})});const o={week:r.week,schoolId:_.user.data.school.id,skipHoliday:!!r.skipHoliday,type:"PRACTISE",startDate:m(r.trainStartDate).format("YYYY-MM-DD"),trainingPlanClassList:a};console.log(o);const{data:l}=await f.post("/api-school/orchestra/trainingPlanList",{hideLoading:!1,data:{...o}});r.selectOrchestraId=null,r.selectClassGroupId=null,r.planList={orchestra:[],classes:{},course:{}},console.log(l,"date"),T.push({path:"/course-preview",query:{cacheId:l}})}catch{}},d=t=>t&&t>=1?k(t):"";return x(()=>{g()}),()=>s("div",{class:u.practiceDetail},[s(D,null,null),r.classPracticeList.map(t=>s(b,null,[s("div",{class:u.title},[s("i",null,null),S[t.classType]]),s(v,{inset:!0,class:u.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"}},[n("\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?m(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"}},[n("\u8BFE\u65F6")])}),s(w,{title:"\u8BAD\u7EC3\u73ED\u7EA7",isLink:!0,center:!0,onClick:()=>{e.selectItem=t,r.classStatus=!0}},{value:()=>s("div",{class:u.value},[t.classIdList.length<=0?s("div",{class:u.tips},[n("\u8BF7\u9009\u62E9\u8BAD\u7EC3\u73ED\u7EA7")]):s("div",null,[n("\u5DF2\u9009"),s("span",{style:{padding:"0 4px"}},[t.classIdList.length]),n("\u4E2A\u73ED\u7EA7")])])})]})])),s(P,{position:"bottom"},{default:()=>[s("div",{class:"btnGroup"},[s(L,{type:"primary",block:!0,round:!0,onClick:M},{default:()=>[n("\u4E0B\u4E00\u6B65")]})])]}),s(E,{modelValue:r.classStatus,"onUpdate:modelValue":t=>r.classStatus=t,position:"bottom",style:{background:"#f6f6f6"},destroy:!0},{default:()=>[s(N,{onClose:()=>r.classStatus=!1,classType:e.selectItem.classType,selectItem:e.selectItem.classIdList,onConfirm:t=>{e.selectItem.classIdList=t}},null)]}),s(V,{show:r.timerStatus,"onUpdate:show":t=>r.timerStatus=t,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[s(F,{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=>y(t)},null)]})])}});export{dt as default};
|