xt-element-ui 2.1.21 → 2.1.61

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 (75) hide show
  1. package/docs/components/base/xt-badge.md +0 -2
  2. package/docs/components/base/xt-bar.md +0 -27
  3. package/docs/components/base/xt-button.md +0 -2
  4. package/docs/components/base/xt-card-item.md +0 -2
  5. package/docs/components/base/xt-card.md +17 -19
  6. package/docs/components/base/xt-chart.md +5 -31
  7. package/docs/components/base/xt-config-provider.md +0 -2
  8. package/docs/components/base/xt-date-picker.md +185 -28
  9. package/docs/components/base/xt-flex-box.md +25 -25
  10. package/docs/components/base/xt-form-schema.md +356 -0
  11. package/docs/components/base/xt-grid-box.md +4 -6
  12. package/docs/components/base/xt-icon.md +0 -2
  13. package/docs/components/base/xt-input.md +204 -44
  14. package/docs/components/base/xt-line.md +0 -26
  15. package/docs/components/base/xt-list.md +456 -458
  16. package/docs/components/base/xt-map-provider.md +0 -2
  17. package/docs/components/base/xt-map.md +0 -2
  18. package/docs/components/base/xt-multi.md +0 -39
  19. package/docs/components/base/xt-page.md +17 -6
  20. package/docs/components/base/xt-pie.md +0 -25
  21. package/docs/components/base/xt-progress.md +0 -2
  22. package/docs/components/base/xt-scroll-arrow.md +0 -2
  23. package/docs/components/base/xt-select-tree.md +0 -2
  24. package/docs/components/base/xt-step-price.md +3 -4
  25. package/docs/components/base/xt-table.md +2 -2
  26. package/docs/components/base/xt-tabs.md +0 -2
  27. package/docs/components/base/xt-text.md +1 -2
  28. package/docs/components/base/xt-time.md +0 -2
  29. package/docs/components/base/xt-transfer-tree.md +270 -0
  30. package/docs/components/base/xt-upload.md +11 -8
  31. package/docs/components/utils/config.md +285 -0
  32. package/docs/components/utils/format.md +445 -0
  33. package/lib/index.common.js +96183 -115717
  34. package/lib/index.css +1 -1
  35. package/lib/index.umd.js +96183 -115717
  36. package/lib/index.umd.min.js +1 -34
  37. package/package.json +7 -4
  38. package/src/components/xt-badge/style/index.scss +0 -22
  39. package/src/components/xt-button/index.vue +2 -1
  40. package/src/components/xt-button/style/index.scss +2 -2
  41. package/src/components/xt-card/style/index.scss +2 -2
  42. package/src/components/xt-card-item/style/index.scss +5 -40
  43. package/src/components/xt-chart/XtBar.vue +0 -3
  44. package/src/components/xt-date-picker/component/Picker.vue +196 -0
  45. package/src/components/xt-date-picker/component/RangeDate.vue +136 -0
  46. package/src/components/xt-date-picker/index.vue +220 -80
  47. package/src/components/xt-flex-box/index.vue +1 -1
  48. package/src/components/xt-form-schema/index.js +8 -0
  49. package/src/components/xt-form-schema/index.vue +328 -0
  50. package/src/components/xt-grid-item/index.vue +2 -2
  51. package/src/components/xt-input/index.vue +224 -28
  52. package/src/components/xt-input/style/index.scss +10 -0
  53. package/src/components/xt-layout/ExFieldset.vue +4 -4
  54. package/src/components/xt-list/index.js +7 -7
  55. package/src/components/xt-list/index.vue +885 -885
  56. package/src/components/xt-page/index.vue +148 -75
  57. package/src/components/xt-progress/style/index.scss +0 -14
  58. package/src/components/xt-step-price/style/index.scss +0 -4
  59. package/src/components/xt-step-price-item/index.vue +1 -1
  60. package/src/components/xt-table/XtTableCell.vue +2 -2
  61. package/src/components/xt-table/index.vue +17 -10
  62. package/src/components/xt-tabs/style/index.scss +0 -40
  63. package/src/components/xt-text/index.vue +16 -4
  64. package/src/components/xt-text/style/index.scss +0 -15
  65. package/src/components/xt-transfer-tree/index.js +8 -0
  66. package/src/components/xt-transfer-tree/index.vue +494 -0
  67. package/src/components/xt-upload/index.vue +12 -6
  68. package/src/index.js +8 -2
  69. package/src/styles/theme/colors.scss +0 -44
  70. package/src/styles/theme/dark-variables.scss +0 -29
  71. package/src/styles/variables-export.scss +0 -72
  72. package/src/utils/index.js +278 -1
  73. package/src/components/xt-date-picker/SearchDate.vue +0 -45
  74. package/src/components/xt-date-picker/quarter.vue +0 -154
  75. package/src/components/xt-table/index copy.vue +0 -663
@@ -1,5 +1,3 @@
1
- ## XtMapProvider 统一地图提供组件
2
-
3
1
  ### 全局配置(推荐)
4
2
 
5
3
  使用 `XtMapProvider` 统一配置项目中所有地图,无需在每个 `<XtMap>` 上重复写密钥:
@@ -1,5 +1,3 @@
1
- ## XtMap 统一地图组件
2
-
3
1
  基于「高德 / 天地图 / 百度」三大地图服务商二次开发,对外暴露统一的 API,解决不同地图 SDK 的使用差异。支持暗黑主题、密钥/URL 灵活配置、地图类型动态切换。
4
2
 
5
3
  ### 核心特性
@@ -1,5 +1,3 @@
1
- ## XtMulti 组合图组件
2
-
3
1
  基于 ECharts 封装的组合图组件,支持多系列数据展示,自动根据单位分组使用不同 Y 轴。
4
2
 
5
3
  ## 基本用法
@@ -234,43 +232,6 @@ export default {
234
232
  ```
235
233
  :::
236
234
 
237
- ### 暗色主题
238
-
239
- ::: demo 暗色主题
240
- ```vue
241
- <template>
242
- <XtMulti :chart-data="chartData" theme="dark" />
243
- </template>
244
-
245
- <script>
246
- export default {
247
- data() {
248
- return {
249
- chartData: [
250
- {
251
- label: "入户数",
252
- unit: "户",
253
- data: [
254
- { label: "01月", value: 980 },
255
- { label: "02月", value: 806 }
256
- ]
257
- },
258
- {
259
- label: "隐患数",
260
- unit: "个",
261
- data: [
262
- { label: "01月", value: 200 },
263
- { label: "02月", value: 120 }
264
- ]
265
- }
266
- ]
267
- }
268
- }
269
- }
270
- </script>
271
- ```
272
- :::
273
-
274
235
  ## 注意事项
275
236
 
276
237
  - 相同 unit 的 series 会共用同一条 Y 轴
@@ -8,11 +8,15 @@
8
8
  ```vue
9
9
  <template>
10
10
  <XtPage>
11
- <template #header>页面标题</template>
12
- <template #default="{ tableHeight }">
13
- <XtTable :height="tableHeight" :table-data="tableData" :columns="columns" />
11
+ <template slot="header">页面标题</template>
12
+ <template slot-scope="scope">
13
+ <XtTable
14
+ :table-data="tableData"
15
+ :height="scope.tableHeight"
16
+ :columns="columns"
17
+ />
14
18
  </template>
15
- <template #footer>页面底部</template>
19
+ <template slot="footer">页面底部</template>
16
20
  </XtPage>
17
21
  </template>
18
22
 
@@ -20,8 +24,15 @@
20
24
  export default {
21
25
  data() {
22
26
  return {
23
- tableData: [],
24
- columns: []
27
+ tableData: [
28
+ { name: '张三', age: 18 },
29
+ { name: '李四', age: 20 }
30
+ ],
31
+ columns: [
32
+ { prop: "name", label:"姓名" },
33
+ { prop: "age", label:"年龄" },
34
+ { label: '操作', slot: 'action' }
35
+ ]
25
36
  }
26
37
  }
27
38
  }
@@ -1,5 +1,3 @@
1
- ## XtPie 饼图组件
2
-
3
1
  基于 ECharts 封装的饼图组件,支持环形图、玫瑰图、自定义颜色等功能。
4
2
 
5
3
  ## 基本用法
@@ -145,29 +143,6 @@ export default {
145
143
  ```
146
144
  :::
147
145
 
148
- ### 暗色主题
149
-
150
- ::: demo 暗色主题
151
- ```vue
152
- <template>
153
- <XtPie :chart-data="chartData" theme="dark" />
154
- </template>
155
-
156
- <script>
157
- export default {
158
- data() {
159
- return {
160
- chartData: [
161
- { value: 53, label: "张三" },
162
- { value: 60, label: "李四" },
163
- { value: 78, label: "王五" }
164
- ]
165
- }
166
- }
167
- }
168
- </script>
169
- ```
170
- :::
171
146
 
172
147
  ## 注意事项
173
148
 
@@ -1,5 +1,3 @@
1
- ## XtProgress 进度条组件
2
-
3
1
  进度条组件,用于展示任务完成进度。
4
2
 
5
3
  ## 基本用法
@@ -1,5 +1,3 @@
1
- ## XtScrollArrow 滚动箭头组件
2
-
3
1
  滚动箭头组件用于在内容溢出时显示滚动箭头,支持水平和垂直方向的滚动。
4
2
 
5
3
  ## 基本用法
@@ -1,5 +1,3 @@
1
- ## XtSelectTree 下拉选择树组件
2
-
3
1
  下拉选择树组件,基于 ElementUI Tree 封装,支持单选、多选、懒加载等功能。
4
2
 
5
3
  ## 基本用法
@@ -1,5 +1,3 @@
1
- ## XtStepPrice 阶梯价格组件
2
-
3
1
  用于配置阶梯式价格、数量区间等场景,支持区间自动校正、批量删除、自定义字段名等功能。
4
2
 
5
3
  ### 核心特性
@@ -42,7 +40,7 @@ Vue.component(XtStepPriceItem.name, XtStepPriceItem)
42
40
  ```
43
41
 
44
42
  ### 基本用法
45
-
43
+ ::: demo
46
44
  ```vue
47
45
  <template>
48
46
  <div style="width: 600px;">
@@ -72,6 +70,7 @@ export default {
72
70
  }
73
71
  </script>
74
72
  ```
73
+ :::
75
74
 
76
75
  ### 自定义字段名
77
76
 
@@ -121,7 +120,7 @@ export default {
121
120
  | `fieldKeys` | Object | `{ min: 'min', max: 'max', price: 'price' }` | 字段名映射,支持自定义字段名 |
122
121
  | `limit` | Number | `0` | 阶梯数量上限,<=0 表示不限制 |
123
122
  | `step` | Number | `10` | 阶梯增量,新增时自动填充下一级的 min 值 |
124
- | `disabled` | Boolean | `false` | 是否禁用所有操作 |
123
+ | `disabled` | Boolean | `false` | 是否禁用所有操作 |
125
124
  | `allowNegative` | Boolean | `false` | 是否允许输入负数价格和下限 |
126
125
  | `tip` | String | `'区间左闭右闭 [min, max],最后一级为 [min, +∞),保证连续且不重叠。'` | 底部提示文本 |
127
126
  | `defaultFirst` | Boolean | `true` | 空数组时是否自动生成默认阶梯 |
@@ -93,8 +93,8 @@ export default {
93
93
  fixed: true, // 是否固定
94
94
  align: 'center', // 对齐方式
95
95
  sortable: true, // 是否可排序
96
- render: (scope) => {}, // 自定义渲染函数
97
- formatter: (row, col) => {}, // 格式化函数
96
+ render: (h, { row, index, column }) => {}, // 自定义渲染函数 返回 VNode
97
+ formatter: (row, index, column) => {}, // 返回字符串
98
98
  slot: 'custom-slot', // 自定义插槽名
99
99
  children: [] // 多级表头
100
100
  }
@@ -1,5 +1,3 @@
1
- ## XtTabs 标签页组件
2
-
3
1
  标签页组件,用于切换不同内容区域。
4
2
 
5
3
  ## 基本用法
@@ -1,5 +1,3 @@
1
- ## XtText 文本组件
2
-
3
1
  文本组件用于展示不同样式的文本内容。
4
2
 
5
3
  ## 基本用法
@@ -8,6 +6,7 @@
8
6
  ```vue
9
7
  <template>
10
8
  <XtText type="primary">主要文本</XtText>
9
+ <div style="width: 80px;"><XtText ellipsis>溢出隐藏文本溢出隐藏文本</XtText></div>
11
10
  </template>
12
11
  ```
13
12
  :::
@@ -1,5 +1,3 @@
1
- ## XtTime 时间组件
2
-
3
1
  集三种模式于一身的时间组件:当前时间实时显示、目标时间倒计时、日期文本格式化展示。
4
2
 
5
3
  ## 基本用法
@@ -0,0 +1,270 @@
1
+ 树形穿梭框组件,支持树形结构数据的穿梭,提供多种穿梭模式满足不同业务场景。
2
+
3
+ ## 基本用法
4
+
5
+ ::: demo 基本用法
6
+ ```vue
7
+ <template>
8
+ <XtTransferTree
9
+ :data="treeData"
10
+ v-model="selectedIds"
11
+ :height="400"
12
+ />
13
+ </template>
14
+
15
+ <script>
16
+ export default {
17
+ data() {
18
+ return {
19
+ selectedIds: [],
20
+ treeData: [
21
+ {
22
+ id: '1',
23
+ label: '一级菜单',
24
+ children: [
25
+ {
26
+ id: '1-1',
27
+ label: '二级菜单1'
28
+ },
29
+ {
30
+ id: '1-2',
31
+ label: '二级菜单2'
32
+ }
33
+ ]
34
+ },
35
+ {
36
+ id: '2',
37
+ label: '一级菜单2',
38
+ children: [
39
+ {
40
+ id: '2-1',
41
+ label: '二级菜单3'
42
+ }
43
+ ]
44
+ }
45
+ ]
46
+ }
47
+ }
48
+ }
49
+ </script>
50
+ ```
51
+ :::
52
+
53
+ ## 属性说明
54
+
55
+ | 属性 | 类型 | 默认值 | 可选值 | 说明 |
56
+ |------|------|--------|--------|------|
57
+ | `value` / `v-model` | Array | `[]` | - | 已选择的节点 ID 数组 |
58
+ | `data` | Array | `[]` | - | 树形数据源 |
59
+ | `leftTitle` | String | `待选择` | - | 左侧面板标题 |
60
+ | `rightTitle` | String | `已选择` | - | 右侧面板标题 |
61
+ | `treeProps` | Object | `{ label, children, value }` | - | 树节点属性配置 |
62
+ | `defaultExpandAll` | Boolean | `true` | - | 是否默认展开所有节点 |
63
+ | `filterable` | Boolean | `false` | - | 是否支持搜索过滤 |
64
+ | `showCheckbox` | Boolean | `true` | - | 是否显示复选框 |
65
+ | `cascade` | Boolean | `true` | - | 是否级联选择 |
66
+ | `transferMode` | String | `single` | `single`, `multiple`, `parent-child` | 穿梭模式 |
67
+ | `buttonSize` | String | `small` | - | 按钮尺寸 |
68
+
69
+ ## 穿梭模式说明
70
+
71
+ | 模式 | 说明 |
72
+ |------|------|
73
+ | `single` | 单选模式,点击节点或勾选后只穿梭当前节点 |
74
+ | `multiple` | 多选模式,勾选多个节点后一次性穿梭 |
75
+ | `parent-child` | 父子模式,穿梭父节点时自动包含所有子节点 |
76
+
77
+ ## 事件
78
+
79
+ | 事件名 | 说明 | 参数 |
80
+ |--------|------|------|
81
+ | `change` | 数据变化时触发 | `{ value, addedKeys, removedKeys }` |
82
+
83
+ ## 示例
84
+
85
+ ### 父子级联穿梭
86
+
87
+ ::: demo 父子级联穿梭
88
+ ```vue
89
+ <template>
90
+ <XtTransferTree
91
+ :data="treeData"
92
+ v-model="selectedIds"
93
+ :height="400"
94
+ transfer-mode="parent-child"
95
+ @change="handleChange"
96
+ />
97
+ </template>
98
+
99
+ <script>
100
+ export default {
101
+ data() {
102
+ return {
103
+ selectedIds: [],
104
+ treeData: [
105
+ {
106
+ id: '1',
107
+ label: '部门A',
108
+ children: [
109
+ { id: '1-1', label: '员工1' },
110
+ { id: '1-2', label: '员工2' }
111
+ ]
112
+ },
113
+ {
114
+ id: '2',
115
+ label: '部门B',
116
+ children: [
117
+ { id: '2-1', label: '员工3' }
118
+ ]
119
+ }
120
+ ]
121
+ }
122
+ },
123
+ methods: {
124
+ handleChange({ value, addedKeys, removedKeys }) {
125
+ console.log('已选择:', value)
126
+ console.log('新增:', addedKeys)
127
+ console.log('移除:', removedKeys)
128
+ }
129
+ }
130
+ }
131
+ </script>
132
+ ```
133
+ :::
134
+
135
+ ### 支持搜索过滤
136
+
137
+ ::: demo 支持搜索过滤
138
+ ```vue
139
+ <template>
140
+ <XtTransferTree
141
+ :data="treeData"
142
+ v-model="selectedIds"
143
+ :height="400"
144
+ :filterable="true"
145
+ />
146
+ </template>
147
+
148
+ <script>
149
+ export default {
150
+ data() {
151
+ return {
152
+ selectedIds: [],
153
+ treeData: [
154
+ {
155
+ id: '1',
156
+ label: '水果',
157
+ children: [
158
+ { id: '1-1', label: '苹果' },
159
+ { id: '1-2', label: '香蕉' },
160
+ { id: '1-3', label: '橙子' }
161
+ ]
162
+ },
163
+ {
164
+ id: '2',
165
+ label: '蔬菜',
166
+ children: [
167
+ { id: '2-1', label: '西红柿' },
168
+ { id: '2-2', label: '黄瓜' }
169
+ ]
170
+ }
171
+ ]
172
+ }
173
+ }
174
+ }
175
+ </script>
176
+ ```
177
+ :::
178
+
179
+ ### 不级联选择
180
+
181
+ ::: demo 不级联选择
182
+ ```vue
183
+ <template>
184
+ <XtTransferTree
185
+ :data="treeData"
186
+ v-model="selectedIds"
187
+ :height="400"
188
+ :cascade="false"
189
+ />
190
+ </template>
191
+
192
+ <script>
193
+ export default {
194
+ data() {
195
+ return {
196
+ selectedIds: [],
197
+ treeData: [
198
+ {
199
+ id: '1',
200
+ label: '分类1',
201
+ children: [
202
+ { id: '1-1', label: '项目1' },
203
+ { id: '1-2', label: '项目2' }
204
+ ]
205
+ }
206
+ ]
207
+ }
208
+ }
209
+ }
210
+ </script>
211
+ ```
212
+ :::
213
+
214
+ ### 点击穿梭(无复选框)
215
+
216
+ ::: demo 点击穿梭
217
+ ```vue
218
+ <template>
219
+ <XtTransferTree
220
+ :data="treeData"
221
+ v-model="selectedIds"
222
+ :height="400"
223
+ :show-checkbox="false"
224
+ />
225
+ </template>
226
+
227
+ <script>
228
+ export default {
229
+ data() {
230
+ return {
231
+ selectedIds: [],
232
+ treeData: [
233
+ {
234
+ id: '1',
235
+ label: '选项1'
236
+ },
237
+ {
238
+ id: '2',
239
+ label: '选项2'
240
+ }
241
+ ]
242
+ }
243
+ }
244
+ }
245
+ </script>
246
+ ```
247
+ :::
248
+
249
+ ## 方法
250
+
251
+ | 方法名 | 说明 | 参数 |
252
+ |--------|------|------|
253
+ | `clearSelection` | 清空选择 | - |
254
+
255
+ ## 数据格式
256
+
257
+ ```javascript
258
+ [
259
+ {
260
+ id: 'node-id',
261
+ label: '节点名称',
262
+ children: [
263
+ {
264
+ id: 'child-id',
265
+ label: '子节点名称'
266
+ }
267
+ ]
268
+ }
269
+ ]
270
+ ```
@@ -7,7 +7,9 @@
7
7
  ::: demo 基本用法
8
8
  ```vue
9
9
  <template>
10
- <XtUpload v-model="imageSrc" action="/upload" base-url="/api" />
10
+ <div>
11
+ <XtUpload v-model="imageSrc" action="/upload" base-url="/api" />
12
+ </div>
11
13
  </template>
12
14
 
13
15
  <script>
@@ -35,6 +37,13 @@ export default {
35
37
  | `accept` | String | `.jpg,.jpeg,.png` | 允许的文件类型 |
36
38
  | `autoUpload` | Boolean | `true` | 是否自动上传 |
37
39
  | `size` | String | `''` | 缩略图大小,可选 `big` |
40
+ | `icon` | String | `el-icon-camera` | 自定义图标 |
41
+
42
+ ## 事件
43
+
44
+ | 事件名 | 说明 | 参数 |
45
+ |--------|------|------|
46
+ | `change` | 文件上传或删除时触发 | `src` |
38
47
 
39
48
  ## 示例
40
49
 
@@ -43,7 +52,7 @@ export default {
43
52
  ::: demo 多文件上传
44
53
  ```vue
45
54
  <template>
46
- <XtUpload v-model="fileSrc" action="/upload" multiple />
55
+ <XtUpload v-model="fileSrc" icon="el-icon-plus" action="/upload" multiple />
47
56
  </template>
48
57
 
49
58
  <script>
@@ -77,9 +86,3 @@ export default {
77
86
  </script>
78
87
  ```
79
88
  :::
80
-
81
- ## 事件
82
-
83
- | 事件名 | 说明 | 参数 |
84
- |--------|------|------|
85
- | `change` | 文件上传或删除时触发 | `src` |