!232 iot产品管理问题修复接口

Merge pull request !232 from huppygo/dev
This commit is contained in:
xingyu
2025-10-20 01:59:37 +00:00
committed by Gitee
33 changed files with 926 additions and 679 deletions

View File

@@ -237,12 +237,10 @@ defineExpose({
.product-card {
height: 100%;
overflow: hidden;
border: 1px solid #e8e8e8;
border-radius: 8px;
transition: all 0.3s ease;
&:hover {
border-color: #d9d9d9;
box-shadow: 0 4px 16px rgb(0 0 0 / 8%);
transform: translateY(-2px);
}
@@ -273,7 +271,6 @@ defineExpose({
font-size: 16px;
font-weight: 600;
line-height: 1.5;
color: #1f2937;
white-space: nowrap;
}
@@ -292,14 +289,13 @@ defineExpose({
.info-label {
flex-shrink: 0;
margin-right: 8px;
color: #6b7280;
opacity: 0.65;
}
.info-value {
overflow: hidden;
text-overflow: ellipsis;
font-weight: 500;
color: #1f2937;
white-space: nowrap;
&.text-primary {
@@ -315,9 +311,9 @@ defineExpose({
font-family: 'Courier New', monospace;
font-size: 12px;
vertical-align: middle;
color: #374151;
white-space: nowrap;
cursor: help;
opacity: 0.85;
}
.info-tag {
@@ -337,6 +333,7 @@ defineExpose({
color: #667eea;
background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
border-radius: 8px;
opacity: 0.8;
}
// 按钮组
@@ -345,7 +342,7 @@ defineExpose({
gap: 8px;
padding-top: 12px;
margin-top: auto;
border-top: 1px solid #f0f0f0;
border-top: 1px solid var(--ant-color-split);
.action-btn {
flex: 1;
@@ -392,4 +389,38 @@ defineExpose({
}
}
}
// 夜间模式适配
html.dark {
.product-card-view {
.product-card {
&:hover {
box-shadow: 0 4px 16px rgb(0 0 0 / 30%);
}
.product-title {
color: rgb(255 255 255 / 85%);
}
.info-list {
.info-label {
color: rgb(255 255 255 / 65%);
}
.info-value {
color: rgb(255 255 255 / 85%);
}
.product-key {
color: rgb(255 255 255 / 75%);
}
}
.product-3d-icon {
color: #8b9cff;
background: linear-gradient(135deg, #667eea25 0%, #764ba225 100%);
}
}
}
}
</style>

View File

@@ -65,12 +65,12 @@ const [Modal, modalApi] = useVbenModal({
if (!basicValid) {
return;
}
modalApi.lock();
try {
// 提交表单 - 合并两个表单的值
const basicValues = await formApi.getValues();
// 如果折叠面板展开,则获取高级表单的值,否则保留原有值(编辑时)或使用空值(新增时)
let advancedValues: any = {};
if (activeKey.value.includes('advanced')) {
@@ -83,12 +83,12 @@ const [Modal, modalApi] = useVbenModal({
description: formData.value.description,
};
}
const values = { ...basicValues, ...advancedValues } as IotProductApi.Product;
const data = formData.value?.id
? { ...values, id: formData.value.id }
: values;
await (formData.value?.id ? updateProduct(data) : createProduct(data));
// 关闭并提示
await modalApi.close();
@@ -123,14 +123,14 @@ const [Modal, modalApi] = useVbenModal({
formData.value = await getProduct(data.id);
// 设置基础表单
await formApi.setValues(formData.value);
// 先设置高级表单的值(不等待)
advancedFormApi.setValues({
icon: formData.value.icon,
picUrl: formData.value.picUrl,
description: formData.value.description,
});
// 如果有图标、图片或描述,自动展开折叠面板以便显示
if (formData.value.icon || formData.value.picUrl || formData.value.description) {
activeKey.value = ['advanced'];
@@ -151,9 +151,6 @@ const [Modal, modalApi] = useVbenModal({
<Form />
<Collapse v-model:active-key="activeKey" class="mt-4">
<CollapsePanel key="advanced" header="更多设置">
<template #extra>
<span class="text-gray-500">📷</span>
</template>
<AdvancedForm />
</CollapsePanel>
</Collapse>

View File

@@ -23,7 +23,7 @@ const formatDate = (date?: Date | string) => {
<template>
<Card title="产品信息">
<Descriptions bordered :column="3">
<Descriptions bordered :column="3" size="small">
<Descriptions.Item label="产品名称">
{{ product.name }}
</Descriptions.Item>