更新密码找回uniapp

This commit is contained in:
hero920103 committed 2026-11-16 17:22:50 +08:00
1 parent 7f9a66da0f
commit 3fdda89833
1304 files changed
+3503 -26132

No files matched your search

-19
View File
@@ -1,8 +1,6 @@
<template>
<view class="oa-dash">
<!-- ============ 上半:公告 + 数据统计 ============ -->
<template v-if="part !== 'bottom'">
<!-- 通知公告 -->
<view class="dash-card">
<view class="dash-head">
<view class="dash-head-left">
@@ -20,7 +18,6 @@
<FaIcon name="bullhorn" color="#c0c4cc" :size="24" />
<text class="dash-empty-text">暂无公告</text>
</view>
<!-- 单行垂直轮播公告 -->
<swiper
v-else
class="notice-swiper"
@@ -45,7 +42,6 @@
</swiper>
</view>
<!-- 数据统计:待办 + 报销 -->
<view class="dash-card">
<view class="dash-head">
<view class="dash-head-left">
@@ -56,7 +52,6 @@
</view>
</view>
<!-- 待办 -->
<view class="stat-tile" @tap="emit('view-schedules')">
<view class="stat-tile-head">
<view class="tile-icon ti-todo">
@@ -85,7 +80,6 @@
</view>
</view>
<!-- 报销 -->
<view class="stat-tile">
<view class="stat-tile-head">
<view class="tile-icon ti-money">
@@ -107,7 +101,6 @@
</view>
</template>
<!-- ============ 下半:报销趋势 + 状态分布 ============ -->
<template v-else>
<view v-if="trend.length || statusList.length" class="dash-card">
<view class="dash-head">
@@ -132,7 +125,6 @@
</view>
</view>
<!-- 状态分布 -->
<view v-if="statusList.length" class="status-block">
<text class="status-title">状态分布</text>
<view v-for="s in statusList" :key="s.key" class="dist-row">
@@ -154,21 +146,18 @@ import FaIcon from '@/components/FaIcon.vue'
const props = defineProps({
data: { type: Object, default: () => ({}) },
// top:公告 + 数据统计;bottom:报销趋势 + 状态分布(中间由首页插入「常用功能」)
part: { type: String, default: 'top' }
})
const emit = defineEmits(['view-notices', 'view-schedules'])
const num = (v) => Number(v || 0)
// ---------- 待办概览 ----------
const ss = computed(() => props.data?.schedule_stats || {})
const overdue = computed(() => num(ss.value.overdue))
const todayPending = computed(() => num(ss.value.today_total) - num(ss.value.today_done))
const weekPending = computed(() => num(ss.value.week_total) - num(ss.value.week_done))
const monthPending = computed(() => num(ss.value.month_total) - num(ss.value.month_done))
// ---------- 报销 ----------
const emptyStat = () => ({ total: 0, paid: 0, unpaid: 0, count: 0 })
const rb = computed(() => props.data?.reimburse || {})
const moneyCards = computed(() => [
@@ -177,7 +166,6 @@ const moneyCards = computed(() => [
{ label: '本年', data: rb.value.year || emptyStat() }
])
// ---------- 趋势(近6月,堆叠柱) ----------
const trend = computed(() => rb.value.trend || [])
const trendMax = computed(() => {
let m = 1
@@ -188,7 +176,6 @@ const MAX_BAR = 160
const barH = (v) => Math.round((num(v) / trendMax.value) * MAX_BAR) + 'rpx'
const monthLabel = (m) => String(m || '').slice(5) + '月'
// ---------- 状态分布 ----------
const statusColors = { 0: '#94a3b8', 1: '#f59e0b', 2: '#10b981', 3: '#ef4444', 4: '#94a3b8', 5: '#2563eb' }
const statusColor = (k) => statusColors[Number(k)] || '#94a3b8'
const statusList = computed(() => {
@@ -200,14 +187,12 @@ const statusList = computed(() => {
.map((x) => ({ ...x, pct: Math.round((num(x.count) / total) * 100) + '%' }))
})
// ---------- 公告 ----------
const notices = computed(() => props.data?.notices || [])
const noticeTypeLabel = (type) => ({ 1: '公告', 2: '活动' }[type] || '通知')
const pad2 = (n) => String(n).padStart(2, '0')
const fmtDate = (d) => `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`
// 公告右侧时间:今天显示 HH:mm,本年显示 M/D,跨年显示 YYYY-M-D
function noticeTime(ts) {
if (!ts) return ''
const d = new Date(String(ts).replace(/-/g, '/'))
@@ -305,7 +290,6 @@ const money = (value) =>
color: $color-text-muted;
}
/* ============ 数据统计:待办 / 报销 双磁贴 ============ */
.stat-tile {
padding: 20rpx 20rpx 8rpx;
border-radius: $radius-md;
@@ -397,7 +381,6 @@ const money = (value) =>
white-space: nowrap;
}
/* ============ 趋势柱状 ============ */
.legend {
display: flex;
gap: 16rpx;
@@ -470,7 +453,6 @@ const money = (value) =>
color: $color-text-muted;
}
/* ============ 状态分布 ============ */
.status-block {
margin-top: 26rpx;
padding-top: 22rpx;
@@ -522,7 +504,6 @@ const money = (value) =>
white-space: nowrap;
}
/* ============ 公告(单行垂直轮播) ============ */
.notice-swiper {
height: 68rpx;
}