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