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