Agriculture-front-end/dist/assets/index.5e33942c.js
2023-07-04 10:08:33 +08:00

2 lines
8.1 KiB
JavaScript

import{H as C,_ as fe,z as _e,r as m,A as ye,M as ge,d as a,K as O,o as r,c as N,C as b,D as G,f as n,e,w as l,j as J,L as $,N as q,k as f,m as c,B as W,l as X,x as Y,g as ve,s as be}from"./index.ae0c781d.js";function he(d){return C({url:"/system/notice/list",method:"get",params:d})}function we(d){return C({url:"/system/notice/"+d,method:"get"})}function Ve(d){return C({url:"/system/notice",method:"post",data:d})}function Te(d){return C({url:"/system/notice",method:"put",data:d})}function Ce(d){return C({url:"/system/notice/"+d,method:"delete"})}const ke={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),k=m(!0),B=m([]),z=m(!0),F=m(!0),D=m(0),I=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,D.value=u.total,U.value=!1})}function te(){y.value=!1,R()}function R(){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){B.value=u.map(o=>o.noticeId),z.value=u.length!=1,F.value=!u.length}function oe(){R(),y.value=!0,I.value="\u6DFB\u52A0\u516C\u544A"}function L(u){R();const o=u.noticeId||B.value;we(o).then(V=>{i.value=V.data,y.value=!0,I.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||B.value;_.$modal.confirm('\u662F\u5426\u786E\u8BA4\u5220\u9664\u516C\u544A\u7F16\u53F7\u4E3A"'+o+'"\u7684\u6570\u636E\u9879\uFF1F').then(function(){return Ce(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"),Q=a("el-select"),p=a("el-button"),j=a("el-form"),w=a("el-col"),ie=a("right-toolbar"),H=a("el-row"),v=a("el-table-column"),M=a("dict-tag"),ue=a("el-table"),se=a("pagination"),re=a("el-radio"),de=a("el-radio-group"),ce=a("el-dialog"),T=O("hasPermi"),pe=O("loading");return r(),N("div",ke,[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:J(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:J(x,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(g,{label:"\u7C7B\u578B",prop:"noticeType"},{default:l(()=>[e(Q,{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"]),[[G,n(k)]]),e(H,{gutter:10,class:"mb8"},{default:l(()=>[e(w,{span:1.5},{default:l(()=>[b((r(),f(p,{type:"primary",plain:"",icon:"Plus",onClick:oe},{default:l(()=>[c("\u65B0\u589E")]),_:1})),[[T,["system:notice:add"]]])]),_:1},8,["span"]),e(w,{span:1.5},{default:l(()=>[b((r(),f(p,{type:"success",plain:"",icon:"Edit",disabled:n(z),onClick:L},{default:l(()=>[c("\u4FEE\u6539")]),_:1},8,["disabled"])),[[T,["system:notice:edit"]]])]),_:1},8,["span"]),e(w,{span:1.5},{default:l(()=>[b((r(),f(p,{type:"danger",plain:"",icon:"Delete",disabled:n(F),onClick:A},{default:l(()=>[c("\u5220\u9664")]),_:1},8,["disabled"])),[[T,["system:notice:remove"]]])]),_:1},8,["span"]),e(ie,{showSearch:n(k),"onUpdate:showSearch":o[3]||(o[3]=t=>W(k)?k.value=t:null),onQueryTable:h},null,8,["showSearch"])]),_:1}),b((r(),f(ue,{data:n(P),onSelectionChange:ne},{default:l(()=>[e(v,{type:"selection",width:"55",align:"center"}),e(v,{label:"\u5E8F\u53F7",align:"center",prop:"noticeId",width:"100"}),e(v,{label:"\u516C\u544A\u6807\u9898",align:"center",prop:"noticeTitle","show-overflow-tooltip":!0}),e(v,{label:"\u516C\u544A\u7C7B\u578B",align:"center",prop:"noticeType",width:"100"},{default:l(t=>[e(M,{options:n(S),value:t.row.noticeType},null,8,["options","value"])]),_:1}),e(v,{label:"\u72B6\u6001",align:"center",prop:"status",width:"100"},{default:l(t=>[e(M,{options:n(K),value:t.row.status},null,8,["options","value"])]),_:1}),e(v,{label:"\u521B\u5EFA\u8005",align:"center",prop:"createBy",width:"100"}),e(v,{label:"\u521B\u5EFA\u65F6\u95F4",align:"center",prop:"createTime",width:"100"},{default:l(t=>[X("span",null,Y(u.parseTime(t.row.createTime,"{y}-{m}-{d}")),1)]),_:1}),e(v,{label:"\u64CD\u4F5C",align:"center","class-name":"small-padding fixed-width"},{default:l(t=>[b((r(),f(p,{link:"",type:"primary",icon:"Edit",onClick:me=>L(t.row)},{default:l(()=>[c("\u4FEE\u6539")]),_:2},1032,["onClick"])),[[T,["system:notice:edit"]]]),b((r(),f(p,{link:"",type:"primary",icon:"Delete",onClick:me=>A(t.row)},{default:l(()=>[c("\u5220\u9664")]),_:2},1032,["onClick"])),[[T,["system:notice:remove"]]])]),_:1})]),_:1},8,["data"])),[[pe,n(U)]]),b(e(se,{total:n(D),page:n(s).pageNum,"onUpdate:page":o[4]||(o[4]=t=>n(s).pageNum=t),limit:n(s).pageSize,"onUpdate:limit":o[5]||(o[5]=t=>n(s).pageSize=t),onPagination:h},null,8,["total","page","limit"]),[[G,n(D)>0]]),ve(" \u6DFB\u52A0\u6216\u4FEE\u6539\u516C\u544A\u5BF9\u8BDD\u6846 "),e(ce,{title:n(I),modelValue:n(y),"onUpdate:modelValue":o[10]||(o[10]=t=>W(y)?y.value=t:null),width:"780px","append-to-body":""},{footer:l(()=>[X("div",xe,[e(p,{type:"primary",onClick:ae},{default:l(()=>[c("\u786E \u5B9A")]),_:1}),e(p,{onClick:te},{default:l(()=>[c("\u53D6 \u6D88")]),_:1})])]),default:l(()=>[e(j,{ref:"noticeRef",model:n(i),rules:n(ee),"label-width":"80px"},{default:l(()=>[e(H,null,{default:l(()=>[e(w,{span:12},{default:l(()=>[e(g,{label:"\u516C\u544A\u6807\u9898",prop:"noticeTitle"},{default:l(()=>[e(V,{modelValue:n(i).noticeTitle,"onUpdate:modelValue":o[6]||(o[6]=t=>n(i).noticeTitle=t),placeholder:"\u8BF7\u8F93\u5165\u516C\u544A\u6807\u9898"},null,8,["modelValue"])]),_:1})]),_:1}),e(w,{span:12},{default:l(()=>[e(g,{label:"\u516C\u544A\u7C7B\u578B",prop:"noticeType"},{default:l(()=>[e(Q,{modelValue:n(i).noticeType,"onUpdate:modelValue":o[7]||(o[7]=t=>n(i).noticeType=t),placeholder:"\u8BF7\u9009\u62E9"},{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})]),_:1}),e(w,{span:24},{default:l(()=>[e(g,{label:"\u72B6\u6001"},{default:l(()=>[e(de,{modelValue:n(i).status,"onUpdate:modelValue":o[8]||(o[8]=t=>n(i).status=t)},{default:l(()=>[(r(!0),N($,null,q(n(K),t=>(r(),f(re,{key:t.value,label:t.value},{default:l(()=>[c(Y(t.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(w,{span:24},{default:l(()=>[e(g,{label:"\u5185\u5BB9"},{default:l(()=>[e(V,{rows:6,type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9",modelValue:n(i).noticeContent,"onUpdate:modelValue":o[9]||(o[9]=t=>n(i).noticeContent=t)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title","modelValue"])])}}}),Be=fe(Se,[["__file","/Users/luce/Desktop/\u6570\u5B57\u4E09\u519C/Agriculture-front-end/src/views/system/notice/index.vue"]]);export{Be as default};