添加项目文件。
This commit is contained in:
@@ -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