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

2 lines
8.1 KiB
JavaScript
Raw Normal View History

2023-04-23 09:41:12 +08:00
import{N as k,_ as fe,G as _e,r as m,H as ye,R as ge,d as a,Q as J,o as r,c as N,J as b,K as O,f as n,e,w as l,j as M,F as $,A as q,k as f,m as c,I as W,l as X,x as Y,g as ve,s as be}from"./index.b3c890dc.js";function he(d){return k({url:"/system/notice/list",method:"get",params:d})}function we(d){return k({url:"/system/notice/"+d,method:"get"})}function Ve(d){return k({url:"/system/notice",method:"post",data:d})}function Te(d){return k({url:"/system/notice",method:"put",data:d})}function ke(d){return k({url:"/system/notice/"+d,method:"delete"})}const Ce={class:"app-container"},xe={class:"dialog-footer"},Ne=_e({name:"Notice"}),Se=Object.assign(Ne,{setup(d){const{proxy:_}=be(),{sys_notice_status:K,sys_notice_type:S}=_.useDict("sys_notice_status","sys_notice_type"),P=m([]),y=m(!1),U=m(!0),C=m(!0),I=m([]),F=m(!0),Q=m(!0),B=m(0),R=m(""),Z=ye({form:{},queryParams:{pageNum:1,pageSize:10,noticeTitle:void 0,createBy:void 0,status:void 0},rules:{noticeTitle:[{required:!0,message:"\u516C\u544A\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],noticeType:[{required:!0,message:"\u516C\u544A\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}]}}),{queryParams:s,form:i,rules:ee}=ge(Z);function h(){U.value=!0,he(s.value).then(u=>{P.value=u.rows,B.value=u.total,U.value=!1})}function te(){y.value=!1,D()}function D(){i.value={noticeId:void 0,noticeTitle:void 0,noticeType:void 0,noticeContent:void 0,status:"0"},_.resetForm("noticeRef")}function x(){s.value.pageNum=1,h()}function le(){_.resetForm("queryRef"),x()}function ne(u){I.value=u.map(o=>o.noticeId),F.value=u.length!=1,Q.value=!u.length}function oe(){D(),y.value=!0,R.value="\u6DFB\u52A0\u516C\u544A"}function z(u){D();const o=u.noticeId||I.value;we(o).then(V=>{i.value=V.data,y.value=!0,R.value="\u4FEE\u6539\u516C\u544A"})}function ae(){_.$refs.noticeRef.validate(u=>{u&&(i.value.noticeId!=null?Te(i.value).then(o=>{_.$modal.msgSuccess("\u4FEE\u6539\u6210\u529F"),y.value=!1,h()}):Ve(i.value).then(o=>{_.$modal.msgSuccess("\u65B0\u589E\u6210\u529F"),y.value=!1,h()}))})}function A(u){const o=u.noticeId||I.value;_.$modal.confirm('\u662F\u5426\u786E\u8BA4\u5220\u9664\u516C\u544A\u7F16\u53F7\u4E3A"'+o+'"\u7684\u6570\u636E\u9879\uFF1F').then(function(){return ke(o)}).then(()=>{h(),_.$modal.msgSuccess("\u5220\u9664\u6210\u529F")}).catch(()=>{})}return h(),(u,o)=>{const V=a("el-input"),g=a("el-form-item"),E=a("el-option"),L=a("el-select"),p=a("el-button"),j=a("el-form"),w=a("el-col"),ie=a("right-toolbar"),G=a("el-row"),v=a("el-table-column"),H=a("dict-tag"),ue=a("el-table"),se=a("pagination"),re=a("el-radio"),de=a("el-radio-group"),ce=a("el-dialog"),T=J("hasPermi"),pe=J("loading");return r(),N("div",Ce,[b(e(j,{model:n(s),ref:"queryRef",inline:!0},{default:l(()=>[e(g,{label:"\u516C\u544A\u6807\u9898",prop:"noticeTitle"},{default:l(()=>[e(V,{modelValue:n(s).noticeTitle,"onUpdate:modelValue":o[0]||(o[0]=t=>n(s).noticeTitle=t),placeholder:"\u8BF7\u8F93\u5165\u516C\u544A\u6807\u9898",clearable:"",style:{width:"200px"},onKeyup:M(x,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(g,{label:"\u64CD\u4F5C\u4EBA\u5458",prop:"createBy"},{default:l(()=>[e(V,{modelValue:n(s).createBy,"onUpdate:modelValue":o[1]||(o[1]=t=>n(s).createBy=t),placeholder:"\u8BF7\u8F93\u5165\u64CD\u4F5C\u4EBA\u5458",clearable:"",style:{width:"200px"},onKeyup:M(x,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(g,{label:"\u7C7B\u578B",prop:"noticeType"},{default:l(()=>[e(L,{modelValue:n(s).noticeType,"onUpdate:modelValue":o[2]||(o[2]=t=>n(s).noticeType=t),placeholder:"\u516C\u544A\u7C7B\u578B",clearable:"",style:{width:"200px"}},{default:l(()=>[(r(!0),N($,null,q(n(S),t=>(r(),f(E,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(g,null,{default:l(()=>[e(p,{type:"primary",icon:"Search",onClick:x},{default:l(()=>[c("\u641C\u7D22")]),_:1}),e(p,{icon:"Refresh",onClick:le},{default:l(()=>[c("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1},8,["model"]),[[O,n(C)]]),e(G,{gutter:10,class:"mb8"},{default:l(()=>[e(w,{span:1.5},{default:l(()=>[b((r(),f(p,{type:"primary",plain:""