mirror of
https://github.com/fumiama/paper-manager.git
synced 2026-06-20 02:16:22 +08:00
add /api/getMessageList
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<Card title="我的消息" v-bind="$attrs">
|
||||
<List item-layout="horizontal" :data-source="dynamicInfoItems">
|
||||
<List item-layout="horizontal" :data-source="dynamicInfoItemsRef">
|
||||
<template #renderItem="{ item }">
|
||||
<ListItem>
|
||||
<ListItemMeta>
|
||||
@@ -8,11 +8,20 @@
|
||||
{{ item.date }}
|
||||
</template>
|
||||
<!-- eslint-disable-next-line -->
|
||||
<template #title> {{ item.name }} <span v-html="item.desc"> </span> </template>
|
||||
<template #title> <span v-html="item.text"> </span> </template>
|
||||
<template #avatar>
|
||||
<Icon :icon="item.avatar" :size="30" />
|
||||
<Avatar :src="item.avatar || headerImg" :size="36" />
|
||||
</template>
|
||||
</ListItemMeta>
|
||||
<a-button
|
||||
ghost
|
||||
color="success"
|
||||
v-if="
|
||||
item.type in [MessageTypeEnum.MessageRegister, MessageTypeEnum.MessageResetPassword]
|
||||
"
|
||||
>接受</a-button
|
||||
>
|
||||
|
||||
<a-button ghost color="error">删除</a-button>
|
||||
</ListItem>
|
||||
</template>
|
||||
@@ -20,10 +29,17 @@
|
||||
</Card>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { Card, List } from 'ant-design-vue'
|
||||
import { dynamicInfoItems } from './data'
|
||||
import { Icon } from '/@/components/Icon'
|
||||
import { getMessageList } from '/@/api/dashboard/index'
|
||||
import { MessageTypeEnum, MessageItem } from '/@/api/dashboard/model/workbenchModel'
|
||||
import { Avatar } from 'ant-design-vue'
|
||||
import headerImg from '/@/assets/images/header.jpg'
|
||||
|
||||
const ListItem = List.Item
|
||||
const ListItemMeta = List.Item.Meta
|
||||
const dynamicInfoItemsRef = ref([] as MessageItem[])
|
||||
getMessageList().then((value) => {
|
||||
dynamicInfoItemsRef.value = value
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user