xt-element-ui 1.2.2 → 1.2.4

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 (36) hide show
  1. package/lib/index.common.js +1322 -1281
  2. package/lib/index.css +1 -1
  3. package/lib/index.umd.js +1327 -1286
  4. package/lib/index.umd.min.js +5 -5
  5. package/package.json +1 -1
  6. package/src/components/ex-button/index.vue +1 -1
  7. package/src/components/ex-button/style/index.scss +10 -4
  8. package/src/components/ex-chart/ExPie.vue +1 -4
  9. package/src/components/ex-chart/theme/dark.js +15 -13
  10. package/src/components/ex-chart/utils.js +1 -1
  11. package/src/components/ex-page/index.js +2 -0
  12. package/src/components/ex-select-tree/index.js +2 -0
  13. package/src/components/{xt-select-tree → ex-select-tree}/index.vue +1 -1
  14. package/src/components/ex-table/ExTableCell.vue +3 -2
  15. package/src/components/ex-table/VirtualElTable.vue +234 -0
  16. package/src/components/ex-table/index.vue +176 -445
  17. package/src/components/ex-upload/index.js +2 -0
  18. package/src/components/xt-button/index.vue +2 -2
  19. package/src/components/xt-button/style/index.scss +524 -614
  20. package/src/components/xt-card-item/index copy.vue +93 -0
  21. package/src/components/xt-card-item/index.vue +23 -83
  22. package/src/components/xt-card-item/style/index copy.scss +72 -0
  23. package/src/components/xt-card-item/style/index.scss +51 -40
  24. package/src/components/xt-config-provider/index.js +2 -2
  25. package/src/components/xt-config-provider/index.vue +9 -5
  26. package/src/components/xt-text/index.vue +58 -29
  27. package/src/components/xt-text/style/index.scss +13 -13
  28. package/src/styles/css-variables.scss +1 -1
  29. package/src/styles/element-theme.scss +1 -1
  30. package/src/utils/index.js +11 -2
  31. package/src/components/xt-page/index.js +0 -0
  32. package/src/components/xt-select-tree/index.js +0 -0
  33. package/src/components/xt-upload/index.js +0 -2
  34. /package/src/components/{xt-page → ex-page}/index.vue +0 -0
  35. /package/src/components/{xt-upload → ex-upload}/index.vue +0 -0
  36. /package/src/components/{xt-upload → ex-upload}/preview.vue +0 -0
@@ -0,0 +1,93 @@
1
+ <template>
2
+ <FlexBox
3
+ v-if="iconType=='border'"
4
+ class="xt-card-item is-border"
5
+ :class="[iconType=='border'?`is-${type}`:'']"
6
+ :style="cardItemStyle"
7
+ content="between"
8
+ >
9
+ <span class="item__label" v-if="title">
10
+ <slot name="label">{{ label }}</slot>
11
+ </span>
12
+ <span class="item__value">
13
+ <slot name="value">{{ value }}</slot>
14
+ </span>
15
+ <span class="item__unit">
16
+ <slot name="unit">{{ unit }}</slot>
17
+ </span>
18
+ </FlexBox>
19
+ <FlexBox
20
+ v-else
21
+ class="xt-card-item"
22
+ :direction="direction"
23
+ :content="contentAlign"
24
+ >
25
+ <slot name="icon">
26
+ <el-button :type="type" :circle="circle" :round="round" plain :icon="icon"></el-button>
27
+ </slot>
28
+ <div class="item__value">
29
+ <span class="value" :style="valueStyle">
30
+ <slot name="value">{{ label }}</slot>
31
+ </span>
32
+ <div class="unit">{{ value }}</div>
33
+ </div>
34
+ </FlexBox>
35
+ </template>
36
+ <script>
37
+ import FlexBox from '../xt-flex-box/index.vue'
38
+ export default {
39
+ name: "XtCardItem",
40
+ components: {
41
+ FlexBox
42
+ },
43
+ props: {
44
+ iconType: { default: "border" },
45
+ type: { default: "primary" },
46
+ label: {},
47
+ value: {},
48
+ unit: {},
49
+ icon: {},
50
+ iconAt: { default: "right" },
51
+ color: {
52
+ type: String,
53
+ default: ''
54
+ }
55
+ },
56
+ data() {
57
+ return {
58
+ circle: false,
59
+ round: false
60
+ }
61
+ },
62
+ computed: {
63
+ contentAlign() {
64
+ return this.iconAt == 'center' ? 'center' : 'start'
65
+ },
66
+ direction() {
67
+ const iconAtMap = {
68
+ left: 'row',
69
+ right: 'row-reverse',
70
+ top: 'column',
71
+ bottom: 'column-reverse'
72
+ }
73
+ return iconAtMap[this.iconAt]
74
+ },
75
+ cardItemStyle() {
76
+ if (this.iconType === 'border' && this.type === 'primary' && this.color) {
77
+ return {
78
+ '--xt-card-item-color': this.color
79
+ }
80
+ }
81
+ return {}
82
+ },
83
+ valueStyle() {
84
+ if (this.iconType !== 'border' && this.type === 'primary' && this.color) {
85
+ return {
86
+ color: this.color
87
+ }
88
+ }
89
+ return {}
90
+ }
91
+ }
92
+ }
93
+ </script>
@@ -1,93 +1,33 @@
1
1
  <template>
2
- <FlexBox
3
- v-if="iconType=='border'"
4
- class="xt-card-item is-border"
5
- :class="[iconType=='border'?`is-${type}`:'']"
6
- :style="cardItemStyle"
7
- content="between"
8
- >
9
- <span class="item__label" v-if="title">
10
- <slot name="label">{{ label }}</slot>
11
- </span>
12
- <span class="item__value">
13
- <slot name="value">{{ value }}</slot>
14
- </span>
15
- <span class="item__unit">
16
- <slot name="unit">{{ unit }}</slot>
17
- </span>
18
- </FlexBox>
19
- <FlexBox
20
- v-else
21
- class="xt-card-item"
22
- :direction="direction"
23
- :content="contentAlign"
24
- >
25
- <slot name="icon">
26
- <el-button :type="type" :circle="circle" :round="round" plain :icon="icon"></el-button>
27
- </slot>
28
- <div class="item__value">
29
- <span class="value" :style="valueStyle">
30
- <slot name="value">{{ label }}</slot>
31
- </span>
32
- <div class="unit">{{ value }}</div>
33
- </div>
34
- </FlexBox>
2
+ <ex-card class="xt-card-item" :bordered="false" :class="{ [`is-${type}`]: type ? true : false}">
3
+ <xt-text bold size="medium">{{ title }}</xt-text>
4
+ <xt-flex-box>
5
+ <div style="width: 50%;margin-bottom: 5px;">
6
+ <xt-text bold size="large" v-model="value" format="thousand" :type="type" :decimals="0"></xt-text>
7
+ <div style="margin: 5px 0;">
8
+ <xt-text size="small">较昨日</xt-text>
9
+ <xt-text v-model="change" format="normal" :type="diff > 0 ? 'success' : 'danger'" :suffix="diff > 0 ? '↑' : '↓'"></xt-text>
10
+ </div>
11
+ </div>
12
+ <div style="flex: 1; height: 100%;">
13
+ <xt-text size="extra-large" :type="type"><i class="el-icon-user"></i></xt-text>
14
+ </div>
15
+ </xt-flex-box>
16
+ </ex-card>
35
17
  </template>
36
18
  <script>
37
- import FlexBox from '../xt-flex-box/index.vue'
38
19
  export default {
39
- name: "XtCardItem",
40
- components: {
41
- FlexBox
42
- },
43
- props: {
44
- iconType: { default: "border" },
45
- type: { default: "primary" },
46
- label: {},
47
- value: {},
48
- unit: {},
49
- icon: {},
50
- iconAt: { default: "right" },
51
- color: {
52
- type: String,
53
- default: ''
54
- }
55
- },
56
- data() {
57
- return {
58
- circle: false,
59
- round: false
60
- }
61
- },
62
- computed: {
63
- contentAlign() {
64
- return this.iconAt == 'center' ? 'center' : 'start'
65
- },
66
- direction() {
67
- const iconAtMap = {
68
- left: 'row',
69
- right: 'row-reverse',
70
- top: 'column',
71
- bottom: 'column-reverse'
72
- }
73
- return iconAtMap[this.iconAt]
74
- },
75
- cardItemStyle() {
76
- if (this.iconType === 'border' && this.type === 'primary' && this.color) {
77
- return {
78
- '--xt-card-item-color': this.color
79
- }
80
- }
81
- return {}
20
+ name: "XtCardItem",
21
+ props: {
22
+ type: { type: String, default: "primary" },
23
+ title: { type: String, default: '' },
24
+ diff: { type: Number, default: 0 },
25
+ value: { type: Number, default: 0 },
26
+ change: { type: Number, default: 0 },
82
27
  },
83
- valueStyle() {
84
- if (this.iconType !== 'border' && this.type === 'primary' && this.color) {
28
+ data() {
85
29
  return {
86
- color: this.color
87
30
  }
88
- }
89
- return {}
90
31
  }
91
- }
92
32
  }
93
33
  </script>
@@ -0,0 +1,72 @@
1
+ @import '../../../styles/variables.scss';
2
+
3
+ .xt-card-item {
4
+ --xt-card-item-color: var(--xt-color-primary, #1890ff);
5
+
6
+ min-height: var(--xt-card-item-min-height, 40px);
7
+ }
8
+
9
+ .xt-card-item + .xt-card-item {
10
+ margin-top: var(--xt-card-item-gap, 10px);
11
+ }
12
+
13
+ .xt-card-item.is-border {
14
+ border-right: var(--xt-card-item-border-width, 3px) solid transparent;
15
+ background-color: var(--xt-color-bg-secondary, #f5f7fa);
16
+ }
17
+
18
+ .xt-card-item.is-border.is-primary {
19
+ border-right-color: var(--xt-card-item-color);
20
+ }
21
+
22
+ .xt-card-item.is-border.is-primary .item__value .value {
23
+ color: var(--xt-card-item-color);
24
+ }
25
+
26
+ .xt-card-item.is-border.is-success {
27
+ border-right-color: var(--xt-color-success, #67C23A);
28
+ }
29
+
30
+ .xt-card-item.is-border.is-success .item__value .value {
31
+ color: var(--xt-color-success, #67C23A);
32
+ }
33
+
34
+ .xt-card-item.is-border.is-warning {
35
+ border-right-color: var(--xt-color-warning, #E6A23C);
36
+ }
37
+
38
+ .xt-card-item.is-border.is-warning .item__value .value {
39
+ color: var(--xt-color-warning, #E6A23C);
40
+ }
41
+
42
+ .xt-card-item.is-border.is-danger {
43
+ border-right-color: var(--xt-color-danger, #F56C6C);
44
+ }
45
+
46
+ .xt-card-item.is-border.is-danger .item__value .value {
47
+ color: var(--xt-color-danger, #F56C6C);
48
+ }
49
+
50
+ .xt-card-item .item__value {
51
+ padding-right: 10px;
52
+ }
53
+
54
+ .xt-card-item .item__value .value {
55
+ font-weight: 600;
56
+ font-size: var(--xt-font-size-base, 14px);
57
+ }
58
+
59
+ .xt-card-item .item__value .unit {
60
+ font-size: var(--xt-font-size-small, 13px);
61
+ color: var(--xt-color-text-secondary, #909399);
62
+ }
63
+
64
+ .xt-card-item .item__label {
65
+ padding-left: 10px;
66
+ color: var(--xt-color-text-secondary, #909399);
67
+ }
68
+
69
+ .xt-card-item .item__unit {
70
+ padding-left: 5px;
71
+ color: var(--xt-color-text-secondary, #909399);
72
+ }
@@ -1,72 +1,83 @@
1
1
  @import '../../../styles/variables.scss';
2
2
 
3
3
  .xt-card-item {
4
- --xt-card-item-color: var(--xt-color-primary, #1890ff);
4
+ --xt-card-bg-color: var(--xt-card-bg-color, #ffffff);
5
+ --xt-card-border-color: var(--xt-card-border-color, #EBEEF5);
6
+ --xt-card-text-color: var(--xt-color-text-primary, #303133);
5
7
 
6
- min-height: var(--xt-card-item-min-height, 40px);
8
+ border-radius: var(--xt-card-border-radius, 4px);
9
+ box-shadow: var(--xt-card-shadow, 0 2px 12px 0 rgba(0, 0, 0, 0.1));
10
+ background-color: var(--xt-card-bg-color);
11
+ overflow: hidden;
12
+ color: var(--xt-card-text-color);
13
+ transition: var(--xt-transition-duration, 0.3s);
7
14
  }
8
15
 
9
- .xt-card-item + .xt-card-item {
10
- margin-top: var(--xt-card-item-gap, 10px);
16
+ .xt-card-item.is-primary {
17
+ --xt-card-bg-color: var(--xt-color-primary, #1890ff);
18
+ .card__header {
19
+ color: var(--xt-color-white, #ffffff);
20
+ }
11
21
  }
12
22
 
13
- .xt-card-item.is-border {
14
- border-right: var(--xt-card-item-border-width, 3px) solid transparent;
15
- background-color: var(--xt-color-bg-secondary, #f5f7fa);
16
- }
17
23
 
18
- .xt-card-item.is-border.is-primary {
19
- border-right-color: var(--xt-card-item-color);
24
+ .xt-card-item.is-success {
25
+ --xt-card-bg-color: var(--xt-color-success, #67c039);
26
+ .card__header {
27
+ color: var(--xt-color-white, #ffffff);
28
+ }
20
29
  }
21
30
 
22
- .xt-card-item.is-border.is-primary .item__value .value {
23
- color: var(--xt-card-item-color);
24
- }
25
31
 
26
- .xt-card-item.is-border.is-success {
27
- border-right-color: var(--xt-color-success, #67C23A);
28
- }
29
32
 
30
- .xt-card-item.is-border.is-success .item__value .value {
31
- color: var(--xt-color-success, #67C23A);
33
+ .xt-card-item.is-danger {
34
+ --xt-card-bg-color: var(--xt-color-danger, #f56c6c);
35
+ .card__header {
36
+ color: var(--xt-color-white, #ffffff);
37
+ }
32
38
  }
33
39
 
34
- .xt-card-item.is-border.is-warning {
35
- border-right-color: var(--xt-color-warning, #E6A23C);
36
- }
37
40
 
38
- .xt-card-item.is-border.is-warning .item__value .value {
39
- color: var(--xt-color-warning, #E6A23C);
40
- }
41
41
 
42
- .xt-card-item.is-border.is-danger {
43
- border-right-color: var(--xt-color-danger, #F56C6C);
42
+ .xt-card-item.is-warning {
43
+ --xt-card-bg-color: var(--xt-color-warning, #e6a23c);
44
+ .card__header {
45
+ color: var(--xt-color-white, #ffffff);
46
+ }
44
47
  }
45
48
 
46
- .xt-card-item.is-border.is-danger .item__value .value {
47
- color: var(--xt-color-danger, #F56C6C);
49
+
50
+ .xt-card-item .card__header {
51
+ padding: var(--xt-card-header-padding, 18px 20px);
52
+ box-sizing: border-box;
53
+ font-weight: 600;
54
+ font-size: var(--xt-font-size-medium, 16px);
48
55
  }
49
56
 
50
- .xt-card-item .item__value {
51
- padding-right: 10px;
57
+ .xt-card-item .card__body {
58
+ padding: var(--xt-card-padding, 20px);
52
59
  }
53
60
 
54
- .xt-card-item .item__value .value {
61
+ .xt-card-item .card__body .value {
62
+ font-size: var(--xt-font-size-large, 18px);
55
63
  font-weight: 600;
56
- font-size: var(--xt-font-size-base, 14px);
64
+ color: var(--xt-color-primary, #1890ff);
57
65
  }
58
66
 
59
- .xt-card-item .item__value .unit {
60
- font-size: var(--xt-font-size-small, 13px);
67
+ .xt-card-item .card__body .unit {
68
+ font-size: var(--xt-font-size-base, 14px);
61
69
  color: var(--xt-color-text-secondary, #909399);
70
+ margin-left: 4px;
62
71
  }
63
72
 
64
- .xt-card-item .item__label {
65
- padding-left: 10px;
66
- color: var(--xt-color-text-secondary, #909399);
73
+ .xt-card-item .value {
74
+ font-weight: 600;
67
75
  }
68
76
 
69
- .xt-card-item .item__unit {
70
- padding-left: 5px;
71
- color: var(--xt-color-text-secondary, #909399);
77
+ .xt-card-item .card__header + .card__body {
78
+ padding-top: 0;
79
+ }
80
+
81
+ .xt-card-item.noPadding .card__body {
82
+ padding: 0;
72
83
  }
@@ -1,2 +1,2 @@
1
- import ConfigProvider from './index.vue'
2
- export default ConfigProvider
1
+ import XtConfigProvider from './index.vue'
2
+ export default XtConfigProvider
@@ -1,4 +1,5 @@
1
1
  <script>
2
+ import EchartsUtil from '../ex-chart/utils.js'
2
3
  export default {
3
4
  name: 'XtConfigProvider',
4
5
  inheritAttrs: false,
@@ -73,9 +74,9 @@ export default {
73
74
  props: {
74
75
  theme: {
75
76
  type: String,
76
- default: 'light',
77
+ default: 'white',
77
78
  validator: (value) => {
78
- return ['light', 'dark', 'auto'].includes(value)
79
+ return ['white', 'dark', 'auto'].includes(value)
79
80
  }
80
81
  },
81
82
  size: {
@@ -139,9 +140,9 @@ export default {
139
140
  }
140
141
 
141
142
  const sizeMap = {
142
- small: '12px',
143
- medium: '14px',
144
- large: '16px'
143
+ small: '14px',
144
+ medium: '16px',
145
+ large: '18px'
145
146
  }
146
147
  if (sizeMap[this.size]) {
147
148
  result['--xt-font-size-base'] = sizeMap[this.size]
@@ -308,6 +309,9 @@ export default {
308
309
 
309
310
  // 设置 data-theme 属性
310
311
  element.setAttribute('data-theme', this.theme)
312
+
313
+ // 更新图表颜色
314
+ EchartsUtil.changeAllTheme(this.theme, this.size, this.primaryColor)
311
315
 
312
316
  // 触发主题改变钩子(当主题实际发生变化时)
313
317
  if (prevTheme !== this.theme && typeof this.onThemeChange === 'function') {
@@ -5,13 +5,15 @@
5
5
  type ? 'xt-text--' + type : '',
6
6
  'xt-text--' + size,
7
7
  { 'xt-text--bold': bold },
8
- { 'xt-text--money': money }
8
+ { 'xt-text--money': format === 'money' }
9
9
  ]"
10
10
  :style="customStyle"
11
11
  >
12
+ <slot name="prefix">{{ prefix }}</slot>
12
13
  <slot>
13
- <template v-if="money && displayValue !== undefined">{{ displayValue }}</template>
14
+ <template v-if="formattedValue !== undefined">{{ formattedValue }}</template>
14
15
  </slot>
16
+ <slot name="suffix">{{ suffix }}</slot>
15
17
  </span>
16
18
  </template>
17
19
 
@@ -41,7 +43,15 @@ export default {
41
43
  type: [String, Number],
42
44
  default: ''
43
45
  },
44
- // 金额格式化相关属性
46
+
47
+ // 格式化模式:normal 普通 | thousand 千分位 | money 金额
48
+ format: {
49
+ type: String,
50
+ default: 'normal',
51
+ validator: (val) => ['normal', 'thousand', 'money'].includes(val)
52
+ },
53
+
54
+ // 兼容旧属性 money(老项目继续使用)
45
55
  money: {
46
56
  type: Boolean,
47
57
  default: false
@@ -78,6 +88,11 @@ export default {
78
88
  }
79
89
  },
80
90
  computed: {
91
+ // 兼容旧 money 属性:如果传了 money=true,自动切为金额模式
92
+ realFormat() {
93
+ return this.money ? 'money' : this.format
94
+ },
95
+
81
96
  customStyle() {
82
97
  const style = {}
83
98
  if (this.letterSpacing) {
@@ -85,41 +100,55 @@ export default {
85
100
  }
86
101
  return style
87
102
  },
88
- displayValue() {
89
- if (!this.money || this.value === '' || this.value === undefined || this.value === null) {
103
+
104
+ formattedValue() {
105
+ const fmt = this.realFormat
106
+ const { value } = this
107
+
108
+ if (value === '' || value === undefined || value === null) {
90
109
  return undefined
91
110
  }
92
-
93
- const numValue = typeof this.value === 'string' ? parseFloat(this.value) : this.value
94
-
111
+
112
+ const numValue = typeof value === 'string' ? parseFloat(value) : value
95
113
  if (isNaN(numValue)) {
96
- return this.value
114
+ return value
97
115
  }
98
-
116
+
99
117
  try {
100
- const formatter = new Intl.NumberFormat(this.locale, {
101
- style: 'currency',
102
- currency: this.currency,
103
- minimumFractionDigits: this.decimals,
104
- maximumFractionDigits: this.decimals,
105
- signDisplay: this.showSign ? 'always' : 'auto'
106
- })
107
-
108
- let result = formatter.format(numValue)
109
-
110
- // 处理前缀和后缀
111
- if (this.prefix) {
112
- result = this.prefix + result
113
- }
114
- if (this.suffix) {
115
- result = result + this.suffix
118
+ let result = ''
119
+ const signOpt = this.showSign ? 'always' : 'auto'
120
+
121
+ switch (fmt) {
122
+ // 千分位格式化(纯数字)
123
+ case 'thousand':
124
+ result = new Intl.NumberFormat(this.locale, {
125
+ minimumFractionDigits: this.decimals,
126
+ maximumFractionDigits: this.decimals,
127
+ signDisplay: signOpt
128
+ }).format(numValue)
129
+ break
130
+
131
+ // 金额格式化(原有逻辑)
132
+ case 'money':
133
+ result = new Intl.NumberFormat(this.locale, {
134
+ style: 'currency',
135
+ currency: this.currency,
136
+ minimumFractionDigits: this.decimals,
137
+ maximumFractionDigits: this.decimals,
138
+ signDisplay: signOpt
139
+ }).format(numValue)
140
+ break
141
+
142
+ // 普通文本,直接返回原值
143
+ default:
144
+ return undefined
116
145
  }
117
-
146
+
118
147
  return result
119
148
  } catch (e) {
120
- return this.value
149
+ return value
121
150
  }
122
151
  }
123
152
  }
124
153
  }
125
- </script>
154
+ </script>ss
@@ -76,17 +76,17 @@
76
76
  }
77
77
 
78
78
  // 暗色主题
79
- [data-theme='dark'] .xt-text--primary {
80
- }
81
-
82
- [data-theme='dark'] .xt-text--success {
83
- color: $xt-dark-color-success;
84
- }
85
-
86
- [data-theme='dark'] .xt-text--warning {
87
- color: $xt-dark-color-warning;
88
- }
89
-
90
- [data-theme='dark'] .xt-text--danger {
91
- color: $xt-dark-color-danger;
79
+ [data-theme='dark'], html.dark {
80
+ .xt-text--primary {
81
+ color: $xt-dark-color-primary;
82
+ }
83
+ .xt-text--success {
84
+ color: $xt-dark-color-success;
85
+ }
86
+ .xt-text--warning {
87
+ color: $xt-dark-color-warning;
88
+ }
89
+ .xt-text--danger {
90
+ color: $xt-dark-color-danger;
91
+ }
92
92
  }
@@ -183,7 +183,7 @@
183
183
  // 暗色主题(参考 Element Plus)
184
184
  // ============================
185
185
  :root[data-theme="dark"],
186
- [data-theme="dark"] {
186
+ [data-theme="dark"], html.dark {
187
187
  color-scheme: dark;
188
188
  --xt-color-primary: #409eff;
189
189
  --xt-color-primary-light-3: rgb(51, 117, 185);
@@ -70,7 +70,7 @@
70
70
 
71
71
  /* 深色主题 */
72
72
  :root[data-theme="dark"],
73
- [data-theme="dark"] {
73
+ [data-theme="dark"], html.dark {
74
74
  --el-color-primary: #409eff;
75
75
  --el-text-color-primary: #ffffff;
76
76
  --el-color-primary-light-9: #1d1e1f;
@@ -1,3 +1,4 @@
1
+ import EchartsUtil from '../components/ex-chart/utils'
1
2
  // 默认配置
2
3
  const defaultConfig = {
3
4
  theme: 'white',
@@ -44,7 +45,7 @@ export const setConfig = function(config) {
44
45
  }
45
46
 
46
47
 
47
- // 设置主题
48
+ // 设置主题 并更新图表主题
48
49
  export const setTheme = function(theme) {
49
50
  const validThemes = ['white', 'dark']
50
51
  if (!validThemes.includes(theme)) {
@@ -59,9 +60,13 @@ export const setTheme = function(theme) {
59
60
  if (theme === 'dark') {
60
61
  root.setAttribute('data-theme', 'dark')
61
62
  } else {
62
- root.removeAttribute('data-theme')
63
+ root.setAttribute('data-theme', theme)
63
64
  }
64
65
 
66
+ // 更新图表主题
67
+ EchartsUtil.changeAllTheme(currentConfig.theme, currentConfig.size)
68
+ console.log('更新图表主题')
69
+
65
70
  emitConfigChange('theme', theme)
66
71
  }
67
72
 
@@ -75,6 +80,10 @@ export const setSize = function(size) {
75
80
 
76
81
  currentConfig.size = size
77
82
  document.documentElement.setAttribute('data-size', size)
83
+ // 更新图表主题
84
+ EchartsUtil.changeAllTheme(currentConfig.theme, currentConfig.size)
85
+ console.log('更新图表字体')
86
+
78
87
  emitConfigChange('size', size)
79
88
  }
80
89
 
File without changes
File without changes
@@ -1,2 +0,0 @@
1
- import XtUpload from './index.vue'
2
- export default XtUpload