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

2 lines
7.5 KiB
JavaScript
Raw Normal View History

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),onClic