@byteluck-fe/model-driven-core 4.36.0-lx2 → 6.1.0-1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/common/BaseControl/designer.js +9 -2
- package/dist/esm/common/BaseControl/property.js +5 -0
- package/dist/esm/common/ColumnControl/property.js +6 -6
- package/dist/esm/common/FormControl/property.js +15 -32
- package/dist/esm/common/ListControl/designer.js +8 -10
- package/dist/esm/common/Validator.js +6 -4
- package/dist/esm/common/initLinkOperationRules.js +2 -2
- package/dist/esm/common/initOptionAndDataSourceRules.js +31 -30
- package/dist/esm/framework/RegisterControls.js +13 -13
- package/dist/esm/framework/index.js +115 -23
- package/dist/index.umd.js +1 -1
- package/dist/types/common/BaseControl/designer.d.ts +8 -0
- package/dist/types/common/BaseControl/property.d.ts +6 -0
- package/dist/types/common/FormControl/property.d.ts +0 -18
- package/dist/types/framework/index.d.ts +65 -18
- package/dist/types/framework/isDataBind.d.ts +1 -1
- package/package.json +3 -3
|
@@ -210,6 +210,7 @@ function _ts_generator(thisArg, body) {
|
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
213
214
|
import Property from './property';
|
|
214
215
|
import { genNonDuplicateId, JSONCopy, referenceError, updateValueFromKeys } from '@byteluck-fe/model-driven-shared';
|
|
215
216
|
import { createValidator } from '../Validator';
|
|
@@ -231,10 +232,12 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
231
232
|
_define_property(this, "eventKeys", []);
|
|
232
233
|
_define_property(this, "customEvents", []);
|
|
233
234
|
_define_property(this, "parent", null);
|
|
235
|
+
_define_property(this, "slots", void 0);
|
|
236
|
+
_define_property(this, "slotPosition", void 0);
|
|
234
237
|
_define_property(this, "updateSetting", updateSetting);
|
|
235
238
|
_define_property(this, "removeSetting", removeSetting);
|
|
236
239
|
this._callControlHooks('preInstance', props);
|
|
237
|
-
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;
|
|
240
|
+
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, slots = _ref.slots, slotPosition = _ref.slotPosition;
|
|
238
241
|
if (!(controlName && controlIcon && controlType)) {
|
|
239
242
|
referenceError("The ".concat(name, " controlName,controlIcon,controlType is not define"));
|
|
240
243
|
}
|
|
@@ -252,6 +255,8 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
252
255
|
this.fieldType = (_props_fieldType = props === null || props === void 0 ? void 0 : props.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
|
|
253
256
|
this.eventKeys = JSONCopy(controlEventKeys);
|
|
254
257
|
this.customEvents = JSONCopy(controlCustomEvents);
|
|
258
|
+
this.slots = JSONCopy(slots);
|
|
259
|
+
this.slotPosition = JSONCopy(slotPosition);
|
|
255
260
|
Promise.resolve().then(function() {
|
|
256
261
|
_this._callControlHooks('postInstance', props);
|
|
257
262
|
});
|
|
@@ -474,7 +479,9 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
474
479
|
return Control;
|
|
475
480
|
}();
|
|
476
481
|
_define_property(Control, "mode", 'Designer');
|
|
477
|
-
_define_property(Control, "
|
|
482
|
+
_define_property(Control, "slots", void 0);
|
|
483
|
+
_define_property(Control, "slotPosition", void 0);
|
|
484
|
+
_define_property(Control, "controlName", getLocaleText('CMD.7baf1751712168384'));
|
|
478
485
|
_define_property(Control, "controlIcon", 'icon');
|
|
479
486
|
_define_property(Control, "controlType", 'control');
|
|
480
487
|
_define_property(Control, "controlFieldType", void 0);
|
|
@@ -152,6 +152,11 @@ 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);
|
|
155
160
|
var _props_isHide;
|
|
156
161
|
this.isHide = (_props_isHide = props === null || props === void 0 ? void 0 : props.isHide) !== null && _props_isHide !== void 0 ? _props_isHide : false;
|
|
157
162
|
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';
|
|
75
74
|
import { initOptionAndDataSourceRules } from '../initOptionAndDataSourceRules';
|
|
76
75
|
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: getLocaleText('CMD.pleaseEnterCaption', null, '请输入标题')
|
|
89
89
|
}), _define_property(_this, "width", {
|
|
90
90
|
type: 'number',
|
|
91
91
|
required: false,
|
|
92
|
-
message:
|
|
92
|
+
message: getLocaleText('CMD.pleaseEnterColumnWidth', null, '请输入列宽')
|
|
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: getLocaleText('CMD.PleaseSelectTheCorrectOptionSettings', null, '请选择正确的选项设置')
|
|
172
172
|
}), _define_property(_this, "options", [
|
|
173
173
|
{
|
|
174
174
|
type: 'array',
|
|
175
|
-
message:
|
|
175
|
+
message: getLocaleText('CMD.isNotArray', null, '请输入一个数组')
|
|
176
176
|
}
|
|
177
177
|
]), _define_property(_this, "datasourceBind", [
|
|
178
178
|
{
|
|
179
179
|
type: 'object',
|
|
180
|
-
message:
|
|
180
|
+
message: getLocaleText('CMD.isNotObject', null, '请输入一个对象')
|
|
181
181
|
}
|
|
182
182
|
]);
|
|
183
183
|
initOptionAndDataSourceRules.call(_this, props);
|
|
@@ -70,11 +70,12 @@ function _is_native_reflect_construct() {
|
|
|
70
70
|
return !!result;
|
|
71
71
|
})();
|
|
72
72
|
}
|
|
73
|
-
import {
|
|
73
|
+
import { 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';
|
|
78
79
|
var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
79
80
|
"use strict";
|
|
80
81
|
_inherits(BaseControlPropertyRules, PropertyRules);
|
|
@@ -86,7 +87,7 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
86
87
|
]), _define_property(_this, "dataBind", {}), _define_property(_this, "caption", {
|
|
87
88
|
type: 'string',
|
|
88
89
|
required: true,
|
|
89
|
-
message:
|
|
90
|
+
message: getLocaleText('CMD.pleaseEnterCaption', null, '请输入标题')
|
|
90
91
|
}), _define_property(_this, "isHideCaption", {
|
|
91
92
|
type: 'boolean'
|
|
92
93
|
}), _define_property(_this, "labelPosition", {
|
|
@@ -99,7 +100,7 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
99
100
|
// public placeholder: RuleItem = {
|
|
100
101
|
// required: true,
|
|
101
102
|
// type: 'string',
|
|
102
|
-
// message:
|
|
103
|
+
// message: getLocaleText('CMD.pleaseEnterPlaceholder',null,'请输入提示文字'),
|
|
103
104
|
// }
|
|
104
105
|
_define_property(_this, "defaultState", {
|
|
105
106
|
type: 'enum',
|
|
@@ -112,19 +113,19 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
112
113
|
}), _define_property(_this, "captionTip", {
|
|
113
114
|
type: 'string',
|
|
114
115
|
required: false,
|
|
115
|
-
message:
|
|
116
|
+
message: getLocaleText('CMD.pleaseEnterCaptionTip', null, '请输入气泡提示语')
|
|
116
117
|
});
|
|
117
118
|
// 初始化dataBind的校验规则
|
|
118
119
|
var validateFields = {
|
|
119
120
|
fieldCode: {
|
|
120
121
|
type: 'string',
|
|
121
122
|
required: true,
|
|
122
|
-
message:
|
|
123
|
+
message: getLocaleText('CMD.pleaseEnterFieldCode', null, '请绑定数据项')
|
|
123
124
|
},
|
|
124
125
|
dataCode: {
|
|
125
126
|
type: 'string',
|
|
126
127
|
required: true,
|
|
127
|
-
message:
|
|
128
|
+
message: getLocaleText('CMD.pleaseEnterFieldCode', null, '请绑定数据项')
|
|
128
129
|
}
|
|
129
130
|
};
|
|
130
131
|
// if (props.dataBind instanceof DataBind) {
|
|
@@ -133,14 +134,14 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
133
134
|
type: 'object',
|
|
134
135
|
required: true,
|
|
135
136
|
fields: JSONCopy(validateFields),
|
|
136
|
-
message:
|
|
137
|
+
message: getLocaleText('CMD.pleaseEnterFieldCode', null, '请绑定数据项')
|
|
137
138
|
};
|
|
138
139
|
} else {
|
|
139
140
|
var dataBind = {
|
|
140
141
|
type: 'object',
|
|
141
142
|
required: true,
|
|
142
143
|
fields: {},
|
|
143
|
-
message:
|
|
144
|
+
message: getLocaleText('CMD.pleaseEnterFieldCode', null, '请绑定数据项')
|
|
144
145
|
};
|
|
145
146
|
Object.keys(props.dataBind).forEach(function(key) {
|
|
146
147
|
;
|
|
@@ -148,7 +149,7 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
148
149
|
type: 'object',
|
|
149
150
|
required: true,
|
|
150
151
|
fields: JSONCopy(validateFields),
|
|
151
|
-
message:
|
|
152
|
+
message: getLocaleText('CMD.pleaseEnterFieldCode', null, '请绑定数据项')
|
|
152
153
|
};
|
|
153
154
|
});
|
|
154
155
|
_this.dataBind = dataBind;
|
|
@@ -174,9 +175,9 @@ var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRule
|
|
|
174
175
|
_this.push({
|
|
175
176
|
type: 'string',
|
|
176
177
|
required: isRequired,
|
|
177
|
-
message: props.requiredMessage !== '' ? props.requiredMessage :
|
|
178
|
+
message: props.requiredMessage !== '' ? props.requiredMessage : getLocaleText('CMD.runtimeRequired', {
|
|
178
179
|
caption: props.caption
|
|
179
|
-
})
|
|
180
|
+
}, '{caption}必填')
|
|
180
181
|
});
|
|
181
182
|
}
|
|
182
183
|
return _this;
|
|
@@ -199,18 +200,6 @@ var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRule
|
|
|
199
200
|
* @defaultValue ''
|
|
200
201
|
* @public
|
|
201
202
|
*/ _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), /**
|
|
214
203
|
* 隐藏标题
|
|
215
204
|
* @defaultValue false
|
|
216
205
|
* @public
|
|
@@ -250,12 +239,6 @@ var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRule
|
|
|
250
239
|
*/ _define_property(_this, "requiredMessage", void 0);
|
|
251
240
|
var _props_caption;
|
|
252
241
|
_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 : '14';
|
|
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;
|
|
259
242
|
var _props_isHideCaption;
|
|
260
243
|
_this.isHideCaption = (_props_isHideCaption = props === null || props === void 0 ? void 0 : props.isHideCaption) !== null && _props_isHideCaption !== void 0 ? _props_isHideCaption : false;
|
|
261
244
|
var _props_isShowCaptionTip;
|
|
@@ -296,16 +279,16 @@ var OptionAndDataSourcePropertyRules = /*#__PURE__*/ function(BaseControlPropert
|
|
|
296
279
|
'custom',
|
|
297
280
|
'datasource'
|
|
298
281
|
],
|
|
299
|
-
message:
|
|
282
|
+
message: getLocaleText('CMD.PleaseSelectTheCorrectOptionSettings', null, '请选择正确的选项设置')
|
|
300
283
|
}), _define_property(_this, "options", [
|
|
301
284
|
{
|
|
302
285
|
type: 'array',
|
|
303
|
-
message:
|
|
286
|
+
message: getLocaleText('CMD.isNotArray', null, '请输入一个数组')
|
|
304
287
|
}
|
|
305
288
|
]), _define_property(_this, "datasourceBind", [
|
|
306
289
|
{
|
|
307
290
|
type: 'object',
|
|
308
|
-
message:
|
|
291
|
+
message: getLocaleText('CMD.isNotObject', null, '请输入一个对象')
|
|
309
292
|
}
|
|
310
293
|
]);
|
|
311
294
|
initOptionAndDataSourceRules.call(_this, props);
|
|
@@ -365,22 +365,20 @@ var ListControl = /*#__PURE__*/ function(DesignerControl) {
|
|
|
365
365
|
{
|
|
366
366
|
key: "toSchema",
|
|
367
367
|
value: function toSchema() {
|
|
368
|
-
var _this_props_footers, _this_props;
|
|
369
368
|
var superSchema = _get(_get_prototype_of(ListControl.prototype), "toSchema", this).call(this);
|
|
370
369
|
var headers = this.props.headers.map(function(item) {
|
|
371
370
|
return item.toSchema();
|
|
372
371
|
});
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
})
|
|
372
|
+
// const footers = this.props?.footers?.map((item) => {
|
|
373
|
+
// if (item) {
|
|
374
|
+
// return item.toSchema()
|
|
375
|
+
// } else {
|
|
376
|
+
// return undefined
|
|
377
|
+
// }
|
|
378
|
+
// })
|
|
380
379
|
return _object_spread_props(_object_spread({}, superSchema), {
|
|
381
380
|
props: _object_spread_props(_object_spread({}, this.props), {
|
|
382
|
-
headers: headers
|
|
383
|
-
footers: footers
|
|
381
|
+
headers: headers
|
|
384
382
|
})
|
|
385
383
|
});
|
|
386
384
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
1
2
|
import Schema from 'async-validator';
|
|
3
|
+
// @i18n-translate-ignore
|
|
2
4
|
var messages = {
|
|
3
|
-
required: '
|
|
4
|
-
maxLength: '
|
|
5
|
-
minLength: '
|
|
5
|
+
required: getLocaleText('CMD.aad41751712156995'),
|
|
6
|
+
maxLength: getLocaleText('CMD.890d1751712141808'),
|
|
7
|
+
minLength: getLocaleText('CMD.bb9b1751712143625'),
|
|
6
8
|
string: {
|
|
7
|
-
range: '
|
|
9
|
+
range: getLocaleText('CMD.f7131751712147855')
|
|
8
10
|
}
|
|
9
11
|
};
|
|
10
12
|
function createValidator(rules) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
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: getLocaleText('CMD.pleaseEnterForm', null, '请绑定表单')
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { getNotRepeatItems
|
|
1
|
+
import { getNotRepeatItems } from '@byteluck-fe/model-driven-shared';
|
|
2
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
2
3
|
export function initOptionAndDataSourceRules(props) {
|
|
3
4
|
if (!props.hasOwnProperty('optionConfig')) {
|
|
4
5
|
this.optionConfig = {
|
|
@@ -20,7 +21,7 @@ export function initOptionAndDataSourceRules(props) {
|
|
|
20
21
|
this.options = [
|
|
21
22
|
{
|
|
22
23
|
type: 'array',
|
|
23
|
-
message:
|
|
24
|
+
message: getLocaleText('CMD.isNotArray', null, '请输入一个数组')
|
|
24
25
|
},
|
|
25
26
|
{
|
|
26
27
|
type: 'array',
|
|
@@ -30,12 +31,12 @@ export function initOptionAndDataSourceRules(props) {
|
|
|
30
31
|
label: {
|
|
31
32
|
type: 'string',
|
|
32
33
|
required: true,
|
|
33
|
-
message:
|
|
34
|
+
message: getLocaleText('CMD.pleaseEnterLabel', null, '请输入显示值')
|
|
34
35
|
},
|
|
35
36
|
value: {
|
|
36
37
|
type: 'string',
|
|
37
38
|
required: true,
|
|
38
|
-
message:
|
|
39
|
+
message: getLocaleText('CMD.pleaseEnterValue', null, '请输入存储值')
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
}
|
|
@@ -44,7 +45,7 @@ export function initOptionAndDataSourceRules(props) {
|
|
|
44
45
|
type: 'array',
|
|
45
46
|
validator: function validator(rule, value, callback) {
|
|
46
47
|
if (value.length === 0) {
|
|
47
|
-
callback(
|
|
48
|
+
callback(getLocaleText('CMD.optionIsRequired', null, '请输入至少一条选项'));
|
|
48
49
|
}
|
|
49
50
|
callback();
|
|
50
51
|
}
|
|
@@ -57,19 +58,19 @@ export function initOptionAndDataSourceRules(props) {
|
|
|
57
58
|
});
|
|
58
59
|
var notRepeatIds = getNotRepeatItems(ids);
|
|
59
60
|
if (ids.length !== notRepeatIds.length) {
|
|
60
|
-
callback(
|
|
61
|
+
callback(getLocaleText('CMD.optionIdIsRepeat', null, '选项ID不能重复'));
|
|
61
62
|
} else {
|
|
62
63
|
callback();
|
|
63
64
|
}
|
|
64
65
|
},
|
|
65
|
-
message:
|
|
66
|
+
message: getLocaleText('CMD.optionIdIsRepeat', null, '选项ID不能重复')
|
|
66
67
|
}
|
|
67
68
|
];
|
|
68
69
|
} else if (props.hasOwnProperty('datasourceBind') && (!props.hasOwnProperty('optionConfig') || props.hasOwnProperty('optionConfig') && props.optionConfig === 'datasource')) {
|
|
69
70
|
this.datasourceBind = [
|
|
70
71
|
{
|
|
71
72
|
type: 'object',
|
|
72
|
-
message:
|
|
73
|
+
message: getLocaleText('CMD.isNotObject', null, '请输入一个对象')
|
|
73
74
|
},
|
|
74
75
|
{
|
|
75
76
|
type: 'object',
|
|
@@ -77,38 +78,38 @@ export function initOptionAndDataSourceRules(props) {
|
|
|
77
78
|
dataCode: {
|
|
78
79
|
type: 'string',
|
|
79
80
|
required: true,
|
|
80
|
-
message:
|
|
81
|
+
message: getLocaleText('CMD.pleaseEnterDataCode', null, '请绑定业务模型')
|
|
81
82
|
},
|
|
82
83
|
valueFieldCode: {
|
|
83
84
|
type: 'string',
|
|
84
85
|
required: true,
|
|
85
|
-
message:
|
|
86
|
+
message: getLocaleText('CMD.pleaseEnterValueFieldCode', null, '请绑定存储值')
|
|
86
87
|
},
|
|
87
88
|
svcCode: {
|
|
88
89
|
type: 'string',
|
|
89
90
|
required: true,
|
|
90
|
-
message:
|
|
91
|
+
message: getLocaleText('CMD.pleaseEnterSvcCode', null, '请绑定服务')
|
|
91
92
|
},
|
|
92
93
|
displayBoList: [
|
|
93
94
|
{
|
|
94
95
|
type: 'array',
|
|
95
|
-
message:
|
|
96
|
+
message: getLocaleText('CMD.isNotArray', null, '请输入一个数组')
|
|
96
97
|
},
|
|
97
98
|
{
|
|
98
99
|
type: 'array',
|
|
99
100
|
validator: function validator(rule, value, callback) {
|
|
100
101
|
if (value.length === 0) {
|
|
101
|
-
callback(
|
|
102
|
+
callback(getLocaleText('CMD.pleaseBindAtLeastOneDisplayValue', null, '至少绑定一个显示值'));
|
|
102
103
|
}
|
|
103
104
|
callback();
|
|
104
105
|
},
|
|
105
|
-
message:
|
|
106
|
+
message: getLocaleText('CMD.pleaseBindAtLeastOneDisplayValue', null, '至少绑定一个显示值')
|
|
106
107
|
}
|
|
107
108
|
],
|
|
108
109
|
orders: [
|
|
109
110
|
{
|
|
110
111
|
type: 'array',
|
|
111
|
-
message:
|
|
112
|
+
message: getLocaleText('CMD.isNotArray', null, '请输入一个数组')
|
|
112
113
|
},
|
|
113
114
|
{
|
|
114
115
|
type: 'array',
|
|
@@ -118,11 +119,11 @@ export function initOptionAndDataSourceRules(props) {
|
|
|
118
119
|
columnName: {
|
|
119
120
|
type: 'string',
|
|
120
121
|
required: true,
|
|
121
|
-
message:
|
|
122
|
+
message: getLocaleText('CMD.pleaseEnterFieldCode', null, '请绑定数据项')
|
|
122
123
|
},
|
|
123
124
|
desc: {
|
|
124
125
|
type: 'boolean',
|
|
125
|
-
message:
|
|
126
|
+
message: getLocaleText('CMD.isNotBoolean', null, '请输入一个布尔')
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
129
|
}
|
|
@@ -138,7 +139,7 @@ export function initSuperDataSourceRules(props, attributes) {
|
|
|
138
139
|
this.datasourceBind = [
|
|
139
140
|
{
|
|
140
141
|
type: 'object',
|
|
141
|
-
message:
|
|
142
|
+
message: getLocaleText('CMD.isNotObject', null, '请输入一个对象')
|
|
142
143
|
},
|
|
143
144
|
{
|
|
144
145
|
type: 'object',
|
|
@@ -146,22 +147,22 @@ export function initSuperDataSourceRules(props, attributes) {
|
|
|
146
147
|
dataCode: {
|
|
147
148
|
type: 'string',
|
|
148
149
|
required: true,
|
|
149
|
-
message:
|
|
150
|
+
message: getLocaleText(messageInDataSetting ? 'CMD.pleaseEnterDataCodeInDataSetting' : 'CMD.pleaseEnterDataCode', null, messageInDataSetting ? getLocaleText('CMD.c4901751712137782') : getLocaleText('CMD.8e161751712150947'))
|
|
150
151
|
},
|
|
151
152
|
valueFieldCode: {
|
|
152
153
|
type: 'string',
|
|
153
154
|
required: true,
|
|
154
|
-
message:
|
|
155
|
+
message: getLocaleText(messageInDataSetting ? 'CMD.pleaseEnterValueFieldCodeInDataSetting' : 'CMD.pleaseEnterValueFieldCode', null, messageInDataSetting ? getLocaleText('CMD.9af91751712139782') : getLocaleText('CMD.92701751712154242'))
|
|
155
156
|
},
|
|
156
157
|
svcCode: {
|
|
157
158
|
type: 'string',
|
|
158
159
|
required: true,
|
|
159
|
-
message:
|
|
160
|
+
message: getLocaleText(messageInDataSetting ? 'CMD.pleaseEnterSvcCodeInDataSetting' : 'CMD.pleaseEnterSvcCode', null, messageInDataSetting ? getLocaleText('CMD.203c1751712145631') : getLocaleText('CMD.9d361751712158465'))
|
|
160
161
|
},
|
|
161
162
|
attributes: [
|
|
162
163
|
{
|
|
163
164
|
type: 'array',
|
|
164
|
-
message:
|
|
165
|
+
message: getLocaleText('CMD.isNotArray', null, '请输入一个数组')
|
|
165
166
|
},
|
|
166
167
|
{
|
|
167
168
|
type: 'array',
|
|
@@ -171,27 +172,27 @@ export function initSuperDataSourceRules(props, attributes) {
|
|
|
171
172
|
name: {
|
|
172
173
|
type: 'string',
|
|
173
174
|
required: true,
|
|
174
|
-
message:
|
|
175
|
+
message: getLocaleText('CMD.isNotString', null, '请输入一个字符串')
|
|
175
176
|
},
|
|
176
177
|
key: {
|
|
177
178
|
type: 'string',
|
|
178
179
|
required: true,
|
|
179
|
-
message:
|
|
180
|
+
message: getLocaleText('CMD.isNotString', null, '请输入一个字符串')
|
|
180
181
|
},
|
|
181
182
|
value: [
|
|
182
183
|
{
|
|
183
184
|
type: 'array',
|
|
184
|
-
message:
|
|
185
|
+
message: getLocaleText('CMD.isNotArray', null, '请输入一个数组')
|
|
185
186
|
},
|
|
186
187
|
{
|
|
187
188
|
type: 'array',
|
|
188
189
|
validator: function validator(rule, value, callback) {
|
|
189
190
|
if (value.length === 0) {
|
|
190
|
-
callback(
|
|
191
|
+
callback(getLocaleText(messageInDataSetting ? 'CMD.pleaseBindAtLeastOneDisplayValueInDataSetting' : 'CMD.pleaseBindAtLeastOneDisplayValue', null, messageInDataSetting ? getLocaleText('CMD.6a071751712131459') : getLocaleText('CMD.52351751712149286')));
|
|
191
192
|
}
|
|
192
193
|
callback();
|
|
193
194
|
},
|
|
194
|
-
message:
|
|
195
|
+
message: getLocaleText(messageInDataSetting ? 'CMD.pleaseBindAtLeastOneDisplayValueInDataSetting' : 'CMD.pleaseBindAtLeastOneDisplayValue', null, messageInDataSetting ? getLocaleText('CMD.6a071751712131459') : getLocaleText('CMD.52351751712149286'))
|
|
195
196
|
}
|
|
196
197
|
]
|
|
197
198
|
}
|
|
@@ -201,7 +202,7 @@ export function initSuperDataSourceRules(props, attributes) {
|
|
|
201
202
|
orders: [
|
|
202
203
|
{
|
|
203
204
|
type: 'array',
|
|
204
|
-
message:
|
|
205
|
+
message: getLocaleText('CMD.isNotArray', null, '请输入一个数组')
|
|
205
206
|
},
|
|
206
207
|
{
|
|
207
208
|
type: 'array',
|
|
@@ -211,11 +212,11 @@ export function initSuperDataSourceRules(props, attributes) {
|
|
|
211
212
|
columnName: {
|
|
212
213
|
type: 'string',
|
|
213
214
|
required: true,
|
|
214
|
-
message:
|
|
215
|
+
message: getLocaleText('CMD.pleaseEnterFieldCode', null, '请绑定数据项')
|
|
215
216
|
},
|
|
216
217
|
desc: {
|
|
217
218
|
type: 'boolean',
|
|
218
|
-
message:
|
|
219
|
+
message: getLocaleText('CMD.isNotBoolean', null, '请输入一个布尔')
|
|
219
220
|
}
|
|
220
221
|
}
|
|
221
222
|
}
|
|
@@ -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((item: Schema<any>) => {
|
|
147
|
+
// let 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);
|