fix: 用户虚拟机详情跳转参数问题
Build and Deploy Vue3 / build (push) Successful in 1m26s
Build and Deploy Vue3 / deploy (push) Successful in 1m17s

This commit is contained in:
2026-04-21 14:13:31 +08:00
parent ab7a8d5cfa
commit 13248468d3
3 changed files with 35 additions and 13 deletions
@@ -131,6 +131,12 @@
<div v-if="spec.attrs && spec.attrs.length > 0 && selectedArgs[spec.id]" class="matched-attr-info">
<el-tag type="success" size="small">匹配区间: {{ getMatchedAttrName(spec, selectedArgs[spec.id]) }}</el-tag>
</div>
<div v-if="getArgKey(spec) === 'system_size'" class="system-size-tip">
<el-tag :type="isSystemSizeTooSmall(spec) ? 'danger' : 'warning'" size="small" effect="light">
<el-icon style="vertical-align: -2px; margin-right: 2px;"><WarningFilled /></el-icon>
{{ isSystemSizeTooSmall(spec) ? '当前系统盘小于30GB,Windows镜像可能无法正常运行' : 'Windows系统镜像建议系统盘不低于30GB' }}
</el-tag>
</div>
</template>
<template v-else>
<el-input v-model="selectedArgs[spec.id]" placeholder="请输入值" size="small" style="width: 200px" @input="updateArgsJson" />
@@ -241,7 +247,7 @@
<script setup>
import { ref, reactive, computed, watch, nextTick } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Plus, Refresh, Delete, View, CopyDocument, DocumentAdd } from '@element-plus/icons-vue'
import { Plus, Refresh, Delete, View, CopyDocument, DocumentAdd, WarningFilled } from '@element-plus/icons-vue'
import {
getProductParameterList,
getProductPlanList,
@@ -426,6 +432,14 @@ const findMatchingNumberAttr = (spec, numValue) => {
return sortedAttrs[sortedAttrs.length - 1]
}
const isSystemSizeTooSmall = (spec) => {
const val = displayValues[spec.id]
if (val === undefined || val === null) return false
const unit = displayUnits[spec.id]
if (unit === 'TB') return val * 1024 < 30
return val < 30
}
const getMatchedAttrName = (spec, numValue) => {
const matchedAttr = findMatchingNumberAttr(spec, Number(numValue))
if (matchedAttr) { const priceText = matchedAttr.price ? ` (+¥${(matchedAttr.price / 100).toFixed(2)})` : ''; return `${matchedAttr.name}${priceText}` }
@@ -748,6 +762,7 @@ watch(() => props.visible, (val) => {
.number-input-wrapper { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.number-range { color: #909399; font-size: 12px; }
.matched-attr-info { margin-top: 2px; }
.system-size-tip { margin-top: 4px; }
.args-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.args-preview { padding: 0; }
.preview-header { display: flex; justify-content: space-between; align-items: center; }