index.ee7bcb3d.js 5.9 KB

1
  1. import{d as I,ag as Y,r as C,$ as x,c as s,F as D,q as n,ah as m,o as c,B as b,P as L,m as f,f as V}from"./index.ffe80dbe.js";import{O as _}from"./index.a0ef77e4.js";import{O as E}from"./index.1829b1b7.js";import{O as P}from"./index.4ddd16f0.js";import{f as S}from"./index.931cf0b8.js";import{v as k}from"./toolsValidate.4388d7ee.js";import{f as r}from"./create.790bcfe9.js";import{P as N}from"./index.9b0a949a.js";import{C as v}from"./index.914765a1.js";import{F as p}from"./index.92ec0bf4.js";import{C as w}from"./index.ea031708.js";import{T as F}from"./index.2ca0f455.js";import"./index.1d5c6f70.js";import"./index.339fc024.js";import"./icon_teacher.df08d662.js";import"./index.cafcb8b5.js";import"./use-tab-status.5a3cd090.js";import"./index.f5635935.js";import"./index.34fb3ef2.js";import"./Checker.7cede1aa.js";import"./index.7e972106.js";import"./index.55ba7429.js";import"./index.72ca63b9.js";import"./index.777c6c1a.js";import"./index.466e527a.js";import"./index.b4b77b5a.js";import"./index.02edecb1.js";import"./utils.18cb7a73.js";const A="_title_wbqc3_1",B="_cellGroup_wbqc3_17",G="_tips_wbqc3_29";var u={title:A,cellGroup:B,tips:G},Tt=I({name:"practice-detail",setup(){const T=Y(),e=C({selectItem:{},currentTime:[],minHour:0,minMinute:0,maxHour:24,maxMinute:60,firstTime:null,lastTime:null}),h=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}})},g=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:V.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(()=>{h()}),()=>s("div",{class:u.practiceDetail},[s(_,null,null),r.classPracticeList.map(t=>s(D,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(b,{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(L,{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:g,onCancel:()=>r.timerStatus=!1,onConfirm:t=>y(t)},null)]})])}});export{Tt as default};