@vue-ui-kit/ant 2.0.0 → 2.0.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 +3 -3
- package/dist/declarations/antProxy.d.ts +5 -1
- package/dist/es/index.js +988 -979
- package/dist/packages/components/PCanvasTable.vue.d.ts +4 -1
- package/dist/style.scss +5 -1
- package/package.json +1 -1
- package/src/declarations/antProxy.ts +5 -0
- package/src/packages/components/PCanvasTable.vue +11 -3
- package/src/packages/components/PromisePicker.vue +16 -3
|
@@ -6,7 +6,10 @@ declare const _default: <T extends Recordable = Recordable, B extends Recordable
|
|
|
6
6
|
readonly onChange?: ((value: any[]) => any) | undefined;
|
|
7
7
|
readonly onReady?: ((value: EVirtTable) => any) | undefined;
|
|
8
8
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onChange" | "onReady"> & CanvasTableProps<T, B> & Partial<{}>> & import('vue').PublicProps;
|
|
9
|
-
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
9
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
10
|
+
$table: null;
|
|
11
|
+
selectedRecords: import('vue').ComputedRef<import('@vue/reactivity').UnwrapRefSimple<T>[]>;
|
|
12
|
+
}>): void;
|
|
10
13
|
attrs: any;
|
|
11
14
|
slots: Partial<Record<string, (_: {
|
|
12
15
|
cell: Cell | import('e-virt-table/dist/lib/CellHeader').default;
|
package/dist/style.scss
CHANGED
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import { FormProps } from 'ant-design-vue/lib/form/Form';
|
|
|
5
5
|
import { TableColumnType, TableProps, TooltipProps } from 'ant-design-vue';
|
|
6
6
|
import { ButtonType } from 'ant-design-vue/lib/button/buttonTypes';
|
|
7
7
|
import type { ConfigType, Column as EVirtColumn } from 'e-virt-table';
|
|
8
|
+
import EVirtTable from 'e-virt-table';
|
|
8
9
|
|
|
9
10
|
export interface CellFuncArg<D extends Recordable = Recordable> {
|
|
10
11
|
row: D;
|
|
@@ -371,3 +372,7 @@ export interface PFormGroupInstance {
|
|
|
371
372
|
validate: (index: number, ignoreTabError?: boolean) => Promise<void>;
|
|
372
373
|
validateFields: (index: number, fields: string[], ignoreTabError?: boolean) => Promise<void>;
|
|
373
374
|
}
|
|
375
|
+
export interface PCanvasTableInstance<T extends Recordable = Recordable> {
|
|
376
|
+
$table: InstanceType<typeof EVirtTable>;
|
|
377
|
+
selectedRecords: T[];
|
|
378
|
+
}
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
const defaultConfig = {
|
|
29
29
|
DISABLED: true,
|
|
30
30
|
};
|
|
31
|
+
const selectedRecords = ref<T[]>([]);
|
|
31
32
|
const props = defineProps<CanvasTableProps<T, B>>();
|
|
32
33
|
let eVirtTable: EVirtTable | null = null;
|
|
33
34
|
const attrs = useAttrs();
|
|
@@ -163,6 +164,9 @@
|
|
|
163
164
|
eVirtTable.on('doneEdit', () => {
|
|
164
165
|
editorType.value = 'text';
|
|
165
166
|
});
|
|
167
|
+
eVirtTable.on('selectionChange', (selection) => {
|
|
168
|
+
selectedRecords.value = selection;
|
|
169
|
+
});
|
|
166
170
|
emit('ready', eVirtTable);
|
|
167
171
|
});
|
|
168
172
|
function saveCellValue(value) {
|
|
@@ -172,6 +176,9 @@
|
|
|
172
176
|
const { rowKey, key } = editorCell.value;
|
|
173
177
|
eVirtTable?.setItemValueByEditor(rowKey, key, value);
|
|
174
178
|
}
|
|
179
|
+
const getPopupContainer = () => {
|
|
180
|
+
return document.body;
|
|
181
|
+
};
|
|
175
182
|
watch(
|
|
176
183
|
props.data,
|
|
177
184
|
(newValue) => {
|
|
@@ -202,9 +209,10 @@
|
|
|
202
209
|
},
|
|
203
210
|
{ deep: true },
|
|
204
211
|
);
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
212
|
+
defineExpose({
|
|
213
|
+
$table: eVirtTable,
|
|
214
|
+
selectedRecords: computed(() => selectedRecords.value),
|
|
215
|
+
});
|
|
208
216
|
</script>
|
|
209
217
|
<template>
|
|
210
218
|
<a-spin :spinning="loading">
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script
|
|
2
|
+
lang="ts"
|
|
3
|
+
setup
|
|
4
|
+
name="PromisePicker"
|
|
5
|
+
generic="D extends Recordable = Recordable, F extends Recordable = Recordable"
|
|
6
|
+
>
|
|
2
7
|
import { reactive, ref, computed } from 'vue';
|
|
3
8
|
import { PGridInstance, PromisePickerProps } from '#/antProxy';
|
|
4
9
|
import PGrid from '@/components/PGrid.vue';
|
|
@@ -6,7 +11,15 @@
|
|
|
6
11
|
import { Button as AButton, Modal as AModal } from 'ant-design-vue';
|
|
7
12
|
|
|
8
13
|
const gridEl = ref<PGridInstance<D>>();
|
|
9
|
-
|
|
14
|
+
const defaultBodyStyle = {
|
|
15
|
+
minHeight: '642px',
|
|
16
|
+
};
|
|
17
|
+
const mergedBodyStyle = computed(() => {
|
|
18
|
+
return {
|
|
19
|
+
...defaultBodyStyle,
|
|
20
|
+
...props.bodyStyle,
|
|
21
|
+
};
|
|
22
|
+
});
|
|
10
23
|
const props = withDefaults(defineProps<PromisePickerProps<D, F>>(), {
|
|
11
24
|
title: '数据选择',
|
|
12
25
|
width: '70%',
|
|
@@ -82,7 +95,7 @@
|
|
|
82
95
|
:width="width"
|
|
83
96
|
:footer="isMultiple ? undefined : null"
|
|
84
97
|
@cancel="handleCancel"
|
|
85
|
-
:body-style="
|
|
98
|
+
:body-style="mergedBodyStyle"
|
|
86
99
|
>
|
|
87
100
|
<p-grid v-bind="gridSetting" ref="gridEl" @pick="selectRow" />
|
|
88
101
|
<template v-if="isMultiple" #footer>
|