1 |
- import{d as N,ag as P,r as O,R as p,$ as W,m as i,o as c,_ as y,c as e,a5 as d,q as n,P as v,F as G}from"./index.ffe80dbe.js";import{O as E}from"./index.4ddd16f0.js";import{C as L}from"./index.914765a1.js";import{F as h}from"./index.92ec0bf4.js";import{P as g}from"./index.777c6c1a.js";import"./index.ea031708.js";import"./index.466e527a.js";import"./use-tab-status.5a3cd090.js";import"./index.b4b77b5a.js";import"./index.02edecb1.js";const x="_schoolEidtWrap_595gl_1",B="_eidtWrap_595gl_1",b="_orchestraName_595gl_10",k="_wall_595gl_13",F="_bottomWrap_595gl_16",D="_addP_595gl_30",S="_schoolDtailWrap_595gl_35",V="_schoolICon_595gl_42",U="_schoolBtnWrap_595gl_46",q="_upload_595gl_57";var r={schoolEidtWrap:x,eidtWrap:B,orchestraName:b,wall:k,bottomWrap:F,addP:D,schoolDtailWrap:S,schoolICon:V,schoolBtnWrap:U,upload:q},Q=N({name:"unit-create",setup(){const w=P(),o=O({actions:[],classList:[],showPopoverOrchestra:!1,showPopoverClass:!1}),s=p({orchestraId:"",orchestraName:"",classGroupName:"",classGroupId:"",emergencyContact:"",addressLongitudeLatitude:"",unitName:"",unitId:""});p();const u=p(!1),_=()=>{if(!s.value.classGroupId){c("\u8BF7\u9009\u62E9\u6D4B\u9A8C\u73ED\u7EA7");return}sessionStorage.setItem("unit-create",JSON.stringify(s.value)),w.push({path:"/unit-Lesson",query:{classGroupId:s.value.classGroupId}})};W(async()=>{var a,t;if(s.value={...JSON.parse(sessionStorage.getItem("unit-create")||"{}")},f(),(a=s.value)!=null&&a.orchestraId)try{const l=await i.post("/api-teacher/classGroup/page",{data:{page:1,rows:9999,orchestraId:(t=s.value)==null?void 0:t.orchestraId}});o.classList=l.data.rows.map(m=>({name:m.name,value:m.id})),o.classList.length<1&&c("\u5F53\u524D\u4E50\u56E2\u6682\u65E0\u73ED\u7EA7")}catch(l){console.log(l,"cuowu")}});const f=async()=>{try{const a=await i.post("/api-teacher/orchestra/page",{data:{page:1,rows:9999,status:"DONE"}});o.actions=a.data.rows.map(t=>({name:t.name,value:t.id})),y(()=>{u.value=!0})}catch(a){u.value=!0;const t=a.message;c(t)}},C=async a=>{if(console.log(a.selectedOptions),s.value.orchestraId=a.selectedOptions[0].value,s.value.orchestraName=a.selectedOptions[0].name,s.value.classGroupName="",s.value.classGroupId="",a.selectedOptions[0].value)try{const t=await i.post("/api-teacher/classGroup/page",{data:{page:1,rows:9999,orchestraId:a.selectedOptions[0].value}});o.classList=t.data.rows.map(l=>({name:l.name,value:l.id})),o.classList.length<1&&c("\u5F53\u524D\u4E50\u56E2\u6682\u65E0\u73ED\u7EA7")}catch(t){console.log(t,"cuowu")}else o.classList=[];o.showPopoverOrchestra=!1},I=async a=>{s.value.classGroupName=a.selectedOptions[0].name,s.value.classGroupId=a.selectedOptions[0].value,o.showPopoverClass=!1};return()=>e(G,null,[u.value?e("div",{class:r.schoolEidtWrap},[e("div",{class:r.eidtWrap},[e(L,{inset:!0},{default:()=>[e(h,{placeholder:"\u8BF7\u9009\u62E9\u4E50\u56E2",readonly:!0,"input-align":"right",onClick:()=>{o.showPopoverOrchestra=!0}},{extra:()=>e("div",{class:r.loctionIconWrap},[e(d,{name:"arrow",color:"#d8d8d8"},null)]),label:()=>e("p",{class:r.addP},[n("\u9009\u62E9\u4E50\u56E2")]),input:()=>s.value.orchestraName?e("div",{class:[r.orchestraName,"van-ellipsis"]},[s.value.orchestraName]):e("div",{style:{color:"#c8c9cc"}},[n("\u8BF7\u9009\u62E9\u4E50\u56E2")])}),e(h,{rows:3,modelValue:s.value.classGroupName,"onUpdate:modelValue":a=>s.value.classGroupName=a,maxlength:50,placeholder:"\u8BF7\u9009\u62E9\u6D4B\u9A8C\u73ED\u7EA7",readonly:!0,"input-align":"right",onClick:()=>{s.value.orchestraId?o.showPopoverClass=!0:c("\u8BF7\u5148\u9009\u62E9\u4E50\u56E2")}},{extra:()=>e("div",{class:r.loctionIconWrap},[e(d,{name:"arrow",color:"#d8d8d8"},null)]),label:()=>e("p",{class:r.addP},[n("\u6D4B\u9A8C\u73ED\u7EA7")])}),e(h,{rows:3,modelValue:s.value.unitName,"onUpdate:modelValue":a=>s.value.unitName=a,maxlength:50,placeholder:"\u8BF7\u9009\u62E9\u6D4B\u9A8C\u5185\u5BB9",readonly:!0,"input-align":"right",onClick:_},{extra:()=>e("div",{class:r.loctionIconWrap},[e(d,{name:"arrow",color:"#d8d8d8"},null)]),label:()=>e("p",{class:r.addP},[n("\u6D4B\u9A8C\u5185\u5BB9")])})]})]),e(E,{position:"bottom"},null)]):null,e(v,{show:o.showPopoverOrchestra,"onUpdate:show":a=>o.showPopoverOrchestra=a,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[e(g,{columns:o.actions,columnsFieldNames:{text:"name",value:"value"},onCancel:()=>o.showPopoverOrchestra=!1,onConfirm:C},null)]}),e(v,{show:o.showPopoverClass,"onUpdate:show":a=>o.showPopoverClass=a,position:"bottom",round:!0,class:"popupBottomSearch"},{default:()=>[e(g,{columns:o.classList,columnsFieldNames:{text:"name",value:"value"},onCancel:()=>o.showPopoverClass=!1,onConfirm:I},null)]})])}});export{Q as default};
|