Agriculture-front-end/dist/assets/index.404d8c41.js
2023-11-08 11:15:41 +08:00

2 lines
8.0 KiB
JavaScript

import{L as C,B as _e,r as _,D as ge,P as ve,d as n,O as L,o as d,c as $,G as g,H as Q,f as l,e,w as o,i as z,Q as j,R as O,j as v,m as p,F as A,k as G,x as H,s as be}from"./index.4144b0df.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"},xe=_e({name:"Post"}),Pe=Object.assign(xe,{setup(i){const{proxy:c}=be(),{sys_normal_disable:N}=c.useDict("sys_normal_disable"),q=_([]),b=_(!1),P=_(!0),k=_(!0),U=_([]),T=_(!0),B=_(!0),D=_(0),I=_(""),J=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:M}=ve(J);function h(){P.value=!0,ye(u.value).then(r=>{q.value=r.rows,D.value=r.total,P.value=!1})}function W(){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){U.value=r.map(a=>a.postId),T.value=r.length!=1,B.value=!r.length}function Z(){R(),b.value=!0,I.value="\u6DFB\u52A0\u5C97\u4F4D"}function F(r){R();const a=r.postId||U.value;he(a).then(V=>{s.value=V.data,b.value=!0,I.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 K(r){const a=r.postId||U.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"),E=n("el-form"),x=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=L("hasPermi"),ce=L("loading");return d(),$("div",ke,[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:z(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:z(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,O(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,["model"]),[[Q,l(k)]]),e(ne,{gutter:10,class:"mb8"},{default:o(()=>[e(x,{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(x,{span:1.5},{default:o(()=>[g((d(),v(m,{type:"success",plain:"",icon:"Edit",disabled:l(T),onClick:F},{default:o(()=>[p("\u4FEE\u6539")]),_:1},8,["disabled"])),[[w,["system:post:edit"]]])]),_:1},8,["span"]),e(x,{span:1.5},{default:o(()=>[g((d(),v(m,{type:"danger",plain:"",icon:"Delete",disabled:l(B),onClick:K},{default:o(()=>[p("\u5220\u9664")]),_:1},8,["disabled"])),[[w,["system:post:remove"]]])]),_:1},8,["span"]),e(x,{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=>A(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(N),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=>[G("span",null,H(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=>F(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=>K(t.row)},{default:o(()=>[p("\u5220\u9664")]),_:2},1032,["onClick"])),[[w,["system:post:remove"]]])]),_:1})]),_:1},8,["data"])),[[ce,l(P)]]),g(e(re,{total:l(D),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"]),[[Q,l(D)>0]]),e(me,{title:l(I),modelValue:l(b),"onUpdate:modelValue":a[11]||(a[11]=t=>A(b)?b.value=t:null),width:"500px","append-to-body":""},{footer:o(()=>[G("div",Se,[e(m,{type:"primary",onClick:ee},{default:o(()=>[p("\u786E \u5B9A")]),_:1}),e(m,{onClick:W},{default:o(()=>[p("\u53D6 \u6D88")]),_:1})])]),default:o(()=>[e(E,{ref:"postRef",model:l(s),rules:l(M),"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,O(l(N),t=>(d(),v(pe,{key:t.value,label:t.value},{default:o(()=>[p(H(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{Pe as default};