@vue-ui-kit/ant 2.5.1 → 2.5.2
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.
- package/dist/cjs/index.js +6 -6
- package/dist/es/index.js +1128 -982
- package/dist/index.d.ts +78 -1
- package/dist/style.css +1 -1
- package/dist/style.scss +1 -1
- package/package.json +2 -2
- package/src/packages/components/PCanvasGrid.vue +106 -170
- package/src/packages/styles/index.scss +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -782,6 +782,12 @@ declare class Config {
|
|
|
782
782
|
CELL_HOVER_ICON_BG_COLOR: string;
|
|
783
783
|
/** hover编辑图标边框颜色 */
|
|
784
784
|
CELL_HOVER_ICON_BORDER_COLOR: string;
|
|
785
|
+
/** 内容缩放最小比例 */
|
|
786
|
+
MIN_ZOOM: number;
|
|
787
|
+
/** 内容缩放最大比例 */
|
|
788
|
+
MAX_ZOOM: number;
|
|
789
|
+
/** 启用 Ctrl + 滚轮内容缩放 */
|
|
790
|
+
ENABLE_ZOOM_WHEEL: boolean;
|
|
785
791
|
/** 滚动条轨道尺寸 */
|
|
786
792
|
SCROLLER_TRACK_SIZE: number;
|
|
787
793
|
/** 滚动条滑块尺寸 */
|
|
@@ -1075,6 +1081,10 @@ declare class Context {
|
|
|
1075
1081
|
loadingElement?: HTMLDivElement;
|
|
1076
1082
|
stageWidth: number;
|
|
1077
1083
|
stageHeight: number;
|
|
1084
|
+
stagePhysicalWidth: number;
|
|
1085
|
+
stagePhysicalHeight: number;
|
|
1086
|
+
zoomScale: ZoomScale;
|
|
1087
|
+
get zoom(): number;
|
|
1078
1088
|
paint: Paint;
|
|
1079
1089
|
icons: Icons;
|
|
1080
1090
|
domSelectionStr: string;
|
|
@@ -1156,6 +1166,12 @@ declare class Context {
|
|
|
1156
1166
|
offsetX: number;
|
|
1157
1167
|
offsetY: number;
|
|
1158
1168
|
};
|
|
1169
|
+
toVisual(value: number): number;
|
|
1170
|
+
toLogical(value: number): number;
|
|
1171
|
+
toVisualPx(value: number): string;
|
|
1172
|
+
scaleStyle<T extends Record<string, any>>(style: T): T;
|
|
1173
|
+
setZoom(zoom: number): void;
|
|
1174
|
+
getZoom(): number;
|
|
1159
1175
|
hasEvent(event: string): boolean;
|
|
1160
1176
|
on(event: string, callback: EventCallback): void;
|
|
1161
1177
|
once(event: string, callback: EventCallback): void;
|
|
@@ -1617,6 +1633,12 @@ declare class EVirtTable {
|
|
|
1617
1633
|
clearEditableData(value?: null): ChangeItem[];
|
|
1618
1634
|
clearEditor(): void;
|
|
1619
1635
|
doLayout(): void;
|
|
1636
|
+
/**
|
|
1637
|
+
* 设置内容缩放比例(容器大小不变,内容变大/变小,基于原生分辨率重绘不失清晰度)
|
|
1638
|
+
* @param zoom 缩放比例,范围 MIN_ZOOM ~ MAX_ZOOM
|
|
1639
|
+
*/
|
|
1640
|
+
setZoom(zoom: number): void;
|
|
1641
|
+
getZoom(): number;
|
|
1620
1642
|
getChangedData(): {
|
|
1621
1643
|
rowKey: string;
|
|
1622
1644
|
colKey: string;
|
|
@@ -1911,7 +1933,7 @@ declare class Paint {
|
|
|
1911
1933
|
constructor(target: HTMLCanvasElement);
|
|
1912
1934
|
getCtx(): CanvasRenderingContext2D;
|
|
1913
1935
|
clearTextCache(): void;
|
|
1914
|
-
scale(dpr: number): void;
|
|
1936
|
+
scale(dpr: number, zoom?: number): void;
|
|
1915
1937
|
save(): void;
|
|
1916
1938
|
restore(): void;
|
|
1917
1939
|
translate(x: number, y: number): void;
|
|
@@ -5363,6 +5385,17 @@ declare type ValidatorFunction<T> = (value: T) => boolean
|
|
|
5363
5385
|
|
|
5364
5386
|
declare type VerticalAlign = 'top' | 'middle' | 'bottom';
|
|
5365
5387
|
|
|
5388
|
+
declare type ViewportRect = {
|
|
5389
|
+
x: number;
|
|
5390
|
+
y: number;
|
|
5391
|
+
left: number;
|
|
5392
|
+
top: number;
|
|
5393
|
+
right: number;
|
|
5394
|
+
bottom: number;
|
|
5395
|
+
width: number;
|
|
5396
|
+
height: number;
|
|
5397
|
+
};
|
|
5398
|
+
|
|
5366
5399
|
declare interface VueTypeBaseDef<
|
|
5367
5400
|
T = unknown,
|
|
5368
5401
|
D = DefaultType<T>,
|
|
@@ -5387,4 +5420,48 @@ declare interface VueTypeValidableDef<T = unknown> extends VueTypeBaseDef<T> {
|
|
|
5387
5420
|
|
|
5388
5421
|
export declare function watchPreviousDeep<T extends object>(source: WatchSource<T>, cb: (value: T, oldValue: T, onCleanup: () => void) => void, options?: WatchOptions): WatchHandle;
|
|
5389
5422
|
|
|
5423
|
+
/** 内容缩放:逻辑坐标 ↔ 物理像素,canvas / DOM 共用 */
|
|
5424
|
+
declare class ZoomScale {
|
|
5425
|
+
value: number;
|
|
5426
|
+
get isDefault(): boolean;
|
|
5427
|
+
clamp(value: number, min: number, max: number): number;
|
|
5428
|
+
/** @returns 是否发生变化 */
|
|
5429
|
+
set(value: number, min: number, max: number): boolean;
|
|
5430
|
+
/** 逻辑 -> 物理 */
|
|
5431
|
+
toVisual(logical: number): number;
|
|
5432
|
+
/** 物理 -> 逻辑 */
|
|
5433
|
+
toLogical(physical: number): number;
|
|
5434
|
+
toPx(logical: number): string;
|
|
5435
|
+
/** DOM 测量高度 -> 逻辑高度 */
|
|
5436
|
+
domHeightToLogical(physicalHeight: number): number;
|
|
5437
|
+
/** 逻辑内容尺寸 -> 物理尺寸 */
|
|
5438
|
+
contentToPhysical(logical: number): number;
|
|
5439
|
+
scaleStyle<T extends Record<string, any>>(style: T): T;
|
|
5440
|
+
assignScaledStyle(el: HTMLElement, style: Record<string, any>): void;
|
|
5441
|
+
/** 容器物理宽度 -> 逻辑可视宽度 */
|
|
5442
|
+
containerWidth(containerPhysicalWidth: number): number;
|
|
5443
|
+
resolveStageWidth(options: {
|
|
5444
|
+
containerPhysicalWidth: number;
|
|
5445
|
+
contentWidth: number;
|
|
5446
|
+
scrollerTrackSize: number;
|
|
5447
|
+
fillContainer: boolean;
|
|
5448
|
+
}): {
|
|
5449
|
+
stageWidth: number;
|
|
5450
|
+
stagePhysicalWidth: number;
|
|
5451
|
+
};
|
|
5452
|
+
applyStageHeight(stageElement: HTMLDivElement, physicalHeight: number): {
|
|
5453
|
+
stageHeight: number;
|
|
5454
|
+
stagePhysicalHeight: number;
|
|
5455
|
+
};
|
|
5456
|
+
/** floating-ui 锚点:逻辑单元格 -> 视口物理矩形 */
|
|
5457
|
+
getViewportRect(logical: {
|
|
5458
|
+
x: number;
|
|
5459
|
+
y: number;
|
|
5460
|
+
width: number;
|
|
5461
|
+
height: number;
|
|
5462
|
+
}, containerRect: DOMRect): ViewportRect;
|
|
5463
|
+
/** overlayer 单元格:外层物理定位 + 内层 zoom 缩放自定义 render */
|
|
5464
|
+
createOverlayerCellElement(cell: Cell | CellHeader, cssPrefix: string): HTMLDivElement;
|
|
5465
|
+
}
|
|
5466
|
+
|
|
5390
5467
|
export { }
|
package/dist/style.css
CHANGED
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
margin-bottom: -0.5em;
|
|
160
160
|
}
|
|
161
161
|
.p-wrapper .p-canvas-toolbar-wrapper {
|
|
162
|
-
box-shadow: 0 8px var(--p-bg
|
|
162
|
+
box-shadow: 0 8px var(--p-theme-bg, #fff);
|
|
163
163
|
border-radius: 0.5em 0.5em 0 0;
|
|
164
164
|
}
|
|
165
165
|
.p-wrapper .ant-form .ant-form-item {
|
package/dist/style.scss
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-ui-kit/ant",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2",
|
|
4
4
|
"description": "Vue3 UI Kit based on Ant Design",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"email": "adoin@qq.com"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"e-virt-table": "
|
|
50
|
+
"e-virt-table": "1.4.2",
|
|
51
51
|
"uuid": "^11.1.1",
|
|
52
52
|
"xe-utils": "^3.7.6"
|
|
53
53
|
},
|
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
setup
|
|
4
|
-
generic="D extends Recordable = Recordable, F extends Recordable = Recordable"
|
|
5
|
-
name="PCanvasGrid"
|
|
6
|
-
>
|
|
7
|
-
import PCanvasTable from './PCanvasTable.vue';
|
|
8
|
-
import {
|
|
9
|
-
computed,
|
|
10
|
-
useAttrs,
|
|
11
|
-
ref,
|
|
12
|
-
Ref,
|
|
13
|
-
reactive,
|
|
14
|
-
onMounted,
|
|
15
|
-
nextTick,
|
|
16
|
-
toRefs,
|
|
17
|
-
onBeforeUnmount,
|
|
18
|
-
watch,
|
|
19
|
-
} from 'vue';
|
|
20
|
-
import { debounce, get, isBoolean, isFunction, isObject, isString, omit, uniq } from 'xe-utils';
|
|
1
|
+
<script lang="ts" setup generic="D extends Recordable = Recordable, F extends Recordable = Recordable"
|
|
2
|
+
name="PCanvasGrid">
|
|
21
3
|
import {
|
|
22
4
|
CanvasColumnProps,
|
|
23
5
|
PCanvasGridProps,
|
|
@@ -25,28 +7,42 @@
|
|
|
25
7
|
PFormItemProps,
|
|
26
8
|
ResponsePathConfig,
|
|
27
9
|
} from '#/antProxy';
|
|
28
|
-
import { v4 as uuid_v4 } from 'uuid';
|
|
29
|
-
import { isGoodValue } from '@/utils/is';
|
|
30
10
|
import PFormCol from '@/components/PFormCol.vue';
|
|
31
|
-
import { defaultLabelCol } from '@/utils/core';
|
|
32
|
-
import Icon from '@/renders/Icon';
|
|
33
11
|
import { $confirm, $error, $success, $warning } from '@/hooks/useMessage';
|
|
34
|
-
import
|
|
35
|
-
Button as AButton,
|
|
36
|
-
Form as AForm,
|
|
37
|
-
Row as ARow,
|
|
38
|
-
Spin as ASpin,
|
|
39
|
-
Pagination as APagination,
|
|
40
|
-
} from 'ant-design-vue';
|
|
41
|
-
import { DownOutlined } from '@ant-design/icons-vue';
|
|
42
|
-
import { getCanvasTableDefaults, getGridDefaults } from '@/utils/config';
|
|
12
|
+
import Icon from '@/renders/Icon';
|
|
43
13
|
import {
|
|
44
14
|
createAutoViewportBoxController,
|
|
45
15
|
parseAutoViewportBoxOffset,
|
|
46
16
|
type AutoViewportBoxController,
|
|
47
17
|
type AutoViewportBoxOffsetInput,
|
|
48
18
|
} from '@/utils/autoViewportBox';
|
|
19
|
+
import { getCanvasTableDefaults, getGridDefaults } from '@/utils/config';
|
|
20
|
+
import { defaultLabelCol } from '@/utils/core';
|
|
21
|
+
import { isGoodValue } from '@/utils/is';
|
|
49
22
|
import { eachTree } from '@/utils/treeHelper';
|
|
23
|
+
import { DownOutlined } from '@ant-design/icons-vue';
|
|
24
|
+
import {
|
|
25
|
+
Button as AButton,
|
|
26
|
+
Form as AForm,
|
|
27
|
+
Pagination as APagination,
|
|
28
|
+
Row as ARow,
|
|
29
|
+
Spin as ASpin,
|
|
30
|
+
} from 'ant-design-vue';
|
|
31
|
+
import { v4 as uuid_v4 } from 'uuid';
|
|
32
|
+
import {
|
|
33
|
+
Ref,
|
|
34
|
+
computed,
|
|
35
|
+
nextTick,
|
|
36
|
+
onBeforeUnmount,
|
|
37
|
+
onMounted,
|
|
38
|
+
reactive,
|
|
39
|
+
ref,
|
|
40
|
+
toRefs,
|
|
41
|
+
useAttrs,
|
|
42
|
+
watch,
|
|
43
|
+
} from 'vue';
|
|
44
|
+
import { debounce, get, isBoolean, isFunction, isObject, isString, omit, uniq } from 'xe-utils';
|
|
45
|
+
import PCanvasTable from './PCanvasTable.vue';
|
|
50
46
|
const props = withDefaults(defineProps<PCanvasGridProps<D, F>>(), {
|
|
51
47
|
lazyReset: () => getGridDefaults().lazyReset ?? false,
|
|
52
48
|
fitHeight: () => getGridDefaults().fitCanvasHeight ?? 0,
|
|
@@ -99,13 +95,13 @@
|
|
|
99
95
|
const pg = computed(() =>
|
|
100
96
|
mode.value === 'pagination'
|
|
101
97
|
? {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
98
|
+
current: pagination.page,
|
|
99
|
+
total: totalCount.value,
|
|
100
|
+
pageSize: pagination.size,
|
|
101
|
+
responsive: false,
|
|
102
|
+
showSizeChanger: true,
|
|
103
|
+
showTotal: (total: number) => `共${total}条数据`,
|
|
104
|
+
}
|
|
109
105
|
: false,
|
|
110
106
|
);
|
|
111
107
|
|
|
@@ -188,30 +184,30 @@
|
|
|
188
184
|
const handleResponse = (response: Recordable, pathConfig?: ResponsePathConfig<D>) =>
|
|
189
185
|
pathConfig
|
|
190
186
|
? {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
187
|
+
list: isString(pathConfig.list)
|
|
188
|
+
? get(response, pathConfig.list)
|
|
189
|
+
: isFunction(pathConfig.list)
|
|
190
|
+
? pathConfig.list(response)
|
|
191
|
+
: undefined,
|
|
192
|
+
total: isString(pathConfig.total)
|
|
193
|
+
? get(response, pathConfig.total)
|
|
194
|
+
: isFunction(pathConfig.total)
|
|
195
|
+
? pathConfig.total(response)
|
|
196
|
+
: undefined,
|
|
197
|
+
result: isString(pathConfig.result)
|
|
198
|
+
? get(response, pathConfig.result)
|
|
199
|
+
: isFunction(pathConfig.result)
|
|
200
|
+
? pathConfig.result(response)
|
|
201
|
+
: undefined,
|
|
202
|
+
message: isString(pathConfig.message)
|
|
203
|
+
? get(response, pathConfig.message)
|
|
204
|
+
: isFunction(pathConfig.message)
|
|
205
|
+
? pathConfig.message(response)
|
|
206
|
+
: undefined,
|
|
207
|
+
}
|
|
212
208
|
: {
|
|
213
|
-
|
|
214
|
-
|
|
209
|
+
list: response,
|
|
210
|
+
};
|
|
215
211
|
const toolBtnClick = (code: string) => {
|
|
216
212
|
emit('toolbarButtonClick', {
|
|
217
213
|
data: tableData.value,
|
|
@@ -333,31 +329,31 @@
|
|
|
333
329
|
const firstColumn: CanvasColumnProps<D> =
|
|
334
330
|
staticConfig.value.selectable && staticConfig.value.tree
|
|
335
331
|
? {
|
|
336
|
-
|
|
332
|
+
type: 'selection-tree',
|
|
333
|
+
width: 40,
|
|
334
|
+
widthFillDisable: true,
|
|
335
|
+
title: '',
|
|
336
|
+
}
|
|
337
|
+
: staticConfig.value.selectable
|
|
338
|
+
? {
|
|
339
|
+
type: 'selection',
|
|
337
340
|
width: 40,
|
|
338
341
|
widthFillDisable: true,
|
|
339
342
|
title: '',
|
|
340
343
|
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
type: '
|
|
344
|
+
: staticConfig.value.tree
|
|
345
|
+
? {
|
|
346
|
+
type: 'tree',
|
|
344
347
|
width: 40,
|
|
345
348
|
widthFillDisable: true,
|
|
346
349
|
title: '',
|
|
347
350
|
}
|
|
348
|
-
: staticConfig.value.tree
|
|
349
|
-
? {
|
|
350
|
-
type: 'tree',
|
|
351
|
-
width: 40,
|
|
352
|
-
widthFillDisable: true,
|
|
353
|
-
title: '',
|
|
354
|
-
}
|
|
355
351
|
: {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
352
|
+
type: 'index',
|
|
353
|
+
width: 40,
|
|
354
|
+
widthFillDisable: true,
|
|
355
|
+
title: '',
|
|
356
|
+
};
|
|
361
357
|
return [firstColumn, ...columns.value];
|
|
362
358
|
});
|
|
363
359
|
const resetQueryFormData = (lazy?: boolean) => {
|
|
@@ -535,66 +531,40 @@
|
|
|
535
531
|
});
|
|
536
532
|
</script>
|
|
537
533
|
<template>
|
|
538
|
-
<div
|
|
539
|
-
|
|
540
|
-
:
|
|
541
|
-
|
|
542
|
-
autoBoxSize ? 'min-h-0 min-w-0 flex-1 w-full' : 'h-full',
|
|
543
|
-
]"
|
|
544
|
-
v-bind="attrs"
|
|
545
|
-
>
|
|
534
|
+
<div ref="boxEl" :class="[
|
|
535
|
+
'p-wrapper flex flex-col gap-8px overflow-y-auto',
|
|
536
|
+
autoBoxSize ? 'min-h-0 min-w-0 flex-1 w-full' : 'h-full',
|
|
537
|
+
]" v-bind="attrs">
|
|
546
538
|
<div v-if="mode === 'bad'">请检查配置</div>
|
|
547
539
|
<template v-else>
|
|
548
|
-
<div
|
|
549
|
-
|
|
550
|
-
class="p-pane p-form-wrapper"
|
|
551
|
-
ref="pFormWrapper"
|
|
552
|
-
>
|
|
540
|
+
<div v-if="formConfig?.items?.some((s: PFormItemProps<F>) => s.field && s.itemRender)"
|
|
541
|
+
class="p-pane p-form-wrapper" ref="pFormWrapper">
|
|
553
542
|
<a-spin :spinning="loading.form">
|
|
554
|
-
<a-form
|
|
555
|
-
:key="renderFormKey"
|
|
556
|
-
ref="formEl"
|
|
557
|
-
:model="queryFormData"
|
|
558
|
-
v-bind="fc"
|
|
559
|
-
@submit="handleFormSubmit"
|
|
560
|
-
>
|
|
543
|
+
<a-form :key="renderFormKey" ref="formEl" :model="queryFormData" v-bind="fc" @submit="handleFormSubmit">
|
|
561
544
|
<a-row :gutter="[6, 12]">
|
|
562
|
-
<p-form-col
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
:form-data="queryFormData"
|
|
566
|
-
:item="item as PFormItemProps<Partial<F>>"
|
|
567
|
-
@reset="resetQueryFormData(props.lazyReset)"
|
|
568
|
-
/>
|
|
545
|
+
<p-form-col v-for="(item, idx) in formConfig!.items" :key="`_col_${item.field || idx}`"
|
|
546
|
+
:form-data="queryFormData" :item="item as PFormItemProps<Partial<F>>"
|
|
547
|
+
@reset="resetQueryFormData(props.lazyReset)" />
|
|
569
548
|
</a-row>
|
|
570
549
|
</a-form>
|
|
571
550
|
</a-spin>
|
|
572
551
|
</div>
|
|
573
|
-
<div
|
|
574
|
-
|
|
575
|
-
class="p-canvas-toolbar-wrapper flex items-center w-full justify-between p-theme-bg pt-8px px-16px"
|
|
576
|
-
>
|
|
552
|
+
<div v-if="toolbarConfig"
|
|
553
|
+
class="p-canvas-toolbar-wrapper flex items-center w-full justify-between p-theme-bg pt-8px px-16px">
|
|
577
554
|
<div class="flex items-center flex-1 gap-4px">
|
|
578
555
|
<template v-if="toolbarConfig.buttons && toolbarConfig.buttons.length > 0">
|
|
579
556
|
<template v-for="(btn, idx) in toolbarConfig.buttons" :key="idx">
|
|
580
557
|
<a-dropdown v-if="btn.dropdowns && btn.dropdowns.length">
|
|
581
558
|
<template #overlay>
|
|
582
559
|
<a-menu @click="toolBtnMenuClick">
|
|
583
|
-
<a-menu-item v-for="sub in btn.dropdowns" :key="sub.code"
|
|
584
|
-
>{{ sub.content }}
|
|
560
|
+
<a-menu-item v-for="sub in btn.dropdowns" :key="sub.code">{{ sub.content }}
|
|
585
561
|
</a-menu-item>
|
|
586
562
|
</a-menu>
|
|
587
563
|
</template>
|
|
588
|
-
<a-button
|
|
589
|
-
:type="btn.type"
|
|
590
|
-
:size="btn.size ?? 'middle'"
|
|
564
|
+
<a-button :type="btn.type" :size="btn.size ?? 'middle'"
|
|
591
565
|
:disabled="toolbarConfig.disabled || btn.disabled"
|
|
592
|
-
:loading="loading.toolbar || (!!btn.code && codeLoadings[btn.code])"
|
|
593
|
-
:
|
|
594
|
-
:shape="btn.shape"
|
|
595
|
-
:ghost="btn.ghost"
|
|
596
|
-
:block="btn.block"
|
|
597
|
-
>
|
|
566
|
+
:loading="loading.toolbar || (!!btn.code && codeLoadings[btn.code])" :danger="btn.danger"
|
|
567
|
+
:shape="btn.shape" :ghost="btn.ghost" :block="btn.block">
|
|
598
568
|
<div class="flex items-center gap-4px">
|
|
599
569
|
<Icon v-if="btn.icon" :icon="btn.icon" />
|
|
600
570
|
<template v-if="btn.content && isStringContent(renderContent(btn.content))">
|
|
@@ -605,18 +575,10 @@
|
|
|
605
575
|
</div>
|
|
606
576
|
</a-button>
|
|
607
577
|
</a-dropdown>
|
|
608
|
-
<a-button
|
|
609
|
-
v-else-if="btn.code"
|
|
610
|
-
:type="btn.type"
|
|
611
|
-
:size="btn.size ?? 'middle'"
|
|
578
|
+
<a-button v-else-if="btn.code" :type="btn.type" :size="btn.size ?? 'middle'"
|
|
612
579
|
:disabled="toolbarConfig.disabled || btn.disabled"
|
|
613
|
-
:loading="loading.toolbar || (!!btn.code && codeLoadings[btn.code])"
|
|
614
|
-
:
|
|
615
|
-
:shape="btn.shape"
|
|
616
|
-
:ghost="btn.ghost"
|
|
617
|
-
:block="btn.block"
|
|
618
|
-
@click="debounceToolBtnClick(btn.code)"
|
|
619
|
-
>
|
|
580
|
+
:loading="loading.toolbar || (!!btn.code && codeLoadings[btn.code])" :danger="btn.danger"
|
|
581
|
+
:shape="btn.shape" :ghost="btn.ghost" :block="btn.block" @click="debounceToolBtnClick(btn.code)">
|
|
620
582
|
<div class="flex items-center gap-4px">
|
|
621
583
|
<Icon v-if="btn.icon" :icon="btn.icon" />
|
|
622
584
|
<template v-if="btn.content && isStringContent(renderContent(btn.content))">
|
|
@@ -631,19 +593,10 @@
|
|
|
631
593
|
</div>
|
|
632
594
|
<span class="flex items-center gap-4px">
|
|
633
595
|
<template v-if="toolbarConfig.tools && toolbarConfig.tools.length > 0">
|
|
634
|
-
<a-button
|
|
635
|
-
|
|
636
|
-
:
|
|
637
|
-
:
|
|
638
|
-
:size="tool.size ?? 'middle'"
|
|
639
|
-
:disabled="toolbarConfig.disabled || tool.disabled"
|
|
640
|
-
:danger="tool.danger"
|
|
641
|
-
:shape="tool.shape"
|
|
642
|
-
:ghost="tool.ghost"
|
|
643
|
-
:block="tool.block"
|
|
644
|
-
@click="debounceToolToolClick(tool.code)"
|
|
645
|
-
:loading="loading.toolbar || (!!tool.code && codeLoadings[tool.code])"
|
|
646
|
-
>
|
|
596
|
+
<a-button v-for="(tool, idx) in toolbarConfig.tools" :key="idx" :type="tool.type"
|
|
597
|
+
:size="tool.size ?? 'middle'" :disabled="toolbarConfig.disabled || tool.disabled" :danger="tool.danger"
|
|
598
|
+
:shape="tool.shape" :ghost="tool.ghost" :block="tool.block" @click="debounceToolToolClick(tool.code)"
|
|
599
|
+
:loading="loading.toolbar || (!!tool.code && codeLoadings[tool.code])">
|
|
647
600
|
<div class="flex items-center gap-4px">
|
|
648
601
|
<Icon v-if="tool.icon" :icon="tool.icon" />
|
|
649
602
|
<template v-if="tool.content && isStringContent(renderContent(tool.content))">
|
|
@@ -655,40 +608,23 @@
|
|
|
655
608
|
</template>
|
|
656
609
|
</span>
|
|
657
610
|
</div>
|
|
658
|
-
<div ref="tableWrapperEl" class="
|
|
611
|
+
<div ref="tableWrapperEl" class="flex-1 h-0 min-h-0 flex flex-col p-inner-scroll">
|
|
659
612
|
<div ref="tableBodyEl" class="flex-1 min-h-0 overflow-hidden">
|
|
660
|
-
<p-canvas-table
|
|
661
|
-
|
|
662
|
-
:
|
|
663
|
-
|
|
664
|
-
...propsWithDefaults.config,
|
|
665
|
-
HEIGHT: renderHeight,
|
|
666
|
-
}"
|
|
667
|
-
:data="tableData"
|
|
668
|
-
:loading="loading.table"
|
|
669
|
-
@selection-change="handleSelectionChange"
|
|
670
|
-
>
|
|
613
|
+
<p-canvas-table ref="canvasTableRef" :columns="finalColumns" :config="{
|
|
614
|
+
...propsWithDefaults.config,
|
|
615
|
+
HEIGHT: renderHeight,
|
|
616
|
+
}" :data="tableData" :loading="loading.table" @selection-change="handleSelectionChange">
|
|
671
617
|
<template v-for="(_, name) in $slots" #[name]="slotProps">
|
|
672
618
|
<slot :name="name" v-bind="slotProps"></slot>
|
|
673
619
|
</template>
|
|
674
620
|
</p-canvas-table>
|
|
675
621
|
</div>
|
|
676
622
|
<div ref="tableFooterEl" class="flex-shrink-0">
|
|
677
|
-
<div
|
|
678
|
-
v-if="staticConfig?.selectable && staticConfig.showCount"
|
|
679
|
-
class="w-full text-slate-5 pl-4"
|
|
680
|
-
>
|
|
623
|
+
<div v-if="staticConfig?.selectable && staticConfig.showCount" class="w-full text-slate-5 pl-4">
|
|
681
624
|
已选:{{ selectedRowKeys.length }}
|
|
682
625
|
</div>
|
|
683
|
-
<a-pagination
|
|
684
|
-
|
|
685
|
-
v-if="mode === 'pagination'"
|
|
686
|
-
size="small"
|
|
687
|
-
:current="pagination.page"
|
|
688
|
-
:page-size="pagination.size"
|
|
689
|
-
:total="totalCount"
|
|
690
|
-
@change="handleTableChange"
|
|
691
|
-
/>
|
|
626
|
+
<a-pagination class="p-canvas-pagination" v-if="mode === 'pagination'" size="small" :current="pagination.page"
|
|
627
|
+
:page-size="pagination.size" :total="totalCount" @change="handleTableChange" />
|
|
692
628
|
</div>
|
|
693
629
|
</div>
|
|
694
630
|
</template>
|