feat: add device-type background colors to subtasks, fix collapsed header height
子任务现按设备类型显示不同背景色和左侧色条,便于区分。 修复 Naive UI default padding-top 导致折叠时标题高度不一致的问题。
This commit is contained in:
16
CLAUDE.md
Normal file
16
CLAUDE.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Spectral Insight Mission Plan
|
||||||
|
|
||||||
|
## 版本管理
|
||||||
|
|
||||||
|
每次 `git commit` 时需要同时更新版本号和 update.md:
|
||||||
|
|
||||||
|
1. **更新版本号**:Cargo.toml、tauri.conf.json、package.json 中 PATCH+1
|
||||||
|
2. **更新 update.md**:在文件头部插入新版本条目
|
||||||
|
3. **变更内容由模型根据实际改动总结**,需注明需求来源(如某人提出)
|
||||||
|
|
||||||
|
### update.md 格式
|
||||||
|
```
|
||||||
|
## vX.Y.Z (YYYY-MM-DD)
|
||||||
|
|
||||||
|
- 改动描述(致谢)
|
||||||
|
```
|
||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "happa-mission-plan",
|
"name": "happa-mission-plan",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.7",
|
"version": "0.0.8",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@ -3180,7 +3180,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "spectral-insight-mission-plan"
|
name = "spectral-insight-mission-plan"
|
||||||
version = "0.0.5"
|
version = "0.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "spectral-insight-mission-plan"
|
name = "spectral-insight-mission-plan"
|
||||||
version = "0.0.7"
|
version = "0.0.8"
|
||||||
description = "Spectral Insight Mission Plan"
|
description = "Spectral Insight Mission Plan"
|
||||||
authors = ["you"]
|
authors = ["you"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "Spectral Insight Mission Plan",
|
"productName": "Spectral Insight Mission Plan",
|
||||||
"version": "0.0.7",
|
"version": "0.0.8",
|
||||||
"identifier": "com.spectral-insight.mission-plan",
|
"identifier": "com.spectral-insight.mission-plan",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "npm run dev",
|
"beforeDevCommand": "npm run dev",
|
||||||
|
|||||||
@ -99,12 +99,13 @@
|
|||||||
</n-grid>
|
</n-grid>
|
||||||
</n-form>
|
</n-form>
|
||||||
|
|
||||||
<n-collapse>
|
<n-collapse class="subtask-collapse">
|
||||||
<n-collapse-item
|
<n-collapse-item
|
||||||
v-for="sub in task.subTasks"
|
v-for="sub in task.subTasks"
|
||||||
:key="sub.id"
|
:key="sub.id"
|
||||||
:title="getSubTaskLabel(sub.type)"
|
:title="getSubTaskLabel(sub.type)"
|
||||||
:name="sub.id"
|
:name="sub.id"
|
||||||
|
:style="subtaskStyle(sub.type)"
|
||||||
>
|
>
|
||||||
<template #header-extra>
|
<template #header-extra>
|
||||||
<n-button text type="error" size="tiny" @click.stop="handleRemoveSubTask(task.id, sub.id)">删除</n-button>
|
<n-button text type="error" size="tiny" @click.stop="handleRemoveSubTask(task.id, sub.id)">删除</n-button>
|
||||||
@ -218,7 +219,7 @@ import {
|
|||||||
import { invoke } from '@tauri-apps/api/core';
|
import { invoke } from '@tauri-apps/api/core';
|
||||||
import { useMissionStore } from '../stores/mission';
|
import { useMissionStore } from '../stores/mission';
|
||||||
import { useValidationStore } from '../stores/validation';
|
import { useValidationStore } from '../stores/validation';
|
||||||
import { SUBTASK_TYPE_LABELS } from '../utils/constants';
|
import { SUBTASK_TYPE_LABELS, SUBTASK_TYPE_COLORS } from '../utils/constants';
|
||||||
import { formatDuration, formatDateTime } from '../utils/constants';
|
import { formatDuration, formatDateTime } from '../utils/constants';
|
||||||
import { isHyperspectral, SubTaskType } from '../types/task';
|
import { isHyperspectral, SubTaskType } from '../types/task';
|
||||||
import type { SubTask } from '../types/task';
|
import type { SubTask } from '../types/task';
|
||||||
@ -263,6 +264,16 @@ function getSubTaskLabel(type: string): string {
|
|||||||
return SUBTASK_TYPE_LABELS[type] || type;
|
return SUBTASK_TYPE_LABELS[type] || type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function subtaskStyle(type: string) {
|
||||||
|
const color = SUBTASK_TYPE_COLORS[type] || '#888';
|
||||||
|
return {
|
||||||
|
borderLeft: `3px solid ${color}`,
|
||||||
|
background: `${color}1a`,
|
||||||
|
borderRadius: '3px',
|
||||||
|
marginBottom: '4px',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const showPathModal = ref(false);
|
const showPathModal = ref(false);
|
||||||
const pathViewRecords = ref<PathLineRecord[]>([]);
|
const pathViewRecords = ref<PathLineRecord[]>([]);
|
||||||
const pathPreviewContainer = ref<HTMLDivElement>();
|
const pathPreviewContainer = ref<HTMLDivElement>();
|
||||||
@ -458,4 +469,5 @@ async function viewPathFile(filePath: string) { if (filePath) await openPathFile
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.mission-editor { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
|
.mission-editor { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
|
||||||
.main-panel { flex: 1; overflow-y: auto; }
|
.main-panel { flex: 1; overflow-y: auto; }
|
||||||
|
.subtask-collapse :deep(.n-collapse-item__header) { padding-top: 0 !important; }
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
# Spectral Insight Mission Plan - 更新日志
|
# Spectral Insight Mission Plan - 更新日志
|
||||||
|
|
||||||
|
## v0.0.8 (2026-06-22)
|
||||||
|
|
||||||
|
- 子任务按设备类型显示不同背景色和左侧色条(Pika L 绿 / Pika NIR 蓝 / 单反 橙 / 深度相机 红)
|
||||||
|
- 修复折叠时子任务标题高度不一致的问题
|
||||||
|
|
||||||
## v0.0.7 (2026-06-18)
|
## v0.0.7 (2026-06-18)
|
||||||
|
|
||||||
- fix: correct update.md v0.0.6 entry with proper 唐超 credit
|
- fix: correct update.md v0.0.6 entry with proper 唐超 credit
|
||||||
|
|||||||
Reference in New Issue
Block a user