var I=Object.defineProperty;var E=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable;var F=(r,s,t)=>s in r?I(r,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[s]=t,C=(r,s)=>{for(var t in s||(s={}))M.call(s,t)&&F(r,t,s[t]);if(E)for(var t of E(s))H.call(s,t)&&F(r,t,s[t]);return r};var d=(r,s,t)=>new Promise((n,p)=>{var y=l=>{try{m(t.next(l))}catch(f){p(f)}},w=l=>{try{m(t.throw(l))}catch(f){p(f)}},m=l=>l.done?n(l.value):Promise.resolve(l.value).then(y,w);m((t=t.apply(r,s)).next())});import{g as J,d as K,n as Q,a as W,t as X}from"./notice-manage-9888f022.js";import{d as Y,A as Z,G as D,r as V,P as v,a as ee,j as i,o as te,c as ae,e as a,w as o,k as N,b,t as le,F as oe}from"./index-90c78f99.js";import{_ as se}from"./notice-dialog.vue_vue_type_script_setup_true_name_menuDialog_lang-dfb8cab1.js";import{u as ne}from"./useCurrentInstance-cd4729ef.js";import"./uploadAction-50b8a6f7.js";const ie={class:"flex justify-between items-center"},re=b("span",null,"公告列表",-1),ce=["onClick"],de=["onClick"],pe=["onClick"],me=["onClick"],ve=Y({__name:"index",setup(r){const s=Z(),{proxy:t}=ne(),n=D({title:void 0,type:void 0}),p=V(),y=V(0),w=D([{label:"序号",type:"index",width:"60"},{label:"公告标题",key:"title",prop:"title"},{label:"公告类型",key:"type",prop:"type",width:"100",render:e=>v("span",`${e.type===1?"系统公告":e.type===2?"帮助文档":"政策文件"}`)},{label:"是否置顶",key:"topped",prop:"topped",width:"80",render:e=>v("span",`${e.topped?"是":"否"}`)},{label:"状态",key:"enabled",prop:"enabled",width:"80",render:e=>[v("span",{class:["dot mr-4",`${e.enabled?"bg-success":"bg-danger"}`]}),v("span",{class:`${e.enabled?"text-success":"text-danger"}`},e.enabled?"启用":"禁用")]},{label:"创建时间",key:"createOn",prop:"createOn",width:"180"},{label:"操作",slot:"action",width:"220",fixed:"right"}]),m=V([]),l=(...u)=>d(this,[...u],function*(e=p.value.pageParams){const g=yield J(C(C({},e),n));y.value=g.data.total,m.value=g.data.records}),f=()=>{p.value.pageNumber=1,l()},L=()=>{n.title=void 0,n.type=void 0,l({pageNumber:1,pageSize:10})},_=D({visible:!1,rowData:void 0}),B=e=>d(this,null,function*(){if(e&&e.id){const u=yield K(e.id);_.rowData=u.data}else _.rowData=void 0;_.visible=!0}),P=e=>{_.visible=!1,e&&l()},R=e=>d(this,null,function*(){t.$messageBox.confirm(`是否${e.enabled?"禁用":"启用"}该公告?`,"提示！",{type:"warning"}).then(()=>d(this,null,function*(){yield Q({id:e.id,status:!e.enabled}),t.$message.success(`${e.enabled?"禁用":"启用"}成功！`),yield l()}))}),j=e=>{t.$messageBox.confirm("是否删除该公告?","提示！",{type:"warning"}).then(()=>d(this,null,function*(){yield W({id:e.id}),t.$message.success("删除成功！"),yield l()}))},G=e=>d(this,null,function*(){t.$messageBox.confirm("是否置顶该公告?","提示！",{type:"warning"}).then(()=>d(this,null,function*(){yield X({id:e.id}),t.$message.success("置顶成功！"),yield l()}))});return ee(()=>{const{type:e}=s.query;n.type=Number(e)||void 0,l()}),(e,u)=>{const g=i("page-title"),O=i("el-input"),h=i("el-form-item"),k=i("el-col"),T=i("el-option"),S=i("el-select"),x=i("el-button"),U=i("el-row"),q=i("el-form"),z=i("table-list"),A=i("el-card");return te(),ae(oe,null,[a(g),a(q,{class:"search mb-16","label-suffix":":",model:n},{default:o(()=>[a(U,{gutter:16},{default:o(()=>[a(k,{span:8},{default:o(()=>[a(h,{label:"公告标题"},{default:o(()=>[a(O,{modelValue:n.title,"onUpdate:modelValue":u[0]||(u[0]=c=>n.title=c),placeholder:"请输入",maxlength:50,clearable:""},null,8,["modelValue"])]),_:1})]),_:1}),a(k,{span:8},{default:o(()=>[a(h,{label:"公告类型"},{default:o(()=>[a(S,{modelValue:n.type,"onUpdate:modelValue":u[1]||(u[1]=c=>n.type=c),class:"m-2",placeholder:"请选择",clearable:""},{default:o(()=>[a(T,{label:"系统公告",value:1}),a(T,{label:"政策文件",value:3})]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(k,{span:8},{default:o(()=>[a(h,{class:"search_btn"},{default:o(()=>[a(x,{type:"primary",onClick:f},{default:o(()=>[N("查询")]),_:1}),a(x,{onClick:L},{default:o(()=>[N("重置")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),a(A,{class:"my-card",shadow:"never"},{header:o(()=>[b("div",ie,[re,a(x,{class:"float-right",type:"primary",icon:"Plus",plain:"",onClick:B},{default:o(()=>[N(" 新增公告 ")]),_:1})])]),default:o(()=>[a(z,{ref_key:"tableListRef",ref:p,column:w,data:m.value,total:y.value,onGetTableData:l},{action:o(({scope:c})=>[b("a",{class:"btn text-primary mr-24",onClick:$=>B(c.row)},"编辑",8,ce),b("a",{class:"btn text-primary mr-24",onClick:$=>G(c.row)},"置顶",8,de),b("a",{class:"btn text-primary mr-24",onClick:$=>R(c.row)},le(c.row.enabled?"禁用":"启用"),9,pe),b("a",{class:"btn text-danger",onClick:$=>j(c.row)},"删除",8,me)]),_:1},8,["column","data","total"])]),_:1}),a(se,{visible:_.visible,data:_.rowData,onClose:P},null,8,["visible","data"])],64)}}});export{ve as default};
