2 lines
7.3 KiB
JavaScript
Raw Normal View History

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