dlt-for-react 1.0.24 → 1.1.1
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 +10 -20
- 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 +187 -118
- 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/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,274 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _switch = require('antd/lib/switch');
|
|
8
|
+
|
|
9
|
+
var _switch2 = _interopRequireDefault(_switch);
|
|
10
|
+
|
|
11
|
+
var _input = require('antd/lib/input');
|
|
12
|
+
|
|
13
|
+
var _input2 = _interopRequireDefault(_input);
|
|
14
|
+
|
|
15
|
+
var _row = require('antd/lib/row');
|
|
16
|
+
|
|
17
|
+
var _row2 = _interopRequireDefault(_row);
|
|
18
|
+
|
|
19
|
+
var _col = require('antd/lib/col');
|
|
20
|
+
|
|
21
|
+
var _col2 = _interopRequireDefault(_col);
|
|
22
|
+
|
|
23
|
+
var _message2 = require('antd/lib/message');
|
|
24
|
+
|
|
25
|
+
var _message3 = _interopRequireDefault(_message2);
|
|
26
|
+
|
|
27
|
+
var _stringify = require('babel-runtime/core-js/json/stringify');
|
|
28
|
+
|
|
29
|
+
var _stringify2 = _interopRequireDefault(_stringify);
|
|
30
|
+
|
|
31
|
+
var _extends2 = require('babel-runtime/helpers/extends');
|
|
32
|
+
|
|
33
|
+
var _extends3 = _interopRequireDefault(_extends2);
|
|
34
|
+
|
|
35
|
+
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
|
|
36
|
+
|
|
37
|
+
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
|
|
38
|
+
|
|
39
|
+
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
40
|
+
|
|
41
|
+
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
42
|
+
|
|
43
|
+
var _createClass2 = require('babel-runtime/helpers/createClass');
|
|
44
|
+
|
|
45
|
+
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
46
|
+
|
|
47
|
+
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
48
|
+
|
|
49
|
+
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
50
|
+
|
|
51
|
+
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
52
|
+
|
|
53
|
+
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
54
|
+
|
|
55
|
+
require('antd/lib/switch/style');
|
|
56
|
+
|
|
57
|
+
require('antd/lib/input/style');
|
|
58
|
+
|
|
59
|
+
require('antd/lib/row/style');
|
|
60
|
+
|
|
61
|
+
require('antd/lib/col/style');
|
|
62
|
+
|
|
63
|
+
require('antd/lib/message/style');
|
|
64
|
+
|
|
65
|
+
var _react = require('react');
|
|
66
|
+
|
|
67
|
+
var _react2 = _interopRequireDefault(_react);
|
|
68
|
+
|
|
69
|
+
var _inputConst = require('./input-const');
|
|
70
|
+
|
|
71
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 开关选择器输入控件配置组件
|
|
75
|
+
* Author: zengxiangkai@ly-sky.com
|
|
76
|
+
* Created on: 2018-02-07 09:36:29
|
|
77
|
+
* Version: 1.0
|
|
78
|
+
* Modify log:
|
|
79
|
+
* 2019-03-21:1、增加validationValueType表单校验值类型属性
|
|
80
|
+
*/
|
|
81
|
+
var SettingSwitch = function (_React$Component) {
|
|
82
|
+
(0, _inherits3.default)(SettingSwitch, _React$Component);
|
|
83
|
+
|
|
84
|
+
function SettingSwitch(props) {
|
|
85
|
+
(0, _classCallCheck3.default)(this, SettingSwitch);
|
|
86
|
+
|
|
87
|
+
var _this = (0, _possibleConstructorReturn3.default)(this, (SettingSwitch.__proto__ || (0, _getPrototypeOf2.default)(SettingSwitch)).call(this, props));
|
|
88
|
+
|
|
89
|
+
_this.getFeature = function () {
|
|
90
|
+
return _this.state.feature;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
_this.handleCheckedTextChange = function (e) {
|
|
94
|
+
var checkedText = e.target.value;
|
|
95
|
+
var fp = (0, _extends3.default)({}, _this.state.featureParams);
|
|
96
|
+
fp.checkedText = checkedText;
|
|
97
|
+
_this.setState({ featureParams: fp });
|
|
98
|
+
_this.createFeature(fp);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
_this.handleUncheckedTextChange = function (e) {
|
|
102
|
+
var uncheckedText = e.target.value;
|
|
103
|
+
var fp = (0, _extends3.default)({}, _this.state.featureParams);
|
|
104
|
+
fp.uncheckedText = uncheckedText;
|
|
105
|
+
_this.setState({ featureParams: fp });
|
|
106
|
+
_this.createFeature(fp);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
_this.handleDefaultCheckedChange = function (value) {
|
|
110
|
+
var defaultChecked = value;
|
|
111
|
+
var fp = (0, _extends3.default)({}, _this.state.featureParams);
|
|
112
|
+
fp.defaultChecked = defaultChecked;
|
|
113
|
+
_this.setState({ featureParams: fp });
|
|
114
|
+
_this.createFeature(fp);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
_this.createFeature = function (featureParams) {
|
|
118
|
+
|
|
119
|
+
try {
|
|
120
|
+
var feature = (0, _stringify2.default)(featureParams);
|
|
121
|
+
_this.setState({
|
|
122
|
+
feature: feature
|
|
123
|
+
});
|
|
124
|
+
_this.props.onChange(feature);
|
|
125
|
+
} catch (e) {
|
|
126
|
+
console.log(e);
|
|
127
|
+
_message3.default.error('生成控件配置参数出错!');
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
_this.state = {
|
|
132
|
+
feature: '', //原参数json字符串
|
|
133
|
+
featureParams: {
|
|
134
|
+
name: '开关选择器组件',
|
|
135
|
+
type: _inputConst.InputType.SWITCH, //控件类型,必须有此属性,用于渲染时期判断控件类型
|
|
136
|
+
checkedText: '', //开启时的文字说明
|
|
137
|
+
uncheckedText: '', //关闭时的文字说明
|
|
138
|
+
defaultChecked: false, //是否开启
|
|
139
|
+
validationValueType: 'boolean' //用于校验的值的类型
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
return _this;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
(0, _createClass3.default)(SettingSwitch, [{
|
|
146
|
+
key: 'componentWillMount',
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
//在渲染前调用,可在此最后一次初始化组件状态
|
|
150
|
+
value: function componentWillMount() {
|
|
151
|
+
//将输入控件配置参数设置到状态中
|
|
152
|
+
if (this.props.initFeature) {
|
|
153
|
+
try {
|
|
154
|
+
var initFeature = JSON.parse(this.props.initFeature);
|
|
155
|
+
if (initFeature.type == _inputConst.InputType.SWITCH) {
|
|
156
|
+
var _initFeature$checkedT = initFeature.checkedText,
|
|
157
|
+
checkedText = _initFeature$checkedT === undefined ? '' : _initFeature$checkedT,
|
|
158
|
+
_initFeature$unchecke = initFeature.uncheckedText,
|
|
159
|
+
uncheckedText = _initFeature$unchecke === undefined ? '' : _initFeature$unchecke,
|
|
160
|
+
_initFeature$defaultC = initFeature.defaultChecked,
|
|
161
|
+
defaultChecked = _initFeature$defaultC === undefined ? false : _initFeature$defaultC;
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
var fp = (0, _extends3.default)({}, this.state.featureParams);
|
|
165
|
+
fp.checkedText = checkedText;
|
|
166
|
+
fp.uncheckedText = uncheckedText;
|
|
167
|
+
fp.defaultChecked = defaultChecked;
|
|
168
|
+
|
|
169
|
+
this.setState({
|
|
170
|
+
feature: this.props.initFeature,
|
|
171
|
+
featureParams: fp
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
} catch (e) {
|
|
175
|
+
console.log(e);
|
|
176
|
+
_message3.default.error('解析控件配置参数出错!');
|
|
177
|
+
}
|
|
178
|
+
} else {
|
|
179
|
+
try {
|
|
180
|
+
var feature = (0, _stringify2.default)(this.state.featureParams);
|
|
181
|
+
this.setState({
|
|
182
|
+
feature: feature
|
|
183
|
+
});
|
|
184
|
+
} catch (e) {
|
|
185
|
+
console.log(e);
|
|
186
|
+
_message3.default.error('生成控件配置参数出错!');
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
//供父组件获取feature
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
//当开关开启文字说明改变时
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
//当开关关闭文字说明改变时
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
//当默认状态改变时
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
//生成feature参数json字符串
|
|
204
|
+
|
|
205
|
+
}, {
|
|
206
|
+
key: 'render',
|
|
207
|
+
value: function render() {
|
|
208
|
+
var _state$featureParams = this.state.featureParams,
|
|
209
|
+
checkedText = _state$featureParams.checkedText,
|
|
210
|
+
uncheckedText = _state$featureParams.uncheckedText,
|
|
211
|
+
defaultChecked = _state$featureParams.defaultChecked;
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
return _react2.default.createElement(
|
|
215
|
+
'div',
|
|
216
|
+
{ id: 'input-setting-div' },
|
|
217
|
+
_react2.default.createElement(
|
|
218
|
+
_row2.default,
|
|
219
|
+
{ type: 'flex' },
|
|
220
|
+
_react2.default.createElement(
|
|
221
|
+
_col2.default,
|
|
222
|
+
null,
|
|
223
|
+
_react2.default.createElement(
|
|
224
|
+
'div',
|
|
225
|
+
{ style: { margin: "16px 0" } },
|
|
226
|
+
'\u5F00\u5173\u6587\u5B57\u8BF4\u660E'
|
|
227
|
+
)
|
|
228
|
+
)
|
|
229
|
+
),
|
|
230
|
+
_react2.default.createElement(
|
|
231
|
+
_row2.default,
|
|
232
|
+
{ type: 'flex', gutter: 8 },
|
|
233
|
+
_react2.default.createElement(
|
|
234
|
+
_col2.default,
|
|
235
|
+
{ span: 12 },
|
|
236
|
+
_react2.default.createElement(_input2.default, { placeholder: '\u8BF7\u8F93\u5165\u5F00\u542F\u6587\u5B57\u8BF4\u660E', value: checkedText, onChange: this.handleCheckedTextChange })
|
|
237
|
+
),
|
|
238
|
+
_react2.default.createElement(
|
|
239
|
+
_col2.default,
|
|
240
|
+
{ span: 12 },
|
|
241
|
+
_react2.default.createElement(_input2.default, { placeholder: '\u8BF7\u8F93\u5165\u5173\u95ED\u6587\u5B57\u8BF4\u660E', value: uncheckedText, onChange: this.handleUncheckedTextChange })
|
|
242
|
+
)
|
|
243
|
+
),
|
|
244
|
+
_react2.default.createElement(
|
|
245
|
+
_row2.default,
|
|
246
|
+
{ type: 'flex' },
|
|
247
|
+
_react2.default.createElement(
|
|
248
|
+
_col2.default,
|
|
249
|
+
{ span: 24 },
|
|
250
|
+
_react2.default.createElement(
|
|
251
|
+
'div',
|
|
252
|
+
{ style: { margin: "16px 0" } },
|
|
253
|
+
'\u9ED8\u8BA4\u72B6\u6001'
|
|
254
|
+
)
|
|
255
|
+
)
|
|
256
|
+
),
|
|
257
|
+
_react2.default.createElement(
|
|
258
|
+
_row2.default,
|
|
259
|
+
{ type: 'flex' },
|
|
260
|
+
_react2.default.createElement(
|
|
261
|
+
_col2.default,
|
|
262
|
+
{ span: 12 },
|
|
263
|
+
_react2.default.createElement(_switch2.default, { checkedChildren: checkedText, unCheckedChildren: uncheckedText, checked: defaultChecked, onChange: this.handleDefaultCheckedChange })
|
|
264
|
+
)
|
|
265
|
+
)
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
}]);
|
|
269
|
+
return SettingSwitch;
|
|
270
|
+
}(_react2.default.Component);
|
|
271
|
+
|
|
272
|
+
SettingSwitch.defaultProps = {
|
|
273
|
+
initFeature: '' };
|
|
274
|
+
exports.default = SettingSwitch;
|