ztxkui 3.1.15 → 3.1.18

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.
Files changed (31) hide show
  1. package/dist/DemoCom/CodeQueryDemo.d.ts +3 -0
  2. package/dist/DemoCom/CodeQueryDemo.js +56 -0
  3. package/dist/DemoCom/SinaturesDemo.js +55 -34
  4. package/dist/components/business/CodeQuery/component/SearchForm.d.ts +8 -0
  5. package/dist/components/business/CodeQuery/component/SearchForm.js +104 -0
  6. package/dist/components/business/CodeQuery/component/TableList.d.ts +6 -0
  7. package/dist/components/business/CodeQuery/component/TableList.js +41 -0
  8. package/dist/components/business/CodeQuery/hooks.d.ts +9 -0
  9. package/dist/components/business/CodeQuery/hooks.js +74 -0
  10. package/dist/components/business/CodeQuery/index.d.ts +13 -0
  11. package/dist/components/business/CodeQuery/index.js +38 -0
  12. package/dist/components/business/Signatures/components/CompareResult.d.ts +0 -1
  13. package/dist/components/business/Signatures/components/CompareResult.js +33 -20
  14. package/dist/components/business/Signatures/components/ElectronicSeal.d.ts +4 -1
  15. package/dist/components/business/Signatures/components/ElectronicSeal.js +27 -5
  16. package/dist/components/business/Signatures/components/QunjSeal.d.ts +6 -1
  17. package/dist/components/business/Signatures/components/QunjSeal.js +37 -14
  18. package/dist/components/business/Signatures/components/SealCheckbox.d.ts +5 -1
  19. package/dist/components/business/Signatures/components/SealCheckbox.js +27 -10
  20. package/dist/components/business/Signatures/components/TemplateAttach.d.ts +1 -5
  21. package/dist/components/business/Signatures/components/TemplateAttach.js +38 -19
  22. package/dist/components/business/Signatures/hooks.js +1 -1
  23. package/dist/components/business/Signatures/index.js +154 -71
  24. package/dist/components/business/Signatures/props.d.ts +28 -17
  25. package/dist/{DemoCom/Template.d.ts → components/business/Template/index.d.ts} +3 -0
  26. package/dist/{DemoCom/Template.js → components/business/Template/index.js} +41 -33
  27. package/dist/index.css +20 -8
  28. package/dist/index.css.map +1 -1
  29. package/dist/index.d.ts +1 -0
  30. package/dist/index.js +5 -0
  31. package/package.json +95 -95
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const CodeQueryDemo: React.FC;
3
+ export default CodeQueryDemo;
@@ -0,0 +1,56 @@
1
+ import { Button } from 'antd';
2
+ import React, { useCallback, useEffect, useState } from 'react';
3
+ import CodeQuery from '../components/business/CodeQuery';
4
+ import { stringify } from 'qs';
5
+ // const ListConst = [
6
+ // { dictKey: '01', dictValue: '值1' },
7
+ // { dictKey: '02', dictValue: '值2' },
8
+ // ];
9
+ function request(options) {
10
+ return fetch("http://192.168.0.83:8000/" + options.url + "?" + stringify(options.params), // http://192.168.0.83:8000
11
+ {
12
+ headers: {
13
+ 'Zmdms-Auth': 'bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJtZW1iZXJfdHlwZSI6MSwiaGFuZGxlX2hyX3Bob25lIjpudWxsLCJyZXN1bWVfZGF0ZSI6bnVsbCwidXNlcl9uYW1lIjoiY2hhaXl1ZmVuZyIsImVtcF9uYW1lIjoi5ZSQ5piKIiwiZW1wX251bWJlciI6IjAwMDE3MTA0IiwiaW10X2lkIjpudWxsLCJyZWFsX25hbWUiOiLmn7Tlrofls7AiLCJjbGllbnRfdHlwZSI6IndlYiIsImRhdGFfcm9sZV9pZCI6IjEzNDU5Nzg1MDUzMDIwNTY5NjIiLCJjbGllbnRfaWQiOiJzd29yZCIsInVzZXJfdHlwZSI6IndlYiIsInJvbGVfaWQiOiIxNDQ2ODE5NDYzNjkzODQ0NDgyIiwicG9zdF9uYW1lIjpudWxsLCJzY29wZSI6WyJhbGwiXSwiaW50ZXJ2aWV3X2lkIjpudWxsLCJleHAiOjE2NTgzNzE3NjAsIm9yZ19uYW1lIjpudWxsLCJqdGkiOiJhNGViNTI1MC0yNWQyLTRhNTItOTVjYy02NTEzZDc3OWYyZjIiLCJtZW1iZXJfaWQiOjE0NjMzOTY2NjQwNjkyNDI4ODIsImNvbXBhbnlfaWQiOjEzOTcwNzQ2MDU0MTI2OTYwNjYsInN5c3RlbV9pZCI6bnVsbCwiZGVwdF9uYW1lIjoi5Lia5Yqh5LiA6YOoIiwiYXZhdGFyIjoiIiwiZGF0YV9yb2xlX25hbWUiOiJhZG1pbiIsImF1dGhvcml0aWVzIjpbImFkbWluaXN0cmF0b3IiXSwicm9sZV9uYW1lIjoiYWRtaW5pc3RyYXRvciIsInJlc3VtZV90ZW1wbGF0ZSI6bnVsbCwibGljZW5zZSI6InBvd2VyZWQgYnkgem1kbXMiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IjE0OTkyODkzNDQyNzE2NzUzOTQiLCJvcmdfaWQiOm51bGwsIm5pY2tfbmFtZSI6IuaftOWuh-WzsCIsImNvbXBhbnlfbmFtZSI6Iua1meWVhuS4reaLk-mbhuWboueJqea1geenkeaKgOaciemZkOWFrOWPuCIsImRlcHRfaWQiOiIxMzk3MDgxOTMwMzI4NDI0NDQ5IiwiaGFuZGxlX2hyX25hbWUiOm51bGwsImFjY291bnQiOiJjaGFpeXVmZW5nIiwicmVzdW1lX2lkIjpudWxsfQ.Zj700_ir0EI0Acja2EXuBp4IW5jvIbqxnluHOChhVb8',
14
+ },
15
+ method: options.method,
16
+ }).then(function (response) {
17
+ return response.json().then(function (res) {
18
+ // 将数据格式改成和项目中相同的格式
19
+ var result = {
20
+ status: res.code,
21
+ data: {
22
+ code: res.code,
23
+ data: res.data,
24
+ msg: res.msg,
25
+ },
26
+ };
27
+ return result;
28
+ });
29
+ });
30
+ }
31
+ var CodeQueryDemo = function () {
32
+ var _a = useState(false), visible = _a[0], setVisible = _a[1];
33
+ var _b = useState([]), list = _b[0], setList = _b[1];
34
+ // 获取下拉框列表
35
+ useEffect(function () {
36
+ request({
37
+ url: "api/zmdms-mdm-data/dict-biz/dictionary",
38
+ method: 'GET',
39
+ params: { code: 'mdm_code_type' },
40
+ }).then(function (res) {
41
+ var _a;
42
+ console.log('下拉框字典的res =', res);
43
+ setList(((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.data) || []);
44
+ });
45
+ // setList(ListConst);
46
+ }, []);
47
+ var onCancelHandle = useCallback(function () {
48
+ setVisible(false);
49
+ }, []);
50
+ return (React.createElement(React.Fragment, null,
51
+ React.createElement(Button, { onClick: function () {
52
+ setVisible(true);
53
+ } }, "\u663E\u793A"),
54
+ React.createElement(CodeQuery, { request: request, codeTypeList: list, onCancel: onCancelHandle, visible: visible })));
55
+ };
56
+ export default CodeQueryDemo;
@@ -52,22 +52,20 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
52
52
  import React, { useRef, useState } from 'react';
53
53
  // redux
54
54
  // ztxkui公共组件
55
- import { Sinatures } from '../index';
56
- import Template from './Template';
55
+ import { Sinatures, Template } from '../index';
57
56
  import { stringify } from 'qs';
58
57
  // 路由配置
59
58
  // store
60
59
  // 自定义组件
61
60
  // 其他文件
62
61
  var ZT_API_BASEURL = 'http://192.168.0.83:8000';
63
- var token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJtZW1iZXJfdHlwZSI6MSwiaGFuZGxlX2hyX3Bob25lIjpudWxsLCJyZXN1bWVfZGF0ZSI6bnVsbCwidXNlcl9uYW1lIjoi5ZGo54Sw5rW3IiwiZW1wX25hbWUiOiLlkajnhLDmtbciLCJlbXBfbnVtYmVyIjoiWUcyMjA1MDAyIiwiaW10X2lkIjpudWxsLCJyZWFsX25hbWUiOiLlkajnhLDmtbciLCJjbGllbnRfdHlwZSI6IndlYiIsImRhdGFfcm9sZV9pZCI6IjEzNDU5Nzg1MDUzMDIwNTY5NjIsMTQ2ODAzNTM1MTYyNTI4NTYzNCIsImNsaWVudF9pZCI6InN3b3JkIiwidXNlcl90eXBlIjoid2ViIiwicm9sZV9pZCI6IjE0NDY4MTk0NjM2OTM4NDQ0ODIsMTQ2NzAxNTk3NTQ4NDc2MDA2N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tZSI6ImFkbWluaXN0cmF0b3IsdXNlcixhZG1pbiIsInJlc3VtZV90ZW1wbGF0ZSI6bnVsbCwibGljZW5zZSI6InBvd2VyZWQgYnkgem1kbXMiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IjE1MjYxMTEzMTgwNDYwNjg3MzciLCJvcmdfaWQiOjE0NTc1Mjc3NjU5MTg1MTUyMDEsIm5pY2tfbmFtZSI6IuWRqOeEsOa1tyIsImNvbXBhbnlfbmFtZSI6Iua1meWVhuS4reaLk-mbhuWbouiCoeS7veaciemZkOWFrOWPuCIsImRlcHRfaWQiOiIxNDE0ODUyODQ3MDM1MDAyODgxIiwiaGFuZGxlX2hyX25hbWUiOm51bGwsImFjY291bnQiOiLlkajnhLDmtbciLCJyZXN1bWVfaWQiOm51bGx9.GkDpjLcI1-1X2zI3MLj9XQyRXb25uaQAA_T8eKLa66w';
64
63
  /**
65
64
  * @description 封装请求方法
66
65
  */
67
- function myRequest(url, params, method) {
66
+ function myRequest(options) {
68
67
  var _this = this;
69
- if (params === void 0) { params = null; }
70
- if (method === void 0) { method = 'GET'; }
68
+ var url = options.url, _a = options.method, method = _a === void 0 ? 'GET' : _a, _b = options.params, params = _b === void 0 ? null : _b, _c = options.data, data = _c === void 0 ? null : _c;
71
69
  return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
72
70
  var headers, config, response, error_1;
73
71
  return __generator(this, function (_a) {
@@ -90,20 +88,28 @@ function myRequest(url, params, method) {
90
88
  method: method,
91
89
  headers: __assign({ 'Content-Type': 'application/json', Authorization: 'Basic c3dvcmQ6c3dvcmRfc2VjcmV0' }, config.headers),
92
90
  };
93
- if (params) {
94
- config = __assign(__assign({}, config), { body: JSON.stringify(params) });
91
+ if (data) {
92
+ config = __assign(__assign({}, config), { body: JSON.stringify(data) });
95
93
  }
96
94
  }
97
95
  _a.label = 1;
98
96
  case 1:
99
97
  _a.trys.push([1, 3, , 4]);
100
- return [4 /*yield*/, fetch(ZT_API_BASEURL + "/" + url, __assign({}, config))];
98
+ return [4 /*yield*/, fetch("" + ZT_API_BASEURL + url, __assign({}, config))];
101
99
  case 2:
102
100
  response = _a.sent();
103
101
  response
104
102
  .json()
105
103
  .then(function (res) {
106
- resolve(res);
104
+ var result = {
105
+ status: res.code,
106
+ data: {
107
+ code: res.code,
108
+ data: res.data,
109
+ msg: res.msg,
110
+ },
111
+ };
112
+ resolve(result);
107
113
  })
108
114
  .catch(function (error) {
109
115
  reject(error);
@@ -118,6 +124,7 @@ function myRequest(url, params, method) {
118
124
  });
119
125
  }); });
120
126
  }
127
+ /** 已选择的附件列表 */
121
128
  var list = [
122
129
  {
123
130
  attachId: '1326475920778194945',
@@ -137,37 +144,26 @@ var list = [
137
144
  templateAttachName: '模板文件1.jpg',
138
145
  },
139
146
  ];
140
- var fileTypeList = [
141
- { dictKey: '001', dictValue: '合同本身' },
142
- { dictKey: '002', dictValue: '担保文件' },
143
- { dictKey: '003', dictValue: '客户资信资料' },
144
- { dictKey: '004', dictValue: '纪要' },
145
- { dictKey: '005', dictValue: '授权类' },
146
- ];
147
- var qunjSealList = [
148
- { name: '浙商中拓集团股份有限公司合同章' },
149
- { name: '浙江中拓供应链管理有限公司合同章' },
150
- ];
147
+ /** 已选中群杰印章信息 */
151
148
  var qunjSeal = {
152
149
  code: '222',
153
150
  contractNum: 4444,
154
- sealMode: '2',
155
- sealList: [
151
+ isTakeOut: '1',
152
+ details: [
156
153
  {
157
- name: '浙商中拓集团股份有限公司合同章',
154
+ sealName: '浙商中拓(物流金融业务专用章)',
155
+ sealNo: '2021030911448826',
156
+ sealCount: 2,
158
157
  },
159
158
  {
160
- name: '浙江中拓供应链管理有限公司合同章',
159
+ sealName: '浙商中拓集团(湖南)有限公司合同专用章(杭州)',
160
+ sealNo: '202003041053255P',
161
+ sealCount: 3,
161
162
  },
162
163
  ],
163
164
  };
164
- var electronicSealList = [
165
- { name: '浙商中拓集团(上海)合同专用章', id: '2980019783467188885' },
166
- { name: '浙商/浙江中拓法人签字章', id: '2980019871597904544' },
167
- ];
168
- var electronicSeal = [
169
- { name: '浙商中拓集团(上海)合同专用章', id: '2980019783467188885' },
170
- ];
165
+ /** 已勾选的契约锁印章id列表 */
166
+ var electronicSeal = ['2969500030189355150'];
171
167
  var SinaturesDemo = function () {
172
168
  var _a = useState(0), rIndex = _a[0], setRIndex = _a[1];
173
169
  var openCustomerModalHandle = function (index) {
@@ -177,9 +173,34 @@ var SinaturesDemo = function () {
177
173
  };
178
174
  var handleRef = useRef({});
179
175
  var templateRef = useRef({});
176
+ /** 是否可编辑 1可编辑 0不可编辑 */
177
+ var canEdit = 1;
178
+ /** 是否展示添加附件按钮 0不展示 1展示 */
179
+ var showAddBtn = 0;
180
+ var params = {
181
+ needQj: 1,
182
+ needDg: 1,
183
+ needQys: 1,
184
+ isUpload: !!showAddBtn && !!canEdit,
185
+ fileList: list,
186
+ qunjSeal: qunjSeal,
187
+ electronicSeal: electronicSeal,
188
+ ZT_API_BASEURL: ZT_API_BASEURL,
189
+ ZT_FILE_BASEURL: 'http://192.168.0.83:88',
190
+ token: token,
191
+ flowId: 1231231,
192
+ deptId: '1262999321077198849',
193
+ canEdit: canEdit,
194
+ caseId: 'bf21be574ce741398e8f0769b61ac983',
195
+ contractId: '2982140578506318463',
196
+ docAttachMap: {},
197
+ checkAttachIdList: [],
198
+ documentIdList: [],
199
+ };
180
200
  return (React.createElement("div", null,
181
- React.createElement(Sinatures, { isUpdate: true, fileList: list, fileTypeList: fileTypeList, qunjSealList: qunjSealList, qunjSeal: qunjSeal, electronicSealList: electronicSealList, electronicSeal: electronicSeal, ZT_API_BASEURL: ZT_API_BASEURL, 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" }),
182
- React.createElement(Template, { handleRef: handleRef, rIndex: rIndex, templateRef: templateRef }),
201
+ React.createElement(Sinatures, __assign({ openCustomerModalHandle: openCustomerModalHandle, handleRef: handleRef, request: myRequest }, params)),
202
+ React.createElement(Template, { handleRef: handleRef, rIndex: rIndex, templateRef: templateRef, request: myRequest, deptId: "1262999321077198849", memberId: "3334" // 客商id
203
+ }),
183
204
  React.createElement("button", { onClick: function () {
184
205
  var _a;
185
206
  console.log((_a = handleRef.current) === null || _a === void 0 ? void 0 : _a.getData());
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ codeTypeList: any[];
4
+ onSearch?: (params: any) => void;
5
+ initParams?: any;
6
+ }
7
+ declare const _default: React.NamedExoticComponent<IProps>;
8
+ export default _default;
@@ -0,0 +1,104 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (_) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import React, { memo, useEffect, useCallback } from 'react';
38
+ import { Form, Input, message, EnhanceSelect } from '../../../../index';
39
+ import SearchContainer from '../../SearchContainer';
40
+ var SearchLeft = SearchContainer.SearchLeft, SearchRight = SearchContainer.SearchRight, Item = SearchContainer.SearchItem;
41
+ var SearchForm = function (_a) {
42
+ var codeTypeList = _a.codeTypeList, onSearch = _a.onSearch, initParams = _a.initParams;
43
+ var form = Form.useForm()[0];
44
+ /**提交验证 */
45
+ var vallidateFn = useCallback(function (callback) { return __awaiter(void 0, void 0, void 0, function () {
46
+ var err_1, errorFields;
47
+ var _a;
48
+ return __generator(this, function (_b) {
49
+ switch (_b.label) {
50
+ case 0:
51
+ _b.trys.push([0, 2, , 3]);
52
+ // 表单验证
53
+ return [4 /*yield*/, form.validateFields()];
54
+ case 1:
55
+ // 表单验证
56
+ _b.sent();
57
+ // 验证成功 提交数据
58
+ callback === null || callback === void 0 ? void 0 : callback();
59
+ return [3 /*break*/, 3];
60
+ case 2:
61
+ err_1 = _b.sent();
62
+ errorFields = err_1.errorFields;
63
+ message.warning(((_a = errorFields === null || errorFields === void 0 ? void 0 : errorFields[0]) === null || _a === void 0 ? void 0 : _a.errors) + '');
64
+ return [3 /*break*/, 3];
65
+ case 3: return [2 /*return*/];
66
+ }
67
+ });
68
+ }); }, [form]);
69
+ /**
70
+ * 初始化赋值
71
+ */
72
+ useEffect(function () {
73
+ initParams && form.setFieldsValue(initParams);
74
+ }, [form, initParams]);
75
+ /**
76
+ * 搜索数据
77
+ */
78
+ function onSearchHandle() {
79
+ return __awaiter(this, void 0, void 0, function () {
80
+ return __generator(this, function (_a) {
81
+ vallidateFn(function () {
82
+ var currentParams = form.getFieldsValue();
83
+ onSearch === null || onSearch === void 0 ? void 0 : onSearch(currentParams);
84
+ });
85
+ return [2 /*return*/];
86
+ });
87
+ });
88
+ }
89
+ /**
90
+ * 重置表单数据
91
+ */
92
+ function onResetHandle() {
93
+ form.resetFields();
94
+ }
95
+ return (React.createElement(Form, { name: "codeQuery-making", form: form },
96
+ React.createElement(SearchContainer, null,
97
+ React.createElement(SearchLeft, null,
98
+ React.createElement(Item, { name: "type", label: "\u7F16\u7801\u7C7B\u578B", rules: [{ required: true, message: '请填写编码类型' }] },
99
+ React.createElement(EnhanceSelect, { list: codeTypeList, titleKey: "dictValue", dataKey: "dictKey" })),
100
+ React.createElement(Item, { name: "name", label: "\u63CF\u8FF0", rules: [{ required: true, message: '请填写描述' }] },
101
+ React.createElement(Input, { allowClear: true }))),
102
+ React.createElement(SearchRight, { onSearchHandle: onSearchHandle, onResetHandle: onResetHandle }))));
103
+ };
104
+ export default memo(SearchForm);
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ records?: any;
4
+ }
5
+ declare const TableList: React.FC<IProps>;
6
+ export default TableList;
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { Table } from '../../../../index';
3
+ var tableScrollHeight = {
4
+ x: 1000,
5
+ // 44px Tab标签页,如果有则减去44px
6
+ // 85px 为表单的高度(这个是动态的)四行169,三行127,两行85,一行43
7
+ // 70px 为按钮的高度 加上 上下外边距20px,如果没有按钮,只需要减去20px
8
+ // 40px 为底部高度
9
+ // 47px 为导航栏高度
10
+ // 40px 为整体外边距
11
+ // 20px 使离底部10px
12
+ y: 'calc(50vh)',
13
+ };
14
+ var TableList = function (_a) {
15
+ var records = _a.records;
16
+ // 表格列表配置
17
+ var columns = [
18
+ {
19
+ title: '序号',
20
+ width: 62,
21
+ key: 'index',
22
+ fixed: 'left',
23
+ align: 'center',
24
+ render: function (text, record, index) { return "" + (index + 1); },
25
+ },
26
+ {
27
+ title: '编码',
28
+ width: 160,
29
+ dataIndex: 'code',
30
+ key: 'code',
31
+ },
32
+ {
33
+ title: '名字',
34
+ width: 160,
35
+ dataIndex: 'name',
36
+ key: 'name',
37
+ },
38
+ ];
39
+ return (React.createElement(Table, { columns: columns, dataSource: records || [], rowKey: "id", scroll: tableScrollHeight }));
40
+ };
41
+ export default TableList;
@@ -0,0 +1,9 @@
1
+ export declare function useCodeQueryList(params: any, request: any): {
2
+ total: number;
3
+ current: number;
4
+ pageSize: number;
5
+ loading: boolean;
6
+ records: any;
7
+ onPageChange: (current: any, size: any) => void;
8
+ initPage: () => void;
9
+ };
@@ -0,0 +1,74 @@
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
+ import { useCallback, useEffect, useState } from 'react';
13
+ import { message } from '../../../index';
14
+ // 每页多少条数据
15
+ var PAGESIZE_NUM = 10;
16
+ export function useCodeQueryList(params, request) {
17
+ var _a = useState(0), total = _a[0], setTotal = _a[1];
18
+ var _b = useState(1), current = _b[0], setCurrent = _b[1];
19
+ var _c = useState(PAGESIZE_NUM), pageSize = _c[0], setPageSize = _c[1];
20
+ var _d = useState(false), loading = _d[0], setLoading = _d[1];
21
+ var _e = useState([]), records = _e[0], setRecords = _e[1];
22
+ useEffect(function () {
23
+ if (!((params === null || params === void 0 ? void 0 : params.type) && (params === null || params === void 0 ? void 0 : params.name)))
24
+ return;
25
+ var newParams = __assign(__assign({}, params), { current: current, size: pageSize });
26
+ setLoading(true);
27
+ request({
28
+ url: 'api/zmdms-system/code-tool/get-code-list',
29
+ method: 'Get',
30
+ params: __assign({}, newParams),
31
+ })
32
+ .then(function (res) {
33
+ var _a, _b;
34
+ if (((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.code) === 200) {
35
+ var _c = ((_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.data) || {}, total_1 = _c.total, records_1 = _c.records;
36
+ setTotal(total_1);
37
+ setRecords(records_1);
38
+ }
39
+ else {
40
+ message.warning((res === null || res === void 0 ? void 0 : res.msg) || '查询失败!');
41
+ }
42
+ setLoading(false);
43
+ })
44
+ .catch(function () {
45
+ setLoading(false);
46
+ });
47
+ }, [current, pageSize, params, request]);
48
+ /**
49
+ * @description 页码更改
50
+ */
51
+ var onPageChange = useCallback(function (current, size) {
52
+ setCurrent(current);
53
+ if (size) {
54
+ setPageSize(size);
55
+ }
56
+ }, []);
57
+ /**
58
+ * @description 页码初始化
59
+ */
60
+ var initPage = useCallback(function () {
61
+ setTotal(0);
62
+ setCurrent(1);
63
+ setPageSize(PAGESIZE_NUM);
64
+ }, []);
65
+ return {
66
+ total: total,
67
+ current: current,
68
+ pageSize: pageSize,
69
+ loading: loading,
70
+ records: records,
71
+ onPageChange: onPageChange,
72
+ initPage: initPage,
73
+ };
74
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @author 柴宇峰
3
+ * @description 编码查询
4
+ */
5
+ import React from 'react';
6
+ interface ICodeQuery {
7
+ request: any;
8
+ onCancel: any;
9
+ codeTypeList: any[];
10
+ visible?: boolean;
11
+ }
12
+ declare const _default: React.NamedExoticComponent<ICodeQuery>;
13
+ export default _default;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @author 柴宇峰
3
+ * @description 编码查询
4
+ */
5
+ import React, { memo, useCallback, useState, useMemo } from 'react';
6
+ import { Modal, Footer } from '../../../index';
7
+ import SearchForm from './component/SearchForm';
8
+ import TableList from './component/TableList';
9
+ import { useCodeQueryList } from './hooks';
10
+ var CodeQuery = function (_a) {
11
+ var request = _a.request, onCancel = _a.onCancel, _b = _a.codeTypeList, codeTypeList = _b === void 0 ? [] : _b, _c = _a.visible, visible = _c === void 0 ? false : _c;
12
+ var _d = useState({}), params = _d[0], setParams = _d[1];
13
+ var _e = useCodeQueryList(params, request), total = _e.total, current = _e.current, pageSize = _e.pageSize, loading = _e.loading, records = _e.records, onPageChange = _e.onPageChange;
14
+ var onSearchHandle = useCallback(function (newParams) {
15
+ setParams({
16
+ type: newParams.type,
17
+ name: newParams.name,
18
+ });
19
+ }, []);
20
+ /**
21
+ * @description 页码改变触发的事件
22
+ */
23
+ var footerDom = useMemo(function () { return [
24
+ {
25
+ DOMType: 'pagination',
26
+ total: total,
27
+ current: current,
28
+ pageSize: pageSize,
29
+ onChange: onPageChange,
30
+ },
31
+ ]; }, [total, current, pageSize, onPageChange]);
32
+ return (React.createElement(React.Fragment, null,
33
+ React.createElement(Modal, { title: "\u7F16\u7801\u67E5\u8BE2\u5DE5\u5177", width: "80%", loading: loading, visible: visible, onCancel: onCancel, maskClosable: false, footer: null, style: { marginTop: '-50px' } },
34
+ React.createElement(SearchForm, { codeTypeList: codeTypeList, onSearch: onSearchHandle }),
35
+ React.createElement(TableList, { records: records }),
36
+ React.createElement(Footer, { footerDom: footerDom, className: "select-footer" }))));
37
+ };
38
+ export default memo(CodeQuery);
@@ -9,7 +9,6 @@ interface IProps {
9
9
  ZT_FILE_BASEURL: string;
10
10
  token: string;
11
11
  index: number;
12
- queryCompareTaskUrl?: string;
13
12
  request?: any;
14
13
  }
15
14
  declare const CompareResult: React.FC<IProps>;
@@ -2,35 +2,48 @@
2
2
  * @author 陈亚雄
3
3
  * @description 合同比对结果
4
4
  */
5
- import React from 'react';
5
+ import React, { useState } from 'react';
6
6
  // redux
7
7
  // ztxkui公共组件
8
8
  import { Button, message } from '../../../../index';
9
9
  import { previewFile } from '../utils';
10
- // 路由配置
11
- // store
12
- // 自定义组件
13
- import AttachOperation from './AttachOperation';
14
10
  var CompareResult = function (_a) {
15
- var record = _a.record, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, token = _a.token, index = _a.index, queryCompareTaskUrl = _a.queryCompareTaskUrl, request = _a.request;
11
+ var record = _a.record, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, token = _a.token, index = _a.index, request = _a.request;
12
+ // 设置查看比对结果按钮的loading状态
13
+ var _b = useState(false), loading = _b[0], setLoading = _b[1];
16
14
  var onClickHandle = function () {
17
15
  console.log('查看比对结果', index, record);
18
- var task_id = record.taskId;
19
- if (task_id) {
20
- request(queryCompareTaskUrl + "/" + task_id, '', 'GET').then(function (res) {
21
- if (res.code === 200) {
22
- var url = ZT_API_BASEURL + "/zmdms-resource/seal/download-compare-file/" + task_id + "?Zmdms-Auth=" + token + "&fullfilename=1.zip";
23
- previewFile(ZT_FILE_BASEURL, url);
24
- }
25
- });
16
+ setLoading(true);
17
+ try {
18
+ var task_id_1 = record.taskId;
19
+ if (task_id_1) {
20
+ // 比对任务状态查询
21
+ request({
22
+ url: "/api/zmdms-resource/seal/query-compare-task/" + task_id_1,
23
+ method: 'GET',
24
+ }).then(function (res) {
25
+ if (res.status === 200 && res.data.code === 200) {
26
+ var url = ZT_API_BASEURL + "/zmdms-resource/seal/download-compare-file/" + task_id_1 + "?Zmdms-Auth=" + token + "&fullfilename=1.zip";
27
+ // 比对文件下载
28
+ previewFile(ZT_FILE_BASEURL, url);
29
+ }
30
+ else {
31
+ message.error(res.data.msg || '出错了');
32
+ }
33
+ });
34
+ }
35
+ else {
36
+ message.info('缺少taskId');
37
+ }
26
38
  }
27
- else {
28
- message.info('请先点击合同比对获取taskId');
39
+ catch (err) {
40
+ //
41
+ }
42
+ finally {
43
+ setLoading(false);
29
44
  }
30
45
  };
31
- return (React.createElement("div", null,
32
- React.createElement("div", { className: "signatures-template" },
33
- React.createElement(Button, { type: "link", onClick: onClickHandle }, "\u67E5\u770B\u6BD4\u5BF9\u7ED3\u679C")),
34
- (record === null || record === void 0 ? void 0 : record.compareAttachId) && (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.compareAttachId, attachName: record === null || record === void 0 ? void 0 : record.compareAttachName, attachSize: record === null || record === void 0 ? void 0 : record.compareAttachSize }))));
46
+ return (React.createElement(React.Fragment, null,
47
+ React.createElement(Button, { type: "link", onClick: onClickHandle, loading: loading }, "\u67E5\u770B\u6BD4\u5BF9\u7ED3\u679C")));
35
48
  };
36
49
  export default CompareResult;
@@ -4,9 +4,12 @@
4
4
  */
5
5
  import React from 'react';
6
6
  interface IProps {
7
- electronicList?: any[];
8
7
  value?: any;
9
8
  onChange?: any;
9
+ request?: any;
10
+ flowId: number;
11
+ deptId: any;
12
+ isEdit: boolean;
10
13
  }
11
14
  declare const ElectronicSeal: React.FC<IProps>;
12
15
  export default ElectronicSeal;