@ebiz/designer-components 0.0.18-beta.8 → 0.0.18-kzy.1

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.
@@ -0,0 +1,486 @@
1
+ <template>
2
+ <t-table
3
+ :data="data"
4
+ :columns="columns"
5
+ :row-key="rowKey"
6
+ :vertical-align="verticalAlign"
7
+ :horizontal-align="horizontalAlign"
8
+ :size="size"
9
+ :bordered="bordered"
10
+ :stripe="stripe"
11
+ :hover="hover"
12
+ :height="height"
13
+ :max-height="maxHeight"
14
+ :loading="loading"
15
+ :loading-props="loadingProps"
16
+ :load-more="loadMore"
17
+ :empty="empty"
18
+ :table-layout="tableLayout"
19
+ :cell-empty-content="cellEmptyContent"
20
+ :pagination="pagination"
21
+ :show-header="showHeader"
22
+ :header-affixed-top="headerAffixedTop"
23
+ :footer-affixed-bottom="footerAffixedBottom"
24
+ :top-content="topContent"
25
+ :bottom-content="bottomContent"
26
+ :sort="sort"
27
+ :filter-value="filterValue"
28
+ :filter-icon="filterIcon"
29
+ :tree="tree"
30
+ :resizable="resizable"
31
+ :column-controller="columnController"
32
+ :column-controller-visible="columnControllerVisible"
33
+ :expandable="expandable"
34
+ :disabled-sort="disabledSort"
35
+ :virtual-scroll="virtualScroll"
36
+ :indent="indent"
37
+ :row-attributes="rowAttributes"
38
+ :scroll="scroll"
39
+ :show-sort-column-bg="showSortColumnBg"
40
+ :allow-sort-by-click-header="allowSortByClickHeader"
41
+ :dragSort="dragSort"
42
+ :select-on-row-click="selectOnRowClick"
43
+ :merge-cells="mergeCells"
44
+ :value="value"
45
+ :row-className="rowClassName"
46
+ :fixed-rows="fixedRows"
47
+ :highlight-current-row="highlightCurrentRow"
48
+ :ellipsis-title="ellipsisTitle"
49
+ @page-change="handlePageChange"
50
+ @sort-change="handleSortChange"
51
+ @filter-change="handleFilterChange"
52
+ @select-change="handleSelectChange"
53
+ @expanded-change="handleExpandedChange"
54
+ @cell-click="handleCellClick"
55
+ @row-click="handleRowClick"
56
+ @row-hover="handleRowHover"
57
+ @row-dblclick="handleRowDblclick"
58
+ @scroll="handleScroll"
59
+ @column-change="handleColumnChange"
60
+ @expand-all="handleExpandAll"
61
+ @tree-expand-change="handleTreeExpandChange"
62
+ @display-columns-change="handleDisplayColumnsChange"
63
+ @column-controller-visible-change="handleColumnControllerVisibleChange"
64
+ @drag-sort="handleDragSort"
65
+ @validate="handleValidate"
66
+ >
67
+
68
+
69
+
70
+ <!-- 顶部内容插槽 -->
71
+ <template v-if="$slots.topContent" #topContent>
72
+ <slot name="topContent"></slot>
73
+ </template>
74
+
75
+ <!-- 底部内容插槽 -->
76
+ <template v-if="$slots.bottomContent" #bottomContent>
77
+ <slot name="bottomContent"></slot>
78
+ </template>
79
+
80
+ <!-- 空状态插槽 -->
81
+ <template v-if="$slots.empty" #empty>
82
+ <slot name="empty"></slot>
83
+ </template>
84
+
85
+ <!-- 加载更多插槽 -->
86
+ <template v-if="$slots.loadMore" #loadMore>
87
+ <slot name="loadMore"></slot>
88
+ </template>
89
+
90
+ <!-- 表头插槽 -->
91
+ <template v-if="$slots.header" #header>
92
+ <slot name="header"></slot>
93
+ </template>
94
+
95
+ <!-- 表尾插槽 -->
96
+ <template v-if="$slots.footer" #footer>
97
+ <slot name="footer"></slot>
98
+ </template>
99
+
100
+ <!-- 自定义单元格插槽 -->
101
+ <template v-if="$slots.cell" #cell="slotProps">
102
+ <slot name="cell" v-bind="slotProps"></slot>
103
+ </template>
104
+
105
+ <!-- 展开行插槽 -->
106
+ <template v-if="$slots.expandedRow" #expandedRow="slotProps">
107
+ <slot name="expandedRow" v-bind="slotProps"></slot>
108
+ </template>
109
+
110
+ <!-- 过滤图标插槽 -->
111
+ <template v-if="$slots.filterIcon" #filterIcon="slotProps">
112
+ <slot name="filterIcon" v-bind="slotProps"></slot>
113
+ </template>
114
+
115
+ <!-- 自定义列配置按钮插槽 -->
116
+ <template v-if="$slots.columnController" #columnController="slotProps">
117
+ <slot name="columnController" v-bind="slotProps"></slot>
118
+ </template>
119
+
120
+ <!-- 自定义分页器插槽 -->
121
+ <template v-if="$slots.pagination" #pagination="slotProps">
122
+ <slot name="pagination" v-bind="slotProps"></slot>
123
+ </template>
124
+
125
+ <!-- 默认插槽 -->
126
+ <slot></slot>
127
+ </t-table>
128
+ </template>
129
+
130
+ <script>
131
+ export default {
132
+ name: "EbizTable"
133
+ }
134
+ </script>
135
+
136
+ <script setup>
137
+ import { defineProps, defineEmits } from 'vue';
138
+ import { Table as TTable } from 'tdesign-vue-next';
139
+
140
+ const props = defineProps({
141
+ // 表格数据
142
+ data: {
143
+ type: Array,
144
+ default: () => []
145
+ },
146
+ // 表格列配置
147
+ columns: {
148
+ type: Array,
149
+ default: () => []
150
+ },
151
+ // 唯一标识字段
152
+ rowKey: {
153
+ type: String,
154
+ default: 'id'
155
+ },
156
+ // 垂直对齐方式
157
+ verticalAlign: {
158
+ type: String,
159
+ default: 'middle',
160
+ validator: (val) => ['top', 'middle', 'bottom'].includes(val)
161
+ },
162
+ // 水平对齐方式
163
+ horizontalAlign: {
164
+ type: String,
165
+ default: 'left',
166
+ validator: (val) => ['left', 'center', 'right'].includes(val)
167
+ },
168
+ // 表格尺寸
169
+ size: {
170
+ type: String,
171
+ default: 'medium',
172
+ validator: (val) => ['small', 'medium', 'large'].includes(val)
173
+ },
174
+ // 是否显示表格边框
175
+ bordered: {
176
+ type: Boolean,
177
+ default: false
178
+ },
179
+ // 是否显示斑马纹
180
+ stripe: {
181
+ type: Boolean,
182
+ default: false
183
+ },
184
+ // 是否开启悬停效果
185
+ hover: {
186
+ type: Boolean,
187
+ default: true
188
+ },
189
+ // 表格高度
190
+ height: {
191
+ type: [String, Number],
192
+ default: undefined
193
+ },
194
+ // 表格最大高度
195
+ maxHeight: {
196
+ type: [String, Number],
197
+ default: undefined
198
+ },
199
+ // 是否处于加载状态
200
+ loading: {
201
+ type: Boolean,
202
+ default: false
203
+ },
204
+ // 加载状态配置
205
+ loadingProps: {
206
+ type: Object,
207
+ default: () => ({})
208
+ },
209
+ // 加载更多配置
210
+ loadMore: {
211
+ type: [String, Function],
212
+ default: undefined
213
+ },
214
+ // 空数据呈现配置
215
+ empty: {
216
+ type: [String, Function],
217
+ default: undefined
218
+ },
219
+ // 表格布局方式
220
+ tableLayout: {
221
+ type: String,
222
+ default: 'fixed',
223
+ validator: (val) => ['auto', 'fixed'].includes(val)
224
+ },
225
+ // 单元格空内容处理
226
+ cellEmptyContent: {
227
+ type: [String, Function],
228
+ default: undefined
229
+ },
230
+ // 分页配置
231
+ pagination: {
232
+ type: Object,
233
+ default: undefined
234
+ },
235
+ // 是否显示表头
236
+ showHeader: {
237
+ type: Boolean,
238
+ default: true
239
+ },
240
+ // 表头吸顶设置
241
+ headerAffixedTop: {
242
+ type: [Boolean, Object],
243
+ default: false
244
+ },
245
+ // 表尾吸底设置
246
+ footerAffixedBottom: {
247
+ type: [Boolean, Object],
248
+ default: false
249
+ },
250
+ // 表格顶部内容
251
+ topContent: {
252
+ type: [String, Function],
253
+ default: undefined
254
+ },
255
+ // 表格底部内容
256
+ bottomContent: {
257
+ type: [String, Function],
258
+ default: undefined
259
+ },
260
+ // 排序配置
261
+ sort: {
262
+ type: [Object, Array],
263
+ default: undefined
264
+ },
265
+ // 过滤值
266
+ filterValue: {
267
+ type: Object,
268
+ default: undefined
269
+ },
270
+ // 过滤图标
271
+ filterIcon: {
272
+ type: Function,
273
+ default: undefined
274
+ },
275
+ // 树形结构配置
276
+ tree: {
277
+ type: Object,
278
+ default: undefined
279
+ },
280
+ // 是否允许调整列宽
281
+ resizable: {
282
+ type: Boolean,
283
+ default: false
284
+ },
285
+ // 列配置器
286
+ columnController: {
287
+ type: Object,
288
+ default: undefined
289
+ },
290
+ // 列配置器是否显示
291
+ columnControllerVisible: {
292
+ type: Boolean,
293
+ default: undefined
294
+ },
295
+ // 展开行配置
296
+ expandable: {
297
+ type: Object,
298
+ default: undefined
299
+ },
300
+ // 禁用排序
301
+ disabledSort: {
302
+ type: Boolean,
303
+ default: false
304
+ },
305
+ // 虚拟滚动配置
306
+ virtualScroll: {
307
+ type: [Boolean, Object],
308
+ default: false
309
+ },
310
+ // 树形结构缩进
311
+ indent: {
312
+ type: Number,
313
+ default: 24
314
+ },
315
+ // 行属性配置
316
+ rowAttributes: {
317
+ type: [Object, Function],
318
+ default: undefined
319
+ },
320
+ // 滚动配置
321
+ scroll: {
322
+ type: Object,
323
+ default: undefined
324
+ },
325
+ // 是否显示排序列背景色
326
+ showSortColumnBg: {
327
+ type: Boolean,
328
+ default: false
329
+ },
330
+ // 是否允许点击表头排序
331
+ allowSortByClickHeader: {
332
+ type: Boolean,
333
+ default: true
334
+ },
335
+ // 拖拽排序配置
336
+ dragSort: {
337
+ type: String,
338
+ default: undefined,
339
+ validator: (val) => ['row', 'row-handler', 'col', 'row-handler-col', 'drag-col'].includes(val)
340
+ },
341
+ // 点击行是否选中
342
+ selectOnRowClick: {
343
+ type: Boolean,
344
+ default: false
345
+ },
346
+ // 合并单元格配置
347
+ mergeCells: {
348
+ type: Array,
349
+ default: undefined
350
+ },
351
+ // 选中值(多选表格)
352
+ value: {
353
+ type: Array,
354
+ default: undefined
355
+ },
356
+ // 行类名配置
357
+ rowClassName: {
358
+ type: [String, Function],
359
+ default: undefined
360
+ },
361
+ // 固定行配置
362
+ fixedRows: {
363
+ type: Array,
364
+ default: undefined
365
+ },
366
+ // 是否高亮当前行
367
+ highlightCurrentRow: {
368
+ type: Boolean,
369
+ default: false
370
+ },
371
+ // 表头文字超出是否显示省略号
372
+ ellipsisTitle: {
373
+ type: Boolean,
374
+ default: undefined
375
+ }
376
+ });
377
+
378
+ const emit = defineEmits([
379
+ 'page-change',
380
+ 'sort-change',
381
+ 'filter-change',
382
+ 'select-change',
383
+ 'expanded-change',
384
+ 'cell-click',
385
+ 'row-click',
386
+ 'row-hover',
387
+ 'row-dblclick',
388
+ 'scroll',
389
+ 'column-change',
390
+ 'expand-all',
391
+ 'tree-expand-change',
392
+ 'display-columns-change',
393
+ 'column-controller-visible-change',
394
+ 'drag-sort',
395
+ 'validate'
396
+ ]);
397
+
398
+ // 分页变化
399
+ const handlePageChange = (pageInfo) => {
400
+ emit('page-change', pageInfo);
401
+ };
402
+
403
+ // 排序变化
404
+ const handleSortChange = (sort, options) => {
405
+ emit('sort-change', sort, options);
406
+ };
407
+
408
+ // 过滤变化
409
+ const handleFilterChange = (filterValue, col) => {
410
+ emit('filter-change', filterValue, col);
411
+ };
412
+
413
+ // 选择变化
414
+ const handleSelectChange = (selectedRowData, options) => {
415
+ emit('select-change', selectedRowData, options);
416
+ };
417
+
418
+ // 展开行变化
419
+ const handleExpandedChange = (expandedRowData, options) => {
420
+ emit('expanded-change', expandedRowData, options);
421
+ };
422
+
423
+ // 单元格点击
424
+ const handleCellClick = (context) => {
425
+ emit('cell-click', context);
426
+ };
427
+
428
+ // 行点击
429
+ const handleRowClick = (rowData, rowIndex, row) => {
430
+ emit('row-click', rowData, rowIndex, row);
431
+ };
432
+
433
+ // 行悬停
434
+ const handleRowHover = (rowData, rowIndex, row) => {
435
+ emit('row-hover', rowData, rowIndex, row);
436
+ };
437
+
438
+ // 行双击
439
+ const handleRowDblclick = (rowData, rowIndex, row) => {
440
+ emit('row-dblclick', rowData, rowIndex, row);
441
+ };
442
+
443
+ // 表格滚动
444
+ const handleScroll = (params) => {
445
+ emit('scroll', params);
446
+ };
447
+
448
+ // 列变化
449
+ const handleColumnChange = (params) => {
450
+ emit('column-change', params);
451
+ };
452
+
453
+ // 全部展开变化
454
+ const handleExpandAll = (expandAll, options) => {
455
+ emit('expand-all', expandAll, options);
456
+ };
457
+
458
+ // 树形展开变化
459
+ const handleTreeExpandChange = (rowData, options) => {
460
+ emit('tree-expand-change', rowData, options);
461
+ };
462
+
463
+ // 显示列变化
464
+ const handleDisplayColumnsChange = (columns) => {
465
+ emit('display-columns-change', columns);
466
+ };
467
+
468
+ // 列控制器显示状态变化
469
+ const handleColumnControllerVisibleChange = (visible) => {
470
+ emit('column-controller-visible-change', visible);
471
+ };
472
+
473
+ // 拖拽排序变化
474
+ const handleDragSort = (params) => {
475
+ emit('drag-sort', params);
476
+ };
477
+
478
+ // 校验
479
+ const handleValidate = (context) => {
480
+ emit('validate', context);
481
+ };
482
+ </script>
483
+
484
+ <style lang="less" scoped>
485
+ /* 自定义样式 */
486
+ </style>
@@ -1,33 +1,12 @@
1
1
  <template>
2
- <t-dialog
3
- v-model:visible="isVisible"
4
- :attach="attach"
5
- :body="body"
6
- :cancel-btn="cancelBtn"
7
- :close-btn="closeBtn"
8
- :close-on-esc-keydown="closeOnEscKeydown"
9
- :close-on-overlay-click="closeOnOverlayClick"
10
- :confirm-btn="confirmBtn"
11
- :default-visible="defaultVisible"
12
- :destroy-on-close="destroyOnClose"
13
- :draggable="draggable"
14
- :footer="footer"
15
- :header="header"
16
- :mode="mode"
17
- :placement="placement"
18
- :show-overlay="showOverlay"
19
- :width="width"
20
- :z-index="zIndex"
21
- @cancel="handleCancel"
22
- @close="handleClose"
23
- @close-btn-click="handleCloseBtnClick"
24
- @confirm="handleConfirm"
25
- @esc-keydown="handleEscKeydown"
26
- @overlay-click="handleOverlayClick"
27
- @opened="handleOpened"
28
- @closed="handleClosed"
29
- @update:visible="handleUpdateVisible"
30
- >
2
+ <t-dialog v-model:visible="isVisible" :attach="attach" :body="body" :cancel-btn="cancelBtn" :close-btn="closeBtn"
3
+ :close-on-esc-keydown="closeOnEscKeydown" :close-on-overlay-click="closeOnOverlayClick"
4
+ :confirm-btn="confirmBtn" :default-visible="defaultVisible" :destroy-on-close="destroyOnClose"
5
+ :draggable="draggable" :footer="footer" :header="header" :mode="mode" :placement="placement"
6
+ :show-overlay="showOverlay" :width="width" :z-index="zIndex" @cancel="handleCancel" @close="handleClose"
7
+ @close-btn-click="handleCloseBtnClick" @confirm="handleConfirm" @esc-keydown="handleEscKeydown"
8
+ @overlay-click="handleOverlayClick" @opened="handleOpened" @closed="handleClosed"
9
+ @update:visible="handleUpdateVisible">
31
10
  <!-- 头部插槽 -->
32
11
  <template v-if="$slots.header" #header>
33
12
  <slot name="header"></slot>
@@ -165,13 +144,11 @@ const props = defineProps({
165
144
  });
166
145
 
167
146
  // 显示状态
168
- const isVisible = ref(props.defaultVisible);
147
+ const isVisible = ref(props.visible);
169
148
 
170
149
  // 监听visible属性变化
171
150
  watch(() => props.visible, (newValue) => {
172
- if (newValue !== undefined) {
173
- isVisible.value = newValue;
174
- }
151
+ isVisible.value = newValue;
175
152
  });
176
153
 
177
154
  // 定义事件
@@ -246,4 +223,4 @@ const handleUpdateVisible = (visible) => {
246
223
 
247
224
  <style lang="less" scoped>
248
225
  /* 自定义样式 */
249
- </style>
226
+ </style>
@@ -55,7 +55,7 @@ export default {
55
55
  <script setup>
56
56
  import { computed, defineProps, defineEmits, ref, onMounted, watch } from 'vue';
57
57
  import { Upload as TUpload } from 'tdesign-vue-next';
58
- import dataServiceAppData from '../apiService/simpleDataServiceAppData';
58
+ import dataService from '../apiService/simpleDataService';
59
59
 
60
60
  // 内部上传地址常量
61
61
  const INTERNAL_UPLOAD_URL = '/file/upload';
@@ -366,7 +366,7 @@ const customRequestMethod = (options) => {
366
366
  };
367
367
 
368
368
  // 使用dataService上传文件
369
- return dataServiceAppData
369
+ return dataService
370
370
  .upload(INTERNAL_UPLOAD_URL, formData, safeProgressCallback)
371
371
  .then(response => {
372
372
  console.log('Upload response:', response);