ztxkui 4.2.20 → 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 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;
@@ -38,7 +38,7 @@ import water from '../assets/img/water.png';
38
38
  import { createDownloadUrl } from 'ztxkutils/dist/fileOperation';
39
39
  import './print.scss';
40
40
  import { token } from '../constants';
41
- import imgSrc from '../assets/img/logo002.jpg';
41
+ import imgSrc from '../assets/img/logo012.jpg';
42
42
  function request(options) {
43
43
  var headers = options.headers, restOptions = __rest(options, ["headers"]);
44
44
  return axios(__assign({ baseURL: options.baseURL ? options.baseURL : 'http://192.168.0.83:8000', url: options.url, headers: __assign({ 'Zmdms-Auth': "bearer " + token }, options.headers), method: options.method, data: options.data, params: options.params }, restOptions));
@@ -177,9 +177,10 @@ var SinaturesDemo = function () {
177
177
  /** 是否可编辑 1可编辑 0不可编辑 */
178
178
  var canEdit = 1;
179
179
  /** 是否展示添加附件按钮 0不展示 1展示 */
180
- var showAddBtn = 0;
180
+ var showAddBtn = 1;
181
181
  var params = {
182
182
  // cancelDefaultCheckedQj: 1,
183
+ showDeleteBtn: true,
183
184
  needQj: 1,
184
185
  needDg: 1,
185
186
  needQys: 1,
@@ -525,6 +525,7 @@ var EditableTable = function () {
525
525
  } }, "\u9A8C\u8BC1"),
526
526
  React.createElement(Button, { onClick: function () {
527
527
  console.log(records);
528
+ console.log(tableHandleRef.current.getColumns());
528
529
  } }, "\u83B7\u53D6\u6570\u636E"),
529
530
  React.createElement(Table, { dataSource: records, columns: columns, rowKey: "id",
530
531
  // 表格项可输入
@@ -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\u4E2D " + url + "==" + dataKey + "==" + titleKey);
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
- 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);
941
+ copyValue(text);
947
942
  }
948
943
  };
949
944
  // 点击时
@@ -1040,7 +1035,28 @@ function EnhanceSelect(_a) {
1040
1035
  }
1041
1036
  },
1042
1037
  }); });
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,
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,
@@ -428,6 +428,18 @@ function Table(props) {
428
428
  }
429
429
  return index;
430
430
  },
431
+ /** 获取自定义列配置当前配置 */
432
+ getColumns: function () {
433
+ var columns = [];
434
+ mergeColumns.forEach(function (column) {
435
+ if (column.dataIndex) {
436
+ columns.push({
437
+ dataIndex: column.dataIndex || column.key,
438
+ });
439
+ }
440
+ });
441
+ return columns;
442
+ },
431
443
  }); });
432
444
  var tableResizableTitle = useMemo(function () {
433
445
  return {
@@ -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);
@@ -550,7 +550,7 @@ var Sinatures = function (_a) {
550
550
  },
551
551
  key: 'attachId',
552
552
  dataIndex: 'attachId',
553
- width: isOnlyQj ? 240 : 350,
553
+ width: isOnlyQj ? 300 : 410,
554
554
  render: function (text, record, index) {
555
555
  if (!isOnlyQj) {
556
556
  /** 删除附件 */
@@ -560,45 +560,68 @@ var Sinatures = function (_a) {
560
560
  console.error('没有找到需要删除的文件名!', "serverFileName \u4E3A " + fileName);
561
561
  return;
562
562
  }
563
- setTbLoading(true);
564
- var xhr = new XMLHttpRequest();
565
- xhr.open('post', ZT_API_BASEURL + "/api/zmdms-resource/oss/endpoint/remove-file", true);
566
- xhr.addEventListener('readystatechange', function () {
567
- if (xhr.readyState === 4) {
568
- var response = JSON.parse(xhr.responseText);
569
- if (xhr.status === 200) {
570
- setTbLoading(false);
571
- if ((response === null || response === void 0 ? void 0 : response.success) === true) {
572
- var result_1 = [];
573
- var getNewRecord_1 = function (data) {
574
- var newRecords = data.slice();
575
- newRecords.splice(index, 1);
576
- result_1 = newRecords;
577
- return newRecords;
578
- };
579
- setRecords(function (preRecords) {
580
- return getNewRecord_1(preRecords);
581
- });
582
- setContractId(null);
583
- if (records.length > 0 && onSigValuesChange) {
584
- onSigValuesChange(sigValuesChange('fileList', result_1));
585
- }
586
- message.success('文件删除成功!');
587
- }
588
- else {
589
- setTbLoading(false);
590
- message.warning(response === null || response === void 0 ? void 0 : response.msg);
591
- }
592
- }
593
- else {
594
- setTbLoading(false);
595
- message.warning(response === null || response === void 0 ? void 0 : response.msg);
596
- }
597
- }
563
+ var result = [];
564
+ var getNewRecord = function (data) {
565
+ var newRecords = data.slice();
566
+ newRecords.splice(index, 1);
567
+ result = newRecords;
568
+ return newRecords;
569
+ };
570
+ setRecords(function (preRecords) {
571
+ return getNewRecord(preRecords);
598
572
  });
599
- xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
600
- xhr.setRequestHeader('Zmdms-Auth', authToken);
601
- xhr.send("fileName=" + fileName);
573
+ setContractId(null);
574
+ if (records.length > 0 && onSigValuesChange) {
575
+ onSigValuesChange(sigValuesChange('fileList', result));
576
+ }
577
+ message.success('文件删除成功!');
578
+ // 此删除附件接口需要管理员权限 后端建议此处仅前端删除 20230111
579
+ // setTbLoading(true);
580
+ // const xhr = new XMLHttpRequest();
581
+ // xhr.open(
582
+ // 'post',
583
+ // `${ZT_API_BASEURL}/api/zmdms-resource/oss/endpoint/remove-file`,
584
+ // true
585
+ // );
586
+ // xhr.addEventListener('readystatechange', function () {
587
+ // if (xhr.readyState === 4) {
588
+ // const response = JSON.parse(xhr.responseText);
589
+ // if (xhr.status === 200) {
590
+ // setTbLoading(false);
591
+ // if (response?.success === true) {
592
+ // let result: any = [];
593
+ // const getNewRecord = (data) => {
594
+ // const newRecords = data.slice();
595
+ // newRecords.splice(index, 1);
596
+ // result = newRecords;
597
+ // return newRecords;
598
+ // };
599
+ // setRecords((preRecords) => {
600
+ // return getNewRecord(preRecords);
601
+ // });
602
+ // setContractId(null);
603
+ // if (records.length > 0 && onSigValuesChange) {
604
+ // onSigValuesChange(
605
+ // sigValuesChange('fileList', result)
606
+ // );
607
+ // }
608
+ // message.success('文件删除成功!');
609
+ // } else {
610
+ // setTbLoading(false);
611
+ // message.warning(response?.msg);
612
+ // }
613
+ // } else {
614
+ // setTbLoading(false);
615
+ // message.warning(response?.msg);
616
+ // }
617
+ // }
618
+ // });
619
+ // xhr.setRequestHeader(
620
+ // 'Content-type',
621
+ // 'application/x-www-form-urlencoded'
622
+ // );
623
+ // xhr.setRequestHeader('Zmdms-Auth', authToken);
624
+ // xhr.send(`fileName=${fileName}`);
602
625
  };
603
626
  return (React.createElement(React.Fragment, null,
604
627
  React.createElement(AttachOperation, { ZT_API_BASEURL: ZT_API_BASEURL, ZT_FILE_BASEURL: ZT_FILE_BASEURL, token: authToken, attachId: record === null || record === void 0 ? void 0 : record.attachId, attachName: record === null || record === void 0 ? void 0 : record.attachName, attachSize: record === null || record === void 0 ? void 0 : record.attachSize, showDeleteBtn: showDeleteBtn, onDeleteFile: deleteFile })));
@@ -619,7 +642,7 @@ var Sinatures = function (_a) {
619
642
  title: '合同比对模板',
620
643
  key: 'templateAttachId',
621
644
  dataIndex: 'templateAttachId',
622
- width: 150,
645
+ width: 200,
623
646
  render: function (text, record, index) {
624
647
  return record.attachTypeName === '合同本身' ? (React.createElement(TemplateAttach, { record: record, index: index, openCustomerModalHandle: openCustomerModalHandle, isEdit: isEdit })) : ('');
625
648
  },
@@ -650,7 +673,7 @@ var Sinatures = function (_a) {
650
673
  title: isEdit ? '添加水印' : '水印',
651
674
  key: 'isWatermark',
652
675
  dataIndex: 'isWatermark',
653
- width: 60,
676
+ width: 100,
654
677
  render: function (text, record, index) {
655
678
  return (React.createElement(Switch, { checked: text, disabled: !isEdit, onChange: function (value) {
656
679
  return onSwitchChangeHandle(value, 'isWatermark', index);
@@ -661,7 +684,7 @@ var Sinatures = function (_a) {
661
684
  title: '电子印章',
662
685
  key: 'needQys',
663
686
  dataIndex: 'needQys',
664
- width: 610,
687
+ width: 700,
665
688
  children: [
666
689
  {
667
690
  title: '盖电子印章',
@@ -678,7 +701,7 @@ var Sinatures = function (_a) {
678
701
  title: '选择电子印章',
679
702
  key: 'electronicSeal',
680
703
  dataIndex: 'electronicSeal',
681
- width: 360,
704
+ width: 450,
682
705
  render: function (value, row, index) {
683
706
  // 是否有勾选加盖电子印章
684
707
  var hasElectronicSeal = records === null || records === void 0 ? void 0 : records.some(function (item) { return !!item.isElectronicSeal; });
@@ -688,7 +711,7 @@ var Sinatures = function (_a) {
688
711
  React.createElement("div", { style: __assign({ height: '36px', borderBottom: '1px solid #EBEBEB', marginBottom: '5px', paddingLeft: '8px', lineHeight: '36px' }, (yjzrr ? {} : { display: 'none' })), title: _label },
689
712
  React.createElement(Checkbox, { checked: isEconomic, disabled: !(hasElectronicSeal && isEdit), onChange: function (e) { return needEconomic(e); } },
690
713
  React.createElement("div", { style: {
691
- width: '300px',
714
+ width: '370px',
692
715
  whiteSpace: 'nowrap',
693
716
  textOverflow: 'ellipsis',
694
717
  overflow: 'hidden',
@@ -773,7 +796,7 @@ var Sinatures = function (_a) {
773
796
  });
774
797
  }
775
798
  // 上传组件的数据
776
- var _0 = useState(), originFileList = _0[0], setOriginFileList = _0[1];
799
+ var _z = useState(), originFileList = _z[0], setOriginFileList = _z[1];
777
800
  /** 签章组件onChange事件 */
778
801
  var sigValuesChange = useCallback(function (type, value) {
779
802
  var _a, _b;
@@ -852,16 +875,16 @@ var Sinatures = function (_a) {
852
875
  });
853
876
  });
854
877
  console.log(successFileList_1);
855
- var getNewRecord_2 = function (data) {
878
+ var getNewRecord_1 = function (data) {
856
879
  if (data === void 0) { data = []; }
857
880
  var newRecords = __spreadArray(__spreadArray([], data), successFileList_1).filter(function (item) { return item.attachId !== '123456789'; });
858
881
  return newRecords;
859
882
  };
860
883
  setRecords(function (preRecords) {
861
- return getNewRecord_2(preRecords);
884
+ return getNewRecord_1(preRecords);
862
885
  });
863
886
  if (typeof fnRef.current === 'function') {
864
- fnRef.current(sigValuesChange('fileList', getNewRecord_2(records)));
887
+ fnRef.current(sigValuesChange('fileList', getNewRecord_1(records)));
865
888
  }
866
889
  }
867
890
  if (filelist.every(function (item) { return item.status === 'error'; })) {
@@ -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.20",
3
+ "version": "4.2.22",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",