@byteluck-fe/model-driven-controls 7.0.0-props.49 → 7.0.0-props.50

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.
@@ -91,14 +91,22 @@ var AddressControlPropertyRuntimeRules = /*#__PURE__*/ function(BaseControlPrope
91
91
  if (props.required && !props.isHide) {
92
92
  var valueValidate = {
93
93
  type: 'object',
94
- fields: {
95
- province: {
96
- type: 'string',
97
- required: props.required,
98
- message: getLocaleText('CMD.pleaseSelectProvince', null, '请选择省')
99
- }
100
- }
94
+ fields: {}
101
95
  };
96
+ if (props.addressType.includes('country')) {
97
+ valueValidate.fields.country = {
98
+ type: 'string',
99
+ required: props.required,
100
+ message: getLocaleText('CMD.pleaseSelectCountry', null, '请选择国家')
101
+ };
102
+ }
103
+ if (props.addressType.includes('province')) {
104
+ valueValidate.fields.province = {
105
+ type: 'string',
106
+ required: props.required,
107
+ message: getLocaleText('CMD.pleaseSelectProvince', null, '请选择省')
108
+ };
109
+ }
102
110
  if (props.addressType.includes('city')) {
103
111
  valueValidate.fields.city = {
104
112
  type: 'string',
@@ -125,19 +133,22 @@ var AddressProperty = /*#__PURE__*/ function(BaseControlProperty) {
125
133
  function AddressProperty(props) {
126
134
  _class_call_check(this, AddressProperty);
127
135
  var _this;
128
- var _ref, _ref1, _ref2, _ref3, _ref4;
136
+ var _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
129
137
  _this = _call_super(this, AddressProperty, [
130
138
  props
131
- ]), _define_property(_this, "defaultValueType", void 0), _define_property(_this, "defaultValue", void 0), _define_property(_this, "addressType", void 0);
139
+ ]), _define_property(_this, "defaultValueType", void 0), _define_property(_this, "defaultValue", void 0), _define_property(_this, "addressType", void 0), _define_property(_this, "countryScope", void 0);
132
140
  _this.caption = (_ref = props === null || props === void 0 ? void 0 : props.caption) !== null && _ref !== void 0 ? _ref : AddressControl.controlName;
133
141
  _this.defaultValueType = (_ref1 = props === null || props === void 0 ? void 0 : props.defaultValueType) !== null && _ref1 !== void 0 ? _ref1 : 'default';
134
- _this.addressType = (_ref2 = props === null || props === void 0 ? void 0 : props.addressType) !== null && _ref2 !== void 0 ? _ref2 : [
142
+ _this.countryScope = (_ref2 = props === null || props === void 0 ? void 0 : props.countryScope) !== null && _ref2 !== void 0 ? _ref2 : [
143
+ 'MDCT00000040'
144
+ ];
145
+ _this.addressType = (_ref3 = props === null || props === void 0 ? void 0 : props.addressType) !== null && _ref3 !== void 0 ? _ref3 : [
135
146
  'province',
136
147
  'city',
137
148
  'district'
138
149
  ];
139
- _this.defaultValue = new AddressValue((_ref3 = props === null || props === void 0 ? void 0 : props.defaultValue) !== null && _ref3 !== void 0 ? _ref3 : {});
140
- _this.placeholder = (_ref4 = props === null || props === void 0 ? void 0 : props.placeholder) !== null && _ref4 !== void 0 ? _ref4 : getLocaleText('CMD.pleaseChooseAddress', null, '请选择地址');
150
+ _this.defaultValue = new AddressValue((_ref4 = props === null || props === void 0 ? void 0 : props.defaultValue) !== null && _ref4 !== void 0 ? _ref4 : {});
151
+ _this.placeholder = (_ref5 = props === null || props === void 0 ? void 0 : props.placeholder) !== null && _ref5 !== void 0 ? _ref5 : getLocaleText('CMD.pleaseChooseAddress', null, '请选择地址');
141
152
  return _this;
142
153
  }
143
154
  return AddressProperty;
@@ -129,6 +129,16 @@
129
129
  "defaultValue": {
130
130
  "type": "object",
131
131
  "properties": {
132
+ "country": {
133
+ "type": "string",
134
+ "description": "国家编码",
135
+ "default": ""
136
+ },
137
+ "countryDisplay": {
138
+ "type": "string",
139
+ "description": "国家显示文字",
140
+ "default": ""
141
+ },
132
142
  "city": {
133
143
  "type": "string",
134
144
  "description": "市编码",
@@ -198,6 +208,11 @@
198
208
  },
199
209
  "description": "地址类型;country:国家;province:省;city:城市;district:区县;",
200
210
  "default": "['province', 'city', 'district']"
211
+ },
212
+ "internationalScope": {
213
+ "type": "boolean",
214
+ "description": "国际范围",
215
+ "default": false
201
216
  }
202
217
  },
203
218
  "required": []