@bchr/bchr-front-lib 0.3.115 → 0.3.119
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.
|
@@ -178,6 +178,27 @@ var LeftOrgTreeRightPersonGridForSelectPsnModal = /*#__PURE__*/function (_React$
|
|
|
178
178
|
}));
|
|
179
179
|
});
|
|
180
180
|
|
|
181
|
+
_defineProperty(_assertThisInitialized(_this2), "selectPsnRadiosChange", function (e) {
|
|
182
|
+
var currentState = _this2.state;
|
|
183
|
+
var selectedPsnList = [];
|
|
184
|
+
var psnList = currentState.pagerData.data;
|
|
185
|
+
|
|
186
|
+
if (psnList && psnList.length > 0) {
|
|
187
|
+
psnList.forEach(function (dataItem) {
|
|
188
|
+
if (dataItem.pk == e.dataItem.pk) {
|
|
189
|
+
dataItem['selected'] = true;
|
|
190
|
+
selectedPsnList.push(dataItem);
|
|
191
|
+
} else {
|
|
192
|
+
dataItem['selected'] = false;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
_this2.setState(_objectSpread(_objectSpread({}, currentState), {}, {
|
|
197
|
+
selectedPsnList: selectedPsnList
|
|
198
|
+
}));
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
|
|
181
202
|
_this2.orgTreeRef = /*#__PURE__*/_react["default"].createRef();
|
|
182
203
|
|
|
183
204
|
var _this = _assertThisInitialized(_this2);
|
|
@@ -483,7 +504,32 @@ var LeftOrgTreeRightPersonGridForSelectPsnModal = /*#__PURE__*/function (_React$
|
|
|
483
504
|
onDataStateChange: this.onDataStateChange.bind(this),
|
|
484
505
|
onSelectionChange: this.onGridRowSelectionChange,
|
|
485
506
|
onHeaderSelectionChange: this.onGridHeaderSelectionChange
|
|
486
|
-
}), /*#__PURE__*/_react["default"].createElement(_kendoReactGrid.GridColumn, {
|
|
507
|
+
}), this.props.selectType && this.props.selectType === 'single' ? /*#__PURE__*/_react["default"].createElement(_kendoReactGrid.GridColumn, {
|
|
508
|
+
locked: true,
|
|
509
|
+
field: "selected",
|
|
510
|
+
title: "\u9009\u62E9",
|
|
511
|
+
width: "55px",
|
|
512
|
+
className: "text-center",
|
|
513
|
+
sortable: false,
|
|
514
|
+
headerCell: function headerCell(props) {
|
|
515
|
+
return /*#__PURE__*/_react["default"].createElement("span", null, "\u9009\u62E9");
|
|
516
|
+
},
|
|
517
|
+
cell: function cell(props) {
|
|
518
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
519
|
+
className: "text-center locked_column k-grid-content-sticky",
|
|
520
|
+
style: {
|
|
521
|
+
left: "0px",
|
|
522
|
+
right: "0px"
|
|
523
|
+
}
|
|
524
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Radio, {
|
|
525
|
+
name: "selectDef",
|
|
526
|
+
defaultChecked: props.dataItem.selected,
|
|
527
|
+
className: "grid-radio",
|
|
528
|
+
key: props.dataIndex,
|
|
529
|
+
onChange: _this3.selectPsnRadiosChange.bind(_this3, props)
|
|
530
|
+
}));
|
|
531
|
+
}
|
|
532
|
+
}) : /*#__PURE__*/_react["default"].createElement(_kendoReactGrid.GridColumn, {
|
|
487
533
|
locked: true,
|
|
488
534
|
field: "selected",
|
|
489
535
|
title: "\u9009\u62E9",
|
|
@@ -131,24 +131,22 @@ var HttpService = /*#__PURE__*/function () {
|
|
|
131
131
|
rpcMethodName = "";
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (ajaxOptions.rpcMethodName) {
|
|
140
|
-
delete ajaxOptions.rpcMethodName;
|
|
141
|
-
}
|
|
134
|
+
if (jsonObject) {
|
|
135
|
+
ajaxOptions.data = jsonObject;
|
|
136
|
+
}
|
|
142
137
|
|
|
143
|
-
|
|
144
|
-
ajaxOptions.
|
|
138
|
+
if (ajaxOptions.rpcMethodName) {
|
|
139
|
+
delete ajaxOptions.rpcMethodName;
|
|
140
|
+
}
|
|
145
141
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
142
|
+
ajaxOptions.type = "post";
|
|
143
|
+
ajaxOptions.dataType = "json";
|
|
149
144
|
|
|
150
|
-
|
|
145
|
+
if (!ajaxOptions.url) {
|
|
146
|
+
ajaxOptions.url = this.requestContextPath + rpcMethodName;
|
|
151
147
|
}
|
|
148
|
+
|
|
149
|
+
return _jquery["default"].ajax(ajaxOptions);
|
|
152
150
|
}
|
|
153
151
|
}, {
|
|
154
152
|
key: "__postForMock",
|
|
@@ -324,7 +322,7 @@ var HttpService = /*#__PURE__*/function () {
|
|
|
324
322
|
var containsHTML = /<(noframes|noscript|object|script|video).*?<\/\2>/i.test(str);
|
|
325
323
|
|
|
326
324
|
if (containsHTML) {
|
|
327
|
-
throw new Error("
|
|
325
|
+
throw new Error("不安全的输入,请检查!【" + str + "】");
|
|
328
326
|
}
|
|
329
327
|
}
|
|
330
328
|
}, {
|
|
@@ -364,7 +362,7 @@ var HttpService = /*#__PURE__*/function () {
|
|
|
364
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);
|
|
365
363
|
|
|
366
364
|
if (containsHTML) {
|
|
367
|
-
throw new Error("
|
|
365
|
+
throw new Error("不安全的输入,请检查!【" + str + "】");
|
|
368
366
|
}
|
|
369
367
|
}
|
|
370
368
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import TreeView from "@progress/kendo-treeview-react-wrapper/dist/npm/treeview";
|
|
3
|
-
import {Checkbox, Input,
|
|
3
|
+
import {Checkbox, Input, Radio} from "antd";
|
|
4
4
|
import {Grid, GridColumn} from "@progress/kendo-react-grid";
|
|
5
5
|
import {GridRowSequenceNumberCell, SmartMessage, HttpService, SModal} from "@bchr/bchr-front-lib";
|
|
6
6
|
|
|
@@ -361,6 +361,28 @@ class LeftOrgTreeRightPersonGridForSelectPsnModal extends React.Component {
|
|
|
361
361
|
})
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
+
selectPsnRadiosChange = (e) => {
|
|
365
|
+
let currentState = this.state;
|
|
366
|
+
let selectedPsnList = [];
|
|
367
|
+
let psnList = currentState.pagerData.data;
|
|
368
|
+
|
|
369
|
+
if (psnList && psnList.length > 0) {
|
|
370
|
+
psnList.forEach(dataItem => {
|
|
371
|
+
if (dataItem.pk == e.dataItem.pk) {
|
|
372
|
+
dataItem['selected'] = true;
|
|
373
|
+
selectedPsnList.push(dataItem)
|
|
374
|
+
} else {
|
|
375
|
+
dataItem['selected'] = false;
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
this.setState({
|
|
380
|
+
...currentState,
|
|
381
|
+
selectedPsnList
|
|
382
|
+
})
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
364
386
|
onOk() {
|
|
365
387
|
let {selectedPsnList} = this.state;
|
|
366
388
|
|
|
@@ -422,16 +444,32 @@ class LeftOrgTreeRightPersonGridForSelectPsnModal extends React.Component {
|
|
|
422
444
|
onSelectionChange={this.onGridRowSelectionChange}
|
|
423
445
|
onHeaderSelectionChange={this.onGridHeaderSelectionChange}
|
|
424
446
|
>
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
447
|
+
{
|
|
448
|
+
this.props.selectType && this.props.selectType ==='single' ? <GridColumn locked field="selected" title="选择" width="55px" className={"text-center"}
|
|
449
|
+
sortable={false}
|
|
450
|
+
headerCell={props => {
|
|
451
|
+
return (<span>选择</span>)
|
|
452
|
+
}}
|
|
453
|
+
cell={(props) => {
|
|
454
|
+
return (
|
|
455
|
+
<td className={"text-center locked_column k-grid-content-sticky"} style={{left: "0px", right: "0px"}}>
|
|
456
|
+
<Radio name='selectDef' defaultChecked={props.dataItem.selected}
|
|
457
|
+
className={"grid-radio"} key={props.dataIndex}
|
|
458
|
+
onChange={this.selectPsnRadiosChange.bind(this, props)}
|
|
459
|
+
></Radio>
|
|
460
|
+
</td>)
|
|
461
|
+
}}/> : <GridColumn locked field="selected" title="选择" width="50px" className={"text-center locked"}
|
|
462
|
+
headerClassName={"text-center"} sortable={false} headerCell={props => {
|
|
463
|
+
return <Checkbox checked={this.state.isAllPsnSelected} onChange={this.onGridHeaderSelectionChange}></Checkbox>
|
|
464
|
+
}}
|
|
465
|
+
cell={props => {
|
|
466
|
+
return <td className={"text-center locked_column k-grid-content-sticky"} style={{left: "0px", right: "0px"}}>
|
|
467
|
+
<Checkbox checked={props.dataItem.selected} onChange={this.onGridRowSelectionChange.bind(this, props)}></Checkbox>
|
|
468
|
+
</td>
|
|
469
|
+
}}
|
|
470
|
+
/>
|
|
471
|
+
|
|
472
|
+
}
|
|
435
473
|
<GridColumn field="sequence_number" title="序号" width="50px" className={"text-center"} headerClassName={"text-center"} width="55px" sortable={false} cell={GridRowSequenceNumberCell}/>
|
|
436
474
|
<GridColumn field="name" title="姓名" className={"text-center"} headerClassName={"text-center"} width="120px" />
|
|
437
475
|
<GridColumn field="code" title="人员编码" className={"text-center"} headerClassName={"text-center"} width="120px" />
|
|
@@ -114,24 +114,22 @@ class HttpService {
|
|
|
114
114
|
rpcMethodName = "";
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
if (
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (ajaxOptions.rpcMethodName) {
|
|
123
|
-
delete ajaxOptions.rpcMethodName;
|
|
124
|
-
}
|
|
117
|
+
if (jsonObject) {
|
|
118
|
+
ajaxOptions.data = jsonObject;
|
|
119
|
+
}
|
|
125
120
|
|
|
126
|
-
|
|
127
|
-
ajaxOptions.
|
|
121
|
+
if (ajaxOptions.rpcMethodName) {
|
|
122
|
+
delete ajaxOptions.rpcMethodName;
|
|
123
|
+
}
|
|
128
124
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
125
|
+
ajaxOptions.type = "post";
|
|
126
|
+
ajaxOptions.dataType = "json";
|
|
132
127
|
|
|
133
|
-
|
|
128
|
+
if (!ajaxOptions.url) {
|
|
129
|
+
ajaxOptions.url = this.requestContextPath + rpcMethodName;
|
|
134
130
|
}
|
|
131
|
+
|
|
132
|
+
return $.ajax(ajaxOptions);
|
|
135
133
|
}
|
|
136
134
|
|
|
137
135
|
__postForMock(mockOptions) {
|
|
@@ -303,7 +301,7 @@ class HttpService {
|
|
|
303
301
|
|
|
304
302
|
let containsHTML = /<(noframes|noscript|object|script|video).*?<\/\2>/i.test(str);
|
|
305
303
|
if (containsHTML) {
|
|
306
|
-
throw new Error("
|
|
304
|
+
throw new Error("不安全的输入,请检查!【" + str + "】");
|
|
307
305
|
}
|
|
308
306
|
}
|
|
309
307
|
|
|
@@ -341,7 +339,7 @@ class HttpService {
|
|
|
341
339
|
|
|
342
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);
|
|
343
341
|
if (containsHTML) {
|
|
344
|
-
throw new Error("
|
|
342
|
+
throw new Error("不安全的输入,请检查!【" + str + "】");
|
|
345
343
|
}
|
|
346
344
|
}
|
|
347
345
|
|