ztxkui 4.2.21 → 4.2.22
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/Demo.js +5 -4
- package/dist/components/EnhanceSelect/index.js +25 -9
- package/dist/components/business/Signatures/hooks.js +4 -9
- package/dist/components/business/Signatures/index.js +8 -8
- package/dist/components/utils/index.d.ts +1 -0
- package/dist/components/utils/index.js +10 -0
- package/package.json +1 -1
package/dist/Demo.js
CHANGED
|
@@ -33,9 +33,9 @@ function Demo() {
|
|
|
33
33
|
var timeoutId = setTimeout(function () {
|
|
34
34
|
console.log('获取数据');
|
|
35
35
|
setList(new Array(50).fill(1).map(function (item, index) {
|
|
36
|
-
if (index === 3) {
|
|
37
|
-
|
|
38
|
-
}
|
|
36
|
+
// if (index === 3) {
|
|
37
|
+
// return null;
|
|
38
|
+
// }
|
|
39
39
|
return {
|
|
40
40
|
id: index,
|
|
41
41
|
name: '你好' + index,
|
|
@@ -138,6 +138,7 @@ function Demo() {
|
|
|
138
138
|
name: '22',
|
|
139
139
|
},
|
|
140
140
|
{},
|
|
141
|
-
] })
|
|
141
|
+
] }),
|
|
142
|
+
React.createElement("input", { style: { width: '300px' } })));
|
|
142
143
|
}
|
|
143
144
|
export default Demo;
|
|
@@ -35,6 +35,7 @@ import Button from '../Button';
|
|
|
35
35
|
import { useFetchState } from 'ztxkutils/dist/hooks';
|
|
36
36
|
import debounce from 'lodash/debounce';
|
|
37
37
|
import { dangerouslySetXss } from 'ztxkutils/dist/tools';
|
|
38
|
+
import { copyValue } from '../utils';
|
|
38
39
|
/**
|
|
39
40
|
* 组件缓存的数据格式,在当前浏览器运行内,能保证是唯一的引用,用来缓存数据用
|
|
40
41
|
* {
|
|
@@ -773,7 +774,7 @@ function EnhanceSelect(_a) {
|
|
|
773
774
|
concatData(concatData(concatData(selectList, _defaultList), multipleList), handleAddItems).map(function (item, index) {
|
|
774
775
|
var _a;
|
|
775
776
|
if (!item) {
|
|
776
|
-
console.error("\u9047\u5230\u4E86\u6570\u7EC4\u4E2D\u5B58\u5728\u7A7A\u503C\u5F97\u60C5\u51B5\uFF0C\u8BF7\u68C0\u67E5\u6570\u636E\u51C6\u786E\u6027!\u5B58\u5728\u95EE\u9898\u5F97\u6570\u636E \u63A5\u53E3
|
|
777
|
+
console.error("\u9047\u5230\u4E86\u6570\u7EC4\u4E2D\u5B58\u5728\u7A7A\u503C\u5F97\u60C5\u51B5\uFF0C\u8BF7\u68C0\u67E5\u6570\u636E\u51C6\u786E\u6027!\u5B58\u5728\u95EE\u9898\u5F97\u6570\u636E \u63A5\u53E3 " + url + "==" + dataKey + "==" + titleKey);
|
|
777
778
|
return null;
|
|
778
779
|
}
|
|
779
780
|
var key = item.__hand_add_key
|
|
@@ -937,13 +938,7 @@ function EnhanceSelect(_a) {
|
|
|
937
938
|
// console.log('选中数据事件');
|
|
938
939
|
if (restProps.mode !== 'multiple' && isCopy) {
|
|
939
940
|
var text = textContent(obj.children);
|
|
940
|
-
|
|
941
|
-
textarea.setAttribute('readonly', 'readonly');
|
|
942
|
-
textarea.value = text;
|
|
943
|
-
document.body.appendChild(textarea);
|
|
944
|
-
textarea.select();
|
|
945
|
-
document === null || document === void 0 ? void 0 : document.execCommand('copy');
|
|
946
|
-
document.body.removeChild(textarea);
|
|
941
|
+
copyValue(text);
|
|
947
942
|
}
|
|
948
943
|
};
|
|
949
944
|
// 点击时
|
|
@@ -1040,7 +1035,28 @@ function EnhanceSelect(_a) {
|
|
|
1040
1035
|
}
|
|
1041
1036
|
},
|
|
1042
1037
|
}); });
|
|
1043
|
-
|
|
1038
|
+
var onMouseDownHandle = function (e) {
|
|
1039
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1040
|
+
if (e.button === 2) {
|
|
1041
|
+
var currentNode_1 = e.target;
|
|
1042
|
+
var contextmenuHandle_1 = function (e) {
|
|
1043
|
+
e.preventDefault();
|
|
1044
|
+
e.stopPropagation();
|
|
1045
|
+
currentNode_1.removeEventListener('contextmenu', contextmenuHandle_1);
|
|
1046
|
+
};
|
|
1047
|
+
currentNode_1.addEventListener('contextmenu', contextmenuHandle_1);
|
|
1048
|
+
if ((_b = (_a = currentNode_1 === null || currentNode_1 === void 0 ? void 0 : currentNode_1.classList) === null || _a === void 0 ? void 0 : _a.contains) === null || _b === void 0 ? void 0 : _b.call(_a, 'ant-select-item-option-content')) {
|
|
1049
|
+
copyValue((_d = (_c = currentNode_1 === null || currentNode_1 === void 0 ? void 0 : currentNode_1.parentNode) === null || _c === void 0 ? void 0 : _c.getAttribute) === null || _d === void 0 ? void 0 : _d.call(_c, 'title'));
|
|
1050
|
+
}
|
|
1051
|
+
else if ((_f = (_e = currentNode_1 === null || currentNode_1 === void 0 ? void 0 : currentNode_1.classList) === null || _e === void 0 ? void 0 : _e.contains) === null || _f === void 0 ? void 0 : _f.call(_e, 'zt-select--feed-item')) {
|
|
1052
|
+
copyValue((_j = (_h = (_g = currentNode_1 === null || currentNode_1 === void 0 ? void 0 : currentNode_1.parentNode) === null || _g === void 0 ? void 0 : _g.parentNode) === null || _h === void 0 ? void 0 : _h.getAttribute) === null || _j === void 0 ? void 0 : _j.call(_h, 'title'));
|
|
1053
|
+
}
|
|
1054
|
+
else {
|
|
1055
|
+
copyValue(currentNode_1 === null || currentNode_1 === void 0 ? void 0 : currentNode_1.innerText);
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
};
|
|
1059
|
+
return (React.createElement(Select, __assign({ defaultValue: showAll ? '' : undefined, allowClear: true, showSearch: true, filterOption: remoteSearch ? false : filterOptionHandle, onSearch: remoteSearch ? onSearchHandle : onSearchHandleInner, onChange: onChangeHandle, optionLabelProp: "title", loading: loading, onFocus: onFocusHandle, onBlur: onBlurHandle, onClear: onClearHandle, onSelect: onSelectHandle, onClick: onClickHandle, onMouseDown: onMouseDownHandle,
|
|
1044
1060
|
// getPopupContainer={(trigger) => trigger || document.body}
|
|
1045
1061
|
open: isOpen, onDropdownVisibleChange: function (visible) { return setIsOpen(visible); }, onPopupScroll: onPopupScrollHandle, dropdownRender: url && !remoteSearch && isCatch
|
|
1046
1062
|
? function (menu) { return (React.createElement(React.Fragment, null,
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
import { useState, useEffect
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* 外部数据发生改变,设置内部数据
|
|
4
4
|
*/
|
|
5
5
|
export function useRecords(fileList) {
|
|
6
6
|
var _a = useState([]), records = _a[0], setRecords = _a[1];
|
|
7
|
-
var fileRef = useRef();
|
|
8
7
|
useEffect(function () {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var list = fileRef.current;
|
|
12
|
-
useEffect(function () {
|
|
13
|
-
if (Array.isArray(list)) {
|
|
14
|
-
setRecords(list);
|
|
8
|
+
if (Array.isArray(fileList)) {
|
|
9
|
+
setRecords(fileList);
|
|
15
10
|
}
|
|
16
11
|
else {
|
|
17
12
|
setRecords([]);
|
|
18
13
|
}
|
|
19
|
-
}, [
|
|
14
|
+
}, [fileList]);
|
|
20
15
|
return {
|
|
21
16
|
records: records,
|
|
22
17
|
setRecords: setRecords,
|
|
@@ -146,21 +146,21 @@ var Sinatures = function (_a) {
|
|
|
146
146
|
// 初始化是否清空契约锁信息标识
|
|
147
147
|
var _s = useState(true), isInit = _s[0], setIsInit = _s[1];
|
|
148
148
|
// 表格loading
|
|
149
|
-
var
|
|
149
|
+
var tbloading = useState(false)[0];
|
|
150
150
|
// 仅需要群杰印章
|
|
151
|
-
var
|
|
151
|
+
var _t = useState(false), isOnlyQj = _t[0], setIsOnlyQj = _t[1];
|
|
152
152
|
// 存放onSigValuesChange缓存回调方法
|
|
153
153
|
var fnRef = useRef();
|
|
154
154
|
// 是否加盖经济责任人手签章
|
|
155
|
-
var
|
|
155
|
+
var _u = useState(true), isEconomic = _u[0], setIsEconomic = _u[1];
|
|
156
156
|
// 一级责任人名字
|
|
157
|
-
var
|
|
157
|
+
var _v = useState(''), yjzrr = _v[0], setYjzrr = _v[1];
|
|
158
158
|
// 未确认盖章位置的弹窗是否可见
|
|
159
|
-
var
|
|
159
|
+
var _w = useState(false), visible = _w[0], setVisible = _w[1];
|
|
160
160
|
// 未确认盖章位置的电子印章列表
|
|
161
|
-
var
|
|
161
|
+
var _x = useState([]), unSealList = _x[0], setUnSealList = _x[1];
|
|
162
162
|
// 需重新确认盖章位置的电子印章
|
|
163
|
-
var
|
|
163
|
+
var _y = useState([]), needReSealList = _y[0], setNeedReSealList = _y[1];
|
|
164
164
|
useEffect(function () {
|
|
165
165
|
if (cancelDefaultCheckedQj) {
|
|
166
166
|
setChecked(false);
|
|
@@ -796,7 +796,7 @@ var Sinatures = function (_a) {
|
|
|
796
796
|
});
|
|
797
797
|
}
|
|
798
798
|
// 上传组件的数据
|
|
799
|
-
var
|
|
799
|
+
var _z = useState(), originFileList = _z[0], setOriginFileList = _z[1];
|
|
800
800
|
/** 签章组件onChange事件 */
|
|
801
801
|
var sigValuesChange = useCallback(function (type, value) {
|
|
802
802
|
var _a, _b;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
import { getSearchParams } from '../business/SearchContainer/hooks/useDynamic';
|
|
2
|
+
export function copyValue(val) {
|
|
3
|
+
var text = val;
|
|
4
|
+
var textarea = document.createElement('textarea');
|
|
5
|
+
textarea.setAttribute('readonly', 'readonly');
|
|
6
|
+
textarea.value = text;
|
|
7
|
+
document.body.appendChild(textarea);
|
|
8
|
+
textarea.select();
|
|
9
|
+
document === null || document === void 0 ? void 0 : document.execCommand('copy');
|
|
10
|
+
document.body.removeChild(textarea);
|
|
11
|
+
}
|
|
2
12
|
export { getSearchParams };
|