feat: 实现层级删除参数设置页面UI
- 添加HierarchyDeletionParamsPage组件,复制参考项目UI - 集成层级分析结果到删除参数页面的导航 - 实现层级选择和范围显示功能 - 应用CSS变量主题系统 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9f3b88d753
commit
7fdbb5791b
@ -175,6 +175,8 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['show-hierarchy-deletion-params'])
|
||||
|
||||
const currentView = ref('tree')
|
||||
const selectedComponents = ref(new Set())
|
||||
const expandedNodes = ref(new Set())
|
||||
@ -310,6 +312,7 @@ const exportResults = () => {
|
||||
|
||||
const continueToDeleteConfig = () => {
|
||||
console.log('跳转到层级删除配置页面')
|
||||
emit('show-hierarchy-deletion-params')
|
||||
}
|
||||
|
||||
// 合并新的层级数据到现有数据中
|
||||
|
||||
416
src/components/pages/HierarchyDeletionParamsPage.vue
Normal file
416
src/components/pages/HierarchyDeletionParamsPage.vue
Normal file
@ -0,0 +1,416 @@
|
||||
<template>
|
||||
<div class="deletion-params-container">
|
||||
<div class="deletion-params-header">
|
||||
<h3>
|
||||
<i class="fas fa-trash-alt"></i>
|
||||
设置删除参数
|
||||
</h3>
|
||||
<button class="deletion-params-close" @click="$emit('close')">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="deletion-params-form">
|
||||
<!-- 层级选择区域 -->
|
||||
<div class="level-selection-section">
|
||||
<h4>
|
||||
<i class="fas fa-layer-group"></i>
|
||||
选择删除层级
|
||||
</h4>
|
||||
<div class="level-selection-description">
|
||||
选择从哪个层级开始删除模型组件。选择层级后,该层级及以下的所有组件都将被删除。
|
||||
</div>
|
||||
|
||||
<div class="level-input-group">
|
||||
<div class="level-input-row">
|
||||
<label class="level-input-label">删除层级:</label>
|
||||
<div class="level-input-control">
|
||||
<input type="number"
|
||||
class="level-number-input"
|
||||
id="deletion-level-input"
|
||||
min="0"
|
||||
:max="maxLevel"
|
||||
v-model="selectedLevel">
|
||||
<span>或选择:</span>
|
||||
<select class="level-select"
|
||||
id="deletion-level-select"
|
||||
v-model="selectedLevel">
|
||||
<option value="">-- 选择层级 --</option>
|
||||
<option v-for="level in availableLevels" :key="level" :value="level">
|
||||
层级 {{ level }} (25 个组件)
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="level-range-indicator">
|
||||
<span class="range-label">删除范围:</span>
|
||||
<span class="range-value" id="deletion-range-display">{{ rangeDisplayText }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<div class="deletion-params-actions">
|
||||
<button class="params-action-btn secondary" @click="$emit('close')">
|
||||
<i class="fas fa-times"></i>
|
||||
取消
|
||||
</button>
|
||||
<button class="params-action-btn danger"
|
||||
id="execute-deletion-btn"
|
||||
@click="$emit('execute-deletion', getExecutionParams())">
|
||||
<i class="fas fa-trash"></i>
|
||||
执行删除
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
|
||||
// Props
|
||||
const props = defineProps({
|
||||
hierarchyData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
// Emits
|
||||
const emit = defineEmits(['close', 'execute-deletion'])
|
||||
|
||||
// 响应式数据
|
||||
const selectedLevel = ref(null)
|
||||
|
||||
// 计算属性 - 可用层级列表
|
||||
const availableLevels = computed(() => {
|
||||
return [0, 1, 2, 3, 4]
|
||||
})
|
||||
|
||||
// 计算属性 - 最大层级
|
||||
const maxLevel = computed(() => {
|
||||
return 4
|
||||
})
|
||||
|
||||
// 计算属性 - 范围显示文本
|
||||
const rangeDisplayText = computed(() => {
|
||||
if (selectedLevel.value === null) return '请选择层级'
|
||||
return `层级 ${selectedLevel.value} 及以下`
|
||||
})
|
||||
|
||||
// 获取指定层级的组件数量
|
||||
const getComponentCountAtLevel = (level) => {
|
||||
return 25
|
||||
}
|
||||
|
||||
// 获取指定层级之后的组件数量
|
||||
const getComponentCountAfterLevel = (level) => {
|
||||
return 45
|
||||
}
|
||||
|
||||
// 获取从指定层级开始的组件数量
|
||||
const getComponentCountFromLevel = (level) => {
|
||||
return 85
|
||||
}
|
||||
|
||||
// 获取执行参数
|
||||
const getExecutionParams = () => {
|
||||
return {
|
||||
selectedLevel: selectedLevel.value
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化默认层级
|
||||
const initializeDefaultLevel = () => {
|
||||
if (availableLevels.value.length > 0) {
|
||||
let defaultLevel = availableLevels.value[0]
|
||||
|
||||
if (availableLevels.value.includes(0) && availableLevels.value.includes(1)) {
|
||||
defaultLevel = 1
|
||||
} else if (availableLevels.value.includes(0) && availableLevels.value.length > 1) {
|
||||
defaultLevel = availableLevels.value[1]
|
||||
}
|
||||
|
||||
selectedLevel.value = defaultLevel
|
||||
}
|
||||
}
|
||||
|
||||
// 组件挂载时初始化
|
||||
onMounted(() => {
|
||||
initializeDefaultLevel()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 删除参数设置容器 */
|
||||
.deletion-params-container {
|
||||
background: var(--color-bg-secondary);
|
||||
border-radius: var(--size-border-radius);
|
||||
padding: var(--spacing-xl);
|
||||
box-shadow: var(--color-shadow-card);
|
||||
border: 1px solid var(--color-border-primary);
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* 删除参数头部 */
|
||||
.deletion-params-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: var(--spacing-xl);
|
||||
padding-bottom: var(--spacing-lg);
|
||||
border-bottom: 2px solid var(--color-border-primary);
|
||||
}
|
||||
|
||||
.deletion-params-header h3 {
|
||||
margin: 0;
|
||||
color: var(--color-text-primary);
|
||||
font-size: var(--font-size-xl);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-md);
|
||||
}
|
||||
|
||||
.deletion-params-header h3 i {
|
||||
color: var(--color-error);
|
||||
}
|
||||
|
||||
.deletion-params-close {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--font-size-xl);
|
||||
cursor: pointer;
|
||||
padding: var(--spacing-xs);
|
||||
border-radius: var(--size-border-radius-button);
|
||||
transition: all var(--transition-duration) var(--transition-timing);
|
||||
}
|
||||
|
||||
.deletion-params-close:hover {
|
||||
background: var(--color-bg-tertiary);
|
||||
color: var(--color-text-primary);
|
||||
}
|
||||
|
||||
/* 参数设置表单 */
|
||||
.deletion-params-form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-xl);
|
||||
}
|
||||
|
||||
/* 层级选择区域 */
|
||||
.level-selection-section {
|
||||
background: var(--color-white-rgb-05);
|
||||
border-radius: var(--size-border-radius-button);
|
||||
padding: var(--spacing-xl);
|
||||
border: 1px solid var(--color-border-primary);
|
||||
}
|
||||
|
||||
.level-selection-section h4 {
|
||||
margin: 0 0 var(--spacing-lg) 0;
|
||||
color: var(--color-text-primary);
|
||||
font-size: var(--font-size-lg);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.level-selection-section h4 i {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.level-selection-description {
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--font-size-sm);
|
||||
margin-bottom: var(--spacing-xl);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* 层级输入控件 */
|
||||
.level-input-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.level-input-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.level-input-label {
|
||||
min-width: 120px;
|
||||
color: var(--color-text-secondary);
|
||||
font-weight: var(--font-weight-medium);
|
||||
}
|
||||
|
||||
.level-input-control {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-md);
|
||||
}
|
||||
|
||||
.level-number-input {
|
||||
width: 100px;
|
||||
padding: var(--spacing-sm) var(--spacing-md);
|
||||
border: 1px solid var(--color-border-primary);
|
||||
border-radius: var(--size-border-radius-button);
|
||||
background: var(--color-bg-primary);
|
||||
color: var(--color-text-primary);
|
||||
font-size: var(--font-size-base);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.level-number-input:focus {
|
||||
outline: none;
|
||||
border-color: var(--color-primary);
|
||||
box-shadow: 0 0 0 2px var(--color-primary-rgb);
|
||||
}
|
||||
|
||||
.level-select {
|
||||
flex: 1;
|
||||
padding: var(--spacing-sm) var(--spacing-md);
|
||||
border: 1px solid var(--color-border-primary);
|
||||
border-radius: var(--size-border-radius-button);
|
||||
background: var(--color-bg-primary);
|
||||
color: var(--color-text-primary);
|
||||
}
|
||||
|
||||
.level-select:focus {
|
||||
outline: none;
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
/* 层级范围指示器 */
|
||||
.level-range-indicator {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-md);
|
||||
margin-top: var(--spacing-md);
|
||||
padding: var(--spacing-md);
|
||||
background: var(--color-bg-tertiary);
|
||||
border-radius: var(--size-border-radius-button);
|
||||
border: 1px solid var(--color-border-primary);
|
||||
}
|
||||
|
||||
.level-range-indicator .range-label {
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--font-size-sm);
|
||||
}
|
||||
|
||||
.level-range-indicator .range-value {
|
||||
font-weight: var(--font-weight-semibold);
|
||||
color: var(--color-text-primary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 操作按钮区域 */
|
||||
.deletion-params-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
gap: var(--spacing-lg);
|
||||
padding-top: var(--spacing-xl);
|
||||
border-top: 1px solid var(--color-border-primary);
|
||||
}
|
||||
|
||||
.params-action-btn {
|
||||
padding: var(--spacing-md) var(--spacing-xl);
|
||||
border: 1px solid var(--color-border-primary);
|
||||
border-radius: var(--size-border-radius-button);
|
||||
cursor: pointer;
|
||||
font-size: var(--font-size-sm);
|
||||
font-weight: var(--font-weight-medium);
|
||||
transition: all var(--transition-duration) var(--transition-timing);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
min-width: 120px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.params-action-btn.secondary {
|
||||
background: var(--color-white-rgb-05);
|
||||
color: var(--color-text-secondary);
|
||||
border-color: var(--color-border-primary);
|
||||
}
|
||||
|
||||
.params-action-btn.secondary:hover {
|
||||
background: var(--color-bg-tertiary);
|
||||
border-color: var(--color-border-secondary);
|
||||
color: var(--color-text-primary);
|
||||
}
|
||||
|
||||
.params-action-btn.danger {
|
||||
background: var(--color-error);
|
||||
color: white;
|
||||
border-color: var(--color-error);
|
||||
}
|
||||
|
||||
.params-action-btn.danger:hover:not(:disabled) {
|
||||
background: var(--color-error);
|
||||
opacity: 0.9;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.params-action-btn:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
transform: none !important;
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.deletion-params-container {
|
||||
padding: var(--spacing-xl);
|
||||
margin-top: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.deletion-params-header {
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-md);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.level-input-row {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.level-input-label {
|
||||
min-width: auto;
|
||||
}
|
||||
|
||||
.deletion-params-actions {
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-md);
|
||||
}
|
||||
|
||||
.params-action-btn {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* 动画效果 */
|
||||
@keyframes slideInFromTop {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-20px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -7,6 +7,7 @@ export const PAGE_TYPES = {
|
||||
FORMAT_CONVERTER: 'format-converter',
|
||||
SHELL_ANALYSIS_RESULT: 'shell-analysis-result',
|
||||
HIERARCHY_ANALYSIS_RESULT: 'hierarchy-analysis-result',
|
||||
HIERARCHY_DELETION_PARAMS: 'hierarchy-deletion-params',
|
||||
GEOMETRY_COMPLEXITY_RESULT: 'geometry-complexity-result',
|
||||
GEOMETRY_OPTIMIZATION_PARAMS: 'geometry-optimization-params'
|
||||
}
|
||||
|
||||
@ -117,7 +117,18 @@
|
||||
|
||||
<!-- 按层级删除优化分析结果页面 -->
|
||||
<div v-else-if="currentPage === PAGE_TYPES.HIERARCHY_ANALYSIS_RESULT" class="page-content">
|
||||
<HierarchyAnalysisResult :analysis-data="hierarchyAnalysisData" />
|
||||
<HierarchyAnalysisResult
|
||||
:analysis-data="hierarchyAnalysisData"
|
||||
@show-hierarchy-deletion-params="handleShowHierarchyDeletionParams"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 层级删除参数设置页面 -->
|
||||
<div v-else-if="currentPage === PAGE_TYPES.HIERARCHY_DELETION_PARAMS" class="page-content">
|
||||
<HierarchyDeletionParamsPage
|
||||
:hierarchy-data="hierarchyAnalysisData"
|
||||
@close="handleCloseHierarchyDeletionParams"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 几何复杂度分析结果页面 -->
|
||||
@ -220,6 +231,7 @@ import CreoExportTools from '@/components/pages/CreoExportTools.vue'
|
||||
import UniversalConverter from '@/components/pages/UniversalConverter.vue'
|
||||
import ShellAnalysisResult from '@/components/pages/ShellAnalysisResult.vue'
|
||||
import HierarchyAnalysisResult from '@/components/pages/HierarchyAnalysisResult.vue'
|
||||
import HierarchyDeletionParamsPage from '@/components/pages/HierarchyDeletionParamsPage.vue'
|
||||
import GeometryComplexityResult from '@/components/pages/GeometryComplexityResult.vue'
|
||||
import GeometryOptimizationParams from '@/components/pages/GeometryOptimizationParams.vue'
|
||||
import { PAGE_TYPES } from '@/config/pages'
|
||||
@ -269,6 +281,16 @@ const handleShowGeometryOptimizationParams = () => {
|
||||
currentPage.value = PAGE_TYPES.GEOMETRY_OPTIMIZATION_PARAMS
|
||||
}
|
||||
|
||||
// 处理跳转到层级删除参数设置页面
|
||||
const handleShowHierarchyDeletionParams = () => {
|
||||
currentPage.value = PAGE_TYPES.HIERARCHY_DELETION_PARAMS
|
||||
}
|
||||
|
||||
// 处理关闭层级删除参数设置页面
|
||||
const handleCloseHierarchyDeletionParams = () => {
|
||||
currentPage.value = PAGE_TYPES.HIERARCHY_ANALYSIS_RESULT
|
||||
}
|
||||
|
||||
// 按钮事件处理
|
||||
const connectCAD = () => {
|
||||
// CAD连接逻辑
|
||||
|
||||
Loading…
Reference in New Issue
Block a user