|
- import{g as P,d as S,n as U,a as j,t as q}from"./noticeManage-8f11233d.js";import{x as G,a as g,r as w,$ as c,o as I,b as n,c as A,d as H,f as t,h as l,i as p,e as u,t as J,F as K,k as Q,s as W}from"./index-dd5fae99.js";import X from"./noticeDialog-924c3480.js";const Y=["onClick"],Z=["onClick"],ee=["onClick"],te=["onClick"],ae=Q({name:"noticeManage"}),ie=Object.assign(ae,{setup(le){const x=G(),{proxy:d}=W(),o=g({title:void 0,type:void 0}),v=w(),k=w(0),D=g([{label:"序号",type:"index",width:"60"},{label:"公告标题",key:"title",prop:"title"},{label:"公告类型",key:"type",prop:"type",width:"100",render:e=>c("span",`${e.type===1?"通知公告":e.type===2?"帮助文档":"政策文件"}`)},{label:"是否置顶",key:"topped",prop:"topped",width:"80",render:e=>c("span",`${e.topped?"是":"否"}`)},{label:"状态",key:"enabled",prop:"enabled",width:"80",render:e=>[c("span",{class:["dot mr-4",`${e.enabled?"bg-success":"bg-danger"}`]}),c("span",{class:`${e.enabled?"text-success":"text-danger"}`},e.enabled?"启用":"禁用")]},{label:"创建时间",key:"createOn",prop:"createOn",width:"180"},{label:"操作",slot:"action",width:"220",fixed:"right"}]),$=w([]),i=async(e=v.value.pageParams)=>{const a=await P({...e,...o});k.value=a.data.total,$.value=a.data.records},V=()=>{i()},B=()=>{o.title=void 0,o.type=void 0,i({pageNumber:1,pageSize:10})},r=g({visible:!1,rowData:void 0}),h=async e=>{if(e&&e.id){const a=await S(e.id);r.rowData=a.data}else r.rowData=void 0;r.visible=!0},N=e=>{r.visible=!1,e&&i()},z=async e=>{d.$messageBox.confirm(`是否${e.enabled?"禁用":"启用"}该公告?`,"提示!",{type:"warning"}).then(async()=>{await U({id:e.id,status:!e.enabled}),d.$message.success(`${e.enabled?"禁用":"启用"}成功!`),await i()})},T=e=>{d.$messageBox.confirm("是否删除该公告?","提示!",{type:"warning"}).then(async()=>{await j({id:e.id}),d.$message.success("删除成功!"),await i()})},E=async e=>{d.$messageBox.confirm("是否置顶该公告?","提示!",{type:"warning"}).then(async()=>{await q({id:e.id}),d.$message.success("置顶成功!"),await i()})};return I(()=>{o.type=x.query.type*1||void 0,i()}),(e,a)=>{const F=n("el-input"),m=n("el-form-item"),_=n("el-col"),f=n("el-option"),L=n("el-select"),b=n("el-button"),O=n("el-row"),R=n("el-form"),C=n("el-card"),M=n("table-list");return A(),H(K,null,[t(C,{shadow:"never",class:"search mb-16"},{default:l(()=>[t(R,{"label-suffix":":",model:o,size:"small"},{default:l(()=>[t(O,{gutter:16},{default:l(()=>[t(_,{span:8},{default:l(()=>[t(m,{label:"公告标题"},{default:l(()=>[t(F,{modelValue:o.title,"onUpdate:modelValue":a[0]||(a[0]=s=>o.title=s),placeholder:"请输入",maxlength:50},null,8,["modelValue"])]),_:1})]),_:1}),t(_,{span:8},{default:l(()=>[t(m,{label:"公告类型"},{default:l(()=>[t(L,{modelValue:o.type,"onUpdate:modelValue":a[1]||(a[1]=s=>o.type=s),class:"m-2",placeholder:"请选择"},{default:l(()=>[t(f,{label:"通知公告",value:1}),t(f,{label:"帮助文档",value:2}),t(f,{label:"政策文件",value:3})]),_:1},8,["modelValue"])]),_:1})]),_:1}),t(_,{span:8},{default:l(()=>[t(m,{class:"btn"},{default:l(()=>[t(b,{type:"primary",size:"small",onClick:V},{default:l(()=>a[2]||(a[2]=[p("查询")])),_:1}),t(b,{size:"small",onClick:B},{default:l(()=>a[3]||(a[3]=[p("重置")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),t(C,{shadow:"never"},{header:l(()=>[a[5]||(a[5]=p(" 公告列表 ")),t(b,{class:"float-right",type:"primary",icon:"Plus",size:"small",onClick:h},{default:l(()=>a[4]||(a[4]=[p(" 新增公告 ")])),_:1})]),default:l(()=>[t(M,{ref_key:"tableListRef",ref:v,column:D,data:$.value,total:k.value,onGetTableData:i},{action:l(({scope:s})=>[u("a",{onClick:y=>h(s.row)},"编辑",8,Y),u("a",{onClick:y=>E(s.row)},"置顶",8,Z),u("a",{onClick:y=>z(s.row)},J(s.row.enabled?"禁用":"启用"),9,ee),u("a",{onClick:y=>T(s.row)},"删除",8,te)]),_:1},8,["column","data","total"])]),_:1}),t(X,{visible:r.visible,data:r.rowData,onClose:N},null,8,["visible","data"])],64)}}});export{ie as default};
|