You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
6.6 KiB
1 lines
6.6 KiB
import{d as H,v as J,l as K,r as f,f as M,h as r,c as u,e as t,w as n,a as h,t as p,u as e,i as y,k as o,F as g,O as w,m as V,J as W,B,S as q,E as A,_ as Q,ac as X,G as Y,D as Z,H as ee,K as ae,$ as te,a0 as le,a1 as oe,L as se}from"./index-775ec1fd.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 I}from"./dict-1054bafa.js";import{g as ne,d as re,a as ie}from"./venues-c55e9cb6.js";import{_ as ue}from"./_plugin-vue_export-helper-c27b6911.js";const de={class:"main-container"},pe={class:"flex justify-between items-center"},me={class:"text-lg"},ce={class:"mt-[10px]"},_e={key:0},ve={key:0},be={class:"mt-[16px] flex justify-end"},fe=H({__name:"venues",setup(he){const F=J().meta.title;let l=K({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{campus_id:"",name:"",type:"",capacity:"",available_time:"",status:""}});const E=f();f([]);const x=f([]);(async()=>{x.value=await(await I("cd_type")).data.dictionary})();const P=f([]);(async()=>{P.value=await(await I("cd_status")).data.dictionary})();const _=(d=1)=>{l.loading=!0,l.page=d,ne({page:l.page,limit:l.limit,...l.searchParam}).then(s=>{l.loading=!1,l.data=s.data.data,l.total=s.data.total}).catch(()=>{l.loading=!1})};_();const L=M(),U=()=>{L.push("/venues/venues_edit")},z=d=>{L.push("/venues/venues_edit?id="+d.id)},$=d=>{q.confirm(o("venuesDeleteTips"),o("warning"),{confirmButtonText:o("confirm"),cancelButtonText:o("cancel"),type:"warning"}).then(()=>{re(d).then(()=>{_()}).catch(()=>{})})},D=f([]);(async()=>{D.value=await(await ie({})).data})();const N=d=>{d&&(d.resetFields(),_())};return(d,s)=>{const v=A,b=Q,k=X,m=Y,C=Z,R=ee,T=ae,c=te,S=le,j=oe,O=se;return r(),u("div",de,[t(T,{class:"box-card !border-none",shadow:"never"},{default:n(()=>[h("div",pe,[h("span",me,p(e(F)),1),t(v,{type:"primary",onClick:U},{default:n(()=>[y(p(e(o)("addVenues")),1)]),_:1})]),t(T,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:n(()=>[t(R,{inline:!0,model:e(l).searchParam,ref_key:"searchFormRef",ref:E},{default:n(()=>[t(m,{label:e(o)("campusId"),prop:"campus_id"},{default:n(()=>[t(k,{class:"w-[280px]",modelValue:e(l).searchParam.campus_id,"onUpdate:modelValue":s[0]||(s[0]=a=>e(l).searchParam.campus_id=a),clearable:"",placeholder:e(o)("campusIdPlaceholder")},{default:n(()=>[(r(!0),u(g,null,w(D.value,(a,i)=>(r(),V(b,{key:i,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),t(m,{label:e(o)("name"),prop:"name"},{default:n(()=>[t(C,{modelValue:e(l).searchParam.name,"onUpdate:modelValue":s[1]||(s[1]=a=>e(l).searchParam.name=a),placeholder:e(o)("namePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(m,{label:e(o)("type"),prop:"type"},{default:n(()=>[t(k,{class:"w-[280px]",modelValue:e(l).searchParam.type,"onUpdate:modelValue":s[2]||(s[2]=a=>e(l).searchParam.type=a),clearable:"",placeholder:e(o)("typePlaceholder")},{default:n(()=>[t(b,{label:"全部",value:""}),(r(!0),u(g,null,w(x.value,(a,i)=>(r(),V(b,{key:i,label:a.name,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),t(m,{label:e(o)("capacity"),prop:"capacity"},{default:n(()=>[t(C,{modelValue:e(l).searchParam.capacity,"onUpdate:modelValue":s[3]||(s[3]=a=>e(l).searchParam.capacity=a),placeholder:e(o)("capacityPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(m,{label:e(o)("availableTime"),prop:"available_time"},{default:n(()=>[t(C,{modelValue:e(l).searchParam.available_time,"onUpdate:modelValue":s[4]||(s[4]=a=>e(l).searchParam.available_time=a),placeholder:e(o)("availableTimePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(m,{label:e(o)("status"),prop:"status"},{default:n(()=>[t(k,{class:"w-[280px]",modelValue:e(l).searchParam.status,"onUpdate:modelValue":s[5]||(s[5]=a=>e(l).searchParam.status=a),clearable:"",placeholder:e(o)("statusPlaceholder")},{default:n(()=>[t(b,{label:"全部",value:""}),(r(!0),u(g,null,w(P.value,(a,i)=>(r(),V(b,{key:i,label:a.name,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),t(m,null,{default:n(()=>[t(v,{type:"primary",onClick:s[6]||(s[6]=a=>_())},{default:n(()=>[y(p(e(o)("search")),1)]),_:1}),t(v,{onClick:s[7]||(s[7]=a=>N(E.value))},{default:n(()=>[y(p(e(o)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),h("div",ce,[W((r(),V(S,{data:e(l).data,size:"large"},{empty:n(()=>[h("span",null,p(e(l).loading?"":e(o)("emptyData")),1)]),default:n(()=>[t(c,{prop:"campus_id_name",label:e(o)("campusId"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(c,{prop:"name",label:e(o)("name"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(c,{label:e(o)("type"),"min-width":"180",align:"center","show-overflow-tooltip":!0},{default:n(({row:a})=>[(r(!0),u(g,null,w(x.value,(i,G)=>(r(),u("div",null,[i.value==a.type?(r(),u("div",_e,p(i.name),1)):B("",!0)]))),256))]),_:1},8,["label"]),t(c,{prop:"capacity",label:e(o)("capacity"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(c,{prop:"available_time",label:e(o)("availableTime"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(c,{label:e(o)("status"),"min-width":"180",align:"center","show-overflow-tooltip":!0},{default:n(({row:a})=>[(r(!0),u(g,null,w(P.value,(i,G)=>(r(),u("div",null,[i.value==a.status?(r(),u("div",ve,p(i.name),1)):B("",!0)]))),256))]),_:1},8,["label"]),t(c,{label:e(o)("operation"),fixed:"right","min-width":"120"},{default:n(({row:a})=>[t(v,{type:"primary",link:"",onClick:i=>z(a)},{default:n(()=>[y(p(e(o)("edit")),1)]),_:2},1032,["onClick"]),t(v,{type:"primary",link:"",onClick:i=>$(a.id)},{default:n(()=>[y(p(e(o)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[O,e(l).loading]]),h("div",be,[t(j,{"current-page":e(l).page,"onUpdate:current-page":s[8]||(s[8]=a=>e(l).page=a),"page-size":e(l).limit,"onUpdate:page-size":s[9]||(s[9]=a=>e(l).limit=a),layout:"total, sizes, prev, pager, next, jumper",total:e(l).total,onSizeChange:s[10]||(s[10]=a=>_()),onCurrentChange:_},null,8,["current-page","page-size","total"])])])]),_:1})])}}});const He=ue(fe,[["__scopeId","data-v-bbdbe298"]]);export{He as default};
|
|
|