diff --git a/src/views/order/intention/Step2.vue b/src/views/order/intention/Step2.vue index 94a2dd7..276a0a2 100644 --- a/src/views/order/intention/Step2.vue +++ b/src/views/order/intention/Step2.vue @@ -151,14 +151,15 @@ -
+
-
    -
  • -
    + + +
    • -
      - {{ fourthLevel.label }} - 替换 -
      + {{ fourthLevel.label }} + 替换
    -
  • -
+
+ {{ thirdLevel.label }} +
+ +
@@ -205,6 +210,9 @@ 请选择左侧商品
+
+ 暂无数据 +
@@ -363,6 +371,7 @@ const replaceDialogVisible = ref(false); const replaceList = ref([]); const replaceSelected = ref(null); const activeTab = ref(""); +const collapseActiveNames = ref([]); // 计算一级菜单项 const firstLevelItems = computed(() => treeData.value); @@ -466,10 +475,27 @@ function handleNextStep() { } } -onMounted(() => { - if (secondLevelItems.value.length > 0) { - activeTab.value = secondLevelItems.value[0].code; +function selectFirstNode() { + const thirdLevels = activeSecondLevelItem.value?.children || []; + if (thirdLevels.length > 0) { + collapseActiveNames.value = [thirdLevels[0].code]; + if (thirdLevels[0].children && thirdLevels[0].children.length > 0) { + selectedNode.value = thirdLevels[0].children[0]; + } else { + selectedNode.value = thirdLevels[0]; + } + } else { + selectedNode.value = null; + collapseActiveNames.value = []; } +} + +onMounted(() => { + selectFirstNode(); +}); + +watch(activeTab, () => { + selectFirstNode(); }); @@ -920,11 +946,15 @@ onMounted(() => { display: flex; align-items: center; justify-content: space-between; + transition: background 0.2s; } .tree-node.active { background: #e6f0ff; color: #2156f3; } +.tree-node:hover { + background: #f0f6ff; +} .detail-img { width: 180px; height: 120px; @@ -958,4 +988,12 @@ onMounted(() => { border-radius: 4px; border: 1px solid #eee; } +.no-data { + display: flex; + align-items: center; + justify-content: center; + min-height: 300px; + color: #999; + font-size: 18px; +} \ No newline at end of file