@byteluck-fe/model-driven-core 3.0.0-beta.5 → 4.34.0-lx1
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/esm/common/BaseControl/designer.js +1 -7
- package/dist/esm/common/BaseControl/property.js +0 -5
- package/dist/esm/common/ColumnControl/property.js +6 -6
- package/dist/esm/common/FormControl/property.js +32 -15
- package/dist/esm/common/ListControl/designer.js +10 -8
- package/dist/esm/common/initLinkOperationRules.js +2 -2
- package/dist/esm/common/initOptionAndDataSourceRules.js +30 -31
- package/dist/esm/framework/RegisterControls.js +13 -13
- package/dist/esm/framework/index.js +17 -127
- package/dist/index.umd.js +1 -1
- package/dist/types/common/BaseControl/designer.d.ts +0 -8
- package/dist/types/common/BaseControl/property.d.ts +0 -6
- package/dist/types/common/FormControl/property.d.ts +18 -0
- package/dist/types/framework/index.d.ts +13 -77
- package/dist/types/framework/isDataBind.d.ts +1 -1
- package/package.json +34 -34
|
@@ -235,12 +235,10 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
235
235
|
_define_property(this, "eventKeys", []);
|
|
236
236
|
_define_property(this, "customEvents", []);
|
|
237
237
|
_define_property(this, "parent", null);
|
|
238
|
-
_define_property(this, "slots", void 0);
|
|
239
|
-
_define_property(this, "slotPosition", void 0);
|
|
240
238
|
_define_property(this, "updateSetting", updateSetting);
|
|
241
239
|
_define_property(this, "removeSetting", removeSetting);
|
|
242
240
|
this._callControlHooks('preInstance', props);
|
|
243
|
-
var _ref = _instanceof(this, Control) ? this.constructor : void 0, controlName = _ref.controlName, controlIcon = _ref.controlIcon, controlType = _ref.controlType, controlFieldType = _ref.controlFieldType, controlEventKeys = _ref.controlEventKeys, controlCustomEvents = _ref.controlCustomEvents, name = _ref.name, setting = _ref.setting
|
|
241
|
+
var _ref = _instanceof(this, Control) ? this.constructor : void 0, controlName = _ref.controlName, controlIcon = _ref.controlIcon, controlType = _ref.controlType, controlFieldType = _ref.controlFieldType, controlEventKeys = _ref.controlEventKeys, controlCustomEvents = _ref.controlCustomEvents, name = _ref.name, setting = _ref.setting;
|
|
244
242
|
if (!(controlName && controlIcon && controlType)) {
|
|
245
243
|
referenceError("The ".concat(name, " controlName,controlIcon,controlType is not define"));
|
|
246
244
|
}
|
|
@@ -258,8 +256,6 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
258
256
|
this.fieldType = (_props_fieldType = props === null || props === void 0 ? void 0 : props.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
|
|
259
257
|
this.eventKeys = JSONCopy(controlEventKeys);
|
|
260
258
|
this.customEvents = JSONCopy(controlCustomEvents);
|
|
261
|
-
this.slots = JSONCopy(slots);
|
|
262
|
-
this.slotPosition = JSONCopy(slotPosition);
|
|
263
259
|
Promise.resolve().then(function() {
|
|
264
260
|
_this._callControlHooks('postInstance', props);
|
|
265
261
|
});
|
|
@@ -484,8 +480,6 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
484
480
|
return Control;
|
|
485
481
|
}();
|
|
486
482
|
_define_property(Control, "mode", 'Designer');
|
|
487
|
-
_define_property(Control, "slots", void 0);
|
|
488
|
-
_define_property(Control, "slotPosition", void 0);
|
|
489
483
|
_define_property(Control, "controlName", '控件');
|
|
490
484
|
_define_property(Control, "controlIcon", 'icon');
|
|
491
485
|
_define_property(Control, "controlType", 'control');
|
|
@@ -152,11 +152,6 @@ var PropertyRuntimeRules = /*#__PURE__*/ function(Array1) {
|
|
|
152
152
|
* @public
|
|
153
153
|
* @defaultValue ''
|
|
154
154
|
*/ _define_property(this, "caption", void 0);
|
|
155
|
-
/**
|
|
156
|
-
* 标题
|
|
157
|
-
* @public
|
|
158
|
-
* @defaultValue ''
|
|
159
|
-
*/ _define_property(this, "defaultState", void 0);
|
|
160
155
|
var _props_isHide;
|
|
161
156
|
this.isHide = (_props_isHide = props === null || props === void 0 ? void 0 : props.isHide) !== null && _props_isHide !== void 0 ? _props_isHide : false;
|
|
162
157
|
this.style = new BaseStyle(props === null || props === void 0 ? void 0 : props.style);
|
|
@@ -71,9 +71,9 @@ function _is_native_reflect_construct() {
|
|
|
71
71
|
})();
|
|
72
72
|
}
|
|
73
73
|
import { Property, PropertyRules } from '../BaseControl';
|
|
74
|
+
import { RulesMessage } from '@byteluck-fe/model-driven-shared';
|
|
74
75
|
import { initOptionAndDataSourceRules } from '../initOptionAndDataSourceRules';
|
|
75
76
|
import { DataBind, AutoWidth } from '../../framework';
|
|
76
|
-
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
77
77
|
var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
78
78
|
"use strict";
|
|
79
79
|
_inherits(ColumnControlPropertyRules, PropertyRules);
|
|
@@ -85,11 +85,11 @@ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
85
85
|
]), _define_property(_this, "caption", {
|
|
86
86
|
type: 'string',
|
|
87
87
|
required: true,
|
|
88
|
-
message:
|
|
88
|
+
message: RulesMessage.getMessage('pleaseEnterCaption')
|
|
89
89
|
}), _define_property(_this, "width", {
|
|
90
90
|
type: 'number',
|
|
91
91
|
required: false,
|
|
92
|
-
message:
|
|
92
|
+
message: RulesMessage.getMessage('pleaseEnterColumnWidth')
|
|
93
93
|
});
|
|
94
94
|
_this.width.required = props.widthType === 'px';
|
|
95
95
|
return _this;
|
|
@@ -168,16 +168,16 @@ var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnContro
|
|
|
168
168
|
'datasource',
|
|
169
169
|
'none'
|
|
170
170
|
],
|
|
171
|
-
message:
|
|
171
|
+
message: RulesMessage.getMessage('PleaseSelectTheCorrectOptionSettings')
|
|
172
172
|
}), _define_property(_this, "options", [
|
|
173
173
|
{
|
|
174
174
|
type: 'array',
|
|
175
|
-
message:
|
|
175
|
+
message: RulesMessage.getMessage('isNotArray')
|
|
176
176
|
}
|
|
177
177
|
]), _define_property(_this, "datasourceBind", [
|
|
178
178
|
{
|
|
179
179
|
type: 'object',
|
|
180
|
-
message:
|
|
180
|
+
message: RulesMessage.getMessage('isNotObject')
|
|
181
181
|
}
|
|
182
182
|
]);
|
|
183
183
|
initOptionAndDataSourceRules.call(_this, props);
|
|
@@ -70,12 +70,11 @@ function _is_native_reflect_construct() {
|
|
|
70
70
|
return !!result;
|
|
71
71
|
})();
|
|
72
72
|
}
|
|
73
|
-
import { JSONCopy } from '@byteluck-fe/model-driven-shared';
|
|
73
|
+
import { RulesMessage, JSONCopy } from '@byteluck-fe/model-driven-shared';
|
|
74
74
|
import { Property, PropertyRules, PropertyRuntimeRules } from '../BaseControl';
|
|
75
75
|
import { initOptionAndDataSourceRules } from '../initOptionAndDataSourceRules';
|
|
76
76
|
import { DataBind } from '../../framework';
|
|
77
77
|
import { isDataBind } from '../../framework/isDataBind';
|
|
78
|
-
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
79
78
|
var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
80
79
|
"use strict";
|
|
81
80
|
_inherits(BaseControlPropertyRules, PropertyRules);
|
|
@@ -87,7 +86,7 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
87
86
|
]), _define_property(_this, "dataBind", {}), _define_property(_this, "caption", {
|
|
88
87
|
type: 'string',
|
|
89
88
|
required: true,
|
|
90
|
-
message:
|
|
89
|
+
message: RulesMessage.getMessage('pleaseEnterCaption')
|
|
91
90
|
}), _define_property(_this, "isHideCaption", {
|
|
92
91
|
type: 'boolean'
|
|
93
92
|
}), _define_property(_this, "labelPosition", {
|
|
@@ -100,7 +99,7 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
100
99
|
// public placeholder: RuleItem = {
|
|
101
100
|
// required: true,
|
|
102
101
|
// type: 'string',
|
|
103
|
-
// message:
|
|
102
|
+
// message: RulesMessage.getMessage('pleaseEnterPlaceholder'),
|
|
104
103
|
// }
|
|
105
104
|
_define_property(_this, "defaultState", {
|
|
106
105
|
type: 'enum',
|
|
@@ -113,19 +112,19 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
113
112
|
}), _define_property(_this, "captionTip", {
|
|
114
113
|
type: 'string',
|
|
115
114
|
required: false,
|
|
116
|
-
message:
|
|
115
|
+
message: RulesMessage.getMessage('pleaseEnterCaptionTip')
|
|
117
116
|
});
|
|
118
117
|
// 初始化dataBind的校验规则
|
|
119
118
|
var validateFields = {
|
|
120
119
|
fieldCode: {
|
|
121
120
|
type: 'string',
|
|
122
121
|
required: true,
|
|
123
|
-
message:
|
|
122
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
124
123
|
},
|
|
125
124
|
dataCode: {
|
|
126
125
|
type: 'string',
|
|
127
126
|
required: true,
|
|
128
|
-
message:
|
|
127
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
129
128
|
}
|
|
130
129
|
};
|
|
131
130
|
// if (props.dataBind instanceof DataBind) {
|
|
@@ -134,14 +133,14 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
134
133
|
type: 'object',
|
|
135
134
|
required: true,
|
|
136
135
|
fields: JSONCopy(validateFields),
|
|
137
|
-
message:
|
|
136
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
138
137
|
};
|
|
139
138
|
} else {
|
|
140
139
|
var dataBind = {
|
|
141
140
|
type: 'object',
|
|
142
141
|
required: true,
|
|
143
142
|
fields: {},
|
|
144
|
-
message:
|
|
143
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
145
144
|
};
|
|
146
145
|
Object.keys(props.dataBind).forEach(function(key) {
|
|
147
146
|
;
|
|
@@ -149,7 +148,7 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
149
148
|
type: 'object',
|
|
150
149
|
required: true,
|
|
151
150
|
fields: JSONCopy(validateFields),
|
|
152
|
-
message:
|
|
151
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
153
152
|
};
|
|
154
153
|
});
|
|
155
154
|
_this.dataBind = dataBind;
|
|
@@ -175,9 +174,9 @@ var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRule
|
|
|
175
174
|
_this.push({
|
|
176
175
|
type: 'string',
|
|
177
176
|
required: isRequired,
|
|
178
|
-
message: props.requiredMessage !== '' ? props.requiredMessage :
|
|
177
|
+
message: props.requiredMessage !== '' ? props.requiredMessage : RulesMessage.getMessage('runtimeRequired', {
|
|
179
178
|
caption: props.caption
|
|
180
|
-
}
|
|
179
|
+
})
|
|
181
180
|
});
|
|
182
181
|
}
|
|
183
182
|
return _this;
|
|
@@ -200,6 +199,18 @@ var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRule
|
|
|
200
199
|
* @defaultValue ''
|
|
201
200
|
* @public
|
|
202
201
|
*/ _define_property(_this, "caption", void 0), /**
|
|
202
|
+
* 标题大小
|
|
203
|
+
* @defaultValue ''
|
|
204
|
+
* @public
|
|
205
|
+
*/ _define_property(_this, "captionSize", void 0), /**
|
|
206
|
+
* 标题颜色
|
|
207
|
+
* @defaultValue ''
|
|
208
|
+
* @public
|
|
209
|
+
*/ _define_property(_this, "captionColor", void 0), /**
|
|
210
|
+
* 标题斜体
|
|
211
|
+
* @defaultValue false
|
|
212
|
+
* @public
|
|
213
|
+
*/ _define_property(_this, "isCaptionItalic", void 0), /**
|
|
203
214
|
* 隐藏标题
|
|
204
215
|
* @defaultValue false
|
|
205
216
|
* @public
|
|
@@ -239,6 +250,12 @@ var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRule
|
|
|
239
250
|
*/ _define_property(_this, "requiredMessage", void 0);
|
|
240
251
|
var _props_caption;
|
|
241
252
|
_this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : '';
|
|
253
|
+
var _props_captionSize;
|
|
254
|
+
_this.captionSize = (_props_captionSize = props === null || props === void 0 ? void 0 : props.captionSize) !== null && _props_captionSize !== void 0 ? _props_captionSize : '';
|
|
255
|
+
var _props_captionColor;
|
|
256
|
+
_this.captionColor = (_props_captionColor = props === null || props === void 0 ? void 0 : props.captionColor) !== null && _props_captionColor !== void 0 ? _props_captionColor : '';
|
|
257
|
+
var _props_isCaptionItalic;
|
|
258
|
+
_this.isCaptionItalic = (_props_isCaptionItalic = props === null || props === void 0 ? void 0 : props.isCaptionItalic) !== null && _props_isCaptionItalic !== void 0 ? _props_isCaptionItalic : false;
|
|
242
259
|
var _props_isHideCaption;
|
|
243
260
|
_this.isHideCaption = (_props_isHideCaption = props === null || props === void 0 ? void 0 : props.isHideCaption) !== null && _props_isHideCaption !== void 0 ? _props_isHideCaption : false;
|
|
244
261
|
var _props_isShowCaptionTip;
|
|
@@ -279,16 +296,16 @@ var OptionAndDataSourcePropertyRules = /*#__PURE__*/ function(BaseControlPropert
|
|
|
279
296
|
'custom',
|
|
280
297
|
'datasource'
|
|
281
298
|
],
|
|
282
|
-
message:
|
|
299
|
+
message: RulesMessage.getMessage('PleaseSelectTheCorrectOptionSettings')
|
|
283
300
|
}), _define_property(_this, "options", [
|
|
284
301
|
{
|
|
285
302
|
type: 'array',
|
|
286
|
-
message:
|
|
303
|
+
message: RulesMessage.getMessage('isNotArray')
|
|
287
304
|
}
|
|
288
305
|
]), _define_property(_this, "datasourceBind", [
|
|
289
306
|
{
|
|
290
307
|
type: 'object',
|
|
291
|
-
message:
|
|
308
|
+
message: RulesMessage.getMessage('isNotObject')
|
|
292
309
|
}
|
|
293
310
|
]);
|
|
294
311
|
initOptionAndDataSourceRules.call(_this, props);
|
|
@@ -369,20 +369,22 @@ var ListControl = /*#__PURE__*/ function(DesignerControl) {
|
|
|
369
369
|
{
|
|
370
370
|
key: "toSchema",
|
|
371
371
|
value: function toSchema() {
|
|
372
|
+
var _this_props_footers, _this_props;
|
|
372
373
|
var superSchema = _get(_get_prototype_of(ListControl.prototype), "toSchema", this).call(this);
|
|
373
374
|
var headers = this.props.headers.map(function(item) {
|
|
374
375
|
return item.toSchema();
|
|
375
376
|
});
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
377
|
+
var footers = (_this_props = this.props) === null || _this_props === void 0 ? void 0 : (_this_props_footers = _this_props.footers) === null || _this_props_footers === void 0 ? void 0 : _this_props_footers.map(function(item) {
|
|
378
|
+
if (item) {
|
|
379
|
+
return item.toSchema();
|
|
380
|
+
} else {
|
|
381
|
+
return undefined;
|
|
382
|
+
}
|
|
383
|
+
});
|
|
383
384
|
return _object_spread_props(_object_spread({}, superSchema), {
|
|
384
385
|
props: _object_spread_props(_object_spread({}, this.props), {
|
|
385
|
-
headers: headers
|
|
386
|
+
headers: headers,
|
|
387
|
+
footers: footers
|
|
386
388
|
})
|
|
387
389
|
});
|
|
388
390
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RulesMessage } from '@byteluck-fe/model-driven-shared';
|
|
2
2
|
export function initLinkOperationRules(props) {
|
|
3
3
|
if (props.hasOwnProperty('linkOperationOption') && props.hasOwnProperty('showLinkOperation') && props.showLinkOperation) {
|
|
4
4
|
this.linkOperationOption = [
|
|
@@ -8,7 +8,7 @@ export function initLinkOperationRules(props) {
|
|
|
8
8
|
formKey: {
|
|
9
9
|
type: 'string',
|
|
10
10
|
required: true,
|
|
11
|
-
message:
|
|
11
|
+
message: RulesMessage.getMessage('pleaseEnterForm')
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { getNotRepeatItems } from '@byteluck-fe/model-driven-shared';
|
|
2
|
-
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
1
|
+
import { getNotRepeatItems, RulesMessage } from '@byteluck-fe/model-driven-shared';
|
|
3
2
|
export function initOptionAndDataSourceRules(props) {
|
|
4
3
|
if (!props.hasOwnProperty('optionConfig')) {
|
|
5
4
|
this.optionConfig = {
|
|
@@ -21,7 +20,7 @@ export function initOptionAndDataSourceRules(props) {
|
|
|
21
20
|
this.options = [
|
|
22
21
|
{
|
|
23
22
|
type: 'array',
|
|
24
|
-
message:
|
|
23
|
+
message: RulesMessage.getMessage('isNotArray')
|
|
25
24
|
},
|
|
26
25
|
{
|
|
27
26
|
type: 'array',
|
|
@@ -31,12 +30,12 @@ export function initOptionAndDataSourceRules(props) {
|
|
|
31
30
|
label: {
|
|
32
31
|
type: 'string',
|
|
33
32
|
required: true,
|
|
34
|
-
message:
|
|
33
|
+
message: RulesMessage.getMessage('pleaseEnterLabel')
|
|
35
34
|
},
|
|
36
35
|
value: {
|
|
37
36
|
type: 'string',
|
|
38
37
|
required: true,
|
|
39
|
-
message:
|
|
38
|
+
message: RulesMessage.getMessage('pleaseEnterValue')
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
}
|
|
@@ -45,7 +44,7 @@ export function initOptionAndDataSourceRules(props) {
|
|
|
45
44
|
type: 'array',
|
|
46
45
|
validator: function validator(rule, value, callback) {
|
|
47
46
|
if (value.length === 0) {
|
|
48
|
-
callback(
|
|
47
|
+
callback(RulesMessage.getMessage('optionIsRequired'));
|
|
49
48
|
}
|
|
50
49
|
callback();
|
|
51
50
|
}
|
|
@@ -58,19 +57,19 @@ export function initOptionAndDataSourceRules(props) {
|
|
|
58
57
|
});
|
|
59
58
|
var notRepeatIds = getNotRepeatItems(ids);
|
|
60
59
|
if (ids.length !== notRepeatIds.length) {
|
|
61
|
-
callback(
|
|
60
|
+
callback(RulesMessage.getMessage('optionIdIsRepeat'));
|
|
62
61
|
} else {
|
|
63
62
|
callback();
|
|
64
63
|
}
|
|
65
64
|
},
|
|
66
|
-
message:
|
|
65
|
+
message: RulesMessage.getMessage('optionIdIsRepeat')
|
|
67
66
|
}
|
|
68
67
|
];
|
|
69
68
|
} else if (props.hasOwnProperty('datasourceBind') && (!props.hasOwnProperty('optionConfig') || props.hasOwnProperty('optionConfig') && props.optionConfig === 'datasource')) {
|
|
70
69
|
this.datasourceBind = [
|
|
71
70
|
{
|
|
72
71
|
type: 'object',
|
|
73
|
-
message:
|
|
72
|
+
message: RulesMessage.getMessage('isNotObject')
|
|
74
73
|
},
|
|
75
74
|
{
|
|
76
75
|
type: 'object',
|
|
@@ -78,38 +77,38 @@ export function initOptionAndDataSourceRules(props) {
|
|
|
78
77
|
dataCode: {
|
|
79
78
|
type: 'string',
|
|
80
79
|
required: true,
|
|
81
|
-
message:
|
|
80
|
+
message: RulesMessage.getMessage('pleaseEnterDataCode')
|
|
82
81
|
},
|
|
83
82
|
valueFieldCode: {
|
|
84
83
|
type: 'string',
|
|
85
84
|
required: true,
|
|
86
|
-
message:
|
|
85
|
+
message: RulesMessage.getMessage('pleaseEnterValueFieldCode')
|
|
87
86
|
},
|
|
88
87
|
svcCode: {
|
|
89
88
|
type: 'string',
|
|
90
89
|
required: true,
|
|
91
|
-
message:
|
|
90
|
+
message: RulesMessage.getMessage('pleaseEnterSvcCode')
|
|
92
91
|
},
|
|
93
92
|
displayBoList: [
|
|
94
93
|
{
|
|
95
94
|
type: 'array',
|
|
96
|
-
message:
|
|
95
|
+
message: RulesMessage.getMessage('isNotArray')
|
|
97
96
|
},
|
|
98
97
|
{
|
|
99
98
|
type: 'array',
|
|
100
99
|
validator: function validator(rule, value, callback) {
|
|
101
100
|
if (value.length === 0) {
|
|
102
|
-
callback(
|
|
101
|
+
callback(RulesMessage.getMessage('pleaseBindAtLeastOneDisplayValue'));
|
|
103
102
|
}
|
|
104
103
|
callback();
|
|
105
104
|
},
|
|
106
|
-
message:
|
|
105
|
+
message: RulesMessage.getMessage('pleaseBindAtLeastOneDisplayValue')
|
|
107
106
|
}
|
|
108
107
|
],
|
|
109
108
|
orders: [
|
|
110
109
|
{
|
|
111
110
|
type: 'array',
|
|
112
|
-
message:
|
|
111
|
+
message: RulesMessage.getMessage('isNotArray')
|
|
113
112
|
},
|
|
114
113
|
{
|
|
115
114
|
type: 'array',
|
|
@@ -119,11 +118,11 @@ export function initOptionAndDataSourceRules(props) {
|
|
|
119
118
|
columnName: {
|
|
120
119
|
type: 'string',
|
|
121
120
|
required: true,
|
|
122
|
-
message:
|
|
121
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
123
122
|
},
|
|
124
123
|
desc: {
|
|
125
124
|
type: 'boolean',
|
|
126
|
-
message:
|
|
125
|
+
message: RulesMessage.getMessage('isNotBoolean')
|
|
127
126
|
}
|
|
128
127
|
}
|
|
129
128
|
}
|
|
@@ -139,7 +138,7 @@ export function initSuperDataSourceRules(props, attributes) {
|
|
|
139
138
|
this.datasourceBind = [
|
|
140
139
|
{
|
|
141
140
|
type: 'object',
|
|
142
|
-
message:
|
|
141
|
+
message: RulesMessage.getMessage('isNotObject')
|
|
143
142
|
},
|
|
144
143
|
{
|
|
145
144
|
type: 'object',
|
|
@@ -147,22 +146,22 @@ export function initSuperDataSourceRules(props, attributes) {
|
|
|
147
146
|
dataCode: {
|
|
148
147
|
type: 'string',
|
|
149
148
|
required: true,
|
|
150
|
-
message:
|
|
149
|
+
message: RulesMessage.getMessage(messageInDataSetting ? 'pleaseEnterDataCodeInDataSetting' : 'pleaseEnterDataCode')
|
|
151
150
|
},
|
|
152
151
|
valueFieldCode: {
|
|
153
152
|
type: 'string',
|
|
154
153
|
required: true,
|
|
155
|
-
message:
|
|
154
|
+
message: RulesMessage.getMessage(messageInDataSetting ? 'pleaseEnterValueFieldCodeInDataSetting' : 'pleaseEnterValueFieldCode')
|
|
156
155
|
},
|
|
157
156
|
svcCode: {
|
|
158
157
|
type: 'string',
|
|
159
158
|
required: true,
|
|
160
|
-
message:
|
|
159
|
+
message: RulesMessage.getMessage(messageInDataSetting ? 'pleaseEnterSvcCodeInDataSetting' : 'pleaseEnterSvcCode')
|
|
161
160
|
},
|
|
162
161
|
attributes: [
|
|
163
162
|
{
|
|
164
163
|
type: 'array',
|
|
165
|
-
message:
|
|
164
|
+
message: RulesMessage.getMessage('isNotArray')
|
|
166
165
|
},
|
|
167
166
|
{
|
|
168
167
|
type: 'array',
|
|
@@ -172,27 +171,27 @@ export function initSuperDataSourceRules(props, attributes) {
|
|
|
172
171
|
name: {
|
|
173
172
|
type: 'string',
|
|
174
173
|
required: true,
|
|
175
|
-
message:
|
|
174
|
+
message: RulesMessage.getMessage('isNotString')
|
|
176
175
|
},
|
|
177
176
|
key: {
|
|
178
177
|
type: 'string',
|
|
179
178
|
required: true,
|
|
180
|
-
message:
|
|
179
|
+
message: RulesMessage.getMessage('isNotString')
|
|
181
180
|
},
|
|
182
181
|
value: [
|
|
183
182
|
{
|
|
184
183
|
type: 'array',
|
|
185
|
-
message:
|
|
184
|
+
message: RulesMessage.getMessage('isNotArray')
|
|
186
185
|
},
|
|
187
186
|
{
|
|
188
187
|
type: 'array',
|
|
189
188
|
validator: function validator(rule, value, callback) {
|
|
190
189
|
if (value.length === 0) {
|
|
191
|
-
callback(
|
|
190
|
+
callback(RulesMessage.getMessage(messageInDataSetting ? 'pleaseBindAtLeastOneDisplayValueInDataSetting' : 'pleaseBindAtLeastOneDisplayValue'));
|
|
192
191
|
}
|
|
193
192
|
callback();
|
|
194
193
|
},
|
|
195
|
-
message:
|
|
194
|
+
message: RulesMessage.getMessage(messageInDataSetting ? 'pleaseBindAtLeastOneDisplayValueInDataSetting' : 'pleaseBindAtLeastOneDisplayValue')
|
|
196
195
|
}
|
|
197
196
|
]
|
|
198
197
|
}
|
|
@@ -202,7 +201,7 @@ export function initSuperDataSourceRules(props, attributes) {
|
|
|
202
201
|
orders: [
|
|
203
202
|
{
|
|
204
203
|
type: 'array',
|
|
205
|
-
message:
|
|
204
|
+
message: RulesMessage.getMessage('isNotArray')
|
|
206
205
|
},
|
|
207
206
|
{
|
|
208
207
|
type: 'array',
|
|
@@ -212,11 +211,11 @@ export function initSuperDataSourceRules(props, attributes) {
|
|
|
212
211
|
columnName: {
|
|
213
212
|
type: 'string',
|
|
214
213
|
required: true,
|
|
215
|
-
message:
|
|
214
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
216
215
|
},
|
|
217
216
|
desc: {
|
|
218
217
|
type: 'boolean',
|
|
219
|
-
message:
|
|
218
|
+
message: RulesMessage.getMessage('isNotBoolean')
|
|
220
219
|
}
|
|
221
220
|
}
|
|
222
221
|
}
|
|
@@ -140,19 +140,19 @@ export var RegisterControls = /*#__PURE__*/ function() {
|
|
|
140
140
|
_this.createControl(item, beforeCreateInstance));
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
143
|
+
// list类型的控件,允许存在footer
|
|
144
|
+
if (props.footers) {
|
|
145
|
+
// @ts-ignore
|
|
146
|
+
props.footers = props.footers.map(function(item) {
|
|
147
|
+
var newctl;
|
|
148
|
+
// footers 允许有空存在
|
|
149
|
+
if (item) {
|
|
150
|
+
// @ts-ignore
|
|
151
|
+
newctl = _this.createControl(item, beforeCreateInstance);
|
|
152
|
+
}
|
|
153
|
+
return newctl;
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
156
|
}
|
|
157
157
|
// @ts-ignore
|
|
158
158
|
var Constructor = this.getControlFormType(schema.type);
|