Browse Source
Merge branch 'milestone-20251104-现金二期' of http://39.101.133.168:8807/huangqizhen/gold-vue into milestone-20251104-现金二期
zhangrenyuan/feature-20251104133449-现金管理二期
Merge branch 'milestone-20251104-现金二期' of http://39.101.133.168:8807/huangqizhen/gold-vue into milestone-20251104-现金二期
zhangrenyuan/feature-20251104133449-现金管理二期
5 changed files with 247 additions and 100 deletions
-
92src/components/dialogs/MessageDialog.vue
-
4src/components/dialogs/changePassword.vue
-
8src/views/audit/bean/beanAudit.vue
-
55src/views/home.vue
-
8src/views/moneyManage/receiveDetail/receiveService.vue
@ -0,0 +1,92 @@ |
|||||
|
<script setup> |
||||
|
import { ref, onMounted } from 'vue' |
||||
|
import API from '@/util/http.js' // 假设你已有请求工具 |
||||
|
|
||||
|
const emit = defineEmits(['close', 'update-dot']) |
||||
|
const dialogRef = ref(null) |
||||
|
|
||||
|
// 模拟接口返回消息数据 |
||||
|
const messages = ref([]) |
||||
|
|
||||
|
// 获取消息接口 |
||||
|
async function getMessages() { |
||||
|
try { |
||||
|
const res = await API({ url: '/getMessages', method: 'GET' }) |
||||
|
if (res.code === 200) { |
||||
|
messages.value = res.data |
||||
|
// 如果有未读消息,通知父组件显示红点 |
||||
|
const hasUnread = messages.value.some(msg => !msg.read) |
||||
|
// emit('update-dot', false) |
||||
|
}else { |
||||
|
|
||||
|
// emit('update-dot', false) |
||||
|
|
||||
|
} |
||||
|
} catch (e) { |
||||
|
emit('update-dot', false) |
||||
|
console.error('获取消息失败:', e) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
onMounted(() => { |
||||
|
getMessages() |
||||
|
}) |
||||
|
|
||||
|
function closeDialog() { |
||||
|
emit('close') |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<template> |
||||
|
<dialog class="message-dialog" open> |
||||
|
<div class="dialog-content"> |
||||
|
<h3>消息中心</h3> |
||||
|
<div v-if="messages.length > 0"> |
||||
|
<!-- <div |
||||
|
v-for="msg in messages" |
||||
|
:key="msg.id" |
||||
|
class="msg-item" |
||||
|
:class="{ unread: !msg.read }" |
||||
|
> |
||||
|
{{ msg.title }} |
||||
|
</div>--> |
||||
|
<div> |
||||
|
测试测试 |
||||
|
</div> |
||||
|
</div> |
||||
|
<div v-else>测试测试</div> |
||||
|
|
||||
|
<div class="dialog-footer"> |
||||
|
<el-button type="primary" @click="closeDialog">关闭</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</dialog> |
||||
|
</template> |
||||
|
|
||||
|
<style scoped> |
||||
|
.message-dialog { |
||||
|
border: none; |
||||
|
border-radius: 10px; |
||||
|
background: rgba(255, 255, 255, 0.96); |
||||
|
box-shadow: 0 0 20px rgba(0, 0, 0, 0.25); |
||||
|
width: 380px; |
||||
|
z-index: 99999; |
||||
|
} |
||||
|
.dialog-content { |
||||
|
padding: 20px; |
||||
|
} |
||||
|
.msg-item { |
||||
|
padding: 6px 0; |
||||
|
} |
||||
|
.msg-item.unread { |
||||
|
font-weight: bold; |
||||
|
color: #409eff; |
||||
|
} |
||||
|
.dialog-footer { |
||||
|
text-align: right; |
||||
|
margin-top: 20px; |
||||
|
} |
||||
|
::backdrop { |
||||
|
background-color: rgba(0, 0, 0, 0.4); |
||||
|
} |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue