Agriculture-front-end/dist/assets/index.fc928b50.js

2 lines
7.5 KiB
JavaScript

import{Q as e,G as l,r as a,I as t,U as o,d as s,T as u,o as n,c as d,K as p,M as r,f as i,e as m,w as c,j as f,V as g,W as v,k as y,n as b,J as h,l as _,A as V,v as w}from"./index.e5c8b0d6.js";const C={class:"app-container"},k={class:"dialog-footer"},S=l({name:"Post"}),x=Object.assign(S,{setup(l){const{proxy:S}=w(),{sys_normal_disable:x}=S.useDict("sys_normal_disable"),N=a([]),U=a(!1),q=a(!0),I=a(!0),P=a([]),R=a(!0),T=a(!0),$=a(0),D=a(""),K=t({form:{},queryParams:{pageNum:1,pageSize:10,postCode:void 0,postName:void 0,status:void 0},rules:{postName:[{required:!0,message:"岗位名称不能为空",trigger:"blur"}],postCode:[{required:!0,message:"岗位编码不能为空",trigger:"blur"}],postSort:[{required:!0,message:"岗位顺序不能为空",trigger:"blur"}]}}),{queryParams:j,form:z,rules:E}=o(K);function F(){var l;q.value=!0,(l=j.value,e({url:"/system/post/list",method:"get",params:l})).then((e=>{N.value=e.rows,$.value=e.total,q.value=!1}))}function Q(){U.value=!1,A()}function A(){z.value={postId:void 0,postCode:void 0,postName:void 0,postSort:0,status:"0",remark:void 0},S.resetForm("postRef")}function G(){j.value.pageNum=1,F()}function J(){S.resetForm("queryRef"),G()}function M(e){P.value=e.map((e=>e.postId)),R.value=1!=e.length,T.value=!e.length}function O(){A(),U.value=!0,D.value="添加岗位"}function W(l){A();(function(l){return e({url:"/system/post/"+l,method:"get"})})(l.postId||P.value).then((e=>{z.value=e.data,U.value=!0,D.value="修改岗位"}))}function B(){S.$refs.postRef.validate((l=>{l&&(null!=z.value.postId?function(l){return e({url:"/system/post",method:"put",data:l})}(z.value).then((e=>{S.$modal.msgSuccess("修改成功"),U.value=!1,F()})):function(l){return e({url:"/system/post",method:"post",data:l})}(z.value).then((e=>{S.$modal.msgSuccess("新增成功"),U.value=!1,F()})))}))}function H(l){const a=l.postId||P.value;S.$modal.confirm('是否确认删除岗位编号为"'+a+'"的数据项?').then((function(){return e({url:"/system/post/"+a,method:"delete"})})).then((()=>{F(),S.$modal.msgSuccess("删除成功")})).catch((()=>{}))}function L(){S.download("system/post/export",{...j.value},`post_${(new Date).getTime()}.xlsx`)}return F(),(e,l)=>{const a=s("el-input"),t=s("el-form-item"),o=s("el-option"),w=s("el-select"),S=s("el-button"),P=s("el-form"),K=s("el-col"),A=s("right-toolbar"),X=s("el-row"),Y=s("el-table-column"),Z=s("dict-tag"),ee=s("el-table"),le=s("pagination"),ae=s("el-input-number"),te=s("el-radio"),oe=s("el-radio-group"),se=s("el-dialog"),ue=u("hasPermi"),ne=u("loading");return n(),d("div",C,[p(m(P,{model:i(j),ref:"queryRef",inline:!0},{default:c((()=>[m(t,{label:"岗位编码",prop:"postCode"},{default:c((()=>[m(a,{modelValue:i(j).postCode,"onUpdate:modelValue":l[0]||(l[0]=e=>i(j).postCode=e),placeholder:"请输入岗位编码",clearable:"",style:{width:"200px"},onKeyup:f(G,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),m(t,{label:"岗位名称",prop:"postName"},{default:c((()=>[m(a,{modelValue:i(j).postName,"onUpdate:modelValue":l[1]||(l[1]=e=>i(j).postName=e),placeholder:"请输入岗位名称",clearable:"",style:{width:"200px"},onKeyup:f(G,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),m(t,{label:"状态",prop:"status"},{default:c((()=>[m(w,{modelValue:i(j).status,"onUpdate:modelValue":l[2]||(l[2]=e=>i(j).status=e),placeholder:"岗位状态",clearable:"",style:{width:"200px"}},{default:c((()=>[(n(!0),d(g,null,v(i(x),(e=>(n(),y(o,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),m(t,null,{default:c((()=>[m(S,{type:"primary",icon:"Search",onClick:G},{default:c((()=>[b("搜索")])),_:1}),m(S,{icon:"Refresh",onClick:J},{default:c((()=>[b("重置")])),_:1})])),_:1})])),_:1},8,["model"]),[[r,i(I)]]),m(X,{gutter:10,class:"mb8"},{default:c((()=>[m(K,{span:1.5},{default:c((()=>[p((n(),y(S,{type:"primary",plain:"",icon:"Plus",onClick:O},{default:c((()=>[b("新增")])),_:1})),[[ue,["system:post:add"]]])])),_:1},8,["span"]),m(K,{span:1.5},{default:c((()=>[p((n(),y(S,{type:"success",plain:"",icon:"Edit",disabled:i(R),onClick:W},{default:c((()=>[b("修改")])),_:1},8,["disabled"])),[[ue,["system:post:edit"]]])])),_:1},8,["span"]),m(K,{span:1.5},{default:c((()=>[p((n(),y(S,{type:"danger",plain:"",icon:"Delete",disabled:i(T),onClick:H},{default:c((()=>[b("删除")])),_:1},8,["disabled"])),[[ue,["system:post:remove"]]])])),_:1},8,["span"]),m(K,{span:1.5},{default:c((()=>[p((n(),y(S,{type:"warning",plain:"",icon:"Download",onClick:L},{default:c((()=>[b("导出")])),_:1})),[[ue,["system:post:export"]]])])),_:1},8,["span"]),m(A,{showSearch:i(I),"onUpdate:showSearch":l[3]||(l[3]=e=>h(I)?I.value=e:null),onQueryTable:F},null,8,["showSearch"])])),_:1}),p((n(),y(ee,{data:i(N),onSelectionChange:M},{default:c((()=>[m(Y,{type:"selection",width:"55",align:"center"}),m(Y,{label:"岗位编号",align:"center",prop:"postId"}),m(Y,{label:"岗位编码",align:"center",prop:"postCode"}),m(Y,{label:"岗位名称",align:"center",prop:"postName"}),m(Y,{label:"岗位排序",align:"center",prop:"postSort"}),m(Y,{label:"状态",align:"center",prop:"status"},{default:c((e=>[m(Z,{options:i(x),value:e.row.status},null,8,["options","value"])])),_:1}),m(Y,{label:"创建时间",align:"center",prop:"createTime",width:"180"},{default:c((l=>[_("span",null,V(e.parseTime(l.row.createTime)),1)])),_:1}),m(Y,{label:"操作",width:"180",align:"center","class-name":"small-padding fixed-width"},{default:c((e=>[p((n(),y(S,{link:"",type:"primary",icon:"Edit",onClick:l=>W(e.row)},{default:c((()=>[b("修改")])),_:2},1032,["onClick"])),[[ue,["system:post:edit"]]]),p((n(),y(S,{link:"",type:"primary",icon:"Delete",onClick:l=>H(e.row)},{default:c((()=>[b("删除")])),_:2},1032,["onClick"])),[[ue,["system:post:remove"]]])])),_:1})])),_:1},8,["data"])),[[ne,i(q)]]),p(m(le,{total:i($),page:i(j).pageNum,"onUpdate:page":l[4]||(l[4]=e=>i(j).pageNum=e),limit:i(j).pageSize,"onUpdate:limit":l[5]||(l[5]=e=>i(j).pageSize=e),onPagination:F},null,8,["total","page","limit"]),[[r,i($)>0]]),m(se,{title:i(D),modelValue:i(U),"onUpdate:modelValue":l[11]||(l[11]=e=>h(U)?U.value=e:null),width:"500px","append-to-body":""},{footer:c((()=>[_("div",k,[m(S,{type:"primary",onClick:B},{default:c((()=>[b("确 定")])),_:1}),m(S,{onClick:Q},{default:c((()=>[b("取 消")])),_:1})])])),default:c((()=>[m(P,{ref:"postRef",model:i(z),rules:i(E),"label-width":"80px"},{default:c((()=>[m(t,{label:"岗位名称",prop:"postName"},{default:c((()=>[m(a,{modelValue:i(z).postName,"onUpdate:modelValue":l[6]||(l[6]=e=>i(z).postName=e),placeholder:"请输入岗位名称"},null,8,["modelValue"])])),_:1}),m(t,{label:"岗位编码",prop:"postCode"},{default:c((()=>[m(a,{modelValue:i(z).postCode,"onUpdate:modelValue":l[7]||(l[7]=e=>i(z).postCode=e),placeholder:"请输入编码名称"},null,8,["modelValue"])])),_:1}),m(t,{label:"岗位顺序",prop:"postSort"},{default:c((()=>[m(ae,{modelValue:i(z).postSort,"onUpdate:modelValue":l[8]||(l[8]=e=>i(z).postSort=e),"controls-position":"right",min:0},null,8,["modelValue"])])),_:1}),m(t,{label:"岗位状态",prop:"status"},{default:c((()=>[m(oe,{modelValue:i(z).status,"onUpdate:modelValue":l[9]||(l[9]=e=>i(z).status=e)},{default:c((()=>[(n(!0),d(g,null,v(i(x),(e=>(n(),y(te,{key:e.value,label:e.value},{default:c((()=>[b(V(e.label),1)])),_:2},1032,["label"])))),128))])),_:1},8,["modelValue"])])),_:1}),m(t,{label:"备注",prop:"remark"},{default:c((()=>[m(a,{modelValue:i(z).remark,"onUpdate:modelValue":l[10]||(l[10]=e=>i(z).remark=e),type:"textarea",placeholder:"请输入内容"},null,8,["modelValue"])])),_:1})])),_:1},8,["model","rules"])])),_:1},8,["title","modelValue"])])}}});export{x as default};