index-b1470566.js
7.66 KB
import{d as $,k as z,e as b,u as C,w as K,a8 as o,_ as s,a9 as m,aa as i,$ as u,ab as P,f as d,a0 as w,ag as L,E as G,a1 as f,ac as T,F as S,a2 as O}from"./vue-5a35c3f5.js";import{h as x,aK as R,_ as F,a as A}from"./index.js";import{ax as N,av as h,bx as E,aR as D,a2 as M,bW as q,af as B,b5 as I}from"./antd-6b087f69.js";const j=[{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"}]}],V=$({components:{[N.name]:N,[h.name]:h,[h.Item.name]:h.Item,AListItemMeta:h.Item.Meta,ATypographyParagraph:E.Paragraph,[D.name]:D},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:g}){const{prefixCls:y}=x("header-notify-list"),r=z(t.currentPage||1),_=b(()=>{const{pageSize:a,list:c}=t;if(a===!1)return[];let p=R(a)?a:5;return c.slice(p*(C(r)-1),p*C(r))});K(()=>t.currentPage,a=>{r.value=a});const n=b(()=>!!t.onTitleClick),l=b(()=>{const{list:a,pageSize:c}=t;return c>0&&a&&a.length>c?{total:a.length,pageSize:c,current:C(r),onChange(p){r.value=p,g("update:currentPage",p)}}:!1});function v(a){t.onTitleClick&&t.onTitleClick(a)}return{prefixCls:y,getPagination:l,getData:_,handleTitleClick:v,isTitleClickable:n}}});const X={class:"title"},H={key:0,class:"extra"},U={key:1},W={key:0,class:"description"},J={class:"datetime"};function Y(t,g,y,r,_,n){const l=o("a-typography-paragraph"),v=o("a-tag"),a=o("a-avatar"),c=o("a-list-item-meta"),p=o("a-list-item"),k=o("a-list");return s(),m(k,{class:O(t.prefixCls),bordered:"",pagination:t.getPagination},{default:i(()=>[(s(!0),u(S,null,P(t.getData,e=>(s(),m(p,{key:e.id,class:"list-item"},{default:i(()=>[d(c,null,{title:i(()=>[w("div",X,[d(l,{onClick:at=>t.handleTitleClick(e),style:L([{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?(s(),u("div",H,[d(v,{class:"tag",color:e.color},{default:i(()=>[G(f(e.extra),1)]),_:2},1032,["color"])])):T("v-if",!0)])]),avatar:i(()=>[e.avatar?(s(),m(a,{key:0,class:"avatar",src:e.avatar},null,8,["src"])):(s(),u("span",U,f(e.avatar),1))]),description:i(()=>[w("div",null,[e.description?(s(),u("div",W,[d(l,{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"])])):T("v-if",!0),w("div",J,f(e.datetime),1)])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["class","pagination"])}const Z=F(V,[["render",Y],["__scopeId","data-v-a3482e6e"],["__file","E:/allcode/erp/test7901/order-erp-front/src/layouts/default/header/components/notify/NoticeList.vue"]]),Q=$({components:{Popover:M,BellOutlined:q,Tabs:B,TabPane:B.TabPane,Badge:I,NoticeList:Z},setup(){const{prefixCls:t}=x("header-notify"),{createMessage:g}=A(),y=z(j),r=b(()=>{let n=0;for(let l=0;l<j.length;l++)n+=j[l].list.length;return n});function _(n){g.success("你点击了通知,ID="+n.id),n.titleDelete=!n.titleDelete}return{prefixCls:t,listData:y,count:r,onNoticeClick:_,numberStyle:{}}}});const tt={key:0};function et(t,g,y,r,_,n){const l=o("BellOutlined"),v=o("Badge"),a=o("NoticeList"),c=o("TabPane"),p=o("Tabs"),k=o("Popover");return s(),u("div",{class:O(t.prefixCls)},[d(k,{title:"",trigger:"click",overlayClassName:`${t.prefixCls}__overlay`},{content:i(()=>[d(p,null,{default:i(()=>[(s(!0),u(S,null,P(t.listData,e=>(s(),m(c,{key:e.key},{tab:i(()=>[G(f(e.name)+" ",1),e.list.length!==0?(s(),u("span",tt,"("+f(e.list.length)+")",1)):T("v-if",!0)]),default:i(()=>[e.key==="1"?(s(),m(a,{key:0,list:e.list,onTitleClick:t.onNoticeClick},null,8,["list","onTitleClick"])):(s(),m(a,{key:1,list:e.list},null,8,["list"]))]),_:2},1024))),128))]),_:1})]),default:i(()=>[d(v,{count:t.count,dot:"",numberStyle:t.numberStyle},{default:i(()=>[d(l)]),_:1},8,["count","numberStyle"])]),_:1},8,["overlayClassName"])],2)}const nt=F(Q,[["render",et],["__file","E:/allcode/erp/test7901/order-erp-front/src/layouts/default/header/components/notify/index.vue"]]);export{nt as default};