import{O as D}from"./index.120b6f0d.js";import{r as T,d as j,ag as L,$ as A,c as a,aj as I,q as r,B as m,f as C,e as w,P as n,ai as F,a_ as k,m as p,g as E,o as u}from"./index.1c621181.js";import{O as v}from"./index.be2c3766.js";import{O as _}from"./index.b491c24a.js";import{v as x}from"./toolsValidate.4388d7ee.js";import{P as G}from"./index.c82d96b3.js";import{C as V}from"./index.2db9d877.js";import{C as d}from"./index.fd5ae97b.js";import{F as c}from"./index.c7a20c76.js";import{R as O,a as h}from"./index.523820fb.js";import{T as f}from"./index.4e64eb97.js";import{P as B}from"./index.53518914.js";import{D as g}from"./index.d270485b.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.5a8ac45d.js";import"./Picker.9bc4331c.js";import"./index.88a00aa9.js";import"./index.78a302c3.js";import"./index.d5b73933.js";import"./utils.3d9f83cd.js";const t=T({changeType:1,startTimeStatus:!1,startTime:[],endTimeMinDate:new Date,endTimeStatus:!1,endTime:[],adjustDay:null,orchestraStatus:!1,orchestraList:[],orchestraId:null,orchestraName:null,classGroupIdList:[],classStatus:!1}),M="_batchAdjust_1wd6n_1",N="_tips_1wd6n_16",P="_radioSection_1wd6n_19",U="_radioItem_1wd6n_24",R="_adjustDay_1wd6n_35";var i={batchAdjust:M,tips:N,radioSection:P,radioItem:U,adjustDay:R},gt=j({name:"batch-adjust",setup(){const l=L(),o=T({submitLoading:!1,dialogStatus:!1,dialogMessage:""}),y=async()=>{try{const{data:e}=await p.post("/api-school/orchestra/page",{data:{page:1,rows:100,schoolId:E.user.data.school.id,status:"DONE"}});if(t.orchestraList=e.rows||[],t.orchestraList.length>0){const s=t.orchestraList[0];t.orchestraId=s.id,t.orchestraName=s.name}}catch{}},S=async()=>{try{if(t.classGroupIdList.length<=0){u("\u8BF7\u9009\u62E9\u73ED\u7EA7");return}if(!t.startTime.join("-")){u("\u8BF7\u9009\u62E9\u8BFE\u7A0B\u5F00\u59CB\u65E5\u671F");return}if(!t.endTime.join("-")){u("\u8BF7\u9009\u62E9\u8BFE\u7A0B\u7ED3\u675F\u65E5\u671F");return}if(!t.adjustDay){u("\u8BF7\u8F93\u5165\u8C03\u6574\u5929\u6570");return}o.submitLoading=!0;const e=await p.post("/api-school/courseSchedule/batchAdjust",{hideLoading:!0,data:{adjustDay:t.changeType?"-"+t.adjustDay:t.adjustDay,classGroupIdList:t.classGroupIdList,startTime:t.startTime.join("-"),endTime:t.endTime.join("-")}});o.submitLoading=!1,e.code===999?(o.dialogStatus=!0,o.dialogMessage=e.message):l.push({path:"/course-preview",query:{cacheId:e.data}})}catch{o.submitLoading=!1}},b=e=>e&&e>=1?x(e):"";return A(()=>{y()}),()=>a("div",{class:i.batchAdjust},[a(I,null,null),a(V,{inset:!0},{default:()=>[a(d,{isLink:!0,onClick:()=>t.orchestraStatus=!0,valueClass:["van-ellipsis"]},{title:()=>"\u4E50\u56E2\u540D\u79F0",value:()=>t.orchestraName}),a(d,{isLink:!0,onClick:()=>{t.classStatus=!0}},{title:()=>"\u73ED\u7EA7",value:()=>a("div",{class:i.value},[t.classGroupIdList.length<=0?a("div",{class:i.tips},[r("\u8BF7\u9009\u62E9\u73ED\u7EA7")]):a("div",null,[r("\u5DF2\u9009"),a("span",{style:{padding:"0 4px"}},[t.classGroupIdList.length]),r("\u4E2A\u73ED\u7EA7")])])}),a(c,{isLink:!0,label:"\u8BFE\u7A0B\u5F00\u59CB\u65E5\u671F",placeholder:"\u8BF7\u9009\u62E9\u8BFE\u7A0B\u5F00\u59CB\u65E5\u671F",readonly:!0,inputAlign:"right",modelValue:t.startTime.join("-"),onClick:()=>{t.startTimeStatus=!0}},null),a(c,{isLink:!0,label:"\u8BFE\u7A0B\u7ED3\u675F\u65E5\u671F",placeholder:"\u8BF7\u9009\u62E9\u8BFE\u7A0B\u7ED3\u675F\u65E5\u671F",readonly:!0,inputAlign:"right",modelValue:t.endTime.join("-"),onClick:()=>{t.endTimeStatus=!0}},null),a(d,{title:"\u8C03\u6574\u65B9\u5F0F"},{value:()=>a(O,{"checked-color":"#FF8057",modelValue:t.changeType,"onUpdate:modelValue":e=>t.changeType=e,direction:"horizontal"},{default:()=>[a(f,{size:"large",type:"primary",color:t.changeType!==1?"#EAEAEA":"#FF8057",textColor:t.changeType!==1?"#AAA":"#FFF",class:i.radioSection,round:!0},{default:()=>[a(h,{class:i.radioItem,name:1},null),r("\u63D0\u524D")]}),a(f,{size:"large",type:"primary",color:t.changeType!==0?"#EAEAEA":"#FF8057",textColor:t.changeType!==0?"#AAA":"#FFF",class:i.radioSection,round:!0},{default:()=>[a(h,{class:i.radioItem,name:0},null),r("\u5EF6\u540E")]})]})}),a(c,{class:i.adjustDay,label:"\u8C03\u6574\u5929\u6570",inputAlign:"right",type:"number",modelValue:t.adjustDay,"onUpdate:modelValue":e=>t.adjustDay=e,placeholder:"\u8BF7\u8F93\u5165\u8C03\u6574\u5929\u6570",formatter:b},{extra:()=>a("span",{style:{paddingLeft:"6px"}},[r("\u5929")])})]}),a(_,{position:"bottom"},{default:()=>[a("div",{class:["btnGroup btnMore"],style:{marginTop:"20px"}},[a(m,{color:"#ccc",round:!0,onClick:()=>{C().isApp?w({api:"back"}):l.back()}},{default:()=>[r("\u53D6\u6D88")]}),a(m,{color:"#FF8057",round:!0,onClick:S,disabled:o.submitLoading,loading:o.submitLoading},{default:()=>[r("\u4E0B\u4E00\u6B65")]})])]}),a(n,{show:t.orchestraStatus,"onUpdate:show":e=>t.orchestraStatus=e,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[a(B,{columns:t.orchestraList,columnsFieldNames:{text:"name",value:"id"},onCancel:()=>t.orchestraStatus=!1,onConfirm:e=>{const s=e.selectedOptions[0];t.orchestraId!==s.id&&(t.orchestraId=s.id,t.orchestraName=s.name,t.classGroupIdList=[]),t.orchestraStatus=!1}},null)]}),a(v,{modelValue:t.classStatus,"onUpdate:modelValue":e=>t.classStatus=e,position:"bottom",style:{background:"#f6f6f6"},destroy:!0},{default:()=>[a(G,{onClose:()=>t.classStatus=!1,orchestraId:t.orchestraId,selectItem:t.classGroupIdList,onConfirm:e=>{t.classGroupIdList=e}},null)]}),a(n,{show:t.startTimeStatus,"onUpdate:show":e=>t.startTimeStatus=e,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[a(g,{minDate:new Date,formatter:(e,s)=>(e==="year"&&(s.text+="\u5E74"),e==="month"&&(s.text+="\u6708"),e==="day"&&(s.text+="\u65E5"),s),onCancel:()=>t.startTimeStatus=!1,onConfirm:e=>{t.startTime=e.selectedValues,t.startTimeStatus=!1,t.endTime=[],t.endTimeMinDate=F(t.startTime.join("-")||new Date).toDate()}},null)]}),a(n,{show:t.endTimeStatus,"onUpdate:show":e=>t.endTimeStatus=e,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[a(g,{minDate:t.endTimeMinDate,formatter:k,onCancel:()=>t.endTimeStatus=!1,onConfirm:e=>{t.endTime=e.selectedValues,t.endTimeStatus=!1}},null)]}),a(D,{title:"\u63D0\u793A",show:o.dialogStatus,"onUpdate:show":e=>o.dialogStatus=e,message:o.dialogMessage,confirmButtonText:"\u786E\u5B9A",onConfirm:()=>{l.back()}},null)])}});export{gt as default};