From eec9a72a1d5a58e0379d793da3de63125b949fde Mon Sep 17 00:00:00 2001
From: WUSIJIAN <13825895+wsj0228@user.noreply.gitee.com>
Date: Tue, 13 Jan 2026 10:24:08 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8C=89=E9=92=AE=E5=9B=BE?=
=?UTF-8?q?=E6=A0=87=E9=97=B4=E8=B7=9D=E6=A0=B7=E5=BC=8F=E5=B9=B6=E4=BF=AE?=
=?UTF-8?q?=E5=A4=8DSKU=E8=A7=84=E6=A0=BC=E5=B1=9E=E6=80=A7=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA,=E5=B0=86=E5=9B=BE=E6=A0=87=E9=97=B4=E8=B7=9D?=
=?UTF-8?q?=E8=A7=84=E5=88=99=E8=B0=83=E6=95=B4=E4=B8=BA=E4=BB=85=E5=AF=B9?=
=?UTF-8?q?=E9=9D=9E=E5=9C=86=E5=BD=A2=E6=8C=89=E9=92=AE=E7=94=9F=E6=95=88?=
=?UTF-8?q?,=E5=90=8C=E6=97=B6=E4=BF=AE=E5=A4=8D=E6=95=B0=E5=AD=97?=
=?UTF-8?q?=E4=BA=BA=E5=BD=A2=E8=B1=A1=E5=A4=B4=E5=83=8F=E5=9B=BE=E7=89=87?=
=?UTF-8?q?=E5=B0=BA=E5=AF=B8=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/theme/element.scss | 15 +++++++++++
.../assets/asset/component/skuDialog.vue | 25 +++++++++++++------
src/views/digitalHuman/avatar/index.vue | 12 ++++-----
3 files changed, 39 insertions(+), 13 deletions(-)
diff --git a/src/theme/element.scss b/src/theme/element.scss
index 17c36d4..4945469 100644
--- a/src/theme/element.scss
+++ b/src/theme/element.scss
@@ -9,11 +9,26 @@
.el-button--default i.iconfont,
.el-button--default i.fa {
font-size: 14px !important;
+}
+// 非圆形按钮的图标右边距(圆形按钮不需要)
+.el-button:not(.is-circle) i.el-icon + span,
+.el-button:not(.is-circle) i.iconfont,
+.el-button:not(.is-circle) i.fa,
+.el-button--default:not(.is-circle) i.iconfont,
+.el-button--default:not(.is-circle) i.fa {
+ margin-left: 5px;
+}
+.el-button:not(.is-circle) > i.el-icon:first-child:not(:last-child),
+.el-button:not(.is-circle) > i.iconfont:first-child:not(:last-child),
+.el-button:not(.is-circle) > i.fa:first-child:not(:last-child) {
margin-right: 5px;
}
.el-button--small i.iconfont,
.el-button--small i.fa {
font-size: 12px !important;
+}
+.el-button--small:not(.is-circle) > i.iconfont:first-child:not(:last-child),
+.el-button--small:not(.is-circle) > i.fa:first-child:not(:last-child) {
margin-right: 5px;
}
diff --git a/src/views/assets/asset/component/skuDialog.vue b/src/views/assets/asset/component/skuDialog.vue
index f4e3c47..88b0a6a 100644
--- a/src/views/assets/asset/component/skuDialog.vue
+++ b/src/views/assets/asset/component/skuDialog.vue
@@ -23,7 +23,12 @@
-
+
+
+ {{ item.name }}: {{ item.options?.[0]?.label || (Array.isArray(item.value) ? item.value[0] : item.value) }}
+
+
+
{{ key }}: {{ value }}
@@ -86,7 +91,7 @@
{{ attr.name }}:
-
+
@@ -148,7 +153,7 @@ interface SpecValueItem {
interface AssetSpecAttr {
name: string;
- options?: string[];
+ options?: { value: string; label: string }[];
dictType?: string;
}
@@ -241,7 +246,7 @@ const fetchAssetSpecAttrs = () => {
.filter((item: any) => item.type === 'multi_select')
.map((item: any) => ({
name: item.name,
- options: item.options?.map((opt: any) => opt.label || opt.value) || [],
+ options: item.options?.map((opt: any) => ({ value: opt.value, label: opt.label || opt.value })) || [],
dictType: item.dictType || '',
}));
} else {
@@ -447,7 +452,7 @@ const removeSkuImage = () => {
};
// 获取属性的可选值
-const getAttrOptions = (key: string): string[] => {
+const getAttrOptions = (key: string): { value: string; label: string }[] => {
if (!key) return [];
const attr = assetSpecAttrs.value.find((a) => a.name === key);
return attr?.options || [];
@@ -503,9 +508,15 @@ const onSubmitSku = async () => {
if (attr.dictType) {
specItem.dictType = attr.dictType;
}
- // 添加 options(只包含选中的值)
+ // 添加 options(只包含选中的值,格式与 metadata 一致)
if (attr.options && attr.options.length > 0) {
- specItem.options = [{ label: selectedValue, value: selectedValue }];
+ // 从 options 中找到选中值对应的完整选项
+ const selectedOpt = attr.options.find((opt) => opt.value === selectedValue || opt.label === selectedValue);
+ if (selectedOpt) {
+ specItem.options = [{ value: selectedOpt.value, label: selectedOpt.label }];
+ } else {
+ specItem.options = [{ value: selectedValue, label: selectedValue }];
+ }
}
specValues.push(specItem);
}
diff --git a/src/views/digitalHuman/avatar/index.vue b/src/views/digitalHuman/avatar/index.vue
index bed8b23..7110195 100644
--- a/src/views/digitalHuman/avatar/index.vue
+++ b/src/views/digitalHuman/avatar/index.vue
@@ -103,7 +103,7 @@ const mockData: AvatarItem[] = [
{
id: 1,
name: '商务男性形象',
- avatar: 'https://img.icons8.com/3d-fluency/512/businessman.png',
+ avatar: 'https://img.icons8.com/3d-fluency/94/businessman.png',
description: '专业商务风格的男性数字人形象,适合企业宣传',
type: '真人形象',
status: 1,
@@ -112,7 +112,7 @@ const mockData: AvatarItem[] = [
{
id: 2,
name: '甜美女性形象',
- avatar: 'https://img.icons8.com/3d-fluency/512/businesswoman.png',
+ avatar: 'https://img.icons8.com/3d-fluency/94/businesswoman.png',
description: '甜美可爱的女性数字人形象,适合直播带货',
type: '真人形象',
status: 1,
@@ -121,7 +121,7 @@ const mockData: AvatarItem[] = [
{
id: 3,
name: '卡通男孩形象',
- avatar: 'https://img.icons8.com/3d-fluency/512/boy.png',
+ avatar: 'https://img.icons8.com/3d-fluency/94/person-male.png',
description: '活泼可爱的卡通男孩形象,适合儿童教育',
type: '卡通形象',
status: 1,
@@ -130,7 +130,7 @@ const mockData: AvatarItem[] = [
{
id: 4,
name: '知性女性形象',
- avatar: 'https://img.icons8.com/3d-fluency/512/teacher.png',
+ avatar: 'https://img.icons8.com/3d-fluency/94/woman-profile.png',
description: '知性优雅的女性数字人形象,适合知识讲解',
type: '真人形象',
status: 0,
@@ -139,7 +139,7 @@ const mockData: AvatarItem[] = [
{
id: 5,
name: '科技机器人形象',
- avatar: 'https://img.icons8.com/3d-fluency/512/robot-2.png',
+ avatar: 'https://img.icons8.com/3d-fluency/94/robot-2.png',
description: '未来科技风格的机器人形象,适合科技产品',
type: '3D形象',
status: 1,
@@ -148,7 +148,7 @@ const mockData: AvatarItem[] = [
{
id: 6,
name: '客服助手形象',
- avatar: 'https://img.icons8.com/3d-fluency/512/customer-support.png',
+ avatar: 'https://img.icons8.com/3d-fluency/94/technical-support.png',
description: '专业友好的客服助手形象,适合在线客服场景',
type: '3D形象',
status: 1,