index-1fb55fe8.js 8.8 KB

1
  1. import{fS as i,fT as D,fU as $,fV as G,fW as x,fX as E,g as y,A as K,d as A,bp as N,bs as h,bb as P,c as L,r as M,e as k,bR as X,f as j,a3 as H,j as V,o as l,q as _,y as r,m as v,D as F,F as R,s as q,k as c,af as w,ah as U,v as I,w as b,t as B,aj as W,b9 as S,bj as J,bz as Y}from"./index-610a1d46.js";import"./index-74f93929.js";i.Text=D;i.Title=$;i.Paragraph=G;i.Link=x;i.Base=E;i.install=function(t){return t.component(i.name,i),t.component(i.Text.displayName,D),t.component(i.Title.displayName,$),t.component(i.Paragraph.displayName,G),t.component(i.Link.displayName,x),t};var Z={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M816 768h-24V428c0-141.1-104.3-257.7-240-277.1V112c0-22.1-17.9-40-40-40s-40 17.9-40 40v38.9c-135.7 19.4-240 136-240 277.1v340h-24c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h216c0 61.8 50.2 112 112 112s112-50.2 112-112h216c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM512 888c-26.5 0-48-21.5-48-48h96c0 26.5-21.5 48-48 48zM304 768V428c0-55.6 21.6-107.8 60.9-147.1S456.4 220 512 220c55.6 0 107.8 21.6 147.1 60.9S720 372.4 720 428v340H304z"}}]},name:"bell",theme:"outlined"};const Q=Z;function z(t){for(var a=1;a<arguments.length;a++){var n=arguments[a]!=null?Object(arguments[a]):{},o=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(p){return Object.getOwnPropertyDescriptor(n,p).enumerable}))),o.forEach(function(p){tt(t,p,n[p])})}return t}function tt(t,a,n){return a in t?Object.defineProperty(t,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[a]=n,t}var O=function(a,n){var o=z({},a,n.attrs);return y(K,z({},o,{icon:Q}),null)};O.displayName="BellOutlined";O.inheritAttrs=!1;const et=O,T=[{key:"1",name:"通知",list:[{id:"000000001",avatar:"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",title:"你收到了 14 份新周报",description:"",datetime:"2017-08-09",type:"1"},{id:"000000002",avatar:"https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png",title:"你推荐的 曲妮妮 已通过第三轮面试",description:"",datetime:"2017-08-08",type:"1"},{id:"000000003",avatar:"https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png",title:"这种模板可以区分多种通知类型",description:"",datetime:"2017-08-07",type:"1"},{id:"000000004",avatar:"https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png",title:"左侧图标用于区分不同的类型",description:"",datetime:"2017-08-07",type:"1"},{id:"000000005",avatar:"https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png",title:"标题可以设置自动显示省略号,本例中标题行数已设为1行,如果内容超过1行将自动截断并支持tooltip显示完整标题。",description:"",datetime:"2017-08-07",type:"1"},{id:"000000006",avatar:"https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png",title:"左侧图标用于区分不同的类型",description:"",datetime:"2017-08-07",type:"1"},{id:"000000007",avatar:"https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png",title:"左侧图标用于区分不同的类型",description:"",datetime:"2017-08-07",type:"1"},{id:"000000008",avatar:"https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png",title:"左侧图标用于区分不同的类型",description:"",datetime:"2017-08-07",type:"1"},{id:"000000009",avatar:"https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png",title:"左侧图标用于区分不同的类型",description:"",datetime:"2017-08-07",type:"1"},{id:"000000010",avatar:"https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png",title:"左侧图标用于区分不同的类型",description:"",datetime:"2017-08-07",type:"1"}]},{key:"2",name:"消息",list:[{id:"000000006",avatar:"https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg",title:"曲丽丽 评论了你",description:"描述信息描述信息描述信息",datetime:"2017-08-07",type:"2",clickClose:!0},{id:"000000007",avatar:"https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg",title:"朱偏右 回复了你",description:"这种模板用于提醒谁与你发生了互动",datetime:"2017-08-07",type:"2",clickClose:!0},{id:"000000008",avatar:"https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg",title:"标题",description:"请将鼠标移动到此处,以便测试超长的消息在此处将如何处理。本例中设置的描述最大行数为2,超过2行的描述内容将被省略并且可以通过tooltip查看完整内容",datetime:"2017-08-07",type:"2",clickClose:!0}]},{key:"3",name:"待办",list:[{id:"000000009",avatar:"",title:"任务名称",description:"任务需要在 2017-01-12 20:00 前启动",datetime:"",extra:"未开始",color:"",type:"3"},{id:"000000010",avatar:"",title:"第三方紧急代码变更",description:"冠霖 需在 2017-01-07 前完成代码变更任务",datetime:"",extra:"马上到期",color:"red",type:"3"},{id:"000000011",avatar:"",title:"信息安全考试",description:"指派竹尔于 2017-01-09 前完成更新并发布",datetime:"",extra:"已耗时 8 天",color:"gold",type:"3"},{id:"000000012",avatar:"",title:"ABCD 版本发布",description:"指派竹尔于 2017-01-09 前完成更新并发布",datetime:"",extra:"进行中",color:"blue",type:"3"}]}],at=A({components:{[N.name]:N,[h.name]:h,[h.Item.name]:h.Item,AListItemMeta:h.Item.Meta,ATypographyParagraph:i.Paragraph,[P.name]:P},props:{list:{type:Array,default:()=>[]},pageSize:{type:[Boolean,Number],default:5},currentPage:{type:Number,default:1},titleRows:{type:Number,default:1},descRows:{type:Number,default:2},onTitleClick:{type:Function}},emits:["update:currentPage"],setup(t,{emit:a}){const{prefixCls:n}=L("header-notify-list"),o=M(t.currentPage||1),p=k(()=>{const{pageSize:s,list:m}=t;if(s===!1)return[];let g=X(s)?s:5;return m.slice(g*(j(o)-1),g*j(o))});H(()=>t.currentPage,s=>{o.value=s});const d=k(()=>!!t.onTitleClick),u=k(()=>{const{list:s,pageSize:m}=t;return m>0&&s&&s.length>m?{total:s.length,pageSize:m,current:j(o),onChange(g){o.value=g,a("update:currentPage",g)}}:!1});function f(s){t.onTitleClick&&t.onTitleClick(s)}return{prefixCls:n,getPagination:u,getData:p,handleTitleClick:f,isTitleClickable:d}}});const st={class:"title"},nt={key:0,class:"extra"},ot={key:1},it={key:0,class:"description"},lt={class:"datetime"};function rt(t,a,n,o,p,d){const u=c("a-typography-paragraph"),f=c("a-tag"),s=c("a-avatar"),m=c("a-list-item-meta"),g=c("a-list-item"),C=c("a-list");return l(),_(C,{class:q(t.prefixCls),bordered:"",pagination:t.getPagination},{default:r(()=>[(l(!0),v(R,null,F(t.getData,e=>(l(),_(g,{key:e.id,class:"list-item"},{default:r(()=>[y(m,null,{title:r(()=>[w("div",st,[y(u,{onClick:mt=>t.handleTitleClick(e),style:U([{width:"100%","margin-bottom":"0 !important"},{cursor:t.isTitleClickable?"pointer":""}]),delete:!!e.titleDelete,ellipsis:t.$props.titleRows&&t.$props.titleRows>0?{rows:t.$props.titleRows,tooltip:!!e.title}:!1,content:e.title},null,8,["onClick","style","delete","ellipsis","content"]),e.extra?(l(),v("div",nt,[y(f,{class:"tag",color:e.color},{default:r(()=>[I(b(e.extra),1)]),_:2},1032,["color"])])):B("",!0)])]),avatar:r(()=>[e.avatar?(l(),_(s,{key:0,class:"avatar",src:e.avatar},null,8,["src"])):(l(),v("span",ot,b(e.avatar),1))]),description:r(()=>[w("div",null,[e.description?(l(),v("div",it,[y(u,{style:{width:"100%","margin-bottom":"0 !important"},ellipsis:t.$props.descRows&&t.$props.descRows>0?{rows:t.$props.descRows,tooltip:!!e.description}:!1,content:e.description},null,8,["ellipsis","content"])])):B("",!0),w("div",lt,b(e.datetime),1)])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["class","pagination"])}const ct=V(at,[["render",rt],["__scopeId","data-v-052e7fb7"]]),pt=A({components:{Popover:W,BellOutlined:et,Tabs:S,TabPane:S.TabPane,Badge:J,NoticeList:ct},setup(){const{prefixCls:t}=L("header-notify"),{createMessage:a}=Y(),n=M(T),o=k(()=>{let d=0;for(let u=0;u<T.length;u++)d+=T[u].list.length;return d});function p(d){a.success("你点击了通知,ID="+d.id),d.titleDelete=!d.titleDelete}return{prefixCls:t,listData:n,count:o,onNoticeClick:p,numberStyle:{}}}});const dt={key:0};function ut(t,a,n,o,p,d){const u=c("BellOutlined"),f=c("Badge"),s=c("NoticeList"),m=c("TabPane"),g=c("Tabs"),C=c("Popover");return l(),v("div",{class:q(t.prefixCls)},[y(C,{title:"",trigger:"click",overlayClassName:`${t.prefixCls}__overlay`},{content:r(()=>[y(g,null,{default:r(()=>[(l(!0),v(R,null,F(t.listData,e=>(l(),_(m,{key:e.key},{tab:r(()=>[I(b(e.name)+" ",1),e.list.length!==0?(l(),v("span",dt,"("+b(e.list.length)+")",1)):B("",!0)]),default:r(()=>[e.key==="1"?(l(),_(s,{key:0,list:e.list,onTitleClick:t.onNoticeClick},null,8,["list","onTitleClick"])):(l(),_(s,{key:1,list:e.list},null,8,["list"]))]),_:2},1024))),128))]),_:1})]),default:r(()=>[y(f,{count:t.count,dot:"",numberStyle:t.numberStyle},{default:r(()=>[y(u)]),_:1},8,["count","numberStyle"])]),_:1},8,["overlayClassName"])],2)}const vt=V(pt,[["render",ut]]);export{vt as default};