import{a0 as h,ax as I}from"./index.17037962789732.js";import"./index.1703796278973300.js";import"./index.170379627897315.js";import"./index.170379627897317.js";import"./index.1703796278973301.js";import"./index.1703796278973302.js";import"./index.170379627897332.js";import"./index.1703796278973303.js";import"./index.170379627897339.js";import"./index.170379627897316.js";import"./index.170379627897314.js";import"./index.1703796278973304.js";import"./index.1703796278973305.js";import"./index.1703796278973306.js";import"./index.170379627897336.js";import{_ as O}from"./index.vue_vue_type_script_setup_true_lang.17037962789733.js";import{_ as l}from"./index.vue_vue_type_script_setup_true_name_PermissionButton_lang.1703796278973.js";import{_ as w}from"./EditDialog.vue_vue_type_script_setup_true_lang.1703796278973.js";import{c as B,r as R,g as $}from"./notificationSubscription.1703796278973.js";import"./default.1703796278973.js";import"./index.1703796278973299.js";import{d as C,k as p,r as _,o as y,c as v,a as o,z as T,b as t,t as g,A as V,u as m,M as A,B as q}from"./vue.1703796278973.js";import{aN as c}from"./index.17037962789733.js";import{_ as j}from"./_plugin-vue_export-helper.1703796278973.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./index.170379627897333.js";import"./index.170379627897320.js";import"./index.170379627897321.js";import"./permission.1703796278973.js";import"./index.170379627897337.js";import"./index.170379627897318.js";import"./index.170379627897319.js";import"./index.170379627897327.js";import"./system.1703796278973.js";import"./comm.1703796278973.js";import"./index.170379627897334.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";const z={class:"notification-subscription-container"},D=C({name:"NotificationSubscription"}),E=C({...D,setup(J){const f=[{title:"名称",dataIndex:"subscribeName",key:"subscribeName",ellipsis:!0,search:{type:"string"}},{title:"类型",dataIndex:"topicName",key:"topicName",scopedSlots:!0,ellipsis:!0},{title:"告警规则",dataIndex:"alarmConfigName",key:"alarmConfigName",scopedSlots:!0,ellipsis:!0},{title:"状态",dataIndex:"state",key:"state",scopedSlots:!0,ellipsis:!0},{title:"操作",dataIndex:"action",key:"action",ellipsis:!0,scopedSlots:!0,width:"200px"}],b=p({}),r=p(!1),d=p(),i={seletctRow:p({}),edit:s=>{i.seletctRow={...s||{}},r.value=!0},changeStatus:s=>{const a=s.state.value==="enabled"?"_disabled":"_enabled";B(s.id,a).then(u=>{u.status===200?(c.success("操作成功！"),i.refresh()):c.warning("操作失败！")})},delete:s=>{R(s.id).then(a=>{a.status===200?(c.success("操作成功！"),i.refresh()):c.warning("操作失败！")})},refresh:()=>{d.value&&d.value.reload()}};return(s,a)=>{const u=_("pro-search"),n=_("AIcon"),k=O,x=h,N=I,S=_("page-container");return y(),v(S,null,{default:o(()=>[T("div",z,[t(u,{columns:f,target:"category",onSearch:a[0]||(a[0]=e=>b.value={...e})}),t(N,{ref_key:"tableRef",ref:d,columns:f,request:m($),model:"TABLE",params:m(b),defaultParams:{sorts:[{name:"notifyTime",order:"desc"}]}},{headerTitle:o(()=>[t(l,{type:"primary",onClick:a[1]||(a[1]=e=>i.edit())},{default:o(()=>[t(n,{type:"PlusOutlined"}),g("新增 ")]),_:1})]),alarmConfigName:o(e=>[g(V(e.topicConfig.alarmConfigName),1)]),state:o(e=>[t(k,{status:e.state.value,text:e.state.text,statusNames:{enabled:"success",disabled:"error"}},null,8,["status","text"])]),action:o(e=>[t(x,{size:16},{default:o(()=>[t(l,{type:"link",tooltip:{title:"编辑"},onClick:L=>i.edit(e)},{default:o(()=>[t(n,{type:"EditOutlined"})]),_:2},1032,["onClick"]),t(l,{type:"link",popConfirm:{title:`确定${e.state.value==="enabled"?"禁用":"启用"}`,onConfirm:()=>i.changeStatus(e)},tooltip:{title:e.state.value==="enabled"?"禁用":"启用"}},{default:o(()=>[t(n,{type:e.state.value==="enabled"?"StopOutlined":"PlayCircleOutlined"},null,8,["type"])]),_:2},1032,["popConfirm","tooltip"]),t(l,{type:"link",tooltip:{title:e.state.value==="enabled"?"请先禁用，再删除":"删除"},popConfirm:{title:"确认删除？",onConfirm:()=>i.delete(e)},disabled:e.state.value==="enabled"},{default:o(()=>[t(n,{type:"DeleteOutlined"})]),_:2},1032,["tooltip","popConfirm","disabled"])]),_:2},1024)]),_:1},8,["request","params"]),m(r)?(y(),v(w,{key:0,visible:m(r),"onUpdate:visible":a[2]||(a[2]=e=>A(r)?r.value=e:null),data:i.seletctRow,onOk:i.refresh},null,8,["visible","data","onOk"])):q("",!0)])]),_:1})}}});const Re=j(E,[["__scopeId","data-v-6521bae7"]]);export{Re as default};
