From 7cd07d635d792089e23fc0e5486992127e0c83d0 Mon Sep 17 00:00:00 2001
From: JenniferW <1627055433@qq.com>
Date: Fri, 13 Jun 2025 10:17:21 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/order/intention/Step2.vue | 227 +++++++++++++++++-----------
1 file changed, 135 insertions(+), 92 deletions(-)
diff --git a/src/views/order/intention/Step2.vue b/src/views/order/intention/Step2.vue
index def43af..94a2dd7 100644
--- a/src/views/order/intention/Step2.vue
+++ b/src/views/order/intention/Step2.vue
@@ -150,91 +150,60 @@
-
-
- 1111
-
-
-
@@ -245,14 +214,21 @@
title="特定替换部件"
width="500px"
>
-
-
+ {{ item.label }}
-
+
![]()
+
+
编号:{{ item.code }}
+
名称:{{ item.label }}
+
+
+
取消
替换
@@ -389,19 +365,16 @@ const replaceSelected = ref(null);
const activeTab = ref("");
// 计算一级菜单项
-const firstLevelItems = computed(() => {
- return treeData.value.map((item) => ({
- code: item.code,
- label: item.label,
- }));
+const firstLevelItems = computed(() => treeData.value);
+
+// 计算二级菜单项(只取第一个一级菜单的 children 作为 tab)
+const secondLevelItems = computed(() => {
+ return treeData.value.length > 0 ? treeData.value[0].children || [] : [];
});
-// 计算二级菜单项
-const secondLevelItems = computed(() => {
- const activeFirstLevel = treeData.value.find(
- (item) => item.code === activeTab.value
- );
- return activeFirstLevel?.children || [];
+// 当前激活的二级菜单项
+const activeSecondLevelItem = computed(() => {
+ return secondLevelItems.value.find(item => item.code === activeTab.value);
});
// 处理tab切换
@@ -494,8 +467,8 @@ function handleNextStep() {
}
onMounted(() => {
- if (treeData.value.length > 0) {
- activeTab.value = treeData.value[0].code;
+ if (secondLevelItems.value.length > 0) {
+ activeTab.value = secondLevelItems.value[0].code;
}
});
@@ -915,4 +888,74 @@ onMounted(() => {
color: var(--el-color-primary);
}
}
+
+.tab-content-flex {
+ display: flex;
+ min-height: 300px;
+}
+.tab-left {
+ width: 260px;
+ border-right: 1px solid #eee;
+ padding-right: 16px;
+ overflow-y: auto;
+}
+.tab-right {
+ flex: 1;
+ padding-left: 24px;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ justify-content: flex-start;
+}
+.custom-tree {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+}
+.tree-node {
+ padding: 8px 12px;
+ cursor: pointer;
+ border-radius: 4px;
+ margin-bottom: 4px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+.tree-node.active {
+ background: #e6f0ff;
+ color: #2156f3;
+}
+.detail-img {
+ width: 180px;
+ height: 120px;
+ object-fit: contain;
+ border: 1px solid #eee;
+ border-radius: 4px;
+ margin-bottom: 16px;
+}
+.replace-list {
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+}
+.replace-item {
+ display: flex;
+ align-items: center;
+ gap: 16px;
+ padding: 8px;
+ border: 1px solid #eee;
+ border-radius: 4px;
+ cursor: pointer;
+}
+.replace-item.selected {
+ border-color: #2156f3;
+ background: #e6f0ff;
+}
+.replace-img {
+ width: 80px;
+ height: 60px;
+ object-fit: contain;
+ border-radius: 4px;
+ border: 1px solid #eee;
+}
\ No newline at end of file