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,279 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _button = require('antd-mobile/lib/button');
|
|
8
|
+
|
|
9
|
+
var _button2 = _interopRequireDefault(_button);
|
|
10
|
+
|
|
11
|
+
var _list = require('antd-mobile/lib/list');
|
|
12
|
+
|
|
13
|
+
var _list2 = _interopRequireDefault(_list);
|
|
14
|
+
|
|
15
|
+
var _toast = require('antd-mobile/lib/toast');
|
|
16
|
+
|
|
17
|
+
var _toast2 = _interopRequireDefault(_toast);
|
|
18
|
+
|
|
19
|
+
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; };
|
|
20
|
+
|
|
21
|
+
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; }; }();
|
|
22
|
+
|
|
23
|
+
require('antd-mobile/lib/button/style/css');
|
|
24
|
+
|
|
25
|
+
require('antd-mobile/lib/list/style/css');
|
|
26
|
+
|
|
27
|
+
require('antd-mobile/lib/toast/style/css');
|
|
28
|
+
|
|
29
|
+
var _react = require('react');
|
|
30
|
+
|
|
31
|
+
var _react2 = _interopRequireDefault(_react);
|
|
32
|
+
|
|
33
|
+
var _propTypes = require('prop-types');
|
|
34
|
+
|
|
35
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
36
|
+
|
|
37
|
+
var _render = require('../../../../NHInputPicker/render');
|
|
38
|
+
|
|
39
|
+
var _render2 = _interopRequireDefault(_render);
|
|
40
|
+
|
|
41
|
+
var _moment = require('moment');
|
|
42
|
+
|
|
43
|
+
var _moment2 = _interopRequireDefault(_moment);
|
|
44
|
+
|
|
45
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
46
|
+
|
|
47
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
48
|
+
|
|
49
|
+
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; }
|
|
50
|
+
|
|
51
|
+
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; }
|
|
52
|
+
|
|
53
|
+
var CardItem = function (_React$Component) {
|
|
54
|
+
_inherits(CardItem, _React$Component);
|
|
55
|
+
|
|
56
|
+
function CardItem() {
|
|
57
|
+
var _ref;
|
|
58
|
+
|
|
59
|
+
var _temp, _this, _ret;
|
|
60
|
+
|
|
61
|
+
_classCallCheck(this, CardItem);
|
|
62
|
+
|
|
63
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
64
|
+
args[_key] = arguments[_key];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = CardItem.__proto__ || Object.getPrototypeOf(CardItem)).call.apply(_ref, [this].concat(args))), _this), _this.onDelete = function (seq, id, data) {
|
|
68
|
+
if (_this.props.onDelete) {
|
|
69
|
+
_this.props.onDelete(seq, id, data);
|
|
70
|
+
}
|
|
71
|
+
}, _this.getDataList = function (titleList, data) {
|
|
72
|
+
var dataList = [];
|
|
73
|
+
if (titleList == null) {
|
|
74
|
+
titleList = [];
|
|
75
|
+
}
|
|
76
|
+
var totalSpan = 0; // 到目前为止的所有列数
|
|
77
|
+
var hasUseSpan = void 0; // 当前行已使用的列数
|
|
78
|
+
titleList.map(function (item) {
|
|
79
|
+
//此处只展示sfxs为1(显示)的字段
|
|
80
|
+
if (item.sfxs === '1') {
|
|
81
|
+
var span = 1;
|
|
82
|
+
var required = item.sfbt === '1' ? true : false;
|
|
83
|
+
var render = undefined;
|
|
84
|
+
|
|
85
|
+
//表单控件类型bdkjlx为upload时span为3列
|
|
86
|
+
if (item.bdkjlx === 'upload') {
|
|
87
|
+
span = 3;
|
|
88
|
+
// 以下操作是为了保证在剩余列数不为3列的情况下换行,
|
|
89
|
+
hasUseSpan = totalSpan % 3;
|
|
90
|
+
if (3 - hasUseSpan < span) {
|
|
91
|
+
if (dataList.length > 0) {
|
|
92
|
+
dataList[dataList.length - 1].span += 3 - hasUseSpan;
|
|
93
|
+
totalSpan += 3 - hasUseSpan;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
//表单控件类型bdkjlx为textarea时span为3列
|
|
98
|
+
if (item.bdkjlx === 'textarea') {
|
|
99
|
+
span = 3;
|
|
100
|
+
// 以下操作是为了保证在剩余列数不为3列的情况下换行,
|
|
101
|
+
hasUseSpan = totalSpan % 3;
|
|
102
|
+
if (3 - hasUseSpan < span) {
|
|
103
|
+
if (dataList.length > 0) {
|
|
104
|
+
dataList[dataList.length - 1].span += 3 - hasUseSpan;
|
|
105
|
+
totalSpan += 3 - hasUseSpan;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//表单控件类型bdkjlx为级联nhcascader、多选下拉框时span为2列
|
|
110
|
+
if (item.bdkjlx === 'nhcascader' || item.bdkjlx === 'multiselect') {
|
|
111
|
+
span = 2;
|
|
112
|
+
// 以下操作是为了保证在一行剩余列数不为2列的情况下换行,
|
|
113
|
+
hasUseSpan = totalSpan % 3;
|
|
114
|
+
if (3 - hasUseSpan < span) {
|
|
115
|
+
if (dataList.length > 0) {
|
|
116
|
+
dataList[dataList.length - 1].span += 3 - hasUseSpan;
|
|
117
|
+
totalSpan += 3 - hasUseSpan;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
totalSpan += span;
|
|
122
|
+
|
|
123
|
+
var dataMap = data[item.fieldName] !== undefined ? data[item.fieldName] : {};
|
|
124
|
+
var deV = undefined;
|
|
125
|
+
if (item.bdkjcs && item.bdkjcs !== "" && item.bdkjcs !== undefined) {
|
|
126
|
+
var parameter = JSON.parse(item.bdkjcs);
|
|
127
|
+
deV = parameter.defaultValue;
|
|
128
|
+
}
|
|
129
|
+
var value = dataMap.value ? dataMap.value : deV;
|
|
130
|
+
//如果是日期(datepicker),初始化的值需要做处理
|
|
131
|
+
if (item.bdkjlx === 'datepicker') {
|
|
132
|
+
value = value ? (0, _moment2.default)(value, 'YYYY-MM-DD').toDate() : undefined;
|
|
133
|
+
}
|
|
134
|
+
//如果是日期时间(datetimepicker),初始化的值需要做处理
|
|
135
|
+
if (item.bdkjlx === 'datetimepicker') {
|
|
136
|
+
value = value ? (0, _moment2.default)(value, 'YYYY-MM-DD HH:mm:ss').toDate() : undefined;
|
|
137
|
+
}
|
|
138
|
+
if (item.bdkjlx === 'timepicker') {
|
|
139
|
+
value = value ? (0, _moment2.default)(value, 'HH:mm:ss').toDate() : undefined;
|
|
140
|
+
}
|
|
141
|
+
//如果是日期范围(rangepicker),暂时不支持
|
|
142
|
+
if (item.bdkjlx === 'rangepicker') {
|
|
143
|
+
_toast2.default.error("表单不支持日期范围控件");
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
var otherParams = {};
|
|
147
|
+
if (item.parentfieldid) {
|
|
148
|
+
var row = titleList.find(function (row) {
|
|
149
|
+
return row.id === item.parentfieldid;
|
|
150
|
+
});
|
|
151
|
+
if (row) {
|
|
152
|
+
otherParams.parentValue = row.value;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
var formItemLayout = { wrapperCol: { span: 24 } };
|
|
157
|
+
// let isEdit = this.props.isEdit && item.sfbj === '1' ? true : false;
|
|
158
|
+
//let disabled = false;
|
|
159
|
+
// 纠错编辑模式下 需要开放纠错编辑才显示可编辑
|
|
160
|
+
var isEdit = true;
|
|
161
|
+
if (_this.props.model == 'editCheck') {
|
|
162
|
+
isEdit = item.sfkfjc === '1' ? true : false;
|
|
163
|
+
};
|
|
164
|
+
//是采集方式为表单控件,且是可编辑的状态
|
|
165
|
+
if (item.sjcjfsdm === '01') {
|
|
166
|
+
//disabled=!(item.sfbj == '1' );
|
|
167
|
+
if (item.sfbj == '1' && isEdit) {
|
|
168
|
+
render = function render() {
|
|
169
|
+
return _react2.default.createElement(_render2.default, _extends({
|
|
170
|
+
key: item.id,
|
|
171
|
+
id: item.fieldName + data.fieldPrefix,
|
|
172
|
+
label: item.title,
|
|
173
|
+
value: value,
|
|
174
|
+
form: _this.props.form,
|
|
175
|
+
feature: item.bdkjcs,
|
|
176
|
+
required: required,
|
|
177
|
+
hideLabel: true,
|
|
178
|
+
formItemLayout: formItemLayout
|
|
179
|
+
//disabled={disabled}
|
|
180
|
+
}, otherParams, {
|
|
181
|
+
onChange: function onChange(value, text) {
|
|
182
|
+
_this.props.onChange(data.seq, item.fieldName, value, text, item);
|
|
183
|
+
}
|
|
184
|
+
}));
|
|
185
|
+
};
|
|
186
|
+
} else {
|
|
187
|
+
render = function render() {
|
|
188
|
+
return _react2.default.createElement(
|
|
189
|
+
_list2.default.Item,
|
|
190
|
+
{ extra: item.text, key: item.id, wrap: true, multipleLine: true },
|
|
191
|
+
item.title
|
|
192
|
+
);
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
var map = {
|
|
198
|
+
title: _react2.default.createElement(
|
|
199
|
+
'font',
|
|
200
|
+
{ className: 'dynamic-label-' + item.blm },
|
|
201
|
+
item.title
|
|
202
|
+
),
|
|
203
|
+
text: dataMap.text,
|
|
204
|
+
required: required,
|
|
205
|
+
render: render,
|
|
206
|
+
span: span,
|
|
207
|
+
id: item.id
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
dataList.push(map);
|
|
211
|
+
}
|
|
212
|
+
return item;
|
|
213
|
+
});
|
|
214
|
+
return dataList;
|
|
215
|
+
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
_createClass(CardItem, [{
|
|
219
|
+
key: 'render',
|
|
220
|
+
value: function render() {
|
|
221
|
+
var _this2 = this;
|
|
222
|
+
|
|
223
|
+
var _props = this.props,
|
|
224
|
+
isEdit = _props.isEdit,
|
|
225
|
+
titleList = _props.titleList,
|
|
226
|
+
data = _props.data,
|
|
227
|
+
model = _props.model;
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
var dataList = this.getDataList(titleList, data);
|
|
231
|
+
return _react2.default.createElement(
|
|
232
|
+
'div',
|
|
233
|
+
null,
|
|
234
|
+
_react2.default.createElement(
|
|
235
|
+
_list2.default,
|
|
236
|
+
null,
|
|
237
|
+
dataList.map(function (item) {
|
|
238
|
+
if (isEdit) {
|
|
239
|
+
return item.render();
|
|
240
|
+
} else {
|
|
241
|
+
return _react2.default.createElement(
|
|
242
|
+
_list2.default.Item,
|
|
243
|
+
{ extra: item.text, wrap: true, key: item.id, multipleLine: true },
|
|
244
|
+
item.title
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
})
|
|
248
|
+
),
|
|
249
|
+
isEdit ? model !== 'editCheck' || model === 'editCheck' && !data.id ? _react2.default.createElement(
|
|
250
|
+
'div',
|
|
251
|
+
null,
|
|
252
|
+
_react2.default.createElement(
|
|
253
|
+
_button2.default,
|
|
254
|
+
{ icon: 'cross', type: 'ghost', size: 'small', onClick: function onClick() {
|
|
255
|
+
return _this2.onDelete(data.seq, data.id, data);
|
|
256
|
+
} },
|
|
257
|
+
'\u5220\u9664'
|
|
258
|
+
)
|
|
259
|
+
) :
|
|
260
|
+
// 如果为纠错编辑模式下 非新增的不显示删除按钮 暂时只考虑补录的情况
|
|
261
|
+
null : null,
|
|
262
|
+
_react2.default.createElement('br', null)
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
}]);
|
|
266
|
+
|
|
267
|
+
return CardItem;
|
|
268
|
+
}(_react2.default.Component);
|
|
269
|
+
|
|
270
|
+
CardItem.propTypes = {
|
|
271
|
+
order: _propTypes2.default.any,
|
|
272
|
+
isEdit: _propTypes2.default.bool,
|
|
273
|
+
onDelete: _propTypes2.default.func
|
|
274
|
+
};
|
|
275
|
+
CardItem.defaultProps = {
|
|
276
|
+
order: "", // 序号
|
|
277
|
+
isEdit: false // 是否正在编辑
|
|
278
|
+
};
|
|
279
|
+
exports.default = CardItem;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _button = require('antd-mobile/lib/button');
|
|
8
|
+
|
|
9
|
+
var _button2 = _interopRequireDefault(_button);
|
|
10
|
+
|
|
11
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
12
|
+
|
|
13
|
+
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; }; }();
|
|
14
|
+
|
|
15
|
+
require('antd-mobile/lib/button/style/css');
|
|
16
|
+
|
|
17
|
+
var _react = require('react');
|
|
18
|
+
|
|
19
|
+
var _react2 = _interopRequireDefault(_react);
|
|
20
|
+
|
|
21
|
+
var _rcForm = require('rc-form');
|
|
22
|
+
|
|
23
|
+
var _index = require('./cardItem/index');
|
|
24
|
+
|
|
25
|
+
var _index2 = _interopRequireDefault(_index);
|
|
26
|
+
|
|
27
|
+
var _createUuid = require('../../../../utils/createUuid');
|
|
28
|
+
|
|
29
|
+
var _createUuid2 = _interopRequireDefault(_createUuid);
|
|
30
|
+
|
|
31
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
|
+
|
|
33
|
+
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); } }
|
|
34
|
+
|
|
35
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
36
|
+
|
|
37
|
+
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; }
|
|
38
|
+
|
|
39
|
+
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; }
|
|
40
|
+
|
|
41
|
+
var Card = function (_React$Component) {
|
|
42
|
+
_inherits(Card, _React$Component);
|
|
43
|
+
|
|
44
|
+
function Card() {
|
|
45
|
+
var _ref;
|
|
46
|
+
|
|
47
|
+
var _temp, _this, _ret;
|
|
48
|
+
|
|
49
|
+
_classCallCheck(this, Card);
|
|
50
|
+
|
|
51
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
52
|
+
args[_key] = arguments[_key];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Card.__proto__ || Object.getPrototypeOf(Card)).call.apply(_ref, [this].concat(args))), _this), _this.onAdd = function () {
|
|
56
|
+
var dataList = [].concat(_toConsumableArray(_this.props.dataList));
|
|
57
|
+
dataList.push({
|
|
58
|
+
seq: dataList.length + 1,
|
|
59
|
+
fieldPrefix: (0, _createUuid2.default)()
|
|
60
|
+
});
|
|
61
|
+
if (_this.props.setDataList) {
|
|
62
|
+
_this.props.setDataList(dataList);
|
|
63
|
+
}
|
|
64
|
+
}, _this.onClose = function (seq, id, data) {
|
|
65
|
+
var dataList = [].concat(_toConsumableArray(_this.props.dataList));
|
|
66
|
+
dataList = dataList.filter(function (item) {
|
|
67
|
+
return item.seq !== seq;
|
|
68
|
+
});
|
|
69
|
+
dataList = dataList.map(function (item, index) {
|
|
70
|
+
item.seq = index + 1;
|
|
71
|
+
return item;
|
|
72
|
+
});
|
|
73
|
+
if (_this.props.setDataList) {
|
|
74
|
+
_this.props.setDataList(dataList, id, data);
|
|
75
|
+
}
|
|
76
|
+
}, _this.onChange = function (seq, fieldName, v, t, item) {
|
|
77
|
+
var value = v;
|
|
78
|
+
var text = t;
|
|
79
|
+
if (item.bdkjlx === 'nhcascader') {
|
|
80
|
+
//如果值是级联,此时需要做处理
|
|
81
|
+
value = "";
|
|
82
|
+
text = "";
|
|
83
|
+
t.map(function (map) {
|
|
84
|
+
text += map.label;
|
|
85
|
+
value = map.value;
|
|
86
|
+
return map;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
var dataList = [].concat(_toConsumableArray(_this.props.dataList));
|
|
91
|
+
var map = dataList[seq - 1] || {};
|
|
92
|
+
|
|
93
|
+
if (map.id === undefined) {
|
|
94
|
+
//说明是新增加的一条数据
|
|
95
|
+
map[fieldName] = {
|
|
96
|
+
text: text,
|
|
97
|
+
value: value
|
|
98
|
+
};
|
|
99
|
+
map.isChange = true; //这个时候的值肯定是改变了的
|
|
100
|
+
} else {
|
|
101
|
+
//说明是本来就有的数据
|
|
102
|
+
map[fieldName].text = text;
|
|
103
|
+
map[fieldName].value = value;
|
|
104
|
+
//此时需要判断所有的值是否存在改变
|
|
105
|
+
var isChange = false;
|
|
106
|
+
for (var key in map) {
|
|
107
|
+
if (_typeof(map[key]) === 'object' && map[key].value !== map[key].initValue) {
|
|
108
|
+
isChange = true;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
map.isChange = isChange;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (_this.props.setDataList) {
|
|
115
|
+
_this.props.setDataList(dataList);
|
|
116
|
+
}
|
|
117
|
+
}, _this.onCacheSave = function () {
|
|
118
|
+
_this.props.onEditClose();
|
|
119
|
+
}, _this.onCancel = function () {
|
|
120
|
+
_this.props.onCacheBack();
|
|
121
|
+
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// 新增
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
// 删除
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 值的改变事件
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
// editCheck模式 点击保存缓存数据
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
// editCheck模式,点击取消回退先前的数据
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
_createClass(Card, [{
|
|
142
|
+
key: 'render',
|
|
143
|
+
value: function render() {
|
|
144
|
+
var _this2 = this;
|
|
145
|
+
|
|
146
|
+
var _props = this.props,
|
|
147
|
+
isEdit = _props.isEdit,
|
|
148
|
+
titleList = _props.titleList,
|
|
149
|
+
dataList = _props.dataList,
|
|
150
|
+
form = _props.form,
|
|
151
|
+
model = _props.model;
|
|
152
|
+
|
|
153
|
+
return _react2.default.createElement(
|
|
154
|
+
'div',
|
|
155
|
+
null,
|
|
156
|
+
_react2.default.createElement(
|
|
157
|
+
'form',
|
|
158
|
+
null,
|
|
159
|
+
dataList.map(function (item) {
|
|
160
|
+
return _react2.default.createElement(_index2.default, {
|
|
161
|
+
key: item.seq,
|
|
162
|
+
order: item.seq,
|
|
163
|
+
data: item,
|
|
164
|
+
titleList: titleList,
|
|
165
|
+
form: form,
|
|
166
|
+
isEdit: isEdit,
|
|
167
|
+
onDelete: _this2.onClose,
|
|
168
|
+
onChange: _this2.onChange,
|
|
169
|
+
model: model
|
|
170
|
+
});
|
|
171
|
+
})
|
|
172
|
+
),
|
|
173
|
+
isEdit === true && dataList.length < this.props.tsxzzdz ? _react2.default.createElement(
|
|
174
|
+
'div',
|
|
175
|
+
null,
|
|
176
|
+
_react2.default.createElement(
|
|
177
|
+
_button2.default,
|
|
178
|
+
{ icon: 'plus', type: 'ghost', size: 'small', onClick: this.onAdd },
|
|
179
|
+
'\u6DFB\u52A0'
|
|
180
|
+
)
|
|
181
|
+
) : null,
|
|
182
|
+
|
|
183
|
+
// 纠错编辑模式
|
|
184
|
+
isEdit === true && model === 'editCheck' && _react2.default.createElement(
|
|
185
|
+
'div',
|
|
186
|
+
{ style: { display: 'flex', justifyContent: 'space-around', margin: '10px 0px 5px 0' } },
|
|
187
|
+
_react2.default.createElement(
|
|
188
|
+
_button2.default,
|
|
189
|
+
{ type: 'primary', inline: true, size: 'small', onClick: this.onCacheSave },
|
|
190
|
+
'\u4FDD\u5B58'
|
|
191
|
+
),
|
|
192
|
+
_react2.default.createElement(
|
|
193
|
+
_button2.default,
|
|
194
|
+
{ type: 'ghost', inline: true, size: 'small', onClick: this.onCancel },
|
|
195
|
+
'\u53D6\u6D88'
|
|
196
|
+
)
|
|
197
|
+
)
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
}]);
|
|
201
|
+
|
|
202
|
+
return Card;
|
|
203
|
+
}(_react2.default.Component);
|
|
204
|
+
|
|
205
|
+
var CardForm = (0, _rcForm.createForm)()(Card);
|
|
206
|
+
exports.default = CardForm;
|