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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<template>
  <div style="width: 100%; padding-bottom: 8px">
    <el-form label-position="top" style="width: 100%">
      <div style="width: 100%; padding: 16px 8px 0">
        <el-row :gutter="8">
          <el-col :span="12">
            <el-form-item
              :effect="themes"
              class="form-item h-auto"
              :class="'form-item-' + themes"
              :label="t('components.jump_icon_color')"
            >
              <el-color-picker
                :effect="themes"
                size="small"
                v-model="seniorStyleSetting.linkageIconColor"
                :trigger-width="100"
                is-custom
                :predefine="state.predefineColors"
                @change="themeChange"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item
              :effect="themes"
              class="form-item h-auto"
              :class="'form-item-' + themes"
              :label="t('components.level_display_color')"
            >
              <el-color-picker
                v-model="seniorStyleSetting.drillLayerColor"
                :effect="themes"
                :trigger-width="100"
                size="small"
                is-custom
                :predefine="state.predefineColors"
                @change="themeChange"
              />
            </el-form-item>
          </el-col>
        </el-row>
      </div>
    </el-form>
  </div>
</template>
 
<script setup lang="ts">
import { onMounted, reactive, computed } from 'vue'
import { COLOR_PANEL } from '@/views/chart/components/editor/util/chart'
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import { useI18n } from '@/hooks/web/useI18n'
import { cloneDeep } from 'lodash-es'
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
import eventBus from '@/utils/eventBus'
const { t } = useI18n()
const dvMainStore = dvMainStoreWithOut()
const snapshotStore = snapshotStoreWithOut()
const seniorStyleSetting = computed<any>(() => {
  return dvMainStore.canvasStyleData.component.seniorStyleSetting
})
 
defineProps({
  themes: {
    type: String,
    default: 'light'
  }
})
const state = reactive({
  fontSize: [],
  isSetting: false,
  predefineColors: COLOR_PANEL
})
 
const initForm = () => {
  // do
}
const themeChange = () => {
  dvMainStore.canvasStyleData.component.seniorStyleSetting = cloneDeep(seniorStyleSetting.value)
  snapshotStore.recordSnapshotCache('seniorStyleSettingSimpleSelector-themeChange')
}
 
onMounted(() => {
  eventBus.on('onThemeColorChange', initForm)
})
</script>
 
<style scoped lang="less">
.hover-icon {
  &.active {
    color: var(--ed-color-primary) !important;
    background-color: var(--ed-color-primary-1a, rgba(51, 112, 255, 0.1));
  }
  & + & {
    margin-left: 8px;
  }
}
.m-divider {
  border-color: rgba(31, 35, 41, 0.15);
  margin: 0 0 8px;
}
.inner-collapse {
  :deep(.ed-collapse-item__header) {
    background-color: transparent !important;
  }
  :deep(.ed-collapse-item__header) {
    border: none;
  }
  :deep(.ed-collapse-item__wrap) {
    border: none;
  }
}
.ed-form-item {
  margin-bottom: 8px;
 
  :deep(.ed-form-item__label) {
    color: #646a73;
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
  }
}
 
.h-auto {
  :deep(.ed-form-item__label) {
    height: auto;
  }
}
.form-item-dark {
  :deep(.ed-form-item__label) {
    color: #6a6a6a;
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
  }
}
</style>