Agriculture-front-end/dist/assets/index.8bb11d8a.js

2 lines
8.2 KiB
JavaScript
Raw Normal View History

2023-06-06 10:46:36 +08:00
import{z as C,_ as _e,P as ge,r as _,A as ve,U as ye,d as n,T as F,o as d,c as $,G as g,H as A,f as l,e,w as o,j as L,J as Q,K as j,k as v,m as p,I as G,l as H,x as J,g as be,s as he}from"./index.68b143c5.js";function Ve(i){return C({url:"/system/post/list",method:"get",params:i})}function we(i){return C({url:"/system/post/"+i,method:"get"})}function Ce(i){return C({url:"/system/post",method:"post",data:i})}function ke(i){return C({url:"/system/post",method:"put",data:i})}function Se(i){return C({url:"/system/post/"+i,method:"delete"})}const xe={class:"app-container"},Ne={class:"dialog-footer"},Ue=ge({name:"Post"}),Pe=Object.assign(Ue,{setup(i){const{proxy:c}=he(),{sys_normal_disable:N}=c.useDict("sys_normal_disable"),q=_([]),y=_(!1),U=_(!0),k=_(!0),P=_([]),T=_(!0),K=_(!0),D=_(0),I=_(""),O=ve({form:{},queryParams:{pageNum:1,pageSize:10,postCode:void 0,postName:void 0,status:void 0},rules:{postName:[{required:!0,message:"\u5C97\u4F4D\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],postCode:[{required:!0,message:"\u5C97\u4F4D\u7F16\u7801\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],postSort:[{required:!0,message:"\u5C97\u4F4D\u987A\u5E8F\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}}),{queryParams:u,form:s,rules:M}=ye(O);function h(){U.value=!0,Ve(u.value).then(r=>{q.value=r.rows,D.value=r.total,U.value=!1})}function W(){y.value=!1,R()}function R(){s.value={postId:void 0,postCode:void 0,postName:void 0,postSort:0,status:"0",remark:void 0},c.resetForm("postRef")}function S(){u.value.pageNum=1,h()}function X(){c.resetForm("queryRef"),S()}function Y(r){P.value=r.map(a=>a.postId),T.value=r.length!=1,K.value=!r.length}function Z(){R(),y.value=!0,I.value="\u6DFB\u52A0\u5C97\u4F4D"}function z(r){R();const a=r.postId||P.value;we(a).then(V=>{s.value=V.data,y.value=!0,I.value="\u4FEE\u6539\u5C97\u4F4D"})}function ee(){c.$refs.postRef.validate(r=>{r&&(s.value.postId!=null?ke(s.value).then(a=>{c.$modal.msgSuccess("\u4FEE\u6539\u6210\u529F"),y.value=!1,h()}):Ce(s.value).then(a=>{c.$modal.msgSuccess("\u65B0\u589E\u6210\u529F"),y.value=!1,h()}))})}function B(r){const a=r.postId||P.value;c.$modal.confirm('\u662F\u5426\u786E\u8BA4\u5220\u9664\u5C97\u4F4D\u7F16\u53F7\u4E3A"'+a+'"\u7684\u6570\u636E\u9879\uFF1F').then(function(){return Se(a)}).then(()=>{h(),c.$modal.msgSuccess("\u5220\u9664\u6210\u529F")}).catch(()=>{})}function te(){c.download("system/post/export",{...u.value},`post_${new Date().getTime()}.xlsx`)}return h(),(r,a)=>{const V=n("el-input"),f=n("el-form-item"),le=n("el-option"),oe=n("el-select"),m=n("el-button"),E=n("el-form"),x=n("el-col"),ae=n("right-toolbar"),ne=n("el-row"),b=n("el-table-column"),se=n("dict-tag"),ue=n("el-table"),re=n("pagination"),de=n("el-input-number"),pe=n("el-radio"),ie=n("el-radio-group"),me=n("el-dialog"),w=F("hasPermi"),ce=F("loading");return d(),$("div",xe,[g(e(E,{model:l(u),ref:"queryRef",inline:!0},{default:o(()=>[e(f,{label:"\u5C97\u4F4D\u7F16\u7801",prop:"postCode"},{default:o(()=>[e(V,{modelValue:l(u).postCode,"onUpdate:modelValue":a[0]||(a[0]=t=>l(u).postCode=t),placeholder:"\u8BF7\u8F93\u5165\u5C97\u4F4D\u7F16\u7801",clearable:"",style:{width:"200px"},onKeyup:L(S,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(f,{label:"\u5C97\u4F4D\u540D\u79F0",prop:"postName"},{default:o(()=>[e(V,{modelValue:l(u).postName,"onUpdate:modelValue":a[1]||(a[1]=t=>l(u).postName=t),placeholder:"\u8BF7\u8F93\u5165\u5C97\u4F4D\u540D\u79F0",clearable:"",style:{width:"200px"},onKeyup:L(S,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(f,{label:"\u72B6\u6001",prop:"status"},{default:o(()=>[e(oe,{modelValue:l(u).status,"onUpdate:modelValue":a[2]||(a[2]=t=>l(u).status=t),placeholder:"\u5C97\u4F4D\u72B6\u6001",clearable:"",style:{width:"200px"}},{default:o(()=>[(d(!0),$(Q,null,j(l(N),t=>(d(),v(le,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(f,null,{default:o(()=>[e(m,{type:"primary",icon:"Search",onClick:S},{default:o(()=>[p("\u641C\u7D22")]),_:1}),e(m,{icon:"Refresh",onClick:X},{default:o(()=>[p("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1},8,["mode