Agriculture-front-end/dist/assets/index.49ad8135.js

2 lines
8.0 KiB
JavaScript

import{Q as C,G as _e,r as _,I as ge,U as ve,d as n,T as Q,o as d,c as $,K as g,M as z,f as l,e,w as o,j as L,V as j,W as A,k as v,n as p,J as G,l as J,A as M,v as be}from"./index.064676a5.js";function ye(i){return C({url:"/system/post/list",method:"get",params:i})}function he(i){return C({url:"/system/post/"+i,method:"get"})}function Ve(i){return C({url:"/system/post",method:"post",data:i})}function we(i){return C({url:"/system/post",method:"put",data:i})}function Ce(i){return C({url:"/system/post/"+i,method:"delete"})}const ke={class:"app-container"},Se={class:"dialog-footer"},Ne=_e({name:"Post"}),Ue=Object.assign(Ne,{setup(i){const{proxy:c}=be(),{sys_normal_disable:x}=c.useDict("sys_normal_disable"),q=_([]),b=_(!1),U=_(!0),k=_(!0),P=_([]),T=_(!0),K=_(!0),I=_(0),D=_(""),O=ge({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:W}=ve(O);function h(){U.value=!0,ye(u.value).then(r=>{q.value=r.rows,I.value=r.total,U.value=!1})}function H(){b.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(),b.value=!0,D.value="\u6DFB\u52A0\u5C97\u4F4D"}function B(r){R();const a=r.postId||P.value;he(a).then(V=>{s.value=V.data,b.value=!0,D.value="\u4FEE\u6539\u5C97\u4F4D"})}function ee(){c.$refs.postRef.validate(r=>{r&&(s.value.postId!=null?we(s.value).then(a=>{c.$modal.msgSuccess("\u4FEE\u6539\u6210\u529F"),b.value=!1,h()}):Ve(s.value).then(a=>{c.$modal.msgSuccess("\u65B0\u589E\u6210\u529F"),b.value=!1,h()}))})}function E(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 Ce(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"),F=n("el-form"),N=n("el-col"),ae=n("right-toolbar"),ne=n("el-row"),y=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=Q("hasPermi"),ce=Q("loading");return d(),$("div",ke,[g(e(F,{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),$(j,null,A(l(x),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,["model"]),[[z,l(k)]]),e(ne,{gutter:10,class:"mb8"},{default:o(()=>[e(N,{span:1.5},{default:o(()=>[g((d(),v(m,{type:"primary",plain:"",icon:"Plus",onClick:Z},{default:o(()=>[p("\u65B0\u589E")]),_:1})),[[w,["system:post:add"]]])]),_:1},8,["span"]),e(N,{span:1.5},{default:o(()=>[g((d(),v(m,{type:"success",plain:"",icon:"Edit",disabled:l(T),onClick:B},{default:o(()=>[p("\u4FEE\u6539")]),_:1},8,["disabled"])),[[w,["system:post:edit"]]])]),_:1},8,["span"]),e(N,{span:1.5},{default:o(()=>[g((d(),v(m,{type:"danger",plain:"",icon:"Delete",disabled:l(K),onClick:E},{default:o(()=>[p("\u5220\u9664")]),_:1},8,["disabled"])),[[w,["system:post:remove"]]])]),_:1},8,["span"]),e(N,{span:1.5},{default:o(()=>[g((d(),v(m,{type:"warning",plain:"",icon:"Download",onClick:te},{default:o(()=>[p("\u5BFC\u51FA")]),_:1})),[[w,["system:post:export"]]])]),_:1},8,["span"]),e(ae,{showSearch:l(k),"onUpdate:showSearch":a[3]||(a[3]=t=>G(k)?k.value=t:null),onQueryTable:h},null,8,["showSearch"])]),_:1}),g((d(),v(ue,{data:l(q),onSelectionChange:Y},{default:o(()=>[e(y,{type:"selection",width:"55",align:"center"}),e(y,{label:"\u5C97\u4F4D\u7F16\u53F7",align:"center",prop:"postId"}),e(y,{label:"\u5C97\u4F4D\u7F16\u7801",align:"center",prop:"postCode"}),e(y,{label:"\u5C97\u4F4D\u540D\u79F0",align:"center",prop:"postName"}),e(y,{label:"\u5C97\u4F4D\u6392\u5E8F",align:"center",prop:"postSort"}),e(y,{label:"\u72B6\u6001",align:"center",prop:"status"},{default:o(t=>[e(se,{options:l(x),value:t.row.status},null,8,["options","value"])]),_:1}),e(y,{label:"\u521B\u5EFA\u65F6\u95F4",align:"center",prop:"createTime",width:"180"},{default:o(t=>[J("span",null,M(r.parseTime(t.row.createTime)),1)]),_:1}),e(y,{label:"\u64CD\u4F5C",width:"180",align:"center","class-name":"small-padding fixed-width"},{default:o(t=>[g((d(),v(m,{link:"",type:"primary",icon:"Edit",onClick:fe=>B(t.row)},{default:o(()=>[p("\u4FEE\u6539")]),_:2},1032,["onClick"])),[[w,["system:post:edit"]]]),g((d(),v(m,{link:"",type:"primary",icon:"Delete",onClick:fe=>E(t.row)},{default:o(()=>[p("\u5220\u9664")]),_:2},1032,["onClick"])),[[w,["system:post:remove"]]])]),_:1})]),_:1},8,["data"])),[[ce,l(U)]]),g(e(re,{total:l(I),page:l(u).pageNum,"onUpdate:page":a[4]||(a[4]=t=>l(u).pageNum=t),limit:l(u).pageSize,"onUpdate:limit":a[5]||(a[5]=t=>l(u).pageSize=t),onPagination:h},null,8,["total","page","limit"]),[[z,l(I)>0]]),e(me,{title:l(D),modelValue:l(b),"onUpdate:modelValue":a[11]||(a[11]=t=>G(b)?b.value=t:null),width:"500px","append-to-body":""},{footer:o(()=>[J("div",Se,[e(m,{type:"primary",onClick:ee},{default:o(()=>[p("\u786E \u5B9A")]),_:1}),e(m,{onClick:H},{default:o(()=>[p("\u53D6 \u6D88")]),_:1})])]),default:o(()=>[e(F,{ref:"postRef",model:l(s),rules:l(W),"label-width":"80px"},{default:o(()=>[e(f,{label:"\u5C97\u4F4D\u540D\u79F0",prop:"postName"},{default:o(()=>[e(V,{modelValue:l(s).postName,"onUpdate:modelValue":a[6]||(a[6]=t=>l(s).postName=t),placeholder:"\u8BF7\u8F93\u5165\u5C97\u4F4D\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(f,{label:"\u5C97\u4F4D\u7F16\u7801",prop:"postCode"},{default:o(()=>[e(V,{modelValue:l(s).postCode,"onUpdate:modelValue":a[7]||(a[7]=t=>l(s).postCode=t),placeholder:"\u8BF7\u8F93\u5165\u7F16\u7801\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(f,{label:"\u5C97\u4F4D\u987A\u5E8F",prop:"postSort"},{default:o(()=>[e(de,{modelValue:l(s).postSort,"onUpdate:modelValue":a[8]||(a[8]=t=>l(s).postSort=t),"controls-position":"right",min:0},null,8,["modelValue"])]),_:1}),e(f,{label:"\u5C97\u4F4D\u72B6\u6001",prop:"status"},{default:o(()=>[e(ie,{modelValue:l(s).status,"onUpdate:modelValue":a[9]||(a[9]=t=>l(s).status=t)},{default:o(()=>[(d(!0),$(j,null,A(l(x),t=>(d(),v(pe,{key:t.value,label:t.value},{default:o(()=>[p(M(t.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(f,{label:"\u5907\u6CE8",prop:"remark"},{default:o(()=>[e(V,{modelValue:l(s).remark,"onUpdate:modelValue":a[10]||(a[10]=t=>l(s).remark=t),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title","modelValue"])])}}});export{Ue as default};