easy3wui 1.5.47-beta3 → 1.5.47-beta5

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.
@@ -6,6 +6,10 @@ var _message2 = require('antd/lib/message');
6
6
 
7
7
  var _message3 = _interopRequireDefault(_message2);
8
8
 
9
+ var _modal = require('antd/lib/modal');
10
+
11
+ var _modal2 = _interopRequireDefault(_modal);
12
+
9
13
  var _extends2 = require('babel-runtime/helpers/extends');
10
14
 
11
15
  var _extends3 = _interopRequireDefault(_extends2);
@@ -28,6 +32,8 @@ var _inherits3 = _interopRequireDefault(_inherits2);
28
32
 
29
33
  require('antd/lib/message/style');
30
34
 
35
+ require('antd/lib/modal/style');
36
+
31
37
  require('antd/lib/notification/style');
32
38
 
33
39
  var _react = require('react');
@@ -332,7 +338,9 @@ var Easy3wFormPage = function (_Component) {
332
338
  var fieldType = item.fieldType,
333
339
  cmptPros = item.cmptPros,
334
340
  disableFlag = item.disableFlag,
335
- readFlag = item.readFlag;
341
+ readFlag = item.readFlag,
342
+ dataDesensitizationFlagTrue = item.dataDesensitizationFlagTrue,
343
+ fieldId = item.fieldId;
336
344
 
337
345
  var itemNew = item;
338
346
  var newCmptPros = {};
@@ -445,6 +453,9 @@ var Easy3wFormPage = function (_Component) {
445
453
  value = _this.getcheckDesensitizeData(value, item);
446
454
  }
447
455
  return value;
456
+ // } else if (disableFlag && dataDesensitizationFlag) { // 只读字段会进行数据校验及脱敏
457
+ // value = this.getcheckDesensitizeData(value, item);
458
+ // return value;
448
459
  }
449
460
  if (fieldType === 'datePicker') {
450
461
  /** 格式化日期型数据 */
@@ -515,10 +526,40 @@ var Easy3wFormPage = function (_Component) {
515
526
  }
516
527
  };
517
528
 
518
- _this.touchImplicit = function (fieldId) {
519
- var _this$setState;
529
+ _this.getImplicit = function (fieldId) {
530
+ if (_comonConfig.dataDesensitizationUrl) {
531
+ var xhr = new XMLHttpRequest();
532
+ xhr.onreadystatechange = function () {
533
+ if (xhr.readyState === 4 && xhr.status === 200) {
534
+ // 请求成功,处理响应数据
535
+ var _JSON$parse = JSON.parse(xhr.responseText),
536
+ _data = _JSON$parse.data;
537
+
538
+ var _ref = _data || {},
539
+ passFlag = _ref.passFlag,
540
+ passMsg = _ref.passMsg;
541
+
542
+ if (passFlag) {
543
+ var _this$setState;
544
+
545
+ _this.setState((_this$setState = {}, _this$setState[fieldId + 'dataDesensitizationEyeFlag'] = !_this.state[fieldId + 'dataDesensitizationEyeFlag'], _this$setState));
546
+ } else {
547
+ _modal2['default'].error({
548
+ content: passMsg || '用户无权限,请联系管理员',
549
+ okText: '确定'
550
+ });
551
+ }
552
+ }
553
+ };
554
+ var data = JSON.stringify({});
555
+ xhr.open('POST', _comonConfig.dataDesensitizationUrl, true); // 异步请求
556
+ xhr.setRequestHeader('Content-Type', 'application/json'); // 设置请求头
557
+ xhr.send(data); // 发送请求
558
+ } else {
559
+ var _this$setState2;
520
560
 
521
- _this.setState((_this$setState = {}, _this$setState[fieldId + 'dataDesensitizationEyeFlag'] = !_this.state[fieldId + 'dataDesensitizationEyeFlag'], _this$setState));
561
+ _this.setState((_this$setState2 = {}, _this$setState2[fieldId + 'dataDesensitizationEyeFlag'] = !_this.state[fieldId + 'dataDesensitizationEyeFlag'], _this$setState2));
562
+ }
522
563
  };
523
564
 
524
565
  _this.getAfterBtn = function (item) {
@@ -805,7 +846,7 @@ var Easy3wFormPage = function (_Component) {
805
846
  _react2['default'].createElement(
806
847
  'a',
807
848
  { onClick: function onClick() {
808
- return _this.touchImplicit(fieldId);
849
+ return _this.getImplicit(fieldId);
809
850
  } },
810
851
  _react2['default'].createElement(_icon2['default'], { type: _this.state[fieldId + 'dataDesensitizationEyeFlag'] ? 'eye' : 'eye-invisible' })
811
852
  )
@@ -912,6 +953,8 @@ var Easy3wFormPage = function (_Component) {
912
953
  fieldType = item.fieldType;
913
954
 
914
955
  var itemValue = _this.getItemValue(item);
956
+ var dataDesensitizationFlagTrue = item.dataDesensitizationFlagTrue,
957
+ value = item.value;
915
958
  var colSpan = cmptPros.colSpan;
916
959
 
917
960
  var addRules = [];
@@ -944,7 +987,19 @@ var Easy3wFormPage = function (_Component) {
944
987
  initialValue: 'easy3wView',
945
988
  rules: [{ required: required, message: requiredMessage || '\u8BF7\u586B\u5199' + label }]
946
989
  })(_react2['default'].createElement(_input2['default'], { type: 'hidden' })),
947
- itemValue
990
+ dataDesensitizationFlagTrue ? _react2['default'].createElement(
991
+ 'span',
992
+ null,
993
+ _this.state[fieldId + 'dataDesensitizationEyeFlag'] ? value : itemValue,
994
+ ' ',
995
+ _react2['default'].createElement(
996
+ 'a',
997
+ { onClick: function onClick() {
998
+ return _this.getImplicit(fieldId);
999
+ } },
1000
+ _react2['default'].createElement(_icon2['default'], { type: _this.state[fieldId + 'dataDesensitizationEyeFlag'] ? 'eye' : 'eye-invisible' })
1001
+ )
1002
+ ) : itemValue
948
1003
  )
949
1004
  );
950
1005
  }
@@ -1030,18 +1085,18 @@ var Easy3wFormPage = function (_Component) {
1030
1085
 
1031
1086
  var threeRowItemFlag = false;
1032
1087
  for (var _iterator = rowItems, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
1033
- var _ref;
1088
+ var _ref2;
1034
1089
 
1035
1090
  if (_isArray) {
1036
1091
  if (_i >= _iterator.length) break;
1037
- _ref = _iterator[_i++];
1092
+ _ref2 = _iterator[_i++];
1038
1093
  } else {
1039
1094
  _i = _iterator.next();
1040
1095
  if (_i.done) break;
1041
- _ref = _i.value;
1096
+ _ref2 = _i.value;
1042
1097
  }
1043
1098
 
1044
- var rItem = _ref;
1099
+ var rItem = _ref2;
1045
1100
 
1046
1101
  if (rItem.cols.length === 3) {
1047
1102
  threeRowItemFlag = true;
@@ -1185,8 +1240,8 @@ var Easy3wFormPage = function (_Component) {
1185
1240
  _this.getColItem = function (colObj, formItemLayout) {
1186
1241
  var fieldType = colObj.fieldType;
1187
1242
 
1188
- var itemArea = _this.getItemArea(colObj);
1189
1243
  var itemValue = _this.getItemValue(colObj);
1244
+ var itemArea = _this.getItemArea(colObj);
1190
1245
  var afterBtns = _this.getAfterBtn(colObj);
1191
1246
  if (fieldType === 'upload') {
1192
1247
  var up = _this.getUploadColItem(colObj, formItemLayout);
@@ -1954,12 +2009,12 @@ var Easy3wFormPage = function (_Component) {
1954
2009
 
1955
2010
  /** 获取value */
1956
2011
 
1957
- // ------------------------------------------------ 数据脱敏 start -----------------------------------------------
2012
+ /** 数据脱敏 start */
1958
2013
  // 数据校验与脱敏
1959
2014
 
1960
2015
  // 数据脱敏--显隐
1961
2016
 
1962
- // ------------------------------------------------ 数据脱敏 end -----------------------------------------------
2017
+ /** 数据脱敏 end */
1963
2018
 
1964
2019
  // 判断fieldType -- 解析字段类型
1965
2020
 
@@ -62,6 +62,12 @@ var _icon2 = _interopRequireDefault(_icon);
62
62
 
63
63
  require('antd/lib/icon/style');
64
64
 
65
+ var _modal = require('antd/lib/modal');
66
+
67
+ var _modal2 = _interopRequireDefault(_modal);
68
+
69
+ require('antd/lib/modal/style');
70
+
65
71
  var _numeral = require('numeral');
66
72
 
67
73
  var _numeral2 = _interopRequireDefault(_numeral);
@@ -194,7 +200,7 @@ var Easy3wGridPage = function (_Component) {
194
200
  _react2['default'].createElement(
195
201
  'a',
196
202
  { onClick: function onClick() {
197
- return _this2.touchImplicit(dataIndex, id, index);
203
+ return _this2.getImplicit(dataIndex, id, index);
198
204
  } },
199
205
  _react2['default'].createElement(_icon2['default'], { type: _this2.state[dataIndex + '-' + id + '-' + index + '-dataDesensitizationEyeFlag'] ? 'eye' : 'eye-invisible' })
200
206
  )
@@ -207,7 +213,7 @@ var Easy3wGridPage = function (_Component) {
207
213
  _react2['default'].createElement(
208
214
  'a',
209
215
  { onClick: function onClick() {
210
- return _this2.touchImplicit(dataIndex, id, index);
216
+ return _this2.getImplicit(dataIndex, id, index);
211
217
  } },
212
218
  _react2['default'].createElement(_icon2['default'], { type: _this2.state[dataIndex + '-' + id + '-' + index + '-dataDesensitizationEyeFlag'] ? 'eye' : 'eye-invisible' })
213
219
  )
@@ -222,7 +228,7 @@ var Easy3wGridPage = function (_Component) {
222
228
  _react2['default'].createElement(
223
229
  'a',
224
230
  { onClick: function onClick() {
225
- return _this2.touchImplicit(dataIndex, id, index);
231
+ return _this2.getImplicit(dataIndex, id, index);
226
232
  } },
227
233
  _react2['default'].createElement(_icon2['default'], { type: _this2.state[dataIndex + '-' + id + '-' + index + '-dataDesensitizationEyeFlag'] ? 'eye' : 'eye-invisible' })
228
234
  )
@@ -724,10 +730,40 @@ var _initialiseProps = function _initialiseProps() {
724
730
  }
725
731
  };
726
732
 
727
- this.touchImplicit = function (dataIndex, id, index) {
728
- var _this3$setState;
733
+ this.getImplicit = function (dataIndex, id, index) {
734
+ if (_comonConfig.dataDesensitizationUrl) {
735
+ var xhr = new XMLHttpRequest();
736
+ xhr.onreadystatechange = function () {
737
+ if (xhr.readyState === 4 && xhr.status === 200) {
738
+ // 请求成功,处理响应数据
739
+ var _JSON$parse = JSON.parse(xhr.responseText),
740
+ _data = _JSON$parse.data;
741
+
742
+ var _ref = _data || {},
743
+ passFlag = _ref.passFlag,
744
+ passMsg = _ref.passMsg;
745
+
746
+ if (passFlag) {
747
+ var _this3$setState;
748
+
749
+ _this3.setState((_this3$setState = {}, _this3$setState[dataIndex + '-' + id + '-' + index + '-dataDesensitizationEyeFlag'] = !_this3.state[dataIndex + '-' + id + '-' + index + '-dataDesensitizationEyeFlag'], _this3$setState));
750
+ } else {
751
+ _modal2['default'].error({
752
+ content: passMsg || '用户无权限,请联系管理员',
753
+ okText: '确定'
754
+ });
755
+ }
756
+ }
757
+ };
758
+ var data = JSON.stringify({});
759
+ xhr.open('POST', _comonConfig.dataDesensitizationUrl, true); // 异步请求
760
+ xhr.setRequestHeader('Content-Type', 'application/json'); // 设置请求头
761
+ xhr.send(data); // 发送请求
762
+ } else {
763
+ var _this3$setState2;
729
764
 
730
- _this3.setState((_this3$setState = {}, _this3$setState[dataIndex + '-' + id + '-' + index + '-dataDesensitizationEyeFlag'] = !_this3.state[dataIndex + '-' + id + '-' + index + '-dataDesensitizationEyeFlag'], _this3$setState));
765
+ _this3.setState((_this3$setState2 = {}, _this3$setState2[dataIndex + '-' + id + '-' + index + '-dataDesensitizationEyeFlag'] = !_this3.state[dataIndex + '-' + id + '-' + index + '-dataDesensitizationEyeFlag'], _this3$setState2));
766
+ }
731
767
  };
732
768
  };
733
769
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy3wui",
3
- "version": "1.5.47-beta3",
3
+ "version": "1.5.47-beta5",
4
4
  "description": "easy3wui components for react",
5
5
  "keywords": [
6
6
  "react",