wangrong
2026-08-30 761e5c5fa871959f60e15c971c8d83f2b53d0af5
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<script setup lang="ts">
import ComponentWrapper from '@/components/data-visualization/canvas/ComponentWrapper.vue'
import { storeToRefs } from 'pinia'
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import dvHidden from '@/assets/svg/dv-hidden.svg'
import { computed } from 'vue'
import Icon from '../icon-custom/src/Icon.vue'
import EmptyBackground from '../empty-background/src/EmptyBackground.vue'
const dvMainStore = dvMainStoreWithOut()
const { componentData, canvasStyleData, canvasViewInfo, dvInfo } = storeToRefs(dvMainStore)
const emit = defineEmits(['cancelHidden'])
const componentsHidden = computed(() => {
  return componentData.value.filter(ele => ele.dashboardHidden)
})
 
const addToDashboard = item => {
  item.dashboardHidden = false
  emit('cancelHidden', item)
}
</script>
 
<template>
  <div class="config-hidden">
    <template v-if="componentsHidden?.length > 0">
      <div
        :style="{ height: '180px', width: '260px' }"
        class="wrapper-inner-adaptor"
        v-for="item in componentsHidden"
        :key="item.id"
      >
        <div class="component-outer">
          <ComponentWrapper
            canvas-id="canvas-main"
            :canvas-style-data="canvasStyleData"
            :dv-info="dvInfo"
            :canvas-view-info="canvasViewInfo"
            :view-info="canvasViewInfo[item.id]"
            :config="item"
            class="wrapper-design"
            show-position="viewDialog"
            :search-count="0"
            :scale="canvasStyleData.scale"
          />
        </div>
        <div class="select-to-dashboard" @click="addToDashboard(item)">
          <el-tooltip effect="dark" :content="$t('visualization.cancel_hidden')" placement="bottom">
            <el-icon style="font-size: 16px">
              <Icon name="dvHidden"><dvHidden class="svg-icon" /></Icon>
            </el-icon>
          </el-tooltip>
        </div>
      </div>
    </template>
    <template v-else>
      <empty-background
        :description="$t('visualization.no_hidden_components')"
        img-type="noneWhite"
      />
    </template>
  </div>
</template>
 
<style scoped lang="less">
.config-hidden {
  position: relative;
  padding: 16px 0;
  .wrapper-inner-adaptor {
    position: relative;
    margin-left: 8px;
    margin-bottom: 8px;
    float: left;
    background: #fff;
    padding: 4px;
    border-radius: 4px;
    border: 1px solid #dee0e3;
    &:nth-child(2n) {
      margin-right: -1px;
    }
 
    .select-to-dashboard {
      position: absolute;
      width: 16px;
      height: 16px;
      top: 4px;
      right: 8px;
      z-index: 24;
      cursor: pointer;
      &:hover {
        color: var(--ed-color-primary-99, #3370ff99);
      }
    }
 
    .component-outer {
      position: relative;
      width: 100%;
      height: 100%;
      .wrapper-design {
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
      }
    }
 
    &:hover {
      border-color: var(--ed-color-primary-99, #3370ff99);
    }
  }
}
</style>