1 |
- import{r as T,d as D,ag as j,$ as L,c as a,aj as A,q as r,B as m,f as I,e as C,P as n,ai as w,a_ as F,m as p,g as k,o as u}from"./index.332c7f08.js";import{O as E}from"./index.a8f5f4b5.js";import{O as v}from"./index.ed5fc819.js";import{O as _}from"./index.d7c1b6ac.js";import{v as x}from"./toolsValidate.4388d7ee.js";import{P as G}from"./index.ec737d57.js";import{C as V}from"./index.324108a5.js";import{C as d}from"./index.91135ff9.js";import{F as c}from"./index.1ed6273e.js";import{R as O,a as h}from"./index.a4155be3.js";import{T as f}from"./index.98482791.js";import{P as B}from"./index.656e257f.js";import{D as g}from"./index.1361b221.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.5e198b6f.js";import"./Picker.e56f94bd.js";import"./index.7c580591.js";import"./index.1e2dfe6e.js";import"./index.4aa8e076.js";import"./utils.4b86e8c9.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},ft=D({name:"batch-adjust",setup(){const l=j(),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:k.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 L(()=>{y()}),()=>a("div",{class:i.batchAdjust},[a(A,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:()=>{I().isApp?C({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=w(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:F,onCancel:()=>t.endTimeStatus=!1,onConfirm:e=>{t.endTime=e.selectedValues,t.endTimeStatus=!1}},null)]}),a(E,{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};
|