ztxkui 10.0.95 → 10.0.97
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/components/TranslationButton/DownFile.d.ts +7 -0
- package/dist/components/TranslationButton/DownFile.js +97 -0
- package/dist/components/TranslationButton/PreviewFile.d.ts +5 -0
- package/dist/components/TranslationButton/PreviewFile.js +75 -0
- package/dist/components/TranslationButton/TranslationButton.d.ts +34 -0
- package/dist/components/TranslationButton/TranslationButton.js +247 -0
- package/dist/components/TranslationButton/demoComponents/index.d.ts +3 -0
- package/dist/components/TranslationButton/demoComponents/index.js +9 -0
- package/dist/components/TranslationButton/hooks.d.ts +8 -0
- package/dist/components/TranslationButton/hooks.js +143 -0
- package/dist/components/TranslationButton/index.d.ts +4 -0
- package/dist/components/TranslationButton/index.js +4 -0
- package/dist/components/Upload/utils.d.ts +8 -1
- package/dist/components/Upload/utils.js +56 -4
- package/dist/components/UploadCustom/hooks/useDg.d.ts +6 -0
- package/dist/components/UploadCustom/hooks/useDg.js +57 -0
- package/dist/components/business/Signatures/components/CodeModal.d.ts +3 -0
- package/dist/components/business/Signatures/components/CodeModal.js +159 -0
- package/dist/components/electron-signatures/content.d.ts +9 -0
- package/dist/components/electron-signatures/content.js +1126 -0
- package/dist/components/electron-signatures/demoComponents/data.d.ts +58 -0
- package/dist/components/electron-signatures/demoComponents/data.js +1307 -0
- package/dist/components/electron-signatures/demoComponents/detail.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/detail.js +283 -0
- package/dist/components/electron-signatures/demoComponents/index.d.ts +2 -0
- package/dist/components/electron-signatures/demoComponents/index.js +27 -0
- package/dist/components/electron-signatures/demoComponents/index_old.d.ts +3 -0
- package/dist/components/electron-signatures/demoComponents/index_old.js +502 -0
- package/dist/components/electron-signatures/demoComponents/jgqrd.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/jgqrd.js +135 -0
- package/dist/components/electron-signatures/demoComponents/making.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/making.js +211 -0
- package/dist/components/electron-signatures/demoComponents/makingData.d.ts +663 -0
- package/dist/components/electron-signatures/demoComponents/makingData.js +1164 -0
- package/dist/components/electron-signatures/demoComponents/newDetail.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/newDetail.js +283 -0
- package/dist/components/electron-signatures/demoComponents/preview.d.ts +3 -0
- package/dist/components/electron-signatures/demoComponents/preview.js +9 -0
- package/dist/components/electron-signatures/demoComponents/singleQjDetail.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/singleQjDetail.js +530 -0
- package/dist/components/electron-signatures/demoComponents/singleQjMaking.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/singleQjMaking.js +219 -0
- package/dist/components/electron-signatures/demoComponents/test.d.ts +6 -0
- package/dist/components/electron-signatures/demoComponents/test.js +119 -0
- package/dist/components/electron-signatures/dgComponents/contract-comparison.d.ts +39 -0
- package/dist/components/electron-signatures/dgComponents/contract-comparison.js +53 -0
- package/dist/components/electron-signatures/dgComponents/file-comparison-btn.d.ts +11 -0
- package/dist/components/electron-signatures/dgComponents/file-comparison-btn.js +180 -0
- package/dist/components/electron-signatures/dgComponents/new-contract-comparison.d.ts +45 -0
- package/dist/components/electron-signatures/dgComponents/new-contract-comparison.js +68 -0
- package/dist/components/electron-signatures/dgComponents/useContractColumns.d.ts +21 -0
- package/dist/components/electron-signatures/dgComponents/useContractColumns.js +171 -0
- package/dist/components/electron-signatures/electron-signatures-fragment.d.ts +8 -0
- package/dist/components/electron-signatures/electron-signatures-fragment.js +344 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-batch-download.d.ts +52 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-batch-download.js +513 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-detail.d.ts +8 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-detail.js +59 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-download.d.ts +16 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-download.js +89 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-firstLevelPerson.d.ts +9 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-firstLevelPerson.js +16 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item-detail.d.ts +15 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item-detail.js +16 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item.d.ts +20 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-item.js +47 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-list.d.ts +11 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-list.js +191 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-setting.d.ts +15 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-setting.js +10 -0
- package/dist/components/electron-signatures/electronComponents/last-qys-modal.d.ts +7 -0
- package/dist/components/electron-signatures/electronComponents/last-qys-modal.js +42 -0
- package/dist/components/electron-signatures/electronComponents/useCheckedSealInfoList.d.ts +3 -0
- package/dist/components/electron-signatures/electronComponents/useCheckedSealInfoList.js +45 -0
- package/dist/components/electron-signatures/electronComponents/useElectronColumns.d.ts +30 -0
- package/dist/components/electron-signatures/electronComponents/useElectronColumns.js +380 -0
- package/dist/components/electron-signatures/electronComponents/useFetchElectronData.d.ts +20 -0
- package/dist/components/electron-signatures/electronComponents/useFetchElectronData.js +169 -0
- package/dist/components/electron-signatures/electronComponents/useGetDeptInfo.d.ts +3 -0
- package/dist/components/electron-signatures/electronComponents/useGetDeptInfo.js +38 -0
- package/dist/components/electron-signatures/fileComponents/file-operation.d.ts +7 -0
- package/dist/components/electron-signatures/fileComponents/file-operation.js +67 -0
- package/dist/components/electron-signatures/fileComponents/file-type-select.d.ts +12 -0
- package/dist/components/electron-signatures/fileComponents/file-type-select.js +10 -0
- package/dist/components/electron-signatures/fileComponents/file-upload.d.ts +11 -0
- package/dist/components/electron-signatures/fileComponents/file-upload.js +146 -0
- package/dist/components/electron-signatures/fileComponents/fileUtils.d.ts +17 -0
- package/dist/components/electron-signatures/fileComponents/fileUtils.js +36 -0
- package/dist/components/electron-signatures/fileComponents/new-file-operation.d.ts +10 -0
- package/dist/components/electron-signatures/fileComponents/new-file-operation.js +73 -0
- package/dist/components/electron-signatures/fileComponents/useFetchFileTypeData.d.ts +13 -0
- package/dist/components/electron-signatures/fileComponents/useFetchFileTypeData.js +45 -0
- package/dist/components/electron-signatures/fileComponents/useFileColumns.d.ts +38 -0
- package/dist/components/electron-signatures/fileComponents/useFileColumns.js +329 -0
- package/dist/components/electron-signatures/fileComponents/useFileTypeColumns.d.ts +19 -0
- package/dist/components/electron-signatures/fileComponents/useFileTypeColumns.js +72 -0
- package/dist/components/electron-signatures/hooks/useGetQjVerifyCode.d.ts +30 -0
- package/dist/components/electron-signatures/hooks/useGetQjVerifyCode.js +134 -0
- package/dist/components/electron-signatures/hooks/useMergeRecords.d.ts +17 -0
- package/dist/components/electron-signatures/hooks/useMergeRecords.js +49 -0
- package/dist/components/electron-signatures/hooks/useParseElectronListData.d.ts +49 -0
- package/dist/components/electron-signatures/hooks/useParseElectronListData.js +111 -0
- package/dist/components/electron-signatures/hooks/useParseElectronSetting.d.ts +102 -0
- package/dist/components/electron-signatures/hooks/useParseElectronSetting.js +365 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedElectronData.d.ts +40 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedElectronData.js +139 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedQunjData.d.ts +36 -0
- package/dist/components/electron-signatures/hooks/useParseIsNeedQunjData.js +48 -0
- package/dist/components/electron-signatures/hooks/useParseQunjListData.d.ts +56 -0
- package/dist/components/electron-signatures/hooks/useParseQunjListData.js +204 -0
- package/dist/components/electron-signatures/hooks/useParseQunjSingleData.d.ts +34 -0
- package/dist/components/electron-signatures/hooks/useParseQunjSingleData.js +110 -0
- package/dist/components/electron-signatures/hooks/useParseRecords.d.ts +65 -0
- package/dist/components/electron-signatures/hooks/useParseRecords.js +165 -0
- package/dist/components/electron-signatures/index.d.ts +13 -0
- package/dist/components/electron-signatures/index.js +54 -0
- package/dist/components/electron-signatures/index_old.d.ts +9 -0
- package/dist/components/electron-signatures/index_old.js +966 -0
- package/dist/components/electron-signatures/interface.d.ts +849 -0
- package/dist/components/electron-signatures/interface.js +57 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-apply.d.ts +6 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-apply.js +8 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-check.d.ts +21 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-check.js +41 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-detail.d.ts +35 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-detail.js +267 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-list.d.ts +24 -0
- package/dist/components/electron-signatures/qunjComponents/qunj-list.js +346 -0
- package/dist/components/electron-signatures/qunjComponents/useFetchQunjData.d.ts +20 -0
- package/dist/components/electron-signatures/qunjComponents/useFetchQunjData.js +63 -0
- package/dist/components/electron-signatures/qunjComponents/useQunjColumns.d.ts +36 -0
- package/dist/components/electron-signatures/qunjComponents/useQunjColumns.js +321 -0
- package/dist/components/electron-signatures/translateComponents/TranslateButton.d.ts +10 -0
- package/dist/components/electron-signatures/translateComponents/TranslateButton.js +44 -0
- package/dist/components/electron-signatures/translateComponents/useTranslateCom.d.ts +22 -0
- package/dist/components/electron-signatures/translateComponents/useTranslateCom.js +50 -0
- package/dist/components/electron-signatures/utils.d.ts +26 -0
- package/dist/components/electron-signatures/utils.js +67 -0
- package/dist/components/utils/ZtxkContext.d.ts +16 -0
- package/dist/components/utils/ZtxkContext.js +4 -0
- package/dist/components/utils/useMemoizedFn.d.ts +6 -0
- package/dist/components/utils/useMemoizedFn.js +22 -0
- package/dist/components/utils/usePrevious.d.ts +3 -0
- package/dist/components/utils/usePrevious.js +13 -0
- package/dist/index.css +686 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +105 -87
- package/dist/request.js +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,219 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
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;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
49
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
50
|
+
import { unstable_batchedUpdates } from 'react-dom';
|
|
51
|
+
import ElectronSignatures from '../index';
|
|
52
|
+
import request from '../../../request';
|
|
53
|
+
import dayjs from 'dayjs';
|
|
54
|
+
import { cghtData2, historyData } from './makingData';
|
|
55
|
+
/**
|
|
56
|
+
* 契约锁编辑模式 每个附件,都使用一个群杰印章按钮
|
|
57
|
+
*/
|
|
58
|
+
var Making = function () {
|
|
59
|
+
var electronHandleRef = useRef();
|
|
60
|
+
var _a = useState(null), params = _a[0], setParams = _a[1];
|
|
61
|
+
var _b = useState(null), otherOptions = _b[0], setOtherOptions = _b[1];
|
|
62
|
+
useEffect(function () {
|
|
63
|
+
// 模拟接口请求
|
|
64
|
+
setTimeout(function () {
|
|
65
|
+
unstable_batchedUpdates(function () {
|
|
66
|
+
setParams(cghtData2);
|
|
67
|
+
var newHistoryData = historyData.map(function (item, index) {
|
|
68
|
+
return __assign({ dataType: "key-" + index, dataTypeName: i18next.t('历史附件-{{index}}', { index: index }) }, item);
|
|
69
|
+
});
|
|
70
|
+
setOtherOptions(newHistoryData);
|
|
71
|
+
});
|
|
72
|
+
}, 1000);
|
|
73
|
+
}, []);
|
|
74
|
+
return (React.createElement(React.Fragment, null,
|
|
75
|
+
React.createElement(ElectronSignatures, __assign({ request: request, dataTypeName: i18next.t('新附件1'), dataType: "key1", otherOptions: otherOptions, isBgColor: true, isNewQys: true,
|
|
76
|
+
// isDefaultQunj={false}
|
|
77
|
+
// 是否显示上传附件按钮
|
|
78
|
+
isShowFileUpload: true, isShowFileUploadIndependence: true,
|
|
79
|
+
// 附件类型是否允许修改
|
|
80
|
+
isAllowedPatchFileType: true,
|
|
81
|
+
// 是否显示批量下载电子签章件
|
|
82
|
+
isShowElectronBatchBtn: true,
|
|
83
|
+
// 是否显示批量下载原件
|
|
84
|
+
isShowDownloadBatchBtn: true,
|
|
85
|
+
// 是否显示双签件
|
|
86
|
+
isShowDoubleSignedBatchBtn: true, isShowChioseTemplate: true, isShowBatchDeleteBtn: true, isShowBatchDeleteBtnIndependence: true,
|
|
87
|
+
// 批量删除前的逻辑控制
|
|
88
|
+
beforeBatchDelete: function (record) {
|
|
89
|
+
console.log(record);
|
|
90
|
+
if (record.attachType === '001') {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
94
|
+
}, isShowBatchPreviewBtn: true,
|
|
95
|
+
// 是否显示附件归属
|
|
96
|
+
isShowFileTypeMerge: true,
|
|
97
|
+
// 是否群杰印章对每个附件生效
|
|
98
|
+
// isSingleQj
|
|
99
|
+
// 是否开启文档翻译功能
|
|
100
|
+
isTranslation: true, isShowSaveTemplate: true, previewUrl: "/document-translation-preview" }, params, { refreshCode: true, isQunjAddress: true, otherColumns: [
|
|
101
|
+
{
|
|
102
|
+
title: i18next.t('合同类型'),
|
|
103
|
+
dataIndex: 'contractType',
|
|
104
|
+
key: 'contractType',
|
|
105
|
+
width: 200,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
// 上传附件时处理附件数据的一个入口
|
|
109
|
+
parseCurrentUploadFile: function (file) {
|
|
110
|
+
return __assign(__assign({}, file), { isAddFile: true, isOther: '1', attachType: '001', attactTypeName: i18next.t('合同本身') });
|
|
111
|
+
},
|
|
112
|
+
// 如果是否需要契约锁不由组件内部控制 需要传递这个字段 需要配合 needQys为 0时
|
|
113
|
+
// isControlNeedQys={false}
|
|
114
|
+
// 如果默认不需要契约锁 需要传递这个属性 需要配置needQys为 0
|
|
115
|
+
defaultJustNeedQj: true, fileSplitRules: function (record) {
|
|
116
|
+
if (record.oldVersionId) {
|
|
117
|
+
return {
|
|
118
|
+
key: 'key2',
|
|
119
|
+
name: i18next.t('替换附件'),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
if (record.isAddFile) {
|
|
123
|
+
return {
|
|
124
|
+
key: 'key3',
|
|
125
|
+
name: i18next.t('补充附件'),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
key: 'key1',
|
|
130
|
+
name: i18next.t('新附件'),
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
// 按照何种排序
|
|
134
|
+
// fileSplitStringRules={['key1', 'key2']}
|
|
135
|
+
// 第二种数据类型的配置 基本外部配置 只是值可能不同
|
|
136
|
+
// otherOptions={[
|
|
137
|
+
// {
|
|
138
|
+
// dataType: 'key2',
|
|
139
|
+
// dataTypeName: '历史附件',
|
|
140
|
+
// ...params1,
|
|
141
|
+
// },
|
|
142
|
+
// ]}
|
|
143
|
+
// 数据改变时 触发
|
|
144
|
+
onValueChange: function (info) {
|
|
145
|
+
console.log(info);
|
|
146
|
+
setParams(function (preParams) {
|
|
147
|
+
var _a, _b;
|
|
148
|
+
var newParams = __assign(__assign({}, preParams), info.key1);
|
|
149
|
+
if (info.key1.fileList) {
|
|
150
|
+
newParams.fileList = (_b = (_a = info.key1) === null || _a === void 0 ? void 0 : _a.fileList) === null || _b === void 0 ? void 0 : _b.map(function (item) {
|
|
151
|
+
return __assign(__assign({}, item), { createTime: item.createTime || dayjs().format('YYYY-MM-DD HH:mm:ss') });
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
return newParams;
|
|
155
|
+
});
|
|
156
|
+
// if (info.key1) {
|
|
157
|
+
// setParams((preParams) => {
|
|
158
|
+
// return {
|
|
159
|
+
// ...preParams,
|
|
160
|
+
// ...info.key1,
|
|
161
|
+
// };
|
|
162
|
+
// });
|
|
163
|
+
// } else {
|
|
164
|
+
// setParams1((preParams1) => {
|
|
165
|
+
// return {
|
|
166
|
+
// ...preParams1,
|
|
167
|
+
// ...info.key2,
|
|
168
|
+
// };
|
|
169
|
+
// });
|
|
170
|
+
// }
|
|
171
|
+
},
|
|
172
|
+
// 组件对外暴露的一些方法 获取数据 校验方法
|
|
173
|
+
electronHandleRef: electronHandleRef, isValidateSuccess: function () {
|
|
174
|
+
// 最后会调用一个接口 验证下是否所选的电子印章都已经盖了章 如果没有盖章 就会弹出一个选择框 让用户重新选择 重新选择后 如果用户把所有未盖章的电子印章都取消勾选的话 那么就会调用这个方法 说明校验通过 可以进行下一步
|
|
175
|
+
console.log(i18next.t('最终校验通过了!!!'));
|
|
176
|
+
} })),
|
|
177
|
+
React.createElement("button", { onClick: function () {
|
|
178
|
+
setParams(function (preParams) {
|
|
179
|
+
return __assign(__assign({}, preParams), { deptId: preParams.deptId === '1514842376723976194'
|
|
180
|
+
? '1514842546870112258'
|
|
181
|
+
: '1514842376723976194' });
|
|
182
|
+
});
|
|
183
|
+
// 修改了哪个数据的部门需要清空部门下的契约锁数据
|
|
184
|
+
// electronHandleRef.current.changeDeptIdClearQysDataHandler('key1');
|
|
185
|
+
} }, i18next.t('修改部门id')),
|
|
186
|
+
React.createElement("button", { onClick: function () {
|
|
187
|
+
setParams(function (preParams) {
|
|
188
|
+
return __assign(__assign({}, preParams), { flowId: preParams.flowId === 'scm_general_yyzj_operation'
|
|
189
|
+
? 'scm_general_yyzj_common'
|
|
190
|
+
: 'scm_general_yyzj_operation' });
|
|
191
|
+
});
|
|
192
|
+
// 修改了哪个数据的部门需要清空部门下的契约锁数据
|
|
193
|
+
// electronHandleRef.current.changeDeptIdClearQysDataHandler('key1');
|
|
194
|
+
} }, i18next.t('修改流程id')),
|
|
195
|
+
React.createElement("button", { onClick: function () {
|
|
196
|
+
console.log(electronHandleRef.current.getAllData());
|
|
197
|
+
} }, i18next.t('获取数据')),
|
|
198
|
+
React.createElement("button", { onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
199
|
+
var err_1;
|
|
200
|
+
return __generator(this, function (_a) {
|
|
201
|
+
switch (_a.label) {
|
|
202
|
+
case 0:
|
|
203
|
+
_a.trys.push([0, 2, , 3]);
|
|
204
|
+
return [4 /*yield*/, electronHandleRef.current.validateElectronTable()];
|
|
205
|
+
case 1:
|
|
206
|
+
_a.sent();
|
|
207
|
+
console.log(i18next.t('校验通过'));
|
|
208
|
+
console.log(electronHandleRef.current.getAllData());
|
|
209
|
+
return [3 /*break*/, 3];
|
|
210
|
+
case 2:
|
|
211
|
+
err_1 = _a.sent();
|
|
212
|
+
console.log(err_1);
|
|
213
|
+
return [3 /*break*/, 3];
|
|
214
|
+
case 3: return [2 /*return*/];
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}); } }, i18next.t('校验逻辑'))));
|
|
218
|
+
};
|
|
219
|
+
export default Making;
|
|
@@ -0,0 +1,119 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
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;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
49
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
50
|
+
import { unstable_batchedUpdates } from 'react-dom';
|
|
51
|
+
import ElectronSignatures from '../index';
|
|
52
|
+
import { Button } from '../../../index';
|
|
53
|
+
import request from '../../../request';
|
|
54
|
+
import { testData2, } from './makingData';
|
|
55
|
+
/**
|
|
56
|
+
* 契约锁编辑模式 每个附件,都使用一个群杰印章按钮
|
|
57
|
+
*/
|
|
58
|
+
var Making = function () {
|
|
59
|
+
var electronHandleRef = useRef();
|
|
60
|
+
var _a = useState(null), params = _a[0], setParams = _a[1];
|
|
61
|
+
useEffect(function () {
|
|
62
|
+
// 模拟接口请求
|
|
63
|
+
setTimeout(function () {
|
|
64
|
+
unstable_batchedUpdates(function () {
|
|
65
|
+
setParams(testData2);
|
|
66
|
+
});
|
|
67
|
+
}, 1000);
|
|
68
|
+
}, []);
|
|
69
|
+
return (React.createElement(React.Fragment, null,
|
|
70
|
+
React.createElement(Button, { type: "link", disabled: true }, i18next.t('我是一个链接按钮')),
|
|
71
|
+
React.createElement(ElectronSignatures, __assign({ electronHandleRef: electronHandleRef, isBgColor: true,
|
|
72
|
+
// onlyQunj
|
|
73
|
+
showUploadBtn: true, isShowFileTypeMerge: false }, params, { canEdit: true ? 0 : 1, isDefaultQunj: true, isAllowedPatchFileType: false, isShowDownloadBatchBtn: true, isShowElectronBatchBtn: true, isQunjAddress: true, isNewQys: true, isShowBatchDeleteBtn: true ? false : true, isShowRelatedAttachBtn: true ? false : true, otherOptions: {
|
|
74
|
+
dataType: null,
|
|
75
|
+
dataTypeName: '',
|
|
76
|
+
}, isTranslation: true, previewUrl: true ? '/workflow/translationPreview' : '/translationPreview', request: request })),
|
|
77
|
+
React.createElement("button", { onClick: function () {
|
|
78
|
+
setParams(function (preParams) {
|
|
79
|
+
return __assign(__assign({}, preParams), { deptId: preParams.deptId === '1514842376723976194'
|
|
80
|
+
? '1514842546870112258'
|
|
81
|
+
: '1514842376723976194' });
|
|
82
|
+
});
|
|
83
|
+
// 修改了哪个数据的部门需要清空部门下的契约锁数据
|
|
84
|
+
// electronHandleRef.current.changeDeptIdClearQysDataHandler('key1');
|
|
85
|
+
} }, i18next.t('修改部门id')),
|
|
86
|
+
React.createElement("button", { onClick: function () {
|
|
87
|
+
setParams(function (preParams) {
|
|
88
|
+
return __assign(__assign({}, preParams), { flowId: preParams.flowId === 'scm_general_yyzj_operation'
|
|
89
|
+
? 'scm_general_yyzj_common'
|
|
90
|
+
: 'scm_general_yyzj_operation' });
|
|
91
|
+
});
|
|
92
|
+
// 修改了哪个数据的部门需要清空部门下的契约锁数据
|
|
93
|
+
// electronHandleRef.current.changeDeptIdClearQysDataHandler('key1');
|
|
94
|
+
} }, i18next.t('修改流程id')),
|
|
95
|
+
React.createElement("button", { onClick: function () {
|
|
96
|
+
console.log(electronHandleRef.current.getAllData());
|
|
97
|
+
} }, i18next.t('获取数据')),
|
|
98
|
+
React.createElement("button", { onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
99
|
+
var err_1;
|
|
100
|
+
return __generator(this, function (_a) {
|
|
101
|
+
switch (_a.label) {
|
|
102
|
+
case 0:
|
|
103
|
+
_a.trys.push([0, 2, , 3]);
|
|
104
|
+
return [4 /*yield*/, electronHandleRef.current.validateElectronTable()];
|
|
105
|
+
case 1:
|
|
106
|
+
_a.sent();
|
|
107
|
+
console.log(i18next.t('校验通过'));
|
|
108
|
+
console.log(electronHandleRef.current.getAllData());
|
|
109
|
+
return [3 /*break*/, 3];
|
|
110
|
+
case 2:
|
|
111
|
+
err_1 = _a.sent();
|
|
112
|
+
console.log(err_1);
|
|
113
|
+
return [3 /*break*/, 3];
|
|
114
|
+
case 3: return [2 /*return*/];
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}); } }, i18next.t('校验逻辑'))));
|
|
118
|
+
};
|
|
119
|
+
export default Making;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IFileItem, IElectronSignaturesItem } from '../interface';
|
|
3
|
+
interface IContractComparisonProps {
|
|
4
|
+
isEdit?: boolean;
|
|
5
|
+
/** 是否需要合同模板相关逻辑 */
|
|
6
|
+
isNeedComparison?: boolean;
|
|
7
|
+
/** 任务id 生成比对结果后 有一个任务id 如果没有这个任务id的话 需要重新比对一下 */
|
|
8
|
+
taskId?: string;
|
|
9
|
+
/** 模板附件名 */
|
|
10
|
+
templateAttachName?: IFileItem['templateAttachName'];
|
|
11
|
+
/** 模板附件ID */
|
|
12
|
+
templateAttachId?: IFileItem['templateAttachId'];
|
|
13
|
+
/** 需要比对的附件id */
|
|
14
|
+
attachId?: IFileItem['attachId'];
|
|
15
|
+
/** 需要比对的附件名称 */
|
|
16
|
+
attachName?: IFileItem['attachName'];
|
|
17
|
+
/** 是否保存为模板 */
|
|
18
|
+
isCustomerReference?: boolean;
|
|
19
|
+
onIsCustomerReferenceChange?: any;
|
|
20
|
+
/** 选择比对合同点击事件 */
|
|
21
|
+
onCheckedComparison?: (info: any) => void;
|
|
22
|
+
compareHandle?: any;
|
|
23
|
+
lookCompareHandle?: any;
|
|
24
|
+
realIndex?: number;
|
|
25
|
+
setRecords?: any;
|
|
26
|
+
dgInfoRef?: any;
|
|
27
|
+
myCompareHandle?: any;
|
|
28
|
+
/**
|
|
29
|
+
* 是否显示保存为模板
|
|
30
|
+
*/
|
|
31
|
+
isShowSaveTemplate?: IElectronSignaturesItem['isShowSaveTemplate'];
|
|
32
|
+
/**
|
|
33
|
+
* 是否显示选择比对模板
|
|
34
|
+
*/
|
|
35
|
+
isShowChioseTemplate?: IElectronSignaturesItem['isShowChioseTemplate'];
|
|
36
|
+
record?: any;
|
|
37
|
+
}
|
|
38
|
+
declare const _default: React.NamedExoticComponent<IContractComparisonProps>;
|
|
39
|
+
export default _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
2
|
+
import React, { memo, useState } from 'react';
|
|
3
|
+
import { Button, Checkbox } from '../../../index';
|
|
4
|
+
var ContractComparison = function (props) {
|
|
5
|
+
var isNeedComparison = props.isNeedComparison, isEdit = props.isEdit, taskId = props.taskId, templateAttachName = props.templateAttachName, templateAttachId = props.templateAttachId, attachId = props.attachId, isCustomerReference = props.isCustomerReference, onIsCustomerReferenceChange = props.onIsCustomerReferenceChange, onCheckedComparison = props.onCheckedComparison, realIndex = props.realIndex, setRecords = props.setRecords, lookCompareHandle = props.lookCompareHandle, dgInfoRef = props.dgInfoRef, myCompareHandle = props.myCompareHandle, record = props.record, isShowChioseTemplate = props.isShowChioseTemplate, isShowSaveTemplate = props.isShowSaveTemplate;
|
|
6
|
+
var _a = useState(false), loading = _a[0], setLoading = _a[1];
|
|
7
|
+
return isEdit ? (React.createElement("div", { className: "contract-comparison--wrap" },
|
|
8
|
+
isNeedComparison ? (React.createElement(React.Fragment, null,
|
|
9
|
+
React.createElement("div", null, templateAttachName),
|
|
10
|
+
!record.isHideChoiseChangeTemplate && isShowChioseTemplate ? (React.createElement(Button, { type: "link", onClick: function () {
|
|
11
|
+
// 记录当前点击产生的一些参数
|
|
12
|
+
dgInfoRef.current = {
|
|
13
|
+
realIndex: realIndex,
|
|
14
|
+
attachId: attachId,
|
|
15
|
+
setRecords: setRecords,
|
|
16
|
+
};
|
|
17
|
+
onCheckedComparison &&
|
|
18
|
+
onCheckedComparison({
|
|
19
|
+
realIndex: realIndex,
|
|
20
|
+
attachId: attachId,
|
|
21
|
+
setRecords: setRecords,
|
|
22
|
+
record: record,
|
|
23
|
+
});
|
|
24
|
+
} }, i18next.t('选择比对模板'))) : null,
|
|
25
|
+
taskId ? (React.createElement(Button, { type: "link", onClick: function () {
|
|
26
|
+
lookCompareHandle(taskId);
|
|
27
|
+
} }, i18next.t('查看比对结果'))) : templateAttachId && attachId ? (React.createElement(Button, { type: "link", style: { color: 'rgb(255, 77, 79)' }, loading: loading, onClick: function () {
|
|
28
|
+
// 记录当前点击产生的一些参数
|
|
29
|
+
dgInfoRef.current = {
|
|
30
|
+
realIndex: realIndex,
|
|
31
|
+
attachId: attachId,
|
|
32
|
+
setRecords: setRecords,
|
|
33
|
+
};
|
|
34
|
+
setLoading(true);
|
|
35
|
+
myCompareHandle(templateAttachId)
|
|
36
|
+
.then(function () {
|
|
37
|
+
setLoading(false);
|
|
38
|
+
})
|
|
39
|
+
.catch(function () {
|
|
40
|
+
setLoading(false);
|
|
41
|
+
});
|
|
42
|
+
} }, i18next.t('无任务ID,开始比对'))) : null)) : null,
|
|
43
|
+
!record.isHideSaveCustomerReference && isShowSaveTemplate ? (React.createElement(Checkbox, { checked: isCustomerReference, onChange: function (e) {
|
|
44
|
+
onIsCustomerReferenceChange &&
|
|
45
|
+
onIsCustomerReferenceChange(e.target.checked);
|
|
46
|
+
} }, i18next.t('存入样板'))) : null)) : (React.createElement("div", { className: "contract-comparison--wrap" },
|
|
47
|
+
React.createElement("div", null, templateAttachName),
|
|
48
|
+
!record.isHideSaveCustomerReference && isShowSaveTemplate ? (React.createElement(Checkbox, { checked: isCustomerReference, disabled: true }, i18next.t('存样板'))) : null,
|
|
49
|
+
taskId && isNeedComparison ? (React.createElement(Button, { type: "link", onClick: function () {
|
|
50
|
+
lookCompareHandle(taskId);
|
|
51
|
+
} }, i18next.t('查看比对结果'))) : null));
|
|
52
|
+
};
|
|
53
|
+
export default memo(ContractComparison);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface FileComparisonBtnProps {
|
|
3
|
+
fileBaseUrl: string;
|
|
4
|
+
compareHandle: (attachId1: string, attachId2: string) => any;
|
|
5
|
+
lookCompareHandle: (taskId: string) => any;
|
|
6
|
+
/** 点击按钮时告知外部触发事件 */
|
|
7
|
+
onCompareClick: () => Promise<any>;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.ForwardRefExoticComponent<FileComparisonBtnProps & React.RefAttributes<unknown>>;
|
|
10
|
+
/** 相对独立的合同比对接口。传入两个附件id,即可完成比对。 */
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,180 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
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;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
49
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
50
|
+
to[j] = from[i];
|
|
51
|
+
return to;
|
|
52
|
+
};
|
|
53
|
+
import i18next from 'ztxkutils/dist/i18next';
|
|
54
|
+
import React, { useState, useImperativeHandle } from 'react';
|
|
55
|
+
import { unstable_batchedUpdates } from 'react-dom';
|
|
56
|
+
import { Button, Modal, Table } from '../../../index';
|
|
57
|
+
import { previewFile } from 'ztxkutils/dist/fileOperation';
|
|
58
|
+
import { dangerouslySetXss } from 'ztxkutils/dist/tools';
|
|
59
|
+
var FileComparisonBtn = function (props, ref) {
|
|
60
|
+
var compareHandle = props.compareHandle, lookCompareHandle = props.lookCompareHandle, onCompareClick = props.onCompareClick, fileBaseUrl = props.fileBaseUrl;
|
|
61
|
+
var _a = useState(false), loading = _a[0], setLoading = _a[1];
|
|
62
|
+
var _b = useState(false), visible = _b[0], setVisible = _b[1];
|
|
63
|
+
var _c = useState([]), data = _c[0], setData = _c[1];
|
|
64
|
+
var columns = [
|
|
65
|
+
{
|
|
66
|
+
title: i18next.t('序号'),
|
|
67
|
+
width: 62,
|
|
68
|
+
key: 'index',
|
|
69
|
+
render: function (_text, _record, index) { return "" + (index + 1); },
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
title: i18next.t('附件1'),
|
|
73
|
+
width: 300,
|
|
74
|
+
dataIndex: 'attachId1',
|
|
75
|
+
key: 'attachId1',
|
|
76
|
+
render: function (text, record) {
|
|
77
|
+
return (React.createElement(Button, { type: "link", onClick: function () {
|
|
78
|
+
previewFile(fileBaseUrl, text, {
|
|
79
|
+
titleName: dangerouslySetXss(record.attach1Name),
|
|
80
|
+
});
|
|
81
|
+
} }, record.attach1Name));
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
title: i18next.t('附件2'),
|
|
86
|
+
width: 300,
|
|
87
|
+
dataIndex: 'attachId2',
|
|
88
|
+
key: 'attachId2',
|
|
89
|
+
render: function (text, record) {
|
|
90
|
+
return (React.createElement(Button, { type: "link", onClick: function () {
|
|
91
|
+
previewFile(fileBaseUrl, text, {
|
|
92
|
+
titleName: dangerouslySetXss(record.attach2Name),
|
|
93
|
+
});
|
|
94
|
+
} }, record.attach2Name));
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
title: i18next.t('查看比对结果'),
|
|
99
|
+
width: 100,
|
|
100
|
+
dataIndex: 'taskId',
|
|
101
|
+
key: 'taskId',
|
|
102
|
+
render: function (text, record) {
|
|
103
|
+
return (React.createElement(Button, { type: "link", onClick: function () {
|
|
104
|
+
lookCompareHandle(text);
|
|
105
|
+
} }, i18next.t('查看比对结果')));
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
useImperativeHandle(ref, function () {
|
|
110
|
+
return {
|
|
111
|
+
appendData: function (data) {
|
|
112
|
+
setData(function (preData) {
|
|
113
|
+
return __spreadArray(__spreadArray([], preData), [data]);
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
return (React.createElement(React.Fragment, null,
|
|
119
|
+
React.createElement(Button, { type: "primary", style: { marginRight: '10px' }, loading: loading, onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
120
|
+
var result_1, item_1, res, error_1;
|
|
121
|
+
return __generator(this, function (_a) {
|
|
122
|
+
switch (_a.label) {
|
|
123
|
+
case 0:
|
|
124
|
+
setLoading(true);
|
|
125
|
+
_a.label = 1;
|
|
126
|
+
case 1:
|
|
127
|
+
_a.trys.push([1, 4, , 5]);
|
|
128
|
+
return [4 /*yield*/, onCompareClick()];
|
|
129
|
+
case 2:
|
|
130
|
+
result_1 = _a.sent();
|
|
131
|
+
if (typeof result_1 === 'string') {
|
|
132
|
+
setVisible(true);
|
|
133
|
+
setLoading(false);
|
|
134
|
+
return [2 /*return*/];
|
|
135
|
+
}
|
|
136
|
+
item_1 = {
|
|
137
|
+
attachId1: result_1[0].attachId,
|
|
138
|
+
attach1Name: result_1[0].attachName,
|
|
139
|
+
attachId2: result_1[1].attachId,
|
|
140
|
+
attach2Name: result_1[1].attachName,
|
|
141
|
+
taskId: '',
|
|
142
|
+
};
|
|
143
|
+
// 如果当前添加的附件,在data中存在,就不添加
|
|
144
|
+
if (data.some(function (item) {
|
|
145
|
+
return ((item.attachId1 === result_1[0].attachId &&
|
|
146
|
+
item.attachId2 === result_1[1].attachId) ||
|
|
147
|
+
(item.attachId1 === result_1[1].attachId &&
|
|
148
|
+
item.attachId2 === result_1[0].attachId));
|
|
149
|
+
})) {
|
|
150
|
+
setVisible(true);
|
|
151
|
+
setLoading(false);
|
|
152
|
+
return [2 /*return*/];
|
|
153
|
+
}
|
|
154
|
+
return [4 /*yield*/, compareHandle(item_1.attachId1, item_1.attachId2)];
|
|
155
|
+
case 3:
|
|
156
|
+
res = _a.sent();
|
|
157
|
+
if (res.status === 200 && res.data.code === 200) {
|
|
158
|
+
item_1.taskId = res.data.data.taskId;
|
|
159
|
+
}
|
|
160
|
+
unstable_batchedUpdates(function () {
|
|
161
|
+
setData(function (preData) {
|
|
162
|
+
return __spreadArray(__spreadArray([], preData), [item_1]).map(function (item, index) { return (__assign(__assign({}, item), { index: index })); });
|
|
163
|
+
});
|
|
164
|
+
setVisible(true);
|
|
165
|
+
setLoading(false);
|
|
166
|
+
});
|
|
167
|
+
return [3 /*break*/, 5];
|
|
168
|
+
case 4:
|
|
169
|
+
error_1 = _a.sent();
|
|
170
|
+
setLoading(false);
|
|
171
|
+
return [3 /*break*/, 5];
|
|
172
|
+
case 5: return [2 /*return*/];
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}); } }, i18next.t('文件比对')),
|
|
176
|
+
React.createElement(Modal, { title: i18next.t('自定义比对'), visible: visible, loading: false, width: "70%", footer: null, onCancel: function () { return setVisible(false); } },
|
|
177
|
+
React.createElement(Table, { rowKey: "index", columns: columns, dataSource: data }))));
|
|
178
|
+
};
|
|
179
|
+
/** 相对独立的合同比对接口。传入两个附件id,即可完成比对。 */
|
|
180
|
+
export default React.forwardRef(FileComparisonBtn);
|