index.40265597.js 5.8 KB

1
  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.1c621181.js";import{O as E}from"./index.be2c3766.js";import{O as P}from"./index.b491c24a.js";import{f as S}from"./index.38b203e1.js";import{v as k}from"./toolsValidate.4388d7ee.js";import{f as r}from"./create.fa5d31e5.js";import{P as N}from"./index.c82d96b3.js";import{C as v}from"./index.2db9d877.js";import{F as p}from"./index.c7a20c76.js";import{C as w}from"./index.fd5ae97b.js";import{T as F}from"./index.c4f0d694.js";import"./index.339fc024.js";import"./icon_teacher.df08d662.js";import"./index.d5ee0b18.js";import"./use-tab-status.40058c51.js";import"./index.9813a8ae.js";import"./index.3e68170a.js";import"./Checker.6bb59ec3.js";import"./index.4c221cbe.js";import"./index.4e64eb97.js";import"./index.5a8ac45d.js";import"./index.53518914.js";import"./Picker.9bc4331c.js";import"./index.88a00aa9.js";import"./index.78a302c3.js";import"./index.d5b73933.js";import"./utils.3d9f83cd.js";const A="_title_wbqc3_1",B="_cellGroup_wbqc3_17",G="_tips_wbqc3_29";var u={title:A,cellGroup:B,tips:G},ft=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{ft as default};