dlt-for-react 1.0.23 → 1.1.0
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/README.md +12 -2
- package/lib/components/Button/index.js +79 -0
- package/lib/components/HqSelector/HqLsrySelector/index.js +3 -5
- package/lib/components/HqSelector/HqRySelector/index.js +3 -5
- package/lib/components/HqSelector/HqWzSelector/index.js +3 -5
- package/lib/components/KyEditableTable/component.js +3 -5
- package/lib/components/KyEditableTable/index.js +7 -13
- package/lib/components/KyExcel/index.js +3 -5
- package/lib/components/KyInputPicker/render.js +13 -43
- package/lib/components/KyInputPicker/setting-checkbox.js +3 -5
- package/lib/components/KyInputPicker/setting-multiSelect.js +3 -5
- package/lib/components/KyInputPicker/setting-nhcascader.js +3 -5
- package/lib/components/KyInputPicker/setting-select.js +3 -5
- package/lib/components/KyInputPicker/setting-stu-selector.js +3 -5
- package/lib/components/KyInputPicker/setting-tea-selector.js +3 -5
- package/lib/components/KyTable/checkButtons.js +4 -7
- package/lib/components/KyTree/index.js +6 -16
- package/lib/components/KyUpload/index.js +13 -21
- package/lib/components/NHAuditPanel/config/Axios.js +263 -0
- package/lib/components/NHAuditPanel/config/api.js +479 -0
- package/lib/components/NHAuditPanel/config/data.js +156 -0
- package/lib/components/NHAuditPanel/config/typeMap.js +1234 -0
- package/lib/components/NHAuditPanel/config/uiValidate.js +92 -0
- package/lib/components/NHAuditPanel/index.js +413 -0
- package/lib/components/NHAuditPanel/node.js +619 -0
- package/lib/components/NHCascader/index.js +355 -0
- package/lib/components/NHCheckboxGroup/index.js +135 -0
- package/lib/components/NHDynamicFormShow/baseInfo/index.js +194 -0
- package/lib/components/NHDynamicFormShow/custom/index.js +553 -0
- package/lib/components/NHDynamicFormShow/customModule/common/CommonMethod.js +43 -0
- package/lib/components/NHDynamicFormShow/customModule/czxy/qgzx/EditForm.js +1113 -0
- package/lib/components/NHDynamicFormShow/customModule/czxy/qgzx/index.js +263 -0
- package/lib/components/NHDynamicFormShow/customModule/czxy/xfjm/EditForm.js +880 -0
- package/lib/components/NHDynamicFormShow/customModule/czxy/xfjm/index.js +171 -0
- package/lib/components/NHDynamicFormShow/customModule/czxy/zxj/EditForm.js +865 -0
- package/lib/components/NHDynamicFormShow/customModule/czxy/zxj/index.js +138 -0
- package/lib/components/NHDynamicFormShow/customModule/eszy/zsxxhd/EditForm.js +571 -0
- package/lib/components/NHDynamicFormShow/customModule/eszy/zsxxhd/index.js +147 -0
- package/lib/components/NHDynamicFormShow/customModule/eszy/zybjtz/EditForm.js +474 -0
- package/lib/components/NHDynamicFormShow/customModule/eszy/zybjtz/index.js +139 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/cqzg/EditForm.js +506 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/cqzg/index.js +143 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/gwsb/EditForm.js +1074 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/gwsb/index.js +172 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/qjgl/EditForm.js +927 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/qjgl/index.js +195 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/sxsqj/EditForm.js +1064 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/sxsqj/index.js +183 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/jxj/EditForm.js +763 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/jxj/index.js +137 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/lzjxj/EditForm.js +819 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/lzjxj/index.js +137 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/qgzx/EditForm.js +700 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/qgzx/index.js +162 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/xsqj/EditForm.js +743 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/xsqj/index.js +177 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/zxj/EditForm.js +848 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/zxj/index.js +138 -0
- package/lib/components/NHDynamicFormShow/customModule/hljwgy/qjgl/EditForm.js +777 -0
- package/lib/components/NHDynamicFormShow/customModule/hljwgy/qjgl/index.js +161 -0
- package/lib/components/NHDynamicFormShow/customModule/hljwgy/xjgl/EditForm.js +706 -0
- package/lib/components/NHDynamicFormShow/customModule/hljwgy/xjgl/index.js +130 -0
- package/lib/components/NHDynamicFormShow/customModule/jhysxy/cfjcsq/cfjcEditForm.js +413 -0
- package/lib/components/NHDynamicFormShow/customModule/jhysxy/cfjcsq/index.js +135 -0
- package/lib/components/NHDynamicFormShow/customModule/jhysxy/xsqj/EditForm.js +1013 -0
- package/lib/components/NHDynamicFormShow/customModule/jhysxy/xsqj/index.js +175 -0
- package/lib/components/NHDynamicFormShow/customModule/jjrlx/EditForm.js +1345 -0
- package/lib/components/NHDynamicFormShow/customModule/jjrlx/index.js +274 -0
- package/lib/components/NHDynamicFormShow/customModule/jxj/EditForm.js +669 -0
- package/lib/components/NHDynamicFormShow/customModule/jxj/index.js +134 -0
- package/lib/components/NHDynamicFormShow/customModule/jxsl/fqkns/EditForm.js +378 -0
- package/lib/components/NHDynamicFormShow/customModule/jxsl/fqkns/index.js +120 -0
- package/lib/components/NHDynamicFormShow/customModule/jxsl/xwryfjjd/EditForm.js +638 -0
- package/lib/components/NHDynamicFormShow/customModule/jxsl/xwryfjjd/index.js +133 -0
- package/lib/components/NHDynamicFormShow/customModule/qgzx/EditForm.js +965 -0
- package/lib/components/NHDynamicFormShow/customModule/qgzx/index.js +237 -0
- package/lib/components/NHDynamicFormShow/customModule/qjgl/EditForm.js +823 -0
- package/lib/components/NHDynamicFormShow/customModule/qjgl/index.js +188 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/jqlssq/EditForm.js +401 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/jqlssq/index.js +472 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/EditForm.js +304 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHCascader/index.js +375 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/RadioGroup.js +118 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/index.js +62 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/input-const.js +55 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/render.js +1238 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/index.js +375 -0
- package/lib/components/NHDynamicFormShow/customModule/rych/collective/EditForm.js +554 -0
- package/lib/components/NHDynamicFormShow/customModule/rych/collective/index.js +130 -0
- package/lib/components/NHDynamicFormShow/customModule/rych/personal/EditForm.js +542 -0
- package/lib/components/NHDynamicFormShow/customModule/rych/personal/index.js +133 -0
- package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/collective/EditForm.js +575 -0
- package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/collective/index.js +130 -0
- package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/personal/EditForm.js +563 -0
- package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/personal/index.js +133 -0
- package/lib/components/NHDynamicFormShow/customModule/whcz/qjgl/EditForm.js +745 -0
- package/lib/components/NHDynamicFormShow/customModule/whcz/qjgl/index.js +164 -0
- package/lib/components/NHDynamicFormShow/customModule/whcz/rccrxy/EditForm.js +587 -0
- package/lib/components/NHDynamicFormShow/customModule/whcz/rccrxy/index.js +143 -0
- package/lib/components/NHDynamicFormShow/customModule/whdlqjgl/EditForm.js +743 -0
- package/lib/components/NHDynamicFormShow/customModule/whdlqjgl/index.js +172 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/jjrlx/EditForm.js +1410 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/jjrlx/index.js +274 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/jxj/EditForm.js +755 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/jxj/index.js +130 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/qjgl/EditForm.js +814 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/qjgl/index.js +188 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/zxj/EditForm.js +769 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/zxj/index.js +130 -0
- package/lib/components/NHDynamicFormShow/customModule/whgcrych/EditForm.js +1004 -0
- package/lib/components/NHDynamicFormShow/customModule/whgcrych/index.js +126 -0
- package/lib/components/NHDynamicFormShow/customModule/whtl/jsrzsq/EditForm.js +503 -0
- package/lib/components/NHDynamicFormShow/customModule/whtl/jsrzsq/index.js +149 -0
- package/lib/components/NHDynamicFormShow/customModule/whtlyhk/EditForm.js +379 -0
- package/lib/components/NHDynamicFormShow/customModule/whtlyhk/index.js +148 -0
- package/lib/components/NHDynamicFormShow/customModule/whtlzxj/EditForm.js +748 -0
- package/lib/components/NHDynamicFormShow/customModule/whtlzxj/index.js +135 -0
- package/lib/components/NHDynamicFormShow/customModule/whtlzy/jxj/EditForm.js +762 -0
- package/lib/components/NHDynamicFormShow/customModule/whtlzy/jxj/index.js +134 -0
- package/lib/components/NHDynamicFormShow/customModule/wjcf/cfjc/cfjcEditForm.js +682 -0
- package/lib/components/NHDynamicFormShow/customModule/wjcf/cfjc/index.js +135 -0
- package/lib/components/NHDynamicFormShow/customModule/wjcf/wjsb/index.js +152 -0
- package/lib/components/NHDynamicFormShow/customModule/wjcf/wjsb/wjsbEditForm.js +783 -0
- package/lib/components/NHDynamicFormShow/customModule/zxj/EditForm.js +764 -0
- package/lib/components/NHDynamicFormShow/customModule/zxj/index.js +138 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/cfjcsq/cfjcEditForm.js +677 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/cfjcsq/index.js +138 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/qjgl/EditForm.js +1173 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/qjgl/index.js +242 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/rcgl/rcxwgrdj/IndividualRegistForm.js +862 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/rcgl/rcxwgrdj/IndividualRegistIndex.js +201 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/stuinfo/messageInfo.js +196 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/wjsb/index.js +167 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/wjsb/wjsbEditForm.js +1096 -0
- package/lib/components/NHDynamicFormShow/index.js +647 -0
- package/lib/components/NHDynamicFormShow/oneOnMany/cardForm/cardItem/index.js +279 -0
- package/lib/components/NHDynamicFormShow/oneOnMany/cardForm/index.js +206 -0
- package/lib/components/NHDynamicFormShow/oneOnMany/index.js +419 -0
- package/lib/components/NHDynamicFormShow/oneOnOne/EditForm.js +401 -0
- package/lib/components/NHDynamicFormShow/oneOnOne/index.js +271 -0
- package/lib/components/NHImagePicker/index.js +554 -0
- package/lib/components/NHInputPicker/RadioGroup.js +118 -0
- package/lib/components/NHInputPicker/index.js +62 -0
- package/lib/components/NHInputPicker/input-const.js +55 -0
- package/lib/components/NHInputPicker/render.js +1271 -0
- package/lib/components/NHListView/index.js +374 -0
- package/lib/components/NHMapGeolocation/index.js +537 -0
- package/lib/components/NHMapGeolocation/initMap/initGdMap.js +104 -0
- package/lib/components/NHMapGeolocation/initMap/initTencentMap.js +138 -0
- package/lib/components/NHMapGeolocation/style.js +51 -0
- package/lib/components/NHMultiSelect/index.js +272 -0
- package/lib/components/NHRadioGroup/index.js +118 -0
- package/lib/components/NHSelect/index.js +364 -0
- package/lib/components/NHTreeMenu/index.js +126 -0
- package/lib/components/NHTreeMenu/treeNode.js +164 -0
- package/lib/components/StuSelector/index.js +611 -0
- package/lib/index.js +161 -116
- package/lib/layouts/KyInputPicker/edit-page.js +585 -0
- package/lib/layouts/KyInputPicker/index.js +220 -0
- package/lib/layouts/KyInputPicker/input-const.js +134 -0
- package/lib/layouts/KyInputPicker/render.js +2477 -0
- package/lib/layouts/KyInputPicker/setting-checkbox.js +850 -0
- package/lib/layouts/KyInputPicker/setting-datepicker.js +430 -0
- package/lib/layouts/KyInputPicker/setting-datetimepicker.js +443 -0
- package/lib/layouts/KyInputPicker/setting-input.js +555 -0
- package/lib/layouts/KyInputPicker/setting-inputNumber.js +612 -0
- package/lib/layouts/KyInputPicker/setting-monthpicker.js +434 -0
- package/lib/layouts/KyInputPicker/setting-multiSelect.js +532 -0
- package/lib/layouts/KyInputPicker/setting-nhcascader.js +584 -0
- package/lib/layouts/KyInputPicker/setting-old-upload.js +428 -0
- package/lib/layouts/KyInputPicker/setting-radio.js +468 -0
- package/lib/layouts/KyInputPicker/setting-rangepicker.js +466 -0
- package/lib/layouts/KyInputPicker/setting-select.js +534 -0
- package/lib/layouts/KyInputPicker/setting-stu-selector.js +507 -0
- package/lib/layouts/KyInputPicker/setting-switch.js +274 -0
- package/lib/layouts/KyInputPicker/setting-tea-selector.js +507 -0
- package/lib/layouts/KyInputPicker/setting-textarea.js +619 -0
- package/lib/layouts/KyInputPicker/setting-timepicker.js +437 -0
- package/lib/layouts/KyInputPicker/setting-upload.js +766 -0
- package/lib/layouts/KyModal/buildTitle.js +81 -0
- package/lib/layouts/KyModal/dragM.js +127 -0
- package/lib/layouts/KyModal/index.js +321 -0
- package/lib/layouts/KyPreview/index.js +219 -0
- package/lib/layouts/KyUpload/index.js +1155 -0
- package/lib/layouts/LeftMenu/index.js +5 -11
- package/lib/layouts/NavigationBar/index.js +4 -10
- package/lib/layouts/Top/editPassWord.js +5 -7
- package/lib/layouts/Top/index.js +6 -20
- package/lib/layouts/TopMenu/index.js +11 -14
- package/lib/layouts/layout/index.js +7 -13
- package/lib/layouts/{Login → login}/index-pre.js +3 -5
- package/lib/layouts/{Login → login}/index.js +6 -8
- package/lib/layouts/{Login → login}/login.js +8 -17
- package/lib/layouts/mixTop/index.js +13 -28
- package/lib/layouts/settingDrawer/index.js +3 -5
- package/lib/routes/AuthorizedRoute.js +7 -13
- package/lib/utils/NHCore.js +46 -2
- package/lib/utils/base64.js +238 -0
- package/lib/utils/browserJudge.js +33 -0
- package/lib/utils/common.js +18 -20
- package/lib/utils/createUuid.js +11 -31
- package/lib/utils/device.js +44 -0
- package/lib/utils/dynamicLoadCss.js +14 -0
- package/lib/utils/dynamicLoadJs.js +21 -0
- package/lib/utils/getLoginUser.js +1 -1
- package/lib/utils/getSize.js +2 -11
- package/lib/utils/getStyle.js +26 -0
- package/lib/utils/getSuitHeight.js +49 -0
- package/lib/utils/hasAuth.js +11 -0
- package/lib/utils/index.js +1 -34
- package/lib/utils/loadJS.js +40 -0
- package/package.json +1 -1
- /package/lib/layouts/{Login → login}/lyPassword.js +0 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _whiteSpace = require('antd-mobile/lib/white-space');
|
|
8
|
+
|
|
9
|
+
var _whiteSpace2 = _interopRequireDefault(_whiteSpace);
|
|
10
|
+
|
|
11
|
+
var _card = require('antd-mobile/lib/card');
|
|
12
|
+
|
|
13
|
+
var _card2 = _interopRequireDefault(_card);
|
|
14
|
+
|
|
15
|
+
var _list = require('antd-mobile/lib/list');
|
|
16
|
+
|
|
17
|
+
var _list2 = _interopRequireDefault(_list);
|
|
18
|
+
|
|
19
|
+
var _toast = require('antd-mobile/lib/toast');
|
|
20
|
+
|
|
21
|
+
var _toast2 = _interopRequireDefault(_toast);
|
|
22
|
+
|
|
23
|
+
var _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; };
|
|
24
|
+
|
|
25
|
+
var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
26
|
+
|
|
27
|
+
require('antd-mobile/lib/white-space/style/css');
|
|
28
|
+
|
|
29
|
+
require('antd-mobile/lib/card/style/css');
|
|
30
|
+
|
|
31
|
+
require('antd-mobile/lib/list/style/css');
|
|
32
|
+
|
|
33
|
+
require('antd-mobile/lib/toast/style/css');
|
|
34
|
+
|
|
35
|
+
var _react = require('react');
|
|
36
|
+
|
|
37
|
+
var _react2 = _interopRequireDefault(_react);
|
|
38
|
+
|
|
39
|
+
var _moment = require('moment');
|
|
40
|
+
|
|
41
|
+
var _moment2 = _interopRequireDefault(_moment);
|
|
42
|
+
|
|
43
|
+
var _render = require('./NHInputPicker/render');
|
|
44
|
+
|
|
45
|
+
var _render2 = _interopRequireDefault(_render);
|
|
46
|
+
|
|
47
|
+
var _rcForm = require('rc-form');
|
|
48
|
+
|
|
49
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
50
|
+
|
|
51
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
52
|
+
|
|
53
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
54
|
+
|
|
55
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
56
|
+
|
|
57
|
+
var EditInitForm = function (_React$Component) {
|
|
58
|
+
_inherits(EditInitForm, _React$Component);
|
|
59
|
+
|
|
60
|
+
function EditInitForm(props) {
|
|
61
|
+
_classCallCheck(this, EditInitForm);
|
|
62
|
+
|
|
63
|
+
var _this = _possibleConstructorReturn(this, (EditInitForm.__proto__ || Object.getPrototypeOf(EditInitForm)).call(this, props));
|
|
64
|
+
|
|
65
|
+
_this.onChange = function (seq, v, t, item) {
|
|
66
|
+
var value = v;
|
|
67
|
+
var text = t;
|
|
68
|
+
//如果是级联,则只需要取最后的一个值
|
|
69
|
+
if (item.bdkjlx === 'nhcascader' && v != undefined) {
|
|
70
|
+
value = "";
|
|
71
|
+
text = "";
|
|
72
|
+
if (Array.isArray(t)) {
|
|
73
|
+
t.map(function (map) {
|
|
74
|
+
text += map.label;
|
|
75
|
+
value = map.value;
|
|
76
|
+
return map;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
_this.props.onChange && _this.props.onChange(seq, value, text);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
_this.getDataList = function (list) {
|
|
84
|
+
var dataList = [];
|
|
85
|
+
if (list == null) {
|
|
86
|
+
list = [];
|
|
87
|
+
}
|
|
88
|
+
list.map(function (item, index) {
|
|
89
|
+
//此处只展示sfxs为1(显示)的字段
|
|
90
|
+
if (item.sfxs === '1') {
|
|
91
|
+
var required = item.sfbt === '1' ? true : false;
|
|
92
|
+
var render = undefined;
|
|
93
|
+
var isUpload = false;
|
|
94
|
+
var deV = undefined;
|
|
95
|
+
var defaultValueText = void 0;
|
|
96
|
+
if (item.bdkjcs && item.bdkjcs !== "" && item.bdkjcs !== undefined) {
|
|
97
|
+
var parameter = JSON.parse(item.bdkjcs);
|
|
98
|
+
if (Array.isArray(parameter.defaultValue) === true) {
|
|
99
|
+
deV = "";
|
|
100
|
+
} else {
|
|
101
|
+
deV = parameter.defaultValue ? parameter.defaultValue : "";
|
|
102
|
+
}
|
|
103
|
+
if (item.bdkjlx === 'radio') {
|
|
104
|
+
var _ref = parameter || {},
|
|
105
|
+
_ref$options = _ref.options,
|
|
106
|
+
options = _ref$options === undefined ? [] : _ref$options;
|
|
107
|
+
|
|
108
|
+
defaultValueText = (options.find(function (item) {
|
|
109
|
+
return item.value === deV;
|
|
110
|
+
}) || {}).label;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
var value = "";
|
|
114
|
+
var text = item.text;
|
|
115
|
+
if (item.value !== "" && item.value !== undefined && item.value) {
|
|
116
|
+
value = item.value;
|
|
117
|
+
} else {
|
|
118
|
+
value = deV;
|
|
119
|
+
text = defaultValueText;
|
|
120
|
+
if (value !== "" && value !== undefined && value) {
|
|
121
|
+
if (!item.text && item.text === "" && item.text === undefined) {
|
|
122
|
+
item.text = "";
|
|
123
|
+
}
|
|
124
|
+
_this.props.onChange && _this.props.onChange(item.seq, value, text, true);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (item.bdkjlx === 'upload') {
|
|
128
|
+
isUpload = true;
|
|
129
|
+
}
|
|
130
|
+
//如果是日期(datepicker),初始化的值需要做处理
|
|
131
|
+
if (item.bdkjlx === 'datepicker') {
|
|
132
|
+
value = item.value ? new Date((0, _moment2.default)(item.value, 'YYYY-MM-DD').toDate()) : undefined;
|
|
133
|
+
}
|
|
134
|
+
//如果是日期时间(datetimepicker),初始化的值需要做处理
|
|
135
|
+
if (item.bdkjlx === 'datetimepicker') {
|
|
136
|
+
value = item.value ? new Date((0, _moment2.default)(item.value, 'YYYY-MM-DD HH:mm:ss').toDate()) : undefined;
|
|
137
|
+
}
|
|
138
|
+
if (item.bdkjlx === 'timepicker') {
|
|
139
|
+
value = item.value ? new Date((0, _moment2.default)(item.value, 'HH:mm:ss').toDate()) : undefined;
|
|
140
|
+
}
|
|
141
|
+
//如果是日期范围(rangepicker),暂时不支持
|
|
142
|
+
if (item.bdkjlx === 'rangepicker') {
|
|
143
|
+
_toast2.default.fail('表单不支持日期范围控件', 1);
|
|
144
|
+
}
|
|
145
|
+
var otherParams = {};
|
|
146
|
+
if (item.parentfieldid) {
|
|
147
|
+
var row = list.find(function (row) {
|
|
148
|
+
return row.id === item.parentfieldid;
|
|
149
|
+
});
|
|
150
|
+
if (row) {
|
|
151
|
+
otherParams.parentValue = row.value;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// console.log("获取到的性别:", this.props.gender);
|
|
156
|
+
var formItemLayout = { wrapperCol: { span: 24 } };
|
|
157
|
+
// let disabled = this.props.isEdit&&item.sfbj==='1'?true:false;
|
|
158
|
+
//let disabled = false;
|
|
159
|
+
//是采集方式为表单控件,且是可编辑的状态
|
|
160
|
+
var isEdit = _this.props.isEdit && item.sfbj === '1' ? true : false;
|
|
161
|
+
if (item.sjcjfsdm === '01') {
|
|
162
|
+
//disabled = !(item.sfbj === '1');
|
|
163
|
+
if (item.sfbj === '1') {
|
|
164
|
+
render = function render() {
|
|
165
|
+
return _react2.default.createElement(_render2.default, _extends({
|
|
166
|
+
id: item.id,
|
|
167
|
+
key: item.id,
|
|
168
|
+
label: item.title,
|
|
169
|
+
value: value,
|
|
170
|
+
form: _this.props.form,
|
|
171
|
+
feature: item.bdkjcs,
|
|
172
|
+
required: required,
|
|
173
|
+
hideLabel: true,
|
|
174
|
+
isEdit: isEdit,
|
|
175
|
+
formItemLayout: formItemLayout
|
|
176
|
+
//disabled={disabled}
|
|
177
|
+
}, otherParams, {
|
|
178
|
+
gender: _this.props.gender,
|
|
179
|
+
otherUrl: '/tsgl/selectCascaderList',
|
|
180
|
+
onChange: function onChange(value, text) {
|
|
181
|
+
_this.onChange(item.seq, value, text, item);
|
|
182
|
+
}
|
|
183
|
+
}));
|
|
184
|
+
};
|
|
185
|
+
} else {
|
|
186
|
+
render = function render() {
|
|
187
|
+
if (isUpload) {
|
|
188
|
+
return _react2.default.createElement(_render2.default, {
|
|
189
|
+
label: item.title,
|
|
190
|
+
value: value,
|
|
191
|
+
feature: item.bdkjcs,
|
|
192
|
+
isEdit: isEdit
|
|
193
|
+
//disabled={disabled}
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
return _react2.default.createElement(
|
|
197
|
+
_list2.default.Item,
|
|
198
|
+
{ extra: item.text, key: item.id, wrap: true, multipleLine: true },
|
|
199
|
+
item.title
|
|
200
|
+
);
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
var map = {
|
|
206
|
+
isUpload: isUpload,
|
|
207
|
+
title: _react2.default.createElement(
|
|
208
|
+
'font',
|
|
209
|
+
{ className: 'dynamic-label-' + item.blm },
|
|
210
|
+
item.title
|
|
211
|
+
),
|
|
212
|
+
text: item.text,
|
|
213
|
+
required: required,
|
|
214
|
+
render: render,
|
|
215
|
+
id: item.id
|
|
216
|
+
};
|
|
217
|
+
dataList.push(map);
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
return dataList;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
_this.state = {};
|
|
224
|
+
return _this;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
_createClass(EditInitForm, [{
|
|
228
|
+
key: 'render',
|
|
229
|
+
value: function render() {
|
|
230
|
+
var _props = this.props,
|
|
231
|
+
form = _props.form,
|
|
232
|
+
isEdit = _props.isEdit,
|
|
233
|
+
list = _props.list,
|
|
234
|
+
title = _props.title;
|
|
235
|
+
|
|
236
|
+
var dataList = this.getDataList(list);
|
|
237
|
+
return isEdit ? _react2.default.createElement(
|
|
238
|
+
_list2.default,
|
|
239
|
+
{ renderHeader: function renderHeader() {
|
|
240
|
+
return title;
|
|
241
|
+
} },
|
|
242
|
+
dataList.map(function (item, index) {
|
|
243
|
+
return item.render !== undefined ? item.render() : _react2.default.createElement(
|
|
244
|
+
_list2.default.Item,
|
|
245
|
+
{ key: item.id, wrap: true, extra: item.text },
|
|
246
|
+
item.title
|
|
247
|
+
);
|
|
248
|
+
})
|
|
249
|
+
) : _react2.default.createElement(
|
|
250
|
+
'div',
|
|
251
|
+
null,
|
|
252
|
+
_react2.default.createElement(
|
|
253
|
+
_card2.default,
|
|
254
|
+
{ full: true },
|
|
255
|
+
_react2.default.createElement(_card2.default.Header, {
|
|
256
|
+
title: _react2.default.createElement(
|
|
257
|
+
'div',
|
|
258
|
+
{ style: { borderLeft: '3px solid #1890ff', paddingLeft: '10px' } },
|
|
259
|
+
title
|
|
260
|
+
)
|
|
261
|
+
}),
|
|
262
|
+
_react2.default.createElement(
|
|
263
|
+
_card2.default.Body,
|
|
264
|
+
null,
|
|
265
|
+
dataList.map(function (item) {
|
|
266
|
+
if (item.isUpload) {
|
|
267
|
+
return _react2.default.createElement(
|
|
268
|
+
'div',
|
|
269
|
+
null,
|
|
270
|
+
_react2.default.createElement(
|
|
271
|
+
'font',
|
|
272
|
+
{ color: 'grey' },
|
|
273
|
+
item.title,
|
|
274
|
+
'\uFF1A '
|
|
275
|
+
),
|
|
276
|
+
item.render(),
|
|
277
|
+
_react2.default.createElement('br', null)
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
return _react2.default.createElement(
|
|
281
|
+
'div',
|
|
282
|
+
null,
|
|
283
|
+
_react2.default.createElement(
|
|
284
|
+
'font',
|
|
285
|
+
{ color: 'grey' },
|
|
286
|
+
item.title,
|
|
287
|
+
'\uFF1A '
|
|
288
|
+
),
|
|
289
|
+
item.text,
|
|
290
|
+
_react2.default.createElement('br', null)
|
|
291
|
+
);
|
|
292
|
+
})
|
|
293
|
+
)
|
|
294
|
+
),
|
|
295
|
+
_react2.default.createElement(_whiteSpace2.default, { size: 'lg' })
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
}]);
|
|
299
|
+
|
|
300
|
+
return EditInitForm;
|
|
301
|
+
}(_react2.default.Component);
|
|
302
|
+
|
|
303
|
+
var EditForm = (0, _rcForm.createForm)()(EditInitForm);
|
|
304
|
+
exports.default = EditForm;
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _picker = require('antd-mobile/lib/picker');
|
|
8
|
+
|
|
9
|
+
var _picker2 = _interopRequireDefault(_picker);
|
|
10
|
+
|
|
11
|
+
var _list = require('antd-mobile/lib/list');
|
|
12
|
+
|
|
13
|
+
var _list2 = _interopRequireDefault(_list);
|
|
14
|
+
|
|
15
|
+
var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
16
|
+
|
|
17
|
+
require('antd-mobile/lib/picker/style/css');
|
|
18
|
+
|
|
19
|
+
require('antd-mobile/lib/list/style/css');
|
|
20
|
+
|
|
21
|
+
var _react = require('react');
|
|
22
|
+
|
|
23
|
+
var _react2 = _interopRequireDefault(_react);
|
|
24
|
+
|
|
25
|
+
var _NHFetch = require('../../../../../../utils/NHFetch');
|
|
26
|
+
|
|
27
|
+
var _NHFetch2 = _interopRequireDefault(_NHFetch);
|
|
28
|
+
|
|
29
|
+
var _propTypes = require('prop-types');
|
|
30
|
+
|
|
31
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
32
|
+
|
|
33
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
34
|
+
|
|
35
|
+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
36
|
+
|
|
37
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
38
|
+
|
|
39
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
40
|
+
|
|
41
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
|
|
42
|
+
* @Description:级联选择
|
|
43
|
+
* @Author: zengweijin
|
|
44
|
+
* @Date: 2019-07-11 11:34:44
|
|
45
|
+
* @LastEditors: zengweijin
|
|
46
|
+
* @LastEditTime: 2020-10-22 14:27:09
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
// import NHFetch from '../../utils/NHFetch'
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
var NHCascader = function (_React$Component) {
|
|
53
|
+
_inherits(NHCascader, _React$Component);
|
|
54
|
+
|
|
55
|
+
function NHCascader(props) {
|
|
56
|
+
_classCallCheck(this, NHCascader);
|
|
57
|
+
|
|
58
|
+
var _this = _possibleConstructorReturn(this, (NHCascader.__proto__ || Object.getPrototypeOf(NHCascader)).call(this, props));
|
|
59
|
+
|
|
60
|
+
_this.getInitData = function (level, cascaderValue, parentOption) {
|
|
61
|
+
var sign = _this.props.sign;
|
|
62
|
+
// let params = {...this.props};
|
|
63
|
+
|
|
64
|
+
var params = {};
|
|
65
|
+
params.nvsx = _this.state.gender; //男女属性
|
|
66
|
+
params.level = level;
|
|
67
|
+
params.sign = sign;
|
|
68
|
+
params.cascaderValue = cascaderValue;
|
|
69
|
+
var baseUrl = _this.props.baseUrl;
|
|
70
|
+
var otherUrl = _this.props.otherUrl ? _this.props.otherUrl : "/proData/selectCascaderList";
|
|
71
|
+
(0, _NHFetch2.default)((baseUrl === undefined ? "" : baseUrl) + otherUrl, 'GET', params).then(function (res) {
|
|
72
|
+
if (res) {
|
|
73
|
+
var data = res.data;
|
|
74
|
+
if (data) {
|
|
75
|
+
if (parentOption) {
|
|
76
|
+
parentOption.loading = false;
|
|
77
|
+
parentOption.children = data;
|
|
78
|
+
_this.setState({
|
|
79
|
+
options: _this.state.options
|
|
80
|
+
});
|
|
81
|
+
} else {
|
|
82
|
+
_this.setState({
|
|
83
|
+
options: data
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
//获取初始值,判断是否需要加载下一级级联数据
|
|
88
|
+
var initValue = _this.state.value;
|
|
89
|
+
if (initValue && initValue.length > 0) {
|
|
90
|
+
var targetOption = data.filter(function (item) {
|
|
91
|
+
return item.value === initValue[level - 1];
|
|
92
|
+
})[0];
|
|
93
|
+
if (targetOption) {
|
|
94
|
+
if (level < initValue.length) {
|
|
95
|
+
_this.getInitData(level + 1, initValue[level - 1], targetOption);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
// 如果没有初始化值,默认加载第一个
|
|
100
|
+
if (level === 1 && !_this.state.options[0].isLeaf) {
|
|
101
|
+
_this.getInitData(level + 1, _this.state.options[0].value, _this.state.options[0]);
|
|
102
|
+
} else if (!parentOption.children[0].isLeaf) {
|
|
103
|
+
_this.getInitData(level + 1, parentOption.children[0].value, parentOption.children[0]);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
} else {
|
|
107
|
+
_this.setState({ options: [] });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
_this.getValues = function (callback) {
|
|
114
|
+
var _this$props = _this.props,
|
|
115
|
+
sign = _this$props.sign,
|
|
116
|
+
value = _this$props.value,
|
|
117
|
+
baseUrl = _this$props.baseUrl;
|
|
118
|
+
|
|
119
|
+
var params = {
|
|
120
|
+
sign: sign,
|
|
121
|
+
value: value
|
|
122
|
+
};
|
|
123
|
+
if (value.length > 0) {
|
|
124
|
+
(0, _NHFetch2.default)((baseUrl === undefined ? "" : baseUrl) + "/proData/selectValues", 'GET', params).then(function (res) {
|
|
125
|
+
if (res && res.code === 200 && res.data) {
|
|
126
|
+
_this.setState({ value: res.data }, callback);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
} else if (typeof callback === 'function') {
|
|
130
|
+
callback();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
_this.loadData = function (value) {
|
|
135
|
+
var targetOption = _this.state.options;
|
|
136
|
+
// 找到目前value的最内部一级对应的option
|
|
137
|
+
|
|
138
|
+
var _loop = function _loop(i) {
|
|
139
|
+
if (i > 0) {
|
|
140
|
+
targetOption = targetOption.children;
|
|
141
|
+
}
|
|
142
|
+
targetOption = targetOption.find(function (item) {
|
|
143
|
+
return item.value === value[i];
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
for (var i = 0; i < value.length; i++) {
|
|
148
|
+
_loop(i);
|
|
149
|
+
}
|
|
150
|
+
// 如果是最后一级或者子节点已经加载数据直接返回
|
|
151
|
+
if ('value' in _this.props) {
|
|
152
|
+
_this.props.onChange && _this.props.onChange(value);
|
|
153
|
+
} else {
|
|
154
|
+
_this.setState({ value: value });
|
|
155
|
+
}
|
|
156
|
+
if (targetOption.isLeaf || targetOption.children) return;
|
|
157
|
+
var level = targetOption.currLevel + 1;
|
|
158
|
+
var cascaderValue = targetOption.value;
|
|
159
|
+
var selectedValue = [].concat(_toConsumableArray(value));
|
|
160
|
+
_this.getCascaderData(level, cascaderValue, targetOption, selectedValue);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
_this.getCascaderData = function (level, cascaderValue, targetOption, selectedValue) {
|
|
164
|
+
var sign = _this.props.sign;
|
|
165
|
+
// let params = {...this.props};
|
|
166
|
+
|
|
167
|
+
var params = {};
|
|
168
|
+
params.nvsx = _this.state.gender; //男女属性
|
|
169
|
+
params.level = level;
|
|
170
|
+
params.sign = sign;
|
|
171
|
+
params.cascaderValue = cascaderValue;
|
|
172
|
+
var baseUrl = _this.props.baseUrl;
|
|
173
|
+
var otherUrl = _this.props.otherUrl ? _this.props.otherUrl : "/proData/selectCascaderList";
|
|
174
|
+
(0, _NHFetch2.default)((baseUrl === undefined ? "" : baseUrl) + otherUrl, 'GET', params).then(function (res) {
|
|
175
|
+
if (res) {
|
|
176
|
+
if (res.data) {
|
|
177
|
+
if (targetOption) {
|
|
178
|
+
targetOption.children = res.data;
|
|
179
|
+
selectedValue.push(targetOption.children[0].value);
|
|
180
|
+
// 如果还有下一级,获取下一级的数据
|
|
181
|
+
if (!targetOption.children[0].isLeaf) {
|
|
182
|
+
_this.getCascaderData(level + 1, targetOption.children[0].value, targetOption.children[0], selectedValue);
|
|
183
|
+
} else {
|
|
184
|
+
_this.setState({
|
|
185
|
+
options: _this.state.options,
|
|
186
|
+
value: selectedValue
|
|
187
|
+
}, function () {});
|
|
188
|
+
}
|
|
189
|
+
} else {
|
|
190
|
+
_this.setState({
|
|
191
|
+
options: res.data
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
} else {
|
|
195
|
+
_this.setState({ options: [] });
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
_this.handleCascaderChange = function (value) {
|
|
202
|
+
if (!('value' in _this.props)) {
|
|
203
|
+
_this.setState({
|
|
204
|
+
value: value
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
_this.loadData(value);
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
_this.handleChange = function (val) {
|
|
211
|
+
var valueState = _this.state.value || [];
|
|
212
|
+
if (!('value' in _this.props) && valueState.length <= val.length) {
|
|
213
|
+
_this.setState({
|
|
214
|
+
value: val
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
var value = val.length >= valueState.length ? val : valueState;
|
|
218
|
+
// 根据选中的value生成option(跟pc保持一致)
|
|
219
|
+
var selectedOptions = [];
|
|
220
|
+
var options = _this.state.options;
|
|
221
|
+
|
|
222
|
+
var _loop2 = function _loop2(i) {
|
|
223
|
+
var option = options.find(function (item) {
|
|
224
|
+
return item.value === value[i];
|
|
225
|
+
});
|
|
226
|
+
selectedOptions.push(option);
|
|
227
|
+
options = option.children;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
for (var i = 0; i < value.length; i++) {
|
|
231
|
+
_loop2(i);
|
|
232
|
+
}
|
|
233
|
+
// 如果父组件传入onChange函数,回调并传入参数
|
|
234
|
+
var onChange = _this.props.onChange;
|
|
235
|
+
if (onChange) {
|
|
236
|
+
onChange(value, selectedOptions);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
_this.state = {
|
|
241
|
+
options: _this.props.options || [],
|
|
242
|
+
value: _this.props.defaultValue || [],
|
|
243
|
+
gender: _this.props.gender
|
|
244
|
+
};
|
|
245
|
+
return _this;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
//初始加载第一级级联下拉数据
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
_createClass(NHCascader, [{
|
|
252
|
+
key: 'componentDidMount',
|
|
253
|
+
value: function componentDidMount() {
|
|
254
|
+
var _this2 = this;
|
|
255
|
+
|
|
256
|
+
var level = 1;
|
|
257
|
+
var cascaderValue = '';
|
|
258
|
+
if (typeof this.props.value === 'string') {
|
|
259
|
+
this.getValues(function () {
|
|
260
|
+
_this2.getInitData(level, cascaderValue);
|
|
261
|
+
});
|
|
262
|
+
} else {
|
|
263
|
+
this.setState({ value: this.props.value || [] }, function () {
|
|
264
|
+
_this2.getInitData(level, cascaderValue);
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}, {
|
|
269
|
+
key: 'UNSAFE_componentWillReceiveProps',
|
|
270
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
271
|
+
var _this3 = this;
|
|
272
|
+
|
|
273
|
+
if ('value' in nextProps) {
|
|
274
|
+
var value = nextProps.value;
|
|
275
|
+
if (typeof value === 'string') {
|
|
276
|
+
this.getValues();
|
|
277
|
+
} else {
|
|
278
|
+
this.setState({ value: value });
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if ('options' in nextProps) {
|
|
282
|
+
var options = nextProps.options;
|
|
283
|
+
this.setState({ options: options });
|
|
284
|
+
}
|
|
285
|
+
if (nextProps.gender !== this.state.gender) {
|
|
286
|
+
var level = 1;
|
|
287
|
+
var cascaderValue = '';
|
|
288
|
+
console.log("重新渲染gender", nextProps.gender, this.state.gender);
|
|
289
|
+
this.setState({ gender: nextProps.gender }, function () {
|
|
290
|
+
return _this3.getInitData(level, cascaderValue);
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
// componentWillReceiveProps = (nextProps)=>{
|
|
295
|
+
// if (nextProps.gender !== this.state.gender){
|
|
296
|
+
// this.setState({gender: nextProps.gender});
|
|
297
|
+
// }
|
|
298
|
+
// }
|
|
299
|
+
|
|
300
|
+
//获取初始化数据
|
|
301
|
+
|
|
302
|
+
// 当父组件只传入最后一级的值时获取父级value
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
//当选择父项时,动态加载子项数据
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
//从后台查询级联下拉数据
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
//选择器每一列变化时的回调
|
|
312
|
+
|
|
313
|
+
// 完成选择时的回调
|
|
314
|
+
|
|
315
|
+
}, {
|
|
316
|
+
key: 'render',
|
|
317
|
+
value: function render() {
|
|
318
|
+
var _state = this.state,
|
|
319
|
+
options = _state.options,
|
|
320
|
+
value = _state.value;
|
|
321
|
+
var _props = this.props,
|
|
322
|
+
style = _props.style,
|
|
323
|
+
placeholder = _props.placeholder,
|
|
324
|
+
disabled = _props.disabled,
|
|
325
|
+
error = _props.error,
|
|
326
|
+
cols = _props.cols;
|
|
327
|
+
|
|
328
|
+
return _react2.default.createElement(
|
|
329
|
+
'div',
|
|
330
|
+
{ className: disabled ? 'nh-inputrender-disabled' : 'nh-inputrender' },
|
|
331
|
+
_react2.default.createElement(
|
|
332
|
+
_picker2.default,
|
|
333
|
+
{
|
|
334
|
+
style: style,
|
|
335
|
+
data: options,
|
|
336
|
+
value: value,
|
|
337
|
+
title: placeholder,
|
|
338
|
+
disabled: disabled,
|
|
339
|
+
onChange: this.handleChange,
|
|
340
|
+
onPickerChange: this.handleCascaderChange,
|
|
341
|
+
cols: cols ? cols : 3
|
|
342
|
+
},
|
|
343
|
+
_react2.default.createElement(
|
|
344
|
+
_list2.default.Item,
|
|
345
|
+
{ arrow: 'horizontal', wrap: true, error: error },
|
|
346
|
+
this.props.children
|
|
347
|
+
)
|
|
348
|
+
)
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
}]);
|
|
352
|
+
|
|
353
|
+
return NHCascader;
|
|
354
|
+
}(_react2.default.Component);
|
|
355
|
+
|
|
356
|
+
//默认属性值
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
exports.default = NHCascader;
|
|
360
|
+
NHCascader.defaultProps = {
|
|
361
|
+
placeholder: '请选择...', //输入框占位文本
|
|
362
|
+
disabled: false //是否禁用
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
//属性检查
|
|
366
|
+
};NHCascader.propTypes = {
|
|
367
|
+
sign: _propTypes2.default.string.isRequired, //数据源标识
|
|
368
|
+
style: _propTypes2.default.object, //样式
|
|
369
|
+
placeholder: _propTypes2.default.string, //输入框占位文本
|
|
370
|
+
disabled: _propTypes2.default.bool, //是否禁用
|
|
371
|
+
defaultValue: _propTypes2.default.any, //默认选中项
|
|
372
|
+
value: _propTypes2.default.any, //初始值
|
|
373
|
+
onChange: _propTypes2.default.func, //选择完成后的回调
|
|
374
|
+
baseUrl: _propTypes2.default.string //请求路径的前缀,可通过改参数控制访问的后端服务,如果不设置,则会去访问当前前端服务对应的后端服务,例如:api/sm-bpm-expansion
|
|
375
|
+
};
|