@cloudbase/weda-ui 3.14.2 → 3.15.0
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/configs/components/listView.d.ts +11 -0
- package/dist/configs/components/listView.js +53 -0
- package/dist/configs/components/wd-select-multiple.d.ts +72 -28
- package/dist/configs/components/wd-select-multiple.js +233 -19
- package/dist/configs/components/wd-select.d.ts +70 -29
- package/dist/configs/components/wd-select.js +211 -17
- package/dist/configs/index.d.ts +174 -60
- package/dist/configs/type-utils/type-form.js +65 -21
- package/dist/configs/type-utils/x-runtime-default.d.ts +2 -0
- package/dist/configs/type-utils/x-runtime-default.js +4 -0
- package/dist/style/index.css +15 -0
- package/dist/style/index.scss +1 -1
- package/dist/style/weda-ui.min.css +3 -3
- package/dist/web/components/form/uploader/uploader.h5.js +9 -10
- package/dist/web/components/form/uploader/uploader.pc.js +7 -7
- package/dist/web/components/form/uploader/util.js +7 -12
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +29 -37
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +15 -22
- package/dist/web/components/listView/index.css +4 -2
- package/dist/web/components/listView/index.js +25 -43
- package/dist/web/components/richText/index.js +13 -15
- package/dist/web/components/statusContent/index.js +1 -1
- package/dist/web/components/wd-input/wd-input.js +16 -20
- package/dist/web/components/wd-select/contexts/selectContext.d.ts +15 -0
- package/dist/web/components/wd-select/contexts/selectContext.js +13 -0
- package/dist/web/components/wd-select/hooks/useChooseList.d.ts +19 -0
- package/dist/web/components/wd-select/hooks/useChooseList.js +94 -0
- package/dist/web/components/wd-select/relationSelect/enumSelect.d.ts +2 -0
- package/dist/web/components/wd-select/relationSelect/enumSelect.js +48 -0
- package/dist/web/components/wd-select/relationSelect/index.d.ts +2 -0
- package/dist/web/components/wd-select/relationSelect/index.js +19 -0
- package/dist/web/components/wd-select/relationSelect/queryParams.d.ts +15 -0
- package/dist/web/components/wd-select/relationSelect/queryParams.js +15 -0
- package/dist/web/components/wd-select/relationSelect/relationSelect.d.ts +0 -2
- package/dist/web/components/wd-select/relationSelect/relationSelect.js +39 -83
- package/dist/web/components/wd-select/select/index.js +1 -1
- package/dist/web/components/wd-select/wd-select.css +8 -0
- package/dist/web/components/wd-select/wd-select.js +11 -8
- package/dist/web/components/wd-select-multiple/wd-select-multiple.js +11 -8
- package/dist/web/components/wd-table/components/FieldRender/index.js +3 -3
- package/dist/web/components/wd-table/components/FilterFieldsPanel/filterFieldsGenerate.js +8 -13
- package/dist/web/components/wd-table/components/deleteModal.d.ts +1 -1
- package/dist/web/components/wd-table/components/deleteModal.js +47 -30
- package/dist/web/utils/getModelParams.d.ts +6 -1
- package/dist/web/utils/getModelParams.js +16 -13
- package/dist/web/utils/platform.js +9 -13
- package/dist/web/utils/tcb.d.ts +4 -0
- package/dist/web/utils/tcb.js +11 -9
- package/package.json +3 -3
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import { Static } from '../type-utils';
|
|
2
2
|
import type { Simplify } from 'type-fest';
|
|
3
3
|
declare const data: import("@sinclair/typebox").TObject<{
|
|
4
|
-
selectFieldType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
5
|
-
selectFields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
6
|
-
enableRelationalSetting: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
7
|
-
enableRelationalRefresh: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
8
|
-
enableAddRelationButton: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
9
|
-
addRelationButtonText: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
10
|
-
enableRelationOptionJump: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
11
|
-
enableRelationTag: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
12
4
|
suffixType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
13
5
|
status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
14
6
|
required: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
15
7
|
requiredMsg: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
16
8
|
requiredFlag: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
9
|
+
staticSearchable: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
17
10
|
extra: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
18
11
|
after: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
19
12
|
before: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -32,24 +25,50 @@ declare const data: import("@sinclair/typebox").TObject<{
|
|
|
32
25
|
layout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
33
26
|
labelWidth: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
34
27
|
labelTips: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
35
|
-
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString
|
|
28
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
29
|
+
'x-index': number;
|
|
30
|
+
}>;
|
|
36
31
|
range: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
37
32
|
label: import("@sinclair/typebox").TString;
|
|
38
33
|
value: import("@sinclair/typebox").TString;
|
|
39
34
|
disabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
35
|
+
}>> & {
|
|
36
|
+
'x-index': number;
|
|
37
|
+
}>;
|
|
38
|
+
tipBlock: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
39
|
+
'x-index': number;
|
|
40
|
+
}>;
|
|
41
|
+
supportManyRelated: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
42
|
+
where: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny> & {
|
|
43
|
+
'x-index': number;
|
|
44
|
+
}>;
|
|
45
|
+
queryCondition: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{}>>;
|
|
46
|
+
sorter: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
47
|
+
orderBy: import("@sinclair/typebox").TString;
|
|
48
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
49
|
+
orderType: import("@sinclair/typebox").TUnsafe<string>;
|
|
40
50
|
}>>>;
|
|
41
|
-
tipBlock: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
42
|
-
where: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>>;
|
|
43
51
|
value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
44
52
|
title: string;
|
|
53
|
+
'x-index': number;
|
|
45
54
|
}>;
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
selectFieldType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
56
|
+
selectFields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
57
|
+
size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
48
58
|
placeholder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
49
59
|
default: string;
|
|
60
|
+
'x-index': number;
|
|
50
61
|
}>;
|
|
51
62
|
searchPlaceholder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
52
|
-
|
|
63
|
+
ignoreCase: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean & {
|
|
64
|
+
'x-index': number;
|
|
65
|
+
}>;
|
|
66
|
+
enableRelationalSetting: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
67
|
+
enableRelationalRefresh: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
68
|
+
enableAddRelationButton: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
69
|
+
addRelationButtonText: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
70
|
+
enableRelationOptionJump: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
71
|
+
enableRelationTag: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
53
72
|
format: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
54
73
|
viewId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
55
74
|
enumName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -59,19 +78,12 @@ declare const data: import("@sinclair/typebox").TObject<{
|
|
|
59
78
|
declare const config: {
|
|
60
79
|
readonly $schema: "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json";
|
|
61
80
|
readonly data: import("@sinclair/typebox").TObject<{
|
|
62
|
-
selectFieldType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
63
|
-
selectFields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
64
|
-
enableRelationalSetting: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
65
|
-
enableRelationalRefresh: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
66
|
-
enableAddRelationButton: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
67
|
-
addRelationButtonText: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
68
|
-
enableRelationOptionJump: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
69
|
-
enableRelationTag: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
70
81
|
suffixType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
71
82
|
status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
72
83
|
required: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
73
84
|
requiredMsg: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
74
85
|
requiredFlag: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
86
|
+
staticSearchable: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
75
87
|
extra: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
76
88
|
after: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
77
89
|
before: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -90,24 +102,50 @@ declare const config: {
|
|
|
90
102
|
layout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
91
103
|
labelWidth: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
92
104
|
labelTips: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
93
|
-
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString
|
|
105
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
106
|
+
'x-index': number;
|
|
107
|
+
}>;
|
|
94
108
|
range: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
95
109
|
label: import("@sinclair/typebox").TString;
|
|
96
110
|
value: import("@sinclair/typebox").TString;
|
|
97
111
|
disabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
112
|
+
}>> & {
|
|
113
|
+
'x-index': number;
|
|
114
|
+
}>;
|
|
115
|
+
tipBlock: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
116
|
+
'x-index': number;
|
|
117
|
+
}>;
|
|
118
|
+
supportManyRelated: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
119
|
+
where: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny> & {
|
|
120
|
+
'x-index': number;
|
|
121
|
+
}>;
|
|
122
|
+
queryCondition: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{}>>;
|
|
123
|
+
sorter: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
124
|
+
orderBy: import("@sinclair/typebox").TString;
|
|
125
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
126
|
+
orderType: import("@sinclair/typebox").TUnsafe<string>;
|
|
98
127
|
}>>>;
|
|
99
|
-
tipBlock: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
100
|
-
where: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny>>;
|
|
101
128
|
value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
102
129
|
title: string;
|
|
130
|
+
'x-index': number;
|
|
103
131
|
}>;
|
|
104
|
-
|
|
105
|
-
|
|
132
|
+
selectFieldType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
133
|
+
selectFields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
134
|
+
size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
106
135
|
placeholder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
107
136
|
default: string;
|
|
137
|
+
'x-index': number;
|
|
108
138
|
}>;
|
|
109
139
|
searchPlaceholder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
110
|
-
|
|
140
|
+
ignoreCase: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean & {
|
|
141
|
+
'x-index': number;
|
|
142
|
+
}>;
|
|
143
|
+
enableRelationalSetting: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
144
|
+
enableRelationalRefresh: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
145
|
+
enableAddRelationButton: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
146
|
+
addRelationButtonText: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
147
|
+
enableRelationOptionJump: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
148
|
+
enableRelationTag: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
111
149
|
format: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
112
150
|
viewId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
113
151
|
enumName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -115,10 +153,13 @@ declare const config: {
|
|
|
115
153
|
dataSourceName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
116
154
|
}>;
|
|
117
155
|
readonly properties: import("@sinclair/typebox").TObject<{
|
|
118
|
-
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString
|
|
156
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
157
|
+
'x-index': number;
|
|
158
|
+
}>;
|
|
119
159
|
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
120
160
|
value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
121
161
|
title: string;
|
|
162
|
+
'x-index': number;
|
|
122
163
|
}>;
|
|
123
164
|
required: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
124
165
|
disabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineConfig, Type } from '../type-utils';
|
|
2
|
+
import { SINGLE_FOREIGN_FORMATS } from '../type-utils/x-runtime-default';
|
|
2
3
|
import { FORM_ITEM_DATA, FORM_ITEM_METHODS, FORM_ITEM_META, ItemData, pickWithXCategory, X_CATEGORY, getFormItemDataTitle, } from '../type-utils/type-form';
|
|
3
4
|
import { getClasses } from '../type-utils/classes';
|
|
4
5
|
import { templateInitNameWithId } from './common/init-name-with-id';
|
|
@@ -19,25 +20,224 @@ const TITLE = getFormItemDataTitle('下拉单选');
|
|
|
19
20
|
// 属性类型定义
|
|
20
21
|
const data = Type.Partial(Type.Object({
|
|
21
22
|
// 通用
|
|
22
|
-
name: FORM_ITEM_DATA.name,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
name: Object.assign({}, FORM_ITEM_DATA.name, { 'x-index': 1 }),
|
|
24
|
+
// label: x-index:11
|
|
25
|
+
range: Object.assign({}, FORM_ITEM_DATA.range, { 'x-index': 12 }),
|
|
26
|
+
tipBlock: Object.assign({}, FORM_ITEM_DATA.tipBlock, { 'x-index': 13 }),
|
|
27
|
+
supportManyRelated: Type.Boolean({
|
|
28
|
+
title: '升级筛选器',
|
|
29
|
+
type: 'boolean',
|
|
30
|
+
default: false,
|
|
31
|
+
'x-props': { 'data-hidebind': true },
|
|
32
|
+
'x-index': 14,
|
|
33
|
+
'x-category': X_CATEGORY.COMMON,
|
|
34
|
+
description: '开启后,筛选器支持自定义筛选条件',
|
|
35
|
+
'x-linkages': [
|
|
36
|
+
{
|
|
37
|
+
type: 'value:visible',
|
|
38
|
+
target: 'queryCondition',
|
|
39
|
+
condition: `{{Boolean($self.value)&&${SINGLE_FOREIGN_FORMATS('$form.values.format')}}}`,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: 'value:visible',
|
|
43
|
+
target: 'where',
|
|
44
|
+
condition: `{{!Boolean($self.value)&&${SINGLE_FOREIGN_FORMATS('$form.values.format')}}}`,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
}),
|
|
48
|
+
where: Object.assign({}, FORM_ITEM_DATA.where, {
|
|
49
|
+
'x-index': 15,
|
|
50
|
+
}),
|
|
51
|
+
queryCondition: Type.Object({}, {
|
|
52
|
+
title: '数据筛选',
|
|
53
|
+
type: 'boolean',
|
|
54
|
+
default: true,
|
|
55
|
+
'x-index': 16,
|
|
56
|
+
'x-category': X_CATEGORY.COMMON,
|
|
57
|
+
'x-component': 'datasource-condition-where-query-editor',
|
|
58
|
+
'x-component-props': {
|
|
59
|
+
propertyPath: 'queryCondition',
|
|
60
|
+
dataSourcePath: 'dataSourceName',
|
|
61
|
+
preWherePath: 'where',
|
|
62
|
+
enableKeyIsRelation: true,
|
|
63
|
+
},
|
|
64
|
+
'x-props': {
|
|
65
|
+
'data-hidebind': false,
|
|
66
|
+
'data-hideBindValue': true,
|
|
67
|
+
'data-withBindMeta': true,
|
|
68
|
+
},
|
|
69
|
+
description: '对数据进行筛选过滤',
|
|
70
|
+
'x-helper-text': '点击fx支持编辑数据筛选表达式 [查看格式](https://docs.cloudbase.net/lowcode/manage/datasource-v2#%E6%9F%A5%E8%AF%A2wedagetitemv2)',
|
|
71
|
+
}),
|
|
72
|
+
// 支持多字段筛选
|
|
73
|
+
sorter: Type.Optional(Type.Array(Type.Object({
|
|
74
|
+
orderBy: Type.String({
|
|
75
|
+
title: '排序字段',
|
|
76
|
+
default: '',
|
|
77
|
+
'x-props': {
|
|
78
|
+
clearable: true,
|
|
79
|
+
},
|
|
80
|
+
}),
|
|
81
|
+
label: Type.Optional(Type.String({
|
|
82
|
+
title: '排序字段名称',
|
|
83
|
+
})),
|
|
84
|
+
orderType: Type.StringEnum({
|
|
85
|
+
title: '排序方式',
|
|
86
|
+
type: 'string',
|
|
87
|
+
enum: [
|
|
88
|
+
{
|
|
89
|
+
label: '升序',
|
|
90
|
+
value: 'asc',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
label: '降序',
|
|
94
|
+
value: 'desc',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
'x-props': {
|
|
98
|
+
clearable: true,
|
|
99
|
+
},
|
|
100
|
+
}),
|
|
101
|
+
}, {
|
|
102
|
+
title: 'tabs',
|
|
103
|
+
default: {
|
|
104
|
+
orderBy: '',
|
|
105
|
+
orderType: '',
|
|
106
|
+
},
|
|
107
|
+
}), {
|
|
108
|
+
title: '数据排序',
|
|
109
|
+
'x-index': 17,
|
|
110
|
+
'x-component': 'list',
|
|
111
|
+
'x-component-props': {
|
|
112
|
+
label_add: '添加排序规则',
|
|
113
|
+
},
|
|
114
|
+
'x-category': X_CATEGORY.COMMON,
|
|
115
|
+
'x-props': {
|
|
116
|
+
'data-withBindMeta': true,
|
|
117
|
+
},
|
|
118
|
+
'x-linkages': [
|
|
119
|
+
{
|
|
120
|
+
type: 'value:schema',
|
|
121
|
+
condition: '{{ Boolean($form?.values?.dataSourceName) }}',
|
|
122
|
+
target: 'sorter',
|
|
123
|
+
schema: {
|
|
124
|
+
items: {
|
|
125
|
+
path: 'sorter.*',
|
|
126
|
+
type: 'object',
|
|
127
|
+
default: {
|
|
128
|
+
orderBy: '',
|
|
129
|
+
orderType: 'asc',
|
|
130
|
+
label: '',
|
|
131
|
+
},
|
|
132
|
+
'x-display': "(!this.orderBy)?'请选择排序字段':(this.label||this.orderBy)+'-'+(({desc:'降序',asc:'升序'})[this.orderType]||'')",
|
|
133
|
+
properties: {
|
|
134
|
+
orderBy: {
|
|
135
|
+
type: 'string',
|
|
136
|
+
title: '排序字段',
|
|
137
|
+
'x-option': '{{getDataSourceValueOptions($form?.values?.dataSourceName, undefined, true)}}',
|
|
138
|
+
'x-sorter': '{{$form?.values.sorter}}',
|
|
139
|
+
'x-linkages': [
|
|
140
|
+
{
|
|
141
|
+
type: 'value:state',
|
|
142
|
+
target: 'dataForm.label',
|
|
143
|
+
condition: '{{ Boolean($self.value)}}',
|
|
144
|
+
state: {
|
|
145
|
+
value: '{{$self.props["x-option"].find(i=>i.value===$self.value)?.label}}',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
type: 'value:schema',
|
|
150
|
+
target: 'dataForm.orderBy',
|
|
151
|
+
schema: {
|
|
152
|
+
enum: '{{$self.props["x-option"].filter(i=>i.value===$self.value||!$self.props["x-sorter"].find(j=>j.orderBy===i.value))}}',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
label: Type.Optional(Type.String({
|
|
158
|
+
type: 'string',
|
|
159
|
+
title: '排序字段名称',
|
|
160
|
+
display: false,
|
|
161
|
+
})),
|
|
162
|
+
orderType: Type.StringEnum({
|
|
163
|
+
title: '排序方式',
|
|
164
|
+
type: 'string',
|
|
165
|
+
'x-component': 'radio',
|
|
166
|
+
enum: [
|
|
167
|
+
{
|
|
168
|
+
label: '升序',
|
|
169
|
+
value: 'asc',
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
label: '降序',
|
|
173
|
+
value: 'desc',
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
'x-props': {
|
|
177
|
+
clearable: true,
|
|
178
|
+
},
|
|
179
|
+
}),
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
type: 'value:schema',
|
|
186
|
+
condition: '{{$self.value?.length>2}}',
|
|
187
|
+
target: 'sorter',
|
|
188
|
+
schema: {
|
|
189
|
+
'x-component-props': {
|
|
190
|
+
label_add: '添加排序规则',
|
|
191
|
+
addDisabledTip: '最多添加3个排序规则,请先删减已有规则',
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
type: 'value:schema',
|
|
197
|
+
condition: '{{$self.value?.length<3}}',
|
|
198
|
+
target: 'sorter',
|
|
199
|
+
schema: {
|
|
200
|
+
'x-component-props': {
|
|
201
|
+
label_add: '添加排序规则',
|
|
202
|
+
addDisabledTip: '',
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
default: [
|
|
208
|
+
{
|
|
209
|
+
orderBy: 'updatedAt',
|
|
210
|
+
orderType: 'desc',
|
|
211
|
+
label: '更新时间',
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
description: '可设置数据排序规则,支持拖拽调整排序优先级,数组下标越小优先级越高。绑定数据示例:[{"orderBy":"updatedAt","orderType":"desc"}],升序传值asc,降序传值desc',
|
|
215
|
+
})),
|
|
216
|
+
value: Object.assign({}, FORM_ITEM_DATA.value, { title: '选中值', 'x-index': 18 }),
|
|
217
|
+
selectFieldType: FORM_ITEM_DATA.selectFieldType,
|
|
218
|
+
selectFields: FORM_ITEM_DATA.selectFields,
|
|
219
|
+
size: FORM_ITEM_DATA.size,
|
|
29
220
|
placeholder: Object.assign({}, FORM_ITEM_DATA.placeholder, {
|
|
30
221
|
default: '请选择',
|
|
222
|
+
'x-index': 41,
|
|
31
223
|
}),
|
|
32
224
|
searchPlaceholder: Type.String({
|
|
33
225
|
title: '搜索框占位文字',
|
|
34
226
|
type: 'string',
|
|
35
227
|
default: '搜索选项',
|
|
36
|
-
'x-index':
|
|
228
|
+
'x-index': 42,
|
|
37
229
|
'x-category': X_CATEGORY.COMMON,
|
|
38
230
|
'x-helper-text': 'PC/H5端生效',
|
|
39
231
|
}),
|
|
40
|
-
|
|
232
|
+
ignoreCase: Object.assign({}, FORM_ITEM_DATA.ignoreCase, {
|
|
233
|
+
'x-index': 43,
|
|
234
|
+
}),
|
|
235
|
+
enableRelationalSetting: FORM_ITEM_DATA.enableRelationalSetting,
|
|
236
|
+
enableRelationalRefresh: FORM_ITEM_DATA.enableRelationalRefresh,
|
|
237
|
+
enableAddRelationButton: FORM_ITEM_DATA.enableAddRelationButton,
|
|
238
|
+
addRelationButtonText: FORM_ITEM_DATA.addRelationButtonText,
|
|
239
|
+
enableRelationOptionJump: FORM_ITEM_DATA.enableRelationOptionJump,
|
|
240
|
+
enableRelationTag: FORM_ITEM_DATA.enableRelationTag,
|
|
41
241
|
format: FORM_ITEM_DATA._formatInSelect,
|
|
42
242
|
viewId: FORM_ITEM_DATA.viewId,
|
|
43
243
|
enumName: FORM_ITEM_DATA.enumName,
|
|
@@ -47,20 +247,14 @@ const data = Type.Partial(Type.Object({
|
|
|
47
247
|
...TITLE,
|
|
48
248
|
// 选择框
|
|
49
249
|
...SELECT,
|
|
50
|
-
selectFieldType: FORM_ITEM_DATA.selectFieldType,
|
|
51
|
-
selectFields: FORM_ITEM_DATA.selectFields,
|
|
52
|
-
enableRelationalSetting: FORM_ITEM_DATA.enableRelationalSetting,
|
|
53
|
-
enableRelationalRefresh: FORM_ITEM_DATA.enableRelationalRefresh,
|
|
54
|
-
enableAddRelationButton: FORM_ITEM_DATA.enableAddRelationButton,
|
|
55
|
-
addRelationButtonText: FORM_ITEM_DATA.addRelationButtonText,
|
|
56
|
-
enableRelationOptionJump: FORM_ITEM_DATA.enableRelationOptionJump,
|
|
57
|
-
enableRelationTag: FORM_ITEM_DATA.enableRelationTag,
|
|
58
250
|
suffixType: FORM_ITEM_DATA._suffixTypeInSelect,
|
|
59
251
|
// 状态校验
|
|
60
252
|
status: FORM_ITEM_DATA.status,
|
|
61
253
|
required: FORM_ITEM_DATA.required,
|
|
62
254
|
requiredMsg: FORM_ITEM_DATA.requiredMsg,
|
|
63
255
|
requiredFlag: FORM_ITEM_DATA.requiredFlag,
|
|
256
|
+
// 废弃属性
|
|
257
|
+
staticSearchable: FORM_ITEM_DATA.staticSearchable,
|
|
64
258
|
}));
|
|
65
259
|
const properties = Type.Composite([
|
|
66
260
|
Type.Pick(data, ['name', 'value', 'label', 'required']),
|