import{g as q,d as M,n as P,a as S,t as U}from"./noticeManage.84e019b5.js";import{d as G,x as I,b as g,r as w,Z as c,o as Z,c as n,e as A,f as H,h as t,i as l,j as p,g as u,t as J,F as K,q as Q}from"./index.66d3f9b1.js";import W from"./noticeDialog.5a1fc209.js";const X=["onClick"],Y=["onClick"],ee=["onClick"],te=["onClick"],ae=G({name:"noticeManage"}),ie=Object.assign(ae,{setup(le){const x=I(),{proxy:d}=Q(),o=g({title:void 0,type:void 0}),v=w(),k=w(0),D=g([{label:"\u5E8F\u53F7",type:"index",width:"60"},{label:"\u516C\u544A\u6807\u9898",key:"title",prop:"title"},{label:"\u516C\u544A\u7C7B\u578B",key:"type",prop:"type",width:"100",render:e=>c("span",`${e.type===1?"\u901A\u77E5\u516C\u544A":e.type===2?"\u5E2E\u52A9\u6587\u6863":"\u653F\u7B56\u6587\u4EF6"}`)},{label:"\u662F\u5426\u7F6E\u9876",key:"topped",prop:"topped",width:"80",render:e=>c("span",`${e.topped?"\u662F":"\u5426"}`)},{label:"\u72B6\u6001",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?"\u542F\u7528":"\u7981\u7528")]},{label:"\u521B\u5EFA\u65F6\u95F4",key:"createOn",prop:"createOn",width:"180"},{label:"\u64CD\u4F5C",slot:"action",width:"220",fixed:"right"}]),$=w([]),i=async(e=v.value.pageParams)=>{const a=await q({...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 M(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(`\u662F\u5426${e.enabled?"\u7981\u7528":"\u542F\u7528"}\u8BE5\u516C\u544A?`,"\u63D0\u793A\uFF01",{type:"warning"}).then(async()=>{await P({id:e.id,status:!e.enabled}),d.$message.success(`${e.enabled?"\u7981\u7528":"\u542F\u7528"}\u6210\u529F\uFF01`),await i()})},T=e=>{d.$messageBox.confirm("\u662F\u5426\u5220\u9664\u8BE5\u516C\u544A?","\u63D0\u793A\uFF01",{type:"warning"}).then(async()=>{await S({id:e.id}),d.$message.success("\u5220\u9664\u6210\u529F\uFF01"),await i()})},E=async e=>{d.$messageBox.confirm("\u662F\u5426\u7F6E\u9876\u8BE5\u516C\u544A?","\u63D0\u793A\uFF01",{type:"warning"}).then(async()=>{await U({id:e.id}),d.$message.success("\u7F6E\u9876\u6210\u529F\uFF01"),await i()})};return Z(()=>{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"),j=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:"\u516C\u544A\u6807\u9898"},{default:l(()=>[t(F,{modelValue:o.title,"onUpdate:modelValue":a[0]||(a[0]=s=>o.title=s),placeholder:"\u8BF7\u8F93\u5165",maxlength:50},null,8,["modelValue"])]),_:1})]),_:1}),t(_,{span:8},{default:l(()=>[t(m,{label:"\u516C\u544A\u7C7B\u578B"},{default:l(()=>[t(L,{modelValue:o.type,"onUpdate:modelValue":a[1]||(a[1]=s=>o.type=s),class:"m-2",placeholder:"\u8BF7\u9009\u62E9"},{default:l(()=>[t(f,{label:"\u901A\u77E5\u516C\u544A",value:1}),t(f,{label:"\u5E2E\u52A9\u6587\u6863",value:2}),t(f,{label:"\u653F\u7B56\u6587\u4EF6",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("\u67E5\u8BE2")])),_:1}),t(b,{size:"small",onClick:B},{default:l(()=>a[3]||(a[3]=[p("\u91CD\u7F6E")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),t(C,{shadow:"never"},{header:l(()=>[a[5]||(a[5]=p(" \u516C\u544A\u5217\u8868 ")),t(b,{class:"float-right",type:"primary",icon:"Plus",size:"small",onClick:h},{default:l(()=>a[4]||(a[4]=[p(" \u65B0\u589E\u516C\u544A ")])),_:1})]),default:l(()=>[t(j,{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)},"\u7F16\u8F91",8,X),u("a",{onClick:y=>E(s.row)},"\u7F6E\u9876",8,Y),u("a",{onClick:y=>z(s.row)},J(s.row.enabled?"\u7981\u7528":"\u542F\u7528"),9,ee),u("a",{onClick:y=>T(s.row)},"\u5220\u9664",8,te)]),_:1},8,["column","data","total"])]),_:1}),t(W,{visible:r.visible,data:r.rowData,onClose:N},null,8,["visible","data"])],64)}}});export{ie as default};