import{d as S,v as j,l as I,r as w,f as O,h as c,c as f,e as t,w as s,a as b,t as d,u as e,i as v,k as l,F as C,O as k,m as E,J as G,B as H,S as J,E as K,D as M,G as q,_ as A,ac as Q,H as W,K as X,$ as Y,a0 as Z,a1 as ee,L as ae}from"./index-7e4fdde7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css */import{u as te}from"./dict-bea2b24b.js";import{g as le,d as oe}from"./campuses-ee2a1819.js";import{_ as ne}from"./_plugin-vue_export-helper-c27b6911.js";const se={class:"main-container"},re={class:"flex justify-between items-center"},de={class:"text-lg"},ie={class:"mt-[10px]"},pe={key:0},ce={class:"mt-[16px] flex justify-end"},me=S({__name:"campuses",setup(ue){const B=j().meta.title;let a=I({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{name:"",coordinate:"",address:"",contact_person:"",contact_phone:"",status:""}});const P=w();w([]);const g=w([]);(async()=>{g.value=await(await te("is_radio")).data.dictionary})();const m=(r=1)=>{a.loading=!0,a.page=r,le({page:a.page,limit:a.limit,...a.searchParam}).then(n=>{a.loading=!1,a.data=n.data.data,a.total=n.data.total}).catch(()=>{a.loading=!1})};m();const y=O(),D=()=>{y.push("/campuses/campuses_edit")},F=r=>{y.push("/campuses/campuses_edit?id="+r.id)},L=r=>{J.confirm(l("campusesDeleteTips"),l("warning"),{confirmButtonText:l("confirm"),cancelButtonText:l("cancel"),type:"warning"}).then(()=>{oe(r).then(()=>{m()}).catch(()=>{})})},U=r=>{r&&(r.resetFields(),m())};return(r,n)=>{const _=K,h=M,i=q,V=A,T=Q,z=W,x=X,p=Y,$=Z,N=ee,R=ae;return c(),f("div",se,[t(x,{class:"box-card !border-none",shadow:"never"},{default:s(()=>[b("div",re,[b("span",de,d(e(B)),1),t(_,{type:"primary",onClick:D},{default:s(()=>[v(d(e(l)("addCampuses")),1)]),_:1})]),t(x,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:s(()=>[t(z,{inline:!0,model:e(a).searchParam,ref_key:"searchFormRef",ref:P},{default:s(()=>[t(i,{label:e(l)("name"),prop:"name"},{default:s(()=>[t(h,{modelValue:e(a).searchParam.name,"onUpdate:modelValue":n[0]||(n[0]=o=>e(a).searchParam.name=o),placeholder:e(l)("namePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(i,{label:e(l)("coordinate"),prop:"coordinate"},{default:s(()=>[t(h,{modelValue:e(a).searchParam.coordinate,"onUpdate:modelValue":n[1]||(n[1]=o=>e(a).searchParam.coordinate=o),placeholder:e(l)("coordinatePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(i,{label:e(l)("address"),prop:"address"},{default:s(()=>[t(h,{modelValue:e(a).searchParam.address,"onUpdate:modelValue":n[2]||(n[2]=o=>e(a).searchParam.address=o),placeholder:e(l)("addressPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(i,{label:e(l)("contactPerson"),prop:"contact_person"},{default:s(()=>[t(h,{modelValue:e(a).searchParam.contact_person,"onUpdate:modelValue":n[3]||(n[3]=o=>e(a).searchParam.contact_person=o),placeholder:e(l)("contactPersonPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(i,{label:e(l)("contactPhone"),prop:"contact_phone"},{default:s(()=>[t(h,{modelValue:e(a).searchParam.contact_phone,"onUpdate:modelValue":n[4]||(n[4]=o=>e(a).searchParam.contact_phone=o),placeholder:e(l)("contactPhonePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(i,{label:e(l)("status"),prop:"status"},{default:s(()=>[t(T,{class:"w-[280px]",modelValue:e(a).searchParam.status,"onUpdate:modelValue":n[5]||(n[5]=o=>e(a).searchParam.status=o),clearable:"",placeholder:e(l)("statusPlaceholder")},{default:s(()=>[t(V,{label:"全部",value:""}),(c(!0),f(C,null,k(g.value,(o,u)=>(c(),E(V,{key:u,label:o.name,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),t(i,null,{default:s(()=>[t(_,{type:"primary",onClick:n[6]||(n[6]=o=>m())},{default:s(()=>[v(d(e(l)("search")),1)]),_:1}),t(_,{onClick:n[7]||(n[7]=o=>U(P.value))},{default:s(()=>[v(d(e(l)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),b("div",ie,[G((c(),E($,{data:e(a).data,size:"large"},{empty:s(()=>[b("span",null,d(e(a).loading?"":e(l)("emptyData")),1)]),default:s(()=>[t(p,{prop:"name",label:e(l)("name"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(p,{prop:"coordinate",label:e(l)("coordinate"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(p,{prop:"address",label:e(l)("address"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(p,{prop:"contact_person",label:e(l)("contactPerson"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(p,{prop:"contact_phone",label:e(l)("contactPhone"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(p,{label:e(l)("status"),"min-width":"180",align:"center","show-overflow-tooltip":!0},{default:s(({row:o})=>[(c(!0),f(C,null,k(g.value,(u,fe)=>(c(),f("div",null,[u.value==o.status?(c(),f("div",pe,d(u.name),1)):H("",!0)]))),256))]),_:1},8,["label"]),t(p,{label:e(l)("operation"),fixed:"right","min-width":"120"},{default:s(({row:o})=>[t(_,{type:"primary",link:"",onClick:u=>F(o)},{default:s(()=>[v(d(e(l)("edit")),1)]),_:2},1032,["onClick"]),t(_,{type:"primary",link:"",onClick:u=>L(o.id)},{default:s(()=>[v(d(e(l)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[R,e(a).loading]]),b("div",ce,[t(N,{"current-page":e(a).page,"onUpdate:current-page":n[8]||(n[8]=o=>e(a).page=o),"page-size":e(a).limit,"onUpdate:page-size":n[9]||(n[9]=o=>e(a).limit=o),layout:"total, sizes, prev, pager, next, jumper",total:e(a).total,onSizeChange:n[10]||(n[10]=o=>m()),onCurrentChange:m},null,8,["current-page","page-size","total"])])])]),_:1})])}}});const Re=ne(me,[["__scopeId","data-v-65223f25"]]);export{Re as default};