添加项目文件。
This commit is contained in:
@@ -0,0 +1,174 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import AppStage from '@/components/AppStage.vue'
|
||||
import ModuleButton from '@/components/ModuleButton.vue'
|
||||
import PrinciplePlayer from '@/components/PrinciplePlayer.vue'
|
||||
import UnderDevelopmentModal from '@/components/UnderDevelopmentModal.vue'
|
||||
import logo from '@/assets/logo.png'
|
||||
|
||||
type ModuleTone = 'blue' | 'orange' | 'green' | 'teal'
|
||||
type ModuleIconName = 'detect' | 'metal' | 'soil' | 'water'
|
||||
|
||||
interface HomeModule {
|
||||
key: string
|
||||
title: string
|
||||
tone: ModuleTone
|
||||
icon: ModuleIconName
|
||||
}
|
||||
|
||||
const modules: HomeModule[] = [
|
||||
{ key: 'element', title: '元素检测', tone: 'blue', icon: 'detect' },
|
||||
{ key: 'metal', title: '金属鉴别', tone: 'orange', icon: 'metal' },
|
||||
{ key: 'soil', title: '土壤与沉积物筛查', tone: 'green', icon: 'soil' },
|
||||
{ key: 'water', title: '水体液体分析', tone: 'teal', icon: 'water' },
|
||||
]
|
||||
|
||||
const router = useRouter()
|
||||
const modalOpen = ref(false)
|
||||
const modalModule = ref('')
|
||||
|
||||
function openModule(module: HomeModule) {
|
||||
if (module.key === 'element') {
|
||||
void router.push({ name: 'sample' })
|
||||
return
|
||||
}
|
||||
|
||||
modalModule.value = module.title
|
||||
modalOpen.value = true
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppStage>
|
||||
<div class="home">
|
||||
<header class="home-header">
|
||||
<div class="brand">
|
||||
<img :src="logo" alt="泽科技 LIBS 标识" />
|
||||
<span>LIBS</span>
|
||||
</div>
|
||||
|
||||
<div class="headline">
|
||||
<h1>激光诱导击穿光谱 元素分析系统</h1>
|
||||
<p>开放 · 共享 · 自助式元素检测平台</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="home-main">
|
||||
<section class="modules-panel">
|
||||
<div class="modules-grid">
|
||||
<ModuleButton
|
||||
v-for="module in modules"
|
||||
:key="module.key"
|
||||
:title="module.title"
|
||||
:tone="module.tone"
|
||||
:icon="module.icon"
|
||||
@click="openModule(module)"
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<PrinciplePlayer class="home-player" />
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<UnderDevelopmentModal
|
||||
:open="modalOpen"
|
||||
:module-name="modalModule"
|
||||
@close="modalOpen = false"
|
||||
/>
|
||||
</AppStage>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.home {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: #f0f2f5;
|
||||
}
|
||||
|
||||
.home-header {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
height: 180px;
|
||||
padding: 24px 44px;
|
||||
background: #f4f5f7;
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.brand img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
object-fit: contain;
|
||||
mix-blend-mode: multiply;
|
||||
}
|
||||
|
||||
.brand span {
|
||||
color: #253243;
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.headline {
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
left: 50%;
|
||||
text-align: center;
|
||||
transform: translateX(-50%);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.headline h1 {
|
||||
color: #1f2937;
|
||||
font-size: 44px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 6px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.headline p {
|
||||
margin-top: 16px;
|
||||
color: #4d5969;
|
||||
font-size: 20px;
|
||||
letter-spacing: 4px;
|
||||
}
|
||||
|
||||
.home-main {
|
||||
position: absolute;
|
||||
top: 196px;
|
||||
right: 44px;
|
||||
bottom: 40px;
|
||||
left: 44px;
|
||||
display: grid;
|
||||
grid-template-columns: 868px minmax(0, 1fr);
|
||||
gap: 36px;
|
||||
}
|
||||
|
||||
.modules-panel {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 34px;
|
||||
border-radius: 20px;
|
||||
background: #fff;
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
.modules-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 32px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.home-player {
|
||||
min-width: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,290 @@
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from 'vue-router'
|
||||
import AppStage from '@/components/AppStage.vue'
|
||||
import PageHeader from '@/components/PageHeader.vue'
|
||||
import MiniSpectrum from '@/components/MiniSpectrum.vue'
|
||||
import { useCountdown } from '@/composables/useCountdown'
|
||||
import { showToast } from '@/composables/useToast'
|
||||
import reportQr from '@/assets/report-qr.png'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
function goHome() {
|
||||
void router.replace({ name: 'home' })
|
||||
}
|
||||
|
||||
const { remaining } = useCountdown(60, goHome)
|
||||
|
||||
const rows = [
|
||||
{ element: 'Fe', intensity: '高', content: '3.82%', verdict: '检出' },
|
||||
{ element: 'Cu', intensity: '中', content: '1.27%', verdict: '检出' },
|
||||
{ element: 'Mg', intensity: '中', content: '0.94%', verdict: '检出' },
|
||||
{ element: 'Si', intensity: '低', content: '0.41%', verdict: '痕量' },
|
||||
]
|
||||
|
||||
function exportReport() {
|
||||
showToast('报告导出功能正在研发中')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppStage>
|
||||
<PageHeader title="检测完成" variant="result" />
|
||||
|
||||
<main class="result-main">
|
||||
<section class="result-card">
|
||||
<h2 class="result-card__title">元素检测结果</h2>
|
||||
|
||||
<div class="result-summary">
|
||||
<MiniSpectrum />
|
||||
<div class="result-badge">合金成分分析完成</div>
|
||||
</div>
|
||||
|
||||
<table class="result-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>元素</th>
|
||||
<th>强度</th>
|
||||
<th>含量</th>
|
||||
<th>判定</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="row in rows" :key="row.element">
|
||||
<td class="result-table__element">{{ row.element }}</td>
|
||||
<td>{{ row.intensity }}</td>
|
||||
<td>{{ row.content }}</td>
|
||||
<td>{{ row.verdict }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<aside class="report-card">
|
||||
<h2 class="report-card__title">获取完整报告</h2>
|
||||
|
||||
<div class="report-card__qr">
|
||||
<img :src="reportQr" alt="获取完整检测报告二维码" />
|
||||
</div>
|
||||
|
||||
<p class="report-card__caption">扫码关注微信公众号获取更详细结果</p>
|
||||
</aside>
|
||||
</main>
|
||||
|
||||
<div class="result-actions">
|
||||
<p class="result-actions__countdown">
|
||||
当前界面还有 <strong>{{ remaining }}</strong>s 后自动关闭...
|
||||
</p>
|
||||
|
||||
<div class="result-actions__buttons">
|
||||
<button class="result-button result-button--close" type="button" @click="goHome">
|
||||
关闭
|
||||
</button>
|
||||
<button class="result-button result-button--export" type="button" @click="exportReport">
|
||||
导出报告
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</AppStage>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.result-main {
|
||||
position: absolute;
|
||||
top: 150px;
|
||||
right: 44px;
|
||||
left: 44px;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 620px;
|
||||
gap: 40px;
|
||||
height: 730px;
|
||||
}
|
||||
|
||||
.result-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 28px 38px 34px;
|
||||
overflow: hidden;
|
||||
border-radius: 20px;
|
||||
background:
|
||||
radial-gradient(ellipse 70% 50% at 60% 0%, rgba(131, 185, 255, 0.28), transparent 70%),
|
||||
linear-gradient(150deg, #3c7fdf 0%, #2f6fd0 48%, #2559ad 100%);
|
||||
box-shadow:
|
||||
0 18px 44px rgba(31, 77, 147, 0.26),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.result-card__title {
|
||||
color: #fff;
|
||||
font-size: 38px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 4px;
|
||||
text-align: center;
|
||||
text-shadow: 0 2px 6px rgba(15, 47, 98, 0.22);
|
||||
}
|
||||
|
||||
.result-summary {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 28px;
|
||||
margin-top: 22px;
|
||||
}
|
||||
|
||||
.result-badge {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 300px;
|
||||
height: 58px;
|
||||
padding: 0 24px;
|
||||
border: 1px solid #e4c98e;
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(180deg, #faf0d8 0%, #f3e3bd 100%);
|
||||
color: #5e4726;
|
||||
font-size: 24px;
|
||||
letter-spacing: 2px;
|
||||
box-shadow: 0 6px 16px rgba(24, 55, 105, 0.14);
|
||||
}
|
||||
|
||||
.result-table {
|
||||
width: 100%;
|
||||
margin-top: 22px;
|
||||
border-collapse: collapse;
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
.result-table th {
|
||||
height: 58px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.5);
|
||||
background: rgba(37, 89, 173, 0.2);
|
||||
color: #fff;
|
||||
font-size: 27px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.result-table td {
|
||||
height: 94px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.66);
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
color: #222b38;
|
||||
font-size: 26px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.result-table__element {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.report-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 28px 34px 34px;
|
||||
overflow: hidden;
|
||||
border-radius: 20px;
|
||||
background:
|
||||
radial-gradient(ellipse 75% 55% at 28% 0%, rgba(255, 220, 170, 0.34), transparent 70%),
|
||||
linear-gradient(150deg, #f7a44b 0%, #ee8a2f 52%, #e67720 100%);
|
||||
box-shadow:
|
||||
0 18px 44px rgba(190, 104, 27, 0.24),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.28);
|
||||
}
|
||||
|
||||
.report-card__title {
|
||||
color: #fff;
|
||||
font-size: 38px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 4px;
|
||||
text-align: center;
|
||||
text-shadow: 0 2px 5px rgba(139, 73, 14, 0.22);
|
||||
}
|
||||
|
||||
.report-card__qr {
|
||||
width: 336px;
|
||||
height: 356px;
|
||||
margin-top: 28px;
|
||||
padding: 18px;
|
||||
border-radius: 14px;
|
||||
background: #fff;
|
||||
box-shadow: 0 14px 30px rgba(129, 69, 13, 0.2);
|
||||
}
|
||||
|
||||
.report-card__qr img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
image-rendering: auto;
|
||||
}
|
||||
|
||||
.report-card__caption {
|
||||
max-width: 480px;
|
||||
margin-top: 26px;
|
||||
color: #fff;
|
||||
font-size: 21px;
|
||||
line-height: 1.6;
|
||||
letter-spacing: 1px;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 3px rgba(139, 73, 14, 0.2);
|
||||
}
|
||||
|
||||
.result-actions {
|
||||
position: absolute;
|
||||
right: 44px;
|
||||
bottom: 48px;
|
||||
left: 44px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.result-actions__countdown {
|
||||
color: #303a48;
|
||||
font-size: 27px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.result-actions__countdown strong {
|
||||
color: var(--orange-dark);
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.result-actions__buttons {
|
||||
display: flex;
|
||||
gap: 22px;
|
||||
}
|
||||
|
||||
.result-button {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 208px;
|
||||
height: 70px;
|
||||
border-radius: 10px;
|
||||
font-size: 29px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 5px;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.result-button:hover {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.result-button--close {
|
||||
color: #fff;
|
||||
background: linear-gradient(180deg, #ffc42b 0%, #f1ab0c 100%);
|
||||
box-shadow:
|
||||
0 10px 22px rgba(225, 154, 6, 0.26),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.55);
|
||||
text-shadow: 0 1px 2px rgba(151, 94, 0, 0.24);
|
||||
}
|
||||
|
||||
.result-button--export {
|
||||
border: 1px solid #e2cb9f;
|
||||
color: #755329;
|
||||
background: linear-gradient(180deg, #fbf1dd 0%, #f1e0bd 100%);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,228 @@
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from 'vue-router'
|
||||
import AppStage from '@/components/AppStage.vue'
|
||||
import PageHeader from '@/components/PageHeader.vue'
|
||||
import CameraPreview from '@/components/CameraPreview.vue'
|
||||
import GuideIcon from '@/components/GuideIcon.vue'
|
||||
import StatusFooter from '@/components/StatusFooter.vue'
|
||||
import { showToast } from '@/composables/useToast'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const steps = [
|
||||
{ title: '打开样品仓', icon: 'door' as const },
|
||||
{ title: '放置待测样品', icon: 'tray' as const },
|
||||
{ title: '调整聚焦位置', icon: 'focus' as const },
|
||||
]
|
||||
|
||||
function goHome() {
|
||||
void router.push({ name: 'home' })
|
||||
}
|
||||
|
||||
function startDetection() {
|
||||
void router.push({ name: 'scan' })
|
||||
}
|
||||
|
||||
function previewFocus() {
|
||||
showToast('预览对焦功能正在研发中')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppStage>
|
||||
<PageHeader title="放置待测样品">
|
||||
<template #left>
|
||||
<button class="header-button header-button--outline" type="button" @click="goHome">
|
||||
返回
|
||||
</button>
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<main class="sample-main">
|
||||
<CameraPreview class="sample-camera" />
|
||||
|
||||
<aside class="guide-column">
|
||||
<section class="guide-card">
|
||||
<header class="guide-card__header">
|
||||
<h2>样品放置操作指引</h2>
|
||||
</header>
|
||||
|
||||
<ol class="guide-steps">
|
||||
<li v-for="(step, index) in steps" :key="step.title" class="guide-step">
|
||||
<span class="guide-step__number">{{ index + 1 }}</span>
|
||||
<span class="guide-step__title">{{ step.title }}</span>
|
||||
<span class="guide-step__icon">
|
||||
<GuideIcon :name="step.icon" />
|
||||
</span>
|
||||
</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<div class="guide-actions">
|
||||
<button class="action-button action-button--start" type="button" @click="startDetection">
|
||||
开始检测
|
||||
</button>
|
||||
<button class="action-button action-button--ghost" type="button" @click="previewFocus">
|
||||
预览对焦
|
||||
</button>
|
||||
</div>
|
||||
</aside>
|
||||
</main>
|
||||
|
||||
<StatusFooter
|
||||
:items="['样品仓已关闭', '激光安全等级 Class 1', '环境温度 22℃']"
|
||||
/>
|
||||
</AppStage>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.sample-main {
|
||||
position: absolute;
|
||||
top: 220px;
|
||||
right: 44px;
|
||||
left: 44px;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 620px;
|
||||
gap: 34px;
|
||||
height: 710px;
|
||||
}
|
||||
|
||||
.sample-camera {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.guide-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 18px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.guide-card {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
border-radius: 18px;
|
||||
background: #2fb8ad;
|
||||
box-shadow: 0 16px 34px rgba(31, 148, 139, 0.24);
|
||||
}
|
||||
|
||||
.guide-card__header {
|
||||
display: flex;
|
||||
flex: none;
|
||||
align-items: center;
|
||||
height: 104px;
|
||||
padding: 0 34px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent);
|
||||
}
|
||||
|
||||
.guide-card__header h2 {
|
||||
color: #fff;
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 3px;
|
||||
text-shadow: 0 1px 3px rgba(10, 94, 88, 0.2);
|
||||
}
|
||||
|
||||
.guide-steps {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.guide-step {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
gap: 22px;
|
||||
min-height: 0;
|
||||
padding: 0 34px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.18);
|
||||
}
|
||||
|
||||
.guide-step:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.guide-step__number {
|
||||
display: grid;
|
||||
flex: none;
|
||||
place-items: center;
|
||||
width: 46px;
|
||||
height: 46px;
|
||||
border: 2px solid rgba(255, 255, 255, 0.9);
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.guide-step__title {
|
||||
flex: 1;
|
||||
color: #fff;
|
||||
font-size: 28px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 1px;
|
||||
text-shadow: 0 1px 3px rgba(10, 94, 88, 0.18);
|
||||
}
|
||||
|
||||
.guide-step__icon {
|
||||
display: grid;
|
||||
flex: none;
|
||||
place-items: center;
|
||||
width: 78px;
|
||||
height: 78px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.guide-actions {
|
||||
display: grid;
|
||||
flex: none;
|
||||
grid-template-columns: 1.16fr 0.84fr;
|
||||
gap: 20px;
|
||||
height: 78px;
|
||||
}
|
||||
|
||||
.action-button {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
height: 78px;
|
||||
border-radius: 12px;
|
||||
font-size: 30px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 4px;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.action-button:hover {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.action-button--start {
|
||||
color: #fff;
|
||||
background: linear-gradient(180deg, #ffc52c 0%, #f3ae0d 100%);
|
||||
box-shadow:
|
||||
0 12px 24px rgba(224, 154, 6, 0.28),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.55);
|
||||
text-shadow: 0 1px 2px rgba(151, 94, 0, 0.25);
|
||||
}
|
||||
|
||||
.action-button--start:hover {
|
||||
box-shadow:
|
||||
0 16px 30px rgba(224, 154, 6, 0.36),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.55);
|
||||
}
|
||||
|
||||
.action-button--ghost {
|
||||
border: 2px solid #d3dbe6;
|
||||
color: #253243;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.action-button--ghost:hover {
|
||||
border-color: #aebdcd;
|
||||
background: #f8fafc;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,178 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import AppStage from '@/components/AppStage.vue'
|
||||
import PageHeader from '@/components/PageHeader.vue'
|
||||
import ScanVisual from '@/components/ScanVisual.vue'
|
||||
import ProgressStrip from '@/components/ProgressStrip.vue'
|
||||
import StatusFooter from '@/components/StatusFooter.vue'
|
||||
import { useTimedProgress } from '@/composables/useTimedProgress'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const { progress } = useTimedProgress(15000, () => {
|
||||
void router.replace({ name: 'spectrum' })
|
||||
})
|
||||
|
||||
const progressLabel = computed(() => `点位扫描 ${Math.round(progress.value)}%`)
|
||||
|
||||
function abortProcess() {
|
||||
void router.replace({ name: 'home' })
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppStage>
|
||||
<PageHeader title="样品轮廓识别与激光点位规划" variant="process">
|
||||
<template #left>
|
||||
<button class="header-button header-button--warn" type="button" @click="abortProcess">
|
||||
中止流程
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<template #right>
|
||||
<button class="icon-close" type="button" aria-label="关闭并返回首页" @click="abortProcess">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="m6 6 12 12M18 6 6 18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" />
|
||||
</svg>
|
||||
</button>
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<main class="scan-main">
|
||||
<ScanVisual class="scan-card" />
|
||||
|
||||
<aside class="params-card">
|
||||
<header class="params-card__header">
|
||||
<h2>采样点</h2>
|
||||
</header>
|
||||
|
||||
<div class="params-card__body">
|
||||
<div class="param-field">
|
||||
<span class="param-field__label">采样点数</span>
|
||||
<div class="param-field__value">5</div>
|
||||
</div>
|
||||
|
||||
<div class="param-field">
|
||||
<span class="param-field__label">脉冲能量</span>
|
||||
<div class="param-field__value">120 <small>mJ</small></div>
|
||||
</div>
|
||||
|
||||
<div class="param-field">
|
||||
<span class="param-field__label">积分时间</span>
|
||||
<div class="param-field__value">10 <small>ms</small></div>
|
||||
</div>
|
||||
|
||||
<div class="param-field">
|
||||
<span class="param-field__label">预扫描</span>
|
||||
<div class="param-field__value">3 <small>次</small></div>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
</main>
|
||||
|
||||
<div class="scan-progress">
|
||||
<ProgressStrip :progress="progress" :label="progressLabel" note="已规划 5 个采样点" />
|
||||
</div>
|
||||
|
||||
<StatusFooter
|
||||
icon="info"
|
||||
:items="['轮廓提取完成', '点位校验通过', '等待采集光谱']"
|
||||
/>
|
||||
</AppStage>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.scan-main {
|
||||
position: absolute;
|
||||
top: 142px;
|
||||
right: 44px;
|
||||
left: 44px;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 342px;
|
||||
gap: 20px;
|
||||
height: 730px;
|
||||
}
|
||||
|
||||
.scan-card {
|
||||
width: 1120px;
|
||||
max-width: 100%;
|
||||
height: 100%;
|
||||
justify-self: center;
|
||||
}
|
||||
|
||||
.params-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
border: 1px solid #d9e0e8;
|
||||
border-radius: 10px;
|
||||
background: #fff;
|
||||
box-shadow: 0 8px 24px rgba(33, 53, 84, 0.05);
|
||||
}
|
||||
|
||||
.params-card__header {
|
||||
display: flex;
|
||||
flex: none;
|
||||
align-items: center;
|
||||
height: 64px;
|
||||
padding: 0 22px;
|
||||
border-bottom: 1px solid #e4e8ee;
|
||||
background: #f3f4f6;
|
||||
}
|
||||
|
||||
.params-card__header h2 {
|
||||
color: #333b46;
|
||||
font-size: 23px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.params-card__body {
|
||||
padding: 26px 22px;
|
||||
}
|
||||
|
||||
.param-field {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.param-field:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.param-field__label {
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
color: #46505e;
|
||||
font-size: 22px;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.param-field__value {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 62px;
|
||||
padding: 0 18px;
|
||||
border: 1px solid #d8dde6;
|
||||
border-radius: 7px;
|
||||
background: #fff;
|
||||
color: #2e3641;
|
||||
font-size: 24px;
|
||||
box-shadow: inset 0 1px 2px rgba(30, 45, 66, 0.03);
|
||||
}
|
||||
|
||||
.param-field__value small {
|
||||
margin-left: 8px;
|
||||
color: #8d97a4;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.scan-progress {
|
||||
position: absolute;
|
||||
top: 900px;
|
||||
right: 44px;
|
||||
left: 44px;
|
||||
height: 54px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,222 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import AppStage from '@/components/AppStage.vue'
|
||||
import PageHeader from '@/components/PageHeader.vue'
|
||||
import SpectrumChart from '@/components/SpectrumChart.vue'
|
||||
import ProgressStrip from '@/components/ProgressStrip.vue'
|
||||
import StatusFooter from '@/components/StatusFooter.vue'
|
||||
import { useTimedProgress } from '@/composables/useTimedProgress'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const { progress } = useTimedProgress(10000, () => {
|
||||
void router.replace({ name: 'result' })
|
||||
})
|
||||
|
||||
const progressLabel = computed(() => `光谱采集 ${Math.round(progress.value)}%`)
|
||||
const sampleIndex = computed(() =>
|
||||
Math.min(5, Math.max(1, Math.ceil(progress.value / 20))),
|
||||
)
|
||||
|
||||
function abortProcess() {
|
||||
void router.replace({ name: 'home' })
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppStage>
|
||||
<PageHeader title="光谱数据采集与分析" variant="process">
|
||||
<template #left>
|
||||
<button class="header-button header-button--warn" type="button" @click="abortProcess">
|
||||
中止流程
|
||||
</button>
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<main class="spectrum-main">
|
||||
<SpectrumChart class="spectrum-chart" />
|
||||
|
||||
<aside class="analysis-card">
|
||||
<header class="analysis-card__header">
|
||||
<h2>分析步骤</h2>
|
||||
</header>
|
||||
|
||||
<div class="analysis-card__body">
|
||||
<div class="analysis-step">
|
||||
<span class="analysis-step__icon analysis-step__icon--blue">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<circle cx="12" cy="12" r="8" fill="none" stroke="currentColor" stroke-width="1.6" />
|
||||
<path d="M12 7v5l3.4 2" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" />
|
||||
</svg>
|
||||
</span>
|
||||
<span class="analysis-step__text">正在拟合峰值</span>
|
||||
<span class="analysis-step__chevron">›</span>
|
||||
</div>
|
||||
|
||||
<div class="analysis-step">
|
||||
<span class="analysis-step__icon analysis-step__icon--amber">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M5 15h14M7 15V8l5-3 5 3v7" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" />
|
||||
<path d="M9 15v3h6v-3" fill="none" stroke="currentColor" stroke-width="1.6" />
|
||||
</svg>
|
||||
</span>
|
||||
<span class="analysis-step__text">扣除连续背景</span>
|
||||
<span class="analysis-step__chevron">›</span>
|
||||
</div>
|
||||
|
||||
<div class="analysis-step">
|
||||
<span class="analysis-step__icon analysis-step__icon--blue">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<rect x="6" y="4" width="12" height="16" rx="2" fill="none" stroke="currentColor" stroke-width="1.6" />
|
||||
<path d="M9 8h6M9 11h6M9 14h3" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" />
|
||||
</svg>
|
||||
</span>
|
||||
<span class="analysis-step__text">计算元素浓度</span>
|
||||
<span class="analysis-step__chevron">›</span>
|
||||
</div>
|
||||
|
||||
<div class="analysis-card__track" aria-hidden="true">
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
</main>
|
||||
|
||||
<div class="spectrum-progress">
|
||||
<ProgressStrip
|
||||
:progress="progress"
|
||||
:label="progressLabel"
|
||||
:note="`第 ${sampleIndex} / 5 次采样`"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<StatusFooter
|
||||
icon="laser"
|
||||
:items="['激光发射正常', '探测器积分完成', '数据保存中']"
|
||||
/>
|
||||
</AppStage>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.spectrum-main {
|
||||
position: absolute;
|
||||
top: 142px;
|
||||
right: 44px;
|
||||
left: 44px;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 342px;
|
||||
gap: 20px;
|
||||
height: 730px;
|
||||
}
|
||||
|
||||
.spectrum-chart {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.analysis-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
border: 1px solid #d9e0e8;
|
||||
border-radius: 10px;
|
||||
background: #fff;
|
||||
box-shadow: 0 8px 24px rgba(33, 53, 84, 0.05);
|
||||
}
|
||||
|
||||
.analysis-card__header {
|
||||
display: flex;
|
||||
flex: none;
|
||||
align-items: center;
|
||||
height: 64px;
|
||||
padding: 0 22px;
|
||||
border-bottom: 1px solid #e4e8ee;
|
||||
background: #f3f4f6;
|
||||
}
|
||||
|
||||
.analysis-card__header h2 {
|
||||
color: #333b46;
|
||||
font-size: 23px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.analysis-card__body {
|
||||
flex: 1;
|
||||
padding: 16px 18px;
|
||||
}
|
||||
|
||||
.analysis-step {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
height: 78px;
|
||||
padding: 0 10px;
|
||||
border-bottom: 1px solid #eef1f5;
|
||||
}
|
||||
|
||||
.analysis-step__icon {
|
||||
display: grid;
|
||||
flex: none;
|
||||
place-items: center;
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.analysis-step__icon svg {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.analysis-step__icon--blue {
|
||||
color: #2f6fd0;
|
||||
background: #eaf2ff;
|
||||
}
|
||||
|
||||
.analysis-step__icon--amber {
|
||||
color: #d59400;
|
||||
background: #fff4d6;
|
||||
}
|
||||
|
||||
.analysis-step__text {
|
||||
flex: 1;
|
||||
color: #3f4b5b;
|
||||
font-size: 21px;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.analysis-step__chevron {
|
||||
color: #b2bcc8;
|
||||
font-size: 30px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.analysis-card__track {
|
||||
position: relative;
|
||||
width: 6px;
|
||||
height: 142px;
|
||||
margin: 22px 0 0 auto;
|
||||
border-radius: 6px;
|
||||
background: #eef1f5;
|
||||
}
|
||||
|
||||
.analysis-card__track span {
|
||||
position: absolute;
|
||||
top: 18px;
|
||||
left: 0;
|
||||
width: 6px;
|
||||
height: 54px;
|
||||
border-radius: 6px;
|
||||
background: #c9d3df;
|
||||
}
|
||||
|
||||
.spectrum-progress {
|
||||
position: absolute;
|
||||
top: 900px;
|
||||
right: 44px;
|
||||
left: 44px;
|
||||
height: 54px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user