ztxkui 2.9.9 → 3.0.0
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/dist/DemoCom/FormDemo.js
CHANGED
|
@@ -92,7 +92,7 @@ var FormDemo = function () {
|
|
|
92
92
|
return (React.createElement(React.Fragment, null,
|
|
93
93
|
React.createElement(Form, { name: "test-list", form: form },
|
|
94
94
|
React.createElement(SearchContainer, { dark: true },
|
|
95
|
-
React.createElement(SearchLeft, {
|
|
95
|
+
React.createElement(SearchLeft, { isDynamic: true, dynamicStorageKey: "symbol-key-00001" },
|
|
96
96
|
React.createElement(SearchItem, { width: "half", name: "pwNo", configname: "pwNoCopy", label: "\u5165\u5E93\u5355\u53F7", rules: [
|
|
97
97
|
{
|
|
98
98
|
required: true,
|
|
@@ -20,29 +20,30 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import React from 'react';
|
|
23
|
+
import React, { useRef } from 'react';
|
|
24
24
|
import { Button as AntButton } from 'antd';
|
|
25
25
|
import classNames from 'classnames';
|
|
26
26
|
var maxClickTime = 1000;
|
|
27
27
|
var Button = function (props) {
|
|
28
28
|
var _a;
|
|
29
29
|
var children = props.children, type = props.type, size = props.size, disabled = props.disabled, danger = props.danger, className = props.className, onClick = props.onClick, _b = props.agentClick, agentClick = _b === void 0 ? true : _b, restProps = __rest(props, ["children", "type", "size", "disabled", "danger", "className", "onClick", "agentClick"]);
|
|
30
|
+
var startTimeRef = useRef(0);
|
|
30
31
|
var classes = classNames('zt-btn', className, (_a = {},
|
|
31
32
|
_a["zt-btn-" + type] = type,
|
|
32
33
|
_a["zt-btn-disabled"] = disabled,
|
|
33
34
|
_a["zt-btn-" + size] = size,
|
|
34
35
|
_a["zt-btn-dangerous"] = danger,
|
|
35
36
|
_a));
|
|
36
|
-
var startTime = 0;
|
|
37
37
|
var myOnClick = function (event) {
|
|
38
38
|
if (agentClick) {
|
|
39
39
|
var nowDateTime = Date.now();
|
|
40
|
-
if (
|
|
41
|
-
|
|
40
|
+
if (startTimeRef.current === 0 ||
|
|
41
|
+
nowDateTime - startTimeRef.current > maxClickTime) {
|
|
42
|
+
startTimeRef.current = nowDateTime;
|
|
42
43
|
onClick && onClick(event);
|
|
43
44
|
}
|
|
44
45
|
else {
|
|
45
|
-
|
|
46
|
+
startTimeRef.current = nowDateTime;
|
|
46
47
|
console.log('点击按钮过于频繁');
|
|
47
48
|
}
|
|
48
49
|
}
|