dlt-for-react 1.1.2 → 1.1.4
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 +9 -2
- package/lib/index.js +13 -1
- package/lib/layouts/LeftMenu/index.js +322 -296
- package/lib/layouts/Top/index.js +1 -1
- package/lib/layouts/layout/index.js +77 -31
- package/lib/layouts/mixTop/index.js +3 -3
- package/lib/utils/createUuid.js +31 -11
- package/lib/utils/getLoginUser.js +1 -1
- package/lib/utils/getSize.js +11 -2
- package/lib/utils/index.js +46 -2
- package/package.json +1 -1
- package/lib/components/Button/index.js +0 -79
- package/lib/components/NHAuditPanel/config/Axios.js +0 -263
- package/lib/components/NHAuditPanel/config/api.js +0 -479
- package/lib/components/NHAuditPanel/config/data.js +0 -156
- package/lib/components/NHAuditPanel/config/typeMap.js +0 -1234
- package/lib/components/NHAuditPanel/config/uiValidate.js +0 -92
- package/lib/components/NHAuditPanel/index.js +0 -413
- package/lib/components/NHAuditPanel/node.js +0 -619
- package/lib/components/NHCascader/index.js +0 -355
- package/lib/components/NHCheckboxGroup/index.js +0 -135
- package/lib/components/NHDynamicFormShow/baseInfo/index.js +0 -194
- package/lib/components/NHDynamicFormShow/custom/index.js +0 -553
- package/lib/components/NHDynamicFormShow/customModule/common/CommonMethod.js +0 -43
- package/lib/components/NHDynamicFormShow/customModule/czxy/qgzx/EditForm.js +0 -1113
- package/lib/components/NHDynamicFormShow/customModule/czxy/qgzx/index.js +0 -263
- package/lib/components/NHDynamicFormShow/customModule/czxy/xfjm/EditForm.js +0 -880
- package/lib/components/NHDynamicFormShow/customModule/czxy/xfjm/index.js +0 -171
- package/lib/components/NHDynamicFormShow/customModule/czxy/zxj/EditForm.js +0 -865
- package/lib/components/NHDynamicFormShow/customModule/czxy/zxj/index.js +0 -138
- package/lib/components/NHDynamicFormShow/customModule/eszy/zsxxhd/EditForm.js +0 -571
- package/lib/components/NHDynamicFormShow/customModule/eszy/zsxxhd/index.js +0 -147
- package/lib/components/NHDynamicFormShow/customModule/eszy/zybjtz/EditForm.js +0 -474
- package/lib/components/NHDynamicFormShow/customModule/eszy/zybjtz/index.js +0 -139
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/cqzg/EditForm.js +0 -506
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/cqzg/index.js +0 -143
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/gwsb/EditForm.js +0 -1074
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/gwsb/index.js +0 -172
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/qjgl/EditForm.js +0 -927
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/qjgl/index.js +0 -195
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/sxsqj/EditForm.js +0 -1064
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/sxsqj/index.js +0 -183
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/jxj/EditForm.js +0 -763
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/jxj/index.js +0 -137
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/lzjxj/EditForm.js +0 -819
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/lzjxj/index.js +0 -137
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/qgzx/EditForm.js +0 -700
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/qgzx/index.js +0 -162
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/xsqj/EditForm.js +0 -743
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/xsqj/index.js +0 -177
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/zxj/EditForm.js +0 -848
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/zxj/index.js +0 -138
- package/lib/components/NHDynamicFormShow/customModule/hljwgy/qjgl/EditForm.js +0 -777
- package/lib/components/NHDynamicFormShow/customModule/hljwgy/qjgl/index.js +0 -161
- package/lib/components/NHDynamicFormShow/customModule/hljwgy/xjgl/EditForm.js +0 -706
- package/lib/components/NHDynamicFormShow/customModule/hljwgy/xjgl/index.js +0 -130
- package/lib/components/NHDynamicFormShow/customModule/jhysxy/cfjcsq/cfjcEditForm.js +0 -413
- package/lib/components/NHDynamicFormShow/customModule/jhysxy/cfjcsq/index.js +0 -135
- package/lib/components/NHDynamicFormShow/customModule/jhysxy/xsqj/EditForm.js +0 -1013
- package/lib/components/NHDynamicFormShow/customModule/jhysxy/xsqj/index.js +0 -175
- package/lib/components/NHDynamicFormShow/customModule/jjrlx/EditForm.js +0 -1345
- package/lib/components/NHDynamicFormShow/customModule/jjrlx/index.js +0 -274
- package/lib/components/NHDynamicFormShow/customModule/jxj/EditForm.js +0 -669
- package/lib/components/NHDynamicFormShow/customModule/jxj/index.js +0 -134
- package/lib/components/NHDynamicFormShow/customModule/jxsl/fqkns/EditForm.js +0 -378
- package/lib/components/NHDynamicFormShow/customModule/jxsl/fqkns/index.js +0 -120
- package/lib/components/NHDynamicFormShow/customModule/jxsl/xwryfjjd/EditForm.js +0 -638
- package/lib/components/NHDynamicFormShow/customModule/jxsl/xwryfjjd/index.js +0 -133
- package/lib/components/NHDynamicFormShow/customModule/qgzx/EditForm.js +0 -965
- package/lib/components/NHDynamicFormShow/customModule/qgzx/index.js +0 -237
- package/lib/components/NHDynamicFormShow/customModule/qjgl/EditForm.js +0 -823
- package/lib/components/NHDynamicFormShow/customModule/qjgl/index.js +0 -188
- package/lib/components/NHDynamicFormShow/customModule/rcgl/jqlssq/EditForm.js +0 -401
- package/lib/components/NHDynamicFormShow/customModule/rcgl/jqlssq/index.js +0 -472
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/EditForm.js +0 -304
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHCascader/index.js +0 -375
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/RadioGroup.js +0 -118
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/index.js +0 -62
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/input-const.js +0 -55
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/render.js +0 -1238
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/index.js +0 -375
- package/lib/components/NHDynamicFormShow/customModule/rych/collective/EditForm.js +0 -554
- package/lib/components/NHDynamicFormShow/customModule/rych/collective/index.js +0 -130
- package/lib/components/NHDynamicFormShow/customModule/rych/personal/EditForm.js +0 -542
- package/lib/components/NHDynamicFormShow/customModule/rych/personal/index.js +0 -133
- package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/collective/EditForm.js +0 -575
- package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/collective/index.js +0 -130
- package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/personal/EditForm.js +0 -563
- package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/personal/index.js +0 -133
- package/lib/components/NHDynamicFormShow/customModule/whcz/qjgl/EditForm.js +0 -745
- package/lib/components/NHDynamicFormShow/customModule/whcz/qjgl/index.js +0 -164
- package/lib/components/NHDynamicFormShow/customModule/whcz/rccrxy/EditForm.js +0 -587
- package/lib/components/NHDynamicFormShow/customModule/whcz/rccrxy/index.js +0 -143
- package/lib/components/NHDynamicFormShow/customModule/whdlqjgl/EditForm.js +0 -743
- package/lib/components/NHDynamicFormShow/customModule/whdlqjgl/index.js +0 -172
- package/lib/components/NHDynamicFormShow/customModule/whgc/jjrlx/EditForm.js +0 -1410
- package/lib/components/NHDynamicFormShow/customModule/whgc/jjrlx/index.js +0 -274
- package/lib/components/NHDynamicFormShow/customModule/whgc/jxj/EditForm.js +0 -755
- package/lib/components/NHDynamicFormShow/customModule/whgc/jxj/index.js +0 -130
- package/lib/components/NHDynamicFormShow/customModule/whgc/qjgl/EditForm.js +0 -814
- package/lib/components/NHDynamicFormShow/customModule/whgc/qjgl/index.js +0 -188
- package/lib/components/NHDynamicFormShow/customModule/whgc/zxj/EditForm.js +0 -769
- package/lib/components/NHDynamicFormShow/customModule/whgc/zxj/index.js +0 -130
- package/lib/components/NHDynamicFormShow/customModule/whgcrych/EditForm.js +0 -1004
- package/lib/components/NHDynamicFormShow/customModule/whgcrych/index.js +0 -126
- package/lib/components/NHDynamicFormShow/customModule/whtl/jsrzsq/EditForm.js +0 -503
- package/lib/components/NHDynamicFormShow/customModule/whtl/jsrzsq/index.js +0 -149
- package/lib/components/NHDynamicFormShow/customModule/whtlyhk/EditForm.js +0 -379
- package/lib/components/NHDynamicFormShow/customModule/whtlyhk/index.js +0 -148
- package/lib/components/NHDynamicFormShow/customModule/whtlzxj/EditForm.js +0 -748
- package/lib/components/NHDynamicFormShow/customModule/whtlzxj/index.js +0 -135
- package/lib/components/NHDynamicFormShow/customModule/whtlzy/jxj/EditForm.js +0 -762
- package/lib/components/NHDynamicFormShow/customModule/whtlzy/jxj/index.js +0 -134
- package/lib/components/NHDynamicFormShow/customModule/wjcf/cfjc/cfjcEditForm.js +0 -682
- package/lib/components/NHDynamicFormShow/customModule/wjcf/cfjc/index.js +0 -135
- package/lib/components/NHDynamicFormShow/customModule/wjcf/wjsb/index.js +0 -152
- package/lib/components/NHDynamicFormShow/customModule/wjcf/wjsb/wjsbEditForm.js +0 -783
- package/lib/components/NHDynamicFormShow/customModule/zxj/EditForm.js +0 -764
- package/lib/components/NHDynamicFormShow/customModule/zxj/index.js +0 -138
- package/lib/components/NHDynamicFormShow/customModule/zzsd/cfjcsq/cfjcEditForm.js +0 -677
- package/lib/components/NHDynamicFormShow/customModule/zzsd/cfjcsq/index.js +0 -138
- package/lib/components/NHDynamicFormShow/customModule/zzsd/qjgl/EditForm.js +0 -1173
- package/lib/components/NHDynamicFormShow/customModule/zzsd/qjgl/index.js +0 -242
- package/lib/components/NHDynamicFormShow/customModule/zzsd/rcgl/rcxwgrdj/IndividualRegistForm.js +0 -862
- package/lib/components/NHDynamicFormShow/customModule/zzsd/rcgl/rcxwgrdj/IndividualRegistIndex.js +0 -201
- package/lib/components/NHDynamicFormShow/customModule/zzsd/stuinfo/messageInfo.js +0 -196
- package/lib/components/NHDynamicFormShow/customModule/zzsd/wjsb/index.js +0 -167
- package/lib/components/NHDynamicFormShow/customModule/zzsd/wjsb/wjsbEditForm.js +0 -1096
- package/lib/components/NHDynamicFormShow/index.js +0 -647
- package/lib/components/NHDynamicFormShow/oneOnMany/cardForm/cardItem/index.js +0 -279
- package/lib/components/NHDynamicFormShow/oneOnMany/cardForm/index.js +0 -206
- package/lib/components/NHDynamicFormShow/oneOnMany/index.js +0 -419
- package/lib/components/NHDynamicFormShow/oneOnOne/EditForm.js +0 -401
- package/lib/components/NHDynamicFormShow/oneOnOne/index.js +0 -271
- package/lib/components/NHImagePicker/index.js +0 -554
- package/lib/components/NHInputPicker/RadioGroup.js +0 -118
- package/lib/components/NHInputPicker/index.js +0 -62
- package/lib/components/NHInputPicker/input-const.js +0 -55
- package/lib/components/NHInputPicker/render.js +0 -1271
- package/lib/components/NHListView/index.js +0 -374
- package/lib/components/NHMapGeolocation/index.js +0 -537
- package/lib/components/NHMapGeolocation/initMap/initGdMap.js +0 -104
- package/lib/components/NHMapGeolocation/initMap/initTencentMap.js +0 -138
- package/lib/components/NHMapGeolocation/style.js +0 -51
- package/lib/components/NHMultiSelect/index.js +0 -272
- package/lib/components/NHRadioGroup/index.js +0 -118
- package/lib/components/NHSelect/index.js +0 -364
- package/lib/components/NHTreeMenu/index.js +0 -126
- package/lib/components/NHTreeMenu/treeNode.js +0 -164
- package/lib/components/StuSelector/index.js +0 -611
- package/lib/layouts/KyInputPicker/edit-page.js +0 -585
- package/lib/layouts/KyInputPicker/index.js +0 -220
- package/lib/layouts/KyInputPicker/input-const.js +0 -134
- package/lib/layouts/KyInputPicker/render.js +0 -2477
- package/lib/layouts/KyInputPicker/setting-checkbox.js +0 -850
- package/lib/layouts/KyInputPicker/setting-datepicker.js +0 -430
- package/lib/layouts/KyInputPicker/setting-datetimepicker.js +0 -443
- package/lib/layouts/KyInputPicker/setting-input.js +0 -555
- package/lib/layouts/KyInputPicker/setting-inputNumber.js +0 -612
- package/lib/layouts/KyInputPicker/setting-monthpicker.js +0 -434
- package/lib/layouts/KyInputPicker/setting-multiSelect.js +0 -532
- package/lib/layouts/KyInputPicker/setting-nhcascader.js +0 -584
- package/lib/layouts/KyInputPicker/setting-old-upload.js +0 -428
- package/lib/layouts/KyInputPicker/setting-radio.js +0 -468
- package/lib/layouts/KyInputPicker/setting-rangepicker.js +0 -466
- package/lib/layouts/KyInputPicker/setting-select.js +0 -534
- package/lib/layouts/KyInputPicker/setting-stu-selector.js +0 -507
- package/lib/layouts/KyInputPicker/setting-switch.js +0 -274
- package/lib/layouts/KyInputPicker/setting-tea-selector.js +0 -507
- package/lib/layouts/KyInputPicker/setting-textarea.js +0 -619
- package/lib/layouts/KyInputPicker/setting-timepicker.js +0 -437
- package/lib/layouts/KyInputPicker/setting-upload.js +0 -766
- package/lib/layouts/KyModal/buildTitle.js +0 -81
- package/lib/layouts/KyModal/dragM.js +0 -127
- package/lib/layouts/KyModal/index.js +0 -321
- package/lib/layouts/KyPreview/index.js +0 -219
- package/lib/layouts/KyUpload/index.js +0 -1155
- package/lib/utils/browserJudge.js +0 -33
- package/lib/utils/dynamicLoadCss.js +0 -14
- package/lib/utils/dynamicLoadJs.js +0 -21
- package/lib/utils/getStyle.js +0 -26
- package/lib/utils/getSuitHeight.js +0 -49
- package/lib/utils/hasAuth.js +0 -11
- package/lib/utils/loadJS.js +0 -40
- /package/lib/layouts/{login → Login}/index-pre.js +0 -0
- /package/lib/layouts/{login → Login}/index.js +0 -0
- /package/lib/layouts/{login → Login}/login.js +0 -0
- /package/lib/layouts/{login → Login}/lyPassword.js +0 -0
|
@@ -1,274 +0,0 @@
|
|
|
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;
|