1 |
- import{r as T,d as D,ag as b,$ as A,c as a,aj as E,q as r,B as m,f as C,e as j,P as n,ai as L,b2 as I,m as p,g as B,o as i}from"./index.5f7ffb46.js";import{O as w}from"./index.95a99ca5.js";import{O as k}from"./index.59b9f984.js";import{O as v}from"./index.7790de2a.js";import{v as _}from"./toolsValidate.4388d7ee.js";import{P as x}from"./index.b4d1f58a.js";import{C as G}from"./index.052b3caa.js";import{C as d}from"./index.abd668f7.js";import{F as c}from"./index.6438a25f.js";import{R as V,a as h}from"./index.ba71b8ca.js";import{T as f}from"./index.ab2541bb.js";import{P as O}from"./index.de1f78a6.js";import{D as g}from"./index.af85409e.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.adf0b8fc.js";import"./Picker.148c9d83.js";import"./index.6bbd7daa.js";import"./index.99e0cf1f.js";import"./index.61ab9823.js";import"./utils.0f86fc1f.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 u={batchAdjust:M,tips:N,radioSection:P,radioItem:U,adjustDay:R},ft=D({name:"batch-adjust",setup(){const l=b(),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:B.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{}},F=async()=>{try{if(t.classGroupIdList.length<=0){i("\u8BF7\u9009\u62E9\u73ED\u7EA7");return}if(!t.startTime.join("-")){i("\u8BF7\u9009\u62E9\u8BFE\u7A0B\u5F00\u59CB\u65E5\u671F");return}if(!t.endTime.join("-")){i("\u8BF7\u9009\u62E9\u8BFE\u7A0B\u7ED3\u675F\u65E5\u671F");return}if(!t.adjustDay){i("\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}},S=e=>e&&e>=1?_(e):"";return A(()=>{y()}),()=>a("div",{class:u.batchAdjust},[a(E,null,null),a(G,{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:u.value},[t.classGroupIdList.length<=0?a("div",{class:u.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(V,{"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:u.radioSection,round:!0},{default:()=>[a(h,{class:u.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:u.radioSection,round:!0},{default:()=>[a(h,{class:u.radioItem,name:0},null),r("\u5EF6\u540E")]})]})}),a(c,{class:u.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:S},{extra:()=>a("span",{style:{paddingLeft:"6px"}},[r("\u5929")])})]}),a(v,{position:"bottom"},{default:()=>[a("div",{class:["btnGroup btnMore"],style:{marginTop:"20px"}},[a(m,{color:"#ccc",round:!0,onClick:()=>{C().isApp?j({api:"back"}):l.back()}},{default:()=>[r("\u53D6\u6D88")]}),a(m,{color:"#FF8057",round:!0,onClick:F,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(O,{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(k,{modelValue:t.classStatus,"onUpdate:modelValue":e=>t.classStatus=e,position:"bottom",style:{background:"#f6f6f6"},destroy:!0},{default:()=>[a(x,{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=L(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:I,onCancel:()=>t.endTimeStatus=!1,onConfirm:e=>{t.endTime=e.selectedValues,t.endTimeStatus=!1}},null)]}),a(w,{title:"\u63D0\u793A",show:o.dialogStatus,"onUpdate:show":e=>o.dialogStatus=e,message:o.dialogMessage,confirmButtonText:"\u786E\u5B9A",onConfirm:()=>{l.back()}},null)])}});export{ft as default};
|