import{av as E,aw as b,ax as B}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{_ as D}from"./index.170379627897313.js";import"./index.170379627897319.js";import"./index.170379627897327.js";import{n as J}from"./template.1703796278973.js";import{M,N as R}from"./const.1703796278973.js";import{d as j,k as h,m as z,r as v,o as q,x as A,b as n,z as r,a as s,y as F,u as d,j as K,A as m,t as L,F as O}from"./vue.1703796278973.js";const V={style:{height:"400px","overflow-y":"auto"}},G=["src"],H={style:{"font-size":"16px","font-weight":"600"}},Y=r("div",{class:"card-item-content-text"}," 通知方式 ",-1),$=r("div",{class:"card-item-content-text"},"说明",-1),_e=j({__name:"NotifyTemplate",props:{notifierId:{type:String,default:""},value:{type:String,default:""}},emits:["update:value","change","update:detail"],setup(f,{emit:l}){const p=f,y=(e,i)=>{var t;return(t=M[e].find(c=>c.value===i))==null?void 0:t.logo},x=e=>{var i;return(i=R.find(t=>t.value===e))==null?void 0:i.label},u=h({}),o=h([]),_=[{title:"名称",dataIndex:"name",key:"name",search:{type:"string"}},{title:"ID",dataIndex:"id",key:"id",search:{type:"string"}},{title:"说明",dataIndex:"description",key:"description",search:{type:"string"}}],w=e=>{u.value=e},C=e=>{o.value.includes(e.id)?(o.value=[],l("update:value",void 0),l("change",{templateName:void 0}),l("update:detail",void 0)):(o.value=[e.id],l("update:value",e.id),l("change",{templateName:e==null?void 0:e.name}),l("update:detail",e))},S=e=>{o.value=[...e]},T=async e=>{const i=[{name:"id",value:p.value},{name:"createTime",order:"desc"}],t=await J.getListByConfigId(p.notifierId,{...e,sorts:i});return{code:t.message,result:{data:t.result?t.result:[],pageIndex:0,pageSize:t.result.length,total:t.result.length},status:t.status}};return z(()=>p.value,e=>{e?o.value=[e]:o.value=[]},{deep:!0,immediate:!0}),(e,i)=>{const t=v("pro-search"),c=v("Ellipsis"),g=E,I=b,N=D,k=B;return q(),A(O,null,[n(t,{columns:_,type:"simple",target:"action-notice-template",onSearch:w,class:"action-search"}),r("div",V,[n(k,{columns:_,request:a=>T(a),model:"CARD",bodyStyle:{padding:0},params:d(u),gridColumn:2,noPagination:!0,rowSelection:{selectedRowKeys:d(o),onChange:S}},{card:s(a=>[n(N,F({showStatus:!1,value:a,showTool:!1,actions:[]},a,{onClick:C,active:d(o).includes(a.id)}),{img:s(()=>[K(e.$slots,"img",{},()=>[r("img",{src:y(a.type,a.provider),class:"notify-logo"},null,8,G)])]),content:s(()=>[n(c,{style:{width:"calc(100% - 100px)"}},{default:s(()=>[r("span",H,m(a.name),1)]),_:2},1024),n(I,null,{default:s(()=>[n(g,{span:12},{default:s(()=>[Y,r("div",null,m(x(a.type)),1)]),_:2},1024),n(g,{span:12},{default:s(()=>[$,n(c,null,{default:s(()=>[L(m(a.description),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1040,["value","active"])]),_:3},8,["request","params","rowSelection"])])],64)}}});export{_e as _};
