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.0 KiB
1 lines
6.0 KiB
import{d as M,v as N,l as R,r as b,f as j,h as c,c as g,e as l,w as r,a as h,t as d,u as e,i as p,k as t,F as I,O as D,m as v,J as O,S as W,E as G,_ as H,ac as J,G as K,bg as q,H as A,K as Q,$ as X,a0 as Z,a1 as ee,L as te}from"./index-b867c57c.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 *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";import{g as ae,d as le,a as oe,b as se}from"./schedules-a417684e.js";import{_ as re}from"./_plugin-vue_export-helper-c27b6911.js";const ne={class:"main-container"},ie={class:"flex justify-between items-center"},de={class:"text-lg"},pe={class:"mt-[10px]"},me={class:"mt-[16px] flex justify-end"},ce=M({__name:"schedules",setup(ue){const L=N().meta.title;let o=R({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{staff_id:"",class_id:"",date_time:[],task:"",create_time:[]}});const w=b();b([]);const m=(n=1)=>{o.loading=!0,o.page=n,ae({page:o.page,limit:o.limit,...o.searchParam}).then(s=>{o.loading=!1,o.data=s.data.data,o.total=s.data.total}).catch(()=>{o.loading=!1})};m();const y=j(),S=()=>{y.push("/schedules/schedules_edit")},T=n=>{y.push("/schedules/schedules_edit?id="+n.id)},B=n=>{W.confirm(t("schedulesDeleteTips"),t("warning"),{confirmButtonText:t("confirm"),cancelButtonText:t("cancel"),type:"warning"}).then(()=>{le(n).then(()=>{m()}).catch(()=>{})})},k=b([]);(async()=>{k.value=await(await oe({})).data})();const x=b([]);(async()=>{x.value=await(await se({})).data})();const F=n=>{n&&(n.resetFields(),m())};return(n,s)=>{const u=G,C=H,E=J,_=K,P=q,Y=A,V=Q,i=X,z=Z,U=ee,$=te;return c(),g("div",ne,[l(V,{class:"box-card !border-none",shadow:"never"},{default:r(()=>[h("div",ie,[h("span",de,d(e(L)),1),l(u,{type:"primary",onClick:S},{default:r(()=>[p(d(e(t)("addSchedules")),1)]),_:1})]),l(V,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:r(()=>[l(Y,{inline:!0,model:e(o).searchParam,ref_key:"searchFormRef",ref:w},{default:r(()=>[l(_,{label:e(t)("staffId"),prop:"staff_id"},{default:r(()=>[l(E,{class:"w-[280px]",modelValue:e(o).searchParam.staff_id,"onUpdate:modelValue":s[0]||(s[0]=a=>e(o).searchParam.staff_id=a),clearable:"",placeholder:e(t)("staffIdPlaceholder")},{default:r(()=>[(c(!0),g(I,null,D(k.value,(a,f)=>(c(),v(C,{key:f,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),l(_,{label:e(t)("classId"),prop:"class_id"},{default:r(()=>[l(E,{class:"w-[280px]",modelValue:e(o).searchParam.class_id,"onUpdate:modelValue":s[1]||(s[1]=a=>e(o).searchParam.class_id=a),clearable:"",placeholder:e(t)("classIdPlaceholder")},{default:r(()=>[(c(!0),g(I,null,D(x.value,(a,f)=>(c(),v(C,{key:f,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),l(_,{label:e(t)("dateTime"),prop:"date_time"},{default:r(()=>[l(P,{modelValue:e(o).searchParam.date_time,"onUpdate:modelValue":s[2]||(s[2]=a=>e(o).searchParam.date_time=a),type:"datetimerange",format:"YYYY-MM-DD hh:mm:ss","start-placeholder":e(t)("startDate"),"end-placeholder":e(t)("endDate")},null,8,["modelValue","start-placeholder","end-placeholder"])]),_:1},8,["label"]),l(_,{label:e(t)("createTime"),prop:"create_time"},{default:r(()=>[l(P,{modelValue:e(o).searchParam.create_time,"onUpdate:modelValue":s[3]||(s[3]=a=>e(o).searchParam.create_time=a),type:"datetimerange",format:"YYYY-MM-DD hh:mm:ss","start-placeholder":e(t)("startDate"),"end-placeholder":e(t)("endDate")},null,8,["modelValue","start-placeholder","end-placeholder"])]),_:1},8,["label"]),l(_,null,{default:r(()=>[l(u,{type:"primary",onClick:s[4]||(s[4]=a=>m())},{default:r(()=>[p(d(e(t)("search")),1)]),_:1}),l(u,{onClick:s[5]||(s[5]=a=>F(w.value))},{default:r(()=>[p(d(e(t)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),h("div",pe,[O((c(),v(z,{data:e(o).data,size:"large"},{empty:r(()=>[h("span",null,d(e(o).loading?"":e(t)("emptyData")),1)]),default:r(()=>[l(i,{prop:"id",label:e(t)("id"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"staff_id_name",label:e(t)("staffId"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"class_id_name",label:e(t)("classId"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"date_time",label:e(t)("dateTime"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"time_slot",label:e(t)("timeSlot"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"task",label:e(t)("task"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{label:e(t)("createTime"),"min-width":"180",align:"center","show-overflow-tooltip":!0},{default:r(({row:a})=>[p(d(a.create_time||""),1)]),_:1},8,["label"]),l(i,{label:e(t)("updateTime"),"min-width":"180",align:"center","show-overflow-tooltip":!0},{default:r(({row:a})=>[p(d(a.update_time||""),1)]),_:1},8,["label"]),l(i,{label:e(t)("operation"),fixed:"right","min-width":"120"},{default:r(({row:a})=>[l(u,{type:"primary",link:"",onClick:f=>T(a)},{default:r(()=>[p(d(e(t)("edit")),1)]),_:2},1032,["onClick"]),l(u,{type:"primary",link:"",onClick:f=>B(a.id)},{default:r(()=>[p(d(e(t)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[$,e(o).loading]]),h("div",me,[l(U,{"current-page":e(o).page,"onUpdate:current-page":s[6]||(s[6]=a=>e(o).page=a),"page-size":e(o).limit,"onUpdate:page-size":s[7]||(s[7]=a=>e(o).limit=a),layout:"total, sizes, prev, pager, next, jumper",total:e(o).total,onSizeChange:s[8]||(s[8]=a=>m()),onCurrentChange:m},null,8,["current-page","page-size","total"])])])]),_:1})])}}});const Ue=re(ce,[["__scopeId","data-v-97157373"]]);export{Ue as default};
|
|
|