@aplus-frontend/ui 0.0.15 → 0.0.16
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/es/src/ap-form/modal-form/index.vue.mjs +1 -1
- package/es/src/ap-table/ap-table.vue.d.ts +2 -2
- package/es/src/ap-table/ap-table.vue.mjs +1 -1
- package/es/src/ap-table/interface.d.ts +12 -11
- package/es/src/ap-table/utils.d.ts +2188 -5
- package/es/src/business/title/style.css +29 -9
- package/es/src/editable-table/hooks/use-get-columns.d.ts +26 -3
- package/es/src/editable-table/hooks/use-get-columns.mjs +54 -52
- package/es/src/editable-table/interface.d.ts +24 -7
- package/es/src/theme/antd-global-overwrite/admin/index.css +6 -6
- package/es/src/theme/antd-global-overwrite/admin/modal.css +6 -6
- package/es/src/theme/antd-global-overwrite/aplus/index.css +6 -6
- package/es/src/theme/antd-global-overwrite/aplus/modal.css +6 -6
- package/es/src/theme/ap-title/ap-title.css +29 -9
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +2 -2
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/interface.d.ts +12 -11
- package/lib/src/ap-table/utils.d.ts +2188 -5
- package/lib/src/business/title/style.css +29 -9
- package/lib/src/editable-table/hooks/use-get-columns.d.ts +26 -3
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/editable-table/interface.d.ts +24 -7
- package/lib/src/theme/antd-global-overwrite/admin/index.css +6 -6
- package/lib/src/theme/antd-global-overwrite/admin/modal.css +6 -6
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +6 -6
- package/lib/src/theme/antd-global-overwrite/aplus/modal.css +6 -6
- package/lib/src/theme/ap-title/ap-title.css +29 -9
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.aplus-ap-title {
|
|
2
2
|
position: relative;
|
|
3
3
|
width: 100%;
|
|
4
|
-
height:
|
|
4
|
+
height: 20px;
|
|
5
5
|
display: flex;
|
|
6
6
|
align-items: center;
|
|
7
7
|
justify-content: space-between;
|
|
@@ -12,17 +12,12 @@
|
|
|
12
12
|
position: absolute;
|
|
13
13
|
content: '';
|
|
14
14
|
left: 0;
|
|
15
|
-
top:
|
|
15
|
+
top: 2px;
|
|
16
16
|
width: 3px;
|
|
17
|
-
height:
|
|
17
|
+
height: 16px;
|
|
18
18
|
background: #0070ff;
|
|
19
19
|
border-radius: 0px 4px 4px 0px;
|
|
20
|
-
|
|
21
|
-
.aplus-ap-title--aplus::before {
|
|
22
|
-
background: #0070ff;
|
|
23
|
-
}
|
|
24
|
-
.aplus-ap-title--admin::before {
|
|
25
|
-
background: #34b77c;
|
|
20
|
+
z-index: 1;
|
|
26
21
|
}
|
|
27
22
|
.aplus-ap-title__prefix {
|
|
28
23
|
font-weight: bold;
|
|
@@ -34,6 +29,31 @@
|
|
|
34
29
|
margin-left: 5px;
|
|
35
30
|
color: #8896b0;
|
|
36
31
|
}
|
|
32
|
+
.aplus-ap-title--admin {
|
|
33
|
+
height: 22px;
|
|
34
|
+
padding-left: 14px;
|
|
35
|
+
}
|
|
36
|
+
.aplus-ap-title--admin::before {
|
|
37
|
+
top: 7px;
|
|
38
|
+
width: 8px;
|
|
39
|
+
height: 8px;
|
|
40
|
+
border-radius: 50%;
|
|
41
|
+
border-width: 2px;
|
|
42
|
+
border-style: solid;
|
|
43
|
+
border-color: #34b77c;
|
|
44
|
+
background: #fff;
|
|
45
|
+
z-index: 1;
|
|
46
|
+
}
|
|
47
|
+
.aplus-ap-title--admin .aplus-ap-title__prefix {
|
|
48
|
+
font-weight: bold;
|
|
49
|
+
color: #333;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
}
|
|
53
|
+
.aplus-ap-title--admin .aplus-ap-title__prefix .anticon-question-circle {
|
|
54
|
+
margin-left: 5px;
|
|
55
|
+
color: #8896b0;
|
|
56
|
+
}
|
|
37
57
|
.aplus-ap-title__suffix {
|
|
38
58
|
color: #526a90;
|
|
39
59
|
}
|
|
@@ -1,5 +1,28 @@
|
|
|
1
|
-
import { EditableTableFormItemProps, EditableTableProps
|
|
2
|
-
import { ComputedRef } from 'vue';
|
|
1
|
+
import { EditableTableFormItemProps, EditableTableProps } from '../interface';
|
|
2
|
+
import { ComputedRef, VNode, RendererNode, RendererElement } from 'vue';
|
|
3
|
+
import { TableColumnType } from 'ant-design-vue';
|
|
4
|
+
import { ValueEnum } from '../..';
|
|
3
5
|
|
|
4
|
-
declare const useGetColumns: (props: EditableTableProps | EditableTableFormItemProps) => ComputedRef<
|
|
6
|
+
declare const useGetColumns: (props: EditableTableProps | EditableTableFormItemProps) => ComputedRef<(Omit< TableColumnType<any>, "children" | "customRender"> & {
|
|
7
|
+
children?: (Omit< TableColumnType<any>, "children" | "customRender"> & any) | undefined;
|
|
8
|
+
tooltip?: string | undefined;
|
|
9
|
+
copyable?: boolean | undefined;
|
|
10
|
+
editable?: boolean | ((text: any, record: any, index: number) => boolean) | undefined;
|
|
11
|
+
valueEnum?: ValueEnum | undefined;
|
|
12
|
+
customRenderFormItem?: ((config: Omit< TableColumnType<any>, "children" | "customRender"> & any) => any) | undefined;
|
|
13
|
+
valueType?: any;
|
|
14
|
+
fieldProps?: any;
|
|
15
|
+
customRender?: ((opt: {
|
|
16
|
+
value: any;
|
|
17
|
+
text: any;
|
|
18
|
+
record: any;
|
|
19
|
+
index: number;
|
|
20
|
+
renderIndex: number;
|
|
21
|
+
column: TableColumnType<any>;
|
|
22
|
+
editable?: boolean | undefined;
|
|
23
|
+
originalNode?: VNode<RendererNode, RendererElement, {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}> | undefined;
|
|
26
|
+
}) => any) | undefined;
|
|
27
|
+
})[]>;
|
|
5
28
|
export default useGetColumns;
|
|
@@ -1,76 +1,78 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as g, createVNode as c, mergeProps as x } from "vue";
|
|
2
2
|
import { isFunction as C } from "lodash-unified";
|
|
3
3
|
import { getEditableComponent as T } from "../utils.mjs";
|
|
4
4
|
import { updateFormProps as h, getFieldProps as F, getPlaceholder as R, getTableRenderProps as I } from "../../ap-table/utils.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
|
-
import { apTableRenderItemMap as
|
|
7
|
-
import { Typography as
|
|
8
|
-
import { useLocale as
|
|
9
|
-
const
|
|
6
|
+
import { apTableRenderItemMap as N, noRenderAsFormItemValueList as v } from "../../ap-table/constants.mjs";
|
|
7
|
+
import { Typography as L } from "ant-design-vue";
|
|
8
|
+
import { useLocale as M } from "../../config-provider/hooks/use-locale.mjs";
|
|
9
|
+
const k = (a) => {
|
|
10
10
|
const {
|
|
11
|
-
t:
|
|
12
|
-
} =
|
|
13
|
-
let
|
|
14
|
-
return
|
|
11
|
+
t: s
|
|
12
|
+
} = M(), f = g(() => {
|
|
13
|
+
let o = a.columns;
|
|
14
|
+
return o ? (o = o.map((e) => ({
|
|
15
15
|
...e,
|
|
16
16
|
customRender({
|
|
17
|
-
value:
|
|
18
|
-
...
|
|
17
|
+
value: l,
|
|
18
|
+
...t
|
|
19
19
|
}) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const u = C(e.editable) ? e.editable(t.text, t.record, t.index) : !!e.editable;
|
|
21
|
+
let d;
|
|
22
|
+
if (u) {
|
|
23
|
+
const r = T(e.valueType), n = h(e, F(e.fieldProps, {
|
|
24
|
+
value: l,
|
|
25
|
+
...t
|
|
26
|
+
})), i = {};
|
|
27
|
+
a.onFieldChange && (i[`onUpdate:${n.valuePropName || "value"}`] = (y) => {
|
|
28
|
+
var p;
|
|
29
|
+
return (p = a.onFieldChange) == null ? void 0 : p.call(a, t.index, e.dataIndex, y);
|
|
25
30
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
style: "width: 100%",
|
|
43
|
-
...(t == null ? void 0 : t.field) || {},
|
|
44
|
-
...r
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
return d(m, b, null);
|
|
48
|
-
}
|
|
49
|
-
const s = v[e.valueType], f = I(e, {
|
|
50
|
-
value: o,
|
|
51
|
-
...l
|
|
31
|
+
const b = {
|
|
32
|
+
name: [a.name, t.index, e.dataIndex],
|
|
33
|
+
...n || {},
|
|
34
|
+
// 格式化placeholder
|
|
35
|
+
placeholder: R(s, e.valueType, n == null ? void 0 : n.placeholder),
|
|
36
|
+
field: {
|
|
37
|
+
style: "width: 100%",
|
|
38
|
+
...(n == null ? void 0 : n.field) || {},
|
|
39
|
+
...i
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
d = c(r, b, null);
|
|
43
|
+
} else {
|
|
44
|
+
const r = N[e.valueType], n = I(e, {
|
|
45
|
+
value: l,
|
|
46
|
+
...t
|
|
52
47
|
});
|
|
53
|
-
|
|
48
|
+
d = m(e, l, c(r, x(n, {
|
|
54
49
|
mode: "read"
|
|
55
50
|
}), null));
|
|
56
51
|
}
|
|
52
|
+
return e.customRender ? e.customRender({
|
|
53
|
+
value: l,
|
|
54
|
+
...t,
|
|
55
|
+
column: e,
|
|
56
|
+
editable: u,
|
|
57
|
+
originalNode: d
|
|
58
|
+
}) : d;
|
|
57
59
|
}
|
|
58
|
-
})),
|
|
60
|
+
})), o) : [];
|
|
59
61
|
});
|
|
60
|
-
function
|
|
61
|
-
return
|
|
62
|
-
copyable:
|
|
62
|
+
function m(o, e, l) {
|
|
63
|
+
return v.includes(o.valueType) ? l : o.copyable || o.ellipsis ? c(L.Text, {
|
|
64
|
+
copyable: o.copyable ? {
|
|
63
65
|
text: e,
|
|
64
66
|
tooltip: !1
|
|
65
67
|
} : !1,
|
|
66
|
-
ellipsis:
|
|
68
|
+
ellipsis: o.ellipsis ? {
|
|
67
69
|
tooltip: e
|
|
68
70
|
} : !1,
|
|
69
|
-
content:
|
|
70
|
-
}, null) :
|
|
71
|
+
content: l
|
|
72
|
+
}, null) : l;
|
|
71
73
|
}
|
|
72
|
-
return
|
|
74
|
+
return f;
|
|
73
75
|
};
|
|
74
76
|
export {
|
|
75
|
-
|
|
77
|
+
k as default
|
|
76
78
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ColumnType, TableProps } from 'ant-design-vue/es/table';
|
|
2
|
-
import { ApTableValueFields, ValueEnum } from '../ap-table';
|
|
2
|
+
import { ApTableValueFields, ApTableValueTypes, ValueEnum } from '../ap-table';
|
|
3
3
|
import { NamePath, ValidateOptions } from 'ant-design-vue/es/form/interface';
|
|
4
4
|
import { DataIndex } from 'ant-design-vue/es/vc-table/interface';
|
|
5
5
|
import { FormItemProps } from 'ant-design-vue';
|
|
6
|
+
import { VNode } from 'vue';
|
|
6
7
|
|
|
7
|
-
export type EditableColumnType<ValueType extends
|
|
8
|
+
export type EditableColumnType<RecordType = any, ValueType extends ApTableValueTypes = ApTableValueTypes> = ValueType extends ApTableValueTypes ? Omit<ColumnType<RecordType>, 'children' | 'customRender'> & {
|
|
9
|
+
children?: EditableColumnType<RecordType, ValueType>;
|
|
8
10
|
/**
|
|
9
11
|
* 在title之后展示一个icon并触发tooltip
|
|
10
12
|
*/
|
|
@@ -25,11 +27,11 @@ export type EditableColumnType<ValueType extends keyof ApTableValueFields = 'tex
|
|
|
25
27
|
* 自定义表单
|
|
26
28
|
* @deprecated 未实现,请使用`customRender`
|
|
27
29
|
*/
|
|
28
|
-
customRenderFormItem?: (config: EditableColumnType<
|
|
30
|
+
customRenderFormItem?: (config: EditableColumnType<RecordType, ValueType>) => any;
|
|
29
31
|
/**
|
|
30
32
|
* 指定值类型(将会用于普通列和可编辑表格的渲染)
|
|
31
33
|
*/
|
|
32
|
-
valueType?:
|
|
34
|
+
valueType?: ValueType;
|
|
33
35
|
/**
|
|
34
36
|
* 值类型额外配置的参数(支持函数)
|
|
35
37
|
*/
|
|
@@ -39,14 +41,29 @@ export type EditableColumnType<ValueType extends keyof ApTableValueFields = 'tex
|
|
|
39
41
|
record: RecordType;
|
|
40
42
|
index: number;
|
|
41
43
|
renderIndex: number;
|
|
42
|
-
column: EditableColumnType<
|
|
44
|
+
column: EditableColumnType<RecordType, ValueType>;
|
|
43
45
|
}) => ApTableValueFields[ValueType]);
|
|
44
|
-
|
|
46
|
+
/**
|
|
47
|
+
* 自定义渲染,添加了`editable`以及`originalNode`
|
|
48
|
+
* @param opt
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
customRender?: (opt: {
|
|
52
|
+
value: any;
|
|
53
|
+
text: any;
|
|
54
|
+
record: RecordType;
|
|
55
|
+
index: number;
|
|
56
|
+
renderIndex: number;
|
|
57
|
+
column: ColumnType<RecordType>;
|
|
58
|
+
editable?: boolean;
|
|
59
|
+
originalNode?: VNode;
|
|
60
|
+
}) => any;
|
|
61
|
+
} : never;
|
|
45
62
|
export type EditableTableProps<RecordType = any> = Omit<TableProps<RecordType>, 'columns' | 'dataSource'> & {
|
|
46
63
|
/**
|
|
47
64
|
* 列配置
|
|
48
65
|
*/
|
|
49
|
-
columns?: EditableColumnType<
|
|
66
|
+
columns?: EditableColumnType<RecordType, any>[];
|
|
50
67
|
/**
|
|
51
68
|
* 表格数据v-model
|
|
52
69
|
*/
|
|
@@ -157,7 +157,7 @@ div[class$='-basic-table-form-container'] form[class$='-basic-form--compact'] di
|
|
|
157
157
|
vertical-align: -0.18em;
|
|
158
158
|
margin-inline-end: 9px;
|
|
159
159
|
}
|
|
160
|
-
.ant-modal-root .ant-modal-close {
|
|
160
|
+
.ant-modal-root .ant-modal .ant-modal-close {
|
|
161
161
|
top: 0;
|
|
162
162
|
right: 0;
|
|
163
163
|
width: auto;
|
|
@@ -167,28 +167,28 @@ div[class$='-basic-table-form-container'] form[class$='-basic-form--compact'] di
|
|
|
167
167
|
outline: none;
|
|
168
168
|
cursor: default;
|
|
169
169
|
}
|
|
170
|
-
.ant-modal-root .ant-modal-close:hover {
|
|
170
|
+
.ant-modal-root .ant-modal .ant-modal-close:hover {
|
|
171
171
|
color: #666666;
|
|
172
172
|
background-color: transparent;
|
|
173
173
|
}
|
|
174
|
-
.ant-modal-root .ant-modal-close-x {
|
|
174
|
+
.ant-modal-root .ant-modal .ant-modal-close-x {
|
|
175
175
|
display: inline-block;
|
|
176
176
|
width: 96px;
|
|
177
177
|
height: 54px;
|
|
178
178
|
line-height: 54px;
|
|
179
179
|
text-align: start;
|
|
180
180
|
}
|
|
181
|
-
.ant-modal-root .ant-modal-close-x > div {
|
|
181
|
+
.ant-modal-root .ant-modal .ant-modal-close-x > div {
|
|
182
182
|
height: 100%;
|
|
183
183
|
}
|
|
184
|
-
.ant-modal-root .ant-modal-close-x > span {
|
|
184
|
+
.ant-modal-root .ant-modal .ant-modal-close-x > span {
|
|
185
185
|
display: inline-block;
|
|
186
186
|
margin-left: 48px;
|
|
187
187
|
padding: 10px;
|
|
188
188
|
cursor: pointer;
|
|
189
189
|
transition: all 0.2s;
|
|
190
190
|
}
|
|
191
|
-
.ant-modal-root .ant-modal-close-x > span:hover {
|
|
191
|
+
.ant-modal-root .ant-modal .ant-modal-close-x > span:hover {
|
|
192
192
|
color: #ed6f6f;
|
|
193
193
|
}
|
|
194
194
|
.ant-modal-root .ant-modal .ant-modal-content {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.ant-modal-root .ant-modal-close {
|
|
1
|
+
.ant-modal-root .ant-modal .ant-modal-close {
|
|
2
2
|
top: 0;
|
|
3
3
|
right: 0;
|
|
4
4
|
width: auto;
|
|
@@ -8,28 +8,28 @@
|
|
|
8
8
|
outline: none;
|
|
9
9
|
cursor: default;
|
|
10
10
|
}
|
|
11
|
-
.ant-modal-root .ant-modal-close:hover {
|
|
11
|
+
.ant-modal-root .ant-modal .ant-modal-close:hover {
|
|
12
12
|
color: #666666;
|
|
13
13
|
background-color: transparent;
|
|
14
14
|
}
|
|
15
|
-
.ant-modal-root .ant-modal-close-x {
|
|
15
|
+
.ant-modal-root .ant-modal .ant-modal-close-x {
|
|
16
16
|
display: inline-block;
|
|
17
17
|
width: 96px;
|
|
18
18
|
height: 54px;
|
|
19
19
|
line-height: 54px;
|
|
20
20
|
text-align: start;
|
|
21
21
|
}
|
|
22
|
-
.ant-modal-root .ant-modal-close-x > div {
|
|
22
|
+
.ant-modal-root .ant-modal .ant-modal-close-x > div {
|
|
23
23
|
height: 100%;
|
|
24
24
|
}
|
|
25
|
-
.ant-modal-root .ant-modal-close-x > span {
|
|
25
|
+
.ant-modal-root .ant-modal .ant-modal-close-x > span {
|
|
26
26
|
display: inline-block;
|
|
27
27
|
margin-left: 48px;
|
|
28
28
|
padding: 10px;
|
|
29
29
|
cursor: pointer;
|
|
30
30
|
transition: all 0.2s;
|
|
31
31
|
}
|
|
32
|
-
.ant-modal-root .ant-modal-close-x > span:hover {
|
|
32
|
+
.ant-modal-root .ant-modal .ant-modal-close-x > span:hover {
|
|
33
33
|
color: #ed6f6f;
|
|
34
34
|
}
|
|
35
35
|
.ant-modal-root .ant-modal .ant-modal-content {
|
|
@@ -182,7 +182,7 @@ div[class$='-basic-table-form-container'] form[class$='-basic-form--compact'] di
|
|
|
182
182
|
vertical-align: -0.18em;
|
|
183
183
|
margin-inline-end: 9px;
|
|
184
184
|
}
|
|
185
|
-
.ant-modal-root .ant-modal-close {
|
|
185
|
+
.ant-modal-root .ant-modal .ant-modal-close {
|
|
186
186
|
top: 0;
|
|
187
187
|
right: 0;
|
|
188
188
|
width: auto;
|
|
@@ -192,28 +192,28 @@ div[class$='-basic-table-form-container'] form[class$='-basic-form--compact'] di
|
|
|
192
192
|
outline: none;
|
|
193
193
|
cursor: default;
|
|
194
194
|
}
|
|
195
|
-
.ant-modal-root .ant-modal-close:hover {
|
|
195
|
+
.ant-modal-root .ant-modal .ant-modal-close:hover {
|
|
196
196
|
color: #8796b0;
|
|
197
197
|
background-color: transparent;
|
|
198
198
|
}
|
|
199
|
-
.ant-modal-root .ant-modal-close-x {
|
|
199
|
+
.ant-modal-root .ant-modal .ant-modal-close-x {
|
|
200
200
|
display: inline-block;
|
|
201
201
|
width: 96px;
|
|
202
202
|
height: 54px;
|
|
203
203
|
line-height: 54px;
|
|
204
204
|
text-align: start;
|
|
205
205
|
}
|
|
206
|
-
.ant-modal-root .ant-modal-close-x > div {
|
|
206
|
+
.ant-modal-root .ant-modal .ant-modal-close-x > div {
|
|
207
207
|
height: 100%;
|
|
208
208
|
}
|
|
209
|
-
.ant-modal-root .ant-modal-close-x > span {
|
|
209
|
+
.ant-modal-root .ant-modal .ant-modal-close-x > span {
|
|
210
210
|
display: inline-block;
|
|
211
211
|
margin-left: 48px;
|
|
212
212
|
padding: 10px;
|
|
213
213
|
cursor: pointer;
|
|
214
214
|
transition: all 0.2s;
|
|
215
215
|
}
|
|
216
|
-
.ant-modal-root .ant-modal-close-x > span:hover {
|
|
216
|
+
.ant-modal-root .ant-modal .ant-modal-close-x > span:hover {
|
|
217
217
|
color: #ed6f6f;
|
|
218
218
|
}
|
|
219
219
|
.ant-modal-root .ant-modal .ant-modal-content {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.ant-modal-root .ant-modal-close {
|
|
1
|
+
.ant-modal-root .ant-modal .ant-modal-close {
|
|
2
2
|
top: 0;
|
|
3
3
|
right: 0;
|
|
4
4
|
width: auto;
|
|
@@ -8,28 +8,28 @@
|
|
|
8
8
|
outline: none;
|
|
9
9
|
cursor: default;
|
|
10
10
|
}
|
|
11
|
-
.ant-modal-root .ant-modal-close:hover {
|
|
11
|
+
.ant-modal-root .ant-modal .ant-modal-close:hover {
|
|
12
12
|
color: #8796b0;
|
|
13
13
|
background-color: transparent;
|
|
14
14
|
}
|
|
15
|
-
.ant-modal-root .ant-modal-close-x {
|
|
15
|
+
.ant-modal-root .ant-modal .ant-modal-close-x {
|
|
16
16
|
display: inline-block;
|
|
17
17
|
width: 96px;
|
|
18
18
|
height: 54px;
|
|
19
19
|
line-height: 54px;
|
|
20
20
|
text-align: start;
|
|
21
21
|
}
|
|
22
|
-
.ant-modal-root .ant-modal-close-x > div {
|
|
22
|
+
.ant-modal-root .ant-modal .ant-modal-close-x > div {
|
|
23
23
|
height: 100%;
|
|
24
24
|
}
|
|
25
|
-
.ant-modal-root .ant-modal-close-x > span {
|
|
25
|
+
.ant-modal-root .ant-modal .ant-modal-close-x > span {
|
|
26
26
|
display: inline-block;
|
|
27
27
|
margin-left: 48px;
|
|
28
28
|
padding: 10px;
|
|
29
29
|
cursor: pointer;
|
|
30
30
|
transition: all 0.2s;
|
|
31
31
|
}
|
|
32
|
-
.ant-modal-root .ant-modal-close-x > span:hover {
|
|
32
|
+
.ant-modal-root .ant-modal .ant-modal-close-x > span:hover {
|
|
33
33
|
color: #ed6f6f;
|
|
34
34
|
}
|
|
35
35
|
.ant-modal-root .ant-modal .ant-modal-content {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.aplus-ap-title {
|
|
2
2
|
position: relative;
|
|
3
3
|
width: 100%;
|
|
4
|
-
height:
|
|
4
|
+
height: 20px;
|
|
5
5
|
display: flex;
|
|
6
6
|
align-items: center;
|
|
7
7
|
justify-content: space-between;
|
|
@@ -12,17 +12,12 @@
|
|
|
12
12
|
position: absolute;
|
|
13
13
|
content: '';
|
|
14
14
|
left: 0;
|
|
15
|
-
top:
|
|
15
|
+
top: 2px;
|
|
16
16
|
width: 3px;
|
|
17
|
-
height:
|
|
17
|
+
height: 16px;
|
|
18
18
|
background: #0070ff;
|
|
19
19
|
border-radius: 0px 4px 4px 0px;
|
|
20
|
-
|
|
21
|
-
.aplus-ap-title--aplus::before {
|
|
22
|
-
background: #0070ff;
|
|
23
|
-
}
|
|
24
|
-
.aplus-ap-title--admin::before {
|
|
25
|
-
background: #34b77c;
|
|
20
|
+
z-index: 1;
|
|
26
21
|
}
|
|
27
22
|
.aplus-ap-title__prefix {
|
|
28
23
|
font-weight: bold;
|
|
@@ -34,6 +29,31 @@
|
|
|
34
29
|
margin-left: 5px;
|
|
35
30
|
color: #8896b0;
|
|
36
31
|
}
|
|
32
|
+
.aplus-ap-title--admin {
|
|
33
|
+
height: 22px;
|
|
34
|
+
padding-left: 14px;
|
|
35
|
+
}
|
|
36
|
+
.aplus-ap-title--admin::before {
|
|
37
|
+
top: 7px;
|
|
38
|
+
width: 8px;
|
|
39
|
+
height: 8px;
|
|
40
|
+
border-radius: 50%;
|
|
41
|
+
border-width: 2px;
|
|
42
|
+
border-style: solid;
|
|
43
|
+
border-color: #34b77c;
|
|
44
|
+
background: #fff;
|
|
45
|
+
z-index: 1;
|
|
46
|
+
}
|
|
47
|
+
.aplus-ap-title--admin .aplus-ap-title__prefix {
|
|
48
|
+
font-weight: bold;
|
|
49
|
+
color: #333;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
}
|
|
53
|
+
.aplus-ap-title--admin .aplus-ap-title__prefix .anticon-question-circle {
|
|
54
|
+
margin-left: 5px;
|
|
55
|
+
color: #8896b0;
|
|
56
|
+
}
|
|
37
57
|
.aplus-ap-title__suffix {
|
|
38
58
|
color: #526a90;
|
|
39
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("ant-design-vue");require("../ap-form.vue.js");require("../../hooks/index.js");const S=require("../../utils/slot.js");require("../../config-provider/index.js");const T=require("lodash-unified");require("../style/modal-form.css");const M=require("../../utils/index.js"),R=require("../../hooks/useControllableValue.js"),j=require("../../config-provider/hooks/use-locale.js"),O=require("../../config-provider/hooks/use-global-config.js"),D=require("../../config-provider/hooks/use-namespace.js"),U=require("../ap-form.vue2.js");function F(d){return typeof d=="function"||Object.prototype.toString.call(d)==="[object Object]"&&!e.isVNode(d)}const z=e.defineComponent({__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onValuesChange:{},onFieldsChange:{},onFinishFailed:{},onValidate:{},initialValues:{},open:{type:Boolean,default:void 0},"onUpdate:open":{},modalProps:{default:()=>({})},title:{},width:{default:800},onFinish:{},submitter:{type:[Boolean,Object],default:()=>({resetButtonProps:!1})},showCancel:{type:Boolean,default:!0}},emits:["update:open"],setup(d,{expose:y,emit:C}){const o=d,m=e.useSlots(),B=C,n=e.ref(),c=e.ref(),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("ant-design-vue");require("../ap-form.vue.js");require("../../hooks/index.js");const S=require("../../utils/slot.js");require("../../config-provider/index.js");const T=require("lodash-unified");require("../style/modal-form.css");const M=require("../../utils/index.js"),R=require("../../hooks/useControllableValue.js"),j=require("../../config-provider/hooks/use-locale.js"),O=require("../../config-provider/hooks/use-global-config.js"),D=require("../../config-provider/hooks/use-namespace.js"),U=require("../ap-form.vue2.js");function F(d){return typeof d=="function"||Object.prototype.toString.call(d)==="[object Object]"&&!e.isVNode(d)}const z=e.defineComponent({__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onValuesChange:{},onFieldsChange:{},onFinishFailed:{},onValidate:{},initialValues:{},open:{type:Boolean,default:void 0},"onUpdate:open":{},modalProps:{default:()=>({})},title:{},width:{default:800},onFinish:{},submitter:{type:[Boolean,Object],default:()=>({resetButtonProps:!1})},showCancel:{type:Boolean,default:!0}},emits:["update:open"],setup(d,{expose:y,emit:C}){const o=d,m=e.useSlots(),B=C,n=e.ref(),c=e.ref(),r=e.ref(!1),{value:k,updateValue:f}=R.useControllableValue(o,B,{valuePropName:"open",defaultValue:!1}),{t:b}=j.useLocale(),v=O.useGlobalConfig("uiMode","aplus"),{b:N,e:g}=D.useNamespace("ap-form-modal-form");e.watch(()=>n.value,t=>{var l;t&&c.value&&((l=t.setFieldsValue)==null||l.call(t,c.value),c.value=void 0)});const h=S.getSingleVNode(m.trigger),q=h?e.cloneVNode(h,{onClick:()=>{f(!0)}}):null,_=e.computed(()=>{var l,a,u,p;const t=[];if(o.submitter===!1)return null;if(o.showCancel){let s;t.push(e.createVNode(i.Button,{onClick:V,disabled:r.value},F(s=b("ap.common.cancelText"))?s:{default:()=>[s]}))}return((l=o.submitter)==null?void 0:l.resetButtonProps)!==!1&&t.push(e.createVNode(i.Button,e.mergeProps(((a=o.submitter)==null?void 0:a.resetButtonProps)||{},{key:"submit",disabled:r.value,onClick:w}),{default:()=>{var s;return[((s=o.submitter)==null?void 0:s.resetText)||b("ap.common.resetText")]}})),((u=o.submitter)==null?void 0:u.submitButtonProps)!==!1&&t.push(e.createVNode(i.Button,e.mergeProps({type:"primary",key:"submit"},((p=o.submitter)==null?void 0:p.submitButtonProps)||{},{loading:r.value,onClick:x}),{default:()=>{var s;return[((s=o.submitter)==null?void 0:s.submitText)||b("ap.common.okText")]}})),e.createVNode(i.Flex,{justify:"flex-end",class:g(e.unref(v)==="admin"?"footer-admin":"footer")},{default:()=>[m.submitter?m.submitter(t):e.createVNode(i.Space,null,F(t)?t:{default:()=>[t]})]})});function w(){var t,l,a;o.submitter!==!1&&((t=n.value)==null||t.resetFields(),(a=(l=o.submitter)==null?void 0:l.onReset)==null||a.call(l))}async function x(){var t,l,a,u;if(o.submitter!==!1)try{const p=await((t=n.value)==null?void 0:t.validateFields());(a=(l=o.submitter)==null?void 0:l.onSubmit)==null||a.call(l),r.value=!0,await((u=o.onFinish)==null?void 0:u.call(o,M.convertReactiveToRaw(p)))&&f(!1)}finally{r.value=!1}}function V(){e.unref(r)||f(!1)}function P(t){!t&&e.unref(r)||f(t)}return y({resetFields:t=>{var l;(l=n.value)==null||l.resetFields(t)},clearValidate:t=>{var l;(l=n.value)==null||l.clearValidate(t)},validateFields:(t,l)=>{var a;return(a=n.value)==null?void 0:a.validateFields(t,l)},getFieldsValue:t=>{var l;return(l=n.value)==null?void 0:l.getFieldsValue(t)},validate:(t,l)=>{var a;return(a=n.value)==null?void 0:a.validate(t,l)},scrollToField:(t,l={})=>{var a;(a=n.value)==null||a.scrollToField(t,l)},setFieldValue:(t,l)=>{var a,u;(u=(a=n.value)==null?void 0:a.setFieldValue)==null||u.call(a,t,l)},setFieldsValue:t=>{var l,a;if(!n.value){c.value=t;return}(a=(l=n.value)==null?void 0:l.setFieldsValue)==null||a.call(l,t)}}),(t,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(i.Modal),e.mergeProps(t.modalProps,{open:e.unref(k),"onUpdate:open":P,onCancel:V,footer:null,width:t.width,class:e.unref(N)(),"body-style":{padding:e.unref(v)==="admin"?"0px !important":"20px !important"}}),{title:e.withCtx(()=>[e.renderSlot(t.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(o.title),1)])]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(g)(e.unref(v)==="admin"?"content-admin":"content"))},[e.createVNode(U.default,e.mergeProps({ref_key:"formRef",ref:n},e.unref(T.omit)(o,["modalProps","open","onUpdate:open","title","width","onFinish","submitter"])),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)],2),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_.value)))]),_:3},16,["open","width","class","body-style"]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(q))))],64))}});exports.default=z;
|
|
@@ -34,7 +34,7 @@ type ApTableSlots = {
|
|
|
34
34
|
*/
|
|
35
35
|
declare function setSearchFormValues(fields: any): void;
|
|
36
36
|
declare function getSearchFormValues(): Partial<any> | undefined;
|
|
37
|
-
declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTableProps<any, any
|
|
37
|
+
declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTableProps<any, any>>, {
|
|
38
38
|
bordered: boolean;
|
|
39
39
|
childrenColumnName: string;
|
|
40
40
|
defaultExpandAllRows: boolean;
|
|
@@ -59,7 +59,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
59
59
|
setSearchFormValues: typeof setSearchFormValues;
|
|
60
60
|
getSearchFormValues: typeof getSearchFormValues;
|
|
61
61
|
dataSource: ComputedRef<any[]>;
|
|
62
|
-
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTableProps<any, any
|
|
62
|
+
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTableProps<any, any>>, {
|
|
63
63
|
bordered: boolean;
|
|
64
64
|
childrenColumnName: string;
|
|
65
65
|
defaultExpandAllRows: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("ant-design-vue"),M=require("ant-design-vue/es/theme/internal"),W=require("../ap-form/index.js"),c=require("./constants.js");require("../config-provider/index.js");const A=require("./hooks/use-table-paging.js"),x=require("lodash-unified");require("./style/ap-table.css");const H=require("@ant-design/icons-vue"),u=require("./utils.js"),K=require("./hooks/use-table-content-height.js"),$=require("../config-provider/hooks/use-locale.js"),G=require("../config-provider/hooks/use-namespace.js"),U=require("../config-provider/hooks/use-global-config.js"),Q={key:0},J=e.defineComponent({name:"ApTable",__name:"ap-table",props:{dropdownPrefixCls:{},loading:{type:[Boolean,Object],default:void 0},bordered:{type:Boolean,default:!1},locale:{},onChange:{},onResizeColumn:{},rowSelection:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},rowKey:{default:"key"},tableLayout:{},rowClassName:{},title:{},footer:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object]},transformCellText:{},columns:{},card:{type:Boolean,default:!1},params:{},searchFormRender:{},request:{},onLoad:{},defaultData:{},onLoadingChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},manual:{type:Boolean,default:!1},size:{default:"middle"},adaptive:{type:Boolean,default:!1}},setup(w,{expose:R}){const o=w,h=e.useSlots(),[,B]=M.useToken(),{t:T}=$.useLocale(),{e:p,b:s}=G.useNamespace("ap-table"),P=U.useGlobalConfig("uiMode"),{height:k,contentRef:v}=K.default(),f=e.computed(()=>{var r;let t=((r=o.columns)==null?void 0:r.filter(a=>!a.hideInTable))||[];return t=t.map(a=>({...u.apColumnToColumn(a),customRender({value:n,...l}){let d;if(a.customRender)d=a.customRender({value:n,...l,column:a});else{const F=u.getTableRenderType(a),D=c.apTableRenderItemMap[F],j=u.getTableRenderProps(a,{value:n,...l});d=e.createVNode(D,e.mergeProps(j,{mode:"read"}),null)}return L(a,n,d)}})),t}),b=e.computed(()=>{var t,r,a;return((a=(r=(t=o.columns)==null?void 0:t.filter(n=>!n.hideInSearch&&n.dataIndex&&(n.valueType||n.customRenderFormItem)&&!c.noRenderAsFormItemValueList.includes(n.valueType)))==null?void 0:r.sort((n,l)=>{let d=u.getColumnOrder(n.order);return u.getColumnOrder(l.order)-d}))==null?void 0:a.map(n=>{const l=u.updateFormProps(n,u.getFieldProps(n.fieldProps));return{...n,fieldProps:{label:n.title,name:n.dataIndex,...l||{},placeholder:u.getPlaceholder(T,n.valueType,l==null?void 0:l.placeholder)}}}))||[]}),I=e.computed(()=>e.unref(f).filter(t=>t.sorter===!0).map(t=>t.dataIndex)),q=e.computed(()=>e.unref(f).filter(t=>t.filters&&!t.onFilter).map(t=>t.dataIndex)),{formRef:m,submit:C,reset:S,tableProps:i,handleTableChange:V,data:g}=A.useTablePaging({async request(t){var a,n;const r=await((a=o.request)==null?void 0:a.call(o,t));return(n=o.onLoad)==null||n.call(o,(r==null?void 0:r.data)||[]),{data:(r==null?void 0:r.data)||[],total:(r==null?void 0:r.total)||0}},filterFields:e.unref(q),sortFields:e.unref(I),defaultParams:o.params,defaultData:o.defaultData,manual:o.manual,defaultCurrent:o.pagination?o.pagination.defaultCurrent:void 0,defaultPageSize:o.pagination?o.pagination.defaultPageSize:void 0,formatParams:o.beforeSearchSubmit}),E=e.computed(()=>o.scroll?o.scroll:o.adaptive&&g.value.total>0?{y:e.unref(k)}:{x:!0}),N=e.computed(()=>({...o,...e.unref(i),loading:x.isUndefined(o.loading)?e.unref(i).loading:o.loading,pagination:o.pagination===!1?!1:e.unref(i).pagination,scroll:e.unref(E)})),z=e.computed(()=>[s(),o.card?null:s("wrapper"),o.adaptive?s("adaptive"):null].filter(Boolean));function L(t,r,a){return c.noRenderAsFormItemValueList.includes(t.valueType)?a:t.copyable||t.ellipsis?e.createVNode(y.Typography.Text,{copyable:t.copyable?{text:r,tooltip:!1}:!1,ellipsis:t.ellipsis?{tooltip:r}:!1,content:a},null):a}e.watch(()=>e.unref(g).loading,t=>{var r;(r=o.onLoadingChange)==null||r.call(o,t)});function O(t){var r,a,n;(n=(a=(r=m.value)==null?void 0:r.apForm)==null?void 0:a.setFieldsValue)==null||n.call(a,t)}function _(){var t,r,a;return(a=(r=(t=m.value)==null?void 0:t.apForm)==null?void 0:r.getFieldsValue)==null?void 0:a.call(r,!0)}return R({submit:()=>C(),reset:()=>S(),setSearchFormValues:O,getSearchFormValues:_,dataSource:e.computed(()=>e.unref(g).records)}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(z.value)},[t.searchForm!==!1&&b.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.card?e.unref(p)("search-wrapper"):null),style:e.normalizeStyle(t.searchFormWrapperStyle)},[e.createVNode(e.unref(W.ApForm).SearchForm,e.mergeProps(t.searchForm||{},{ref_key:"formRef",ref:m,"custom-reset":"",onSubmit:e.unref(C),onReset:e.unref(S),"submit-loading":e.unref(i).loading}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,a=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.customRenderFormItem?a.customRenderFormItem(a):e.unref(c.apTableFormItemMap)[a.valueType||"text"]),e.mergeProps({key:a.dataIndex,ref_for:!0},a.fieldProps||{},{span:a.span}),null,16,["span"]))),128))]),_:2},[h.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["onSubmit","onReset","submit-loading"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"contentRef",ref:v,class:e.normalizeClass([e.unref(p)("table-wrapper"),t.card?e.unref(p)("table-wrapper-card"):null]),style:e.normalizeStyle(t.tableWrapperStyle)},[e.renderSlot(t.$slots,"title"),e.createVNode(e.unref(y.Table),e.mergeProps({class:e.unref(P)==="admin"?e.unref(s)("table-admin"):e.unref(s)("table")},N.value,{onChange:e.unref(V),columns:f.value}),e.createSlots({headerCell:e.withCtx(({column:a,title:n})=>[a.tooltip?(e.openBlock(),e.createElementBlock("span",Q,[e.createElementVNode("span",null,e.toDisplayString(n),1),e.createVNode(e.unref(y.Tooltip),{title:a.tooltip,placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(H.QuestionCircleOutlined),{style:e.normalizeStyle({paddingLeft:"4px",color:e.unref(B).colorPrimary})},null,8,["style"])]),_:2},1032,["title"])])):e.createCommentVNode("",!0)]),_:2},[e.renderList(e.unref(x.omit)(h,["title","searchFormExtra"]),(a,n)=>({name:n,fn:e.withCtx(l=>[e.renderSlot(t.$slots,n,e.normalizeProps(e.guardReactiveProps(l||{})))])}))]),1040,["class","onChange","columns"])],6)],2))}});exports.default=J;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("ant-design-vue"),M=require("ant-design-vue/es/theme/internal"),W=require("../ap-form/index.js"),c=require("./constants.js");require("../config-provider/index.js");const A=require("./hooks/use-table-paging.js"),x=require("lodash-unified");require("./style/ap-table.css");const H=require("@ant-design/icons-vue"),u=require("./utils.js"),K=require("./hooks/use-table-content-height.js"),$=require("../config-provider/hooks/use-locale.js"),G=require("../config-provider/hooks/use-namespace.js"),U=require("../config-provider/hooks/use-global-config.js"),Q={key:0},J=e.defineComponent({name:"ApTable",__name:"ap-table",props:{dropdownPrefixCls:{},loading:{type:[Boolean,Object],default:void 0},bordered:{type:Boolean,default:!1},locale:{},onChange:{},onResizeColumn:{},rowSelection:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},rowKey:{default:"key"},tableLayout:{},rowClassName:{},title:{},footer:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object]},transformCellText:{},columns:{},card:{type:Boolean,default:!1},params:{},searchFormRender:{},request:{},onLoad:{},defaultData:{},onLoadingChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},manual:{type:Boolean,default:!1},size:{default:"middle"},adaptive:{type:Boolean,default:!1}},setup(w,{expose:R}){const o=w,h=e.useSlots(),[,B]=M.useToken(),{t:T}=$.useLocale(),{e:p,b:s}=G.useNamespace("ap-table"),P=U.useGlobalConfig("uiMode","aplus"),{height:k,contentRef:v}=K.default(),f=e.computed(()=>{var r;let t=((r=o.columns)==null?void 0:r.filter(a=>!a.hideInTable))||[];return t=t.map(a=>({...u.apColumnToColumn(a),customRender({value:n,...l}){let d;if(a.customRender)d=a.customRender({value:n,...l,column:a});else{const F=u.getTableRenderType(a),D=c.apTableRenderItemMap[F],j=u.getTableRenderProps(a,{value:n,...l});d=e.createVNode(D,e.mergeProps(j,{mode:"read"}),null)}return L(a,n,d)}})),t}),b=e.computed(()=>{var t,r,a;return((a=(r=(t=o.columns)==null?void 0:t.filter(n=>!n.hideInSearch&&n.dataIndex&&(n.valueType||n.customRenderFormItem)&&!c.noRenderAsFormItemValueList.includes(n.valueType)))==null?void 0:r.sort((n,l)=>{let d=u.getColumnOrder(n.order);return u.getColumnOrder(l.order)-d}))==null?void 0:a.map(n=>{const l=u.updateFormProps(n,u.getFieldProps(n.fieldProps));return{...n,fieldProps:{label:n.title,name:n.dataIndex,...l||{},placeholder:u.getPlaceholder(T,n.valueType,l==null?void 0:l.placeholder)}}}))||[]}),I=e.computed(()=>e.unref(f).filter(t=>t.sorter===!0).map(t=>t.dataIndex)),q=e.computed(()=>e.unref(f).filter(t=>t.filters&&!t.onFilter).map(t=>t.dataIndex)),{formRef:m,submit:C,reset:S,tableProps:i,handleTableChange:V,data:g}=A.useTablePaging({async request(t){var a,n;const r=await((a=o.request)==null?void 0:a.call(o,t));return(n=o.onLoad)==null||n.call(o,(r==null?void 0:r.data)||[]),{data:(r==null?void 0:r.data)||[],total:(r==null?void 0:r.total)||0}},filterFields:e.unref(q),sortFields:e.unref(I),defaultParams:o.params,defaultData:o.defaultData,manual:o.manual,defaultCurrent:o.pagination?o.pagination.defaultCurrent:void 0,defaultPageSize:o.pagination?o.pagination.defaultPageSize:void 0,formatParams:o.beforeSearchSubmit}),E=e.computed(()=>o.scroll?o.scroll:o.adaptive&&g.value.total>0?{y:e.unref(k)}:{x:!0}),N=e.computed(()=>({...o,...e.unref(i),loading:x.isUndefined(o.loading)?e.unref(i).loading:o.loading,pagination:o.pagination===!1?!1:e.unref(i).pagination,scroll:e.unref(E)})),z=e.computed(()=>[s(),o.card?null:s("wrapper"),o.adaptive?s("adaptive"):null].filter(Boolean));function L(t,r,a){return c.noRenderAsFormItemValueList.includes(t.valueType)?a:t.copyable||t.ellipsis?e.createVNode(y.Typography.Text,{copyable:t.copyable?{text:r,tooltip:!1}:!1,ellipsis:t.ellipsis?{tooltip:r}:!1,content:a},null):a}e.watch(()=>e.unref(g).loading,t=>{var r;(r=o.onLoadingChange)==null||r.call(o,t)});function O(t){var r,a,n;(n=(a=(r=m.value)==null?void 0:r.apForm)==null?void 0:a.setFieldsValue)==null||n.call(a,t)}function _(){var t,r,a;return(a=(r=(t=m.value)==null?void 0:t.apForm)==null?void 0:r.getFieldsValue)==null?void 0:a.call(r,!0)}return R({submit:()=>C(),reset:()=>S(),setSearchFormValues:O,getSearchFormValues:_,dataSource:e.computed(()=>e.unref(g).records)}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(z.value)},[t.searchForm!==!1&&b.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.card?e.unref(p)("search-wrapper"):null),style:e.normalizeStyle(t.searchFormWrapperStyle)},[e.createVNode(e.unref(W.ApForm).SearchForm,e.mergeProps(t.searchForm||{},{ref_key:"formRef",ref:m,"custom-reset":"",onSubmit:e.unref(C),onReset:e.unref(S),"submit-loading":e.unref(i).loading}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,a=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.customRenderFormItem?a.customRenderFormItem(a):e.unref(c.apTableFormItemMap)[a.valueType||"text"]),e.mergeProps({key:a.dataIndex,ref_for:!0},a.fieldProps||{},{span:a.span}),null,16,["span"]))),128))]),_:2},[h.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["onSubmit","onReset","submit-loading"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"contentRef",ref:v,class:e.normalizeClass([e.unref(p)("table-wrapper"),t.card?e.unref(p)("table-wrapper-card"):null]),style:e.normalizeStyle(t.tableWrapperStyle)},[e.renderSlot(t.$slots,"title"),e.createVNode(e.unref(y.Table),e.mergeProps({class:e.unref(P)==="admin"?e.unref(s)("table-admin"):e.unref(s)("table")},N.value,{onChange:e.unref(V),columns:f.value}),e.createSlots({headerCell:e.withCtx(({column:a,title:n})=>[a.tooltip?(e.openBlock(),e.createElementBlock("span",Q,[e.createElementVNode("span",null,e.toDisplayString(n),1),e.createVNode(e.unref(y.Tooltip),{title:a.tooltip,placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(H.QuestionCircleOutlined),{style:e.normalizeStyle({paddingLeft:"4px",color:e.unref(B).colorPrimary})},null,8,["style"])]),_:2},1032,["title"])])):e.createCommentVNode("",!0)]),_:2},[e.renderList(e.unref(x.omit)(h,["title","searchFormExtra"]),(a,n)=>({name:n,fn:e.withCtx(l=>[e.renderSlot(t.$slots,n,e.normalizeProps(e.guardReactiveProps(l||{})))])}))]),1040,["class","onChange","columns"])],6)],2))}});exports.default=J;
|