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,["span"]),p(j,{span:1.5},{default:m((()=>[s((u(),_(C,{type:"danger",plain:"",icon:"Delete",disabled:r(N),onClick:L},{default:m((()=>[g("删除")])),_:1},8,["disabled"])),[[ne,["system:notice:remove"]]])])),_:1},8,["span"]),p(A,{showSearch:r(R),"onUpdate:showSearch":l[3]||(l[3]=e=>h(R)?R.value=e:null),onQueryTable:F},null,8,["showSearch"])])),_:1}),s((u(),_(ee,{data:r(x),onSelectionChange:M},{default:m((()=>[p(Y,{type:"selection",width:"55",align:"center"}),p(Y,{label:"序号",align:"center",prop:"noticeId",width:"100"}),p(Y,{label:"公告标题",align:"center",prop:"noticeTitle","show-overflow-tooltip":!0}),p(Y,{label:"公告类型",align:"center",prop:"noticeType",width:"100"},{default:m((e=>[p(Z,{options:r(S),value:e.row.noticeType},null,8,["options","value"])])),_:1}),p(Y,{label:"状态",align:"center",prop:"status",width:"100"},{default:m((e=>[p(Z,{options:r(U),value:e.row.status},null,8,["options","value"])])),_:1}),p(Y,{label:"创建者",align:"center",prop:"createBy",width:"100"}),p(Y,{label:"创建时间",align:"center",prop:"createTime",width:"100"},{default:m((l=>[b("span",null,w(e.parseTime(l.row.createTime,"{y}-{m}-{d}")),1)])),_:1}),p(Y,{label:"操作",align:"center","class-name":"small-padding fixed-width"},{default:m((e=>[s((u(),_(C,{link:"",type:"primary",icon:"Edit",onClick:l=>W(e.row)},{default:m((()=>[g("修改")])),_:2},1032,["onClick"])),[[ne,["system:notice:edit"]]]),s((u(),_(C,{link:"",type:"primary",icon:"Delete",onClick:l=>L(e.row)},{default:m((()=>[g("删除")])),_:2},1032,["onClick"])),[[ne,["system:notice:remove"]]])])),_:1})])),_:1},8,["data"])),[[ie,r(q)]]),s(p(le,{total:r(P),page:r(z).pageNum,"onUpdate:page":l[4]||(l[4]=e=>r(z).pageNum=e),limit:r(z).pageSize,"onUpdate:limit":l[5]||(l[5]=e=>r(z).pageSize=e),onPagination:F},null,8,["total","page","limit"]),[[c,r(P)>0]]),p(oe,{title:r($),modelValue:r(I),"onUpdate:modelValue":l[10]||(l[10]=e=>h(I)?I.value=e:null),width:"780px","append-to-body":""},{footer:m((()=>[b("div",k,[p(C,{type:"primary",onClick:H},{default:m((()=>[g("确 定")])),_:1}),p(C,{onClick:Q},{default:m((()=>[g("取 消")])),_:1})])])),default:m((()=>[p(B,{ref:"noticeRef",model:r(D),rules:r(E),"label-width":"80px"},{default:m((()=>[p(X,null,{default:m((()=>[p(j,{span:12},{default:m((()=>[p(t,{label:"公告标题",prop:"noticeTitle"},{default:m((()=>[p(a,{modelValue:r(D).noticeTitle,"onUpdate:modelValue":l[6]||(l[6]=e=>r(D).noticeTitle=e),placeholder:"请输入公告标题"},null,8,["modelValue"])])),_:1})])),_:1}),p(j,{span:12},{default:m((()=>[p(t,{label:"公告类型",prop:"noticeType"},{default:m((()=>[p(T,{modelValue:r(D).noticeType,"onUpdate:modelValue":l[7]||(l[7]=e=>r(D).noticeType=e),placeholder:"请选择"},{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})])),_:1}),p(j,{span:24},{default:m((()=>[p(t,{label:"状态"},{default:m((()=>[p(te,{modelValue:r(D).status,"onUpdate:modelValue":l[8]||(l[8]=e=>r(D).status=e)},{default:m((()=>[(u(!0),d(y,null,v(r(U),(e=>(u(),_(ae,{key:e.value,label:e.value},{default:m((()=>[g(w(e.label),1)])),_:2},1032,["label"])))),128))])),_:1},8,["modelValue"])])),_:1})])),_:1}),p(j,{span:24},{default:m((()=>[p(t,{label:"内容"},{default:m((()=>[p(a,{rows:6,type:"textarea",placeholder:"请输入内容",modelValue:r(D).noticeContent,"onUpdate:modelValue":l[9]||(l[9]=e=>r(D).noticeContent=e)},null,8,["modelValue"])])),_:1})])),_:1})])),_:1})])),_:1},8,["model","rules"])])),_:1},8,["title","modelValue"])])}}});export{U as default};