From 0e0453eab03945b55b65f36a857210effcee5480 Mon Sep 17 00:00:00 2001 From: Defined <39450947+imaginarykhy@users.noreply.github.com> Date: Mon, 31 Oct 2022 11:19:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=88=97=E8=A1=A8=20(#24)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Notify/NotifyList.vue | 60 ++++++++++++++++++++++++++-- src/components/Notify/data.ts | 24 +++++------ src/components/Notify/index.vue | 9 +++-- 3 files changed, 74 insertions(+), 19 deletions(-) diff --git a/src/components/Notify/NotifyList.vue b/src/components/Notify/NotifyList.vue index 7f794f8..95ae75a 100644 --- a/src/components/Notify/NotifyList.vue +++ b/src/components/Notify/NotifyList.vue @@ -1,5 +1,59 @@ - + - + + + diff --git a/src/components/Notify/data.ts b/src/components/Notify/data.ts index e43d738..c9d3bc0 100644 --- a/src/components/Notify/data.ts +++ b/src/components/Notify/data.ts @@ -1,4 +1,4 @@ -export interface ListItem { +export interface IListItem { avatar?: string title: string datetime?: string @@ -7,59 +7,59 @@ export interface ListItem { extra?: string } -export const notifyData: ListItem[] = [ +export const notifyData: IListItem[] = [ { - avatar: "https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png", + avatar: "https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png", title: "V3 Admin Vite 上线啦", datetime: "半年前", description: "一个免费开源的中后台管理系统基础解决方案,基于 Vue3、TypeScript、Element Plus、Pinia 和 Vite 等主流技术" }, { - avatar: "https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png", + avatar: "https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png", title: "V3 Admin 上线啦", datetime: "一年前", description: "一个中后台管理系统基础解决方案,基于 Vue3、TypeScript、Element Plus 和 Pinia" } ] -export const messageData: ListItem[] = [ +export const messageData: IListItem[] = [ { - avatar: "https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png", + avatar: "https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png", title: "来自楚门的世界", description: "如果再也不能见到你,祝你早安、午安和晚安", datetime: "1998-06-05" }, { - avatar: "https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png", + avatar: "https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png", title: "来自大话西游", description: "如果非要在这份爱上加上一个期限,我希望是一万年", datetime: "1995-02-04" }, { - avatar: "https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png", + avatar: "https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png", title: "来自龙猫", description: "心存善意,定能途遇天使", datetime: "1988-04-16" } ] -export const todoData: ListItem[] = [ +export const todoData: IListItem[] = [ { title: "任务名称", - description: "任务描述", + description: "这家伙很懒,什么都没留下", extra: "未开始", status: "info" }, { title: "任务名称", - description: "任务描述", + description: "这家伙很懒,什么都没留下", extra: "进行中", status: "" }, { title: "任务名称", - description: "任务描述", + description: "这家伙很懒,什么都没留下", extra: "已超时", status: "danger" } diff --git a/src/components/Notify/index.vue b/src/components/Notify/index.vue index 3806385..82fb8c1 100644 --- a/src/components/Notify/index.vue +++ b/src/components/Notify/index.vue @@ -3,13 +3,14 @@ import { ref, computed } from "vue" import { ElMessage } from "element-plus" import { Bell } from "@element-plus/icons-vue" import NotifyList from "./NotifyList.vue" +import { type IListItem, notifyData, messageData, todoData } from "./data" type TabNameType = "通知" | "消息" | "待办" interface IDataItem { name: TabNameType type: "primary" | "success" | "warning" | "danger" | "info" - list: any[] + list: IListItem[] } /** 角标当前值 */ @@ -32,19 +33,19 @@ const data = ref([ { name: "通知", type: "primary", - list: [] + list: notifyData }, // 消息数据 { name: "消息", type: "danger", - list: [] + list: messageData }, // 待办数据 { name: "待办", type: "warning", - list: [] + list: todoData } ])