ztxkui 4.2.21 → 4.2.23

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 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
- return null;
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
  * {
@@ -517,7 +518,7 @@ function EnhanceSelect(_a) {
517
518
  var catchData = enhanceSelectCatchObj[url];
518
519
  var catchDataKey = params ? JSON.stringify(params) : 'single';
519
520
  // 发送接口请求,并设置缓存数据
520
- getDataHandle(request, { url: url, params: params, method: method, timeout: timeout }, {
521
+ getDataHandle(request, { url: url, params: params, method: method, timeout: timeout, isForceRequest: true }, {
521
522
  appointObj: {
522
523
  obj: catchData,
523
524
  key: catchDataKey,
@@ -531,6 +532,7 @@ function EnhanceSelect(_a) {
531
532
  params: params,
532
533
  method: method,
533
534
  timeout: timeout,
535
+ isForceRequest: true,
534
536
  });
535
537
  }
536
538
  };
@@ -773,7 +775,7 @@ function EnhanceSelect(_a) {
773
775
  concatData(concatData(concatData(selectList, _defaultList), multipleList), handleAddItems).map(function (item, index) {
774
776
  var _a;
775
777
  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\u4E2D " + url + "==" + dataKey + "==" + titleKey);
778
+ 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
779
  return null;
778
780
  }
779
781
  var key = item.__hand_add_key
@@ -937,13 +939,7 @@ function EnhanceSelect(_a) {
937
939
  // console.log('选中数据事件');
938
940
  if (restProps.mode !== 'multiple' && isCopy) {
939
941
  var text = textContent(obj.children);
940
- var textarea = document.createElement('textarea');
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);
942
+ copyValue(text);
947
943
  }
948
944
  };
949
945
  // 点击时
@@ -1040,7 +1036,28 @@ function EnhanceSelect(_a) {
1040
1036
  }
1041
1037
  },
1042
1038
  }); });
1043
- 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,
1039
+ var onMouseDownHandle = function (e) {
1040
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1041
+ if (e.button === 2) {
1042
+ var currentNode_1 = e.target;
1043
+ var contextmenuHandle_1 = function (e) {
1044
+ e.preventDefault();
1045
+ e.stopPropagation();
1046
+ currentNode_1.removeEventListener('contextmenu', contextmenuHandle_1);
1047
+ };
1048
+ currentNode_1.addEventListener('contextmenu', contextmenuHandle_1);
1049
+ 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')) {
1050
+ 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'));
1051
+ }
1052
+ 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')) {
1053
+ 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'));
1054
+ }
1055
+ else {
1056
+ copyValue(currentNode_1 === null || currentNode_1 === void 0 ? void 0 : currentNode_1.innerText);
1057
+ }
1058
+ }
1059
+ };
1060
+ 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
1061
  // getPopupContainer={(trigger) => trigger || document.body}
1045
1062
  open: isOpen, onDropdownVisibleChange: function (visible) { return setIsOpen(visible); }, onPopupScroll: onPopupScrollHandle, dropdownRender: url && !remoteSearch && isCatch
1046
1063
  ? function (menu) { return (React.createElement(React.Fragment, null,
@@ -1,22 +1,17 @@
1
- import { useState, useEffect, useRef } from 'react';
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
- fileRef.current = fileList;
10
- }, [fileList]);
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
- }, [list]);
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 _t = useState(false), tbloading = _t[0], setTbLoading = _t[1];
149
+ var tbloading = useState(false)[0];
150
150
  // 仅需要群杰印章
151
- var _u = useState(false), isOnlyQj = _u[0], setIsOnlyQj = _u[1];
151
+ var _t = useState(false), isOnlyQj = _t[0], setIsOnlyQj = _t[1];
152
152
  // 存放onSigValuesChange缓存回调方法
153
153
  var fnRef = useRef();
154
154
  // 是否加盖经济责任人手签章
155
- var _v = useState(true), isEconomic = _v[0], setIsEconomic = _v[1];
155
+ var _u = useState(true), isEconomic = _u[0], setIsEconomic = _u[1];
156
156
  // 一级责任人名字
157
- var _w = useState(''), yjzrr = _w[0], setYjzrr = _w[1];
157
+ var _v = useState(''), yjzrr = _v[0], setYjzrr = _v[1];
158
158
  // 未确认盖章位置的弹窗是否可见
159
- var _x = useState(false), visible = _x[0], setVisible = _x[1];
159
+ var _w = useState(false), visible = _w[0], setVisible = _w[1];
160
160
  // 未确认盖章位置的电子印章列表
161
- var _y = useState([]), unSealList = _y[0], setUnSealList = _y[1];
161
+ var _x = useState([]), unSealList = _x[0], setUnSealList = _x[1];
162
162
  // 需重新确认盖章位置的电子印章
163
- var _z = useState([]), needReSealList = _z[0], setNeedReSealList = _z[1];
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 _0 = useState(), originFileList = _0[0], setOriginFileList = _0[1];
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,3 @@
1
1
  import { getSearchParams } from '../business/SearchContainer/hooks/useDynamic';
2
+ export declare function copyValue(val: string): void;
2
3
  export { getSearchParams };
@@ -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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "4.2.21",
3
+ "version": "4.2.23",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",