easy3wui 1.5.8-2.beta → 1.5.8-5.beta

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 CHANGED
@@ -13,6 +13,13 @@ https://www.npmjs.com/
13
13
  // 官方镜像源
14
14
  npm config set registry https://registry.npmjs.org/
15
15
  // 淘宝镜像源
16
- npm config set registry https://registry.npmmirror.com/
16
+ npm config set registry http://registry.npm.taobao.org/
17
17
  检查当前npm源:
18
18
  npm config get registry
19
+
20
+ # 生成令牌‌‌操作步骤‌:
21
+ * 登录 npm 官网,进入令牌管理页面(https://www.npmjs.com/settings/(您的用户名)/tokens)。
22
+ * ‌删除旧令牌‌:点击令牌右侧的“Delete”(删除)按钮。
23
+ * ‌创建新令牌‌:点击“Generate New Token”(生成新令牌),输入名称并勾选“Bypass two-factor authentication”(绕过 2FA)。
24
+ * ‌立即复制新令牌‌:创建后立即点击复制按钮,‌避免离开页面‌。
25
+ * 配置令牌到 .npmrc 文件,在项目根目录下
@@ -51,8 +51,12 @@ var Easy3wA = function (_Component) {
51
51
  }
52
52
 
53
53
  return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onClickFunc = function (e, func) {
54
- var globalLoading = _this.props.loading.global;
55
- if (globalLoading) {
54
+ var _this$props$loading = _this.props.loading,
55
+ global = _this$props$loading.global,
56
+ globalFetch = _this$props$loading.globalFetch,
57
+ globalBlack = _this$props$loading.globalBlack;
58
+
59
+ if (global || globalFetch || globalBlack) {
56
60
  _notification2['default'].warning({
57
61
  message: '温馨提示',
58
62
  description: '正在后台处理,请稍后!',
@@ -91,8 +91,12 @@ var Easy3wButton = function (_Component) {
91
91
  }
92
92
 
93
93
  return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onClickFunc = function (e, func) {
94
- var globalLoading = _this.props.loading.global;
95
- if (globalLoading) {
94
+ var _this$props$loading = _this.props.loading,
95
+ global = _this$props$loading.global,
96
+ globalFetch = _this$props$loading.globalFetch,
97
+ globalBlack = _this$props$loading.globalBlack;
98
+
99
+ if (global || globalFetch || globalBlack) {
96
100
  _notification2['default'].warning({
97
101
  message: '温馨提示',
98
102
  description: '正在后台处理,请稍后!',
@@ -71,8 +71,12 @@ var Easy3wButtonOne = function (_Component) {
71
71
  }
72
72
 
73
73
  return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onClickFunc = function (e, func) {
74
- var globalLoading = _this.props.loadingFlag.global;
75
- if (globalLoading) {
74
+ var _this$props$loadingFl = _this.props.loadingFlag,
75
+ global = _this$props$loadingFl.global,
76
+ globalFetch = _this$props$loadingFl.globalFetch,
77
+ globalBlack = _this$props$loadingFl.globalBlack;
78
+
79
+ if (global || globalFetch || globalBlack) {
76
80
  _notification3['default'].warning({
77
81
  message: '温馨提示',
78
82
  description: '正在后台处理,请稍后!',
@@ -2,6 +2,10 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
 
5
+ var _extends2 = require('babel-runtime/helpers/extends');
6
+
7
+ var _extends3 = _interopRequireDefault(_extends2);
8
+
5
9
  var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
6
10
 
7
11
  var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
@@ -24,6 +28,12 @@ var _card2 = _interopRequireDefault(_card);
24
28
 
25
29
  require('antd/lib/card/style');
26
30
 
31
+ var _alert = require('antd/lib/alert');
32
+
33
+ var _alert2 = _interopRequireDefault(_alert);
34
+
35
+ require('antd/lib/alert/style');
36
+
27
37
  var _classnames = require('classnames');
28
38
 
29
39
  var _classnames2 = _interopRequireDefault(_classnames);
@@ -42,20 +52,139 @@ var Easy3wCardM = function (_Component) {
42
52
  (0, _inherits3['default'])(Easy3wCardM, _Component);
43
53
 
44
54
  function Easy3wCardM() {
55
+ var _temp, _this, _ret;
56
+
45
57
  (0, _classCallCheck3['default'])(this, Easy3wCardM);
46
- return (0, _possibleConstructorReturn3['default'])(this, _Component.apply(this, arguments));
47
- }
48
58
 
49
- Easy3wCardM.prototype.render = function render() {
50
- var _props = this.props,
51
- label = _props.label,
52
- children = _props.children,
53
- mobileShowFlag = _props.mobileShowFlag;
54
-
55
- return _react2['default'].createElement(
56
- _react2['default'].Fragment,
57
- null,
58
- mobileShowFlag === false ? '' : _react2['default'].createElement(
59
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
60
+ args[_key] = arguments[_key];
61
+ }
62
+
63
+ return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.touchRender = function () {
64
+ var _this$props = _this.props,
65
+ e3wCardId = _this$props.e3wCardId,
66
+ e3wCardCfg = _this$props.e3wCardCfg,
67
+ mobileShowFlag = _this$props.mobileShowFlag;
68
+
69
+ var objCfg = e3wCardId && e3wCardCfg && e3wCardCfg instanceof Object && e3wCardCfg[e3wCardId] && e3wCardCfg[e3wCardId] instanceof Object ? e3wCardCfg[e3wCardId] : {};
70
+ var cardHelpInfo = objCfg.cardHelpInfo,
71
+ cardDspFlag = objCfg.cardDspFlag,
72
+ cardReqFlag = objCfg.cardReqFlag,
73
+ cardSName = objCfg.cardSName;
74
+ // const labelF = objCfg.cardSName || label;
75
+
76
+ var _this$props2 = _this.props,
77
+ label = _this$props2.label,
78
+ children = _this$props2.children;
79
+ // 创建 children 的可变副本,避免修改只读的 props.children
80
+
81
+ if (children != null) {
82
+ children = _react2['default'].Children.toArray(children);
83
+ // 如果转换后数组为空,设置为 null 以保持原行为
84
+ if (children.length === 0) {
85
+ children = null;
86
+ }
87
+ }
88
+ if (cardHelpInfo) {
89
+ if (children && children instanceof Array) {
90
+ // children 现在是数组
91
+ if (children.length === 1) {
92
+ // 单个元素,检查是否是 Alert
93
+ var _children = children,
94
+ item = _children[0];
95
+ var type = item.type;
96
+
97
+ var _ref3 = type && type instanceof Object ? type : {},
98
+ name = _ref3.name;
99
+
100
+ if (name === 'Alert') {
101
+ children = null;
102
+ }
103
+ } else {
104
+ // 多个元素,查找并移除 Alert
105
+ var foundIndex = children.findIndex(function (item) {
106
+ var type = item.type;
107
+
108
+ var _ref4 = type && type instanceof Object ? type : {},
109
+ name = _ref4.name;
110
+
111
+ return name === 'Alert';
112
+ });
113
+ if (foundIndex !== -1) {
114
+ children.splice(foundIndex, 1);
115
+ // 如果移除后数组为空,设置为 null
116
+ if (children.length === 0) {
117
+ children = null;
118
+ }
119
+ }
120
+ }
121
+ }
122
+ // 注意:children 现在要么是数组,要么是 null
123
+ // 原 else if 分支处理 children 是单个对象的情况,现在已经被数组包装
124
+ }
125
+ var hasReqFlag = false;
126
+ if (label && label instanceof Object) {
127
+ var _label = label,
128
+ props = _label.props;
129
+
130
+ var _ref5 = props || {},
131
+ childrenLabel = _ref5.children;
132
+
133
+ if (childrenLabel && childrenLabel instanceof Array) {
134
+ // 创建 childrenLabel 的可变副本,避免修改只读的 props.children
135
+ var childrenLabelCopy = _react2['default'].Children.toArray(childrenLabel);
136
+ var _foundIndex = childrenLabelCopy.findIndex(function (item) {
137
+ var propsCL = item.props;
138
+
139
+ var _ref6 = propsCL || {},
140
+ childrenLabelC = _ref6.children,
141
+ style = _ref6.style;
142
+
143
+ var _ref7 = style || {},
144
+ color = _ref7.color;
145
+ // const { name } = type && type instanceof Object ? type : {};
146
+
147
+
148
+ return childrenLabelC === '*' && (color === 'red' || color === '#f00');
149
+ });
150
+
151
+ if (_foundIndex !== -1) {
152
+ hasReqFlag = true;
153
+ if (cardReqFlag === '0') {
154
+ // 移除红色星号元素
155
+ childrenLabelCopy.splice(_foundIndex, 1);
156
+ // 创建新的 label 元素,使用修改后的 children
157
+ label = _react2['default'].cloneElement(label, (0, _extends3['default'])({}, props, {
158
+ children: childrenLabelCopy.length === 1 ? childrenLabelCopy[0] : childrenLabelCopy
159
+ }));
160
+ }
161
+ }
162
+ }
163
+ }
164
+ if (cardSName) {
165
+ label = _react2['default'].createElement(
166
+ 'span',
167
+ null,
168
+ cardReqFlag === '1' ? _react2['default'].createElement(
169
+ 'span',
170
+ { style: { color: 'red' } },
171
+ '*'
172
+ ) : '',
173
+ cardSName
174
+ );
175
+ } else if (label && cardReqFlag === '1' && !hasReqFlag) {
176
+ label = _react2['default'].createElement(
177
+ 'span',
178
+ null,
179
+ _react2['default'].createElement(
180
+ 'span',
181
+ { style: { color: 'red' } },
182
+ '*'
183
+ ),
184
+ label
185
+ );
186
+ }
187
+ var content = _react2['default'].createElement(
59
188
  _card2['default'],
60
189
  {
61
190
  title: label ? _react2['default'].createElement(
@@ -68,9 +197,21 @@ var Easy3wCardM = function (_Component) {
68
197
  className: (0, _classnames2['default'])(['e3wCardForm']),
69
198
  size: size || 'default'
70
199
  },
200
+ cardHelpInfo ? _react2['default'].createElement(_alert2['default'], {
201
+ message: cardHelpInfo,
202
+ type: 'success',
203
+ closable: true
204
+ }) : '',
71
205
  children
72
- )
73
- );
206
+ );
207
+ return cardDspFlag === '0' ? null : cardDspFlag === '1' ? content : mobileShowFlag === false ? null : content;
208
+ }, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
209
+ }
210
+ // 根据配置重新渲染 去除原内容: 如帮助及红色*号
211
+
212
+
213
+ Easy3wCardM.prototype.render = function render() {
214
+ return this.touchRender();
74
215
  };
75
216
 
76
217
  return Easy3wCardM;
@@ -2,6 +2,10 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
 
5
+ var _extends2 = require('babel-runtime/helpers/extends');
6
+
7
+ var _extends3 = _interopRequireDefault(_extends2);
8
+
5
9
  var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
6
10
 
7
11
  var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
@@ -24,6 +28,12 @@ var _card2 = _interopRequireDefault(_card);
24
28
 
25
29
  require('antd/lib/card/style');
26
30
 
31
+ var _alert = require('antd/lib/alert');
32
+
33
+ var _alert2 = _interopRequireDefault(_alert);
34
+
35
+ require('antd/lib/alert/style');
36
+
27
37
  var _classnames = require('classnames');
28
38
 
29
39
  var _classnames2 = _interopRequireDefault(_classnames);
@@ -42,30 +52,164 @@ var Easy3wCardPC = function (_Component) {
42
52
  (0, _inherits3['default'])(Easy3wCardPC, _Component);
43
53
 
44
54
  function Easy3wCardPC() {
55
+ var _temp, _this, _ret;
56
+
45
57
  (0, _classCallCheck3['default'])(this, Easy3wCardPC);
46
- return (0, _possibleConstructorReturn3['default'])(this, _Component.apply(this, arguments));
47
- }
48
58
 
49
- Easy3wCardPC.prototype.render = function render() {
50
- var _props = this.props,
51
- label = _props.label,
52
- children = _props.children;
53
-
54
- return _react2['default'].createElement(
55
- _card2['default'],
56
- {
57
- title: label ? _react2['default'].createElement(
59
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
60
+ args[_key] = arguments[_key];
61
+ }
62
+
63
+ return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.touchRender = function () {
64
+ var _this$props = _this.props,
65
+ e3wCardId = _this$props.e3wCardId,
66
+ e3wCardCfg = _this$props.e3wCardCfg;
67
+
68
+ var objCfg = e3wCardId && e3wCardCfg && e3wCardCfg instanceof Object && e3wCardCfg[e3wCardId] && e3wCardCfg[e3wCardId] instanceof Object ? e3wCardCfg[e3wCardId] : {};
69
+ var cardHelpInfo = objCfg.cardHelpInfo,
70
+ cardDspFlag = objCfg.cardDspFlag,
71
+ cardReqFlag = objCfg.cardReqFlag,
72
+ cardSName = objCfg.cardSName;
73
+ // const labelF = objCfg.cardSName || label;
74
+
75
+ var _this$props2 = _this.props,
76
+ label = _this$props2.label,
77
+ children = _this$props2.children;
78
+ // 创建 children 的可变副本,避免修改只读的 props.children
79
+
80
+ if (children != null) {
81
+ children = _react2['default'].Children.toArray(children);
82
+ // 如果转换后数组为空,设置为 null 以保持原行为
83
+ if (children.length === 0) {
84
+ children = null;
85
+ }
86
+ }
87
+ if (cardHelpInfo) {
88
+ if (children && children instanceof Array) {
89
+ // children 现在是数组
90
+ if (children.length === 1) {
91
+ // 单个元素,检查是否是 Alert
92
+ var _children = children,
93
+ item = _children[0];
94
+ var type = item.type;
95
+
96
+ var _ref3 = type && type instanceof Object ? type : {},
97
+ name = _ref3.name;
98
+
99
+ if (name === 'Alert') {
100
+ children = null;
101
+ }
102
+ } else {
103
+ // 多个元素,查找并移除 Alert
104
+ var foundIndex = children.findIndex(function (item) {
105
+ var type = item.type;
106
+
107
+ var _ref4 = type && type instanceof Object ? type : {},
108
+ name = _ref4.name;
109
+
110
+ return name === 'Alert';
111
+ });
112
+ if (foundIndex !== -1) {
113
+ children.splice(foundIndex, 1);
114
+ // 如果移除后数组为空,设置为 null
115
+ if (children.length === 0) {
116
+ children = null;
117
+ }
118
+ }
119
+ }
120
+ }
121
+ // 注意:children 现在要么是数组,要么是 null
122
+ // 原 else if 分支处理 children 是单个对象的情况,现在已经被数组包装
123
+ }
124
+ var hasReqFlag = false;
125
+ if (label && label instanceof Object) {
126
+ var _label = label,
127
+ props = _label.props;
128
+
129
+ var _ref5 = props || {},
130
+ childrenLabel = _ref5.children;
131
+
132
+ if (childrenLabel && childrenLabel instanceof Array) {
133
+ // 创建 childrenLabel 的可变副本,避免修改只读的 props.children
134
+ var childrenLabelCopy = _react2['default'].Children.toArray(childrenLabel);
135
+ var _foundIndex = childrenLabelCopy.findIndex(function (item) {
136
+ var propsCL = item.props;
137
+
138
+ var _ref6 = propsCL || {},
139
+ childrenLabelC = _ref6.children,
140
+ style = _ref6.style;
141
+
142
+ var _ref7 = style || {},
143
+ color = _ref7.color;
144
+ // const { name } = type && type instanceof Object ? type : {};
145
+
146
+
147
+ return childrenLabelC === '*' && (color === 'red' || color === '#f00');
148
+ });
149
+
150
+ if (_foundIndex !== -1) {
151
+ hasReqFlag = true;
152
+ if (cardReqFlag === '0') {
153
+ // 移除红色星号元素
154
+ childrenLabelCopy.splice(_foundIndex, 1);
155
+ // 创建新的 label 元素,使用修改后的 children
156
+ label = _react2['default'].cloneElement(label, (0, _extends3['default'])({}, props, {
157
+ children: childrenLabelCopy.length === 1 ? childrenLabelCopy[0] : childrenLabelCopy
158
+ }));
159
+ }
160
+ }
161
+ }
162
+ }
163
+ if (cardSName) {
164
+ label = _react2['default'].createElement(
165
+ 'span',
166
+ null,
167
+ cardReqFlag === '1' ? _react2['default'].createElement(
168
+ 'span',
169
+ { style: { color: 'red' } },
170
+ '*'
171
+ ) : '',
172
+ cardSName
173
+ );
174
+ } else if (label && cardReqFlag === '1' && !hasReqFlag) {
175
+ label = _react2['default'].createElement(
58
176
  'span',
59
- { className: (0, _classnames2['default'])(['e3wCardSpanCardTitle']) },
60
- _react2['default'].createElement('s', null),
177
+ null,
178
+ _react2['default'].createElement(
179
+ 'span',
180
+ { style: { color: 'red' } },
181
+ '*'
182
+ ),
61
183
  label
62
- ) : '',
63
- bordered: false,
64
- className: (0, _classnames2['default'])(['e3wCardForm']),
65
- size: size || 'default'
66
- },
67
- children
68
- );
184
+ );
185
+ }
186
+ return cardDspFlag === '0' ? null : _react2['default'].createElement(
187
+ _card2['default'],
188
+ {
189
+ title: label ? _react2['default'].createElement(
190
+ 'span',
191
+ { className: (0, _classnames2['default'])(['e3wCardSpanCardTitle']) },
192
+ _react2['default'].createElement('s', null),
193
+ label
194
+ ) : '',
195
+ bordered: false,
196
+ className: (0, _classnames2['default'])(['e3wCardForm']),
197
+ size: size || 'default'
198
+ },
199
+ cardHelpInfo ? _react2['default'].createElement(_alert2['default'], {
200
+ message: cardHelpInfo,
201
+ type: 'success',
202
+ closable: true
203
+ }) : '',
204
+ children
205
+ );
206
+ }, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
207
+ }
208
+ // 根据配置重新渲染 去除原内容: 如帮助及红色*号
209
+
210
+
211
+ Easy3wCardPC.prototype.render = function render() {
212
+ return this.touchRender();
69
213
  };
70
214
 
71
215
  return Easy3wCardPC;