MOC移动端页面
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
VITE_API_BASE_URL=/api
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
VITE_API_BASE_URL=/api
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
dist-ssr
|
||||||
|
*.local
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/extensions.json
|
||||||
|
.idea
|
||||||
|
.DS_Store
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"recommendations": ["Vue.volar"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# Vue 3 + TypeScript + Vite
|
||||||
|
|
||||||
|
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
||||||
|
|
||||||
|
Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
|
||||||
+88
@@ -0,0 +1,88 @@
|
|||||||
|
# mocmobile 项目 TODO List
|
||||||
|
|
||||||
|
> 技术栈:Vant 4 + Vite 8 + Vue 3 + TypeScript
|
||||||
|
|
||||||
|
## ✅ 已完成
|
||||||
|
|
||||||
|
### 基础架构
|
||||||
|
- [x] 使用 Vite + Vue 3 + TypeScript 初始化项目
|
||||||
|
- [x] 集成 Vant 4 移动端 UI 组件库(按需自动引入)
|
||||||
|
- [x] 配置 `@` 路径别名(`src/`)
|
||||||
|
- [x] 配置环境变量(`.env.development` / `.env.production`)
|
||||||
|
|
||||||
|
### 路由与权限
|
||||||
|
- [x] 集成 Vue Router,路由懒加载
|
||||||
|
- [x] 全局前置守卫:未登录跳转登录页,已登录不可访问登录页
|
||||||
|
- [x] 白名单路由放行
|
||||||
|
- [x] 登录后跳转回来源页(`redirect` 参数)
|
||||||
|
- [x] 路由 `meta.title` 自动设置页面标题
|
||||||
|
|
||||||
|
### 接口请求封装
|
||||||
|
- [x] 基于 axios 封装统一请求实例
|
||||||
|
- [x] 请求拦截器:自动携带 token(`Authorization: Bearer`)
|
||||||
|
- [x] 响应拦截器:统一处理 `code`、错误提示、401 自动登出
|
||||||
|
- [x] 支持 `loading` 配置(Vant Toast loading)
|
||||||
|
- [x] 标准响应结构 `ApiResult<T> { code, message, data }`
|
||||||
|
|
||||||
|
### 移动端适配
|
||||||
|
- [x] 配置 `postcss-px-to-viewport-8-plugin`(设计稿 375px)
|
||||||
|
- [x] `px` 自动转换为 `vw`,字体同样自适应
|
||||||
|
- [x] viewport meta 禁止缩放、适配刘海屏(`viewport-fit=cover`)
|
||||||
|
|
||||||
|
### 页面
|
||||||
|
- [x] 登录页:用户名 + 密码,Vant Form 校验,loading 状态
|
||||||
|
- [x] 404 页面
|
||||||
|
- [x] 403 无权限页面(`/403`,已加入路由白名单)
|
||||||
|
- [x] 站内消息页:汇总卡与页签固定,仅列表滚动,上拉加载(40 条,10 条/页)
|
||||||
|
- [x] 变更查看页:筛选/排序区固定,仅列表滚动,上拉加载(40 条,10 条/页)
|
||||||
|
- [x] 拍照上传页
|
||||||
|
- [x] 变更详情页:返回板块固定、下方内容滚动,详情/进度/等级判定/判定说明跳转
|
||||||
|
- [x] 变更进度页:6 节点时间轴,头部与详情页一致
|
||||||
|
- [x] 等级判定页:判定汇总条 + 评估维度评分表
|
||||||
|
- [x] 判定说明页:AI 判定结论、命中/排除规则、知识库引用、免责说明
|
||||||
|
|
||||||
|
### 用户状态
|
||||||
|
- [x] Token 持久化(localStorage)
|
||||||
|
- [x] 基于 Vue reactive 的轻量用户状态管理
|
||||||
|
|
||||||
|
## 📋 待办 / 可扩展
|
||||||
|
|
||||||
|
### 登录相关
|
||||||
|
- [ ] 接入真实登录接口(当前 `/user/login` 为占位)
|
||||||
|
- [x] 密码显示/隐藏切换
|
||||||
|
- [ ] 记住用户名
|
||||||
|
- [ ] 图形验证码 / 短信验证码
|
||||||
|
- [ ] 第三方登录(微信等)
|
||||||
|
|
||||||
|
### 状态管理
|
||||||
|
- [ ] 引入 Pinia 替代轻量 reactive store(如需复杂状态)
|
||||||
|
- [ ] 用户信息持久化(刷新页面后恢复)
|
||||||
|
- [ ] 权限点 / 角色管理
|
||||||
|
|
||||||
|
### 请求层
|
||||||
|
- [ ] 请求重试机制
|
||||||
|
- [ ] 请求取消(AbortController)
|
||||||
|
- [ ] 请求防抖 / 节流
|
||||||
|
- [ ] 大文件上传 / 下载进度
|
||||||
|
|
||||||
|
### 工程化
|
||||||
|
- [ ] ESLint + Prettier 代码规范
|
||||||
|
- [ ] 提交规范(husky + commitlint + lint-staged)
|
||||||
|
- [ ] 单元测试(Vitest)
|
||||||
|
- [ ] CI/CD 配置
|
||||||
|
- [ ] 打包体积分析(rollup-plugin-visualizer)
|
||||||
|
|
||||||
|
### 体验优化
|
||||||
|
- [ ] 骨架屏
|
||||||
|
- [ ] 路由切换动画
|
||||||
|
- [ ] 图片懒加载
|
||||||
|
- [ ] 离线缓存(Service Worker / PWA)
|
||||||
|
- [ ] 暗黑模式
|
||||||
|
|
||||||
|
### 功能模块
|
||||||
|
- [ ] 首页业务接口对接(首页已删除,待确定落地页后对接)
|
||||||
|
- [x] 列表页(搜索、分页、空状态)
|
||||||
|
- [x] 详情页(路由参数 id 传参)
|
||||||
|
- [x] 上拉加载(van-list 无限滚动)
|
||||||
|
- [ ] 个人信息编辑
|
||||||
|
- [ ] 修改密码
|
||||||
Vendored
+36
@@ -0,0 +1,36 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
// @ts-nocheck
|
||||||
|
// biome-ignore lint: disable
|
||||||
|
// oxlint-disable
|
||||||
|
// ------
|
||||||
|
// Generated by unplugin-vue-components
|
||||||
|
// Read more: https://github.com/vuejs/core/pull/3399
|
||||||
|
|
||||||
|
export {}
|
||||||
|
|
||||||
|
/* prettier-ignore */
|
||||||
|
declare module 'vue' {
|
||||||
|
export interface GlobalComponents {
|
||||||
|
AppHeader: typeof import('./src/components/common/AppHeader.vue')['default']
|
||||||
|
AppTabbar: typeof import('./src/components/common/AppTabbar.vue')['default']
|
||||||
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
|
RouterView: typeof import('vue-router')['RouterView']
|
||||||
|
VanButton: typeof import('vant/es')['Button']
|
||||||
|
VanCell: typeof import('vant/es')['Cell']
|
||||||
|
VanCellGroup: typeof import('vant/es')['CellGroup']
|
||||||
|
VanEmpty: typeof import('vant/es')['Empty']
|
||||||
|
VanField: typeof import('vant/es')['Field']
|
||||||
|
VanForm: typeof import('vant/es')['Form']
|
||||||
|
VanIcon: typeof import('vant/es')['Icon']
|
||||||
|
VanImage: typeof import('vant/es')['Image']
|
||||||
|
VanList: typeof import('vant/es')['List']
|
||||||
|
VanLoading: typeof import('vant/es')['Loading']
|
||||||
|
VanNavBar: typeof import('vant/es')['NavBar']
|
||||||
|
VanPicker: typeof import('vant/es')['Picker']
|
||||||
|
VanPopup: typeof import('vant/es')['Popup']
|
||||||
|
VanSearch: typeof import('vant/es')['Search']
|
||||||
|
VanTabbar: typeof import('vant/es')['Tabbar']
|
||||||
|
VanTabbarItem: typeof import('vant/es')['TabbarItem']
|
||||||
|
VanTag: typeof import('vant/es')['Tag']
|
||||||
|
}
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
|
<meta
|
||||||
|
name="viewport"
|
||||||
|
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, viewport-fit=cover"
|
||||||
|
/>
|
||||||
|
<meta name="format-detection" content="telephone=no" />
|
||||||
|
<title>mocmobile</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script type="module" src="/src/main.ts"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Generated
+2636
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"name": "mocmobile",
|
||||||
|
"private": true,
|
||||||
|
"version": "0.0.0",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite",
|
||||||
|
"build": "vue-tsc -b && vite build",
|
||||||
|
"preview": "vite preview"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"axios": "^1.20.0",
|
||||||
|
"vant": "^4.10.2",
|
||||||
|
"vue": "^3.5.42",
|
||||||
|
"vue-router": "^5.4.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^24.13.3",
|
||||||
|
"@vant/auto-import-resolver": "^1.3.0",
|
||||||
|
"@vitejs/plugin-vue": "^6.0.8",
|
||||||
|
"@vue/tsconfig": "^0.9.1",
|
||||||
|
"postcss-px-to-viewport-8-plugin": "^1.2.5",
|
||||||
|
"typescript": "~6.0.2",
|
||||||
|
"unplugin-vue-components": "^32.1.0",
|
||||||
|
"vite": "^8.3.0",
|
||||||
|
"vue-tsc": "^3.3.11"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import pxToViewport from 'postcss-px-to-viewport-8-plugin'
|
||||||
|
|
||||||
|
// 移动端自适应:将 px 转换为 vw
|
||||||
|
export default {
|
||||||
|
plugins: [
|
||||||
|
pxToViewport({
|
||||||
|
unitToConvert: 'px', // 需要转换的单位
|
||||||
|
viewportWidth: 375, // 设计稿宽度,通常为 iPhone 6 宽度
|
||||||
|
viewportHeight: 667, // 设计稿高度(可选)
|
||||||
|
unitPrecision: 5, // 转换后保留的小数位数
|
||||||
|
propList: ['*'], // 需要转换的属性,* 表示全部
|
||||||
|
viewportUnit: 'vw', // 转换后的单位
|
||||||
|
fontViewportUnit: 'vw', // 字体使用的单位
|
||||||
|
selectorBlackList: ['.ignore-', '.hairlines'], // 不转换的类名
|
||||||
|
minPixelValue: 1, // 最小转换像素值
|
||||||
|
mediaQuery: false, // 是否转换媒体查询中的 px
|
||||||
|
replace: true, // 是否直接替换属性值
|
||||||
|
exclude: [/node_modules/], // 排除的文件
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 9.3 KiB |
@@ -0,0 +1,24 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<symbol id="bluesky-icon" viewBox="0 0 16 17">
|
||||||
|
<g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
|
||||||
|
<defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="discord-icon" viewBox="0 0 20 19">
|
||||||
|
<path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="documentation-icon" viewBox="0 0 21 20">
|
||||||
|
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
|
||||||
|
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
|
||||||
|
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="github-icon" viewBox="0 0 19 19">
|
||||||
|
<path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="social-icon" viewBox="0 0 20 20">
|
||||||
|
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
|
||||||
|
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
|
||||||
|
</symbol>
|
||||||
|
<symbol id="x-icon" viewBox="0 0 19 19">
|
||||||
|
<path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
|
||||||
|
</symbol>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 4.9 KiB |
@@ -0,0 +1,6 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<router-view />
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export type ChangeSort = 'apply' | 'plan' | 'status'
|
||||||
|
|
||||||
|
export interface ChangeTag {
|
||||||
|
text: string
|
||||||
|
kind: 'category' | 'level' | 'duration'
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChangeItem {
|
||||||
|
id: number
|
||||||
|
code: string
|
||||||
|
title: string
|
||||||
|
tags: ChangeTag[]
|
||||||
|
applyTime: string
|
||||||
|
workshop: string
|
||||||
|
applicant: string
|
||||||
|
plannedUse: string
|
||||||
|
statusTime: string
|
||||||
|
statusText: string
|
||||||
|
approval: '审批中' | '已审批' | '已关闭'
|
||||||
|
closed: boolean
|
||||||
|
org: string
|
||||||
|
}
|
||||||
|
export interface ChangeListParams {
|
||||||
|
kw?: string
|
||||||
|
org_id?: string
|
||||||
|
type?: string
|
||||||
|
level?: string
|
||||||
|
duration?: string
|
||||||
|
status?: string
|
||||||
|
apply_time_start?: string
|
||||||
|
apply_time_end?: string
|
||||||
|
onlyOpen?: boolean
|
||||||
|
sort?: ChangeSort
|
||||||
|
self?: number
|
||||||
|
page_num: number
|
||||||
|
page_size: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChangeListResult {
|
||||||
|
list: ChangeItem[]
|
||||||
|
total: number
|
||||||
|
allTotal: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChangeFlowNode {
|
||||||
|
title: string
|
||||||
|
person: string
|
||||||
|
time: string
|
||||||
|
status: 'done' | 'current' | 'wait'
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChangeAttachment {
|
||||||
|
name: string
|
||||||
|
size: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChangeDetail extends ChangeItem {
|
||||||
|
category: string
|
||||||
|
department: string
|
||||||
|
orgName: string
|
||||||
|
deadline: string
|
||||||
|
urgent: string
|
||||||
|
level: '重要变更' | '一般变更'
|
||||||
|
score: number
|
||||||
|
aiTag: string
|
||||||
|
content: string[]
|
||||||
|
risk: string
|
||||||
|
flow: ChangeFlowNode[]
|
||||||
|
attachments: ChangeAttachment[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChangeProgressStep {
|
||||||
|
title: string
|
||||||
|
time?: string
|
||||||
|
desc?: string
|
||||||
|
status: 'done' | 'current' | 'wait'
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChangeProgress {
|
||||||
|
id: number
|
||||||
|
code: string
|
||||||
|
title: string
|
||||||
|
approval: ChangeItem['approval']
|
||||||
|
workshop: string
|
||||||
|
applicant: string
|
||||||
|
steps: ChangeProgressStep[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GradeDimension {
|
||||||
|
name: string
|
||||||
|
score: number
|
||||||
|
reason: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChangeGrade {
|
||||||
|
id: number
|
||||||
|
level: '重要变更' | '一般变更'
|
||||||
|
totalScore: number
|
||||||
|
rows: GradeDimension[]
|
||||||
|
note: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChangeJudgeRule {
|
||||||
|
kind: 'hit' | 'exclude'
|
||||||
|
label: string
|
||||||
|
text: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChangeJudge {
|
||||||
|
id: number
|
||||||
|
aiTag: string
|
||||||
|
category: string
|
||||||
|
confidence: string
|
||||||
|
conclusion: string
|
||||||
|
rules: ChangeJudgeRule[]
|
||||||
|
references: string
|
||||||
|
disclaimer: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取变更列表
|
||||||
|
*/
|
||||||
|
export function changeListApi(params: ChangeListParams) {
|
||||||
|
return request<ChangeListResult>({
|
||||||
|
url: '/api/changes',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取变更详情
|
||||||
|
*/
|
||||||
|
export function getChangeDetail(id: number) {
|
||||||
|
return request<ChangeDetail>({
|
||||||
|
url: '/change/detail',
|
||||||
|
method: 'get',
|
||||||
|
params: { id },
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取变更进度
|
||||||
|
*/
|
||||||
|
export function getChangeProgress(id: number) {
|
||||||
|
return request<ChangeProgress>({
|
||||||
|
url: '/change/progress',
|
||||||
|
method: 'get',
|
||||||
|
params: { id },
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取变更等级判定
|
||||||
|
*/
|
||||||
|
export function getChangeGrade(id: number) {
|
||||||
|
return request<ChangeGrade>({
|
||||||
|
url: '/change/grade',
|
||||||
|
method: 'get',
|
||||||
|
params: { id },
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取变更类型判定说明
|
||||||
|
*/
|
||||||
|
export function getChangeJudge(id: number) {
|
||||||
|
return request<ChangeJudge>({
|
||||||
|
url: '/change/judge',
|
||||||
|
method: 'get',
|
||||||
|
params: { id },
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export type MessageLevel = 'warning' | 'notice' | 'system'
|
||||||
|
export type MessageTab = 'UNREAD' | 'TODO' | 'URGE'
|
||||||
|
|
||||||
|
export interface MessageItem {
|
||||||
|
id: number
|
||||||
|
type: string
|
||||||
|
level: MessageLevel
|
||||||
|
title: string
|
||||||
|
code: string
|
||||||
|
desc: string
|
||||||
|
time: string
|
||||||
|
read: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MessageStats {
|
||||||
|
unread: number
|
||||||
|
todo: number
|
||||||
|
urge: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MessageListResult extends MessageStats {
|
||||||
|
list: MessageItem[]
|
||||||
|
total: number,
|
||||||
|
unread_count: number,
|
||||||
|
todo_count: number,
|
||||||
|
urge_count: number,
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MessageListParams {
|
||||||
|
page_num: number
|
||||||
|
page_size: number
|
||||||
|
read: number
|
||||||
|
msg_type: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MessageRelated {
|
||||||
|
code: string
|
||||||
|
title: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MessageDetail extends MessageItem {
|
||||||
|
sender: string
|
||||||
|
content: string[]
|
||||||
|
related: MessageRelated | null
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取站内消息列表(分页)
|
||||||
|
*/
|
||||||
|
export function messageListApi(params: MessageListParams) {
|
||||||
|
return request<MessageListResult>({
|
||||||
|
url: '/api/notices',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全部标记为已读
|
||||||
|
*/
|
||||||
|
export function readAllMessages() {
|
||||||
|
return request<MessageStats>({
|
||||||
|
url: '/message/read-all',
|
||||||
|
method: 'post',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取消息详情
|
||||||
|
*/
|
||||||
|
export function getMessageDetail(id: number) {
|
||||||
|
return request<MessageDetail>({
|
||||||
|
url: '/message/detail',
|
||||||
|
method: 'get',
|
||||||
|
params: { id },
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export interface UploadMaterialItem {
|
||||||
|
key: string
|
||||||
|
name: string
|
||||||
|
uploaded: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UploadTaskItem {
|
||||||
|
id: number
|
||||||
|
code: string
|
||||||
|
title: string
|
||||||
|
owner: string
|
||||||
|
status: string
|
||||||
|
statusKind: 'pssr' | 'close'
|
||||||
|
materials: UploadMaterialItem[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UploadTaskResult {
|
||||||
|
list: UploadTaskItem[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UploadMaterialParams {
|
||||||
|
taskId: number
|
||||||
|
materialKey: string
|
||||||
|
fileName?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取拍照上传任务列表
|
||||||
|
*/
|
||||||
|
export function getUploadTasks() {
|
||||||
|
return request<UploadTaskResult>({
|
||||||
|
url: '/upload/tasks',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传变更资料
|
||||||
|
*/
|
||||||
|
export function uploadMaterial(data: UploadMaterialParams) {
|
||||||
|
return request<{ success: boolean }>({
|
||||||
|
url: '/upload/material',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export interface LoginParams {
|
||||||
|
username: string
|
||||||
|
password: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名密码登录
|
||||||
|
*/
|
||||||
|
export function login(data: LoginParams) {
|
||||||
|
return request({
|
||||||
|
url: '/api/auth/login',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
loading: true,
|
||||||
|
loadingText: '登录中...',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前用户信息
|
||||||
|
*/
|
||||||
|
export function getUserInfo() {
|
||||||
|
return request({
|
||||||
|
url: '/user/info',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 8.5 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
|
||||||
|
After Width: | Height: | Size: 496 B |
@@ -0,0 +1,101 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { computed } from 'vue'
|
||||||
|
import { getUserInfo } from '@/utils/auth'
|
||||||
|
import type { AppHeaderProps, HeaderUserInfo } from './types'
|
||||||
|
|
||||||
|
const { title, unread = 0 } = defineProps<AppHeaderProps>()
|
||||||
|
|
||||||
|
// 当前登录用户信息(来自本地缓存)
|
||||||
|
const userInfo = getUserInfo() as HeaderUserInfo
|
||||||
|
// 用户显示名,兼容 real_name / realname 两种字段
|
||||||
|
const displayName = computed(
|
||||||
|
() => userInfo.real_name ?? userInfo.realname ?? ''
|
||||||
|
)
|
||||||
|
// 角色名称
|
||||||
|
const roleName = computed(() => userInfo.roles?.name ?? '')
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<header class="top-bar">
|
||||||
|
<h1 class="page-title">{{ title }}</h1>
|
||||||
|
<div class="top-actions">
|
||||||
|
<button class="icon-btn" type="button">
|
||||||
|
<van-icon name="bell" class="bell" />
|
||||||
|
<span v-if="unread > 0" class="dot-badge">{{ unread }}</span>
|
||||||
|
</button>
|
||||||
|
<p class="applicant">
|
||||||
|
{{ displayName }}
|
||||||
|
<span v-if="roleName">({{ roleName }})</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.top-bar {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 10;
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-btn {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
padding: 0;
|
||||||
|
color: #3b4656;
|
||||||
|
font-size: 19px;
|
||||||
|
background: #fff;
|
||||||
|
border: none;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-shadow: 0 2px 8px rgba(31, 93, 179, 0.16);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-btn .bell {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-btn .dot-badge {
|
||||||
|
position: absolute;
|
||||||
|
top: -4px;
|
||||||
|
right: -8px;
|
||||||
|
min-width: 16px;
|
||||||
|
padding: 0 4px;
|
||||||
|
font-size: 10px;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
background: #ee4d2d;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.applicant {
|
||||||
|
padding: 3px 7px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #1f5db3;
|
||||||
|
background: #f7faff;
|
||||||
|
border: 1px solid #a9c7ef;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
import type { AppTabbarProps } from './types'
|
||||||
|
|
||||||
|
const { active, unread = 0 } = defineProps<AppTabbarProps>()
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
// tab 下标与路由路径的映射
|
||||||
|
const TAB_ROUTES = ['/messages', '/changes', '/upload'] as const
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 切换底部 tab,跳转到对应页面
|
||||||
|
* @param index - 目标 tab 下标
|
||||||
|
*/
|
||||||
|
function onChange(index: number) {
|
||||||
|
const target = TAB_ROUTES[index]
|
||||||
|
if (target && index !== active) {
|
||||||
|
router.push(target)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<van-tabbar
|
||||||
|
:model-value="active"
|
||||||
|
fixed
|
||||||
|
active-color="#1f5db3"
|
||||||
|
inactive-color="#8a94a6"
|
||||||
|
@change="onChange"
|
||||||
|
>
|
||||||
|
<van-tabbar-item icon="bell" :badge="unread || undefined">站内消息</van-tabbar-item>
|
||||||
|
<van-tabbar-item icon="apps-o">变更查看</van-tabbar-item>
|
||||||
|
<van-tabbar-item icon="photograph">拍照上传</van-tabbar-item>
|
||||||
|
</van-tabbar>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export { default as AppHeader } from './AppHeader.vue'
|
||||||
|
export { default as AppTabbar } from './AppTabbar.vue'
|
||||||
|
export type { AppHeaderProps, AppTabbarProps } from './types'
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/**
|
||||||
|
* AppHeader 组件属性
|
||||||
|
*/
|
||||||
|
export interface AppHeaderProps {
|
||||||
|
/** 页面标题 */
|
||||||
|
title: string
|
||||||
|
/** 未读消息数,为 0 时不显示角标,默认 0 */
|
||||||
|
unread?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AppTabbar 组件属性
|
||||||
|
*/
|
||||||
|
export interface AppTabbarProps {
|
||||||
|
/** 当前激活的 tab 下标:0 消息 / 1 变更查看 / 2 拍照上传 */
|
||||||
|
active: number
|
||||||
|
/** 未读消息数,为 0 时不显示角标,默认 0 */
|
||||||
|
unread?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头部展示所需的用户信息(读取自本地缓存)
|
||||||
|
*/
|
||||||
|
export interface HeaderUserInfo {
|
||||||
|
/** 用户真实姓名(新字段) */
|
||||||
|
real_name?: string
|
||||||
|
/** 用户真实姓名(旧字段,兼容用) */
|
||||||
|
realname?: string
|
||||||
|
/** 角色信息 */
|
||||||
|
roles?: {
|
||||||
|
/** 角色名称 */
|
||||||
|
name?: string
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { createApp } from 'vue'
|
||||||
|
import App from './App.vue'
|
||||||
|
import router from './router'
|
||||||
|
import 'vant/lib/index.css'
|
||||||
|
import './style.css'
|
||||||
|
|
||||||
|
const app = createApp(App)
|
||||||
|
app.use(router)
|
||||||
|
app.mount('#app')
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
|
||||||
|
import { getToken } from '@/utils/auth'
|
||||||
|
|
||||||
|
const routes: RouteRecordRaw[] = [
|
||||||
|
{
|
||||||
|
path: '/',
|
||||||
|
redirect: '/login',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/login',
|
||||||
|
name: 'Login',
|
||||||
|
component: () => import('@/views/Login.vue'),
|
||||||
|
meta: { title: '登录', requiresAuth: false },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/messages',
|
||||||
|
name: 'Messages',
|
||||||
|
component: () => import('@/views/Messages.vue'),
|
||||||
|
meta: { title: '站内消息', requiresAuth: true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/message/:id',
|
||||||
|
name: 'MessageDetail',
|
||||||
|
component: () => import('@/views/MessageDetail.vue'),
|
||||||
|
meta: { title: '消息详情', requiresAuth: true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/changes',
|
||||||
|
name: 'Changes',
|
||||||
|
component: () => import('@/views/Changes.vue'),
|
||||||
|
meta: { title: '变更查看', requiresAuth: true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/change/:id',
|
||||||
|
name: 'ChangeDetail',
|
||||||
|
component: () => import('@/views/ChangeDetail.vue'),
|
||||||
|
meta: { title: '变更详情', requiresAuth: true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/change/:id/progress',
|
||||||
|
name: 'ChangeProgress',
|
||||||
|
component: () => import('@/views/ChangeProgress.vue'),
|
||||||
|
meta: { title: '变更进度', requiresAuth: true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/change/:id/grade',
|
||||||
|
name: 'ChangeGrade',
|
||||||
|
component: () => import('@/views/ChangeGrade.vue'),
|
||||||
|
meta: { title: '等级判定', requiresAuth: true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/change/:id/judge',
|
||||||
|
name: 'ChangeJudge',
|
||||||
|
component: () => import('@/views/ChangeJudge.vue'),
|
||||||
|
meta: { title: '判定说明', requiresAuth: true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/upload',
|
||||||
|
name: 'Upload',
|
||||||
|
component: () => import('@/views/Upload.vue'),
|
||||||
|
meta: { title: '拍照上传', requiresAuth: true },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/403',
|
||||||
|
name: 'Forbidden',
|
||||||
|
component: () => import('@/views/Forbidden.vue'),
|
||||||
|
meta: { title: '无权限', requiresAuth: false },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/:pathMatch(.*)*',
|
||||||
|
name: 'NotFound',
|
||||||
|
component: () => import('@/views/NotFound.vue'),
|
||||||
|
meta: { title: '页面不存在', requiresAuth: false },
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
const router = createRouter({
|
||||||
|
history: createWebHistory(),
|
||||||
|
routes,
|
||||||
|
})
|
||||||
|
|
||||||
|
// 全局前置守卫:路由权限控制
|
||||||
|
const WHITE_LIST = ['/login', '/404', '/403']
|
||||||
|
|
||||||
|
router.beforeEach((to, _from, next) => {
|
||||||
|
// 设置页面标题
|
||||||
|
if (to.meta.title) {
|
||||||
|
document.title = to.meta.title as string
|
||||||
|
}
|
||||||
|
|
||||||
|
const hasToken = getToken()
|
||||||
|
|
||||||
|
if (hasToken) {
|
||||||
|
// 已登录,访问登录页直接跳消息页
|
||||||
|
if (to.path === '/login') {
|
||||||
|
next({ path: '/messages' })
|
||||||
|
} else {
|
||||||
|
next()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 未登录,白名单内放行,否则跳登录页
|
||||||
|
if (WHITE_LIST.includes(to.path) || to.meta.requiresAuth === false) {
|
||||||
|
next()
|
||||||
|
} else {
|
||||||
|
next(`/login?redirect=${encodeURIComponent(to.fullPath)}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export default router
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { reactive, readonly } from 'vue'
|
||||||
|
|
||||||
|
interface UserState {
|
||||||
|
token: string
|
||||||
|
userInfo: any | null
|
||||||
|
}
|
||||||
|
|
||||||
|
const state = reactive<UserState>({
|
||||||
|
token: '',
|
||||||
|
userInfo: null,
|
||||||
|
})
|
||||||
|
|
||||||
|
export function setAuth(data: any) {
|
||||||
|
state.token = data.token
|
||||||
|
state.userInfo = data.user
|
||||||
|
}
|
||||||
|
|
||||||
|
export function clearAuth() {
|
||||||
|
state.token = ''
|
||||||
|
state.userInfo = null
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useUserStore = () => readonly(state)
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
html,
|
||||||
|
body,
|
||||||
|
#app {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica,
|
||||||
|
Segoe UI, Arial, Roboto, 'PingFang SC', 'Hiragino Sans GB',
|
||||||
|
'Microsoft Yahei', sans-serif;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
background-color: #f7f8fa;
|
||||||
|
color: #323233;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: inherit;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul,
|
||||||
|
ol {
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 修复 van-popup 按需引入的样式覆盖 toast 背景(.van-popup 白底规则后加载,
|
||||||
|
与 .van-toast 同 specificity 时会赢,用双类选择器提升优先级) */
|
||||||
|
.van-popup.van-toast {
|
||||||
|
background: var(--van-toast-background);
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
// Token 存储工具
|
||||||
|
const TOKEN_KEY = 'MOC_MOBILE_TOKEN'
|
||||||
|
// 用户信息存储工具
|
||||||
|
const USER_INFO_KEY = 'MOC_MOBILE_USER_INFO'
|
||||||
|
|
||||||
|
// 获取 Token
|
||||||
|
export function getToken(): string {
|
||||||
|
return localStorage.getItem(TOKEN_KEY) || ''
|
||||||
|
}
|
||||||
|
// 设置 Token
|
||||||
|
export function setToken(token: string): void {
|
||||||
|
localStorage.setItem(TOKEN_KEY, token)
|
||||||
|
}
|
||||||
|
// 移除 Token
|
||||||
|
export function removeToken(): void {
|
||||||
|
localStorage.removeItem(TOKEN_KEY)
|
||||||
|
}
|
||||||
|
// 设置用户信息
|
||||||
|
export function setUserInfo(userInfo: any): void {
|
||||||
|
localStorage.setItem(USER_INFO_KEY, JSON.stringify(userInfo))
|
||||||
|
}
|
||||||
|
// 获取用户信息
|
||||||
|
export function getUserInfo(): any {
|
||||||
|
return JSON.parse(localStorage.getItem(USER_INFO_KEY) || '{}')
|
||||||
|
}
|
||||||
|
// 移除用户信息
|
||||||
|
export function removeUserInfo(): void {
|
||||||
|
localStorage.removeItem(USER_INFO_KEY)
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
import axios, {
|
||||||
|
type AxiosInstance,
|
||||||
|
type AxiosRequestConfig,
|
||||||
|
type InternalAxiosRequestConfig,
|
||||||
|
type AxiosResponse,
|
||||||
|
} from 'axios'
|
||||||
|
import { showToast, showLoadingToast, closeToast } from 'vant'
|
||||||
|
import { getToken, removeToken } from './auth'
|
||||||
|
import router from '@/router'
|
||||||
|
|
||||||
|
// 统一响应数据结构
|
||||||
|
export interface ApiResult<T = unknown> {
|
||||||
|
code: number
|
||||||
|
message: string
|
||||||
|
data: T
|
||||||
|
}
|
||||||
|
|
||||||
|
let url = window.location.origin;
|
||||||
|
if(import.meta.env.MODE === 'development'){
|
||||||
|
url = 'http://192.168.0.230:8086';
|
||||||
|
}
|
||||||
|
|
||||||
|
const service: AxiosInstance = axios.create({
|
||||||
|
baseURL: url,
|
||||||
|
// baseURL: import.meta.env.VITE_API_BASE_URL || '/api',
|
||||||
|
withCredentials: false,
|
||||||
|
timeout: 200000,
|
||||||
|
})
|
||||||
|
|
||||||
|
// 请求拦截器:统一携带 token
|
||||||
|
service.interceptors.request.use(
|
||||||
|
(config: InternalAxiosRequestConfig) => {
|
||||||
|
const token = getToken()
|
||||||
|
if (token && config.headers) {
|
||||||
|
config.headers.Authorization = `Bearer ${token}`
|
||||||
|
config.headers['Content-Type'] = 'application/json;application/vnd.ms-excel;application/json;charset=UTF-8';
|
||||||
|
}
|
||||||
|
return config
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
return Promise.reject(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// 响应拦截器:统一处理返回结果与错误
|
||||||
|
service.interceptors.response.use(
|
||||||
|
(response: AxiosResponse<ApiResult>) => {
|
||||||
|
const res = response.data
|
||||||
|
// 如果返回的不是标准结构,直接返回
|
||||||
|
if (res && typeof res === 'object' && 'code' in res) {
|
||||||
|
if (res.code == 200 || res.code == 0) {
|
||||||
|
return res.data as unknown as AxiosResponse
|
||||||
|
}
|
||||||
|
// 401 未授权,清除 token 跳转登录
|
||||||
|
if (res.code == 401) {
|
||||||
|
removeToken()
|
||||||
|
showToast('登录已过期,请重新登录')
|
||||||
|
router.replace('/login')
|
||||||
|
return Promise.reject(new Error(res.message || '未授权'))
|
||||||
|
}
|
||||||
|
showToast(res.message || '请求失败')
|
||||||
|
return Promise.reject(new Error(res.message || 'Error'))
|
||||||
|
}
|
||||||
|
return res as unknown as AxiosResponse
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
const status = error.response?.status
|
||||||
|
let message = error.response?.data?.message || '网络异常'
|
||||||
|
if (status == 401) {
|
||||||
|
removeToken()
|
||||||
|
message = '登录已过期,请重新登录'
|
||||||
|
router.replace('/login')
|
||||||
|
} else if (status === 403) {
|
||||||
|
message = '没有权限访问'
|
||||||
|
} else if (status === 404) {
|
||||||
|
message = '请求资源不存在'
|
||||||
|
} else if (status >= 500) {
|
||||||
|
message = '服务器异常,请稍后重试'
|
||||||
|
}
|
||||||
|
showToast(message)
|
||||||
|
return Promise.reject(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// 通用请求方法
|
||||||
|
export interface RequestOptions extends AxiosRequestConfig {
|
||||||
|
/** 是否显示 loading,默认 false */
|
||||||
|
loading?: boolean
|
||||||
|
/** loading 文案 */
|
||||||
|
loadingText?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
function request<T = unknown>(options: RequestOptions): Promise<T> {
|
||||||
|
const { loading = false, loadingText = '加载中...', ...config } = options
|
||||||
|
if (loading) {
|
||||||
|
showLoadingToast({
|
||||||
|
message: loadingText,
|
||||||
|
forbidClick: true,
|
||||||
|
duration: 0,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return service
|
||||||
|
.request<unknown, T>(config)
|
||||||
|
.then((res) => {
|
||||||
|
if (loading) closeToast()
|
||||||
|
return res as T
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default request
|
||||||
@@ -0,0 +1,673 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted, ref } from 'vue'
|
||||||
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
import { showToast } from 'vant'
|
||||||
|
import { getChangeDetail, type ChangeDetail } from '@/api/change'
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
const detail = ref<ChangeDetail | null>(null)
|
||||||
|
const loading = ref(true)
|
||||||
|
const tabbarActive = ref(1)
|
||||||
|
|
||||||
|
async function loadDetail() {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
detail.value = await getChangeDetail(Number(route.params.id))
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function goBack() {
|
||||||
|
router.back()
|
||||||
|
}
|
||||||
|
|
||||||
|
function goGrade() {
|
||||||
|
if (!detail.value) return
|
||||||
|
router.push(`/change/${detail.value.id}/grade`)
|
||||||
|
}
|
||||||
|
|
||||||
|
function goJudge() {
|
||||||
|
if (!detail.value) return
|
||||||
|
router.push(`/change/${detail.value.id}/judge`)
|
||||||
|
}
|
||||||
|
|
||||||
|
function onExport() {
|
||||||
|
showToast('导出功能建设中')
|
||||||
|
}
|
||||||
|
|
||||||
|
function onTabbarChange(index: number) {
|
||||||
|
if (index === 0) {
|
||||||
|
router.push('/messages')
|
||||||
|
} else if (index === 2) {
|
||||||
|
router.push('/upload')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(loadDetail)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="detail-page">
|
||||||
|
<header class="top-bar">
|
||||||
|
<h1 class="page-title">变更详情</h1>
|
||||||
|
<div class="top-actions">
|
||||||
|
<button class="icon-btn" type="button">
|
||||||
|
<van-icon name="bell" />
|
||||||
|
<span class="bell-badge">2</span>
|
||||||
|
</button>
|
||||||
|
<button class="applicant-btn" type="button">申请人</button>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<section v-if="!loading && detail" class="head-card">
|
||||||
|
<div class="head-main">
|
||||||
|
<button class="back-btn" type="button" @click="goBack">
|
||||||
|
<van-icon name="arrow-left" />
|
||||||
|
<span>返回</span>
|
||||||
|
</button>
|
||||||
|
<h2 class="detail-title">{{ detail.title }}</h2>
|
||||||
|
<span class="code-chip">编号:{{ detail.code }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="ai-chip">
|
||||||
|
<van-icon name="star-o" />
|
||||||
|
<span>{{ detail.aiTag }}</span>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="detail-scroll">
|
||||||
|
<van-loading v-if="loading" class="page-loading" />
|
||||||
|
|
||||||
|
<template v-else-if="detail">
|
||||||
|
<div class="tab-strip">
|
||||||
|
<button class="apply-tab" type="button">变更申请单</button>
|
||||||
|
<button class="export-btn" type="button" @click="onExport">
|
||||||
|
<van-icon name="down" />
|
||||||
|
<span>导出变更申请表</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section class="form-card">
|
||||||
|
<div class="form-row">
|
||||||
|
<span class="form-label">变更发起人</span>
|
||||||
|
<span class="form-value">{{ detail.applicant }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<span class="form-label">申请单位</span>
|
||||||
|
<span class="form-value">{{ detail.orgName }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<span class="form-label">主管部门</span>
|
||||||
|
<span class="form-value">{{ detail.department }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<span class="form-label">变更类别</span>
|
||||||
|
<span class="form-value">
|
||||||
|
{{ detail.category }}
|
||||||
|
<button class="judge-tag" type="button" @click="goJudge">判定说明</button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<span class="form-label">发起日期</span>
|
||||||
|
<span class="form-value">{{ detail.applyTime.slice(0, 10) }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<span class="form-label">计划投用日期</span>
|
||||||
|
<span class="form-value">{{ detail.plannedUse }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<span class="form-label">变更时限</span>
|
||||||
|
<span class="form-value">{{ detail.deadline }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<span class="form-label">紧急</span>
|
||||||
|
<span class="form-value">{{ detail.urgent }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-row level-row">
|
||||||
|
<span class="form-label">变更等级</span>
|
||||||
|
<div class="level-wrap">
|
||||||
|
<div class="level-line">
|
||||||
|
<span
|
||||||
|
class="radio-item"
|
||||||
|
:class="{ active: detail.level === '重要变更' }"
|
||||||
|
>
|
||||||
|
<i class="radio-dot" />
|
||||||
|
重要变更
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="radio-item"
|
||||||
|
:class="{ active: detail.level === '一般变更' }"
|
||||||
|
>
|
||||||
|
<i class="radio-dot" />
|
||||||
|
一般变更
|
||||||
|
</span>
|
||||||
|
<span class="score-badge">合计 {{ detail.score }} 分</span>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
class="grade-btn"
|
||||||
|
type="button"
|
||||||
|
@click="goGrade"
|
||||||
|
>
|
||||||
|
<van-icon name="eye-o" />
|
||||||
|
查看等级判定
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-row content-row">
|
||||||
|
<span class="form-label">变更内容</span>
|
||||||
|
<div class="form-value content-value">
|
||||||
|
<p v-for="(line, i) in detail.content" :key="i">{{ line }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section-card">
|
||||||
|
<h3 class="section-title">风险分析与措施</h3>
|
||||||
|
<p class="section-text">{{ detail.risk }}</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section-card">
|
||||||
|
<h3 class="section-title">审批流程</h3>
|
||||||
|
<div class="flow-list">
|
||||||
|
<div
|
||||||
|
v-for="(node, i) in detail.flow"
|
||||||
|
:key="i"
|
||||||
|
class="flow-item"
|
||||||
|
:class="node.status"
|
||||||
|
>
|
||||||
|
<span class="flow-dot" />
|
||||||
|
<div class="flow-body">
|
||||||
|
<div class="flow-head">
|
||||||
|
<span class="flow-title">{{ node.title }}</span>
|
||||||
|
<span class="flow-time">{{ node.time }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="flow-person">{{ node.person }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section-card">
|
||||||
|
<h3 class="section-title">附件</h3>
|
||||||
|
<div
|
||||||
|
v-for="(file, i) in detail.attachments"
|
||||||
|
:key="i"
|
||||||
|
class="file-item"
|
||||||
|
>
|
||||||
|
<van-icon name="description" class="file-icon" />
|
||||||
|
<div class="file-body">
|
||||||
|
<span class="file-name">{{ file.name }}</span>
|
||||||
|
<span class="file-size">{{ file.size }}</span>
|
||||||
|
</div>
|
||||||
|
<van-icon name="down" class="file-down" />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-tabbar
|
||||||
|
v-model="tabbarActive"
|
||||||
|
fixed
|
||||||
|
active-color="#1f5db3"
|
||||||
|
inactive-color="#8a94a6"
|
||||||
|
@change="onTabbarChange"
|
||||||
|
>
|
||||||
|
<van-tabbar-item icon="bell" badge="2">消息</van-tabbar-item>
|
||||||
|
<van-tabbar-item icon="apps-o">变更查看</van-tabbar-item>
|
||||||
|
<van-tabbar-item icon="photograph">拍照上传</van-tabbar-item>
|
||||||
|
</van-tabbar>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.detail-page {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100vh;
|
||||||
|
padding-bottom: 64px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #f4f6fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 顶部标题栏 */
|
||||||
|
.top-bar {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 17px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-btn {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 34px;
|
||||||
|
height: 34px;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #1d2430;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bell-badge {
|
||||||
|
position: absolute;
|
||||||
|
top: 1px;
|
||||||
|
right: 0;
|
||||||
|
min-width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
padding: 0 3px;
|
||||||
|
font-size: 10px;
|
||||||
|
line-height: 15px;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
background: #ee4d2d;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.applicant-btn {
|
||||||
|
padding: 5px 12px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #1d2430;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #cfd8e8;
|
||||||
|
border-radius: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 内容滚动区 */
|
||||||
|
.detail-scroll {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
padding: 10px 16px 16px;
|
||||||
|
overflow-y: auto;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-loading {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 60px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 标题卡片 */
|
||||||
|
.head-card {
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin: 12px 16px 0;
|
||||||
|
padding: 12px;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.head-main {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-btn {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
gap: 2px;
|
||||||
|
height: 32px;
|
||||||
|
padding: 0 10px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #1f5db3;
|
||||||
|
background: #f7faff;
|
||||||
|
border: 1px solid #9db9e6;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-title {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1d2430;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-chip {
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 3px 6px;
|
||||||
|
font-size: 11px;
|
||||||
|
color: #3b4a63;
|
||||||
|
background: #eef3fb;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ai-chip {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
margin-top: 10px;
|
||||||
|
padding: 3px 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #56627a;
|
||||||
|
background: #f4f5f7;
|
||||||
|
border: 1px solid #dde3ec;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 表单页签栏 */
|
||||||
|
.tab-strip {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.apply-tab {
|
||||||
|
height: 34px;
|
||||||
|
padding: 0 16px;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #fff;
|
||||||
|
background: #1f3f7a;
|
||||||
|
border: none;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.export-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
height: 32px;
|
||||||
|
padding: 0 12px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #1d2430;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #dfe6f0;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 表单卡片 */
|
||||||
|
.form-card {
|
||||||
|
margin-top: 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 12px 14px;
|
||||||
|
border-bottom: 1px solid #edf0f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-row:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-label {
|
||||||
|
flex: 0 0 30%;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #5b6678;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-value {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.judge-tag {
|
||||||
|
margin-left: 6px;
|
||||||
|
padding: 2px 6px;
|
||||||
|
font-size: 11px;
|
||||||
|
color: #1f5db3;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #9db9e6;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 变更等级 */
|
||||||
|
.level-row {
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.level-wrap {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.level-line {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio-item {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #5b6678;
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio-dot {
|
||||||
|
display: inline-block;
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #b7c1d2;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio-item.active {
|
||||||
|
color: #1f5db3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio-item.active .radio-dot {
|
||||||
|
background: #1f5db3;
|
||||||
|
border-color: #1f5db3;
|
||||||
|
box-shadow: inset 0 0 0 2px #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.score-badge {
|
||||||
|
padding: 2px 6px;
|
||||||
|
font-size: 11px;
|
||||||
|
color: #d9534f;
|
||||||
|
background: #fdecea;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade-btn {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
margin-top: 8px;
|
||||||
|
padding: 4px 9px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #a86b00;
|
||||||
|
background: #fff9e6;
|
||||||
|
border: 1px solid #f0c36d;
|
||||||
|
border-radius: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 变更内容 */
|
||||||
|
.content-row {
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-value {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-value p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 通用区块 */
|
||||||
|
.section-card {
|
||||||
|
margin-top: 12px;
|
||||||
|
padding: 14px;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
margin: 0 0 10px;
|
||||||
|
padding-left: 8px;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1d2430;
|
||||||
|
border-left: 3px solid #1f5db3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-text {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.7;
|
||||||
|
color: #3b4656;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 审批流程 */
|
||||||
|
.flow-item {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
padding-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flow-item:last-child {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flow-item::before {
|
||||||
|
position: absolute;
|
||||||
|
top: 14px;
|
||||||
|
bottom: 0;
|
||||||
|
left: 4px;
|
||||||
|
width: 1px;
|
||||||
|
content: '';
|
||||||
|
background: #e2e8f2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flow-item:last-child::before {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flow-dot {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 9px;
|
||||||
|
height: 9px;
|
||||||
|
margin-top: 5px;
|
||||||
|
background: #cfd6e0;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flow-item.done .flow-dot {
|
||||||
|
background: #1f5db3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flow-item.current .flow-dot {
|
||||||
|
background: #f0a020;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flow-body {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flow-head {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flow-title {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flow-time {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #8a94a6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flow-person {
|
||||||
|
margin-top: 3px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #5b6678;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 附件 */
|
||||||
|
.file-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
padding: 10px 0;
|
||||||
|
border-bottom: 1px solid #edf0f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-item:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-icon {
|
||||||
|
font-size: 22px;
|
||||||
|
color: #1f5db3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-body {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-name {
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #1d2430;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-size {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #8a94a6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-down {
|
||||||
|
font-size: 18px;
|
||||||
|
color: #8a94a6;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,316 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted, ref } from 'vue'
|
||||||
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
import { getChangeGrade, type ChangeGrade } from '@/api/change'
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
const grade = ref<ChangeGrade | null>(null)
|
||||||
|
const loading = ref(true)
|
||||||
|
const tabbarActive = ref(1)
|
||||||
|
|
||||||
|
async function loadGrade() {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
grade.value = await getChangeGrade(Number(route.params.id))
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function goBack() {
|
||||||
|
router.back()
|
||||||
|
}
|
||||||
|
|
||||||
|
function onTabbarChange(index: number) {
|
||||||
|
if (index === 0) {
|
||||||
|
router.push('/messages')
|
||||||
|
} else if (index === 2) {
|
||||||
|
router.push('/upload')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(loadGrade)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="grade-page">
|
||||||
|
<header class="top-bar">
|
||||||
|
<div class="head-left">
|
||||||
|
<button class="back-btn" type="button" @click="goBack">
|
||||||
|
<van-icon name="arrow-left" />
|
||||||
|
<span>返回</span>
|
||||||
|
</button>
|
||||||
|
<h1 class="page-title">等级判定</h1>
|
||||||
|
</div>
|
||||||
|
<div class="top-actions">
|
||||||
|
<button class="icon-btn" type="button">
|
||||||
|
<van-icon name="bell" />
|
||||||
|
<span class="bell-badge">2</span>
|
||||||
|
</button>
|
||||||
|
<button class="applicant-btn" type="button">申请人</button>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="grade-scroll">
|
||||||
|
<van-loading v-if="loading" class="page-loading" />
|
||||||
|
|
||||||
|
<template v-else-if="grade">
|
||||||
|
<div class="summary">
|
||||||
|
<span class="verdict" :class="grade.level === '重要变更' ? 'important' : 'general'">
|
||||||
|
判定:{{ grade.level }}
|
||||||
|
</span>
|
||||||
|
<span class="total">
|
||||||
|
合计得分 <em>{{ grade.totalScore }}</em> 分
|
||||||
|
</span>
|
||||||
|
<span class="rule">(<20 分为一般,≥20 分为重要)</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="table-card">
|
||||||
|
<table class="grade-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>评估维度</th>
|
||||||
|
<th>得分</th>
|
||||||
|
<th>评分依据</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="row in grade.rows" :key="row.name">
|
||||||
|
<td>{{ row.name }}</td>
|
||||||
|
<td class="score-cell">{{ row.score }}</td>
|
||||||
|
<td>{{ row.reason }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="note">{{ grade.note }}</p>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-tabbar
|
||||||
|
v-model="tabbarActive"
|
||||||
|
fixed
|
||||||
|
active-color="#1f5db3"
|
||||||
|
inactive-color="#8a94a6"
|
||||||
|
@change="onTabbarChange"
|
||||||
|
>
|
||||||
|
<van-tabbar-item icon="bell" badge="2">消息</van-tabbar-item>
|
||||||
|
<van-tabbar-item icon="apps-o">变更查看</van-tabbar-item>
|
||||||
|
<van-tabbar-item icon="photograph">拍照上传</van-tabbar-item>
|
||||||
|
</van-tabbar>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.grade-page {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100vh;
|
||||||
|
padding-bottom: 64px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 顶部栏 */
|
||||||
|
.top-bar {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 8px;
|
||||||
|
padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.head-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 2px;
|
||||||
|
height: 32px;
|
||||||
|
padding: 0 10px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #1f5db3;
|
||||||
|
background: #f7faff;
|
||||||
|
border: 1px solid #9db9e6;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 17px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-btn {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 34px;
|
||||||
|
height: 34px;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #1d2430;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bell-badge {
|
||||||
|
position: absolute;
|
||||||
|
top: 1px;
|
||||||
|
right: 0;
|
||||||
|
min-width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
padding: 0 3px;
|
||||||
|
font-size: 10px;
|
||||||
|
line-height: 15px;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
background: #ee4d2d;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.applicant-btn {
|
||||||
|
padding: 5px 12px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #1d2430;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #cfd8e8;
|
||||||
|
border-radius: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 内容滚动区 */
|
||||||
|
.grade-scroll {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
padding: 12px 16px 16px;
|
||||||
|
overflow-y: auto;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-loading {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 60px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 判定汇总 */
|
||||||
|
.summary {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px 8px;
|
||||||
|
padding: 10px 12px;
|
||||||
|
font-size: 12px;
|
||||||
|
background: #fdf7f3;
|
||||||
|
border: 1px solid #f6e4da;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.verdict {
|
||||||
|
padding: 2px 6px;
|
||||||
|
font-weight: 600;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.verdict.important {
|
||||||
|
color: #d9534f;
|
||||||
|
background: #fdecea;
|
||||||
|
}
|
||||||
|
|
||||||
|
.verdict.general {
|
||||||
|
color: #1f5db3;
|
||||||
|
background: #eef4ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total {
|
||||||
|
color: #3b4656;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total em {
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #d9534f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rule {
|
||||||
|
color: #8a94a6;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 评分表 */
|
||||||
|
.table-card {
|
||||||
|
margin-top: 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #dfe6f0;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade-table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
table-layout: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade-table th,
|
||||||
|
.grade-table td {
|
||||||
|
padding: 9px 10px;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.5;
|
||||||
|
text-align: left;
|
||||||
|
vertical-align: top;
|
||||||
|
border-bottom: 1px solid #e8edf5;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade-table th {
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1d2430;
|
||||||
|
background: #f5f8fc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade-table th:nth-child(1),
|
||||||
|
.grade-table td:nth-child(1) {
|
||||||
|
width: 30%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade-table th:nth-child(2),
|
||||||
|
.grade-table td:nth-child(2) {
|
||||||
|
width: 14%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade-table tbody tr:last-child td {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grade-table td {
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.score-cell {
|
||||||
|
color: #3b4656;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 底部说明 */
|
||||||
|
.note {
|
||||||
|
margin: 12px 0 0;
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #8a94a6;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,323 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted, ref } from 'vue'
|
||||||
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
import { getChangeJudge, type ChangeJudge } from '@/api/change'
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
const judge = ref<ChangeJudge | null>(null)
|
||||||
|
const loading = ref(true)
|
||||||
|
const tabbarActive = ref(1)
|
||||||
|
|
||||||
|
async function loadJudge() {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
judge.value = await getChangeJudge(Number(route.params.id))
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function goBack() {
|
||||||
|
router.back()
|
||||||
|
}
|
||||||
|
|
||||||
|
function onTabbarChange(index: number) {
|
||||||
|
if (index === 0) {
|
||||||
|
router.push('/messages')
|
||||||
|
} else if (index === 2) {
|
||||||
|
router.push('/upload')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(loadJudge)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="judge-page">
|
||||||
|
<header class="top-bar">
|
||||||
|
<div class="head-left">
|
||||||
|
<button class="back-btn" type="button" @click="goBack">
|
||||||
|
<van-icon name="arrow-left" />
|
||||||
|
<span>返回</span>
|
||||||
|
</button>
|
||||||
|
<h1 class="page-title">判定说明</h1>
|
||||||
|
</div>
|
||||||
|
<div class="top-actions">
|
||||||
|
<button class="icon-btn" type="button">
|
||||||
|
<van-icon name="bell" />
|
||||||
|
<span class="bell-badge">2</span>
|
||||||
|
</button>
|
||||||
|
<button class="applicant-btn" type="button">申请人</button>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="judge-scroll">
|
||||||
|
<van-loading v-if="loading" class="page-loading" />
|
||||||
|
|
||||||
|
<template v-else-if="judge">
|
||||||
|
<div class="chips">
|
||||||
|
<span class="ai-tag">
|
||||||
|
<i class="ai-spark">✦</i>
|
||||||
|
{{ judge.aiTag }}
|
||||||
|
</span>
|
||||||
|
<span class="chip">判定:{{ judge.category }}</span>
|
||||||
|
<span class="confidence">置信度:{{ judge.confidence }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="para"><strong>判定结论:</strong>{{ judge.conclusion }}</p>
|
||||||
|
|
||||||
|
<p class="para label">判定依据:</p>
|
||||||
|
<ul class="rules">
|
||||||
|
<li
|
||||||
|
v-for="(rule, i) in judge.rules"
|
||||||
|
:key="i"
|
||||||
|
class="rule-item"
|
||||||
|
:class="rule.kind"
|
||||||
|
>
|
||||||
|
<i class="dot" />
|
||||||
|
<span class="rule-text">
|
||||||
|
<strong>{{ rule.label }}:</strong>{{ rule.text }}
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p class="para"><strong>知识库引用:</strong>{{ judge.references }}</p>
|
||||||
|
|
||||||
|
<p class="disclaimer">{{ judge.disclaimer }}</p>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-tabbar
|
||||||
|
v-model="tabbarActive"
|
||||||
|
fixed
|
||||||
|
active-color="#1f5db3"
|
||||||
|
inactive-color="#8a94a6"
|
||||||
|
@change="onTabbarChange"
|
||||||
|
>
|
||||||
|
<van-tabbar-item icon="bell" badge="2">消息</van-tabbar-item>
|
||||||
|
<van-tabbar-item icon="apps-o">变更查看</van-tabbar-item>
|
||||||
|
<van-tabbar-item icon="photograph">拍照上传</van-tabbar-item>
|
||||||
|
</van-tabbar>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.judge-page {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100vh;
|
||||||
|
padding-bottom: 64px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 顶部栏 */
|
||||||
|
.top-bar {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 8px;
|
||||||
|
padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.head-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 2px;
|
||||||
|
height: 32px;
|
||||||
|
padding: 0 10px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #1f5db3;
|
||||||
|
background: #f7faff;
|
||||||
|
border: 1px solid #9db9e6;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 17px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-btn {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 34px;
|
||||||
|
height: 34px;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #1d2430;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bell-badge {
|
||||||
|
position: absolute;
|
||||||
|
top: 1px;
|
||||||
|
right: 0;
|
||||||
|
min-width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
padding: 0 3px;
|
||||||
|
font-size: 10px;
|
||||||
|
line-height: 15px;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
background: #ee4d2d;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.applicant-btn {
|
||||||
|
padding: 5px 12px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #1d2430;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #cfd8e8;
|
||||||
|
border-radius: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 内容滚动区 */
|
||||||
|
.judge-scroll {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
padding: 10px 16px 16px;
|
||||||
|
overflow-y: auto;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-loading {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 60px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 标签行 */
|
||||||
|
.chips {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px 8px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ai-tag {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 3px;
|
||||||
|
padding: 2px 8px;
|
||||||
|
font-size: 11.5px;
|
||||||
|
color: #5a6572;
|
||||||
|
background: #f3f4f7;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ai-spark {
|
||||||
|
font-size: 11px;
|
||||||
|
font-style: normal;
|
||||||
|
color: #7b5ce0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chip {
|
||||||
|
padding: 2px 8px;
|
||||||
|
font-size: 11.5px;
|
||||||
|
color: #1f5db3;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #9db9e6;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.confidence {
|
||||||
|
font-size: 11.5px;
|
||||||
|
color: #8a94a6;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 正文 */
|
||||||
|
.para {
|
||||||
|
margin: 0 0 10px;
|
||||||
|
font-size: 12.5px;
|
||||||
|
line-height: 1.65;
|
||||||
|
color: #3b4656;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.para strong {
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.para.label {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rules {
|
||||||
|
margin: 0 0 10px;
|
||||||
|
padding: 0;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rule-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 6px;
|
||||||
|
margin-bottom: 7px;
|
||||||
|
font-size: 12.5px;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #3b4656;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rule-item:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 4px;
|
||||||
|
height: 4px;
|
||||||
|
margin-top: 7px;
|
||||||
|
background: #1f5db3;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rule-item.exclude .dot {
|
||||||
|
background: #b0b8c6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rule-text {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rule-text strong {
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 免责说明 */
|
||||||
|
.disclaimer {
|
||||||
|
margin: 14px 0 0;
|
||||||
|
padding: 10px 12px;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #8a7340;
|
||||||
|
background: #fff9e6;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,383 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted, ref } from 'vue'
|
||||||
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
import { getChangeProgress, type ChangeProgress } from '@/api/change'
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
const progress = ref<ChangeProgress | null>(null)
|
||||||
|
const loading = ref(true)
|
||||||
|
const tabbarActive = ref(1)
|
||||||
|
|
||||||
|
async function loadProgress() {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
progress.value = await getChangeProgress(Number(route.params.id))
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function goBack() {
|
||||||
|
router.back()
|
||||||
|
}
|
||||||
|
|
||||||
|
function statusClass(status: ChangeProgress['approval']) {
|
||||||
|
if (status === '审批中') return 'pending'
|
||||||
|
if (status === '已审批') return 'approved'
|
||||||
|
return 'closed'
|
||||||
|
}
|
||||||
|
|
||||||
|
function onTabbarChange(index: number) {
|
||||||
|
if (index === 0) {
|
||||||
|
router.push('/messages')
|
||||||
|
} else if (index === 2) {
|
||||||
|
router.push('/upload')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(loadProgress)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="progress-page">
|
||||||
|
<header class="top-bar">
|
||||||
|
<div class="head-left">
|
||||||
|
<button class="back-btn" type="button" @click="goBack">
|
||||||
|
<van-icon name="arrow-left" />
|
||||||
|
<span>返回</span>
|
||||||
|
</button>
|
||||||
|
<h1 class="page-title">变更进度</h1>
|
||||||
|
</div>
|
||||||
|
<div class="top-actions">
|
||||||
|
<button class="icon-btn" type="button">
|
||||||
|
<van-icon name="bell" />
|
||||||
|
<span class="bell-badge">2</span>
|
||||||
|
</button>
|
||||||
|
<button class="applicant-btn" type="button">申请人</button>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="progress-scroll">
|
||||||
|
<van-loading v-if="loading" class="page-loading" />
|
||||||
|
|
||||||
|
<template v-else-if="progress">
|
||||||
|
<section class="progress-card">
|
||||||
|
<h2 class="change-title">{{ progress.title }}</h2>
|
||||||
|
<div class="meta-row">
|
||||||
|
<span class="code-chip">{{ progress.code }}</span>
|
||||||
|
<span
|
||||||
|
class="status-badge"
|
||||||
|
:class="statusClass(progress.approval)"
|
||||||
|
>
|
||||||
|
{{ progress.approval }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<p class="org-text">{{ progress.workshop }} · {{ progress.applicant }}</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="timeline">
|
||||||
|
<div
|
||||||
|
v-for="(step, i) in progress.steps"
|
||||||
|
:key="i"
|
||||||
|
class="step"
|
||||||
|
:class="step.status"
|
||||||
|
>
|
||||||
|
<div class="step-marker">
|
||||||
|
<van-icon v-if="step.status !== 'wait'" name="success" />
|
||||||
|
<span v-else>{{ i + 1 }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="step-body">
|
||||||
|
<h3 class="step-title">
|
||||||
|
{{ step.title }}
|
||||||
|
<em v-if="step.status === 'current'">(当前)</em>
|
||||||
|
</h3>
|
||||||
|
<p v-if="step.desc" class="step-desc">{{ step.desc }}</p>
|
||||||
|
<p v-if="step.time" class="step-time">{{ step.time }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-tabbar
|
||||||
|
v-model="tabbarActive"
|
||||||
|
fixed
|
||||||
|
active-color="#1f5db3"
|
||||||
|
inactive-color="#8a94a6"
|
||||||
|
@change="onTabbarChange"
|
||||||
|
>
|
||||||
|
<van-tabbar-item icon="bell" badge="2">消息</van-tabbar-item>
|
||||||
|
<van-tabbar-item icon="apps-o">变更查看</van-tabbar-item>
|
||||||
|
<van-tabbar-item icon="photograph">拍照上传</van-tabbar-item>
|
||||||
|
</van-tabbar>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.progress-page {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100vh;
|
||||||
|
padding-bottom: 64px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 顶部栏 */
|
||||||
|
.top-bar {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 8px;
|
||||||
|
padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.head-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 2px;
|
||||||
|
height: 32px;
|
||||||
|
padding: 0 10px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #1f5db3;
|
||||||
|
background: #f7faff;
|
||||||
|
border: 1px solid #9db9e6;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 17px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-btn {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 34px;
|
||||||
|
height: 34px;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #1d2430;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bell-badge {
|
||||||
|
position: absolute;
|
||||||
|
top: 1px;
|
||||||
|
right: 0;
|
||||||
|
min-width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
padding: 0 3px;
|
||||||
|
font-size: 10px;
|
||||||
|
line-height: 15px;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
background: #ee4d2d;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.applicant-btn {
|
||||||
|
padding: 5px 12px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #1d2430;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #cfd8e8;
|
||||||
|
border-radius: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 内容滚动区 */
|
||||||
|
.progress-scroll {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-loading {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 60px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 变更信息卡 */
|
||||||
|
.progress-card {
|
||||||
|
margin: 16px;
|
||||||
|
padding: 14px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #e3e8f0;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.5;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.meta-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-chip {
|
||||||
|
padding: 2px 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #3b4a63;
|
||||||
|
background: #eef3fb;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-badge {
|
||||||
|
padding: 1px 7px;
|
||||||
|
font-size: 12px;
|
||||||
|
border: 1px solid;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-badge.pending {
|
||||||
|
color: #c47f00;
|
||||||
|
background: #fff8e8;
|
||||||
|
border-color: #f0c36d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-badge.approved {
|
||||||
|
color: #1f5db3;
|
||||||
|
background: #eef4ff;
|
||||||
|
border-color: #a9c4ea;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-badge.closed {
|
||||||
|
color: #7b8698;
|
||||||
|
background: #f3f5f8;
|
||||||
|
border-color: #d8dee8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.org-text {
|
||||||
|
margin: 10px 0 0;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #8a94a6;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 进度时间轴 */
|
||||||
|
.timeline {
|
||||||
|
padding: 8px 16px 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
padding-bottom: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step:last-child {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step::before {
|
||||||
|
position: absolute;
|
||||||
|
top: 24px;
|
||||||
|
bottom: 0;
|
||||||
|
left: 9px;
|
||||||
|
width: 2px;
|
||||||
|
content: '';
|
||||||
|
background: #e1e6ef;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step:last-child::before {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step.done::before {
|
||||||
|
background: #3fa34d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-marker {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
margin-top: 1px;
|
||||||
|
font-size: 11px;
|
||||||
|
color: #a7b1c0;
|
||||||
|
background: #f4f6fa;
|
||||||
|
border: 1px solid #dfe5ee;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step.done .step-marker {
|
||||||
|
color: #fff;
|
||||||
|
background: #3fa34d;
|
||||||
|
border-color: #3fa34d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step.current .step-marker {
|
||||||
|
color: #fff;
|
||||||
|
background: #1f5db3;
|
||||||
|
border-color: #1f5db3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-marker .van-icon {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-body {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
padding-top: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.4;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-title em {
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step.wait .step-title {
|
||||||
|
font-weight: 400;
|
||||||
|
color: #8a94a6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-time,
|
||||||
|
.step-desc {
|
||||||
|
margin: 6px 0 0;
|
||||||
|
font-size: 11.5px;
|
||||||
|
line-height: 1.5;
|
||||||
|
color: #8a94a6;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,658 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, computed, watch, onMounted } from 'vue'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
import { showToast } from 'vant'
|
||||||
|
import {
|
||||||
|
changeListApi,
|
||||||
|
type ChangeItem,
|
||||||
|
type ChangeSort,
|
||||||
|
} from '@/api/change'
|
||||||
|
import { AppHeader, AppTabbar } from '@/components/common'
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
const keyword = ref('')
|
||||||
|
const org = ref('')
|
||||||
|
const mode = ref<'all' | 'open'>('all')
|
||||||
|
const sort = ref<ChangeSort>('apply')
|
||||||
|
const expanded = ref(false)
|
||||||
|
const list = ref<ChangeItem[]>([])
|
||||||
|
const total = ref(0)
|
||||||
|
const loading = ref(false)
|
||||||
|
const finished = ref(false)
|
||||||
|
const page = ref(1)
|
||||||
|
const pageSize = 10
|
||||||
|
const listScroll = ref<HTMLDivElement | null>(null)
|
||||||
|
let requestId = 0
|
||||||
|
// 排序选项
|
||||||
|
const sortOptions: Array<{ key: ChangeSort; label: string }> = [
|
||||||
|
{ key: 'apply', label: '最新申请' },
|
||||||
|
{ key: 'plan', label: '计划投用' },
|
||||||
|
{ key: 'status', label: '状态更新' },
|
||||||
|
]
|
||||||
|
// 组织选项
|
||||||
|
const orgOptions: Array<{ text: string; value: string }> = [
|
||||||
|
{ text: '全部组织', value: '' },
|
||||||
|
{ text: '一车间', value: '一车间' },
|
||||||
|
{ text: '二车间', value: '二车间' },
|
||||||
|
{ text: '三车间', value: '三车间' },
|
||||||
|
]
|
||||||
|
// 组织选择器显隐
|
||||||
|
const showOrgPicker = ref(false)
|
||||||
|
// 当前组织显示文本
|
||||||
|
const orgLabel = computed(
|
||||||
|
() =>
|
||||||
|
orgOptions.find((item) => item.value === org.value)?.text ?? '全部组织'
|
||||||
|
)
|
||||||
|
// 确认组织选择
|
||||||
|
function onOrgConfirm(params: {
|
||||||
|
selectedOptions: Array<{ text: string; value: string }>
|
||||||
|
}) {
|
||||||
|
org.value = params.selectedOptions[0]?.value ?? ''
|
||||||
|
showOrgPicker.value = false
|
||||||
|
resetList()
|
||||||
|
}
|
||||||
|
// 搜索关键字变化时刷新列表
|
||||||
|
watch(keyword, resetList)
|
||||||
|
// 变更列表
|
||||||
|
async function onLoad() {
|
||||||
|
const currentRequest = requestId
|
||||||
|
try {
|
||||||
|
const res = await changeListApi({
|
||||||
|
kw: keyword.value,
|
||||||
|
org_id: org.value,
|
||||||
|
type: '',
|
||||||
|
level: '',
|
||||||
|
duration: '',
|
||||||
|
status: '',
|
||||||
|
apply_time_start: '',
|
||||||
|
apply_time_end: '',
|
||||||
|
onlyOpen: mode.value === 'open',
|
||||||
|
sort: sort.value,
|
||||||
|
self: 1,
|
||||||
|
page_num: page.value,
|
||||||
|
page_size: pageSize,
|
||||||
|
})
|
||||||
|
if (currentRequest !== requestId) return
|
||||||
|
list.value.push(...res.list)
|
||||||
|
total.value = res.total
|
||||||
|
loading.value = false
|
||||||
|
if (list.value.length >= res.total) {
|
||||||
|
finished.value = true
|
||||||
|
} else {
|
||||||
|
page.value++
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
if (currentRequest === requestId) {
|
||||||
|
// 请求失败时标记加载结束,展示空状态而非白屏
|
||||||
|
loading.value = false
|
||||||
|
finished.value = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 刷新变更列表
|
||||||
|
function resetList() {
|
||||||
|
requestId++
|
||||||
|
list.value = []
|
||||||
|
page.value = 1
|
||||||
|
finished.value = false
|
||||||
|
loading.value = true
|
||||||
|
if (listScroll.value) {
|
||||||
|
listScroll.value.scrollTop = 0
|
||||||
|
}
|
||||||
|
onLoad()
|
||||||
|
}
|
||||||
|
// 切换显示模式
|
||||||
|
function setMode(value: 'all' | 'open') {
|
||||||
|
if (mode.value === value) return
|
||||||
|
mode.value = value
|
||||||
|
resetList()
|
||||||
|
}
|
||||||
|
// 排序变更
|
||||||
|
function selectSort(key: ChangeSort) {
|
||||||
|
if (sort.value === key) return
|
||||||
|
sort.value = key
|
||||||
|
resetList()
|
||||||
|
}
|
||||||
|
// 审批状态类名
|
||||||
|
function approvalClass(value: ChangeItem['approval']) {
|
||||||
|
if (value === '审批中') return 'pending'
|
||||||
|
if (value === '已审批') return 'approved'
|
||||||
|
return 'closed'
|
||||||
|
}
|
||||||
|
// 跳转详情页
|
||||||
|
function goDetail(item: ChangeItem) {
|
||||||
|
router.push(`/change/${item.id}`)
|
||||||
|
}
|
||||||
|
// 跳转进度页
|
||||||
|
function goProgress(item: ChangeItem) {
|
||||||
|
router.push(`/change/${item.id}/progress`)
|
||||||
|
}
|
||||||
|
// 操作变更
|
||||||
|
function onAction(action: string) {
|
||||||
|
showToast(`${action}功能建设中`)
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
resetList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="changes-page">
|
||||||
|
<AppHeader title="变更查看" />
|
||||||
|
|
||||||
|
<section class="filter-card">
|
||||||
|
<div class="filter-row">
|
||||||
|
<div class="filter-title">
|
||||||
|
全部变更
|
||||||
|
<span class="count">{{ total }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-field
|
||||||
|
:model-value="orgLabel"
|
||||||
|
readonly
|
||||||
|
right-icon="arrow-down"
|
||||||
|
class="org-field"
|
||||||
|
@click="showOrgPicker = true"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="filter-row mt-10 ">
|
||||||
|
<div class="radio-item" @click="setMode('all')">
|
||||||
|
<span class="radio" :class="{ checked: mode === 'all' }" />
|
||||||
|
显示全部
|
||||||
|
</div>
|
||||||
|
<div class="radio-item" @click="setMode('open')">
|
||||||
|
<span class="radio" :class="{ checked: mode === 'open' }" />
|
||||||
|
显示未关闭
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<van-search
|
||||||
|
v-model="keyword"
|
||||||
|
class="search-box mt-10"
|
||||||
|
shape="round"
|
||||||
|
background="transparent"
|
||||||
|
placeholder="搜索变更名称 / 编号"
|
||||||
|
/>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="filter-sort" @click="expanded = !expanded">
|
||||||
|
<van-icon name="filter-o" class="fs-icon" />
|
||||||
|
<span class="fs-label">筛选与排序</span>
|
||||||
|
<span class="fs-action">{{ expanded ? '收起' : '展开' }}</span>
|
||||||
|
<van-icon
|
||||||
|
name="arrow-down"
|
||||||
|
class="fs-arrow"
|
||||||
|
:class="{ rotated: expanded }"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="expanded" class="sort-panel">
|
||||||
|
<span
|
||||||
|
v-for="item in sortOptions"
|
||||||
|
:key="item.key"
|
||||||
|
class="sort-chip"
|
||||||
|
:class="{ active: sort === item.key }"
|
||||||
|
@click="selectSort(item.key)"
|
||||||
|
>
|
||||||
|
{{ item.label }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ref="listScroll" class="list-scroll">
|
||||||
|
<van-list
|
||||||
|
v-model:loading="loading"
|
||||||
|
:finished="finished"
|
||||||
|
:finished-text="list.length ? '没有更多了' : ''"
|
||||||
|
:immediate-check="false"
|
||||||
|
@load="onLoad"
|
||||||
|
>
|
||||||
|
<div v-if="list.length > 0" class="change-list">
|
||||||
|
<article v-for="(item, index) in list" :key="item.id" class="change-card">
|
||||||
|
<div class="card-index">{{ String(index + 1).padStart(2, '0') }}</div>
|
||||||
|
|
||||||
|
<h2 class="change-title">{{ item.title }}</h2>
|
||||||
|
<div class="change-code">{{ item.code }}</div>
|
||||||
|
|
||||||
|
<div class="change-tags">
|
||||||
|
<span
|
||||||
|
v-for="tag in item.tags"
|
||||||
|
:key="tag.text"
|
||||||
|
class="tag"
|
||||||
|
:class="tag.kind"
|
||||||
|
>
|
||||||
|
{{ tag.text }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="change-info">
|
||||||
|
<div class="info-line">
|
||||||
|
<span class="info-item">
|
||||||
|
<span class="label">申请</span>
|
||||||
|
<span class="value">{{ item.applyTime }}</span>
|
||||||
|
</span>
|
||||||
|
<span class="info-item">
|
||||||
|
<span class="value">{{ item.workshop }}·{{ item.applicant }}</span>
|
||||||
|
</span>
|
||||||
|
<span class="info-item">
|
||||||
|
<span class="label">计划投用</span>
|
||||||
|
<span class="value">{{ item.plannedUse }}</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="info-line">
|
||||||
|
<span class="info-item">
|
||||||
|
<span class="label">状态更新</span>
|
||||||
|
<span class="value">{{ item.statusTime }}</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="status-text">{{ item.statusText }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-footer">
|
||||||
|
<div class="actions">
|
||||||
|
<button
|
||||||
|
class="btn btn-withdraw"
|
||||||
|
type="button"
|
||||||
|
@click="onAction('撤回')"
|
||||||
|
>
|
||||||
|
撤回
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn btn-detail"
|
||||||
|
type="button"
|
||||||
|
@click="goDetail(item)"
|
||||||
|
>
|
||||||
|
详情
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn btn-progress"
|
||||||
|
type="button"
|
||||||
|
@click="goProgress(item)"
|
||||||
|
>
|
||||||
|
进度
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<span class="approval-tag" :class="approvalClass(item.approval)">
|
||||||
|
{{ item.approval }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-empty v-else-if="finished" description="暂无变更" image-size="100" />
|
||||||
|
</van-list>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-popup v-model:show="showOrgPicker" position="bottom" round>
|
||||||
|
<van-picker
|
||||||
|
title="选择组织"
|
||||||
|
:columns="orgOptions"
|
||||||
|
@confirm="onOrgConfirm"
|
||||||
|
@cancel="showOrgPicker = false"
|
||||||
|
/>
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
<AppTabbar :active="1" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.changes-page {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100vh;
|
||||||
|
padding-bottom: 64px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #f4f6fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 筛选卡片 */
|
||||||
|
.filter-card {
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin: 10px;
|
||||||
|
padding: 10px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #e0e8f4;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 2px 8px rgba(31, 93, 179, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mt-10 {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-title {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1f5db3;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-title .count {
|
||||||
|
margin-left: 2px;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.org-field {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: auto;
|
||||||
|
margin-left: auto;
|
||||||
|
padding: 0;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.org-field :deep(.van-field__control) {
|
||||||
|
min-width: 64px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #4e5868;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.org-field :deep(.van-field__right-icon .van-icon) {
|
||||||
|
margin-right: 0;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #8a94a6;
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #4e5868;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio {
|
||||||
|
position: relative;
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #c6cfdd;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio.checked {
|
||||||
|
background: #1f5db3;
|
||||||
|
border-color: #1f5db3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio.checked::after {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
content: '';
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-box {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-box :deep(.van-search__content) {
|
||||||
|
padding-left: 10px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #dfe6f0;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-box :deep(.van-field__control) {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-box :deep(.van-field__control::placeholder) {
|
||||||
|
color: #a8b1bf;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 筛选与排序 */
|
||||||
|
.filter-sort {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
margin: 0 10px;
|
||||||
|
padding: 0 10px;
|
||||||
|
height: 40px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #cfdaeb;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fs-icon {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #3b4656;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fs-label {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fs-action {
|
||||||
|
margin-left: auto;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #5f6b7a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fs-arrow {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #8a94a6;
|
||||||
|
transition: transform 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fs-arrow.rotated {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sort-panel {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
margin: 4px 10px 0;
|
||||||
|
padding: 10px;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sort-chip {
|
||||||
|
padding: 5px 12px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #5f6b7a;
|
||||||
|
background: #f1f4f9;
|
||||||
|
border-radius: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sort-chip.active {
|
||||||
|
color: #1f5db3;
|
||||||
|
background: #e6f0ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 可滚动列表区域 */
|
||||||
|
.list-scroll {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 变更列表 */
|
||||||
|
.change-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 12px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-card {
|
||||||
|
padding: 14px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #e6ebf3;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 2px 8px rgba(31, 93, 179, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-index {
|
||||||
|
margin-bottom: 6px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #a9b2c0;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 1.45;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-code {
|
||||||
|
margin-top: 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #8a94a6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-tags {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 6px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
padding: 2px 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag.category {
|
||||||
|
color: #2f6fb2;
|
||||||
|
background: #fafcff;
|
||||||
|
border: 1px solid #9db8dd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag.level {
|
||||||
|
color: #d9534f;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #e6a79c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag.duration {
|
||||||
|
color: #fff;
|
||||||
|
background: #1f3f7a;
|
||||||
|
border: 1px solid #1f3f7a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.change-info {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-line {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 4px 12px;
|
||||||
|
margin-top: 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-item {
|
||||||
|
display: inline-flex;
|
||||||
|
gap: 4px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
color: #4e5868;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
color: #7b8595;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-text {
|
||||||
|
margin-top: 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #7b8595;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-footer {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
height: 28px;
|
||||||
|
padding: 0 14px;
|
||||||
|
font-size: 12px;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-withdraw {
|
||||||
|
color: #d9534f;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #f0b3aa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-detail {
|
||||||
|
color: #fff;
|
||||||
|
background: #1e3f7d;
|
||||||
|
border: 1px solid #1e3f7d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-progress {
|
||||||
|
color: #1f5db3;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #9db8dd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.approval-tag {
|
||||||
|
margin-left: auto;
|
||||||
|
padding: 3px 10px;
|
||||||
|
font-size: 12px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.approval-tag.pending {
|
||||||
|
color: #d89b1c;
|
||||||
|
background: #fff4d8;
|
||||||
|
border: 1px solid #f3d58c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.approval-tag.approved {
|
||||||
|
color: #2e9b5b;
|
||||||
|
background: #eaf8ef;
|
||||||
|
border: 1px solid #b6e2c6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.approval-tag.closed {
|
||||||
|
color: #7b8595;
|
||||||
|
background: #f1f3f7;
|
||||||
|
border: 1px solid #dfe3ea;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="forbidden">
|
||||||
|
<div class="code">403</div>
|
||||||
|
<p class="msg">抱歉,您没有权限访问该页面</p>
|
||||||
|
<van-button type="primary" round @click="router.replace('/messages')">
|
||||||
|
返回消息页
|
||||||
|
</van-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.forbidden {
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: #f7f8fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code {
|
||||||
|
font-size: 96px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #ee0a24;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg {
|
||||||
|
margin: 16px 0 32px;
|
||||||
|
color: #969799;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
import { showToast } from 'vant'
|
||||||
|
import { login, type LoginParams } from '@/api/user'
|
||||||
|
import { setToken, setUserInfo } from '@/utils/auth'
|
||||||
|
import { setAuth } from '@/store/user'
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
|
const loading = ref(false)
|
||||||
|
const showPassword = ref(false)
|
||||||
|
const form = reactive<LoginParams>({
|
||||||
|
username: '',
|
||||||
|
password: '',
|
||||||
|
})
|
||||||
|
|
||||||
|
const rules = {
|
||||||
|
username: [{ required: true, message: '请输入用户名' }],
|
||||||
|
password: [{ required: true, message: '请输入密码' }],
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onSubmit(values: LoginParams) {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const res:any = await login(values)
|
||||||
|
setToken(res.token)
|
||||||
|
setUserInfo(res)
|
||||||
|
setAuth(res)
|
||||||
|
showToast('登录成功')
|
||||||
|
const redirect = (route.query.redirect as string) || '/messages'
|
||||||
|
router.replace(redirect)
|
||||||
|
} catch {
|
||||||
|
// 错误已在拦截器中提示
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="login-page">
|
||||||
|
<div class="login-header">
|
||||||
|
<div class="logo">MOC</div>
|
||||||
|
<h1 class="title">欢迎登录</h1>
|
||||||
|
<p class="subtitle">移动端管理系统</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-form class="login-form" @submit="onSubmit">
|
||||||
|
<van-cell-group inset>
|
||||||
|
<van-field
|
||||||
|
v-model="form.username"
|
||||||
|
name="username"
|
||||||
|
label="用户名"
|
||||||
|
placeholder="请输入用户名"
|
||||||
|
:rules="rules.username"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
v-model="form.password"
|
||||||
|
:type="showPassword ? 'text' : 'password'"
|
||||||
|
name="password"
|
||||||
|
label="密码"
|
||||||
|
placeholder="请输入密码"
|
||||||
|
:rules="rules.password"
|
||||||
|
>
|
||||||
|
<template #right-icon>
|
||||||
|
<van-icon
|
||||||
|
:name="showPassword ? 'eye-o' : 'closed-eye'"
|
||||||
|
@click="showPassword = !showPassword"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
</van-cell-group>
|
||||||
|
|
||||||
|
<div class="login-btn">
|
||||||
|
<van-button
|
||||||
|
round
|
||||||
|
block
|
||||||
|
type="primary"
|
||||||
|
native-type="submit"
|
||||||
|
:loading="loading"
|
||||||
|
>
|
||||||
|
登录
|
||||||
|
</van-button>
|
||||||
|
</div>
|
||||||
|
</van-form>
|
||||||
|
|
||||||
|
<p class="tips">演示账号:admin / 123456</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.login-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
padding: 80px 24px 0;
|
||||||
|
background: linear-gradient(180deg, #1989fa 0%, #f7f8fa 40%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-header {
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
margin-bottom: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
line-height: 80px;
|
||||||
|
margin: 0 auto 16px;
|
||||||
|
border-radius: 20px;
|
||||||
|
background: #fff;
|
||||||
|
color: #1989fa;
|
||||||
|
font-size: 32px;
|
||||||
|
font-weight: bold;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subtitle {
|
||||||
|
font-size: 14px;
|
||||||
|
opacity: 0.85;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-form {
|
||||||
|
margin-top: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-btn {
|
||||||
|
padding: 32px 16px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
margin-top: 32px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #969799;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,384 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted, ref } from 'vue'
|
||||||
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
import { getMessageDetail, type MessageDetail, type MessageItem } from '@/api/message'
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
const detail = ref<MessageDetail | null>(null)
|
||||||
|
const loading = ref(true)
|
||||||
|
const tabbarActive = ref(0)
|
||||||
|
|
||||||
|
function iconOf(level: MessageItem['level']) {
|
||||||
|
const map = {
|
||||||
|
warning: 'warning-o',
|
||||||
|
notice: 'bell',
|
||||||
|
system: 'volume-o',
|
||||||
|
}
|
||||||
|
return map[level]
|
||||||
|
}
|
||||||
|
|
||||||
|
async function loadDetail() {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
detail.value = await getMessageDetail(Number(route.params.id))
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function goBack() {
|
||||||
|
router.back()
|
||||||
|
}
|
||||||
|
|
||||||
|
function goChanges() {
|
||||||
|
router.push('/changes')
|
||||||
|
}
|
||||||
|
|
||||||
|
function onTabbarChange(index: number) {
|
||||||
|
if (index === 1) {
|
||||||
|
router.push('/changes')
|
||||||
|
} else if (index === 2) {
|
||||||
|
router.push('/upload')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(loadDetail)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="detail-page">
|
||||||
|
<header class="top-bar">
|
||||||
|
<div class="head-left">
|
||||||
|
<button class="back-btn" type="button" @click="goBack">
|
||||||
|
<van-icon name="arrow-left" />
|
||||||
|
<span>返回</span>
|
||||||
|
</button>
|
||||||
|
<h1 class="page-title">消息详情</h1>
|
||||||
|
</div>
|
||||||
|
<div class="top-actions">
|
||||||
|
<button class="icon-btn" type="button">
|
||||||
|
<van-icon name="bell" />
|
||||||
|
<span class="bell-badge">2</span>
|
||||||
|
</button>
|
||||||
|
<button class="applicant-btn" type="button">申请人</button>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="detail-scroll">
|
||||||
|
<van-loading v-if="loading" class="page-loading" />
|
||||||
|
|
||||||
|
<template v-else-if="detail">
|
||||||
|
<section class="head-card">
|
||||||
|
<div class="head-top">
|
||||||
|
<span class="msg-icon" :class="detail.level">
|
||||||
|
<van-icon :name="iconOf(detail.level)" />
|
||||||
|
</span>
|
||||||
|
<span class="msg-tag" :class="detail.level">{{ detail.type }}</span>
|
||||||
|
<span class="read-state" :class="{ unread: !detail.read }">
|
||||||
|
{{ detail.read ? '已读' : '未读' }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2 class="detail-title">{{ detail.title }}</h2>
|
||||||
|
|
||||||
|
<div class="meta-line">
|
||||||
|
<span class="sender">{{ detail.sender }}</span>
|
||||||
|
<span class="time">{{ detail.time }}</span>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="content-card">
|
||||||
|
<p v-for="(paragraph, i) in detail.content" :key="i" class="paragraph">
|
||||||
|
{{ paragraph }}
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section v-if="detail.related" class="related-card" @click="goChanges">
|
||||||
|
<div class="related-body">
|
||||||
|
<div class="related-label">关联变更</div>
|
||||||
|
<div class="related-code">{{ detail.related.code }}</div>
|
||||||
|
<div class="related-title">{{ detail.related.title }}</div>
|
||||||
|
</div>
|
||||||
|
<van-icon name="arrow" class="related-arrow" />
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-tabbar
|
||||||
|
v-model="tabbarActive"
|
||||||
|
fixed
|
||||||
|
active-color="#1f5db3"
|
||||||
|
inactive-color="#8a94a6"
|
||||||
|
@change="onTabbarChange"
|
||||||
|
>
|
||||||
|
<van-tabbar-item icon="bell" badge="2">消息</van-tabbar-item>
|
||||||
|
<van-tabbar-item icon="apps-o">变更查看</van-tabbar-item>
|
||||||
|
<van-tabbar-item icon="photograph">拍照上传</van-tabbar-item>
|
||||||
|
</van-tabbar>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.detail-page {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100vh;
|
||||||
|
padding-bottom: 64px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #f4f6fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 顶部栏 */
|
||||||
|
.top-bar {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 8px;
|
||||||
|
padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.head-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 2px;
|
||||||
|
height: 32px;
|
||||||
|
padding: 0 10px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #1f5db3;
|
||||||
|
background: #f7faff;
|
||||||
|
border: 1px solid #9db9e6;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 17px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-btn {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 34px;
|
||||||
|
height: 34px;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #1d2430;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bell-badge {
|
||||||
|
position: absolute;
|
||||||
|
top: 1px;
|
||||||
|
right: 0;
|
||||||
|
min-width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
padding: 0 3px;
|
||||||
|
font-size: 10px;
|
||||||
|
line-height: 15px;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
background: #ee4d2d;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.applicant-btn {
|
||||||
|
padding: 5px 12px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #1d2430;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #cfd8e8;
|
||||||
|
border-radius: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 内容滚动区 */
|
||||||
|
.detail-scroll {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
padding: 12px 16px 16px;
|
||||||
|
overflow-y: auto;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-loading {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 60px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 标题卡片 */
|
||||||
|
.head-card {
|
||||||
|
padding: 14px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #e6ebf3;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 2px 8px rgba(31, 93, 179, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.head-top {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-icon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
font-size: 20px;
|
||||||
|
border-radius: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-icon.warning {
|
||||||
|
color: #e8912c;
|
||||||
|
background: #fff3e3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-icon.notice {
|
||||||
|
color: #e8b72c;
|
||||||
|
background: #fff9e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-icon.system {
|
||||||
|
color: #7a8494;
|
||||||
|
background: #f2f4f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-tag {
|
||||||
|
padding: 2px 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-tag.warning {
|
||||||
|
color: #e5533d;
|
||||||
|
background: #fdece7;
|
||||||
|
border: 1px solid #f6c8bf;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-tag.notice {
|
||||||
|
color: #2f6fb2;
|
||||||
|
background: #eef4fb;
|
||||||
|
border: 1px solid #cfe0f3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-tag.system {
|
||||||
|
color: #5f6b7a;
|
||||||
|
background: #f0f2f5;
|
||||||
|
border: 1px solid #e2e6ec;
|
||||||
|
}
|
||||||
|
|
||||||
|
.read-state {
|
||||||
|
margin-left: auto;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #9aa3b2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.read-state.unread {
|
||||||
|
color: #e14b3b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-title {
|
||||||
|
margin: 12px 0 0;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.45;
|
||||||
|
color: #1d2430;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.meta-line {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 4px 12px;
|
||||||
|
margin-top: 10px;
|
||||||
|
font-size: 12.5px;
|
||||||
|
color: #8a94a6;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 正文卡片 */
|
||||||
|
.content-card {
|
||||||
|
margin-top: 12px;
|
||||||
|
padding: 14px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #e6ebf3;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.paragraph {
|
||||||
|
margin: 0 0 12px;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.75;
|
||||||
|
color: #3b4656;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.paragraph:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 关联变更 */
|
||||||
|
.related-card {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
margin-top: 12px;
|
||||||
|
padding: 12px 14px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #e6ebf3;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.related-body {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.related-label {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #8a94a6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.related-code {
|
||||||
|
margin-top: 4px;
|
||||||
|
font-size: 13.5px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1f5db3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.related-title {
|
||||||
|
margin-top: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #3b4656;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.related-arrow {
|
||||||
|
flex-shrink: 0;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #c2cad6;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,424 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { reactive, ref, onMounted, computed } from 'vue'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
import { showToast } from 'vant'
|
||||||
|
import {
|
||||||
|
messageListApi,
|
||||||
|
readAllMessages,
|
||||||
|
type MessageItem,
|
||||||
|
type MessageTab,
|
||||||
|
} from '@/api/message'
|
||||||
|
import { AppHeader, AppTabbar } from '@/components/common'
|
||||||
|
|
||||||
|
const tab = ref<MessageTab>('UNREAD')
|
||||||
|
const router = useRouter()
|
||||||
|
const list = ref<MessageItem[]>([])
|
||||||
|
const loading = ref(false)
|
||||||
|
const finished = ref(false)
|
||||||
|
const page = ref(1)
|
||||||
|
const pageSize = 10
|
||||||
|
const listScroll = ref<HTMLDivElement | null>(null)
|
||||||
|
const stats = reactive({ unread: 0, todo: 0, urge: 0 })
|
||||||
|
// 消息tab
|
||||||
|
const tabs: Array<{ key: MessageTab; label: string }> = [
|
||||||
|
{ key: 'UNREAD', label: '未读' },
|
||||||
|
{ key: 'TODO', label: '待办' },
|
||||||
|
{ key: 'URGE', label: '催办' },
|
||||||
|
]
|
||||||
|
// 空状态文本
|
||||||
|
const emptyText = computed(() => {
|
||||||
|
const map: Record<MessageTab, string> = {
|
||||||
|
UNREAD: '暂无未读消息',
|
||||||
|
TODO: '暂无待办',
|
||||||
|
URGE: '暂无催办',
|
||||||
|
}
|
||||||
|
return map[tab.value]
|
||||||
|
})
|
||||||
|
// tab 与统计字段的映射
|
||||||
|
const statsKeyMap: Record<MessageTab, keyof typeof stats> = {
|
||||||
|
UNREAD: 'unread',
|
||||||
|
TODO: 'todo',
|
||||||
|
URGE: 'urge',
|
||||||
|
}
|
||||||
|
// 消息图标
|
||||||
|
function iconOf(level: MessageItem['level']) {
|
||||||
|
const map = {
|
||||||
|
warning: 'warning-o',
|
||||||
|
notice: 'bell',
|
||||||
|
system: 'volume-o',
|
||||||
|
}
|
||||||
|
return map[level]
|
||||||
|
}
|
||||||
|
// 消息列表
|
||||||
|
async function onLoad() {
|
||||||
|
try {
|
||||||
|
const res = await messageListApi({
|
||||||
|
page_num: page.value,
|
||||||
|
page_size: pageSize,
|
||||||
|
read: 0,
|
||||||
|
msg_type: tab.value,
|
||||||
|
})
|
||||||
|
console.log(res)
|
||||||
|
list.value.push(...res.list)
|
||||||
|
stats.unread = res?.unread_count || 0
|
||||||
|
stats.todo = res?.todo_count || 0
|
||||||
|
stats.urge = res?.urge_count || 0
|
||||||
|
if (list.value.length >= res.total) {
|
||||||
|
finished.value = true
|
||||||
|
} else {
|
||||||
|
page.value++
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// 请求失败时标记加载结束,展示空状态而非白屏
|
||||||
|
finished.value = true
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 切换tab重置列表
|
||||||
|
function resetList() {
|
||||||
|
list.value = []
|
||||||
|
page.value = 1
|
||||||
|
finished.value = false
|
||||||
|
loading.value = true
|
||||||
|
if (listScroll.value) {
|
||||||
|
listScroll.value.scrollTop = 0
|
||||||
|
}
|
||||||
|
onLoad()
|
||||||
|
}
|
||||||
|
// 切换tab
|
||||||
|
function switchTab(key: MessageTab) {
|
||||||
|
if (tab.value === key) return
|
||||||
|
tab.value = key
|
||||||
|
resetList()
|
||||||
|
}
|
||||||
|
// 全部标记为已读
|
||||||
|
async function onReadAll() {
|
||||||
|
if (stats.unread === 0) {
|
||||||
|
showToast('暂无未读消息')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const res = await readAllMessages()
|
||||||
|
stats.unread = res.unread
|
||||||
|
stats.todo = res.todo
|
||||||
|
stats.urge = res.urge
|
||||||
|
showToast('已全部标记为已读')
|
||||||
|
resetList()
|
||||||
|
}
|
||||||
|
// 跳转详情页
|
||||||
|
function goDetail(item: MessageItem) {
|
||||||
|
router.push(`/message/${item.id}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
loading.value = true
|
||||||
|
onLoad()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="message-page">
|
||||||
|
<AppHeader title="站内消息" :unread="stats.unread" />
|
||||||
|
|
||||||
|
<section class="summary-card">
|
||||||
|
<div class="summary-left">
|
||||||
|
<van-icon name="bell" class="summary-bell" />
|
||||||
|
<span class="summary-title">站内消息</span>
|
||||||
|
<span class="unread-tag">{{ stats.unread }} 条未读</span>
|
||||||
|
</div>
|
||||||
|
<button class="read-all" type="button" @click="onReadAll">
|
||||||
|
<van-icon name="passed" />
|
||||||
|
全部已读
|
||||||
|
</button>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="tabs">
|
||||||
|
<div
|
||||||
|
v-for="item in tabs"
|
||||||
|
:key="item.key"
|
||||||
|
class="tab"
|
||||||
|
:class="{ active: tab === item.key }"
|
||||||
|
@click="switchTab(item.key)"
|
||||||
|
>
|
||||||
|
{{ item.label }}
|
||||||
|
<span class="tab-num">{{ stats[statsKeyMap[item.key]] }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ref="listScroll" class="list-scroll">
|
||||||
|
<van-list
|
||||||
|
v-model:loading="loading"
|
||||||
|
:finished="finished"
|
||||||
|
:finished-text="list.length ? '没有更多了' : ''"
|
||||||
|
:immediate-check="false"
|
||||||
|
@load="onLoad"
|
||||||
|
>
|
||||||
|
<div v-if="list.length > 0" class="message-list">
|
||||||
|
<div
|
||||||
|
v-for="item in list"
|
||||||
|
:key="item.id"
|
||||||
|
class="message-card"
|
||||||
|
@click="goDetail(item)"
|
||||||
|
>
|
||||||
|
<div class="msg-icon" :class="item.level">
|
||||||
|
<van-icon :name="iconOf(item.level)" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="msg-body">
|
||||||
|
<div class="msg-head">
|
||||||
|
<span v-if="!item.read" class="red-dot"></span>
|
||||||
|
<span class="msg-title">{{ item.title }}</span>
|
||||||
|
<span class="msg-tag" :class="item.level">{{ item.type }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="msg-code">
|
||||||
|
{{ item.code }} {{ item.desc }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="msg-meta">
|
||||||
|
<span>{{ item.time }}</span>
|
||||||
|
<span v-if="item.code">{{ item.code }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<van-icon name="arrow" class="msg-arrow" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-empty
|
||||||
|
v-else-if="finished"
|
||||||
|
:description="emptyText"
|
||||||
|
image-size="100"
|
||||||
|
/>
|
||||||
|
</van-list>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<AppTabbar :active="0" :unread="stats.unread" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.message-page {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100vh;
|
||||||
|
padding-bottom: 64px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #f4f6fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 汇总卡片 */
|
||||||
|
.summary-card {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin: 10px;
|
||||||
|
padding: 10px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #d9e4f2;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 2px 8px rgba(31, 93, 179, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-bell {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #3b4656;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-title {
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.unread-tag {
|
||||||
|
padding: 2px 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #e14b3b;
|
||||||
|
background: #fdeaea;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.read-all {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 3px 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #1f5db3;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #c9d8ee;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 页签 */
|
||||||
|
.tabs {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
gap: 4px;
|
||||||
|
margin: 0 10px;
|
||||||
|
padding: 4px;
|
||||||
|
background: #eaf0f9;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 可滚动列表区域 */
|
||||||
|
.list-scroll {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6px;
|
||||||
|
height: 30px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #5b6678;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab.active {
|
||||||
|
font-weight: 500;
|
||||||
|
color: #fff;
|
||||||
|
background: #1f5db3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-num {
|
||||||
|
font-size: 13px;
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 消息列表 */
|
||||||
|
.message-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 12px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message-card {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 14px 12px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #e6ebf3;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 2px 8px rgba(31, 93, 179, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-icon {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
margin-right: 10px;
|
||||||
|
font-size: 22px;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-icon.warning {
|
||||||
|
color: #e8912c;
|
||||||
|
background: #fff3e3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-icon.notice {
|
||||||
|
color: #e8b72c;
|
||||||
|
background: #fff9e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-icon.system {
|
||||||
|
color: #7a8494;
|
||||||
|
background: #f2f4f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-body {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-head {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.red-dot {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 7px;
|
||||||
|
height: 7px;
|
||||||
|
background: #ee4d2d;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-title {
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1d2430;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-tag {
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 2px 6px;
|
||||||
|
font-size: 11px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-tag.warning {
|
||||||
|
color: #e5533d;
|
||||||
|
background: #fdece7;
|
||||||
|
border: 1px solid #f6c8bf;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-tag.notice {
|
||||||
|
color: #2f6fb2;
|
||||||
|
background: #eef4fb;
|
||||||
|
border: 1px solid #cfe0f3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-tag.system {
|
||||||
|
color: #5f6b7a;
|
||||||
|
background: #f0f2f5;
|
||||||
|
border: 1px solid #e2e6ec;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-code {
|
||||||
|
margin-top: 6px;
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #5f6b7a;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-meta {
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
margin-top: 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #9aa3b2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg-arrow {
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-left: 4px;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #c2cad6;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="not-found">
|
||||||
|
<div class="code">404</div>
|
||||||
|
<p class="msg">抱歉,您访问的页面不存在</p>
|
||||||
|
<van-button type="primary" round @click="router.replace('/messages')">
|
||||||
|
返回消息页
|
||||||
|
</van-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.not-found {
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: #f7f8fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code {
|
||||||
|
font-size: 96px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #1989fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg {
|
||||||
|
margin: 16px 0 32px;
|
||||||
|
color: #969799;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,283 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted } from 'vue'
|
||||||
|
import { showToast } from 'vant'
|
||||||
|
import {
|
||||||
|
getUploadTasks,
|
||||||
|
uploadMaterial,
|
||||||
|
type UploadTaskItem,
|
||||||
|
type UploadMaterialItem,
|
||||||
|
} from '@/api/upload'
|
||||||
|
import { AppHeader, AppTabbar } from '@/components/common'
|
||||||
|
|
||||||
|
const tasks = ref<UploadTaskItem[]>([])
|
||||||
|
const loading = ref(false)
|
||||||
|
const fileInput = ref<HTMLInputElement | null>(null)
|
||||||
|
const pending = ref<{
|
||||||
|
task: UploadTaskItem
|
||||||
|
material: UploadMaterialItem
|
||||||
|
} | null>(null)
|
||||||
|
|
||||||
|
async function fetchTasks() {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const res = await getUploadTasks()
|
||||||
|
tasks.value = res.list
|
||||||
|
} catch (error) {
|
||||||
|
// 错误已在请求拦截器中提示
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function pickFile(task: UploadTaskItem, material: UploadMaterialItem) {
|
||||||
|
pending.value = { task, material }
|
||||||
|
fileInput.value?.click()
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onFileChange(event: Event) {
|
||||||
|
const input = event.target as HTMLInputElement
|
||||||
|
const file = input.files?.[0]
|
||||||
|
input.value = ''
|
||||||
|
if (!file || !pending.value) return
|
||||||
|
|
||||||
|
const { task, material } = pending.value
|
||||||
|
pending.value = null
|
||||||
|
|
||||||
|
try {
|
||||||
|
await uploadMaterial({
|
||||||
|
taskId: task.id,
|
||||||
|
materialKey: material.key,
|
||||||
|
fileName: file.name,
|
||||||
|
})
|
||||||
|
material.uploaded = true
|
||||||
|
showToast('上传成功')
|
||||||
|
} catch {
|
||||||
|
// 错误已在请求拦截器中提示
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(fetchTasks)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="upload-page">
|
||||||
|
<AppHeader title="拍照上传" />
|
||||||
|
|
||||||
|
<section class="intro-card">
|
||||||
|
<div class="intro-title">
|
||||||
|
<van-icon name="photograph" class="intro-icon" />
|
||||||
|
<span>拍照上传 · 任务区</span>
|
||||||
|
</div>
|
||||||
|
<p class="intro-desc">
|
||||||
|
现场拍照或从相册选择,直接上传至对应变更的资料区;培训签到表、PSSR
|
||||||
|
确认表上传后 PC 端同步可见。
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<van-loading v-if="loading" class="loading" />
|
||||||
|
|
||||||
|
<van-empty v-else-if="tasks.length === 0" description="暂无拍照上传任务" image-size="100" />
|
||||||
|
|
||||||
|
<div v-else class="task-list">
|
||||||
|
<article v-for="task in tasks" :key="task.id" class="task-card">
|
||||||
|
<div class="task-head">
|
||||||
|
<h2 class="task-title">{{ task.title }}</h2>
|
||||||
|
<span class="status-tag" :class="task.statusKind">
|
||||||
|
{{ task.status }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="task-meta">{{ task.code }} · {{ task.owner }}</div>
|
||||||
|
|
||||||
|
<div class="material-list">
|
||||||
|
<div
|
||||||
|
v-for="material in task.materials"
|
||||||
|
:key="material.key"
|
||||||
|
class="material-row"
|
||||||
|
>
|
||||||
|
<span class="material-name">{{ material.name }}</span>
|
||||||
|
<span v-if="material.uploaded" class="uploaded-tag">已上传</span>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="upload-btn"
|
||||||
|
type="button"
|
||||||
|
@click="pickFile(task, material)"
|
||||||
|
>
|
||||||
|
<van-icon name="photograph" />
|
||||||
|
拍照上传
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input
|
||||||
|
ref="fileInput"
|
||||||
|
class="file-input"
|
||||||
|
type="file"
|
||||||
|
accept="image/*"
|
||||||
|
capture="environment"
|
||||||
|
@change="onFileChange"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<AppTabbar :active="2" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.upload-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
padding-bottom: 64px;
|
||||||
|
background: #f4f6fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 说明卡片 */
|
||||||
|
.intro-card {
|
||||||
|
margin: 10px;
|
||||||
|
padding: 10px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #e0e8f4;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 2px 8px rgba(31, 93, 179, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.intro-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #33415c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.intro-icon {
|
||||||
|
font-size: 18px;
|
||||||
|
color: #1f5db3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.intro-desc {
|
||||||
|
margin: 8px 0 0;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.7;
|
||||||
|
color: #8a94a6;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 任务列表 */
|
||||||
|
.loading {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 60px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 12px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-card {
|
||||||
|
padding: 14px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #e6ebf3;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 2px 8px rgba(31, 93, 179, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-head {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-title {
|
||||||
|
flex: 1;
|
||||||
|
margin: 0;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 1.45;
|
||||||
|
color: #1d2430;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-tag {
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-top: 2px;
|
||||||
|
padding: 3px 10px;
|
||||||
|
font-size: 12px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-tag.pssr {
|
||||||
|
color: #7b5cc4;
|
||||||
|
background: #f1ecfb;
|
||||||
|
border: 1px solid #dccff5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-tag.close {
|
||||||
|
color: #d9534f;
|
||||||
|
background: #fdecea;
|
||||||
|
border: 1px solid #f5c2bd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-meta {
|
||||||
|
margin-top: 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #8a94a6;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 资料行 */
|
||||||
|
.material-list {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.material-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 10px 0;
|
||||||
|
border-bottom: 1px solid #eef1f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.material-row:last-child {
|
||||||
|
padding-bottom: 0;
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.material-name {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #33415c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uploaded-tag {
|
||||||
|
padding: 1px 6px;
|
||||||
|
font-size: 11px;
|
||||||
|
color: #2e9b5b;
|
||||||
|
background: #eaf8ef;
|
||||||
|
border: 1px solid #b6e2c6;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-btn {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
height: 30px;
|
||||||
|
margin-left: auto;
|
||||||
|
padding: 0 12px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #fff;
|
||||||
|
background: #1e3f7d;
|
||||||
|
border: 1px solid #1e3f7d;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-btn :deep(.van-icon) {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Vendored
+15
@@ -0,0 +1,15 @@
|
|||||||
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
|
interface ImportMetaEnv {
|
||||||
|
readonly VITE_API_BASE_URL: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ImportMeta {
|
||||||
|
readonly env: ImportMetaEnv
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module '*.vue' {
|
||||||
|
import type { DefineComponent } from 'vue'
|
||||||
|
const component: DefineComponent<object, object, unknown>
|
||||||
|
export default component
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||||
|
"types": ["vite/client"],
|
||||||
|
"allowArbitraryExtensions": true,
|
||||||
|
|
||||||
|
/* Linting */
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"erasableSyntaxOnly": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"ignoreDeprecations": "6.0",
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["src/*"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"files": [],
|
||||||
|
"references": [
|
||||||
|
{ "path": "./tsconfig.app.json" },
|
||||||
|
{ "path": "./tsconfig.node.json" }
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||||
|
"target": "es2023",
|
||||||
|
"lib": ["ES2023"],
|
||||||
|
"types": ["node"],
|
||||||
|
"skipLibCheck": true,
|
||||||
|
|
||||||
|
/* Bundler mode */
|
||||||
|
"module": "nodenext",
|
||||||
|
"allowImportingTsExtensions": true,
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
|
"moduleDetection": "force",
|
||||||
|
"noEmit": true,
|
||||||
|
|
||||||
|
/* Linting */
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"erasableSyntaxOnly": true,
|
||||||
|
"noFallthroughCasesInSwitch": true
|
||||||
|
},
|
||||||
|
"include": ["vite.config.ts"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import { defineConfig } from 'vite'
|
||||||
|
import vue from '@vitejs/plugin-vue'
|
||||||
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
|
import Components from 'unplugin-vue-components/vite'
|
||||||
|
import { VantResolver } from '@vant/auto-import-resolver'
|
||||||
|
|
||||||
|
// https://vite.dev/config/
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [
|
||||||
|
vue(),
|
||||||
|
// Vant 按需自动引入
|
||||||
|
Components({
|
||||||
|
resolvers: [VantResolver()],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
server: {
|
||||||
|
host: '0.0.0.0',
|
||||||
|
port: 5173,
|
||||||
|
open: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user