@bchr/bchr-front-lib 0.3.114 → 0.3.118
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.
|
@@ -105,8 +105,6 @@ var LeftOrgTreeRightPersonGridForSelectPsnModal = /*#__PURE__*/function (_React$
|
|
|
105
105
|
});
|
|
106
106
|
|
|
107
107
|
_defineProperty(_assertThisInitialized(_this2), "onSelect", function (event) {
|
|
108
|
-
debugger;
|
|
109
|
-
|
|
110
108
|
var that = _assertThisInitialized(_this2);
|
|
111
109
|
|
|
112
110
|
if (!event) {
|
|
@@ -180,6 +178,27 @@ var LeftOrgTreeRightPersonGridForSelectPsnModal = /*#__PURE__*/function (_React$
|
|
|
180
178
|
}));
|
|
181
179
|
});
|
|
182
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
|
+
|
|
183
202
|
_this2.orgTreeRef = /*#__PURE__*/_react["default"].createRef();
|
|
184
203
|
|
|
185
204
|
var _this = _assertThisInitialized(_this2);
|
|
@@ -214,7 +233,6 @@ var LeftOrgTreeRightPersonGridForSelectPsnModal = /*#__PURE__*/function (_React$
|
|
|
214
233
|
}
|
|
215
234
|
},
|
|
216
235
|
requestEnd: function requestEnd(e) {
|
|
217
|
-
debugger;
|
|
218
236
|
var currentState = _this.state;
|
|
219
237
|
|
|
220
238
|
if (currentState.isInitSelectedRootOrg) {
|
|
@@ -445,7 +463,7 @@ var LeftOrgTreeRightPersonGridForSelectPsnModal = /*#__PURE__*/function (_React$
|
|
|
445
463
|
requestFailed: "加载失败.",
|
|
446
464
|
loading: "正在加载中..."
|
|
447
465
|
};
|
|
448
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
466
|
+
return /*#__PURE__*/_react["default"].createElement(_bchrFrontLib.SModal, {
|
|
449
467
|
className: "left-org-tree-right-person-grid-modal ".concat(this.props.className ? this.props.className : ''),
|
|
450
468
|
title: "\u4EBA\u5458\u53C2\u7167",
|
|
451
469
|
visible: true,
|
|
@@ -486,7 +504,32 @@ var LeftOrgTreeRightPersonGridForSelectPsnModal = /*#__PURE__*/function (_React$
|
|
|
486
504
|
onDataStateChange: this.onDataStateChange.bind(this),
|
|
487
505
|
onSelectionChange: this.onGridRowSelectionChange,
|
|
488
506
|
onHeaderSelectionChange: this.onGridHeaderSelectionChange
|
|
489
|
-
}), /*#__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, {
|
|
490
533
|
locked: true,
|
|
491
534
|
field: "selected",
|
|
492
535
|
title: "\u9009\u62E9",
|
|
@@ -131,24 +131,14 @@ var HttpService = /*#__PURE__*/function () {
|
|
|
131
131
|
rpcMethodName = "";
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
ajaxOptions.data = jsonObject;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (ajaxOptions.rpcMethodName) {
|
|
140
|
-
delete ajaxOptions.rpcMethodName;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
ajaxOptions.type = "post";
|
|
144
|
-
ajaxOptions.dataType = "json";
|
|
145
|
-
|
|
146
|
-
if (!ajaxOptions.url) {
|
|
147
|
-
ajaxOptions.url = this.requestContextPath + rpcMethodName;
|
|
148
|
-
}
|
|
134
|
+
ajaxOptions.type = "post";
|
|
135
|
+
ajaxOptions.dataType = "json";
|
|
149
136
|
|
|
150
|
-
|
|
137
|
+
if (!ajaxOptions.url) {
|
|
138
|
+
ajaxOptions.url = this.requestContextPath + rpcMethodName;
|
|
151
139
|
}
|
|
140
|
+
|
|
141
|
+
return _jquery["default"].ajax(ajaxOptions);
|
|
152
142
|
}
|
|
153
143
|
}, {
|
|
154
144
|
key: "__postForMock",
|
|
@@ -324,7 +314,7 @@ var HttpService = /*#__PURE__*/function () {
|
|
|
324
314
|
var containsHTML = /<(noframes|noscript|object|script|video).*?<\/\2>/i.test(str);
|
|
325
315
|
|
|
326
316
|
if (containsHTML) {
|
|
327
|
-
throw new Error("
|
|
317
|
+
throw new Error("不安全的输入,请检查!【" + str + "】");
|
|
328
318
|
}
|
|
329
319
|
}
|
|
330
320
|
}, {
|
|
@@ -364,7 +354,7 @@ var HttpService = /*#__PURE__*/function () {
|
|
|
364
354
|
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
355
|
|
|
366
356
|
if (containsHTML) {
|
|
367
|
-
throw new Error("
|
|
357
|
+
throw new Error("不安全的输入,请检查!【" + str + "】");
|
|
368
358
|
}
|
|
369
359
|
}
|
|
370
360
|
}, {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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
|
-
import {GridRowSequenceNumberCell, SmartMessage, HttpService} from "@bchr/bchr-front-lib";
|
|
5
|
+
import {GridRowSequenceNumberCell, SmartMessage, HttpService, SModal} from "@bchr/bchr-front-lib";
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -46,7 +46,6 @@ class LeftOrgTreeRightPersonGridForSelectPsnModal extends React.Component {
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
requestEnd: function (e) {
|
|
49
|
-
debugger
|
|
50
49
|
let currentState = _this.state;
|
|
51
50
|
|
|
52
51
|
if (currentState.isInitSelectedRootOrg) {
|
|
@@ -194,7 +193,6 @@ class LeftOrgTreeRightPersonGridForSelectPsnModal extends React.Component {
|
|
|
194
193
|
* @param event
|
|
195
194
|
*/
|
|
196
195
|
onSelect = (event) => {
|
|
197
|
-
debugger
|
|
198
196
|
let that = this;
|
|
199
197
|
|
|
200
198
|
if (!event) {
|
|
@@ -363,6 +361,28 @@ class LeftOrgTreeRightPersonGridForSelectPsnModal extends React.Component {
|
|
|
363
361
|
})
|
|
364
362
|
}
|
|
365
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
|
+
|
|
366
386
|
onOk() {
|
|
367
387
|
let {selectedPsnList} = this.state;
|
|
368
388
|
|
|
@@ -383,7 +403,7 @@ class LeftOrgTreeRightPersonGridForSelectPsnModal extends React.Component {
|
|
|
383
403
|
};
|
|
384
404
|
|
|
385
405
|
return (
|
|
386
|
-
<
|
|
406
|
+
<SModal className={`left-org-tree-right-person-grid-modal ${this.props.className? this.props.className : ''}`}
|
|
387
407
|
title="人员参照"
|
|
388
408
|
visible={true}
|
|
389
409
|
centered
|
|
@@ -424,16 +444,32 @@ class LeftOrgTreeRightPersonGridForSelectPsnModal extends React.Component {
|
|
|
424
444
|
onSelectionChange={this.onGridRowSelectionChange}
|
|
425
445
|
onHeaderSelectionChange={this.onGridHeaderSelectionChange}
|
|
426
446
|
>
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
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
|
+
}
|
|
437
473
|
<GridColumn field="sequence_number" title="序号" width="50px" className={"text-center"} headerClassName={"text-center"} width="55px" sortable={false} cell={GridRowSequenceNumberCell}/>
|
|
438
474
|
<GridColumn field="name" title="姓名" className={"text-center"} headerClassName={"text-center"} width="120px" />
|
|
439
475
|
<GridColumn field="code" title="人员编码" className={"text-center"} headerClassName={"text-center"} width="120px" />
|
|
@@ -443,7 +479,7 @@ class LeftOrgTreeRightPersonGridForSelectPsnModal extends React.Component {
|
|
|
443
479
|
</Grid>
|
|
444
480
|
</div>
|
|
445
481
|
</div>
|
|
446
|
-
</
|
|
482
|
+
</SModal>
|
|
447
483
|
)
|
|
448
484
|
}
|
|
449
485
|
}
|
|
@@ -114,24 +114,14 @@ class HttpService {
|
|
|
114
114
|
rpcMethodName = "";
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
ajaxOptions.data = jsonObject;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (ajaxOptions.rpcMethodName) {
|
|
123
|
-
delete ajaxOptions.rpcMethodName;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
ajaxOptions.type = "post";
|
|
127
|
-
ajaxOptions.dataType = "json";
|
|
128
|
-
|
|
129
|
-
if (!ajaxOptions.url) {
|
|
130
|
-
ajaxOptions.url = this.requestContextPath + rpcMethodName;
|
|
131
|
-
}
|
|
117
|
+
ajaxOptions.type = "post";
|
|
118
|
+
ajaxOptions.dataType = "json";
|
|
132
119
|
|
|
133
|
-
|
|
120
|
+
if (!ajaxOptions.url) {
|
|
121
|
+
ajaxOptions.url = this.requestContextPath + rpcMethodName;
|
|
134
122
|
}
|
|
123
|
+
|
|
124
|
+
return $.ajax(ajaxOptions);
|
|
135
125
|
}
|
|
136
126
|
|
|
137
127
|
__postForMock(mockOptions) {
|
|
@@ -303,7 +293,7 @@ class HttpService {
|
|
|
303
293
|
|
|
304
294
|
let containsHTML = /<(noframes|noscript|object|script|video).*?<\/\2>/i.test(str);
|
|
305
295
|
if (containsHTML) {
|
|
306
|
-
throw new Error("
|
|
296
|
+
throw new Error("不安全的输入,请检查!【" + str + "】");
|
|
307
297
|
}
|
|
308
298
|
}
|
|
309
299
|
|
|
@@ -341,7 +331,7 @@ class HttpService {
|
|
|
341
331
|
|
|
342
332
|
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
333
|
if (containsHTML) {
|
|
344
|
-
throw new Error("
|
|
334
|
+
throw new Error("不安全的输入,请检查!【" + str + "】");
|
|
345
335
|
}
|
|
346
336
|
}
|
|
347
337
|
|