2 lines
7.5 KiB
JavaScript
2 lines
7.5 KiB
JavaScript
|
import{Q as e,G as l,r as a,I as t,U as o,d as n,T as i,o as u,c as d,K as s,M as c,f as r,e as p,w as m,j as f,V as y,W as v,k as _,n as g,J as h,l as b,A as w,v as T}from"./index.e5c8b0d6.js";const V={class:"app-container"},k={class:"dialog-footer"},C=l({name:"Notice"}),U=Object.assign(C,{setup(l){const{proxy:C}=T(),{sys_notice_status:U,sys_notice_type:S}=C.useDict("sys_notice_status","sys_notice_type"),x=a([]),I=a(!1),q=a(!0),R=a(!0),B=a([]),K=a(!0),N=a(!0),P=a(0),$=a(""),j=t({form:{},queryParams:{pageNum:1,pageSize:10,noticeTitle:void 0,createBy:void 0,status:void 0},rules:{noticeTitle:[{required:!0,message:"公告标题不能为空",trigger:"blur"}],noticeType:[{required:!0,message:"公告类型不能为空",trigger:"change"}]}}),{queryParams:z,form:D,rules:E}=o(j);function F(){var l;q.value=!0,(l=z.value,e({url:"/system/notice/list",method:"get",params:l})).then((e=>{x.value=e.rows,P.value=e.total,q.value=!1}))}function Q(){I.value=!1,A()}function A(){D.value={noticeId:void 0,noticeTitle:void 0,noticeType:void 0,noticeContent:void 0,status:"0"},C.resetForm("noticeRef")}function G(){z.value.pageNum=1,F()}function J(){C.resetForm("queryRef"),G()}function M(e){B.value=e.map((e=>e.noticeId)),K.value=1!=e.length,N.value=!e.length}function O(){A(),I.value=!0,$.value="添加公告"}function W(l){A();(function(l){return e({url:"/system/notice/"+l,method:"get"})})(l.noticeId||B.value).then((e=>{D.value=e.data,I.value=!0,$.value="修改公告"}))}function H(){C.$refs.noticeRef.validate((l=>{l&&(null!=D.value.noticeId?function(l){return e({url:"/system/notice",method:"put",data:l})}(D.value).then((e=>{C.$modal.msgSuccess("修改成功"),I.value=!1,F()})):function(l){return e({url:"/system/notice",method:"post",data:l})}(D.value).then((e=>{C.$modal.msgSuccess("新增成功"),I.value=!1,F()})))}))}function L(l){const a=l.noticeId||B.value;C.$modal.confirm('是否确认删除公告编号为"'+a+'"的数据项?').then((function(){return e({url:"/system/notice/"+a,method:"delete"})})).then((()=>{F(),C.$modal.msgSuccess("删除成功")})).catch((()=>{}))}return F(),(e,l)=>{const a=n("el-input"),t=n("el-form-item"),o=n("el-option"),T=n("el-select"),C=n("el-button"),B=n("el-form"),j=n("el-col"),A=n("right-toolbar"),X=n("el-row"),Y=n("el-table-column"),Z=n("dict-tag"),ee=n("el-table"),le=n("pagination"),ae=n("el-radio"),te=n("el-radio-group"),oe=n("el-dialog"),ne=i("hasPermi"),ie=i("loading");return u(),d("div",V,[s(p(B,{model:r(z),ref:"queryRef",inline:!0},{default:m((()=>[p(t,{label:"公告标题",prop:"noticeTitle"},{default:m((()=>[p(a,{modelValue:r(z).noticeTitle,"onUpdate:modelValue":l[0]||(l[0]=e=>r(z).noticeTitle=e),placeholder:"请输入公告标题",clearable:"",style:{width:"200px"},onKeyup:f(G,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),p(t,{label:"操作人员",prop:"createBy"},{default:m((()=>[p(a,{modelValue:r(z).createBy,"onUpdate:modelValue":l[1]||(l[1]=e=>r(z).createBy=e),placeholder:"请输入操作人员",clearable:"",style:{width:"200px"},onKeyup:f(G,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),p(t,{label:"类型",prop:"noticeType"},{default:m((()=>[p(T,{modelValue:r(z).noticeType,"onUpdate:modelValue":l[2]||(l[2]=e=>r(z).noticeType=e),placeholder:"公告类型",clearable:"",style:{width:"200px"}},{default:m((()=>[(u(!0),d(y,null,v(r(S),(e=>(u(),_(o,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),p(t,null,{default:m((()=>[p(C,{type:"primary",icon:"Search",onClick:G},{default:m((()=>[g("搜索")])),_:1}),p(C,{icon:"Refresh",onClick:J},{default:m((()=>[g("重置")])),_:1})])),_:1})])),_:1},8,["model"]),[[c,r(R)]]),p(X,{gutter:10,class:"mb8"},{default:m((()=>[p(j,{span:1.5},{default:m((()=>[s((u(),_(C,{type:"primary",plain:"",icon:"Plus",onClick:O},{default:m((()=>[g("新增")])),_:1})),[[ne,["system:notice:add"]]])])),_:1},8,["span"]),p(j,{span:1.5},{default:m((()=>[s((u(),_(C,{type:"success",plain:"",icon:"Edit",disabled:r(K),onClick:W},{default:m((()=>[g("修改")])),_:1},8,["disabled"])),[[ne,["system:notice:edit"]]])])),_:1},8,
|