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,81 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
|
|
8
|
+
|
|
9
|
+
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
|
|
10
|
+
|
|
11
|
+
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
12
|
+
|
|
13
|
+
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
14
|
+
|
|
15
|
+
var _createClass2 = require('babel-runtime/helpers/createClass');
|
|
16
|
+
|
|
17
|
+
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
18
|
+
|
|
19
|
+
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
20
|
+
|
|
21
|
+
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
22
|
+
|
|
23
|
+
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
24
|
+
|
|
25
|
+
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
26
|
+
|
|
27
|
+
var _react = require('react');
|
|
28
|
+
|
|
29
|
+
var _react2 = _interopRequireDefault(_react);
|
|
30
|
+
|
|
31
|
+
var _dragM = require('./dragM');
|
|
32
|
+
|
|
33
|
+
var _dragM2 = _interopRequireDefault(_dragM);
|
|
34
|
+
|
|
35
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
36
|
+
|
|
37
|
+
var BuildTitle = function (_React$Component) {
|
|
38
|
+
(0, _inherits3.default)(BuildTitle, _React$Component);
|
|
39
|
+
|
|
40
|
+
function BuildTitle() {
|
|
41
|
+
var _ref;
|
|
42
|
+
|
|
43
|
+
var _temp, _this, _ret;
|
|
44
|
+
|
|
45
|
+
(0, _classCallCheck3.default)(this, BuildTitle);
|
|
46
|
+
|
|
47
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
48
|
+
args[_key] = arguments[_key];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = BuildTitle.__proto__ || (0, _getPrototypeOf2.default)(BuildTitle)).call.apply(_ref, [this].concat(args))), _this), _this.updateTransform = function (transformStr) {
|
|
52
|
+
_this.modalDom.style.transform = transformStr;
|
|
53
|
+
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
(0, _createClass3.default)(BuildTitle, [{
|
|
57
|
+
key: 'componentDidMount',
|
|
58
|
+
value: function componentDidMount() {
|
|
59
|
+
var modalList = document.getElementsByClassName('ant-modal'); //modal的class是ant-modal
|
|
60
|
+
this.modalDom = modalList[modalList.length - 1];
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
key: 'render',
|
|
64
|
+
value: function render() {
|
|
65
|
+
var title = this.props.title;
|
|
66
|
+
|
|
67
|
+
return _react2.default.createElement(
|
|
68
|
+
_dragM2.default,
|
|
69
|
+
{ updateTransform: this.updateTransform },
|
|
70
|
+
_react2.default.createElement(
|
|
71
|
+
'div',
|
|
72
|
+
null,
|
|
73
|
+
title
|
|
74
|
+
)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
}]);
|
|
78
|
+
return BuildTitle;
|
|
79
|
+
}(_react2.default.Component);
|
|
80
|
+
|
|
81
|
+
exports.default = BuildTitle;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _extends2 = require('babel-runtime/helpers/extends');
|
|
8
|
+
|
|
9
|
+
var _extends3 = _interopRequireDefault(_extends2);
|
|
10
|
+
|
|
11
|
+
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
|
|
12
|
+
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
|
|
14
|
+
|
|
15
|
+
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
16
|
+
|
|
17
|
+
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
18
|
+
|
|
19
|
+
var _createClass2 = require('babel-runtime/helpers/createClass');
|
|
20
|
+
|
|
21
|
+
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
22
|
+
|
|
23
|
+
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
24
|
+
|
|
25
|
+
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
26
|
+
|
|
27
|
+
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
28
|
+
|
|
29
|
+
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
30
|
+
|
|
31
|
+
var _react = require('react');
|
|
32
|
+
|
|
33
|
+
var _react2 = _interopRequireDefault(_react);
|
|
34
|
+
|
|
35
|
+
var _propTypes = require('prop-types');
|
|
36
|
+
|
|
37
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
38
|
+
|
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
|
+
|
|
41
|
+
var DragM = function (_React$Component) {
|
|
42
|
+
(0, _inherits3.default)(DragM, _React$Component);
|
|
43
|
+
|
|
44
|
+
function DragM() {
|
|
45
|
+
var _ref;
|
|
46
|
+
|
|
47
|
+
var _temp, _this, _ret;
|
|
48
|
+
|
|
49
|
+
(0, _classCallCheck3.default)(this, DragM);
|
|
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 = (0, _possibleConstructorReturn3.default)(this, (_ref = DragM.__proto__ || (0, _getPrototypeOf2.default)(DragM)).call.apply(_ref, [this].concat(args))), _this), _this.position = {
|
|
56
|
+
startX: 0,
|
|
57
|
+
startY: 0,
|
|
58
|
+
dx: 0,
|
|
59
|
+
dy: 0,
|
|
60
|
+
tx: 0,
|
|
61
|
+
ty: 0
|
|
62
|
+
}, _this.start = function (event) {
|
|
63
|
+
if (event.button != 0) {
|
|
64
|
+
//只允许左键,右键问题在于不选择conextmenu就不会触发mouseup事件
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
document.addEventListener('mousemove', _this.docMove);
|
|
68
|
+
_this.position.startX = event.pageX - _this.position.dx;
|
|
69
|
+
_this.position.startY = event.pageY - _this.position.dy;
|
|
70
|
+
}, _this.docMove = function (event) {
|
|
71
|
+
var tx = event.pageX - _this.position.startX;
|
|
72
|
+
var ty = event.pageY - _this.position.startY;
|
|
73
|
+
var transformStr = 'translate(' + tx + 'px,' + ty + 'px)';
|
|
74
|
+
_this.props.updateTransform(transformStr, tx, ty, _this.tdom);
|
|
75
|
+
_this.position.dx = tx;
|
|
76
|
+
_this.position.dy = ty;
|
|
77
|
+
}, _this.docMouseUp = function (event) {
|
|
78
|
+
document.removeEventListener('mousemove', _this.docMove);
|
|
79
|
+
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
(0, _createClass3.default)(DragM, [{
|
|
83
|
+
key: 'componentDidMount',
|
|
84
|
+
value: function componentDidMount() {
|
|
85
|
+
this.tdom.addEventListener('mousedown', this.start);
|
|
86
|
+
//用document移除对mousemove事件的监听
|
|
87
|
+
document.addEventListener('mouseup', this.docMouseUp);
|
|
88
|
+
}
|
|
89
|
+
}, {
|
|
90
|
+
key: 'componentWillUnmount',
|
|
91
|
+
value: function componentWillUnmount() {
|
|
92
|
+
this.tdom.removeEventListener('mousedown', this.start);
|
|
93
|
+
document.removeEventListener('mouseup', this.docMouseUp);
|
|
94
|
+
document.removeEventListener('mousemove', this.docMove);
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
key: 'render',
|
|
98
|
+
value: function render() {
|
|
99
|
+
var _this2 = this;
|
|
100
|
+
|
|
101
|
+
var children = this.props.children;
|
|
102
|
+
|
|
103
|
+
var newStyle = (0, _extends3.default)({}, children.props.style, {
|
|
104
|
+
cursor: 'move',
|
|
105
|
+
userSelect: 'none'
|
|
106
|
+
});
|
|
107
|
+
return _react2.default.cloneElement(_react2.default.Children.only(children), {
|
|
108
|
+
ref: function ref(tdom) {
|
|
109
|
+
return _this2.tdom = tdom;
|
|
110
|
+
},
|
|
111
|
+
style: newStyle
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}]);
|
|
115
|
+
return DragM;
|
|
116
|
+
}(_react2.default.Component);
|
|
117
|
+
|
|
118
|
+
DragM.propTypes = {
|
|
119
|
+
children: _propTypes2.default.element.isRequired
|
|
120
|
+
};
|
|
121
|
+
DragM.defaultProps = {
|
|
122
|
+
//默认是移动children dom,覆盖该方法,可以把tranform行为同步给外部
|
|
123
|
+
updateTransform: function updateTransform(transformStr, tx, ty, tdom) {
|
|
124
|
+
tdom.style.transform = transformStr;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
exports.default = DragM;
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.KyModal = undefined;
|
|
7
|
+
|
|
8
|
+
var _button = require('antd/lib/button');
|
|
9
|
+
|
|
10
|
+
var _button2 = _interopRequireDefault(_button);
|
|
11
|
+
|
|
12
|
+
var _getIterator2 = require('babel-runtime/core-js/get-iterator');
|
|
13
|
+
|
|
14
|
+
var _getIterator3 = _interopRequireDefault(_getIterator2);
|
|
15
|
+
|
|
16
|
+
var _modal = require('antd/lib/modal');
|
|
17
|
+
|
|
18
|
+
var _modal2 = _interopRequireDefault(_modal);
|
|
19
|
+
|
|
20
|
+
var _extends2 = require('babel-runtime/helpers/extends');
|
|
21
|
+
|
|
22
|
+
var _extends3 = _interopRequireDefault(_extends2);
|
|
23
|
+
|
|
24
|
+
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
|
|
25
|
+
|
|
26
|
+
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
|
|
27
|
+
|
|
28
|
+
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
29
|
+
|
|
30
|
+
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
31
|
+
|
|
32
|
+
var _createClass2 = require('babel-runtime/helpers/createClass');
|
|
33
|
+
|
|
34
|
+
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
35
|
+
|
|
36
|
+
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
37
|
+
|
|
38
|
+
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
39
|
+
|
|
40
|
+
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
41
|
+
|
|
42
|
+
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
43
|
+
|
|
44
|
+
require('antd/lib/button/style');
|
|
45
|
+
|
|
46
|
+
require('antd/lib/modal/style');
|
|
47
|
+
|
|
48
|
+
var _react = require('react');
|
|
49
|
+
|
|
50
|
+
var _react2 = _interopRequireDefault(_react);
|
|
51
|
+
|
|
52
|
+
var _reactCustomScrollbars = require('react-custom-scrollbars');
|
|
53
|
+
|
|
54
|
+
var _propTypes = require('prop-types');
|
|
55
|
+
|
|
56
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
57
|
+
|
|
58
|
+
var _buildTitle = require('./buildTitle');
|
|
59
|
+
|
|
60
|
+
var _buildTitle2 = _interopRequireDefault(_buildTitle);
|
|
61
|
+
|
|
62
|
+
require('../../../assets/components/KyModal/index.less');
|
|
63
|
+
|
|
64
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
65
|
+
|
|
66
|
+
//Modal的最大宽度、高度为屏幕宽度、高度的2/3
|
|
67
|
+
var maxWidth = window.screen.width * 2 / 3; /**
|
|
68
|
+
* @Description: 对话框二次封装
|
|
69
|
+
* @Version: 1.0
|
|
70
|
+
* @Author: 琴时
|
|
71
|
+
* @Date: 2022-04-24 17:00:53
|
|
72
|
+
* @LastEditors: 琴时
|
|
73
|
+
* @LastEditTime: 2022-06-06 10:07:04
|
|
74
|
+
* Modify log:
|
|
75
|
+
* 1、解决控制台警告问题;
|
|
76
|
+
* 2、对话框居中;
|
|
77
|
+
* 3、点击保存按钮后,保存按钮默认变成loading状态,可在onOk回调方法中调用回调函数stopLoading来终止按钮的loading状态;
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
var maxHeight = window.screen.height * 2 / 3;
|
|
81
|
+
|
|
82
|
+
var KyModal = exports.KyModal = function (_React$Component) {
|
|
83
|
+
(0, _inherits3.default)(KyModal, _React$Component);
|
|
84
|
+
|
|
85
|
+
function KyModal(props) {
|
|
86
|
+
(0, _classCallCheck3.default)(this, KyModal);
|
|
87
|
+
|
|
88
|
+
var _this = (0, _possibleConstructorReturn3.default)(this, (KyModal.__proto__ || (0, _getPrototypeOf2.default)(KyModal)).call(this, props));
|
|
89
|
+
|
|
90
|
+
_this.show = function () {
|
|
91
|
+
_this.setState({ visible: true });
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
_this.close = function () {
|
|
95
|
+
_this.setState({ visible: false, confirmLoading: false });
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
_this.stopLoading = function () {
|
|
99
|
+
_this.setState({ confirmLoading: false });
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
_this.handleOk = function () {
|
|
103
|
+
_this.setState({ confirmLoading: true });
|
|
104
|
+
_this.props.onOk(_this.stopLoading);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
_this.handleCancel = function () {
|
|
108
|
+
_this.close();
|
|
109
|
+
_this.props.onCancel();
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
_this.state = {
|
|
113
|
+
visible: false, //默认不可见
|
|
114
|
+
confirmLoading: false //确定按钮 loading
|
|
115
|
+
};
|
|
116
|
+
return _this;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
//显示
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
//关闭
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
//隐藏加载动画
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
//确认
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
//取消
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
(0, _createClass3.default)(KyModal, [{
|
|
135
|
+
key: 'render',
|
|
136
|
+
value: function render() {
|
|
137
|
+
var _state = this.state,
|
|
138
|
+
visible = _state.visible,
|
|
139
|
+
confirmLoading = _state.confirmLoading;
|
|
140
|
+
var _props = this.props,
|
|
141
|
+
title = _props.title,
|
|
142
|
+
style = _props.style,
|
|
143
|
+
bodyStyle = _props.bodyStyle,
|
|
144
|
+
maxSize = _props.maxSize,
|
|
145
|
+
destroyOnClose = _props.destroyOnClose,
|
|
146
|
+
footer = _props.footer,
|
|
147
|
+
afterClose = _props.afterClose,
|
|
148
|
+
drag = _props.drag,
|
|
149
|
+
okText = _props.okText,
|
|
150
|
+
cancelText = _props.cancelText,
|
|
151
|
+
height = _props.height;
|
|
152
|
+
|
|
153
|
+
var width = this.props.width;
|
|
154
|
+
var _title = title && drag ? _react2.default.createElement(_buildTitle2.default, { visible: visible, title: title }) : title;
|
|
155
|
+
if (maxSize) {
|
|
156
|
+
width = maxWidth;
|
|
157
|
+
} else if (width > maxWidth) {
|
|
158
|
+
width = maxWidth;
|
|
159
|
+
}
|
|
160
|
+
if (!visible) return null;
|
|
161
|
+
//如果未定义页脚按钮,则使用默认按钮
|
|
162
|
+
if (!footer) {
|
|
163
|
+
return _react2.default.createElement(
|
|
164
|
+
_modal2.default,
|
|
165
|
+
(0, _extends3.default)({}, this.props, {
|
|
166
|
+
title: _title,
|
|
167
|
+
style: style,
|
|
168
|
+
bodyStyle: bodyStyle,
|
|
169
|
+
visible: visible,
|
|
170
|
+
width: width,
|
|
171
|
+
okText: okText,
|
|
172
|
+
onOk: this.handleOk,
|
|
173
|
+
cancelText: cancelText,
|
|
174
|
+
onCancel: this.handleCancel,
|
|
175
|
+
wrapClassName: 'vertical-center-modal',
|
|
176
|
+
confirmLoading: confirmLoading,
|
|
177
|
+
maskClosable: false,
|
|
178
|
+
destroyOnClose: destroyOnClose,
|
|
179
|
+
afterClose: afterClose
|
|
180
|
+
}),
|
|
181
|
+
_react2.default.createElement(
|
|
182
|
+
'div',
|
|
183
|
+
{ style: { maxHeight: height || maxHeight } },
|
|
184
|
+
_react2.default.createElement(
|
|
185
|
+
_reactCustomScrollbars.Scrollbars,
|
|
186
|
+
{ autoHide: true, autoHeight: true, autoHeightMax: maxHeight, style: { width: '100%' } },
|
|
187
|
+
this.props.children
|
|
188
|
+
)
|
|
189
|
+
)
|
|
190
|
+
);
|
|
191
|
+
} else {
|
|
192
|
+
//如果footer为null,则不显示页脚按钮
|
|
193
|
+
var buttons = [];
|
|
194
|
+
if (footer && footer.length > 0) {
|
|
195
|
+
var buttonKey = 0;
|
|
196
|
+
var _iteratorNormalCompletion = true;
|
|
197
|
+
var _didIteratorError = false;
|
|
198
|
+
var _iteratorError = undefined;
|
|
199
|
+
|
|
200
|
+
try {
|
|
201
|
+
for (var _iterator = (0, _getIterator3.default)(footer), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
202
|
+
var buttonParam = _step.value;
|
|
203
|
+
|
|
204
|
+
//text:按钮描述,type:按钮类型,icon:按钮图标,loading:加载状态,onClick:按钮点击事件
|
|
205
|
+
var _buttonParam$text = buttonParam.text,
|
|
206
|
+
text = _buttonParam$text === undefined ? '' : _buttonParam$text,
|
|
207
|
+
_buttonParam$type = buttonParam.type,
|
|
208
|
+
type = _buttonParam$type === undefined ? 'primary' : _buttonParam$type,
|
|
209
|
+
_buttonParam$icon = buttonParam.icon,
|
|
210
|
+
icon = _buttonParam$icon === undefined ? '' : _buttonParam$icon,
|
|
211
|
+
_buttonParam$loading = buttonParam.loading,
|
|
212
|
+
loading = _buttonParam$loading === undefined ? false : _buttonParam$loading,
|
|
213
|
+
_buttonParam$onClick = buttonParam.onClick,
|
|
214
|
+
onClick = _buttonParam$onClick === undefined ? function () {} : _buttonParam$onClick,
|
|
215
|
+
_buttonParam$disabled = buttonParam.disabled,
|
|
216
|
+
disabled = _buttonParam$disabled === undefined ? false : _buttonParam$disabled;
|
|
217
|
+
|
|
218
|
+
var customButton = _react2.default.createElement(
|
|
219
|
+
_button2.default,
|
|
220
|
+
{
|
|
221
|
+
key: buttonKey,
|
|
222
|
+
type: type,
|
|
223
|
+
icon: icon,
|
|
224
|
+
loading: loading,
|
|
225
|
+
onClick: onClick,
|
|
226
|
+
disabled: disabled
|
|
227
|
+
},
|
|
228
|
+
text
|
|
229
|
+
);
|
|
230
|
+
buttons.push(customButton);
|
|
231
|
+
buttonKey++;
|
|
232
|
+
}
|
|
233
|
+
} catch (err) {
|
|
234
|
+
_didIteratorError = true;
|
|
235
|
+
_iteratorError = err;
|
|
236
|
+
} finally {
|
|
237
|
+
try {
|
|
238
|
+
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
239
|
+
_iterator.return();
|
|
240
|
+
}
|
|
241
|
+
} finally {
|
|
242
|
+
if (_didIteratorError) {
|
|
243
|
+
throw _iteratorError;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
} else {
|
|
248
|
+
buttons = null;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return _react2.default.createElement(
|
|
252
|
+
_modal2.default,
|
|
253
|
+
(0, _extends3.default)({}, this.props, {
|
|
254
|
+
title: title,
|
|
255
|
+
style: style,
|
|
256
|
+
bodyStyle: bodyStyle,
|
|
257
|
+
visible: visible,
|
|
258
|
+
width: width,
|
|
259
|
+
footer: buttons,
|
|
260
|
+
onCancel: this.handleCancel,
|
|
261
|
+
wrapClassName: 'vertical-center-modal',
|
|
262
|
+
confirmLoading: confirmLoading,
|
|
263
|
+
maskClosable: false,
|
|
264
|
+
destroyOnClose: destroyOnClose,
|
|
265
|
+
afterClose: afterClose
|
|
266
|
+
}),
|
|
267
|
+
_react2.default.createElement(
|
|
268
|
+
'div',
|
|
269
|
+
{ style: { maxHeight: maxHeight } },
|
|
270
|
+
_react2.default.createElement(
|
|
271
|
+
_reactCustomScrollbars.Scrollbars,
|
|
272
|
+
{ autoHide: true, autoHeight: true, autoHeightMax: maxHeight, style: { width: '100%' } },
|
|
273
|
+
this.props.children
|
|
274
|
+
)
|
|
275
|
+
)
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}]);
|
|
280
|
+
return KyModal;
|
|
281
|
+
}(_react2.default.Component);
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* KyModal默认属性
|
|
285
|
+
*/
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
KyModal.defaultProps = {
|
|
289
|
+
title: '标题',
|
|
290
|
+
cancelText: '取消',
|
|
291
|
+
okText: '确定',
|
|
292
|
+
width: 520, //默认最小宽度
|
|
293
|
+
maxSize: false, //是否最大化窗口
|
|
294
|
+
height: undefined, //高度
|
|
295
|
+
destroyOnClose: true, //关闭时销毁 Modal 里的子元素
|
|
296
|
+
onOk: function onOk() {},
|
|
297
|
+
onCancel: function onCancel() {},
|
|
298
|
+
afterClose: function afterClose() {},
|
|
299
|
+
drag: true
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* KyModal属性检查
|
|
304
|
+
*/
|
|
305
|
+
KyModal.propTypes = {
|
|
306
|
+
title: _propTypes2.default.string, //对话框标题
|
|
307
|
+
cancelText: _propTypes2.default.string, //返回按钮文字
|
|
308
|
+
okText: _propTypes2.default.string, //确认按钮文字
|
|
309
|
+
style: _propTypes2.default.object, //对话框样式
|
|
310
|
+
bodyStyle: _propTypes2.default.object, //Modal body 样式
|
|
311
|
+
width: _propTypes2.default.number, //宽度
|
|
312
|
+
maxSize: _propTypes2.default.bool, //最大化窗口
|
|
313
|
+
footer: _propTypes2.default.arrayOf(_propTypes2.default.object), //按钮组
|
|
314
|
+
destroyOnClose: _propTypes2.default.bool, //关闭时销毁对话框内子元素
|
|
315
|
+
onOk: _propTypes2.default.func, //保存事件回调方法
|
|
316
|
+
onCancel: _propTypes2.default.func, //返回事件回调方法
|
|
317
|
+
afterClose: _propTypes2.default.func, //Modal 完全关闭后的回调
|
|
318
|
+
drag: _propTypes2.default.bool // 是否可拖拽
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
exports.default = KyModal;
|