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,401 @@
|
|
|
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 _button = require('antd-mobile/lib/button');
|
|
12
|
+
|
|
13
|
+
var _button2 = _interopRequireDefault(_button);
|
|
14
|
+
|
|
15
|
+
var _card = require('antd-mobile/lib/card');
|
|
16
|
+
|
|
17
|
+
var _card2 = _interopRequireDefault(_card);
|
|
18
|
+
|
|
19
|
+
var _list = require('antd-mobile/lib/list');
|
|
20
|
+
|
|
21
|
+
var _list2 = _interopRequireDefault(_list);
|
|
22
|
+
|
|
23
|
+
var _toast = require('antd-mobile/lib/toast');
|
|
24
|
+
|
|
25
|
+
var _toast2 = _interopRequireDefault(_toast);
|
|
26
|
+
|
|
27
|
+
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; };
|
|
28
|
+
|
|
29
|
+
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; }; }();
|
|
30
|
+
|
|
31
|
+
require('antd-mobile/lib/white-space/style/css');
|
|
32
|
+
|
|
33
|
+
require('antd-mobile/lib/button/style/css');
|
|
34
|
+
|
|
35
|
+
require('antd-mobile/lib/card/style/css');
|
|
36
|
+
|
|
37
|
+
require('antd-mobile/lib/list/style/css');
|
|
38
|
+
|
|
39
|
+
require('antd-mobile/lib/toast/style/css');
|
|
40
|
+
|
|
41
|
+
var _react = require('react');
|
|
42
|
+
|
|
43
|
+
var _react2 = _interopRequireDefault(_react);
|
|
44
|
+
|
|
45
|
+
var _moment = require('moment');
|
|
46
|
+
|
|
47
|
+
var _moment2 = _interopRequireDefault(_moment);
|
|
48
|
+
|
|
49
|
+
var _render = require('../../NHInputPicker/render.js');
|
|
50
|
+
|
|
51
|
+
var _render2 = _interopRequireDefault(_render);
|
|
52
|
+
|
|
53
|
+
var _rcForm = require('rc-form');
|
|
54
|
+
|
|
55
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
56
|
+
|
|
57
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
58
|
+
|
|
59
|
+
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; }
|
|
60
|
+
|
|
61
|
+
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; }
|
|
62
|
+
|
|
63
|
+
var EditInitForm = function (_React$Component) {
|
|
64
|
+
_inherits(EditInitForm, _React$Component);
|
|
65
|
+
|
|
66
|
+
function EditInitForm(props) {
|
|
67
|
+
_classCallCheck(this, EditInitForm);
|
|
68
|
+
|
|
69
|
+
var _this = _possibleConstructorReturn(this, (EditInitForm.__proto__ || Object.getPrototypeOf(EditInitForm)).call(this, props));
|
|
70
|
+
|
|
71
|
+
_this.onChange = function (seq, v, t, item) {
|
|
72
|
+
var value = v;
|
|
73
|
+
var text = t;
|
|
74
|
+
//如果是级联,则只需要取最后的一个值
|
|
75
|
+
if (item.bdkjlx === 'nhcascader' && v != undefined) {
|
|
76
|
+
value = "";
|
|
77
|
+
text = "";
|
|
78
|
+
if (Array.isArray(t)) {
|
|
79
|
+
t.map(function (map) {
|
|
80
|
+
text += map.label;
|
|
81
|
+
value = map.value;
|
|
82
|
+
return map;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
_this.props.onChange && _this.props.onChange(seq, value, text);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
_this.getDataList = function (list) {
|
|
90
|
+
var dataList = [];
|
|
91
|
+
if (list == null) {
|
|
92
|
+
list = [];
|
|
93
|
+
}
|
|
94
|
+
list.map(function (item, index) {
|
|
95
|
+
//此处只展示sfxs为1(显示)的字段
|
|
96
|
+
if (item.sfxs === '1') {
|
|
97
|
+
var required = item.sfbt === '1' ? true : false;
|
|
98
|
+
var render = undefined;
|
|
99
|
+
var isUpload = false;
|
|
100
|
+
var deV = undefined;
|
|
101
|
+
var defaultValueText = void 0;
|
|
102
|
+
if (item.bdkjcs && item.bdkjcs !== "" && item.bdkjcs !== undefined) {
|
|
103
|
+
var parameter = JSON.parse(item.bdkjcs);
|
|
104
|
+
if (Array.isArray(parameter.defaultValue) === true) {
|
|
105
|
+
deV = "";
|
|
106
|
+
} else {
|
|
107
|
+
deV = parameter.defaultValue ? parameter.defaultValue : "";
|
|
108
|
+
}
|
|
109
|
+
if (item.bdkjlx === 'radio') {
|
|
110
|
+
var _ref = parameter || {},
|
|
111
|
+
_ref$options = _ref.options,
|
|
112
|
+
options = _ref$options === undefined ? [] : _ref$options;
|
|
113
|
+
|
|
114
|
+
defaultValueText = (options.find(function (item) {
|
|
115
|
+
return item.value === deV;
|
|
116
|
+
}) || {}).label;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
var value = "";
|
|
120
|
+
var text = item.text;
|
|
121
|
+
if (item.value !== "" && item.value !== undefined && item.value) {
|
|
122
|
+
value = item.value;
|
|
123
|
+
} else {
|
|
124
|
+
value = deV;
|
|
125
|
+
text = defaultValueText;
|
|
126
|
+
if (value !== "" && value !== undefined && value) {
|
|
127
|
+
if (!item.text && item.text === "" && item.text === undefined) {
|
|
128
|
+
item.text = "";
|
|
129
|
+
}
|
|
130
|
+
_this.props.onChange && _this.props.onChange(item.seq, value, text, true);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (item.bdkjlx === 'upload') {
|
|
134
|
+
isUpload = true;
|
|
135
|
+
}
|
|
136
|
+
//如果是日期(datepicker),初始化的值需要做处理
|
|
137
|
+
if (item.bdkjlx === 'datepicker') {
|
|
138
|
+
value = item.value ? new Date((0, _moment2.default)(item.value, 'YYYY-MM-DD').toDate()) : undefined;
|
|
139
|
+
}
|
|
140
|
+
//如果是日期时间(datetimepicker),初始化的值需要做处理
|
|
141
|
+
if (item.bdkjlx === 'datetimepicker') {
|
|
142
|
+
value = item.value ? new Date((0, _moment2.default)(item.value, 'YYYY-MM-DD HH:mm:ss').toDate()) : undefined;
|
|
143
|
+
}
|
|
144
|
+
if (item.bdkjlx === 'timepicker') {
|
|
145
|
+
value = item.value ? new Date((0, _moment2.default)(item.value, 'HH:mm:ss').toDate()) : undefined;
|
|
146
|
+
}
|
|
147
|
+
//如果是日期范围(rangepicker),暂时不支持
|
|
148
|
+
if (item.bdkjlx === 'rangepicker') {
|
|
149
|
+
_toast2.default.fail('表单不支持日期范围控件', 1);
|
|
150
|
+
}
|
|
151
|
+
var otherParams = {};
|
|
152
|
+
if (item.parentfieldid) {
|
|
153
|
+
var row = list.find(function (row) {
|
|
154
|
+
return row.id === item.parentfieldid;
|
|
155
|
+
});
|
|
156
|
+
if (row) {
|
|
157
|
+
otherParams.parentValue = row.value;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
var formItemLayout = { wrapperCol: { span: 24 } };
|
|
162
|
+
// let disabled = this.props.isEdit&&item.sfbj==='1'?true:false;
|
|
163
|
+
//let disabled = false;
|
|
164
|
+
//是采集方式为表单控件,且是可编辑的状态
|
|
165
|
+
var isEdit = _this.props.isEdit && item.sfbj === '1' ? true : false;
|
|
166
|
+
// 纠错编辑模式下 需要开放纠错编辑才显示可编辑
|
|
167
|
+
if (_this.props.model == 'editCheck') {
|
|
168
|
+
isEdit = item.sfkfjc === '1' ? true : false;
|
|
169
|
+
};
|
|
170
|
+
if (item.sjcjfsdm === '01') {
|
|
171
|
+
//disabled = !(item.sfbj === '1');
|
|
172
|
+
if (item.sfbj === '1' && isEdit) {
|
|
173
|
+
render = function render() {
|
|
174
|
+
if (_this.props.model === 'editCheck' && !item.sfkfjc) {
|
|
175
|
+
// 如果是纠错编辑模式未开纠错字段 不显示编辑
|
|
176
|
+
return _react2.default.createElement(
|
|
177
|
+
_list2.default.Item,
|
|
178
|
+
{ extra: item.text, key: item.id, wrap: true, multipleLine: true },
|
|
179
|
+
item.title
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
return _react2.default.createElement(_render2.default, _extends({
|
|
183
|
+
id: item.id,
|
|
184
|
+
key: item.id,
|
|
185
|
+
label: item.title,
|
|
186
|
+
value: value,
|
|
187
|
+
form: _this.props.form,
|
|
188
|
+
feature: item.bdkjcs,
|
|
189
|
+
required: required,
|
|
190
|
+
hideLabel: true,
|
|
191
|
+
isEdit: isEdit,
|
|
192
|
+
formItemLayout: formItemLayout
|
|
193
|
+
//disabled={disabled}
|
|
194
|
+
}, otherParams, {
|
|
195
|
+
onChange: function onChange(value, text) {
|
|
196
|
+
_this.onChange(item.seq, value, text, item);
|
|
197
|
+
}
|
|
198
|
+
}));
|
|
199
|
+
};
|
|
200
|
+
} else {
|
|
201
|
+
render = function render() {
|
|
202
|
+
if (isUpload) {
|
|
203
|
+
return _react2.default.createElement(_render2.default, {
|
|
204
|
+
label: item.title,
|
|
205
|
+
value: value,
|
|
206
|
+
feature: item.bdkjcs,
|
|
207
|
+
isEdit: isEdit
|
|
208
|
+
//disabled={disabled}
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
return _react2.default.createElement(
|
|
212
|
+
_list2.default.Item,
|
|
213
|
+
{ extra: item.text, key: item.id, wrap: true, multipleLine: true },
|
|
214
|
+
item.title
|
|
215
|
+
);
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
var map = {
|
|
221
|
+
isUpload: isUpload,
|
|
222
|
+
title: _react2.default.createElement(
|
|
223
|
+
'font',
|
|
224
|
+
{ className: 'dynamic-label-' + item.blm },
|
|
225
|
+
item.title
|
|
226
|
+
),
|
|
227
|
+
text: item.text,
|
|
228
|
+
required: required,
|
|
229
|
+
render: render,
|
|
230
|
+
id: item.id,
|
|
231
|
+
sfkfjc: item.sfkfjc,
|
|
232
|
+
sfxs: item.sfxs,
|
|
233
|
+
sfbj: item.sfbj
|
|
234
|
+
};
|
|
235
|
+
dataList.push(map);
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
return dataList;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
_this.onEdit = function () {
|
|
242
|
+
_this.props.onEdit();
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
_this.onCacheSave = function () {
|
|
246
|
+
_this.props.form.validateFields(function (err, value) {
|
|
247
|
+
if (err) {
|
|
248
|
+
_toast2.default.info('请检查必填项是否填写!');
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
_this.props.onClose();
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
_this.onCanCel = function () {
|
|
256
|
+
_this.props.onCacheBack();
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
_this.state = {
|
|
260
|
+
onpenEdit: false
|
|
261
|
+
};
|
|
262
|
+
return _this;
|
|
263
|
+
}
|
|
264
|
+
// editCheck模式下 开启编辑
|
|
265
|
+
|
|
266
|
+
// editCheck模式下 保存
|
|
267
|
+
|
|
268
|
+
// editCheck模式下 保存
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
_createClass(EditInitForm, [{
|
|
272
|
+
key: 'render',
|
|
273
|
+
value: function render() {
|
|
274
|
+
var _props = this.props,
|
|
275
|
+
form = _props.form,
|
|
276
|
+
isEdit = _props.isEdit,
|
|
277
|
+
list = _props.list,
|
|
278
|
+
title = _props.title,
|
|
279
|
+
model = _props.model;
|
|
280
|
+
|
|
281
|
+
var dataList = this.getDataList(list);
|
|
282
|
+
// 该分类是否存在可编辑的纠错字段
|
|
283
|
+
var hasJczd = dataList.filter(function (item) {
|
|
284
|
+
return item.sfkfjc === '1' && item.sfbj === '1' && item.sfxs === '1';
|
|
285
|
+
}).length > 0;
|
|
286
|
+
var cardExtra = model === 'editCheck' && hasJczd ? _react2.default.createElement('img', { src: require('../../../../assets/NHDynamicFormShow/edit.svg'), style: { width: "0.4rem", height: "0.4rem", margin: "0px 5px" },
|
|
287
|
+
onClick: this.onEdit }) : null;
|
|
288
|
+
|
|
289
|
+
return _react2.default.createElement(
|
|
290
|
+
_react.Fragment,
|
|
291
|
+
null,
|
|
292
|
+
isEdit ?
|
|
293
|
+
// <List renderHeader={() => title}>
|
|
294
|
+
// {
|
|
295
|
+
// dataList.map((item, index) => {
|
|
296
|
+
// return item.render !== undefined ? item.render() : <List.Item key={item.id} wrap extra={item.text}>{item.title}</List.Item>;
|
|
297
|
+
// })
|
|
298
|
+
// }
|
|
299
|
+
// </List>
|
|
300
|
+
_react2.default.createElement(
|
|
301
|
+
'div',
|
|
302
|
+
null,
|
|
303
|
+
_react2.default.createElement(
|
|
304
|
+
_card2.default,
|
|
305
|
+
{ full: true, className: 'editTypeCard' },
|
|
306
|
+
_react2.default.createElement(_card2.default.Header, {
|
|
307
|
+
title: _react2.default.createElement(
|
|
308
|
+
'div',
|
|
309
|
+
{ style: { borderLeft: '3px solid #1890ff', paddingLeft: '10px' } },
|
|
310
|
+
title
|
|
311
|
+
)
|
|
312
|
+
}),
|
|
313
|
+
_react2.default.createElement(
|
|
314
|
+
_card2.default.Body,
|
|
315
|
+
null,
|
|
316
|
+
dataList.map(function (item, index) {
|
|
317
|
+
return item.render !== undefined ? item.render() : _react2.default.createElement(
|
|
318
|
+
_list2.default.Item,
|
|
319
|
+
{ key: item.id, wrap: true, extra: item.text },
|
|
320
|
+
item.title
|
|
321
|
+
);
|
|
322
|
+
}),
|
|
323
|
+
model === 'editCheck' && _react2.default.createElement(
|
|
324
|
+
'div',
|
|
325
|
+
{ style: { display: 'flex', justifyContent: 'space-around', margin: '10px 0px 5px 0' } },
|
|
326
|
+
_react2.default.createElement(
|
|
327
|
+
_button2.default,
|
|
328
|
+
{ type: 'primary', inline: true, size: 'small', onClick: this.onCacheSave },
|
|
329
|
+
'\u4FDD\u5B58'
|
|
330
|
+
),
|
|
331
|
+
_react2.default.createElement(
|
|
332
|
+
_button2.default,
|
|
333
|
+
{ type: 'ghost', inline: true, size: 'small', onClick: this.onCanCel },
|
|
334
|
+
'\u53D6\u6D88'
|
|
335
|
+
)
|
|
336
|
+
)
|
|
337
|
+
)
|
|
338
|
+
)
|
|
339
|
+
) : _react2.default.createElement(
|
|
340
|
+
'div',
|
|
341
|
+
null,
|
|
342
|
+
_react2.default.createElement(
|
|
343
|
+
_card2.default,
|
|
344
|
+
{ full: true },
|
|
345
|
+
_react2.default.createElement(_card2.default.Header, {
|
|
346
|
+
title: _react2.default.createElement(
|
|
347
|
+
'div',
|
|
348
|
+
{ style: { borderLeft: '3px solid #1890ff', paddingLeft: '10px' } },
|
|
349
|
+
title
|
|
350
|
+
),
|
|
351
|
+
extra: cardExtra
|
|
352
|
+
}),
|
|
353
|
+
_react2.default.createElement(
|
|
354
|
+
_card2.default.Body,
|
|
355
|
+
null,
|
|
356
|
+
dataList.map(function (item) {
|
|
357
|
+
if (item.isUpload) {
|
|
358
|
+
return _react2.default.createElement(
|
|
359
|
+
'div',
|
|
360
|
+
null,
|
|
361
|
+
_react2.default.createElement(
|
|
362
|
+
'font',
|
|
363
|
+
{ color: 'grey' },
|
|
364
|
+
item.title,
|
|
365
|
+
'\uFF1A '
|
|
366
|
+
),
|
|
367
|
+
item.render(),
|
|
368
|
+
_react2.default.createElement('br', null)
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
return _react2.default.createElement(
|
|
372
|
+
'div',
|
|
373
|
+
null,
|
|
374
|
+
_react2.default.createElement(
|
|
375
|
+
'font',
|
|
376
|
+
{ color: 'grey' },
|
|
377
|
+
item.title,
|
|
378
|
+
'\uFF1A '
|
|
379
|
+
),
|
|
380
|
+
item.text,
|
|
381
|
+
_react2.default.createElement('br', null)
|
|
382
|
+
);
|
|
383
|
+
})
|
|
384
|
+
)
|
|
385
|
+
),
|
|
386
|
+
_react2.default.createElement(_whiteSpace2.default, { size: 'lg' })
|
|
387
|
+
),
|
|
388
|
+
_react2.default.createElement(
|
|
389
|
+
'style',
|
|
390
|
+
{ global: 'true', jsx: 'true' },
|
|
391
|
+
'\n .editTypeCard .am-card-body{\n padding: 0 !important;\n }\n .editTypeCard .am-card-body .nh-inputrender .am-list-item.am-list-item-middle .am-list-line{\n border-bottom: 1px solid #ddd;\n }\n '
|
|
392
|
+
)
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
}]);
|
|
396
|
+
|
|
397
|
+
return EditInitForm;
|
|
398
|
+
}(_react2.default.Component);
|
|
399
|
+
|
|
400
|
+
var EditForm = (0, _rcForm.createForm)()(EditInitForm);
|
|
401
|
+
exports.default = EditForm;
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
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; }; }();
|
|
8
|
+
|
|
9
|
+
var _react = require('react');
|
|
10
|
+
|
|
11
|
+
var _react2 = _interopRequireDefault(_react);
|
|
12
|
+
|
|
13
|
+
var _NHFetch = require('../../../utils/NHFetch');
|
|
14
|
+
|
|
15
|
+
var _NHFetch2 = _interopRequireDefault(_NHFetch);
|
|
16
|
+
|
|
17
|
+
var _EditForm = require('./EditForm');
|
|
18
|
+
|
|
19
|
+
var _EditForm2 = _interopRequireDefault(_EditForm);
|
|
20
|
+
|
|
21
|
+
var _propTypes = require('prop-types');
|
|
22
|
+
|
|
23
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
24
|
+
|
|
25
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
+
|
|
27
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
28
|
+
|
|
29
|
+
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; }
|
|
30
|
+
|
|
31
|
+
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; }
|
|
32
|
+
|
|
33
|
+
var _ = require('lodash');
|
|
34
|
+
|
|
35
|
+
var InfoItem = function (_React$Component) {
|
|
36
|
+
_inherits(InfoItem, _React$Component);
|
|
37
|
+
|
|
38
|
+
function InfoItem(props) {
|
|
39
|
+
_classCallCheck(this, InfoItem);
|
|
40
|
+
|
|
41
|
+
var _this = _possibleConstructorReturn(this, (InfoItem.__proto__ || Object.getPrototypeOf(InfoItem)).call(this, props));
|
|
42
|
+
|
|
43
|
+
_this.InitialOneOnOneInfo = function () {
|
|
44
|
+
var params = {
|
|
45
|
+
id: _this.props.objId,
|
|
46
|
+
bdid: _this.props.formId,
|
|
47
|
+
type: '2', //this.props.model === "view" ? "1" : "2", 如果查看模式需要根据控件类型占不同的列,此处只能为'2'
|
|
48
|
+
zdflid: _this.props.flid,
|
|
49
|
+
clientType: "mobile"
|
|
50
|
+
};
|
|
51
|
+
if (_this.props.processId !== undefined) {
|
|
52
|
+
params.lcId = _this.props.processId;
|
|
53
|
+
}
|
|
54
|
+
if (_this.props.processApplyId !== undefined) {
|
|
55
|
+
params.lcsqid = _this.props.processApplyId;
|
|
56
|
+
}
|
|
57
|
+
if (_this.props.pkid !== undefined) {
|
|
58
|
+
params.pkid = _this.props.pkid;
|
|
59
|
+
}
|
|
60
|
+
if (_this.props.rwid) {
|
|
61
|
+
params.rwid = _this.props.rwid; // 任务id
|
|
62
|
+
}
|
|
63
|
+
(0, _NHFetch2.default)("api/sm-dynamic-form/dynamicShow/queryBdzdInfo", "GET", params).then(function (res) {
|
|
64
|
+
if (res) {
|
|
65
|
+
//把通过接口方式获取的功能实现
|
|
66
|
+
var listInfo = [];
|
|
67
|
+
if (res.data != null && res.data != "" && res.data != undefined) {
|
|
68
|
+
listInfo = res.data;
|
|
69
|
+
}
|
|
70
|
+
_this.setState({
|
|
71
|
+
list: listInfo,
|
|
72
|
+
cacheList: _.cloneDeep(listInfo),
|
|
73
|
+
loading: false
|
|
74
|
+
}, function () {
|
|
75
|
+
_this.state.list.map(function (item) {
|
|
76
|
+
if (item.jkUrl !== "" && item.jkUrl !== undefined && item.jkUrl !== null) {
|
|
77
|
+
var url = item.jkUrl;
|
|
78
|
+
(0, _NHFetch2.default)(url, "GET", params).then(function (res) {
|
|
79
|
+
if (res) {
|
|
80
|
+
var maps = {};
|
|
81
|
+
maps = res.data;
|
|
82
|
+
var zzd = item.zzd; //要获取的值字段名称
|
|
83
|
+
var wbzd = item.wbzd; //要获取的文本字段名称
|
|
84
|
+
item.text = maps[wbzd];
|
|
85
|
+
item.inittext = maps[wbzd];
|
|
86
|
+
item.value = maps[zzd];
|
|
87
|
+
item.initValue = maps[zzd];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
_this.setState({
|
|
91
|
+
list: _this.state.list,
|
|
92
|
+
cacheList: _.cloneDeep(_this.state.list)
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return item;
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
_this.onChange = function (seq, value, text, isChange) {
|
|
104
|
+
var list = _this.state.list;
|
|
105
|
+
if (list[seq - 1] !== undefined) {
|
|
106
|
+
list[seq - 1].text = text;
|
|
107
|
+
list[seq - 1].value = value;
|
|
108
|
+
//判断值是否有改变
|
|
109
|
+
if (isChange !== "" && isChange !== undefined) {
|
|
110
|
+
list[seq - 1].isChange = isChange;
|
|
111
|
+
} else {
|
|
112
|
+
if (list[seq - 1].value === list[seq - 1].initValue || !value && list[seq - 1].initValue === '') {
|
|
113
|
+
list[seq - 1].isChange = false;
|
|
114
|
+
} else {
|
|
115
|
+
list[seq - 1].isChange = true;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
_this.setState({
|
|
119
|
+
list: list
|
|
120
|
+
});
|
|
121
|
+
var oneONOneInfo = {
|
|
122
|
+
id: _this.props.objId,
|
|
123
|
+
sjkyh: _this.props.sjkyh,
|
|
124
|
+
dto: _this.state.list,
|
|
125
|
+
flid: _this.props.flid,
|
|
126
|
+
baseUrl: _this.props.baseUrl,
|
|
127
|
+
flstdm: _this.props.flstdm,
|
|
128
|
+
pkid: _this.props.pkid === undefined ? null : _this.props.pkid,
|
|
129
|
+
lcslid: _this.props.processApplyId
|
|
130
|
+
};
|
|
131
|
+
_this.props.handlOneOnDetail(oneONOneInfo, _.cloneDeep(_this.state.cacheList));
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
_this.validate = function (func) {
|
|
136
|
+
if (_this.nhEditForm) {
|
|
137
|
+
_this.nhEditForm.validateFields(function (err) {
|
|
138
|
+
var flag = true;
|
|
139
|
+
if (err) {
|
|
140
|
+
flag = false;
|
|
141
|
+
}
|
|
142
|
+
func(flag);
|
|
143
|
+
});
|
|
144
|
+
} else {
|
|
145
|
+
func(true);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
_this.onEditClose = function () {
|
|
150
|
+
_this.setState({
|
|
151
|
+
isEdit: false
|
|
152
|
+
// cacheList: _.cloneDeep(this.state.list)
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
_this.onEdit = function () {
|
|
157
|
+
_this.setState({
|
|
158
|
+
isEdit: true,
|
|
159
|
+
preEditCacheList: _.cloneDeep(_this.state.list)
|
|
160
|
+
}, function () {
|
|
161
|
+
_this.props.editCheckShow && _this.props.editCheckShow();
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
_this.onCacheBack = function () {
|
|
166
|
+
_this.setState({
|
|
167
|
+
list: _.cloneDeep(_this.state.preEditCacheList),
|
|
168
|
+
isEdit: false
|
|
169
|
+
});
|
|
170
|
+
var oneONOneInfo = {
|
|
171
|
+
id: _this.props.objId,
|
|
172
|
+
sjkyh: _this.props.sjkyh,
|
|
173
|
+
dto: _.cloneDeep(_this.state.preEditCacheList),
|
|
174
|
+
flid: _this.props.flid,
|
|
175
|
+
baseUrl: _this.props.baseUrl,
|
|
176
|
+
flstdm: _this.props.flstdm,
|
|
177
|
+
pkid: _this.props.pkid === undefined ? null : _this.props.pkid,
|
|
178
|
+
lcslid: _this.props.processApplyId
|
|
179
|
+
};
|
|
180
|
+
_this.props.handlOneOnDetail(oneONOneInfo, _.cloneDeep(_this.state.cacheList));
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
_this.state = {
|
|
184
|
+
isEdit: props.model === "edit" ? true : false, //当时编辑模式模式时,直接自动进入编辑模式
|
|
185
|
+
list: [
|
|
186
|
+
//该分类的所有的数据
|
|
187
|
+
// 标题 显示的文本 控件的值 控件初始化的值 数据采集方式 表单控件参数
|
|
188
|
+
// {seq:1,id:'1',title:'姓名',text:'百里屠苏',value:'百里屠苏',initValue:'百里屠苏',sjcjfsdm:'01',bdkjcs:'{"name":"单行文本输入控件","type":"input","widthType":"default","widthStr":"","patternTag":"","placeholder":"","required":true,"defaultValue":""}'
|
|
189
|
+
// //接口url 值字段 文本字段 是否显示 是否编辑 是否必填 字段最小值 字段最大值
|
|
190
|
+
// ,jkUrl:'',zzd:'',wbzd:'',sfxs:'1',sfbj:'1',sfbt:'1',zszxz:'',zszdz:'',isChange:false,bdkjlx:'input'},
|
|
191
|
+
// {seq:2,id:'2',title:'性别',text:'是',value:'1',initValue:'1',sjcjfsdm:'01',bdkjcs:'{"type":"switch","checkedText":"是","uncheckedText":"否","defaultChecked":false}'
|
|
192
|
+
// ,jkUrl:'',zzd:'',wbzd:'',sfxs:'1',sfbj:'1',sfbt:'0',zszxz:'',zszdz:'',isChange:false,bdkjlx:'switch'},
|
|
193
|
+
// {seq:3,id:'3',title:'年龄',text:'23',value:'23',initValue:'23',sjcjfsdm:'01',bdkjcs:'{"name":"单行文本输入控件","type":"input","widthType":"default","widthStr":"","patternTag":"","placeholder":"","required":true,"defaultValue":""}'
|
|
194
|
+
// ,jkUrl:'',zzd:'',wbzd:'',sfxs:'1',sfbj:'1',sfbt:'1',zszxz:'',zszdz:'',isChange:false,bdkjlx:'input'},
|
|
195
|
+
// {seq:4,id:'4',title:'籍贯',text:'湖南',value:'湖南',initValue:'湖南',sjcjfsdm:'01',bdkjcs:'{"name":"单行文本输入控件","type":"input","widthType":"default","widthStr":"","patternTag":"","placeholder":"","required":true,"defaultValue":""}'
|
|
196
|
+
// ,jkUrl:'',zzd:'',wbzd:'',sfxs:'1',sfbj:'1',sfbt:'1',zszxz:'',zszdz:'',isChange:false,bdkjlx:'input'},
|
|
197
|
+
],
|
|
198
|
+
cacheList: [], //缓存数据 备份初始数据 用于比较字段是否有修改过
|
|
199
|
+
preEditCacheList: [] //editCheck模式下 上次点击保存的数据,取消后回退到当前数据,而不是初始缓存的cacheList的数据
|
|
200
|
+
};
|
|
201
|
+
return _this;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
_createClass(InfoItem, [{
|
|
205
|
+
key: 'UNSAFE_componentWillMount',
|
|
206
|
+
value: function UNSAFE_componentWillMount() {
|
|
207
|
+
this.InitialOneOnOneInfo();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* 值改变事件
|
|
212
|
+
*/
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* 校验该分类表单是否全部填写完成
|
|
217
|
+
*/
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
/** editCheck模式下 关闭编辑 */
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
/** editCheck模式下 开启编辑 */
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
/** editCheck模式下 取消编辑 将上次编辑保存备份数据preEditCacheList赋值给list */
|
|
227
|
+
|
|
228
|
+
}, {
|
|
229
|
+
key: 'render',
|
|
230
|
+
value: function render() {
|
|
231
|
+
var _this2 = this;
|
|
232
|
+
|
|
233
|
+
var _props = this.props,
|
|
234
|
+
data = _props.data,
|
|
235
|
+
showTitle = _props.showTitle,
|
|
236
|
+
showHeader = _props.showHeader,
|
|
237
|
+
model = _props.model; //data 是这一条分类的信息
|
|
238
|
+
|
|
239
|
+
var isEdit = this.state.isEdit;
|
|
240
|
+
|
|
241
|
+
var title = showHeader && showTitle ? data.flmc : "";
|
|
242
|
+
return _react2.default.createElement(_EditForm2.default, {
|
|
243
|
+
ref: function ref(form) {
|
|
244
|
+
_this2.nhEditForm = form;
|
|
245
|
+
},
|
|
246
|
+
isEdit: isEdit,
|
|
247
|
+
list: this.state.list,
|
|
248
|
+
onChange: this.onChange,
|
|
249
|
+
onEdit: this.onEdit,
|
|
250
|
+
onClose: this.onEditClose,
|
|
251
|
+
onCacheBack: this.onCacheBack,
|
|
252
|
+
title: title,
|
|
253
|
+
model: model
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}]);
|
|
257
|
+
|
|
258
|
+
return InfoItem;
|
|
259
|
+
}(_react2.default.Component);
|
|
260
|
+
|
|
261
|
+
InfoItem.propTypes = {
|
|
262
|
+
title: _propTypes2.default.string,
|
|
263
|
+
showTitle: _propTypes2.default.bool,
|
|
264
|
+
showHeader: _propTypes2.default.bool
|
|
265
|
+
};
|
|
266
|
+
InfoItem.defaultProps = {
|
|
267
|
+
title: "Title", // 标题
|
|
268
|
+
showTitle: true,
|
|
269
|
+
showHeader: true
|
|
270
|
+
};
|
|
271
|
+
exports.default = InfoItem;
|