wangrong
2026-08-30 4c949c0dc9bcae785c281c9d8125295f09810b15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<script lang="tsx" setup>
import { computed } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import { ArrowRight } from '@element-plus/icons-vue'
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
const dvMainStore = dvMainStoreWithOut()
 
const { t } = useI18n()
 
const props = defineProps({
  drillFilters: {
    type: Array,
    default: () => []
  },
  themeStyle: {
    type: Object,
    required: false,
    default: null
  },
  disabled: {
    type: Boolean,
    required: false,
    default: false
  }
})
 
const emit = defineEmits(['onDrillJump'])
 
const textColor = computed(
  () => dvMainStore.canvasStyleData.component.seniorStyleSetting.drillLayerColor
)
 
const drillJump = index => {
  if (index < props.drillFilters.length) {
    emit('onDrillJump', index)
  }
}
 
const drillPathVar = computed(() => [{ '--drill-color': textColor.value }])
</script>
 
<template>
  <div
    v-if="props.drillFilters && props.drillFilters.length > 0"
    class="drill"
    :style="drillPathVar"
    :class="{ noClick: disabled }"
  >
    <el-breadcrumb :separator-icon="ArrowRight" class="drill-style">
      <el-breadcrumb-item class="drill-item" @click="drillJump(0)">
        <span :style="{ color: textColor }">{{ t('commons.all') }}</span>
      </el-breadcrumb-item>
      <el-breadcrumb-item
        v-for="(filter, index) in props.drillFilters"
        :key="index"
        class="drill-item"
        @click="drillJump(index + 1)"
      >
        <span class="item-name" :style="{ color: textColor }" :title="filter.value[0]">{{
          filter.value[0]
        }}</span>
      </el-breadcrumb-item>
    </el-breadcrumb>
  </div>
</template>
 
<style lang="less" scoped>
.drill-style {
  font-size: 12px;
}
.drill-style :deep(.el-breadcrumb__separator) {
  margin: 0 !important;
}
.drill-item {
  cursor: pointer;
  .item-name {
    max-width: 200px;
    display: inline-block;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }
}
.drill {
  z-index: 1;
  height: 20px;
  padding: 0 16px;
  ::v-deep(.ed-icon) {
    color: var(--drill-color) !important;
  }
}
.noClick {
  pointer-events: none; /* 禁止鼠标点击 */
}
</style>