@titaui/pc 1.9.0 → 1.9.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/lib/components/create-okr-modal/index.js +4 -1
- package/lib/components/dialog/index.css +0 -2
- package/lib/components/dialog/index.js +2 -1
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.js +3 -1
- package/lib/components/form/form-fields/input-verification-code/index.js +64 -27
- package/lib/components/form/form-fields/password/index.css +1 -1
- package/lib/components/form/form-fields/password/index.js +23 -10
- package/lib/components/menus/components/flip-menu-card/dark.svg +15 -0
- package/lib/components/menus/components/flip-menu-card/index.css +21 -0
- package/lib/components/menus/components/flip-menu-card/index.js +45 -15
- package/lib/components/menus/components/flip-menu-card/light.svg +15 -0
- package/lib/components/menus/export-modules/appraisal-menus/index.css +1 -1
- package/lib/pages/personal-info/components/base-info/index.css +1 -0
- package/lib/pages/personal-info/components/edit-base-info/index.js +19 -9
- package/package.json +1 -1
- package/src/components/create-okr-modal/index.tsx +1 -0
- package/src/components/dialog/index.js +1 -1
- package/src/components/dialog/index.scss +0 -2
- package/src/components/dynamic/dynamic-item/dynamic-announcement/index.tsx +2 -1
- package/src/components/form/form-fields/input-verification-code/index.tsx +9 -10
- package/src/components/form/form-fields/password/index.scss +1 -1
- package/src/components/form/form-fields/password/index.tsx +14 -4
- package/src/components/menus/components/flip-menu-card/dark.svg +15 -0
- package/src/components/menus/components/flip-menu-card/index.scss +19 -0
- package/src/components/menus/components/flip-menu-card/index.tsx +173 -125
- package/src/components/menus/components/flip-menu-card/light.svg +15 -0
- package/src/components/menus/export-modules/appraisal-menus/index.scss +1 -1
- package/src/pages/personal-info/components/base-info/index.scss +1 -0
- package/src/pages/personal-info/components/edit-base-info/index.tsx +17 -15
|
@@ -824,7 +824,10 @@ function CreateOkrModal(_ref, ref) {
|
|
|
824
824
|
onCancel: hideCreateOkrModal,
|
|
825
825
|
maskClosable: false,
|
|
826
826
|
footerLeftContent: renderFooterTeachWriteOKr,
|
|
827
|
-
zIndex: 1200
|
|
827
|
+
zIndex: 1200,
|
|
828
|
+
bodyStyle: {
|
|
829
|
+
flexBasis: '0%'
|
|
830
|
+
}
|
|
828
831
|
}, /*#__PURE__*/_react["default"].createElement(_style.Wrapper, {
|
|
829
832
|
ref: wrapperRef
|
|
830
833
|
}, /*#__PURE__*/_react["default"].createElement(_oNewName["default"], {
|
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
|
|
52
52
|
.titaui-dialog .rc-dialog-header {
|
|
53
53
|
padding: 18px 32px;
|
|
54
|
-
margin-bottom: 10px;
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
.titaui-dialog .rc-dialog-body {
|
|
@@ -60,7 +59,6 @@
|
|
|
60
59
|
|
|
61
60
|
.titaui-dialog .rc-dialog-footer {
|
|
62
61
|
padding: 20px 32px;
|
|
63
|
-
margin-top: 8px;
|
|
64
62
|
display: flex;
|
|
65
63
|
justify-content: flex-end;
|
|
66
64
|
}
|
|
@@ -67,7 +67,8 @@ var _default = function _default(props) {
|
|
|
67
67
|
_props$extraClass = props.extraClass,
|
|
68
68
|
extraClass = _props$extraClass === void 0 ? [] : _props$extraClass,
|
|
69
69
|
extendFooterBtn = props.extendFooterBtn,
|
|
70
|
-
disabled = props.disabled,
|
|
70
|
+
_props$disabled = props.disabled,
|
|
71
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
71
72
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
72
73
|
|
|
73
74
|
var baseFooter = [extendFooterBtn, /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -27,6 +27,8 @@ var _util = require("../../util");
|
|
|
27
27
|
|
|
28
28
|
var _dangerousHtml = _interopRequireDefault(require("../../components/dangerous-html"));
|
|
29
29
|
|
|
30
|
+
var _getLocale = require("../../../../utils/getLocale");
|
|
31
|
+
|
|
30
32
|
require("./index.css");
|
|
31
33
|
|
|
32
34
|
var _excluded = ["data", "hasDynamicOpereateAuth"];
|
|
@@ -63,7 +65,7 @@ var DynamicAnnouncement = function DynamicAnnouncement(_ref) {
|
|
|
63
65
|
var renderDesc = (0, _react.useMemo)(function () {
|
|
64
66
|
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
65
67
|
className: prefix + "__operate-desc"
|
|
66
|
-
},
|
|
68
|
+
}, (0, _getLocale.getLocale)('Feed_SsAnnounce')), /*#__PURE__*/_react["default"].createElement("span", {
|
|
67
69
|
className: prefix + "-desc-operate-type",
|
|
68
70
|
style: {
|
|
69
71
|
background: feedTypeColor
|
|
@@ -23,6 +23,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
23
23
|
|
|
24
24
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
25
|
|
|
26
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
27
|
+
|
|
28
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
29
|
+
|
|
26
30
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
31
|
|
|
28
32
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -96,20 +100,26 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
96
100
|
btnCanClick = _useState8[0],
|
|
97
101
|
setBtnCanClick = _useState8[1];
|
|
98
102
|
|
|
99
|
-
var _useState9 = (0, _react.useState)(
|
|
103
|
+
var _useState9 = (0, _react.useState)(false),
|
|
100
104
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
isTime = _useState10[0],
|
|
106
|
+
setIsTime = _useState10[1];
|
|
103
107
|
|
|
104
|
-
var _useState11 = (0, _react.useState)(
|
|
108
|
+
var _useState11 = (0, _react.useState)(""),
|
|
105
109
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
tip = _useState12[0],
|
|
111
|
+
setTip = _useState12[1];
|
|
112
|
+
|
|
113
|
+
var _useState13 = (0, _react.useState)(props.value || ""),
|
|
114
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
115
|
+
value = _useState14[0],
|
|
116
|
+
setValue = _useState14[1];
|
|
108
117
|
|
|
109
118
|
(0, _react.useEffect)(function () {
|
|
110
119
|
setValue(props.value);
|
|
111
120
|
}, [props.value]);
|
|
112
121
|
(0, _react.useEffect)(function () {
|
|
122
|
+
if (isTime) return;
|
|
113
123
|
setBtnCanClick(canClickCode);
|
|
114
124
|
}, [canClickCode]);
|
|
115
125
|
|
|
@@ -160,28 +170,55 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
160
170
|
}
|
|
161
171
|
};
|
|
162
172
|
|
|
163
|
-
var HandlerCode = function
|
|
164
|
-
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
|
|
173
|
+
var HandlerCode = /*#__PURE__*/function () {
|
|
174
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
175
|
+
var isSuccess, time, timer;
|
|
176
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
177
|
+
while (1) {
|
|
178
|
+
switch (_context.prev = _context.next) {
|
|
179
|
+
case 0:
|
|
180
|
+
if (btnCanClick) {
|
|
181
|
+
_context.next = 2;
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return _context.abrupt("return");
|
|
186
|
+
|
|
187
|
+
case 2:
|
|
188
|
+
setBtnCanClick(false);
|
|
189
|
+
_context.next = 5;
|
|
190
|
+
return btnClick();
|
|
191
|
+
|
|
192
|
+
case 5:
|
|
193
|
+
isSuccess = _context.sent;
|
|
194
|
+
time = isSuccess ? 60 : 3;
|
|
195
|
+
setBtn_info("".concat(time, "s\u91CD\u65B0\u53D1\u9001"));
|
|
196
|
+
timer = setInterval(function () {
|
|
197
|
+
setIsTime(true);
|
|
198
|
+
|
|
199
|
+
if (time === 0) {
|
|
200
|
+
clearInterval(timer);
|
|
201
|
+
setBtn_info("获取验证码");
|
|
202
|
+
setBtnCanClick(true);
|
|
203
|
+
setIsTime(false);
|
|
204
|
+
} else {
|
|
205
|
+
setBtn_info("".concat(time, "s\u91CD\u65B0\u53D1\u9001"));
|
|
206
|
+
time--;
|
|
207
|
+
}
|
|
208
|
+
}, 1000);
|
|
209
|
+
|
|
210
|
+
case 9:
|
|
211
|
+
case "end":
|
|
212
|
+
return _context.stop();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}, _callee);
|
|
216
|
+
}));
|
|
168
217
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
setBtnCanClick(false);
|
|
174
|
-
var timer = setInterval(function () {
|
|
175
|
-
if (time === 0) {
|
|
176
|
-
clearInterval(timer);
|
|
177
|
-
setBtn_info("获取验证码");
|
|
178
|
-
setBtnCanClick(true);
|
|
179
|
-
} else {
|
|
180
|
-
setBtn_info("".concat(time, "s\u91CD\u65B0\u53D1\u9001"));
|
|
181
|
-
time--;
|
|
182
|
-
}
|
|
183
|
-
}, 1000);
|
|
184
|
-
};
|
|
218
|
+
return function HandlerCode() {
|
|
219
|
+
return _ref2.apply(this, arguments);
|
|
220
|
+
};
|
|
221
|
+
}();
|
|
185
222
|
|
|
186
223
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
187
224
|
return {
|
|
@@ -102,17 +102,30 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
102
102
|
if (!require && !value) return [];
|
|
103
103
|
var errors = [];
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
var
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
105
|
+
try {
|
|
106
|
+
for (var i = 0; i < verifies.length; i++) {
|
|
107
|
+
var _verifies$i = verifies[i],
|
|
108
|
+
test = _verifies$i.test,
|
|
109
|
+
_tip = _verifies$i.tip;
|
|
110
|
+
|
|
111
|
+
if (test instanceof Function) {
|
|
112
|
+
if (!test(value)) {
|
|
113
|
+
errors.push({
|
|
114
|
+
name: name,
|
|
115
|
+
tip: _tip
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
if (!value.match(test)) {
|
|
120
|
+
errors.push({
|
|
121
|
+
name: name,
|
|
122
|
+
tip: _tip
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
115
126
|
}
|
|
127
|
+
} catch (e) {
|
|
128
|
+
throw new Error(e);
|
|
116
129
|
}
|
|
117
130
|
|
|
118
131
|
return errors;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>编组 5</title>
|
|
4
|
+
<g id="整体框架" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
5
|
+
<g transform="translate(-125.000000, -504.000000)" id="编组-5">
|
|
6
|
+
<g transform="translate(125.000000, 504.000000)">
|
|
7
|
+
<rect id="矩形" x="0" y="0" width="16" height="16" rx="1"></rect>
|
|
8
|
+
<g id="double-left" transform="translate(8.333333, 8.000000) rotate(-90.000000) translate(-8.333333, -8.000000) translate(2.333333, 1.000000)" fill="#2879FF" fill-rule="nonzero">
|
|
9
|
+
<path d="M-1.76793705,3.3938889 L-1.75125494,3.40915022 L3.65139574,8.51106147 L9.06523913,3.41309131 C9.34060773,3.15378577 9.78335553,3.14884771 10.0651005,3.39816722 L10.0818093,3.41343148 C10.0819295,3.41354477 10.0820495,3.41365807 10.0821696,3.41377143 C10.3568954,3.67320717 10.3619721,4.09038252 10.0976325,4.35565042 L10.0814489,4.37138173 L4.18879147,9.92030247 C4.05610644,10.0452476 3.88456021,10.111135 3.7108896,10.1179771 C3.50761457,10.1410503 3.29591324,10.0821891 3.13579683,9.94151673 L3.11683434,9.92424333 L-2.76746471,4.36744057 C-3.04244275,4.1077667 -3.04767927,3.69025351 -2.78329081,3.42456679 L-2.76710395,3.40881027 L-2.76674348,3.40847055 C-2.49162737,3.14940283 -2.04923783,3.1446155 -1.76793705,3.3938889 Z" id="路径" fill-opacity="0.3" transform="translate(3.657203, 6.666667) scale(-1, 1) rotate(-90.000000) translate(-3.657203, -6.666667) "></path>
|
|
10
|
+
<path d="M5.14583122,4.27441254 L5.1580251,4.28556785 L9.10712094,8.01483661 L13.0643981,4.28844864 C13.2656802,4.0989079 13.5893091,4.09529839 13.795252,4.2775398 L13.8074654,4.2886973 C13.8075532,4.2887801 13.8076409,4.28886292 13.8077287,4.28894578 C14.008541,4.47858168 14.0122519,4.78351817 13.8190315,4.97741714 L13.8072019,4.98891602 L9.49993314,9.04492868 C9.40294634,9.13625801 9.27755368,9.18441881 9.15060828,9.18942001 C9.00202328,9.20628554 8.84727914,9.16326061 8.73024121,9.06043534 L8.71638048,9.04780928 L4.41522124,4.98603523 C4.2142246,4.79622525 4.21039694,4.49104178 4.40365307,4.2968367 L4.41548494,4.28531938 L4.41574843,4.28507108 C4.61684599,4.09570415 4.94021294,4.09220485 5.14583122,4.27441254 Z" id="路径" transform="translate(9.111366, 6.666667) scale(-1, 1) rotate(-90.000000) translate(-9.111366, -6.666667) "></path>
|
|
11
|
+
</g>
|
|
12
|
+
</g>
|
|
13
|
+
</g>
|
|
14
|
+
</g>
|
|
15
|
+
</svg>
|
|
@@ -127,3 +127,24 @@
|
|
|
127
127
|
color: #89919f;
|
|
128
128
|
margin-right: 2px;
|
|
129
129
|
}
|
|
130
|
+
|
|
131
|
+
.titaui-flip-card__has-more {
|
|
132
|
+
position: absolute;
|
|
133
|
+
bottom: 0;
|
|
134
|
+
width: 100%;
|
|
135
|
+
height: 28px;
|
|
136
|
+
box-sizing: border-box;
|
|
137
|
+
background-repeat: no-repeat;
|
|
138
|
+
background-position: 50% 4px;
|
|
139
|
+
animation: hasMoreLight 0.5s 0.2s linear infinite;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@keyframes hasMoreLight {
|
|
143
|
+
0% {
|
|
144
|
+
background-image: url("./dark.svg");
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
100% {
|
|
148
|
+
background-image: url("./light.svg");
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -74,6 +74,11 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
74
74
|
isHideTopRightIcon = _useState8[0],
|
|
75
75
|
setIsHideTopRightIcon = _useState8[1];
|
|
76
76
|
|
|
77
|
+
var _useState9 = (0, _react.useState)(false),
|
|
78
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
79
|
+
showMore = _useState10[0],
|
|
80
|
+
setShowMore = _useState10[1];
|
|
81
|
+
|
|
77
82
|
var hideFloatRef = (0, _react.useRef)();
|
|
78
83
|
var flipCardRef = (0, _react.useRef)();
|
|
79
84
|
var flipFrontRef = (0, _react.useRef)();
|
|
@@ -82,11 +87,11 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
82
87
|
var goBackHandler = function goBackHandler() {
|
|
83
88
|
if (!isBack) return;
|
|
84
89
|
setMenuHideIcon(true);
|
|
85
|
-
flipBackRef.current.style.position =
|
|
86
|
-
flipFrontRef.current.style.display =
|
|
90
|
+
flipBackRef.current.style.position = "absolute";
|
|
91
|
+
flipFrontRef.current.style.display = "block";
|
|
87
92
|
setTimeout(function () {
|
|
88
|
-
flipFrontRef.current.style.position =
|
|
89
|
-
flipBackRef.current.style.display =
|
|
93
|
+
flipFrontRef.current.style.position = "relative";
|
|
94
|
+
flipBackRef.current.style.display = "none";
|
|
90
95
|
setMenuHideIcon(false);
|
|
91
96
|
}, 600);
|
|
92
97
|
setIsBack(false);
|
|
@@ -96,11 +101,11 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
96
101
|
var nextHandler = function nextHandler() {
|
|
97
102
|
if (isBack) return;
|
|
98
103
|
setMenuHideIcon(true);
|
|
99
|
-
flipFrontRef.current.style.position =
|
|
100
|
-
flipBackRef.current.style.display =
|
|
104
|
+
flipFrontRef.current.style.position = "absolute";
|
|
105
|
+
flipBackRef.current.style.display = "block";
|
|
101
106
|
setTimeout(function () {
|
|
102
|
-
flipBackRef.current.style.position =
|
|
103
|
-
flipFrontRef.current.style.display =
|
|
107
|
+
flipBackRef.current.style.position = "relative";
|
|
108
|
+
flipFrontRef.current.style.display = "none";
|
|
104
109
|
setMenuHideIcon(false);
|
|
105
110
|
}, 600);
|
|
106
111
|
setIsBack(true);
|
|
@@ -118,8 +123,8 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
118
123
|
}, [isFloat]);
|
|
119
124
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
120
125
|
return {
|
|
121
|
-
|
|
122
|
-
|
|
126
|
+
next: nextHandler,
|
|
127
|
+
goback: goBackHandler
|
|
123
128
|
};
|
|
124
129
|
});
|
|
125
130
|
|
|
@@ -174,14 +179,37 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
174
179
|
var onFlipMouseLeaveHandler = function onFlipMouseLeaveHandler(e) {
|
|
175
180
|
e.stopPropagation();
|
|
176
181
|
|
|
177
|
-
if (e.currentTarget.className.indexOf(
|
|
182
|
+
if (e.currentTarget.className.indexOf("titaui-flip-card--is-float-hide") != -1) {
|
|
178
183
|
return;
|
|
179
184
|
}
|
|
180
185
|
|
|
181
|
-
;
|
|
182
186
|
hideFlipCard(e);
|
|
183
187
|
};
|
|
184
188
|
|
|
189
|
+
(0, _react.useEffect)(function () {
|
|
190
|
+
var targetNode = document.getElementsByClassName("simplebar-content-wrapper")[0];
|
|
191
|
+
var config = {
|
|
192
|
+
attributes: true,
|
|
193
|
+
childList: true,
|
|
194
|
+
subtree: true
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
var callback = function callback(_mutationsList, _observer) {
|
|
198
|
+
var scrollArea = document.getElementsByClassName("simplebar-content-wrapper")[0];
|
|
199
|
+
|
|
200
|
+
if (scrollArea && scrollArea.scrollHeight > scrollArea.offsetHeight) {
|
|
201
|
+
setShowMore(true);
|
|
202
|
+
} else {
|
|
203
|
+
setShowMore(false);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
var observer = new MutationObserver(callback);
|
|
208
|
+
targetNode && observer.observe(targetNode, config);
|
|
209
|
+
return function () {
|
|
210
|
+
observer.disconnect();
|
|
211
|
+
};
|
|
212
|
+
}, []);
|
|
185
213
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
186
214
|
ref: flipCardRef,
|
|
187
215
|
onMouseEnter: onFlipMouseEnterHandler,
|
|
@@ -200,7 +228,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
200
228
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__inner-front-content"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(_precls["default"], "__inner-front-content--is-float"), isFloat), _defineProperty(_classNames2, "".concat(_precls["default"], "__inner-front-content--is-float-hide"), isFloatHide), _classNames2))
|
|
201
229
|
}, /*#__PURE__*/_react["default"].createElement(_menuCard["default"], {
|
|
202
230
|
style: {
|
|
203
|
-
|
|
231
|
+
padding: "28px 12px 28px 12px"
|
|
204
232
|
}
|
|
205
233
|
}, children[0]))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
206
234
|
ref: flipBackRef,
|
|
@@ -209,11 +237,13 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
209
237
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__inner-back-content"), (_classNames3 = {}, _defineProperty(_classNames3, "".concat(_precls["default"], "__inner-back-content--is-float"), isFloat), _defineProperty(_classNames3, "".concat(_precls["default"], "__inner-back-content--is-float-hide"), isFloatHide), _classNames3))
|
|
210
238
|
}, /*#__PURE__*/_react["default"].createElement(_menuCard["default"], {
|
|
211
239
|
style: {
|
|
212
|
-
|
|
240
|
+
padding: "42px 12px 28px 12px"
|
|
213
241
|
}
|
|
214
242
|
}, /*#__PURE__*/_react["default"].createElement(_flipBackHeader["default"], {
|
|
215
243
|
onClick: goBackHandler
|
|
216
|
-
}), children[1])))
|
|
244
|
+
}), children[1]))), showMore && /*#__PURE__*/_react["default"].createElement("div", {
|
|
245
|
+
className: "".concat(_precls["default"], "__has-more")
|
|
246
|
+
}))), !isHideTopRightIcon && /*#__PURE__*/_react["default"].createElement(_menuCloseBtn["default"], {
|
|
217
247
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__top-right-hide-icon")),
|
|
218
248
|
isAutoShow: true,
|
|
219
249
|
onClick: onMenuHideHandler
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>编组 4</title>
|
|
4
|
+
<g id="整体框架" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
5
|
+
<g transform="translate(-98.000000, -504.000000)" id="编组-4">
|
|
6
|
+
<g transform="translate(98.000000, 504.000000)">
|
|
7
|
+
<rect id="矩形" x="0" y="0" width="16" height="16" rx="1"></rect>
|
|
8
|
+
<g id="double-left" transform="translate(8.333333, 8.000000) rotate(-90.000000) translate(-8.333333, -8.000000) translate(2.333333, 1.000000)" fill="#2879FF" fill-rule="nonzero">
|
|
9
|
+
<path d="M-1.76793705,3.3938889 L-1.75125494,3.40915022 L3.65139574,8.51106147 L9.06523913,3.41309131 C9.34060773,3.15378577 9.78335553,3.14884771 10.0651005,3.39816722 L10.0818093,3.41343148 C10.0819295,3.41354477 10.0820495,3.41365807 10.0821696,3.41377143 C10.3568954,3.67320717 10.3619721,4.09038252 10.0976325,4.35565042 L10.0814489,4.37138173 L4.18879147,9.92030247 C4.05610644,10.0452476 3.88456021,10.111135 3.7108896,10.1179771 C3.50761457,10.1410503 3.29591324,10.0821891 3.13579683,9.94151673 L3.11683434,9.92424333 L-2.76746471,4.36744057 C-3.04244275,4.1077667 -3.04767927,3.69025351 -2.78329081,3.42456679 L-2.76710395,3.40881027 L-2.76674348,3.40847055 C-2.49162737,3.14940283 -2.04923783,3.1446155 -1.76793705,3.3938889 Z" id="路径" transform="translate(3.657203, 6.666667) scale(-1, 1) rotate(-90.000000) translate(-3.657203, -6.666667) "></path>
|
|
10
|
+
<path d="M5.14583122,4.27441254 L5.1580251,4.28556785 L9.10712094,8.01483661 L13.0643981,4.28844864 C13.2656802,4.0989079 13.5893091,4.09529839 13.795252,4.2775398 L13.8074654,4.2886973 C13.8075532,4.2887801 13.8076409,4.28886292 13.8077287,4.28894578 C14.008541,4.47858168 14.0122519,4.78351817 13.8190315,4.97741714 L13.8072019,4.98891602 L9.49993314,9.04492868 C9.40294634,9.13625801 9.27755368,9.18441881 9.15060828,9.18942001 C9.00202328,9.20628554 8.84727914,9.16326061 8.73024121,9.06043534 L8.71638048,9.04780928 L4.41522124,4.98603523 C4.2142246,4.79622525 4.21039694,4.49104178 4.40365307,4.2968367 L4.41548494,4.28531938 L4.41574843,4.28507108 C4.61684599,4.09570415 4.94021294,4.09220485 5.14583122,4.27441254 Z" id="路径" fill-opacity="0.3" transform="translate(9.111366, 6.666667) scale(-1, 1) rotate(-90.000000) translate(-9.111366, -6.666667) "></path>
|
|
11
|
+
</g>
|
|
12
|
+
</g>
|
|
13
|
+
</g>
|
|
14
|
+
</g>
|
|
15
|
+
</svg>
|
|
@@ -77,6 +77,13 @@ var EditBaseInfo = function EditBaseInfo(props) {
|
|
|
77
77
|
setUserInfo(_objectSpread(_objectSpread({}, userInfo), {}, {
|
|
78
78
|
name: value || ''
|
|
79
79
|
}));
|
|
80
|
+
|
|
81
|
+
if (value.length > 50 || value.length === 0) {
|
|
82
|
+
setIsDisable(true);
|
|
83
|
+
} else {
|
|
84
|
+
setIsDisable(false);
|
|
85
|
+
}
|
|
86
|
+
|
|
80
87
|
setIsEdit(true);
|
|
81
88
|
};
|
|
82
89
|
|
|
@@ -84,6 +91,13 @@ var EditBaseInfo = function EditBaseInfo(props) {
|
|
|
84
91
|
setUserInfo(_objectSpread(_objectSpread({}, userInfo), {}, {
|
|
85
92
|
mobile: value || ''
|
|
86
93
|
}));
|
|
94
|
+
|
|
95
|
+
if (value.length !== 11) {
|
|
96
|
+
setIsDisable(true);
|
|
97
|
+
} else {
|
|
98
|
+
setIsDisable(false);
|
|
99
|
+
}
|
|
100
|
+
|
|
87
101
|
setIsEdit(true);
|
|
88
102
|
};
|
|
89
103
|
|
|
@@ -95,7 +109,7 @@ var EditBaseInfo = function EditBaseInfo(props) {
|
|
|
95
109
|
};
|
|
96
110
|
|
|
97
111
|
var handleSaveUserInfo = function handleSaveUserInfo() {
|
|
98
|
-
if (!userInfo.email || !userInfo.mobile || !userInfo.name ||
|
|
112
|
+
if (!userInfo.email || !userInfo.mobile || !userInfo.name || userInfo.name.length > 50) {
|
|
99
113
|
setIsDisable(true);
|
|
100
114
|
return;
|
|
101
115
|
} else {
|
|
@@ -127,13 +141,6 @@ var EditBaseInfo = function EditBaseInfo(props) {
|
|
|
127
141
|
}
|
|
128
142
|
});
|
|
129
143
|
}, []);
|
|
130
|
-
(0, _react.useEffect)(function () {
|
|
131
|
-
if (userInfo.name && userInfo.mobile && isEdit) {
|
|
132
|
-
setIsDisable(false);
|
|
133
|
-
} else {
|
|
134
|
-
setIsDisable(true);
|
|
135
|
-
}
|
|
136
|
-
}, [userInfo, isEdit]);
|
|
137
144
|
return /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
|
|
138
145
|
visible: visible,
|
|
139
146
|
ref: modalRef,
|
|
@@ -170,6 +177,9 @@ var EditBaseInfo = function EditBaseInfo(props) {
|
|
|
170
177
|
}, {
|
|
171
178
|
tip: '姓名只能为中文,英文字母和数字及下划线的组合',
|
|
172
179
|
test: /^((?!(\uff08|\uff09)).)*$/g
|
|
180
|
+
}, {
|
|
181
|
+
tip: "\u59D3\u540D\u4E0D\u80FD\u8D85\u8FC7".concat(50, "\u4E2A\u5B57"),
|
|
182
|
+
test: /^[\s\S]{0,50}$/
|
|
173
183
|
}],
|
|
174
184
|
value: userInfo.name,
|
|
175
185
|
onChange: handleNameChange
|
|
@@ -185,7 +195,7 @@ var EditBaseInfo = function EditBaseInfo(props) {
|
|
|
185
195
|
tip: '手机号不能为空',
|
|
186
196
|
test: /^[\s\S]+$/
|
|
187
197
|
}, {
|
|
188
|
-
tip: '
|
|
198
|
+
tip: '格式错误,海外手机格式如:(+852)52345678',
|
|
189
199
|
test: /^1[3456789]\d{9}$/
|
|
190
200
|
}],
|
|
191
201
|
onChange: handlePhoneChange
|
package/package.json
CHANGED
|
@@ -48,7 +48,6 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
48
48
|
|
|
49
49
|
.rc-dialog-header {
|
|
50
50
|
padding: 18px 32px;
|
|
51
|
-
margin-bottom: 10px;
|
|
52
51
|
}
|
|
53
52
|
.rc-dialog-body {
|
|
54
53
|
// padding: 0 32px 0 32px;
|
|
@@ -56,7 +55,6 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
56
55
|
}
|
|
57
56
|
.rc-dialog-footer {
|
|
58
57
|
padding: 20px 32px;
|
|
59
|
-
margin-top: 8px;
|
|
60
58
|
display: flex;
|
|
61
59
|
justify-content: flex-end;
|
|
62
60
|
}
|
|
@@ -9,6 +9,7 @@ import { highLightWord } from '../../../../utils/tools';
|
|
|
9
9
|
import DynamicItemHeader from "../components/header";
|
|
10
10
|
import { getFeedTypeAndTypeColor } from "../../util";
|
|
11
11
|
import DangerousHtml from "../../components/dangerous-html";
|
|
12
|
+
import { getLocale } from "../../../../utils/getLocale";
|
|
12
13
|
import "./index.scss";
|
|
13
14
|
|
|
14
15
|
const prefix = "titaui-dynamic-announcement-item";
|
|
@@ -27,7 +28,7 @@ const DynamicAnnouncement: FC<IDynamicItemContentProps> = ({
|
|
|
27
28
|
const renderDesc = useMemo(() => {
|
|
28
29
|
return (
|
|
29
30
|
<Fragment>
|
|
30
|
-
<span className={prefix + "__operate-desc"}
|
|
31
|
+
<span className={prefix + "__operate-desc"}>{getLocale('Feed_SsAnnounce')}</span>
|
|
31
32
|
<span
|
|
32
33
|
className={prefix + "-desc-operate-type"}
|
|
33
34
|
style={{ background: feedTypeColor }}
|
|
@@ -67,14 +67,15 @@ export default forwardRef((props: Props, ref) => {
|
|
|
67
67
|
const [hasActive, setHasActive] = useState<boolean>(false);
|
|
68
68
|
const [btn_info, setBtn_info] = useState<any>("获取验证码");
|
|
69
69
|
const [btnCanClick, setBtnCanClick] = useState<any>(canClickCode);
|
|
70
|
+
const [isTime,setIsTime] = useState<any>(false);
|
|
70
71
|
const [tip, setTip] = useState<string>("");
|
|
71
72
|
const [value, setValue] = useState<string>(props.value || "");
|
|
72
|
-
|
|
73
73
|
useEffect(() => {
|
|
74
74
|
setValue(props.value);
|
|
75
75
|
}, [props.value]);
|
|
76
76
|
|
|
77
77
|
useEffect(()=>{
|
|
78
|
+
if(isTime) return
|
|
78
79
|
setBtnCanClick(canClickCode)
|
|
79
80
|
},[canClickCode])
|
|
80
81
|
|
|
@@ -115,22 +116,20 @@ export default forwardRef((props: Props, ref) => {
|
|
|
115
116
|
}
|
|
116
117
|
};
|
|
117
118
|
|
|
118
|
-
const HandlerCode = () => {
|
|
119
|
-
if (beforeSend) {
|
|
120
|
-
const result = beforeSend();
|
|
121
|
-
if (!result) return;
|
|
122
|
-
}
|
|
119
|
+
const HandlerCode = async () => {
|
|
123
120
|
if (!btnCanClick) return;
|
|
124
|
-
|
|
125
|
-
let isSuccess = btnClick && btnClick();
|
|
126
|
-
let time = isSuccess?60:3;
|
|
127
|
-
setBtn_info(`${time}s重新发送`);
|
|
128
121
|
setBtnCanClick(false);
|
|
122
|
+
let isSuccess = await btnClick();
|
|
123
|
+
let time = isSuccess ? 60 : 3;
|
|
124
|
+
setBtn_info(`${time}s重新发送`);
|
|
125
|
+
|
|
129
126
|
let timer = setInterval(() => {
|
|
127
|
+
setIsTime(true)
|
|
130
128
|
if (time === 0) {
|
|
131
129
|
clearInterval(timer);
|
|
132
130
|
setBtn_info("获取验证码");
|
|
133
131
|
setBtnCanClick(true);
|
|
132
|
+
setIsTime(false)
|
|
134
133
|
} else {
|
|
135
134
|
setBtn_info(`${time}s重新发送`);
|
|
136
135
|
time--;
|
|
@@ -65,11 +65,21 @@ export default forwardRef((props: Props, ref) => {
|
|
|
65
65
|
if (!verifies || !verifies.length) return [];
|
|
66
66
|
if (!require && !value) return [];
|
|
67
67
|
const errors: Error[] = [];
|
|
68
|
-
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
try {
|
|
69
|
+
for (let i = 0; i < verifies.length; i++) {
|
|
70
|
+
let { test, tip } = verifies[i];
|
|
71
|
+
if (test instanceof Function) {
|
|
72
|
+
if (!test(value)) {
|
|
73
|
+
errors.push({ name, tip });
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
if (!value.match(test)) {
|
|
77
|
+
errors.push({ name, tip });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
72
80
|
}
|
|
81
|
+
} catch (e) {
|
|
82
|
+
throw new Error(e);
|
|
73
83
|
}
|
|
74
84
|
return errors;
|
|
75
85
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>编组 5</title>
|
|
4
|
+
<g id="整体框架" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
5
|
+
<g transform="translate(-125.000000, -504.000000)" id="编组-5">
|
|
6
|
+
<g transform="translate(125.000000, 504.000000)">
|
|
7
|
+
<rect id="矩形" x="0" y="0" width="16" height="16" rx="1"></rect>
|
|
8
|
+
<g id="double-left" transform="translate(8.333333, 8.000000) rotate(-90.000000) translate(-8.333333, -8.000000) translate(2.333333, 1.000000)" fill="#2879FF" fill-rule="nonzero">
|
|
9
|
+
<path d="M-1.76793705,3.3938889 L-1.75125494,3.40915022 L3.65139574,8.51106147 L9.06523913,3.41309131 C9.34060773,3.15378577 9.78335553,3.14884771 10.0651005,3.39816722 L10.0818093,3.41343148 C10.0819295,3.41354477 10.0820495,3.41365807 10.0821696,3.41377143 C10.3568954,3.67320717 10.3619721,4.09038252 10.0976325,4.35565042 L10.0814489,4.37138173 L4.18879147,9.92030247 C4.05610644,10.0452476 3.88456021,10.111135 3.7108896,10.1179771 C3.50761457,10.1410503 3.29591324,10.0821891 3.13579683,9.94151673 L3.11683434,9.92424333 L-2.76746471,4.36744057 C-3.04244275,4.1077667 -3.04767927,3.69025351 -2.78329081,3.42456679 L-2.76710395,3.40881027 L-2.76674348,3.40847055 C-2.49162737,3.14940283 -2.04923783,3.1446155 -1.76793705,3.3938889 Z" id="路径" fill-opacity="0.3" transform="translate(3.657203, 6.666667) scale(-1, 1) rotate(-90.000000) translate(-3.657203, -6.666667) "></path>
|
|
10
|
+
<path d="M5.14583122,4.27441254 L5.1580251,4.28556785 L9.10712094,8.01483661 L13.0643981,4.28844864 C13.2656802,4.0989079 13.5893091,4.09529839 13.795252,4.2775398 L13.8074654,4.2886973 C13.8075532,4.2887801 13.8076409,4.28886292 13.8077287,4.28894578 C14.008541,4.47858168 14.0122519,4.78351817 13.8190315,4.97741714 L13.8072019,4.98891602 L9.49993314,9.04492868 C9.40294634,9.13625801 9.27755368,9.18441881 9.15060828,9.18942001 C9.00202328,9.20628554 8.84727914,9.16326061 8.73024121,9.06043534 L8.71638048,9.04780928 L4.41522124,4.98603523 C4.2142246,4.79622525 4.21039694,4.49104178 4.40365307,4.2968367 L4.41548494,4.28531938 L4.41574843,4.28507108 C4.61684599,4.09570415 4.94021294,4.09220485 5.14583122,4.27441254 Z" id="路径" transform="translate(9.111366, 6.666667) scale(-1, 1) rotate(-90.000000) translate(-9.111366, -6.666667) "></path>
|
|
11
|
+
</g>
|
|
12
|
+
</g>
|
|
13
|
+
</g>
|
|
14
|
+
</g>
|
|
15
|
+
</svg>
|
|
@@ -120,4 +120,23 @@
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
+
|
|
124
|
+
&__has-more {
|
|
125
|
+
position: absolute;
|
|
126
|
+
bottom: 0;
|
|
127
|
+
width: 100%;
|
|
128
|
+
height: 28px;
|
|
129
|
+
box-sizing: border-box;
|
|
130
|
+
background-repeat: no-repeat;
|
|
131
|
+
background-position: 50% 4px;
|
|
132
|
+
animation: hasMoreLight 0.5s 0.2s linear infinite;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
@keyframes hasMoreLight {
|
|
136
|
+
0% {
|
|
137
|
+
background-image: url("./dark.svg");
|
|
138
|
+
}
|
|
139
|
+
100% {
|
|
140
|
+
background-image: url("./light.svg");
|
|
141
|
+
}
|
|
123
142
|
}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import React, {
|
|
2
|
+
useState,
|
|
3
|
+
useRef,
|
|
4
|
+
forwardRef,
|
|
5
|
+
useImperativeHandle,
|
|
6
|
+
useEffect,
|
|
7
|
+
} from "react";
|
|
8
|
+
import ReactDOM from "react-dom";
|
|
9
|
+
import classNames from "classnames";
|
|
10
|
+
import MenuCard from "../menu-card";
|
|
11
|
+
import FlipBackHander from "./flip-back-header";
|
|
12
|
+
import MenuCloseBtn from "../menu-close-btn";
|
|
13
|
+
import DragResize from "../drag-resize";
|
|
14
|
+
import preCls from "./precls";
|
|
15
|
+
import "./index.scss";
|
|
10
16
|
|
|
11
17
|
interface Props {
|
|
12
18
|
children: any;
|
|
13
19
|
defaultWidth: number;
|
|
14
20
|
collapseMenu: Function;
|
|
15
|
-
onChange?: Function
|
|
21
|
+
onChange?: Function;
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
export interface flipRefIns {
|
|
@@ -22,18 +28,15 @@ export interface flipRefIns {
|
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
export default forwardRef((props: Props, ref) => {
|
|
25
|
-
const {
|
|
26
|
-
children,
|
|
27
|
-
defaultWidth,
|
|
28
|
-
collapseMenu,
|
|
29
|
-
onChange = () => { }
|
|
30
|
-
} = props;
|
|
31
|
+
const { children, defaultWidth, collapseMenu, onChange = () => {} } = props;
|
|
31
32
|
|
|
32
33
|
const [isBack, setIsBack] = useState(false);
|
|
33
34
|
const [isFloat, setIsFloat] = useState(false);
|
|
34
35
|
const [isFloatHide, setIsFloatHide] = useState(false);
|
|
35
36
|
const [isHideTopRightIcon, setIsHideTopRightIcon] = useState(false);
|
|
36
37
|
|
|
38
|
+
const [showMore, setShowMore] = useState(false);
|
|
39
|
+
|
|
37
40
|
const hideFloatRef = useRef<any>();
|
|
38
41
|
const flipCardRef = useRef<any>();
|
|
39
42
|
const flipFrontRef = useRef<any>();
|
|
@@ -42,168 +45,213 @@ export default forwardRef((props: Props, ref) => {
|
|
|
42
45
|
const goBackHandler = () => {
|
|
43
46
|
if (!isBack) return;
|
|
44
47
|
setMenuHideIcon(true);
|
|
45
|
-
flipBackRef.current.style.position =
|
|
46
|
-
flipFrontRef.current.style.display =
|
|
48
|
+
flipBackRef.current.style.position = "absolute";
|
|
49
|
+
flipFrontRef.current.style.display = "block";
|
|
47
50
|
setTimeout(() => {
|
|
48
|
-
flipFrontRef.current.style.position =
|
|
49
|
-
flipBackRef.current.style.display =
|
|
51
|
+
flipFrontRef.current.style.position = "relative";
|
|
52
|
+
flipBackRef.current.style.display = "none";
|
|
50
53
|
setMenuHideIcon(false);
|
|
51
|
-
}, 600)
|
|
54
|
+
}, 600);
|
|
52
55
|
setIsBack(false);
|
|
53
56
|
onChange(false);
|
|
54
|
-
}
|
|
57
|
+
};
|
|
55
58
|
|
|
56
59
|
const nextHandler = () => {
|
|
57
60
|
if (isBack) return;
|
|
58
61
|
setMenuHideIcon(true);
|
|
59
|
-
flipFrontRef.current.style.position =
|
|
60
|
-
flipBackRef.current.style.display =
|
|
62
|
+
flipFrontRef.current.style.position = "absolute";
|
|
63
|
+
flipBackRef.current.style.display = "block";
|
|
61
64
|
setTimeout(() => {
|
|
62
|
-
flipBackRef.current.style.position =
|
|
63
|
-
flipFrontRef.current.style.display =
|
|
65
|
+
flipBackRef.current.style.position = "relative";
|
|
66
|
+
flipFrontRef.current.style.display = "none";
|
|
64
67
|
setMenuHideIcon(false);
|
|
65
|
-
}, 600)
|
|
68
|
+
}, 600);
|
|
66
69
|
setIsBack(true);
|
|
67
70
|
onChange(true);
|
|
68
|
-
}
|
|
71
|
+
};
|
|
69
72
|
|
|
70
|
-
const setMenuHideIcon = isHide => {
|
|
73
|
+
const setMenuHideIcon = (isHide) => {
|
|
71
74
|
if (isHide === false && isFloat) return; // 如果是浮动状态则不能显示隐藏按钮
|
|
72
75
|
setIsHideTopRightIcon(isHide);
|
|
73
|
-
}
|
|
76
|
+
};
|
|
74
77
|
|
|
75
78
|
useEffect(() => {
|
|
76
79
|
setMenuHideIcon(isFloat);
|
|
77
80
|
}, [isFloat]);
|
|
78
81
|
|
|
79
82
|
useImperativeHandle(ref, () => ({
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}))
|
|
83
|
+
next: nextHandler,
|
|
84
|
+
goback: goBackHandler,
|
|
85
|
+
}));
|
|
83
86
|
|
|
84
87
|
const onMenuHideHandler = () => {
|
|
85
88
|
collapseMenu(!isFloat); // 最外层菜单with=0
|
|
86
|
-
setIsFloat(!isFloat);
|
|
87
|
-
setTimeout(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
setIsFloat(!isFloat); // 浮动菜单,设置阴影
|
|
90
|
+
setTimeout(
|
|
91
|
+
() => {
|
|
92
|
+
// 1秒后隐藏菜单到左侧
|
|
93
|
+
setIsFloatHide(!isFloatHide);
|
|
94
|
+
},
|
|
95
|
+
!isFloat ? 400 : 0
|
|
96
|
+
);
|
|
97
|
+
};
|
|
91
98
|
|
|
92
99
|
const removeCloseFloat = () => {
|
|
93
100
|
clearTimeout(hideFloatRef.current);
|
|
94
|
-
}
|
|
101
|
+
};
|
|
95
102
|
|
|
96
103
|
// 隐藏浮动的菜单(通用)
|
|
97
|
-
const hideFlipCard = e => {
|
|
104
|
+
const hideFlipCard = (e) => {
|
|
98
105
|
if (!isFloat) return; // 非浮动状态下不隐藏
|
|
99
106
|
removeCloseFloat();
|
|
100
107
|
hideFloatRef.current = setTimeout(() => {
|
|
101
108
|
setIsFloatHide(true);
|
|
102
|
-
}, 400)
|
|
103
|
-
}
|
|
109
|
+
}, 400);
|
|
110
|
+
};
|
|
104
111
|
|
|
105
|
-
const onFixedHideIconMouseEnter = e => {
|
|
112
|
+
const onFixedHideIconMouseEnter = (e) => {
|
|
106
113
|
e.stopPropagation();
|
|
107
114
|
removeCloseFloat();
|
|
108
115
|
setIsFloatHide(false);
|
|
109
|
-
}
|
|
116
|
+
};
|
|
110
117
|
|
|
111
|
-
const onFixedHideIconMouseLeave = e => {
|
|
118
|
+
const onFixedHideIconMouseLeave = (e) => {
|
|
112
119
|
e.stopPropagation();
|
|
113
120
|
hideFlipCard(e);
|
|
114
|
-
}
|
|
121
|
+
};
|
|
115
122
|
|
|
116
|
-
const onFixedHideIconClickHandler = e => {
|
|
123
|
+
const onFixedHideIconClickHandler = (e) => {
|
|
117
124
|
e.stopPropagation();
|
|
118
125
|
collapseMenu(false);
|
|
119
126
|
setIsFloat(false);
|
|
120
127
|
setIsFloatHide(false);
|
|
121
|
-
}
|
|
128
|
+
};
|
|
122
129
|
|
|
123
|
-
const onFlipMouseEnterHandler = e => {
|
|
130
|
+
const onFlipMouseEnterHandler = (e) => {
|
|
124
131
|
e.stopPropagation();
|
|
125
132
|
removeCloseFloat();
|
|
126
|
-
}
|
|
133
|
+
};
|
|
127
134
|
|
|
128
|
-
const onFlipMouseLeaveHandler = e => {
|
|
135
|
+
const onFlipMouseLeaveHandler = (e) => {
|
|
129
136
|
e.stopPropagation();
|
|
130
|
-
if (
|
|
131
|
-
|
|
132
|
-
|
|
137
|
+
if (
|
|
138
|
+
e.currentTarget.className.indexOf("titaui-flip-card--is-float-hide") != -1
|
|
139
|
+
) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
133
142
|
hideFlipCard(e);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
const targetNode = document.getElementsByClassName(
|
|
147
|
+
"simplebar-content-wrapper"
|
|
148
|
+
)[0];
|
|
149
|
+
|
|
150
|
+
const config = { attributes: true, childList: true, subtree: true };
|
|
151
|
+
|
|
152
|
+
const callback = function (_mutationsList, _observer) {
|
|
153
|
+
const scrollArea = document.getElementsByClassName(
|
|
154
|
+
"simplebar-content-wrapper"
|
|
155
|
+
)[0];
|
|
156
|
+
if (scrollArea && scrollArea.scrollHeight > scrollArea.offsetHeight) {
|
|
157
|
+
setShowMore(true);
|
|
158
|
+
} else {
|
|
159
|
+
setShowMore(false);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
const observer = new MutationObserver(callback);
|
|
163
|
+
|
|
164
|
+
targetNode && observer.observe(targetNode, config);
|
|
165
|
+
|
|
166
|
+
return () => {
|
|
167
|
+
observer.disconnect();
|
|
168
|
+
};
|
|
169
|
+
}, []);
|
|
170
|
+
|
|
171
|
+
return (
|
|
172
|
+
<React.Fragment>
|
|
173
|
+
<div
|
|
174
|
+
ref={flipCardRef}
|
|
175
|
+
onMouseEnter={onFlipMouseEnterHandler}
|
|
176
|
+
onMouseLeave={onFlipMouseLeaveHandler}
|
|
177
|
+
className={classNames(preCls, {
|
|
178
|
+
[`${preCls}--is-back`]: isBack,
|
|
179
|
+
[`${preCls}--is-float`]: isFloat,
|
|
180
|
+
[`${preCls}--is-float-hide`]: isFloatHide,
|
|
181
|
+
})}
|
|
151
182
|
>
|
|
152
|
-
<
|
|
153
|
-
|
|
154
|
-
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
<div
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
<
|
|
164
|
-
{
|
|
165
|
-
|
|
183
|
+
<DragResize
|
|
184
|
+
minWidth={defaultWidth - 10}
|
|
185
|
+
maxWidth={600}
|
|
186
|
+
defaultWidth={defaultWidth}
|
|
187
|
+
>
|
|
188
|
+
<div className={classNames(`${preCls}__inner`)}>
|
|
189
|
+
{/* 第一屏的内容 */}
|
|
190
|
+
<div
|
|
191
|
+
ref={flipFrontRef}
|
|
192
|
+
className={classNames(`${preCls}__inner-front`)}
|
|
193
|
+
>
|
|
194
|
+
<div
|
|
195
|
+
className={classNames(`${preCls}__inner-front-content`, {
|
|
196
|
+
[`${preCls}__inner-front-content--is-float`]: isFloat,
|
|
197
|
+
[`${preCls}__inner-front-content--is-float-hide`]:
|
|
198
|
+
isFloatHide,
|
|
199
|
+
})}
|
|
200
|
+
>
|
|
201
|
+
<MenuCard style={{ padding: "28px 12px 28px 12px" }}>
|
|
202
|
+
{children[0]}
|
|
203
|
+
</MenuCard>
|
|
204
|
+
</div>
|
|
166
205
|
</div>
|
|
167
|
-
</div>
|
|
168
206
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
{
|
|
181
|
-
|
|
207
|
+
{/* 第二屏的内容 */}
|
|
208
|
+
<div
|
|
209
|
+
ref={flipBackRef}
|
|
210
|
+
className={classNames(`${preCls}__inner-back`)}
|
|
211
|
+
>
|
|
212
|
+
<div
|
|
213
|
+
className={classNames(`${preCls}__inner-back-content`, {
|
|
214
|
+
[`${preCls}__inner-back-content--is-float`]: isFloat,
|
|
215
|
+
[`${preCls}__inner-back-content--is-float-hide`]: isFloatHide,
|
|
216
|
+
})}
|
|
217
|
+
>
|
|
218
|
+
<MenuCard style={{ padding: "42px 12px 28px 12px" }}>
|
|
219
|
+
<FlipBackHander onClick={goBackHandler} />
|
|
220
|
+
{children[1]}
|
|
221
|
+
</MenuCard>
|
|
222
|
+
</div>
|
|
182
223
|
</div>
|
|
224
|
+
{showMore && (
|
|
225
|
+
<div className={`${preCls}__has-more`}>
|
|
226
|
+
</div>
|
|
227
|
+
)}
|
|
183
228
|
</div>
|
|
184
|
-
</
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
229
|
+
</DragResize>
|
|
230
|
+
|
|
231
|
+
{/* 菜单右上角的隐藏ICON */}
|
|
232
|
+
{!isHideTopRightIcon && (
|
|
233
|
+
<MenuCloseBtn
|
|
234
|
+
className={classNames(`${preCls}__top-right-hide-icon`)}
|
|
235
|
+
isAutoShow={true}
|
|
236
|
+
onClick={onMenuHideHandler}
|
|
237
|
+
/>
|
|
238
|
+
)}
|
|
239
|
+
</div>
|
|
240
|
+
|
|
241
|
+
{/* 页面最左侧的隐藏ICON */}
|
|
242
|
+
{isFloat &&
|
|
243
|
+
ReactDOM.createPortal(
|
|
244
|
+
<span className={classNames(`${preCls}__fixed-hide-icon`)}>
|
|
245
|
+
<MenuCloseBtn
|
|
246
|
+
isClose={true}
|
|
247
|
+
isAutoShow={false}
|
|
248
|
+
onClick={onFixedHideIconClickHandler}
|
|
249
|
+
onMouseEnter={onFixedHideIconMouseEnter}
|
|
250
|
+
onMouseLeave={onFixedHideIconMouseLeave}
|
|
251
|
+
/>
|
|
252
|
+
</span>,
|
|
253
|
+
document.body
|
|
254
|
+
)}
|
|
255
|
+
</React.Fragment>
|
|
256
|
+
);
|
|
257
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>编组 4</title>
|
|
4
|
+
<g id="整体框架" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
5
|
+
<g transform="translate(-98.000000, -504.000000)" id="编组-4">
|
|
6
|
+
<g transform="translate(98.000000, 504.000000)">
|
|
7
|
+
<rect id="矩形" x="0" y="0" width="16" height="16" rx="1"></rect>
|
|
8
|
+
<g id="double-left" transform="translate(8.333333, 8.000000) rotate(-90.000000) translate(-8.333333, -8.000000) translate(2.333333, 1.000000)" fill="#2879FF" fill-rule="nonzero">
|
|
9
|
+
<path d="M-1.76793705,3.3938889 L-1.75125494,3.40915022 L3.65139574,8.51106147 L9.06523913,3.41309131 C9.34060773,3.15378577 9.78335553,3.14884771 10.0651005,3.39816722 L10.0818093,3.41343148 C10.0819295,3.41354477 10.0820495,3.41365807 10.0821696,3.41377143 C10.3568954,3.67320717 10.3619721,4.09038252 10.0976325,4.35565042 L10.0814489,4.37138173 L4.18879147,9.92030247 C4.05610644,10.0452476 3.88456021,10.111135 3.7108896,10.1179771 C3.50761457,10.1410503 3.29591324,10.0821891 3.13579683,9.94151673 L3.11683434,9.92424333 L-2.76746471,4.36744057 C-3.04244275,4.1077667 -3.04767927,3.69025351 -2.78329081,3.42456679 L-2.76710395,3.40881027 L-2.76674348,3.40847055 C-2.49162737,3.14940283 -2.04923783,3.1446155 -1.76793705,3.3938889 Z" id="路径" transform="translate(3.657203, 6.666667) scale(-1, 1) rotate(-90.000000) translate(-3.657203, -6.666667) "></path>
|
|
10
|
+
<path d="M5.14583122,4.27441254 L5.1580251,4.28556785 L9.10712094,8.01483661 L13.0643981,4.28844864 C13.2656802,4.0989079 13.5893091,4.09529839 13.795252,4.2775398 L13.8074654,4.2886973 C13.8075532,4.2887801 13.8076409,4.28886292 13.8077287,4.28894578 C14.008541,4.47858168 14.0122519,4.78351817 13.8190315,4.97741714 L13.8072019,4.98891602 L9.49993314,9.04492868 C9.40294634,9.13625801 9.27755368,9.18441881 9.15060828,9.18942001 C9.00202328,9.20628554 8.84727914,9.16326061 8.73024121,9.06043534 L8.71638048,9.04780928 L4.41522124,4.98603523 C4.2142246,4.79622525 4.21039694,4.49104178 4.40365307,4.2968367 L4.41548494,4.28531938 L4.41574843,4.28507108 C4.61684599,4.09570415 4.94021294,4.09220485 5.14583122,4.27441254 Z" id="路径" fill-opacity="0.3" transform="translate(9.111366, 6.666667) scale(-1, 1) rotate(-90.000000) translate(-9.111366, -6.666667) "></path>
|
|
11
|
+
</g>
|
|
12
|
+
</g>
|
|
13
|
+
</g>
|
|
14
|
+
</g>
|
|
15
|
+
</svg>
|
|
@@ -2,7 +2,6 @@ import React, { useState, useRef, useEffect } from 'react';
|
|
|
2
2
|
import Form from '../../../../components/form';
|
|
3
3
|
import { getUserInfoFun, saveUserInfo } from '../../request-api';
|
|
4
4
|
import Toast from '../../../../components/toast';
|
|
5
|
-
// import Input from './input';
|
|
6
5
|
import Dialog from '../../../../components/dialog';
|
|
7
6
|
import './index.scss';
|
|
8
7
|
|
|
@@ -26,6 +25,11 @@ const EditBaseInfo = (props) => {
|
|
|
26
25
|
...userInfo,
|
|
27
26
|
name: value || ''
|
|
28
27
|
});
|
|
28
|
+
if(value.length > 50 || value.length === 0) {
|
|
29
|
+
setIsDisable(true);
|
|
30
|
+
} else {
|
|
31
|
+
setIsDisable(false);
|
|
32
|
+
}
|
|
29
33
|
setIsEdit(true);
|
|
30
34
|
};
|
|
31
35
|
|
|
@@ -34,6 +38,11 @@ const EditBaseInfo = (props) => {
|
|
|
34
38
|
...userInfo,
|
|
35
39
|
mobile: value || ''
|
|
36
40
|
});
|
|
41
|
+
if(value.length !== 11 ) {
|
|
42
|
+
setIsDisable(true);
|
|
43
|
+
}else {
|
|
44
|
+
setIsDisable(false);
|
|
45
|
+
}
|
|
37
46
|
setIsEdit(true);
|
|
38
47
|
};
|
|
39
48
|
|
|
@@ -46,7 +55,7 @@ const EditBaseInfo = (props) => {
|
|
|
46
55
|
};
|
|
47
56
|
|
|
48
57
|
const handleSaveUserInfo = () => {
|
|
49
|
-
if (!userInfo.email || !userInfo.mobile || !userInfo.name ||
|
|
58
|
+
if (!userInfo.email || !userInfo.mobile || !userInfo.name || userInfo.name.length > 50) {
|
|
50
59
|
setIsDisable(true);
|
|
51
60
|
return;
|
|
52
61
|
} else {
|
|
@@ -70,17 +79,6 @@ const EditBaseInfo = (props) => {
|
|
|
70
79
|
});
|
|
71
80
|
}, []);
|
|
72
81
|
|
|
73
|
-
useEffect(
|
|
74
|
-
() => {
|
|
75
|
-
if (userInfo.name && userInfo.mobile && isEdit) {
|
|
76
|
-
setIsDisable(false);
|
|
77
|
-
} else {
|
|
78
|
-
setIsDisable(true);
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
[ userInfo, isEdit ]
|
|
82
|
-
);
|
|
83
|
-
|
|
84
82
|
return (
|
|
85
83
|
<Dialog
|
|
86
84
|
visible={visible}
|
|
@@ -115,7 +113,11 @@ const EditBaseInfo = (props) => {
|
|
|
115
113
|
{
|
|
116
114
|
tip: '姓名只能为中文,英文字母和数字及下划线的组合',
|
|
117
115
|
test: /^((?!(\uff08|\uff09)).)*$/g
|
|
118
|
-
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
tip: `姓名不能超过${50}个字`,
|
|
119
|
+
test: /^[\s\S]{0,50}$/,
|
|
120
|
+
},
|
|
119
121
|
]}
|
|
120
122
|
value={userInfo.name}
|
|
121
123
|
onChange={handleNameChange}
|
|
@@ -134,7 +136,7 @@ const EditBaseInfo = (props) => {
|
|
|
134
136
|
test: /^[\s\S]+$/
|
|
135
137
|
},
|
|
136
138
|
{
|
|
137
|
-
tip: '
|
|
139
|
+
tip: '格式错误,海外手机格式如:(+852)52345678',
|
|
138
140
|
test: /^1[3456789]\d{9}$/
|
|
139
141
|
}
|
|
140
142
|
]}
|