xt-element-ui 2.2.2 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/README.md +1 -1
  2. package/docs/README.md +10 -3
  3. package/docs/components/base/xt-button.md +11 -4
  4. package/docs/components/base/xt-card.md +5 -11
  5. package/docs/components/base/xt-config-provider.md +2 -0
  6. package/docs/components/base/xt-flow.md +404 -0
  7. package/docs/components/base/xt-multi.md +5 -5
  8. package/docs/components/business/xt-chart.md +1 -0
  9. package/lib/index.common.1.js +2 -2
  10. package/lib/index.common.2.js +1 -1
  11. package/lib/index.common.js +11462 -118010
  12. package/lib/index.css +1 -1
  13. package/lib/index.umd.1.js +2 -2
  14. package/lib/index.umd.2.js +1 -1
  15. package/lib/index.umd.js +11468 -118015
  16. package/lib/index.umd.min.js +1 -1
  17. package/lib/xt-badge/xt-badge.common.js +1 -1
  18. package/lib/xt-badge/xt-badge.css +1 -1
  19. package/lib/xt-badge/xt-badge.umd.js +1 -1
  20. package/lib/xt-button/xt-button.common.js +13 -8
  21. package/lib/xt-button/xt-button.css +1 -1
  22. package/lib/xt-button/xt-button.umd.js +13 -8
  23. package/lib/xt-button/xt-button.umd.min.js +1 -1
  24. package/lib/xt-card/xt-card.common.js +5 -5
  25. package/lib/xt-card/xt-card.umd.js +5 -5
  26. package/lib/xt-card/xt-card.umd.min.js +1 -1
  27. package/lib/xt-card-item/xt-card-item.common.js +4 -4
  28. package/lib/xt-card-item/xt-card-item.umd.js +4 -4
  29. package/lib/xt-card-item/xt-card-item.umd.min.js +1 -1
  30. package/lib/xt-chart/xt-chart.common.js +1969 -108924
  31. package/lib/xt-chart/xt-chart.css +1 -1
  32. package/lib/xt-chart/xt-chart.umd.js +1975 -108929
  33. package/lib/xt-chart/xt-chart.umd.min.js +1 -1
  34. package/lib/xt-config-provider/xt-config-provider.common.js +561 -107504
  35. package/lib/xt-config-provider/xt-config-provider.css +1 -1
  36. package/lib/xt-config-provider/xt-config-provider.umd.js +567 -107509
  37. package/lib/xt-config-provider/xt-config-provider.umd.min.js +1 -1
  38. package/lib/xt-date-picker/xt-date-picker.common.1.js +2 -2
  39. package/lib/xt-date-picker/xt-date-picker.common.2.js +1 -1
  40. package/lib/xt-date-picker/xt-date-picker.common.js +1 -1
  41. package/lib/xt-date-picker/xt-date-picker.css +1 -1
  42. package/lib/xt-date-picker/xt-date-picker.umd.1.js +2 -2
  43. package/lib/xt-date-picker/xt-date-picker.umd.2.js +1 -1
  44. package/lib/xt-date-picker/xt-date-picker.umd.js +1 -1
  45. package/lib/xt-flex-box/xt-flex-box.common.js +1 -1
  46. package/lib/xt-flex-box/xt-flex-box.umd.js +1 -1
  47. package/lib/xt-flow/demo.html +10 -0
  48. package/lib/xt-flow/index.js +1 -0
  49. package/lib/xt-flow/xt-flow.common.js +638 -0
  50. package/lib/xt-flow/xt-flow.css +1 -0
  51. package/lib/xt-flow/xt-flow.umd.js +648 -0
  52. package/lib/xt-flow/xt-flow.umd.min.js +1 -0
  53. package/lib/xt-form-schema/xt-form-schema.common.js +1 -1
  54. package/lib/xt-form-schema/xt-form-schema.umd.js +1 -1
  55. package/lib/xt-grid-box/xt-grid-box.common.js +1 -1
  56. package/lib/xt-grid-box/xt-grid-box.umd.js +1 -1
  57. package/lib/xt-grid-item/xt-grid-item.common.js +1 -1
  58. package/lib/xt-grid-item/xt-grid-item.umd.js +1 -1
  59. package/lib/xt-icon/xt-icon.common.js +1 -1
  60. package/lib/xt-icon/xt-icon.umd.js +1 -1
  61. package/lib/xt-input/xt-input.common.js +1 -1
  62. package/lib/xt-input/xt-input.umd.js +1 -1
  63. package/lib/xt-list/xt-list.common.js +1 -1
  64. package/lib/xt-list/xt-list.umd.js +1 -1
  65. package/lib/xt-map/xt-map.common.js +1 -1
  66. package/lib/xt-map/xt-map.umd.js +1 -1
  67. package/lib/xt-map-provider/xt-map-provider.common.js +1 -1
  68. package/lib/xt-map-provider/xt-map-provider.umd.js +1 -1
  69. package/lib/xt-page/xt-page.common.js +1 -1
  70. package/lib/xt-page/xt-page.umd.js +1 -1
  71. package/lib/xt-progress/xt-progress.common.js +1 -1
  72. package/lib/xt-progress/xt-progress.umd.js +1 -1
  73. package/lib/xt-scroll-arrow/xt-scroll-arrow.common.js +1 -1
  74. package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.js +1 -1
  75. package/lib/xt-select-tree/xt-select-tree.common.js +1 -1
  76. package/lib/xt-select-tree/xt-select-tree.umd.js +1 -1
  77. package/lib/xt-step-price/xt-step-price.common.js +2 -2
  78. package/lib/xt-step-price/xt-step-price.umd.js +2 -2
  79. package/lib/xt-step-price-item/xt-step-price-item.common.js +1 -1
  80. package/lib/xt-step-price-item/xt-step-price-item.umd.js +1 -1
  81. package/lib/xt-tab-pane/xt-tab-pane.common.js +1 -1
  82. package/lib/xt-tab-pane/xt-tab-pane.umd.js +1 -1
  83. package/lib/xt-table/xt-table.common.js +2 -2
  84. package/lib/xt-table/xt-table.umd.js +2 -2
  85. package/lib/xt-tabs/xt-tabs.common.js +1 -1
  86. package/lib/xt-tabs/xt-tabs.umd.js +1 -1
  87. package/lib/xt-text/xt-text.common.js +1 -1
  88. package/lib/xt-text/xt-text.css +1 -1
  89. package/lib/xt-text/xt-text.umd.js +1 -1
  90. package/lib/xt-time/xt-time.common.js +1 -1
  91. package/lib/xt-time/xt-time.umd.js +1 -1
  92. package/lib/xt-transfer-tree/xt-transfer-tree.common.js +1 -1
  93. package/lib/xt-transfer-tree/xt-transfer-tree.umd.js +1 -1
  94. package/lib/xt-upload/xt-upload.common.js +11 -11
  95. package/lib/xt-upload/xt-upload.umd.js +12 -12
  96. package/lib/xt-upload/xt-upload.umd.min.js +1 -1
  97. package/package.json +5 -6
  98. package/src/components/index.scss +4 -1
  99. package/src/components/xt-badge/style/index.scss +6 -6
  100. package/src/components/xt-button/index.vue +11 -6
  101. package/src/components/xt-button/style/index.scss +7 -5
  102. package/src/components/xt-card/index.vue +3 -3
  103. package/src/components/xt-card-item/index.vue +2 -2
  104. package/src/components/xt-chart/XtMulti.vue +8 -18
  105. package/src/components/xt-chart/XtPie.vue +1 -0
  106. package/src/components/xt-chart/utils.js +84 -50
  107. package/src/components/xt-config-provider/index.vue +56 -54
  108. package/src/components/xt-date-picker/style/index.scss +4 -6
  109. package/src/components/xt-flow/flowable-parser.js +244 -0
  110. package/src/components/xt-flow/index.js +8 -0
  111. package/src/components/xt-flow/index.vue +226 -0
  112. package/src/components/xt-flow/style/index.scss +359 -0
  113. package/src/components/xt-text/style/index.scss +6 -6
  114. package/src/index.js +8 -13
  115. package/src/styles/css-variables.scss +73 -1
@@ -7,16 +7,27 @@ const themeKeys = {
7
7
  "dark": themeDark
8
8
  };
9
9
 
10
- // echarts 仅在客户端加载,避免 SSR 编译/渲染报错
10
+ // 品牌色映射 - 用于 ECharts 图表调色板
11
+ const brandColors = {
12
+ "water": ["#0077be", "#0099cc", "#5DB1FF", "#005C91", "#003D61"],
13
+ "electricity": ["#2ecc71", "#27ae60", "#5DD3B0", "#22A85A", "#167039"],
14
+ "gas": ["#f39c12", "#e67e22", "#F5C976", "#C28500", "#8C6000"]
15
+ };
16
+
11
17
  let echarts = null;
18
+ let themesRegistered = false;
12
19
 
13
20
  function getEcharts() {
14
21
  if (!echarts && typeof window !== 'undefined') {
15
22
  try {
16
23
  echarts = require('echarts');
17
- // 注册所有主题
18
- for (const key in themeKeys) {
19
- echarts.registerTheme(key, themeKeys[key]);
24
+
25
+ // 主题只注册一次
26
+ if (!themesRegistered) {
27
+ for (const key in themeKeys) {
28
+ echarts.registerTheme(key, themeKeys[key]);
29
+ }
30
+ themesRegistered = true;
20
31
  }
21
32
  } catch (e) {
22
33
  console.warn('[XtChart] echarts 加载失败:', e.message);
@@ -59,6 +70,43 @@ EchartsUtil.currentTheme = "default";
59
70
  EchartsUtil.currentSize = "medium";
60
71
  EchartsUtil.inverse = false;
61
72
 
73
+ // 颜色处理工具方法
74
+ EchartsUtil.hexToRgb = function(hex) {
75
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
76
+ return result ? {
77
+ r: parseInt(result[1], 16),
78
+ g: parseInt(result[2], 16),
79
+ b: parseInt(result[3], 16)
80
+ } : null;
81
+ };
82
+
83
+ EchartsUtil.rgbToHex = function(r, g, b) {
84
+ return '#' + [r, g, b].map(x => {
85
+ const hex = x.toString(16);
86
+ return hex.length === 1 ? '0' + hex : hex;
87
+ }).join('');
88
+ };
89
+
90
+ EchartsUtil.lightenColor = function(hex, percent) {
91
+ const rgb = this.hexToRgb(hex);
92
+ if (!rgb) return hex;
93
+ const ratio = percent / 100;
94
+ const r = Math.round(rgb.r * (1 - ratio) + 255 * ratio);
95
+ const g = Math.round(rgb.g * (1 - ratio) + 255 * ratio);
96
+ const b = Math.round(rgb.b * (1 - ratio) + 255 * ratio);
97
+ return this.rgbToHex(r, g, b);
98
+ };
99
+
100
+ EchartsUtil.darkenColor = function(hex, percent) {
101
+ const rgb = this.hexToRgb(hex);
102
+ if (!rgb) return hex;
103
+ const ratio = percent / 100;
104
+ const r = Math.max(0, Math.round(rgb.r * (1 - ratio)));
105
+ const g = Math.max(0, Math.round(rgb.g * (1 - ratio)));
106
+ const b = Math.max(0, Math.round(rgb.b * (1 - ratio)));
107
+ return this.rgbToHex(r, g, b);
108
+ };
109
+
62
110
  EchartsUtil.EchartsUtil = {
63
111
  backgroundColor: "transparent",
64
112
  tooltip: {
@@ -74,42 +122,11 @@ EchartsUtil.EchartsUtil = {
74
122
  }
75
123
  },
76
124
  grid: {
77
- top: "25%",
78
- left: "40",
79
- right: "15",
80
- bottom: "40"
81
- },
82
- xAxis: {
83
- type: "category",
84
- boundaryGap: false,
85
- axisTick: {
86
- show: true,
87
- length: 4
88
- },
89
- axisLabel: {
90
- fontSize: 12,
91
- interval: 0,
92
- formatter: function(value) {
93
- return !this.reverse && this.longLable ? value.replace(new RegExp(`(.{${this.longLableSplitNum}})`, "g"), `$1\n`) : value;
94
- }
95
- }
96
- },
97
- yAxis: {
98
- type: "value",
99
- axisTick: {
100
- show: false
101
- },
102
- min: null,
103
- max: null,
104
- axisLabel: {
105
- show: false
106
- },
107
- splitLine: {
108
- lineStyle: {
109
- type: "dashed",
110
- width: 1
111
- }
112
- }
125
+ left: 16,
126
+ right: 16,
127
+ top: 40,
128
+ bottom: 48,
129
+ containLabel: true
113
130
  }
114
131
  };
115
132
 
@@ -358,11 +375,13 @@ EchartsUtil.init = function(dom, theme, customOption, size) {
358
375
  this.currentTheme = useTheme;
359
376
  this.currentSize = useSize;
360
377
 
361
- let themeOption = themeKeys[useTheme];
378
+ // 使用基础选项配置作为 option 模板
379
+ // 主题已通过 ec.init(dom, useTheme) 应用,这里不需要再使用 themeOption
380
+ let baseOption = JSON.parse(JSON.stringify(EchartsUtil.EchartsUtil));
362
381
  // 应用字体大小配置
363
- themeOption = this.applyFontSize(themeOption, useSize);
382
+ baseOption = this.applyFontSize(baseOption, useSize);
364
383
 
365
- const option = this.mergeOptions(themeOption, customOption);
384
+ const option = this.mergeOptions(baseOption, customOption);
366
385
 
367
386
  const chart = ec.init(dom, useTheme);
368
387
  chart.setOption(option, true);
@@ -401,12 +420,11 @@ EchartsUtil.changeSingleTheme = function(dom, chartIns, customOption, newTheme)
401
420
  return newChart;
402
421
  };
403
422
 
404
- EchartsUtil.changeAllTheme = function(newTheme, newSize) {
423
+ EchartsUtil.changeAllTheme = function(newTheme, newSize, primaryColor, brand) {
405
424
  const ec = getEcharts();
406
425
  if (!ec || !newTheme) return;
407
426
 
408
427
  this.currentTheme = newTheme;
409
- // 如果传入了新的 size,则更新全局 size
410
428
  if (newSize) {
411
429
  this.currentSize = newSize;
412
430
  }
@@ -415,7 +433,6 @@ EchartsUtil.changeAllTheme = function(newTheme, newSize) {
415
433
  const dom = item.dom;
416
434
  const chart = item.chart;
417
435
  const customOption = item.customOption;
418
- // 使用图表自己的 size,如果没有则使用全局 size
419
436
  const useSize = item.size || EchartsUtil.currentSize;
420
437
 
421
438
  if (chart) {
@@ -423,14 +440,31 @@ EchartsUtil.changeAllTheme = function(newTheme, newSize) {
423
440
  }
424
441
 
425
442
  const newChart = ec.init(dom, newTheme);
426
- let themeOption = themeKeys[newTheme];
443
+
444
+ // 使用基础选项配置(EchartsUtil.EchartsUtil)作为 option 模板
445
+ let baseOption = JSON.parse(JSON.stringify(EchartsUtil.EchartsUtil));
446
+
427
447
  // 应用字体大小配置
428
- themeOption = EchartsUtil.applyFontSize(themeOption, useSize);
429
- const option = EchartsUtil.mergeOptions(themeOption, customOption);
448
+ baseOption = EchartsUtil.applyFontSize(baseOption, useSize);
449
+
450
+ // 应用品牌色到图表调色板
451
+ if (brand && brandColors[brand]) {
452
+ baseOption.color = brandColors[brand];
453
+ } else if (primaryColor) {
454
+ // 如果没有品牌色但有自定义主色,生成衍生色系
455
+ baseOption.color = [
456
+ primaryColor,
457
+ EchartsUtil.lightenColor(primaryColor, 30),
458
+ EchartsUtil.lightenColor(primaryColor, 50),
459
+ EchartsUtil.darkenColor(primaryColor, 20),
460
+ EchartsUtil.darkenColor(primaryColor, 40)
461
+ ];
462
+ }
430
463
 
464
+ const option = EchartsUtil.mergeOptions(baseOption, customOption);
465
+ console.log('option1', option);
431
466
  newChart.setOption(option, true);
432
467
  item.chart = newChart;
433
- // 更新图表的 size 记录
434
468
  item.size = useSize;
435
469
  EchartsUtil.bindResize(newChart);
436
470
  });
@@ -7,71 +7,67 @@ const HTMLElementType = typeof HTMLElement !== 'undefined' ? HTMLElement : Objec
7
7
  export default {
8
8
  name: 'XtConfigProvider',
9
9
  inheritAttrs: false,
10
- provide() {
10
+ data() {
11
11
  return {
12
12
  xtConfig: {
13
13
  theme: this.theme,
14
14
  size: this.size,
15
- primaryColor: this.primaryColor
15
+ primaryColor: this.primaryColor,
16
+ brand: this.brand
16
17
  }
17
18
  }
18
19
  },
20
+ provide() {
21
+ return {
22
+ xtConfig: this.xtConfig
23
+ }
24
+ },
19
25
  watch: {
20
26
  theme(newVal) {
21
- this.xtConfig ={
22
- theme: newVal,
23
- size: this.size,
24
- primaryColor: this.primaryColor
25
- }
27
+ this.xtConfig.theme = newVal
28
+ this.updateConfig()
26
29
  },
27
30
  size(newVal) {
28
- this.xtConfig ={
29
- theme: newVal,
30
- size: this.size,
31
- primaryColor: this.primaryColor
32
- }
31
+ this.xtConfig.size = newVal
32
+ this.updateConfig()
33
33
  },
34
34
  primaryColor(newVal) {
35
- this.xtConfig ={
36
- theme: newVal,
37
- size: this.size,
38
- primaryColor: this.primaryColor
39
- }
35
+ this.xtConfig.primaryColor = newVal
36
+ this.updateConfig()
37
+ },
38
+ brand(newVal) {
39
+ this.xtConfig.brand = newVal
40
+ this.updateConfig()
40
41
  }
41
42
  },
42
43
  render(h) {
43
- // Vue 2 不支持 Fragment,当 tag="template" 时需要特殊处理
44
- // 如果设置了 proxyElement,则不渲染包裹元素,只渲染 slot 内容
45
- if (this.tag === 'template' || this.proxyElement) {
46
- // 渲染 slot 内容,如果只有一个元素则直接返回,否则包裹一个 div
47
- const slotContent = this.$slots.default
44
+ const slotContent = this.$slots.default
48
45
 
46
+ if (this.tag === 'template' || this.proxyElement) {
49
47
  if (!slotContent || slotContent.length === 0) {
50
48
  return h('div')
51
49
  }
52
50
 
53
- // 如果 slot 只有一个元素,直接返回该元素
54
51
  if (slotContent.length === 1) {
55
52
  return slotContent[0]
56
53
  }
57
54
 
58
- // Vue 2 不支持多根节点,需要包裹一个 div
59
- // 使用普通的 div 包裹,避免 display: contents 的兼容性问题
60
55
  return h('div', {
61
56
  class: 'xt-config-provider-wrapper',
62
57
  attrs: {
63
- 'data-theme': this.theme
58
+ 'data-theme': this.theme,
59
+ 'data-brand': this.brand
64
60
  }
65
61
  }, slotContent)
66
62
  }
67
63
 
68
- // 正常渲染包裹元素
69
64
  return h(this.tag, {
70
65
  style: this.mergedStyle,
71
66
  class: this.computedClass,
72
67
  attrs: {
73
68
  ...this.customAttrs,
74
- 'data-theme': this.theme
69
+ 'data-theme': this.theme,
70
+ 'data-brand': this.brand
75
71
  }
76
72
  }, this.$slots.default)
77
73
  },
@@ -85,12 +81,22 @@ export default {
85
81
  },
86
82
  size: {
87
83
  type: String,
88
- default: 'medium'
84
+ default: 'medium',
85
+ validator: (value) => {
86
+ return ['small', 'medium', 'large'].includes(value)
87
+ }
89
88
  },
90
89
  primaryColor: {
91
90
  type: String,
92
91
  default: '#1890ff'
93
92
  },
93
+ brand: {
94
+ type: String,
95
+ default: '',
96
+ validator: (value) => {
97
+ return ['', 'water', 'electricity', 'gas'].includes(value)
98
+ }
99
+ },
94
100
  vars: {
95
101
  type: Object,
96
102
  default: () => ({})
@@ -118,12 +124,12 @@ export default {
118
124
  onThemeChange: {
119
125
  type: Function,
120
126
  default: null,
121
- description: '主题改变时的钩子函数,接收参数: { theme, size, primaryColor }'
127
+ description: '主题改变时的钩子函数,接收参数: { theme, size, primaryColor, brand }'
122
128
  },
123
129
  onStyleApplied: {
124
130
  type: Function,
125
131
  default: null,
126
- description: '样式应用完成时的钩子函数,接收参数: { element, style, theme }'
132
+ description: '样式应用完成时的钩子函数,接收参数: { element, style, theme, brand }'
127
133
  }
128
134
  },
129
135
  computed: {
@@ -133,13 +139,11 @@ export default {
133
139
  if (this.primaryColor) {
134
140
  const color = this.normalizeColor(this.primaryColor)
135
141
  result['--xt-color-primary'] = color
136
- // 浅色系列(与 css-variables.scss 保持一致)
137
142
  result['--xt-color-primary-light-3'] = this.lightenColor(color, 30)
138
143
  result['--xt-color-primary-light-5'] = this.lightenColor(color, 50)
139
144
  result['--xt-color-primary-light-7'] = this.lightenColor(color, 70)
140
145
  result['--xt-color-primary-light-8'] = this.lightenColor(color, 80)
141
146
  result['--xt-color-primary-light-9'] = this.lightenColor(color, 90)
142
- // 深色系列
143
147
  result['--xt-color-primary-dark-2'] = this.darkenColor(color, 20)
144
148
  }
145
149
 
@@ -154,18 +158,17 @@ export default {
154
158
 
155
159
  if (this.theme === 'dark') {
156
160
  if (this.injectBackground) {
157
- result.backgroundColor = result['--xt-color-bg-primary'] || '#141414'
161
+ result.backgroundColor = result['--xt-bg-color'] || '#141414'
158
162
  }
159
163
  if (this.injectColor) {
160
- result.color = result['--xt-color-text-primary'] || '#E5EAF3'
164
+ result.color = result['--xt-text-color-primary'] || '#E5EAF3'
161
165
  }
162
166
  } else {
163
- // 恢复默认主题颜色(light 主题)
164
167
  if (this.injectBackground) {
165
- result.backgroundColor = result['--xt-color-bg-primary'] || '#ffffff'
168
+ result.backgroundColor = result['--xt-bg-color'] || '#ffffff'
166
169
  }
167
170
  if (this.injectColor) {
168
- result.color = result['--xt-color-text-primary'] || '#2c3e50'
171
+ result.color = result['--xt-text-color-primary'] || '#303133'
169
172
  }
170
173
  }
171
174
 
@@ -181,7 +184,7 @@ export default {
181
184
  return classes
182
185
  },
183
186
  customAttrs() {
184
- const props = ['theme', 'size', 'primaryColor', 'vars', 'tag', 'injectBackground', 'injectColor', 'proxyElement']
187
+ const props = ['theme', 'size', 'primaryColor', 'brand', 'vars', 'tag', 'injectBackground', 'injectColor', 'proxyElement']
185
188
  const attrs = {}
186
189
 
187
190
  for (const key in this.$attrs) {
@@ -203,6 +206,10 @@ export default {
203
206
  this.clearProxyElementStyle()
204
207
  },
205
208
  methods: {
209
+ updateConfig() {
210
+ this.applyProxyElementStyle()
211
+ },
212
+
206
213
  normalizeColor(color) {
207
214
  if (!color) return '#1890ff'
208
215
 
@@ -250,8 +257,6 @@ export default {
250
257
  const rgb = this.hexToRgb(hex)
251
258
  if (!rgb) return hex
252
259
 
253
- // 使用与 Element Plus 一致的算法:将颜色与白色按比例混合
254
- // percent 表示混合白色的比例(0-100),即 (1 - percent/100) 是原色比例
255
260
  const ratio = percent / 100
256
261
  const r = Math.round(rgb.r * (1 - ratio) + 255 * ratio)
257
262
  const g = Math.round(rgb.g * (1 - ratio) + 255 * ratio)
@@ -264,8 +269,6 @@ export default {
264
269
  const rgb = this.hexToRgb(hex)
265
270
  if (!rgb) return hex
266
271
 
267
- // 使用按比例混合黑色的方式变暗
268
- // percent 表示混合黑色的比例(0-100)
269
272
  const ratio = percent / 100
270
273
  const r = Math.max(0, Math.round(rgb.r * (1 - ratio)))
271
274
  const g = Math.max(0, Math.round(rgb.g * (1 - ratio)))
@@ -305,36 +308,36 @@ export default {
305
308
 
306
309
  const style = this.mergedStyle
307
310
  const prevTheme = element.getAttribute('data-theme')
311
+ const prevBrand = element.getAttribute('data-brand')
308
312
 
309
- // 应用样式到代理元素
310
313
  for (const key in style) {
311
314
  element.style.setProperty(key, style[key])
312
315
  }
313
316
 
314
- // 设置 data-theme 属性
315
317
  element.setAttribute('data-theme', this.theme)
318
+ element.setAttribute('data-brand', this.brand)
316
319
 
317
- // 更新图表颜色
318
- EchartsUtil.changeAllTheme(this.theme, this.size, this.primaryColor)
320
+ EchartsUtil.changeAllTheme(this.theme, this.size, this.primaryColor, this.brand)
319
321
 
320
- // 触发主题改变钩子(当主题实际发生变化时)
321
322
  if (prevTheme !== this.theme && typeof this.onThemeChange === 'function') {
322
323
  this.onThemeChange({
323
324
  theme: this.theme,
324
325
  size: this.size,
325
326
  primaryColor: this.primaryColor,
326
- prevTheme: prevTheme
327
+ brand: this.brand,
328
+ prevTheme: prevTheme,
329
+ prevBrand: prevBrand
327
330
  })
328
331
  }
329
332
 
330
- // 触发样式应用完成钩子
331
333
  if (typeof this.onStyleApplied === 'function') {
332
334
  this.onStyleApplied({
333
335
  element: element,
334
336
  style: style,
335
337
  theme: this.theme,
336
338
  size: this.size,
337
- primaryColor: this.primaryColor
339
+ primaryColor: this.primaryColor,
340
+ brand: this.brand
338
341
  })
339
342
  }
340
343
 
@@ -350,17 +353,16 @@ export default {
350
353
  element.style.removeProperty(key)
351
354
  }
352
355
 
353
- // 移除 data-theme 属性
354
356
  element.removeAttribute('data-theme')
357
+ element.removeAttribute('data-brand')
355
358
  }
356
359
  }
357
360
  }
358
361
  </script>
359
362
 
360
363
  <style scoped>
361
- /* 包裹容器样式 - 最小化影响布局 */
362
364
  .xt-config-provider-wrapper {
363
365
  width: 100%;
364
366
  height: 100%;
365
367
  }
366
- </style>
368
+ </style>
@@ -3,7 +3,7 @@
3
3
  .xt-date-picker-container {
4
4
  display: inline-block;
5
5
  width: 100%;
6
-
6
+ --xt-input-height: 32px;
7
7
  }
8
8
  .xt-date .el-date-editor .el-input__inner {
9
9
  background-color: var(--xt-fill-color-blank);
@@ -13,7 +13,7 @@
13
13
  border-radius: var(--xt-border-radius-small, 4px);
14
14
  height: var(--xt-input-height);
15
15
  line-height: var(--xt-input-height);
16
- padding: 0 15px;
16
+ padding: 0 30px;
17
17
  }
18
18
  .xt-date-dimension {
19
19
  margin-bottom: 8px;
@@ -26,10 +26,8 @@
26
26
 
27
27
 
28
28
 
29
- .date-picker {
30
- .quarter-panel {
31
- padding: 10px;
32
- }
29
+ .quarter-panel {
30
+ padding: 10px;
33
31
 
34
32
  .quarter-header {
35
33
  display: flex;