@bchr/bchr-front-lib 0.3.111 → 0.3.115
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/lib/base/AppFormulaFunctions.js +11 -3
- package/lib/base/layout/ui_tpl/form/FormForModify.js +19 -19
- package/lib/base/widgets/stree/LeftOrgTreeRightPersonGridForSelectPsnModal.js +556 -0
- package/package.json +1 -1
- package/src/base/AppFormulaFunctions.js +12 -4
- package/src/base/layout/ui_tpl/form/FormForModify.js +20 -19
- package/src/base/widgets/stree/LeftOrgTreeRightPersonGridForSelectPsnModal.js +449 -0
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _treeview = _interopRequireDefault(require("@progress/kendo-treeview-react-wrapper/dist/npm/treeview"));
|
|
11
|
+
|
|
12
|
+
var _antd = require("antd");
|
|
13
|
+
|
|
14
|
+
var _kendoReactGrid = require("@progress/kendo-react-grid");
|
|
15
|
+
|
|
16
|
+
var _bchrFrontLib = require("@bchr/bchr-front-lib");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
21
|
+
|
|
22
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
+
|
|
24
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
25
|
+
|
|
26
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
27
|
+
|
|
28
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
29
|
+
|
|
30
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
31
|
+
|
|
32
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
|
+
|
|
34
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
35
|
+
|
|
36
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
37
|
+
|
|
38
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
39
|
+
|
|
40
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
41
|
+
|
|
42
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
43
|
+
|
|
44
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
45
|
+
|
|
46
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
47
|
+
|
|
48
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
49
|
+
|
|
50
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
51
|
+
|
|
52
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
53
|
+
|
|
54
|
+
var Search = _antd.Input.Search;
|
|
55
|
+
|
|
56
|
+
var LeftOrgTreeRightPersonGridForSelectPsnModal = /*#__PURE__*/function (_React$Component) {
|
|
57
|
+
_inherits(LeftOrgTreeRightPersonGridForSelectPsnModal, _React$Component);
|
|
58
|
+
|
|
59
|
+
var _super = _createSuper(LeftOrgTreeRightPersonGridForSelectPsnModal);
|
|
60
|
+
|
|
61
|
+
function LeftOrgTreeRightPersonGridForSelectPsnModal(_props) {
|
|
62
|
+
var _this2;
|
|
63
|
+
|
|
64
|
+
_classCallCheck(this, LeftOrgTreeRightPersonGridForSelectPsnModal);
|
|
65
|
+
|
|
66
|
+
_this2 = _super.call(this, _props);
|
|
67
|
+
|
|
68
|
+
_defineProperty(_assertThisInitialized(_this2), "buildQueryOrgTreeNodeURL", function (e) {
|
|
69
|
+
var parent_org_node_pk = 0;
|
|
70
|
+
|
|
71
|
+
if (_this2.orgTreeRef.current && _this2.orgTreeRef.current.widgetInstance) {
|
|
72
|
+
parent_org_node_pk = e.pk;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return _this2.http().getRequestPath("queryOrgDataByCurrentUserAuthOfLazyLoad?&parent_org_pk=".concat(parent_org_node_pk, "&org_expanded_level=").concat(_this2.props.org_expanded_level, "&is_implicit_auth=").concat(_this2.props.is_implicit_auth));
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
_defineProperty(_assertThisInitialized(_this2), "treeNodeTemplate", function (props) {
|
|
79
|
+
if (props.item.org_type == 1) {
|
|
80
|
+
return "<div class=\"tree-node-box\" key={props.item.pk}>\n <span class=\"iconfont icon-bchr-corporate-repor\"></span><span>".concat(props.item.name, "</span>\n </div>");
|
|
81
|
+
} else if (props.item.org_type == 2) {
|
|
82
|
+
return "<div class=\"tree-node-box\" key={props.item.pk}>\n <span class=\"iconfont icon-bchr-virtual-dept\"></span><span>".concat(props.item.name, "</span>\n </div>");
|
|
83
|
+
} else if (props.item.org_type == 3) {
|
|
84
|
+
return "<div class=\"tree-node-box\" key={props.item.pk}>\n <span class=\"iconfont icon-bchr-post-manage\"></span><span>".concat(props.item.name, "</span>\n </div>");
|
|
85
|
+
} else {
|
|
86
|
+
return "<div class=\"tree-node-box\" key={props.item.pk}>\n <span class=\"iconfont icon-bchr-person1\"></span><span>".concat(props.item.name, "</span>\n </div>");
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
_defineProperty(_assertThisInitialized(_this2), "onPersonSearch", function (e) {
|
|
91
|
+
var that = _assertThisInitialized(_this2);
|
|
92
|
+
|
|
93
|
+
Promise.all([function () {
|
|
94
|
+
var currentState = that.state;
|
|
95
|
+
var personNameKeyWords = currentState.personNameKeyWords;
|
|
96
|
+
|
|
97
|
+
if (!e && e.trim() == personNameKeyWords) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
that.setState(_objectSpread(_objectSpread({}, currentState), {}, {
|
|
102
|
+
personNameKeyWords: e ? e.trim() : null
|
|
103
|
+
}));
|
|
104
|
+
}()]).then(_this2.queryPsnList);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
_defineProperty(_assertThisInitialized(_this2), "onSelect", function (event) {
|
|
108
|
+
var that = _assertThisInitialized(_this2);
|
|
109
|
+
|
|
110
|
+
if (!event) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
Promise.all([function () {
|
|
115
|
+
var selectedOrgNode;
|
|
116
|
+
|
|
117
|
+
if (event.node) {
|
|
118
|
+
selectedOrgNode = that.orgTreeRef.current.widgetInstance.dataItem(event.node);
|
|
119
|
+
} else {
|
|
120
|
+
selectedOrgNode = event;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
var currentState = that.state;
|
|
124
|
+
var gridOperator = {
|
|
125
|
+
skip: 0,
|
|
126
|
+
take: currentState.gridOperator.take
|
|
127
|
+
};
|
|
128
|
+
that.setState(_objectSpread(_objectSpread({}, currentState), {}, {
|
|
129
|
+
selectedOrg: selectedOrgNode,
|
|
130
|
+
gridOperator: gridOperator,
|
|
131
|
+
selectedPsnList: [],
|
|
132
|
+
isAllPsnSelected: false
|
|
133
|
+
}));
|
|
134
|
+
}()]).then(_this2.queryPsnList);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
_defineProperty(_assertThisInitialized(_this2), "onGridHeaderSelectionChange", function () {
|
|
138
|
+
var currentState = _this2.state;
|
|
139
|
+
var pagerData = currentState.pagerData;
|
|
140
|
+
var isAllPsnSelected = !currentState.isAllPsnSelected;
|
|
141
|
+
|
|
142
|
+
if (pagerData.data && pagerData.data.length > 0) {
|
|
143
|
+
pagerData.data.forEach(function (dataItem) {
|
|
144
|
+
dataItem.selected = isAllPsnSelected;
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
_this2.setState(_objectSpread(_objectSpread({}, currentState), {}, {
|
|
149
|
+
pagerData: pagerData,
|
|
150
|
+
isAllPsnSelected: isAllPsnSelected,
|
|
151
|
+
selectedPsnList: []
|
|
152
|
+
}));
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
_defineProperty(_assertThisInitialized(_this2), "onGridRowSelectionChange", function (e) {
|
|
156
|
+
var selectedRowData = e.dataItem;
|
|
157
|
+
selectedRowData.selected = !selectedRowData.selected;
|
|
158
|
+
var currentState = _this2.state;
|
|
159
|
+
var selectedPsnList = [];
|
|
160
|
+
var psnList = currentState.pagerData.data;
|
|
161
|
+
var isAllPsnSelected = true;
|
|
162
|
+
|
|
163
|
+
if (psnList && psnList.length > 0) {
|
|
164
|
+
psnList.forEach(function (dataItem) {
|
|
165
|
+
if (dataItem.selected) {
|
|
166
|
+
selectedPsnList.push(dataItem);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (selectedPsnList.length != currentState.pagerData.total) {
|
|
172
|
+
isAllPsnSelected = false;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
_this2.setState(_objectSpread(_objectSpread({}, currentState), {}, {
|
|
176
|
+
selectedPsnList: selectedPsnList,
|
|
177
|
+
isAllPsnSelected: isAllPsnSelected
|
|
178
|
+
}));
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
_this2.orgTreeRef = /*#__PURE__*/_react["default"].createRef();
|
|
182
|
+
|
|
183
|
+
var _this = _assertThisInitialized(_this2);
|
|
184
|
+
|
|
185
|
+
_this2.state = {
|
|
186
|
+
selectedOrg: null,
|
|
187
|
+
gridOperator: {
|
|
188
|
+
skip: 0,
|
|
189
|
+
take: 20
|
|
190
|
+
},
|
|
191
|
+
pagerData: {
|
|
192
|
+
data: [],
|
|
193
|
+
total: 0
|
|
194
|
+
},
|
|
195
|
+
personNameKeyWords: null,
|
|
196
|
+
isAllPsnSelected: false,
|
|
197
|
+
selectedPsnList: [],
|
|
198
|
+
isInitSelectedRootOrg: false
|
|
199
|
+
};
|
|
200
|
+
_this2.dataSource = {
|
|
201
|
+
transport: {
|
|
202
|
+
read: {
|
|
203
|
+
url: _this2.buildQueryOrgTreeNodeURL,
|
|
204
|
+
dataType: "json",
|
|
205
|
+
Type: "POST"
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
schema: {
|
|
209
|
+
model: {
|
|
210
|
+
id: "pk",
|
|
211
|
+
hasChildren: "b_has_child"
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
requestEnd: function requestEnd(e) {
|
|
215
|
+
var currentState = _this.state;
|
|
216
|
+
|
|
217
|
+
if (currentState.isInitSelectedRootOrg) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (!e.response || e.response.length == 0) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (_this.props.isDefaultSelectedFirstOrg) {
|
|
226
|
+
var expand_pk_path = e.response[0].pk_path.split("/");
|
|
227
|
+
expand_pk_path = expand_pk_path.slice(1, expand_pk_path.length - 1);
|
|
228
|
+
expand_pk_path.unshift(0);
|
|
229
|
+
var last_node_pk = expand_pk_path[expand_pk_path.length - 1];
|
|
230
|
+
var treeView = _this.orgTreeRef.current.widgetInstance;
|
|
231
|
+
treeView.expandPath(expand_pk_path, function () {
|
|
232
|
+
var nodeDataItem = treeView.dataSource.get(last_node_pk);
|
|
233
|
+
|
|
234
|
+
if (nodeDataItem && nodeDataItem.uid) {
|
|
235
|
+
var treeNodeEle = treeView.findByUid(nodeDataItem.uid);
|
|
236
|
+
|
|
237
|
+
if (treeNodeEle && treeNodeEle.length > 0) {
|
|
238
|
+
treeView.element.find(".searched").removeClass("searched");
|
|
239
|
+
treeNodeEle.find(".k-in:first").addClass("searched");
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
_this.scrollTreeView(treeView, nodeDataItem);
|
|
243
|
+
|
|
244
|
+
treeView.select(treeNodeEle);
|
|
245
|
+
|
|
246
|
+
_this.onSelect(nodeDataItem);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
_this.setState(_objectSpread(_objectSpread({}, currentState), {}, {
|
|
252
|
+
isInitSelectedRootOrg: true
|
|
253
|
+
}));
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
_this2.queryPsnList = _this2.queryPsnList.bind(_assertThisInitialized(_this2));
|
|
257
|
+
_this2.onOk = _this2.onOk.bind(_assertThisInitialized(_this2));
|
|
258
|
+
return _this2;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
_createClass(LeftOrgTreeRightPersonGridForSelectPsnModal, [{
|
|
262
|
+
key: "componentDidMount",
|
|
263
|
+
value: function componentDidMount() {}
|
|
264
|
+
}, {
|
|
265
|
+
key: "getFunctionLetBasePath",
|
|
266
|
+
value: function getFunctionLetBasePath() {
|
|
267
|
+
if (!this.props.functionLetBasePath) {
|
|
268
|
+
throw new Error("请为组件注入属性【functionLetBasePath】");
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return this.props.functionLetBasePath;
|
|
272
|
+
}
|
|
273
|
+
}, {
|
|
274
|
+
key: "scrollTreeView",
|
|
275
|
+
value: function scrollTreeView(treeView, nodeDataItem) {
|
|
276
|
+
var treeNodeEle = treeView.findByUid(nodeDataItem.uid);
|
|
277
|
+
var treeViewHeight = treeView.element.parent().height();
|
|
278
|
+
var treeViewTop = treeView.element.offset().top;
|
|
279
|
+
var treeNodeTop = treeNodeEle.offset().top;
|
|
280
|
+
var scrollTop = treeView.element.parent().scrollTop();
|
|
281
|
+
scrollTop = treeNodeTop - treeViewTop - treeViewHeight / 2;
|
|
282
|
+
treeView.element.parent().scrollTop(scrollTop);
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Lazy Loading URL
|
|
286
|
+
* @param e
|
|
287
|
+
* @returns {*}
|
|
288
|
+
*/
|
|
289
|
+
|
|
290
|
+
}, {
|
|
291
|
+
key: "http",
|
|
292
|
+
value: function http() {
|
|
293
|
+
return new _bchrFrontLib.HttpService(this.props.appConfig.back_service_rpc_prefix + this.getFunctionLetBasePath(), this.props.appConfig);
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* 组织 Node Render
|
|
297
|
+
* @param props
|
|
298
|
+
* @returns {string}
|
|
299
|
+
*/
|
|
300
|
+
|
|
301
|
+
}, {
|
|
302
|
+
key: "queryPsnList",
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* 查询人员数据
|
|
306
|
+
* @returns {Promise<void>}
|
|
307
|
+
*/
|
|
308
|
+
value: function () {
|
|
309
|
+
var _queryPsnList = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
310
|
+
var that, currentState, selectedOrg, personNameKeyWords, gridOperator, isAllPsnSelected, selectedPsnList, newPagerData, queryOrgPkParems, queryPsnParams, i, selectedPsnItem, j, dataItem;
|
|
311
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
312
|
+
while (1) {
|
|
313
|
+
switch (_context.prev = _context.next) {
|
|
314
|
+
case 0:
|
|
315
|
+
_context.prev = 0;
|
|
316
|
+
that = this;
|
|
317
|
+
currentState = that.state;
|
|
318
|
+
selectedOrg = currentState.selectedOrg;
|
|
319
|
+
personNameKeyWords = currentState.personNameKeyWords;
|
|
320
|
+
gridOperator = currentState.gridOperator;
|
|
321
|
+
isAllPsnSelected = currentState.isAllPsnSelected;
|
|
322
|
+
selectedPsnList = currentState.selectedPsnList;
|
|
323
|
+
newPagerData = {
|
|
324
|
+
data: [],
|
|
325
|
+
total: 0
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
if (!(selectedOrg && selectedOrg.pk)) {
|
|
329
|
+
_context.next = 15;
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
queryOrgPkParems = {
|
|
334
|
+
parent_org_pk: selectedOrg.pk,
|
|
335
|
+
is_implicit_auth: that.props.is_implicit_auth
|
|
336
|
+
};
|
|
337
|
+
queryPsnParams = {
|
|
338
|
+
parent_org_pk: selectedOrg.pk,
|
|
339
|
+
is_implicit_auth: that.props.is_implicit_auth,
|
|
340
|
+
person_name_key_words: personNameKeyWords,
|
|
341
|
+
page_index: gridOperator.skip / gridOperator.take + 1,
|
|
342
|
+
page_size: gridOperator.take
|
|
343
|
+
};
|
|
344
|
+
_context.next = 14;
|
|
345
|
+
return that.http().post("queryPersonListByOrgPksAndPersonName", queryPsnParams);
|
|
346
|
+
|
|
347
|
+
case 14:
|
|
348
|
+
newPagerData = _context.sent;
|
|
349
|
+
|
|
350
|
+
case 15:
|
|
351
|
+
if (newPagerData && newPagerData.data && newPagerData.data.length > 0) {
|
|
352
|
+
if (isAllPsnSelected) {
|
|
353
|
+
newPagerData.data.forEach(function (dataItem) {
|
|
354
|
+
dataItem.selected = isAllPsnSelected;
|
|
355
|
+
});
|
|
356
|
+
} else {
|
|
357
|
+
if (selectedPsnList && selectedPsnList.length > 0) {
|
|
358
|
+
for (i in selectedPsnList) {
|
|
359
|
+
selectedPsnItem = selectedPsnList[i];
|
|
360
|
+
|
|
361
|
+
for (j in newPagerData.data) {
|
|
362
|
+
dataItem = newPagerData.data[j];
|
|
363
|
+
|
|
364
|
+
if (dataItem.pk == selectedPsnItem.pk) {
|
|
365
|
+
dataItem.selected = true;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
this.setState(_objectSpread(_objectSpread({}, currentState), {}, {
|
|
374
|
+
pagerData: _objectSpread({}, newPagerData)
|
|
375
|
+
}));
|
|
376
|
+
_context.next = 22;
|
|
377
|
+
break;
|
|
378
|
+
|
|
379
|
+
case 19:
|
|
380
|
+
_context.prev = 19;
|
|
381
|
+
_context.t0 = _context["catch"](0);
|
|
382
|
+
this.dealAjaxException(_context.t0);
|
|
383
|
+
|
|
384
|
+
case 22:
|
|
385
|
+
case "end":
|
|
386
|
+
return _context.stop();
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}, _callee, this, [[0, 19]]);
|
|
390
|
+
}));
|
|
391
|
+
|
|
392
|
+
function queryPsnList() {
|
|
393
|
+
return _queryPsnList.apply(this, arguments);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
return queryPsnList;
|
|
397
|
+
}()
|
|
398
|
+
/**
|
|
399
|
+
* 页码&页大小发生变化
|
|
400
|
+
* @param e
|
|
401
|
+
*/
|
|
402
|
+
|
|
403
|
+
}, {
|
|
404
|
+
key: "onDataStateChange",
|
|
405
|
+
value: function onDataStateChange(e) {
|
|
406
|
+
var that = this;
|
|
407
|
+
Promise.all([function () {
|
|
408
|
+
var currentState = that.state;
|
|
409
|
+
that.setState(_objectSpread(_objectSpread({}, currentState), {}, {
|
|
410
|
+
gridOperator: {
|
|
411
|
+
skip: e.data.skip,
|
|
412
|
+
take: e.data.take
|
|
413
|
+
}
|
|
414
|
+
}));
|
|
415
|
+
}()]).then(this.queryPsnList);
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Header Select
|
|
419
|
+
*/
|
|
420
|
+
|
|
421
|
+
}, {
|
|
422
|
+
key: "onOk",
|
|
423
|
+
value: function onOk() {
|
|
424
|
+
var selectedPsnList = this.state.selectedPsnList;
|
|
425
|
+
|
|
426
|
+
if (!selectedPsnList || selectedPsnList.length == 0) {
|
|
427
|
+
_bchrFrontLib.SmartMessage.info("请选择人员");
|
|
428
|
+
|
|
429
|
+
return;
|
|
430
|
+
} else {
|
|
431
|
+
this.props.onOk(selectedPsnList);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}, {
|
|
435
|
+
key: "render",
|
|
436
|
+
value: function render() {
|
|
437
|
+
var _this3 = this,
|
|
438
|
+
_React$createElement;
|
|
439
|
+
|
|
440
|
+
var treeViewMessages = {
|
|
441
|
+
retry: "重新加载",
|
|
442
|
+
requestFailed: "加载失败.",
|
|
443
|
+
loading: "正在加载中..."
|
|
444
|
+
};
|
|
445
|
+
return /*#__PURE__*/_react["default"].createElement(_bchrFrontLib.SModal, {
|
|
446
|
+
className: "left-org-tree-right-person-grid-modal ".concat(this.props.className ? this.props.className : ''),
|
|
447
|
+
title: "\u4EBA\u5458\u53C2\u7167",
|
|
448
|
+
visible: true,
|
|
449
|
+
centered: true,
|
|
450
|
+
width: '1000px',
|
|
451
|
+
onCancel: this.props.onCancel,
|
|
452
|
+
onOk: this.onOk
|
|
453
|
+
}, /*#__PURE__*/_react["default"].createElement(Search, {
|
|
454
|
+
className: "person-search-box",
|
|
455
|
+
placeholder: "\u4EBA\u5458\u641C\u7D22",
|
|
456
|
+
onSearch: this.onPersonSearch
|
|
457
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
458
|
+
className: "left-org-tree-right-person-grid-container"
|
|
459
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
460
|
+
className: "left-org-tree-box"
|
|
461
|
+
}, /*#__PURE__*/_react["default"].createElement(_treeview["default"], {
|
|
462
|
+
dataSource: this.dataSource,
|
|
463
|
+
messages: treeViewMessages,
|
|
464
|
+
expandIcons: false,
|
|
465
|
+
dataTextField: "name",
|
|
466
|
+
template: this.treeNodeTemplate,
|
|
467
|
+
ref: this.orgTreeRef,
|
|
468
|
+
select: this.onSelect
|
|
469
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
470
|
+
className: "right-psn-grid-box"
|
|
471
|
+
}, /*#__PURE__*/_react["default"].createElement(_kendoReactGrid.Grid, _extends({
|
|
472
|
+
data: this.state.pagerData.data,
|
|
473
|
+
total: this.state.pagerData.total
|
|
474
|
+
}, this.state.gridOperator, {
|
|
475
|
+
pageable: {
|
|
476
|
+
pageSizes: [20, 50, 100, 200],
|
|
477
|
+
type: 'numeric'
|
|
478
|
+
},
|
|
479
|
+
pageSize: 20,
|
|
480
|
+
sortable: true,
|
|
481
|
+
resizable: true,
|
|
482
|
+
selectedField: "selected",
|
|
483
|
+
onDataStateChange: this.onDataStateChange.bind(this),
|
|
484
|
+
onSelectionChange: this.onGridRowSelectionChange,
|
|
485
|
+
onHeaderSelectionChange: this.onGridHeaderSelectionChange
|
|
486
|
+
}), /*#__PURE__*/_react["default"].createElement(_kendoReactGrid.GridColumn, {
|
|
487
|
+
locked: true,
|
|
488
|
+
field: "selected",
|
|
489
|
+
title: "\u9009\u62E9",
|
|
490
|
+
width: "50px",
|
|
491
|
+
className: "text-center locked",
|
|
492
|
+
headerClassName: "text-center",
|
|
493
|
+
sortable: false,
|
|
494
|
+
headerCell: function headerCell(props) {
|
|
495
|
+
return /*#__PURE__*/_react["default"].createElement(_antd.Checkbox, {
|
|
496
|
+
checked: _this3.state.isAllPsnSelected,
|
|
497
|
+
onChange: _this3.onGridHeaderSelectionChange
|
|
498
|
+
});
|
|
499
|
+
},
|
|
500
|
+
cell: function cell(props) {
|
|
501
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
502
|
+
className: "text-center locked_column k-grid-content-sticky",
|
|
503
|
+
style: {
|
|
504
|
+
left: "0px",
|
|
505
|
+
right: "0px"
|
|
506
|
+
}
|
|
507
|
+
}, /*#__PURE__*/_react["default"].createElement(_antd.Checkbox, {
|
|
508
|
+
checked: props.dataItem.selected,
|
|
509
|
+
onChange: _this3.onGridRowSelectionChange.bind(_this3, props)
|
|
510
|
+
}));
|
|
511
|
+
}
|
|
512
|
+
}), /*#__PURE__*/_react["default"].createElement(_kendoReactGrid.GridColumn, (_React$createElement = {
|
|
513
|
+
field: "sequence_number",
|
|
514
|
+
title: "\u5E8F\u53F7",
|
|
515
|
+
width: "50px",
|
|
516
|
+
className: "text-center",
|
|
517
|
+
headerClassName: "text-center"
|
|
518
|
+
}, _defineProperty(_React$createElement, "width", "55px"), _defineProperty(_React$createElement, "sortable", false), _defineProperty(_React$createElement, "cell", _bchrFrontLib.GridRowSequenceNumberCell), _React$createElement)), /*#__PURE__*/_react["default"].createElement(_kendoReactGrid.GridColumn, {
|
|
519
|
+
field: "name",
|
|
520
|
+
title: "\u59D3\u540D",
|
|
521
|
+
className: "text-center",
|
|
522
|
+
headerClassName: "text-center",
|
|
523
|
+
width: "120px"
|
|
524
|
+
}), /*#__PURE__*/_react["default"].createElement(_kendoReactGrid.GridColumn, {
|
|
525
|
+
field: "code",
|
|
526
|
+
title: "\u4EBA\u5458\u7F16\u7801",
|
|
527
|
+
className: "text-center",
|
|
528
|
+
headerClassName: "text-center",
|
|
529
|
+
width: "120px"
|
|
530
|
+
}), /*#__PURE__*/_react["default"].createElement(_kendoReactGrid.GridColumn, {
|
|
531
|
+
field: "corp_ext_name",
|
|
532
|
+
title: "\u5355\u4F4D\u540D\u79F0",
|
|
533
|
+
className: "text-center",
|
|
534
|
+
headerClassName: "text-center",
|
|
535
|
+
width: "180px"
|
|
536
|
+
}), /*#__PURE__*/_react["default"].createElement(_kendoReactGrid.GridColumn, {
|
|
537
|
+
field: "dept_ext_name",
|
|
538
|
+
title: "\u90E8\u95E8\u540D\u79F0",
|
|
539
|
+
className: "text-center",
|
|
540
|
+
headerClassName: "text-center",
|
|
541
|
+
width: "180px"
|
|
542
|
+
}), /*#__PURE__*/_react["default"].createElement(_kendoReactGrid.GridColumn, {
|
|
543
|
+
field: "post_ext_name",
|
|
544
|
+
title: "\u5C97\u4F4D\u540D\u79F0",
|
|
545
|
+
className: "text-center",
|
|
546
|
+
headerClassName: "text-center",
|
|
547
|
+
width: "180px"
|
|
548
|
+
})))));
|
|
549
|
+
}
|
|
550
|
+
}]);
|
|
551
|
+
|
|
552
|
+
return LeftOrgTreeRightPersonGridForSelectPsnModal;
|
|
553
|
+
}(_react["default"].Component);
|
|
554
|
+
|
|
555
|
+
var _default = LeftOrgTreeRightPersonGridForSelectPsnModal;
|
|
556
|
+
exports["default"] = _default;
|
package/package.json
CHANGED
|
@@ -48,13 +48,19 @@ window.AppFormulaFunctions = {
|
|
|
48
48
|
|
|
49
49
|
// YH use 生活补贴标准级别
|
|
50
50
|
lifeBTLevel : function (post_wa_rank_pk, work_place_pk) {
|
|
51
|
-
if (!post_wa_rank_pk || !work_place_pk
|
|
52
|
-
|
|
51
|
+
if (!post_wa_rank_pk || !work_place_pk) {
|
|
52
|
+
console.log("lifeBTLevel param post_wa_rank_pk: " + post_wa_rank_pk + ",work_place_pk" + work_place_pk);
|
|
53
|
+
return null;
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
post_wa_rank_pk = post_wa_rank_pk + "";
|
|
56
57
|
work_place_pk = work_place_pk + "";
|
|
57
58
|
|
|
59
|
+
if (post_wa_rank_pk == "0" || post_wa_rank_pk == "0")
|
|
60
|
+
{
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
58
64
|
// M8 和T6以上级别
|
|
59
65
|
let postWaRankOfDeptLevelAndUp = [
|
|
60
66
|
"601801", "601802", "601803", "601804", "601805", "601806", "601807", "601808",
|
|
@@ -93,6 +99,7 @@ window.AppFormulaFunctions = {
|
|
|
93
99
|
// YH use 房补级别
|
|
94
100
|
houseBTLevel : function (post_wa_rank_pk, work_place_pk, person_class_pk) {
|
|
95
101
|
if (!post_wa_rank_pk || !work_place_pk || !person_class_pk) {
|
|
102
|
+
console.log("houseBTLevel param post_wa_rank_pk: " + post_wa_rank_pk + ",work_place_pk" + work_place_pk + ", person_class_pk=" + person_class_pk);
|
|
96
103
|
return null
|
|
97
104
|
}
|
|
98
105
|
|
|
@@ -105,7 +112,7 @@ window.AppFormulaFunctions = {
|
|
|
105
112
|
return null;
|
|
106
113
|
}
|
|
107
114
|
|
|
108
|
-
//100006、100011、101003、101006、103006、103011
|
|
115
|
+
//100006、100011、101003、101006、103006、103011 总共六类人员类别有房补
|
|
109
116
|
let houseBTPersonClassPKs = ["100006", "100011", "101003", "101006", "103006", "103011"];
|
|
110
117
|
if (houseBTPersonClassPKs.findIndex(item => item == person_class_pk) === -1) {
|
|
111
118
|
return null;
|
|
@@ -179,13 +186,14 @@ window.AppFormulaFunctions = {
|
|
|
179
186
|
// YH use 意外险级别
|
|
180
187
|
accidentInsLevel : function (execute_wa_grade_pk) {
|
|
181
188
|
if (!execute_wa_grade_pk) {
|
|
189
|
+
console.log("accidentInsLevel param execute_wa_grade_pk: " + execute_wa_grade_pk)
|
|
182
190
|
return null;
|
|
183
191
|
}
|
|
184
192
|
|
|
185
193
|
execute_wa_grade_pk = execute_wa_grade_pk + "";
|
|
186
194
|
|
|
187
195
|
if (execute_wa_grade_pk == "0") {
|
|
188
|
-
return null
|
|
196
|
+
return null;
|
|
189
197
|
}
|
|
190
198
|
|
|
191
199
|
// M1
|