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",
|
||||
"private": true,
|
||||
"version": "0.0.7",
|
||||
"version": "0.0.8",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@ -3180,7 +3180,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "spectral-insight-mission-plan"
|
||||
version = "0.0.5"
|
||||
version = "0.0.7"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"chrono",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "spectral-insight-mission-plan"
|
||||
version = "0.0.7"
|
||||
version = "0.0.8"
|
||||
description = "Spectral Insight Mission Plan"
|
||||
authors = ["you"]
|
||||
edition = "2021"
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Spectral Insight Mission Plan",
|
||||
"version": "0.0.7",
|
||||
"version": "0.0.8",
|
||||
"identifier": "com.spectral-insight.mission-plan",
|
||||
"build": {
|
||||
"beforeDevCommand": "npm run dev",
|
||||
|
||||
@ -99,12 +99,13 @@
|
||||
</n-grid>
|
||||
</n-form>
|
||||
|
||||
<n-collapse>
|
||||
<n-collapse class="subtask-collapse">
|
||||
<n-collapse-item
|
||||
v-for="sub in task.subTasks"
|
||||
:key="sub.id"
|
||||
:title="getSubTaskLabel(sub.type)"
|
||||
:name="sub.id"
|
||||
:style="subtaskStyle(sub.type)"
|
||||
>
|
||||
<template #header-extra>
|
||||
<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 { useMissionStore } from '../stores/mission';
|
||||
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 { isHyperspectral, SubTaskType } from '../types/task';
|
||||
import type { SubTask } from '../types/task';
|
||||
@ -263,6 +264,16 @@ function getSubTaskLabel(type: string): string {
|
||||
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 pathViewRecords = ref<PathLineRecord[]>([]);
|
||||
const pathPreviewContainer = ref<HTMLDivElement>();
|
||||
@ -458,4 +469,5 @@ async function viewPathFile(filePath: string) { if (filePath) await openPathFile
|
||||
<style scoped>
|
||||
.mission-editor { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
|
||||
.main-panel { flex: 1; overflow-y: auto; }
|
||||
.subtask-collapse :deep(.n-collapse-item__header) { padding-top: 0 !important; }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user