MOC移动端页面
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user