@bchr/bchr-front-lib 0.3.119 → 0.3.123
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.
|
@@ -336,7 +336,7 @@ var FormForModify = /*#__PURE__*/function (_React$Component) {
|
|
|
336
336
|
label: dataItem.label,
|
|
337
337
|
name: dataItem.name,
|
|
338
338
|
rules: [{
|
|
339
|
-
required: !dataItem.
|
|
339
|
+
required: !dataItem.b_readonly && dataItem.required
|
|
340
340
|
}]
|
|
341
341
|
}, dataItem.render));
|
|
342
342
|
}
|
|
@@ -641,7 +641,7 @@ var FormForModify = /*#__PURE__*/function (_React$Component) {
|
|
|
641
641
|
required: !dataItem.b_readonly && b_required,
|
|
642
642
|
message: "请填写" + name,
|
|
643
643
|
whitespace: true,
|
|
644
|
-
validator: _this2.validator.bind(_assertThisInitialized(_this2), !dataItem.
|
|
644
|
+
validator: _this2.validator.bind(_assertThisInitialized(_this2), !dataItem.b_readonly && b_required, ui_render_type)
|
|
645
645
|
}, {
|
|
646
646
|
required: false,
|
|
647
647
|
message: name + "格式不正确",
|
|
@@ -649,7 +649,7 @@ var FormForModify = /*#__PURE__*/function (_React$Component) {
|
|
|
649
649
|
validator: _this2.formatValidator.bind(_assertThisInitialized(_this2)),
|
|
650
650
|
pattern: regexp_pattern
|
|
651
651
|
}],
|
|
652
|
-
hasFeedback: !dataItem.
|
|
652
|
+
hasFeedback: !dataItem.b_readonly && b_required,
|
|
653
653
|
valuePropName: valuePropName ? valuePropName : "value"
|
|
654
654
|
}, component));
|
|
655
655
|
});
|
|
@@ -131,22 +131,24 @@ var HttpService = /*#__PURE__*/function () {
|
|
|
131
131
|
rpcMethodName = "";
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
if (jsonObject) {
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
if (!this.__checkJSONObjectSecurity(jsonObject)) {
|
|
135
|
+
if (jsonObject) {
|
|
136
|
+
ajaxOptions.data = jsonObject;
|
|
137
|
+
}
|
|
137
138
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
if (ajaxOptions.rpcMethodName) {
|
|
140
|
+
delete ajaxOptions.rpcMethodName;
|
|
141
|
+
}
|
|
141
142
|
|
|
142
|
-
|
|
143
|
-
|
|
143
|
+
ajaxOptions.type = "post";
|
|
144
|
+
ajaxOptions.dataType = "json";
|
|
144
145
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
if (!ajaxOptions.url) {
|
|
147
|
+
ajaxOptions.url = this.requestContextPath + rpcMethodName;
|
|
148
|
+
}
|
|
148
149
|
|
|
149
|
-
|
|
150
|
+
return _jquery["default"].ajax(ajaxOptions);
|
|
151
|
+
}
|
|
150
152
|
}
|
|
151
153
|
}, {
|
|
152
154
|
key: "__postForMock",
|
|
@@ -359,7 +361,7 @@ var HttpService = /*#__PURE__*/function () {
|
|
|
359
361
|
return;
|
|
360
362
|
}
|
|
361
363
|
|
|
362
|
-
var containsHTML = /<(br|basefont|hr|input|source|frame|param|area|meta|!--|col|link|option|base|img|wbr|!DOCTYPE).*?>|<(a|abbr|acronym|address|applet|article|aside|audio|b|bdi|bdo|big|blockquote|body|button|canvas|caption|center|cite|code|colgroup|command|datalist|dd|del|details|dfn|dialog|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frameset|head|header|hgroup|h1|h2|h3|h4|h5|h6|html|i|iframe|ins|kbd|keygen|label|legend|li|map|mark|menu|meter|nav|noframes|noscript|object|ol|optgroup|output|p|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video).*?<\/\2>/i.test(str);
|
|
364
|
+
var containsHTML = /<(br|basefont|hr|input|source|frame|param|area|meta|!--|col|link|option|base|img|wbr|!DOCTYPE).*?>|<(a|abbr|acronym|address|applet|article|aside|audio|b|bdi|bdo|big|blockquote|body|button|canvas|caption|center|cite|code|colgroup|command|datalist|dd|del|details|dfn|dialog|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frameset|head|header|hgroup|h1|h2|h3|h4|h5|h6|html|i|iframe|ins|kbd|keygen|label|legend|li|map|mark|menu|meter|nav|noframes|noscript|object|ol|optgroup|output|p|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|svg).*?<\/\2>/i.test(str);
|
|
363
365
|
|
|
364
366
|
if (containsHTML) {
|
|
365
367
|
throw new Error("不安全的输入,请检查!【" + str + "】");
|
package/package.json
CHANGED
|
@@ -326,7 +326,7 @@ class FormForModify extends React.Component{
|
|
|
326
326
|
key={form_id + "_" + dataItem.code}
|
|
327
327
|
label={dataItem.label}
|
|
328
328
|
name={dataItem.name}
|
|
329
|
-
rules={[{ required: !dataItem.
|
|
329
|
+
rules={[{ required: !dataItem.b_readonly && dataItem.required}]}
|
|
330
330
|
>
|
|
331
331
|
{dataItem.render}
|
|
332
332
|
</Form.Item>
|
|
@@ -728,10 +728,10 @@ class FormForModify extends React.Component{
|
|
|
728
728
|
name={code}
|
|
729
729
|
initialValue={initialValue}
|
|
730
730
|
rules={[
|
|
731
|
-
{required: (!dataItem.b_readonly && b_required), message: ("请填写" + name), whitespace: true, validator: this.validator.bind(this, (!dataItem.
|
|
731
|
+
{required: (!dataItem.b_readonly && b_required), message: ("请填写" + name), whitespace: true, validator: this.validator.bind(this, (!dataItem.b_readonly && b_required), ui_render_type)},
|
|
732
732
|
{required: false, message: (name + "格式不正确"), whitespace: true, validator: this.formatValidator.bind(this), pattern: regexp_pattern}
|
|
733
733
|
]}
|
|
734
|
-
hasFeedback={(!dataItem.
|
|
734
|
+
hasFeedback={(!dataItem.b_readonly && b_required)}
|
|
735
735
|
valuePropName={valuePropName ? valuePropName : "value"}
|
|
736
736
|
>
|
|
737
737
|
{component}
|
|
@@ -114,22 +114,24 @@ class HttpService {
|
|
|
114
114
|
rpcMethodName = "";
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
if (jsonObject) {
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
if (!this.__checkJSONObjectSecurity(jsonObject)) {
|
|
118
|
+
if (jsonObject) {
|
|
119
|
+
ajaxOptions.data = jsonObject;
|
|
120
|
+
}
|
|
120
121
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
if (ajaxOptions.rpcMethodName) {
|
|
123
|
+
delete ajaxOptions.rpcMethodName;
|
|
124
|
+
}
|
|
124
125
|
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
ajaxOptions.type = "post";
|
|
127
|
+
ajaxOptions.dataType = "json";
|
|
127
128
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
if (!ajaxOptions.url) {
|
|
130
|
+
ajaxOptions.url = this.requestContextPath + rpcMethodName;
|
|
131
|
+
}
|
|
131
132
|
|
|
132
|
-
|
|
133
|
+
return $.ajax(ajaxOptions);
|
|
134
|
+
}
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
__postForMock(mockOptions) {
|
|
@@ -337,7 +339,7 @@ class HttpService {
|
|
|
337
339
|
return;
|
|
338
340
|
}
|
|
339
341
|
|
|
340
|
-
let containsHTML = /<(br|basefont|hr|input|source|frame|param|area|meta|!--|col|link|option|base|img|wbr|!DOCTYPE).*?>|<(a|abbr|acronym|address|applet|article|aside|audio|b|bdi|bdo|big|blockquote|body|button|canvas|caption|center|cite|code|colgroup|command|datalist|dd|del|details|dfn|dialog|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frameset|head|header|hgroup|h1|h2|h3|h4|h5|h6|html|i|iframe|ins|kbd|keygen|label|legend|li|map|mark|menu|meter|nav|noframes|noscript|object|ol|optgroup|output|p|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video).*?<\/\2>/i.test(str);
|
|
342
|
+
let containsHTML = /<(br|basefont|hr|input|source|frame|param|area|meta|!--|col|link|option|base|img|wbr|!DOCTYPE).*?>|<(a|abbr|acronym|address|applet|article|aside|audio|b|bdi|bdo|big|blockquote|body|button|canvas|caption|center|cite|code|colgroup|command|datalist|dd|del|details|dfn|dialog|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frameset|head|header|hgroup|h1|h2|h3|h4|h5|h6|html|i|iframe|ins|kbd|keygen|label|legend|li|map|mark|menu|meter|nav|noframes|noscript|object|ol|optgroup|output|p|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|svg).*?<\/\2>/i.test(str);
|
|
341
343
|
if (containsHTML) {
|
|
342
344
|
throw new Error("不安全的输入,请检查!【" + str + "】");
|
|
343
345
|
}
|