ztxkui 3.1.2 → 3.1.3

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.
@@ -2,21 +2,39 @@
2
2
  * @author 陈亚雄
3
3
  * @description
4
4
  */
5
- import React, { useRef } from 'react';
5
+ import React, { useRef, useState } from 'react';
6
+ import { stringify } from 'qs';
6
7
  // redux
7
8
  // ztxkui公共组件
8
9
  import { Sinatures } from '../index';
10
+ import Template from './Template';
9
11
  // 路由配置
10
12
  // store
11
13
  // 自定义组件
12
14
  // 其他文件
15
+ /**
16
+ * @description 封装请求方法
17
+ */
18
+ function myRequest(options) {
19
+ return fetch(options.url + "?" + stringify(options.params), {
20
+ headers: {
21
+ 'Zmdms-Auth': 'bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJtZW1iZXJfdHlwZSI6MSwiaGFuZGxlX2hyX3Bob25lIjpudWxsLCJyZXN1bWVfZGF0ZSI6bnVsbCwidXNlcl9uYW1lIjoiY2hlbnl4IiwiZW1wX25hbWUiOiLpmYjkuprpm4QiLCJlbXBfbnVtYmVyIjoiWUcyMTA3MDA4IiwiaW10X2lkIjpudWxsLCJyZWFsX25hbWUiOiLpmYjkuprpm4QiLCJjbGllbnRfdHlwZSI6IndlYiIsImRhdGFfcm9sZV9pZCI6IjEzNDU5Nzg1MDUzMDIwNTY5NjIsMTQxMjYxNDExMDY0NzM4NjExNCwxNDEyNjE1Njc3MTE5MjY2ODE3LDE0NDgxMjEwODY1MDQzMDA1NDYsMTQ1MjgyMDI5MzgwMjcxMzA5MCwxNDUzOTI1MDAxNTMxNDc4MDE3LDE0NTg3MTIwODIwODIzNTcyNTAsMTQ1ODgyNjIzODE4NTg4OTc5NCwxNDU4ODI3NzAxMDEyMzI0MzUzLDE0NTg4MjgzNjA4MDE1MDkzNzcsMTQ2MDA4OTI2MjAxMjAzMDk3NywxNDYxMTM3Nzg4Nj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JuaWNrX25hbWUiOiLpmYjkuprpm4QiLCJjb21wYW55X25hbWUiOiLmtZnllYbkuK3mi5Ppm4blm6LnianmtYHnp5HmioDmnInpmZDlhazlj7giLCJkZXB0X2lkIjoiMTM5NzA4MTkzMDMyODQyNDQ0OSIsImhhbmRsZV9ocl9uYW1lIjpudWxsLCJhY2NvdW50IjoiY2hlbnl4IiwicmVzdW1lX2lkIjpudWxsfQ.FzJkqhtmGgkSsDZd6RBylQEGxBsJRslLDtX9DXgfW-M',
22
+ },
23
+ method: options.method,
24
+ }).then(function (response) { return response.json(); });
25
+ }
13
26
  var token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJtZW1iZXJfdHlwZSI6MSwiaGFuZGxlX2hyX3Bob25lIjpudWxsLCJyZXN1bWVfZGF0ZSI6bnVsbCwidXNlcl9uYW1lIjoiY2hlbnl4IiwiZW1wX25hbWUiOiLpmYjkuprpm4QiLCJlbXBfbnVtYmVyIjoiMDAwMTcwODkiLCJpbXRfaWQiOm51bGwsInJlYWxfbmFtZSI6IumZiOS6mumbhCIsImNsaWVudF90eXBlIjoid2ViIiwiZGF0YV9yb2xlX2lkIjoiMTM0NTk3ODUwNTMwMjA1Njk2MiwxNDEyNjE0MTEwNjQ3Mzg2MTE0LDE0MTI2MTU2NzcxMTkyNjY4MTcsMTQ0ODEyMTA4NjUwNDMwMDU0NiwxNDUyODIwMjkzODAyNzEzMDkwLDE0NTM5MjUwMDE1MzE0NzgwMTcsMTQ1ODcxMjA4MjA4MjM1NzI1MCwxNDU4ODI2MjM4MTg1ODg5Nzk0LDE0NTg4Mjc3MDEwMTIzMjQzNTMsMTQ1ODgyODM2MDgwMTUwOTM3NywxNDYwMDg5MjYyMDEyMDMwOTc3LDE0NjExMzc3ODg2NDUxMjYxNDYsMTQ2ODAzNTM1MTYyNTI4NTYzNCIsImNsaWVudF9pZCI6InN3b3JkIiwidXNlcl90eXBlIjo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NTU1NzE0Iiwib3JnX2lkIjpudWxsLCJuaWNrX25hbWUiOiLpmYjkuprpm4QiLCJjb21wYW55X25hbWUiOiLmtZnllYbkuK3mi5Ppm4blm6LvvIjph43luobvvInmnInpmZDlhazlj7giLCJkZXB0X2lkIjoiMTM5NzA4MTkzMDMyODQyNDQ0OSIsImhhbmRsZV9ocl9uYW1lIjpudWxsLCJhY2NvdW50IjoiY2hlbnl4IiwicmVzdW1lX2lkIjpudWxsfQ.xvUZAA0tLrpNTPK5nRhihdSyQbTQyAmcOJS724OUnHY';
14
27
  var list = [
15
28
  {
16
- attachId: '1540149601361080321',
29
+ attachId: '1326475920778194945',
17
30
  attachName: '源文件.jpg',
18
- templateAttachId: '1540149601361080321',
31
+ templateAttachId: '1326465400842948610',
19
32
  templateAttachName: '模板文件.jpg',
33
+ attachType: '001',
34
+ attachTypeName: '合同本身',
35
+ isCustomerReference: true,
36
+ isWatermark: true,
37
+ isElectronicSeal: true,
20
38
  },
21
39
  {
22
40
  attachId: '1540242898414874626',
@@ -36,25 +54,43 @@ var qunjSealList = [
36
54
  { name: '浙商中拓集团股份有限公司合同章' },
37
55
  { name: '浙江中拓供应链管理有限公司合同章' },
38
56
  ];
57
+ var qunjSeal = {
58
+ code: '222',
59
+ contractNum: 4444,
60
+ sealMode: '2',
61
+ sealList: [
62
+ {
63
+ name: '浙商中拓集团股份有限公司合同章',
64
+ },
65
+ {
66
+ name: '浙江中拓供应链管理有限公司合同章',
67
+ },
68
+ ],
69
+ };
39
70
  var electronicSealList = [
40
71
  { name: '浙商中拓集团(上海)合同专用章' },
41
72
  { name: '浙商/浙江中拓法人签字章' },
42
73
  ];
74
+ var electronicSeal = ['浙商中拓集团(上海)合同专用章'];
43
75
  var SinaturesDemo = function () {
76
+ var _a = useState(0), rIndex = _a[0], setRIndex = _a[1];
44
77
  var openCustomerModalHandle = function (index) {
45
78
  console.log(index);
46
- console.log(handleRef.current.setTemplateData({
47
- templateAttachId: '2',
48
- templateAttachName: '2',
49
- templateAttachSize: '3',
50
- }, index));
79
+ setRIndex(index);
80
+ templateRef.current.openModal();
51
81
  };
52
82
  var handleRef = useRef({});
83
+ var templateRef = useRef({});
53
84
  return (React.createElement("div", null,
54
- React.createElement(Sinatures, { isUpdate: true, fileList: list, fileTypeList: fileTypeList, qunjSealList: qunjSealList, electronicSealList: electronicSealList, ZT_API_BASEURL: "http://192.168.0.83:8000", ZT_FILE_BASEURL: "http://192.168.0.83:88", token: token, openCustomerModalHandle: openCustomerModalHandle, handleRef: handleRef }),
85
+ React.createElement(Sinatures, { isUpdate: true, fileList: list, fileTypeList: fileTypeList, qunjSealList: qunjSealList, qunjSeal: qunjSeal, electronicSealList: electronicSealList, electronicSeal: electronicSeal, ZT_API_BASEURL: "http://192.168.0.83:8000", ZT_FILE_BASEURL: "http://192.168.0.83:88", token: token, openCustomerModalHandle: openCustomerModalHandle, handleRef: handleRef, request: myRequest, compareTaskUrl: "api/zmdms-resource/seal/create-compare-task", queryCompareTaskUrl: "api/zmdms-resource/seal/query-compare-task", downloadCompareFileUrl: "api/zmdms-resource/seal/download-compare-file" }),
86
+ React.createElement(Template, { handleRef: handleRef, rIndex: rIndex, templateRef: templateRef }),
87
+ React.createElement("button", { onClick: function () {
88
+ var _a;
89
+ console.log((_a = handleRef.current) === null || _a === void 0 ? void 0 : _a.getData());
90
+ } }, "\u83B7\u53D6\u6570\u636E"),
55
91
  React.createElement("button", { onClick: function () {
56
92
  var _a;
57
93
  console.log((_a = handleRef.current) === null || _a === void 0 ? void 0 : _a.getData());
58
- } }, "\u83B7\u53D6\u6570\u636E")));
94
+ } }, "\u76D6\u7AE0")));
59
95
  };
60
96
  export default SinaturesDemo;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @author zyh
3
+ * @description 客户样板
4
+ */
5
+ import React from 'react';
6
+ interface Iprops {
7
+ rIndex: number;
8
+ templateRef: any;
9
+ handleRef?: any;
10
+ }
11
+ declare const _default: React.NamedExoticComponent<Iprops>;
12
+ export default _default;
@@ -0,0 +1,100 @@
1
+ /**
2
+ * @author zyh
3
+ * @description 客户样板
4
+ */
5
+ import React, { useState, memo, useImperativeHandle } from 'react';
6
+ import { Form, Row, Col, Input, Table, Modal } from '../index';
7
+ var Template = function (_a) {
8
+ var handleRef = _a.handleRef, rIndex = _a.rIndex, templateRef = _a.templateRef;
9
+ var form = Form.useForm()[0];
10
+ var selectionType = useState('radio')[0];
11
+ var _b = useState([]), selectedRowKeys = _b[0], setSelectedRowKeys = _b[1];
12
+ // 设置样板弹窗显示或隐藏
13
+ var _c = useState(false), visible = _c[0], setVisible = _c[1];
14
+ var onSelectChange = function (newSelectedRowKeys) {
15
+ setSelectedRowKeys(newSelectedRowKeys);
16
+ var values = form.getFieldsValue();
17
+ values.selectedRowKeys = newSelectedRowKeys;
18
+ handleRef.current.setTemplateData({
19
+ templateAttachId: '2',
20
+ templateAttachName: '2',
21
+ templateAttachSize: '3',
22
+ }, rIndex);
23
+ };
24
+ var data = useState([
25
+ {
26
+ key: '111',
27
+ create_time: '2020-04-20 10:10',
28
+ contractNo: 'SD003',
29
+ creator: 'xxx',
30
+ templateNo: 'A20200816_3',
31
+ },
32
+ {
33
+ key: '222',
34
+ create_time: '2020-04-20 10:10',
35
+ contractNo: 'SD002',
36
+ creator: 'xxx',
37
+ templateNo: 'A20200816_3',
38
+ },
39
+ ])[0];
40
+ var columns = [
41
+ {
42
+ title: '序号',
43
+ width: 52,
44
+ render: function (text, record, index) { return "" + (index + 1); },
45
+ },
46
+ {
47
+ title: '创建时间',
48
+ dataIndex: 'create_time',
49
+ },
50
+ {
51
+ title: '合同号',
52
+ dataIndex: 'contractNo',
53
+ },
54
+ {
55
+ title: '创建人',
56
+ dataIndex: 'creator',
57
+ },
58
+ {
59
+ title: '样板号',
60
+ dataIndex: 'templateNo',
61
+ },
62
+ ];
63
+ var rowSelection = {
64
+ type: selectionType,
65
+ selectedRowKeys: selectedRowKeys,
66
+ onChange: onSelectChange,
67
+ };
68
+ // 打开或关闭样板弹窗
69
+ var openOrCloseModal = function () {
70
+ form === null || form === void 0 ? void 0 : form.resetFields();
71
+ setSelectedRowKeys([]);
72
+ setVisible(!visible);
73
+ };
74
+ /** 样板弹窗的确定事件 */
75
+ var onSure = function () {
76
+ openOrCloseModal();
77
+ };
78
+ /**
79
+ * 暴露方法给外部调用
80
+ */
81
+ useImperativeHandle(templateRef, function () { return ({
82
+ openModal: function () {
83
+ openOrCloseModal();
84
+ },
85
+ }); });
86
+ return (React.createElement(Modal, { visible: visible, title: "\u9009\u62E9\u5BA2\u6237\u6837\u677F", width: "70%", maskClosable: false, loading: false, onCancel: openOrCloseModal, onOk: onSure },
87
+ React.createElement(Form, { name: "contract-compare", form: form },
88
+ React.createElement(Row, null,
89
+ React.createElement(Col, { span: 8 },
90
+ React.createElement(Form.Item, { name: "Customer", label: "\u5BA2\u5546\u540D\u79F0" },
91
+ React.createElement(Input, { bordered: false }))),
92
+ React.createElement(Col, { span: 8 },
93
+ React.createElement(Form.Item, { name: "company", label: "\u516C\u53F8\u540D\u79F0" },
94
+ React.createElement(Input, { bordered: false }))),
95
+ React.createElement(Col, { span: 8 },
96
+ React.createElement(Form.Item, { name: "departMent", label: "\u90E8\u95E8\u540D\u79F0" },
97
+ React.createElement(Input, { bordered: false })))),
98
+ React.createElement(Table, { rowSelection: rowSelection, columns: columns, dataSource: data, rowKey: "key", scroll: { x: undefined } }))));
99
+ };
100
+ export default memo(Template);
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @author 陈亚雄
3
+ * @description
4
+ */
5
+ import React from 'react';
6
+ interface IProps {
7
+ params?: any;
8
+ url?: string;
9
+ request?: any;
10
+ method?: string;
11
+ }
12
+ declare const Export: React.FC<IProps>;
13
+ export default Export;
@@ -0,0 +1,67 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ /**
13
+ * @author 陈亚雄
14
+ * @description
15
+ */
16
+ import React from 'react';
17
+ // redux
18
+ // ztxkui公共组件
19
+ import { Button, message } from '../../index';
20
+ // 路由配置
21
+ // store
22
+ // 自定义组件
23
+ // 其他文件
24
+ import qs from 'qs';
25
+ var Export = function (_a) {
26
+ var params = _a.params, url = _a.url, request = _a.request, _b = _a.method, method = _b === void 0 ? 'POST' : _b;
27
+ var onClickExport = function () {
28
+ if (!url) {
29
+ message.warning('该功能正在开发中');
30
+ return;
31
+ }
32
+ var _params = __assign({}, params);
33
+ request({
34
+ method: 'POST',
35
+ url: "/api" + (url.startsWith('/') ? url : "/" + url),
36
+ headers: {
37
+ 'Content-Type': 'application/x-www-form-urlencoded',
38
+ },
39
+ responseType: 'blob',
40
+ data: qs.stringify(_params),
41
+ }).then(function (res) {
42
+ if (!res.headers['content-disposition']) {
43
+ message.warning('没有可导出的内容');
44
+ return;
45
+ }
46
+ var fileName = res.headers['content-disposition'].split(';');
47
+ var fileNameArray = fileName[1].split('=');
48
+ var fileNameStr = decodeURIComponent(fileNameArray[1]);
49
+ var blob = new Blob([res.data], {
50
+ type: 'application/vnd.ms-excel',
51
+ });
52
+ if (blob.size < 1) {
53
+ alert('导出失败,导出的内容为空!');
54
+ return;
55
+ }
56
+ var aLink = document.createElement('a');
57
+ aLink.style.display = 'none';
58
+ aLink.href = window.URL.createObjectURL(blob);
59
+ aLink.download = fileNameStr;
60
+ document.body.appendChild(aLink);
61
+ aLink.click();
62
+ document.body.removeChild(aLink);
63
+ });
64
+ };
65
+ return React.createElement(Button, { onClick: onClickExport }, "\u5BFC\u51FA");
66
+ };
67
+ export default Export;
@@ -9,6 +9,10 @@ interface IProps {
9
9
  ZT_FILE_BASEURL: string;
10
10
  token: string;
11
11
  index: number;
12
+ queryCompareTaskUrl?: string;
13
+ downloadCompareFileUrl?: string;
14
+ taskId: any;
15
+ request?: any;
12
16
  }
13
17
  declare const CompareResult: React.FC<IProps>;
14
18
  export default CompareResult;
@@ -11,9 +11,24 @@ import { Button } from '../../../../index';
11
11
  // 自定义组件
12
12
  import AttachOperation from './AttachOperation';
13
13
  var CompareResult = function (_a) {
14
- var record = _a.record, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, token = _a.token, index = _a.index;
14
+ var record = _a.record, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, token = _a.token, index = _a.index, taskId = _a.taskId, queryCompareTaskUrl = _a.queryCompareTaskUrl, downloadCompareFileUrl = _a.downloadCompareFileUrl, request = _a.request;
15
15
  var onClickHandle = function () {
16
16
  console.log('查看比对结果', index, record);
17
+ request({
18
+ url: queryCompareTaskUrl + "/" + taskId,
19
+ method: 'GET',
20
+ }).then(function (res) {
21
+ if (res.status === 200 &&
22
+ res.data.code === 200 &&
23
+ res.data.success === true) {
24
+ request({
25
+ url: downloadCompareFileUrl + "/" + taskId,
26
+ method: 'GET',
27
+ }).then(function (res) {
28
+ //TODO
29
+ });
30
+ }
31
+ });
17
32
  };
18
33
  return (React.createElement("div", null,
19
34
  React.createElement("div", { className: "signatures-template" },
@@ -8,9 +8,9 @@ import React from 'react';
8
8
  import { Checkbox } from '../../../../index';
9
9
  var ElectronicSeal = function (_a) {
10
10
  var electronicList = _a.electronicList, value = _a.value, onChange = _a.onChange;
11
- return (React.createElement(Checkbox.Group, { value: value, onChange: onChange, className: "flex-checkbox-group" }, Array.isArray(electronicList) &&
11
+ return (React.createElement(Checkbox.Group, { defaultValue: value, onChange: onChange, className: "flex-checkbox-group" }, Array.isArray(electronicList) &&
12
12
  electronicList.map(function (item) {
13
- return React.createElement(Checkbox, { key: item.name }, item.name);
13
+ return (React.createElement(Checkbox, { key: item.name, value: item.name }, item.name));
14
14
  })));
15
15
  };
16
16
  export default ElectronicSeal;
@@ -17,7 +17,7 @@ var QunjSeal = function (_a) {
17
17
  var form = Form.useForm()[0];
18
18
  useEffect(function () {
19
19
  if (value) {
20
- form.setFields(value);
20
+ form.setFieldsValue(value);
21
21
  }
22
22
  }, [value, form]);
23
23
  var onSealCheckboxHandle = function (sealList) {
@@ -11,6 +11,9 @@ interface IProps {
11
11
  index: number;
12
12
  /** 点击客户样板 */
13
13
  openCustomerModalHandle?: any;
14
+ compareTaskUrl?: string;
15
+ getTaskId: (id: any) => void;
16
+ request?: any;
14
17
  }
15
18
  declare const TemplateAttach: React.FC<IProps>;
16
19
  export default TemplateAttach;
@@ -11,13 +11,29 @@ import { Button } from '../../../../index';
11
11
  // 自定义组件
12
12
  import AttachOperation from './AttachOperation';
13
13
  var TemplateAttach = function (_a) {
14
- var record = _a.record, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, token = _a.token, openCustomerModalHandle = _a.openCustomerModalHandle, index = _a.index;
14
+ var record = _a.record, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, token = _a.token, openCustomerModalHandle = _a.openCustomerModalHandle, index = _a.index, compareTaskUrl = _a.compareTaskUrl, request = _a.request, getTaskId = _a.getTaskId;
15
+ var onClickHandle = function () {
16
+ console.log('合同比对', index, record);
17
+ var params = {
18
+ leftAttachId: record.attachId,
19
+ rightAttachId: record.templateAttachId,
20
+ };
21
+ request({
22
+ url: compareTaskUrl + "/" + params.leftAttachId + "/" + params.rightAttachId,
23
+ method: 'GET',
24
+ }).then(function (res) {
25
+ var _a;
26
+ if (res.status === 200 && res.data.code === 200) {
27
+ getTaskId((_a = res.data.data) === null || _a === void 0 ? void 0 : _a.taskId);
28
+ }
29
+ });
30
+ };
15
31
  return (React.createElement("div", null,
16
32
  React.createElement("div", { className: "signatures-template" },
17
33
  React.createElement(Button, { type: "link", onClick: function () {
18
34
  openCustomerModalHandle && openCustomerModalHandle(index);
19
35
  } }, "\u9009\u62E9\u5BA2\u6237\u6837\u677F"),
20
- React.createElement(Button, { type: "primary" }, "\u5408\u540C\u6BD4\u5BF9")),
36
+ React.createElement(Button, { type: "primary", onClick: onClickHandle }, "\u5408\u540C\u6BD4\u5BF9")),
21
37
  (record === null || record === void 0 ? void 0 : record.templateAttachId) && (React.createElement(AttachOperation, { ZT_API_BASEURL: ZT_API_BASEURL, ZT_FILE_BASEURL: ZT_FILE_BASEURL, token: token, attachId: record === null || record === void 0 ? void 0 : record.templateAttachId, attachName: record === null || record === void 0 ? void 0 : record.templateAttachName, attachSize: record === null || record === void 0 ? void 0 : record.templateAttachSize }))));
22
38
  };
23
39
  export default TemplateAttach;
@@ -17,7 +17,7 @@ export function useRecords(fileList) {
17
17
  export function useQunjData(data) {
18
18
  var _a = useState([]), qunjSeal = _a[0], setQunjSeal = _a[1];
19
19
  useEffect(function () {
20
- if (Array.isArray(data)) {
20
+ if (typeof data === 'object') {
21
21
  setQunjSeal(data);
22
22
  }
23
23
  }, [data]);
@@ -38,7 +38,7 @@ import { getToken } from 'ztxkutils/dist/authority';
38
38
  * 实现受控,接收一个附件列表
39
39
  */
40
40
  var Sinatures = function (_a) {
41
- var isUpdate = _a.isUpdate, fileList = _a.fileList, qunjSeal = _a.qunjSeal, qunjSealList = _a.qunjSealList, qunjSealChange = _a.qunjSealChange, electronicSeal = _a.electronicSeal, electronicSealList = _a.electronicSealList, electronicSealChange = _a.electronicSealChange, handleRef = _a.handleRef, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, systemCode = _a.systemCode, token = _a.token, openCustomerModalHandle = _a.openCustomerModalHandle, fileTypeList = _a.fileTypeList;
41
+ var isUpdate = _a.isUpdate, fileList = _a.fileList, qunjSeal = _a.qunjSeal, qunjSealList = _a.qunjSealList, qunjSealChange = _a.qunjSealChange, electronicSeal = _a.electronicSeal, electronicSealList = _a.electronicSealList, electronicSealChange = _a.electronicSealChange, handleRef = _a.handleRef, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, systemCode = _a.systemCode, token = _a.token, openCustomerModalHandle = _a.openCustomerModalHandle, fileTypeList = _a.fileTypeList, request = _a.request, compareTaskUrl = _a.compareTaskUrl, queryCompareTaskUrl = _a.queryCompareTaskUrl, downloadCompareFileUrl = _a.downloadCompareFileUrl;
42
42
  var authToken = token || getToken() || '';
43
43
  // 如果上传,需要传入系统的code
44
44
  var uploadData = useMemo(function () { return (systemCode ? { system: systemCode } : {}); }, [systemCode]);
@@ -47,16 +47,32 @@ var Sinatures = function (_a) {
47
47
  // 组件内部管理的群杰数据
48
48
  var _c = useQunjData(qunjSeal), innerQunjSeal = _c.qunjSeal, setQunjSeal = _c.setQunjSeal;
49
49
  // 组件内部管理的电子印章数据
50
- var _d = useElectronicData(qunjSeal), innerElectronicSeal = _d.electronicSeal, setElectronicSeal = _d.setElectronicSeal;
50
+ var _d = useElectronicData(electronicSeal), innerElectronicSeal = _d.electronicSeal, setElectronicSeal = _d.setElectronicSeal;
51
+ var _e = useState(null), taskId = _e[0], setTaskId = _e[1];
52
+ /** 获取taskId */
53
+ var getTaskId = function (id) {
54
+ setTaskId(id);
55
+ };
51
56
  var columns = [
52
57
  {
53
58
  title: '附件类型',
54
59
  key: 'attachType',
55
60
  dataIndex: 'attachType',
56
- width: 120,
57
- render: function (text, record, index) { return (React.createElement(EnhanceSelect, { value: text, list: fileTypeList, titleKey: "dictValue", dataKey: "dictKey", dropdownMatchSelectWidth: 160, onChange: function (value, option, fullData) {
58
- onFileTypeChange({ value: value, option: option, fullData: fullData }, index);
59
- } })); },
61
+ render: function (text, record, index) { return (React.createElement("div", { style: { width: 160 } },
62
+ React.createElement(EnhanceSelect, { value: text, list: fileTypeList, titleKey: "dictValue", dataKey: "dictKey", dropdownMatchSelectWidth: 160, onChange: function (value, option, fullData) {
63
+ onFileTypeChange({ value: value, option: option, fullData: fullData }, index);
64
+ } }))); },
65
+ },
66
+ {
67
+ title: '存入样板',
68
+ key: 'isCustomerReference',
69
+ dataIndex: 'isCustomerReference',
70
+ width: 70,
71
+ render: function (text, record, index) {
72
+ return (React.createElement(Checkbox, { checked: text, onChange: function (e) {
73
+ return onCheckboxChangeHandle(e, 'isCustomerReference', index);
74
+ } }));
75
+ },
60
76
  },
61
77
  {
62
78
  title: '附件',
@@ -73,23 +89,23 @@ var Sinatures = function (_a) {
73
89
  dataIndex: 'templateAttachId',
74
90
  width: 220,
75
91
  render: function (text, record, index) {
76
- return (React.createElement(TemplateAttach, { record: record, ZT_API_BASEURL: ZT_API_BASEURL, ZT_FILE_BASEURL: ZT_FILE_BASEURL, token: authToken, index: index, openCustomerModalHandle: openCustomerModalHandle }));
92
+ return (React.createElement(TemplateAttach, { record: record, request: request, compareTaskUrl: compareTaskUrl, ZT_API_BASEURL: ZT_API_BASEURL, ZT_FILE_BASEURL: ZT_FILE_BASEURL, token: authToken, index: index, openCustomerModalHandle: openCustomerModalHandle, getTaskId: getTaskId }));
77
93
  },
78
94
  },
79
95
  {
80
96
  title: '合同比对结果',
81
97
  key: 'compareAttachId',
82
98
  dataIndex: 'compareAttachId',
83
- width: 220,
99
+ width: 100,
84
100
  render: function (text, record, index) {
85
- return (React.createElement(CompareResult, { record: record, ZT_API_BASEURL: ZT_API_BASEURL, ZT_FILE_BASEURL: ZT_FILE_BASEURL, token: authToken, index: index }));
101
+ return (React.createElement(CompareResult, { record: record, ZT_API_BASEURL: ZT_API_BASEURL, ZT_FILE_BASEURL: ZT_FILE_BASEURL, token: authToken, index: index, request: request, queryCompareTaskUrl: queryCompareTaskUrl, downloadCompareFileUrl: downloadCompareFileUrl, taskId: taskId }));
86
102
  },
87
103
  },
88
104
  {
89
105
  title: '是否添加水印',
90
106
  key: 'isWatermark',
91
107
  dataIndex: 'isWatermark',
92
- width: 120,
108
+ width: 100,
93
109
  render: function (text, record, index) {
94
110
  return (React.createElement(Checkbox, { checked: text, onChange: function (e) { return onCheckboxChangeHandle(e, 'isWatermark', index); } }, "\u662F"));
95
111
  },
@@ -133,8 +149,8 @@ var Sinatures = function (_a) {
133
149
  },
134
150
  ];
135
151
  // 上传组件的数据
136
- var _e = useState(), originFileList = _e[0], setOriginFileList = _e[1];
137
- // 是否添加水印 电子印章发生改变触发事件
152
+ var _f = useState(), originFileList = _f[0], setOriginFileList = _f[1];
153
+ // 是否存入样板 添加水印 电子印章发生改变触发事件
138
154
  function onCheckboxChangeHandle(e, type, index) {
139
155
  setRecords(function (preRecords) {
140
156
  var _a;
@@ -148,7 +164,7 @@ var Sinatures = function (_a) {
148
164
  var value = _a.value, option = _a.option, fullData = _a.fullData;
149
165
  setRecords(function (preRecords) {
150
166
  var newRecords = preRecords.slice();
151
- newRecords.splice(index, 1, __assign(__assign({}, newRecords[index]), { attachType: fullData.dictKey, attachTypeName: fullData.dictValue }));
167
+ newRecords.splice(index, 1, __assign(__assign({}, newRecords[index]), { attachType: fullData === null || fullData === void 0 ? void 0 : fullData.dictKey, attachTypeName: fullData === null || fullData === void 0 ? void 0 : fullData.dictValue }));
152
168
  return newRecords;
153
169
  });
154
170
  }
@@ -207,11 +223,13 @@ var Sinatures = function (_a) {
207
223
  return newRecords;
208
224
  });
209
225
  },
226
+ /** 获取盖章参数 */
227
+ getParams: function () { return ({}); },
210
228
  }); });
211
229
  return (React.createElement(React.Fragment, null,
212
230
  isUpdate && (React.createElement(Upload, { apiBaseUrl: ZT_API_BASEURL, method: "post", showTable: false, showTip: false, headers: {
213
231
  'Zmdms-Auth': authToken,
214
232
  }, data: uploadData, authToken: authToken, callback: uploadCallbackFn, originFileList: originFileList })),
215
- React.createElement(Table, { columns: columns, rowKey: "attachId", dataSource: records })));
233
+ React.createElement(Table, { columns: columns, rowKey: "attachId", dataSource: records, scroll: { x: true } })));
216
234
  };
217
235
  export default Sinatures;
@@ -30,7 +30,7 @@ export interface IProps {
30
30
  /** 附件列表 */
31
31
  fileList?: IFileItem[];
32
32
  /** 已选中群杰印章列表 */
33
- qunjSeal?: IQunjProps[];
33
+ qunjSeal?: IQunjProps;
34
34
  /** 当前群杰所有印章列表 */
35
35
  qunjSealList?: any[];
36
36
  /** 群杰印章修改事件 */
@@ -55,4 +55,12 @@ export interface IProps {
55
55
  openCustomerModalHandle?: any;
56
56
  /** 附件类型 */
57
57
  fileTypeList?: any;
58
+ /** 发送接口请求的方法 */
59
+ request?: any;
60
+ /** 发起比对任务url */
61
+ compareTaskUrl?: string;
62
+ /** 比对任务状态查询url */
63
+ queryCompareTaskUrl?: string;
64
+ /** 比对文件下载url */
65
+ downloadCompareFileUrl?: string;
58
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",