更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<!-- ============ Hero 头部 ============ -->
|
||||
<view class="hero" :style="headPad">
|
||||
<view class="hero-glow hero-glow-1" />
|
||||
<view class="hero-glow hero-glow-2" />
|
||||
@@ -20,9 +19,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- ============ 内容区 ============ -->
|
||||
<view class="body">
|
||||
<!-- KPI 数据条(悬浮压在 Hero 上) -->
|
||||
<view class="kpi">
|
||||
<view
|
||||
v-for="item in kpiList"
|
||||
@@ -35,7 +32,6 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 数据加载失败提示(避免把接口故障误显示成「尚未配置」) -->
|
||||
<view v-if="loadError" class="err-box" @tap="loadAll">
|
||||
<FaIcon name="triangle-exclamation" color="#f04438" :size="18" />
|
||||
<view class="err-body">
|
||||
@@ -45,7 +41,6 @@
|
||||
<FaIcon name="rotate" color="#f04438" :size="16" />
|
||||
</view>
|
||||
|
||||
<!-- 应用:按模块分组,每组一个 card,组头 + 组内一行 4 个功能 -->
|
||||
<view class="block">
|
||||
<view class="block-head">
|
||||
<text class="block-title">应用</text>
|
||||
@@ -96,7 +91,6 @@
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 常用功能:宫格卡(一行 4 个) -->
|
||||
<view class="block">
|
||||
<view class="block-head">
|
||||
<text class="block-title">常用功能</text>
|
||||
@@ -130,7 +124,6 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 今日待办 -->
|
||||
<view class="block">
|
||||
<view class="block-head">
|
||||
<text class="block-title">今日待办</text>
|
||||
@@ -160,7 +153,6 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 最近动态 -->
|
||||
<view v-if="activities.length" class="block">
|
||||
<view class="block-head">
|
||||
<text class="block-title">最近动态</text>
|
||||
@@ -195,7 +187,6 @@ import { openMenu, resolveNativeRoute } from '@/utils/nav.js'
|
||||
import { request } from '@/api/request.js'
|
||||
import AppTabbar from '@/components/MainTabbar.vue'
|
||||
|
||||
/** 公共菜单(无 module 归属)的协作工具图标 */
|
||||
const TOOL_ICONS = ['note-sticky', 'calendar-days', 'file-lines', 'clock-rotate-left', 'chart-line']
|
||||
|
||||
const loading = ref(true)
|
||||
@@ -206,8 +197,6 @@ const stats = ref({ todo: 0, overdue: 0, note: 0, message: 0, reimburse: 0 })
|
||||
const pendingList = ref([])
|
||||
const activities = ref([])
|
||||
|
||||
/* ==================== 派生数据 ==================== */
|
||||
|
||||
const greeting = computed(() => {
|
||||
const h = new Date().getHours()
|
||||
const slot = h < 6 ? '夜深了' : h < 11 ? '早上好' : h < 13 ? '中午好' : h < 18 ? '下午好' : '晚上好'
|
||||
@@ -215,7 +204,6 @@ const greeting = computed(() => {
|
||||
return name ? slot + ',' + name : slot
|
||||
})
|
||||
|
||||
/** 统一账号:企业 · 账号 · 角色(账号在全平台各系统通用) */
|
||||
const orgLine = computed(() => {
|
||||
const parts = []
|
||||
if (user.value.tenant) parts.push(user.value.tenant)
|
||||
@@ -226,24 +214,15 @@ const orgLine = computed(() => {
|
||||
|
||||
const badgeText = computed(() => (stats.value.message > 99 ? '99+' : String(stats.value.message || '')))
|
||||
|
||||
/** 叶子菜单(可直接跳转的功能页) */
|
||||
const leafMenus = computed(() => menus.value.filter((m) => m.leaf !== false && !m.locked))
|
||||
|
||||
/**
|
||||
* 按「一级分类目录」归组(与子系统功能页 SubFunctions.vue 一致):
|
||||
* 菜单层级形如 模块根 → 个人办公 → 通讯录,分组取一级目录名(个人办公 / 人事管理 …);
|
||||
* 模块根仅作容器被跳过;无分类归属的顶层功能统一归入「常用功能」。
|
||||
* 祖先链需在「全部菜单」里查找(目录不是叶子,不在 leafMenus 中)。
|
||||
*/
|
||||
const moduleGroups = computed(() => {
|
||||
const byId = {}
|
||||
menus.value.forEach((m) => {
|
||||
byId[m.id] = m
|
||||
})
|
||||
// 只有叶子菜单才是可点功能;目录只作分组标题
|
||||
const leaves = leafMenus.value.slice().sort((a, b) => (a.sort || 0) - (b.sort || 0))
|
||||
|
||||
// 取该菜单所属的「一级分组」节点(自底向上找到链上最顶层节点)
|
||||
function groupNodeOf(m) {
|
||||
const chain = [m]
|
||||
let cur = m
|
||||
@@ -254,12 +233,9 @@ const moduleGroups = computed(() => {
|
||||
}
|
||||
const top = chain[0]
|
||||
if (top.pid === 0) {
|
||||
// 模块根在列表内:跳过根,取它下一层(个人办公 / 人事管理 …)
|
||||
if (chain.length >= 2) return chain[1]
|
||||
// 顶层节点自身:目录容器跳过,叶子归入「常用功能」
|
||||
return top.leaf === false ? null : top
|
||||
}
|
||||
// 模块根不在列表内:链上顶层节点本身就是一级分组
|
||||
return top
|
||||
}
|
||||
|
||||
@@ -270,7 +246,6 @@ const moduleGroups = computed(() => {
|
||||
const g = groupNodeOf(m)
|
||||
if (!g) return
|
||||
if (g.id === m.id) {
|
||||
// 无分类归属的顶层散装功能
|
||||
common.items.push(m)
|
||||
return
|
||||
}
|
||||
@@ -288,7 +263,6 @@ const moduleGroups = computed(() => {
|
||||
if (common.items.length) all.push(common)
|
||||
all.push(...dirGroups)
|
||||
|
||||
// 工作台只展示 2 行(一行 4 个),更多功能留给「全部应用」页
|
||||
return all.map((group, gi) => ({
|
||||
...group,
|
||||
icon: group.icon || 'file-lines',
|
||||
@@ -299,14 +273,8 @@ const moduleGroups = computed(() => {
|
||||
}))
|
||||
})
|
||||
|
||||
/**
|
||||
* 协作工具:真正无模块归属的公共菜单(如后续新增的通用功能)。
|
||||
* 系统设置类与已归入模块的菜单都不在这里,避免把日志/角色/字典等后台配置
|
||||
* 和业务功能混在一块。
|
||||
*/
|
||||
const commonMenus = computed(() => menus.value.filter((m) => !m.module && m.leaf !== false).slice(0, 6))
|
||||
|
||||
/** 常用应用:端上原生页面优先,再补各模块首个功能 */
|
||||
const quickApps = computed(() => {
|
||||
const picked = []
|
||||
const seen = new Set()
|
||||
@@ -337,8 +305,6 @@ const kpiList = computed(() => [
|
||||
{ label: '我的笔记', value: stats.value.note || 0, warn: false, tap: () => openMenu({ title: '记事本' }) }
|
||||
])
|
||||
|
||||
/* ==================== 数据加载 ==================== */
|
||||
|
||||
async function loadHome() {
|
||||
try {
|
||||
const data = await fetchHome()
|
||||
@@ -383,13 +349,6 @@ async function loadAll() {
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
/* ==================== 交互 ==================== */
|
||||
|
||||
/**
|
||||
* 点击应用卡片 → 进入该功能系统。
|
||||
* 优先进入模块下的第一个功能页(各模块的仪表盘/首页,即系统入口),
|
||||
* 没有功能页时回落到模块自身 path。
|
||||
*/
|
||||
function onModuleTap(group) {
|
||||
if (group.locked) {
|
||||
openMenu({ locked: true, title: group.name })
|
||||
@@ -410,8 +369,6 @@ function goSchedules() {
|
||||
uni.navigateTo({ url: '/pages/tools/schedule/index' })
|
||||
}
|
||||
|
||||
/* ==================== 工具 ==================== */
|
||||
|
||||
function isOverdue(item) {
|
||||
const t = String(item.schedule_time || item.created_at || '')
|
||||
return t.length >= 10 && t.slice(0, 10) < todayStr()
|
||||
@@ -451,8 +408,6 @@ function formatTime(dateStr) {
|
||||
return d.getMonth() + 1 + '/' + d.getDate()
|
||||
}
|
||||
|
||||
/* ==================== 生命周期 ==================== */
|
||||
|
||||
onMounted(() => {
|
||||
if (!isLoggedIn()) {
|
||||
uni.reLaunch({ url: '/pages/login/login' })
|
||||
@@ -473,11 +428,8 @@ onShow(() => {
|
||||
@include page-shell;
|
||||
}
|
||||
|
||||
/* ============ Hero ============ */
|
||||
.hero {
|
||||
position: relative;
|
||||
/* 与 .kpi 显式分层:不依赖渲染器对 position:relative 同级元素的隐式绘制顺序,
|
||||
否则部分 WebView 下 .kpi 的负边距上移部分会被本层裁掉 */
|
||||
z-index: 1;
|
||||
flex-shrink: 0;
|
||||
padding: calc(var(--status-bar-height, 44px) + 28rpx) $page-padding-x 76rpx;
|
||||
@@ -586,7 +538,6 @@ onShow(() => {
|
||||
color: $color-text-muted;
|
||||
}
|
||||
|
||||
/* ============ 内容区 ============ */
|
||||
.body {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
@@ -595,8 +546,6 @@ onShow(() => {
|
||||
padding: 0 $page-padding-x;
|
||||
}
|
||||
|
||||
/* KPI 悬浮卡 */
|
||||
/* KPI 悬浮卡:上移量 = 顶部内边距,保证数字恰好落在 Hero 下边缘之后 */
|
||||
.kpi {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
@@ -643,7 +592,6 @@ onShow(() => {
|
||||
color: $color-text-muted;
|
||||
}
|
||||
|
||||
/* ============ 加载失败提示 ============ */
|
||||
.err-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -675,7 +623,6 @@ onShow(() => {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
/* ============ 区块通用 ============ */
|
||||
.block {
|
||||
margin-top: 36rpx;
|
||||
}
|
||||
@@ -718,7 +665,6 @@ onShow(() => {
|
||||
color: $color-text-muted;
|
||||
}
|
||||
|
||||
/* ============ 分组卡:外层一个 card,组头 + 组内一行 4 个功能 ============ */
|
||||
.group-card {
|
||||
@include card;
|
||||
padding: 24rpx 20rpx 8rpx;
|
||||
@@ -773,9 +719,6 @@ onShow(() => {
|
||||
color: $color-text-muted;
|
||||
}
|
||||
|
||||
/* ============ 功能宫格:一行 4 个 ============
|
||||
cell 占 25% 宽并自带右侧间隙,容器用负 margin 抵消末列间隙,
|
||||
避免使用 calc 除法——小程序端 wxss 对复杂 calc 支持不稳。 */
|
||||
.quick-card {
|
||||
@include card;
|
||||
padding: 24rpx 20rpx 8rpx;
|
||||
@@ -829,7 +772,6 @@ onShow(() => {
|
||||
color: $color-text-muted;
|
||||
}
|
||||
|
||||
/* ============ 列表(待办 / 动态) ============ */
|
||||
.list-card {
|
||||
@include card;
|
||||
overflow: hidden;
|
||||
|
||||
Reference in new issue
Block a user