site-settings-8b473f7b.js 5.5 KB

1
  1. import{M as C}from"./index-9eb775de.js";import{d as g,O as w,o as _,w as P,g as s,R as b,I as y,T as G,P as h,h as d,B as m,f as N,a as p}from"./index-071fe22e.js";import{i as k}from"./icon-music-10132ef5.js";import{i as M}from"./icon-teacher-default-a5bec550.js";import{i as I}from"./icon-edit-9f02937c.js";import{S as T,b as f,a as r}from"./index-ba01ad91.js";import{C as v}from"./index-5ff8e868.js";import{C as n}from"./index-02fc6d53.js";import{M as E}from"./index-627a2934.js";import{L as x}from"./index-378e01f1.js";import{I as O}from"./index-71c05002.js";import{F as B}from"./index-df3b588b.js";import{P as U}from"./index-031935fc.js";import"./use-tab-status-9f8207e0.js";import"./index-119ece69.js";const V="_searchGroup_1gbo4_1",A="_searchItem_1gbo4_5",L="_overhide_1gbo4_32",F="_cellGroup_1gbo4_38",R="_orchestraName_1gbo4_46",W="_iconMusic_1gbo4_53",H="_address_1gbo4_58",$="_iconEdit_1gbo4_67",D="_red_1gbo4_71",j="_iconTeacher_1gbo4_74",q="_username_1gbo4_80",z="_classname_1gbo4_86",J="_popupContainer_1gbo4_92",K="_field_1gbo4_103",a={searchGroup:V,searchItem:A,overhide:L,cellGroup:F,orchestraName:R,iconMusic:W,address:H,iconEdit:$,red:D,iconTeacher:j,username:q,classname:z,popupContainer:J,field:K},Q=g({name:"skeleton-modal",props:{show:{type:Boolean,default:!1},showCount:{type:Array,default:()=>[1,2,3,4,5,6]}},setup(e,{slots:i}){const l=w({loading:!1});return _(()=>{l.loading=e.show}),P(()=>e.show,()=>{l.loading=e.show}),()=>s(T,{loading:l.loading,style:"flex-wrap: wrap"},{template:()=>s("div",{style:{height:"calc(100vh - var(--header-height))",overflow:"hidden",width:"100%"}},[e.showCount.map(()=>s(v,{class:a.cellGroup},{default:()=>[s(n,{center:!0},{icon:()=>s(f,{class:a.iconMusic},null),title:()=>s("div",{style:{display:"flex",justifyContent:"space-between"}},[s(r,{rowWidth:"40%"},null),s(r,{style:{marginTop:0},rowWidth:"40%"},null)])}),s(n,{center:!0,class:a.username},{icon:()=>s(f,{class:a.iconTeacher},null),title:()=>s("div",null,[s(r,{rowWidth:"40%"},null),s(r,{rowWidth:"40%",style:{marginTop:"4px"}},null)])})]}))]),default:()=>i.default&&i.default()})}}),pe=g({name:"site-setting",setup(){const e=w({showPopup:!1,showOrchestraPopup:!1,siteName:"",orchestraName:"全部乐团",orchestraColumns:[{text:"全部乐团",value:""}],listState:{dataShow:!0,loading:!0,finished:!1,refreshing:!1},params:{musicGroupId:null,page:1,rows:20},isClick:!1,list:[],selectSite:{}}),i=t=>{e.selectSite=t,e.siteName=t.teachingPoint,e.showPopup=!0},l=async()=>{try{if(!e.siteName){N("请输入场地名称");return}await p.post("/api-web/classGroup/teachingPoint",{hideLoading:!1,data:{classGroupId:e.selectSite.classGroupId,teachingPoint:e.siteName}}),e.showPopup=!1,e.list=[],u()}catch(t){}},c=async()=>{try{if(e.isClick)return;e.isClick=!0;const{data:t}=await p.post("/api-web/classGroup/teachingPointClass",{data:e.params}),o=t||{};e.listState.refreshing?e.list=o.rows||[]:e.list=e.list.concat(o.rows||[]),e.listState.finished=o.pageNo>=o.totalPage,e.params.page=o.pageNo+1}catch(t){e.listState.finished=!0}finally{e.listState.dataShow=e.list.length>0,e.listState.refreshing=!1,e.listState.loading=!1,e.isClick=!1}},u=()=>{e.params.page=1,c()},S=async()=>{try{const{data:t}=await p.get("/api-web/cooperationOrgan/musicGroupPage");(t||[]).forEach(o=>{e.orchestraColumns.push({text:o.name,value:o.id})})}catch(t){}};return _(()=>{S(),c()}),()=>s("div",{class:a.siteSetting},[s(C,{position:"top"},{default:()=>[s(b,null,null),s("div",{class:a.searchGroup},[s("div",{class:a.searchItem,onClick:()=>e.showOrchestraPopup=!0},[s("span",null,[e.orchestraName])])])]}),s(Q,{show:e.listState.loading,"onUpdate:show":t=>e.listState.loading=t},{default:()=>[s(E,{modelValue:e.listState.refreshing,"onUpdate:modelValue":t=>e.listState.refreshing=t,onRefresh:()=>u(),style:{minHeight:"calc(100vh - var(--header-height))"}},{default:()=>[s(x,{finished:e.listState.finished,finishedText:" ",style:{overflow:"hidden"},onLoad:c,immediateCheck:!1},{default:()=>[e.listState.dataShow?e.list.map(t=>s(v,{class:a.cellGroup,border:!1},{default:()=>[s(n,{border:!1,center:!0},{title:()=>s("div",{class:a.orchestraName},[s("img",{src:k,class:a.iconMusic},null),s("p",{class:a.overhide},[t.musicGroupName])]),default:()=>s("div",{class:a.address,onClick:()=>i(t)},[s("p",{class:[a.overhide,t.teachingPoint?"":a.red]},[t.teachingPoint||"未设置场地"]),s(y,{name:I,class:a.iconEdit},null)])}),s(n,{center:!0,class:a.username},{icon:()=>s(O,{src:t.teacherAvatar||M,class:a.iconTeacher,fit:"cover"},null),title:()=>s("div",null,[s("div",{class:a.classname},[t.classGroupName]),s("div",{class:a.name},[t.teacherName])])})]})):s(G,{style:{minHeight:"calc(100vh - var(--header-height))"},description:"暂无数据"},null)]})]})]}),s(h,{show:e.showPopup,"onUpdate:show":t=>e.showPopup=t,round:!0,onClose:()=>{e.siteName="",e.selectSite={}}},{default:()=>[s("div",{class:a.popupContainer},[s("h2",null,[d("设置场地")]),s(B,{placeholder:"请输入场地名称",modelValue:e.siteName,"onUpdate:modelValue":t=>e.siteName=t,border:!1,class:a.field,maxlength:15},null),s("div",{class:["btnGroupPopup"]},[s(m,{round:!0,onClick:()=>{e.showPopup=!1}},{default:()=>[d("取消")]}),s(m,{type:"primary",round:!0,onClick:l},{default:()=>[d("确定")]})])])]}),s(h,{show:e.showOrchestraPopup,"onUpdate:show":t=>e.showOrchestraPopup=t,round:!0,position:"bottom"},{default:()=>[s(U,{columns:e.orchestraColumns,onCancel:()=>e.showOrchestraPopup=!1,onConfirm:({selectedOptions:t})=>{e.showOrchestraPopup=!1;const o=t[0];e.orchestraName=o.text,e.params.musicGroupId=o.value,e.list=[],e.listState.dataShow=!0,u()}},null)]})])}});export{pe as default};