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
7.0 KiB
1 lines
7.0 KiB
import{d as R,v as B,l as F,r as b,h as v,c as N,e as l,w as n,a as h,t as p,u as e,i as f,k as o,J as z,m as $,M as S,E as L,D as j,G as I,H as M,K as G,O as H,P as J,Q as K,L as O}from"./index-f5d841af.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{_ as Q,g as q,d as A}from"./course-edit.vue_vue_type_style_index_0_lang-84b3a5a6.js";import{_ as W}from"./_plugin-vue_export-helper-c27b6911.js";/* empty css *//* empty css */const X={class:"main-container"},Y={class:"flex justify-between items-center"},Z={class:"text-lg"},ee={class:"mt-[10px]"},le={class:"mt-[16px] flex justify-end"},oe=R({__name:"course",setup(ae){const P=B().meta.title;let a=F({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{course_name:"",course_type:"",duration:"",session_count:"",single_session_count:"",price:"",internal_reminder:"",customer_reminder:"",remarks:""}});const g=b();b([]);const m=(d=1)=>{a.loading=!0,a.page=d,q({page:a.page,limit:a.limit,...a.searchParam}).then(t=>{a.loading=!1,a.data=t.data.data,a.total=t.data.total}).catch(()=>{a.loading=!1})};m();const c=b(null),V=()=>{c.value.setFormData(),c.value.showDialog=!0},y=d=>{c.value.setFormData(d),c.value.showDialog=!0},C=d=>{S.confirm(o("courseDeleteTips"),o("warning"),{confirmButtonText:o("confirm"),cancelButtonText:o("cancel"),type:"warning"}).then(()=>{A(d).then(()=>{m()}).catch(()=>{})})},k=d=>{d&&(d.resetFields(),m())};return(d,t)=>{const _=L,u=j,s=I,x=M,w=G,i=H,E=J,D=K,U=O;return v(),N("div",X,[l(w,{class:"box-card !border-none",shadow:"never"},{default:n(()=>[h("div",Y,[h("span",Z,p(e(P)),1),l(_,{type:"primary",onClick:V},{default:n(()=>[f(p(e(o)("addCourse")),1)]),_:1})]),l(w,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:n(()=>[l(x,{inline:!0,model:e(a).searchParam,ref_key:"searchFormRef",ref:g},{default:n(()=>[l(s,{label:e(o)("courseName"),prop:"course_name"},{default:n(()=>[l(u,{modelValue:e(a).searchParam.course_name,"onUpdate:modelValue":t[0]||(t[0]=r=>e(a).searchParam.course_name=r),placeholder:e(o)("courseNamePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(s,{label:e(o)("courseType"),prop:"course_type"},{default:n(()=>[l(u,{modelValue:e(a).searchParam.course_type,"onUpdate:modelValue":t[1]||(t[1]=r=>e(a).searchParam.course_type=r),placeholder:e(o)("courseTypePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(s,{label:e(o)("duration"),prop:"duration"},{default:n(()=>[l(u,{modelValue:e(a).searchParam.duration,"onUpdate:modelValue":t[2]||(t[2]=r=>e(a).searchParam.duration=r),placeholder:e(o)("durationPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(s,{label:e(o)("sessionCount"),prop:"session_count"},{default:n(()=>[l(u,{modelValue:e(a).searchParam.session_count,"onUpdate:modelValue":t[3]||(t[3]=r=>e(a).searchParam.session_count=r),placeholder:e(o)("sessionCountPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(s,{label:e(o)("singleSessionCount"),prop:"single_session_count"},{default:n(()=>[l(u,{modelValue:e(a).searchParam.single_session_count,"onUpdate:modelValue":t[4]||(t[4]=r=>e(a).searchParam.single_session_count=r),placeholder:e(o)("singleSessionCountPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(s,{label:e(o)("price"),prop:"price"},{default:n(()=>[l(u,{modelValue:e(a).searchParam.price,"onUpdate:modelValue":t[5]||(t[5]=r=>e(a).searchParam.price=r),placeholder:e(o)("pricePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(s,{label:e(o)("internalReminder"),prop:"internal_reminder"},{default:n(()=>[l(u,{modelValue:e(a).searchParam.internal_reminder,"onUpdate:modelValue":t[6]||(t[6]=r=>e(a).searchParam.internal_reminder=r),placeholder:e(o)("internalReminderPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(s,{label:e(o)("customerReminder"),prop:"customer_reminder"},{default:n(()=>[l(u,{modelValue:e(a).searchParam.customer_reminder,"onUpdate:modelValue":t[7]||(t[7]=r=>e(a).searchParam.customer_reminder=r),placeholder:e(o)("customerReminderPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(s,{label:e(o)("remarks"),prop:"remarks"},{default:n(()=>[l(u,{modelValue:e(a).searchParam.remarks,"onUpdate:modelValue":t[8]||(t[8]=r=>e(a).searchParam.remarks=r),placeholder:e(o)("remarksPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),l(s,null,{default:n(()=>[l(_,{type:"primary",onClick:t[9]||(t[9]=r=>m())},{default:n(()=>[f(p(e(o)("search")),1)]),_:1}),l(_,{onClick:t[10]||(t[10]=r=>k(g.value))},{default:n(()=>[f(p(e(o)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),h("div",ee,[z((v(),$(E,{data:e(a).data,size:"large"},{empty:n(()=>[h("span",null,p(e(a).loading?"":e(o)("emptyData")),1)]),default:n(()=>[l(i,{prop:"course_name",label:e(o)("courseName"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"course_type",label:e(o)("courseType"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"duration",label:e(o)("duration"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"session_count",label:e(o)("sessionCount"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"single_session_count",label:e(o)("singleSessionCount"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"price",label:e(o)("price"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"internal_reminder",label:e(o)("internalReminder"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"customer_reminder",label:e(o)("customerReminder"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{prop:"remarks",label:e(o)("remarks"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),l(i,{label:e(o)("operation"),fixed:"right","min-width":"120"},{default:n(({row:r})=>[l(_,{type:"primary",link:"",onClick:T=>y(r)},{default:n(()=>[f(p(e(o)("edit")),1)]),_:2},1032,["onClick"]),l(_,{type:"primary",link:"",onClick:T=>C(r.id)},{default:n(()=>[f(p(e(o)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[U,e(a).loading]]),h("div",le,[l(D,{"current-page":e(a).page,"onUpdate:current-page":t[11]||(t[11]=r=>e(a).page=r),"page-size":e(a).limit,"onUpdate:page-size":t[12]||(t[12]=r=>e(a).limit=r),layout:"total, sizes, prev, pager, next, jumper",total:e(a).total,onSizeChange:t[13]||(t[13]=r=>m()),onCurrentChange:m},null,8,["current-page","page-size","total"])])]),l(Q,{ref_key:"editCourseDialog",ref:c,onComplete:m},null,512)]),_:1})])}}});const xe=W(oe,[["__scopeId","data-v-f3a5cc1b"]]);export{xe as default};
|
|
|