ydb-components-material 0.1.87 → 0.1.89
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/build/docs/404.html +3 -3
- package/build/docs/_demos/:uuid +3 -3
- package/build/docs/colorful-button.html +3 -3
- package/build/docs/colorful-input.html +3 -3
- package/build/docs/index.html +3 -3
- package/build/docs/umi.6ffa9be4.js +1 -0
- package/build/docs/{umi.507b3306.css → umi.fd11a37a.css} +1 -1
- package/build/docs/~demos/:uuid.html +3 -3
- package/build/docs/~demos/colorful-button-demo.html +3 -3
- package/build/docs/~demos/colorful-input-demo.html +3 -3
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +9 -9
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +2 -2
- package/dist/BizComps.css +1 -1
- package/dist/BizComps.js +5 -5
- package/dist/BizComps.js.map +1 -1
- package/es/components/file-list/checkPoint.d.ts +3 -0
- package/es/components/file-list/checkPoint.js +157 -0
- package/es/components/file-list/checkPoint.scss +120 -0
- package/es/components/file-list/file.js +224 -0
- package/es/components/file-list/icon/checked.svg +1 -0
- package/es/components/file-list/icon/close.svg +1 -0
- package/es/components/file-list/icon/del.svg +1 -0
- package/es/components/file-list/icon/download.svg +1 -0
- package/es/components/file-list/icon/download_pc.svg +1 -0
- package/es/components/file-list/icon/file.svg +1 -0
- package/es/components/file-list/icon/icon_errorMsg.svg +1 -0
- package/es/components/file-list/icon/icon_warning.svg +1 -0
- package/es/components/file-list/icon/preview.svg +1 -0
- package/es/components/file-list/icon/preview_pc.svg +1 -0
- package/es/components/file-list/icon/upload.svg +1 -0
- package/es/components/file-list/icon/view.svg +1 -0
- package/es/components/file-list/index.d.ts +21 -0
- package/es/components/file-list/index.js +258 -0
- package/es/components/file-list/index.scss +61 -0
- package/es/components/file-list/item.d.ts +27 -0
- package/es/components/file-list/item.js +854 -0
- package/es/components/file-list/item.scss +412 -0
- package/es/components/file-list/seal.d.ts +3 -0
- package/es/components/file-list/seal.js +222 -0
- package/es/components/file-list/sealUtil.js +252 -0
- package/es/components/file-list/sign.d.ts +3 -0
- package/es/components/file-list/sign.js +138 -0
- package/es/components/file-list/signUtil.js +369 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +1 -0
- package/es/style.js +1 -0
- package/lib/components/file-list/checkPoint.d.ts +3 -0
- package/lib/components/file-list/checkPoint.js +162 -0
- package/lib/components/file-list/checkPoint.scss +120 -0
- package/lib/components/file-list/file.js +233 -0
- package/lib/components/file-list/icon/checked.svg +1 -0
- package/lib/components/file-list/icon/close.svg +1 -0
- package/lib/components/file-list/icon/del.svg +1 -0
- package/lib/components/file-list/icon/download.svg +1 -0
- package/lib/components/file-list/icon/download_pc.svg +1 -0
- package/lib/components/file-list/icon/file.svg +1 -0
- package/lib/components/file-list/icon/icon_errorMsg.svg +1 -0
- package/lib/components/file-list/icon/icon_warning.svg +1 -0
- package/lib/components/file-list/icon/preview.svg +1 -0
- package/lib/components/file-list/icon/preview_pc.svg +1 -0
- package/lib/components/file-list/icon/upload.svg +1 -0
- package/lib/components/file-list/icon/view.svg +1 -0
- package/lib/components/file-list/index.d.ts +21 -0
- package/lib/components/file-list/index.js +263 -0
- package/lib/components/file-list/index.scss +61 -0
- package/lib/components/file-list/item.d.ts +27 -0
- package/lib/components/file-list/item.js +860 -0
- package/lib/components/file-list/item.scss +412 -0
- package/lib/components/file-list/seal.d.ts +3 -0
- package/lib/components/file-list/seal.js +228 -0
- package/lib/components/file-list/sealUtil.js +254 -0
- package/lib/components/file-list/sign.d.ts +3 -0
- package/lib/components/file-list/sign.js +144 -0
- package/lib/components/file-list/signUtil.js +371 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -1
- package/lib/style.js +1 -0
- package/lowcode/file-list/meta.ts +231 -0
- package/lowcode_es/_setter/IconSelectSetter.js +1 -1
- package/lowcode_es/file-list/meta.d.ts +22 -0
- package/lowcode_es/file-list/meta.js +213 -0
- package/lowcode_es/meta.js +3 -2
- package/lowcode_lib/_setter/IconSelectSetter.js +1 -1
- package/lowcode_lib/file-list/meta.d.ts +22 -0
- package/lowcode_lib/file-list/meta.js +218 -0
- package/lowcode_lib/meta.js +14 -13
- package/package.json +5 -4
- package/build/docs/umi.5298404d.js +0 -1
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
import { getBlob, getFileExtension, upload, dataURLtoBlob, uploadFilePromise } from "./file";
|
|
4
|
+
import { createbycategory, contractSignUrl, signurl, checkSignState, contractFinish, documentDownload, fileUploadApi } from "../../api";
|
|
5
|
+
var categoryId = '3354397552669692408';
|
|
6
|
+
// 预发
|
|
7
|
+
var categoryIdRelease = '3291682531601133765'; // 手写签批id
|
|
8
|
+
var documentId = ''; // 手写签批生成的文件id
|
|
9
|
+
var contractId = ''; // 合同id
|
|
10
|
+
|
|
11
|
+
// 对外的方法 初始化手写签批的页面
|
|
12
|
+
export function initSignPageMethod(_x, _x2, _x3) {
|
|
13
|
+
return _initSignPageMethod.apply(this, arguments);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// 【第 1 步】上传要手写签批的文件
|
|
17
|
+
function _initSignPageMethod() {
|
|
18
|
+
_initSignPageMethod = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(fileObj, userInfo, config) {
|
|
19
|
+
var fileName, docId, contrId, flag, pageUrl, params;
|
|
20
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
21
|
+
while (1) switch (_context.prev = _context.next) {
|
|
22
|
+
case 0:
|
|
23
|
+
console.log('fileObj', fileObj, userInfo);
|
|
24
|
+
fileName = fileObj.fileName; // 【第 1 步】上传要手写签批的文件
|
|
25
|
+
_context.next = 1;
|
|
26
|
+
return uploadSignFile(fileObj, config);
|
|
27
|
+
case 1:
|
|
28
|
+
docId = _context.sent;
|
|
29
|
+
console.log('docId---', docId);
|
|
30
|
+
if (docId) {
|
|
31
|
+
_context.next = 2;
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
return _context.abrupt("return", false);
|
|
35
|
+
case 2:
|
|
36
|
+
documentId = docId; // 保存文档 id
|
|
37
|
+
|
|
38
|
+
// 【第 2 步】创建或者发起电子签批
|
|
39
|
+
_context.next = 3;
|
|
40
|
+
return createbycategoryFun(fileName, docId, config);
|
|
41
|
+
case 3:
|
|
42
|
+
contrId = _context.sent;
|
|
43
|
+
console.log('contrId---', contrId);
|
|
44
|
+
if (contrId) {
|
|
45
|
+
_context.next = 4;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
return _context.abrupt("return", false);
|
|
49
|
+
case 4:
|
|
50
|
+
contractId = contrId;
|
|
51
|
+
|
|
52
|
+
// 【第 3 步】创建手写签批页面
|
|
53
|
+
_context.next = 5;
|
|
54
|
+
return getContractSignUrl(contrId, userInfo, config);
|
|
55
|
+
case 5:
|
|
56
|
+
flag = _context.sent;
|
|
57
|
+
if (flag) {
|
|
58
|
+
_context.next = 6;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
return _context.abrupt("return", false);
|
|
62
|
+
case 6:
|
|
63
|
+
_context.next = 7;
|
|
64
|
+
return getSignUrl(userInfo, config);
|
|
65
|
+
case 7:
|
|
66
|
+
pageUrl = _context.sent;
|
|
67
|
+
if (pageUrl) {
|
|
68
|
+
_context.next = 8;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
return _context.abrupt("return", false);
|
|
72
|
+
case 8:
|
|
73
|
+
// 将 文档 id/签批文件 id/签署地址/文件名称 返回
|
|
74
|
+
params = {
|
|
75
|
+
documentId: documentId,
|
|
76
|
+
contractId: contractId,
|
|
77
|
+
pageUrl: pageUrl,
|
|
78
|
+
fileName: fileName
|
|
79
|
+
};
|
|
80
|
+
return _context.abrupt("return", params);
|
|
81
|
+
case 9:
|
|
82
|
+
case "end":
|
|
83
|
+
return _context.stop();
|
|
84
|
+
}
|
|
85
|
+
}, _callee);
|
|
86
|
+
}));
|
|
87
|
+
return _initSignPageMethod.apply(this, arguments);
|
|
88
|
+
}
|
|
89
|
+
function uploadSignFile(_x4, _x5) {
|
|
90
|
+
return _uploadSignFile.apply(this, arguments);
|
|
91
|
+
} // 【第 2 步】创建或者发起电子签批
|
|
92
|
+
function _uploadSignFile() {
|
|
93
|
+
_uploadSignFile = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(event, config) {
|
|
94
|
+
var blob, file, signApprovalFileType;
|
|
95
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
96
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
97
|
+
case 0:
|
|
98
|
+
console.log('文件 1111', event, config);
|
|
99
|
+
// uni.showLoading({ title: '加载中' })
|
|
100
|
+
_context2.next = 1;
|
|
101
|
+
return getBlob(event.fileUrl);
|
|
102
|
+
case 1:
|
|
103
|
+
blob = _context2.sent;
|
|
104
|
+
file = new File([blob], event.fileName, {
|
|
105
|
+
type: getFileExtension(event.fileName)
|
|
106
|
+
});
|
|
107
|
+
console.log('file----', file);
|
|
108
|
+
// 获取文件类型
|
|
109
|
+
signApprovalFileType = getFileExtension(event.fileName);
|
|
110
|
+
return _context2.abrupt("return", new Promise(function (resolve) {
|
|
111
|
+
// 上传文件
|
|
112
|
+
upload({
|
|
113
|
+
file: file,
|
|
114
|
+
title: event.fileName,
|
|
115
|
+
fileType: signApprovalFileType,
|
|
116
|
+
filename: event.fileName,
|
|
117
|
+
// 文件名称
|
|
118
|
+
headers: {
|
|
119
|
+
Authorization: config.tokenTY
|
|
120
|
+
},
|
|
121
|
+
// https://zwfwpt.sxzwfw.gov.cn${window.env === 'release' ? ':10010' : ''}/DeclarationAPI
|
|
122
|
+
action: config.baseUrl + "/declaration/center/signapproval/api/createbyfile",
|
|
123
|
+
// 上传文件的地址
|
|
124
|
+
onError: function onError(e) {
|
|
125
|
+
// uni.$u.toast(e.msg || '手写签批上传文件异常');
|
|
126
|
+
// uni.hideLoading();
|
|
127
|
+
resolve(false);
|
|
128
|
+
},
|
|
129
|
+
onSuccess: function onSuccess(e) {
|
|
130
|
+
// 上传成功
|
|
131
|
+
console.log('上传成功', e);
|
|
132
|
+
resolve(e.data.documentId);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}));
|
|
136
|
+
case 2:
|
|
137
|
+
case "end":
|
|
138
|
+
return _context2.stop();
|
|
139
|
+
}
|
|
140
|
+
}, _callee2);
|
|
141
|
+
}));
|
|
142
|
+
return _uploadSignFile.apply(this, arguments);
|
|
143
|
+
}
|
|
144
|
+
function createbycategoryFun(fileName, documentIdVal, config) {
|
|
145
|
+
// uni.showLoading({ title: '加载中' })
|
|
146
|
+
console.log('env---', config.env);
|
|
147
|
+
var params = {
|
|
148
|
+
subject: fileName,
|
|
149
|
+
documents: [documentIdVal],
|
|
150
|
+
categoryId: config.env === 'releaseHLW' ? categoryIdRelease : categoryId,
|
|
151
|
+
send: true,
|
|
152
|
+
tenantName: '山西省行政审批服务管理局'
|
|
153
|
+
};
|
|
154
|
+
return new Promise(function (resolve) {
|
|
155
|
+
createbycategory(params, config).then(function (res) {
|
|
156
|
+
console.log('创建订单成功', res);
|
|
157
|
+
if (res.code === 200) {
|
|
158
|
+
resolve(res.data.contractId);
|
|
159
|
+
} else {
|
|
160
|
+
resolve(false);
|
|
161
|
+
}
|
|
162
|
+
})["catch"](function (error) {
|
|
163
|
+
// uni.hideLoading();
|
|
164
|
+
resolve(false);
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// 【第 3 步】创建手写签批页面
|
|
170
|
+
function getContractSignUrl(contractIdVal, userInfo, config) {
|
|
171
|
+
console.log('contractIdVal', contractIdVal, userInfo);
|
|
172
|
+
// uni.showLoading({ title: '加载中' })
|
|
173
|
+
var params = {
|
|
174
|
+
contractId: contractIdVal,
|
|
175
|
+
signatories: [{
|
|
176
|
+
tenantType: 'PERSONAL',
|
|
177
|
+
tenantName: userInfo.acctType === '20' ? userInfo.legalName : userInfo.userName,
|
|
178
|
+
contact: userInfo.acctType === '20' ? userInfo.legalMobile : userInfo.contactMobile,
|
|
179
|
+
serialNo: 1,
|
|
180
|
+
signAuthConfig: {
|
|
181
|
+
signAuth: 'DEFAULT'
|
|
182
|
+
},
|
|
183
|
+
remind: false
|
|
184
|
+
}]
|
|
185
|
+
};
|
|
186
|
+
return new Promise(function (resolve) {
|
|
187
|
+
contractSignUrl(params, config).then(function (res) {
|
|
188
|
+
if (res.data.code == 0) {
|
|
189
|
+
resolve(true);
|
|
190
|
+
} else {
|
|
191
|
+
// uni.hideLoading();
|
|
192
|
+
// uni.showModal({
|
|
193
|
+
// title: '温馨提示',
|
|
194
|
+
// content: '获取签批页面失败',
|
|
195
|
+
// confirmText: '知道了',
|
|
196
|
+
// showCancel: false,
|
|
197
|
+
// })
|
|
198
|
+
resolve(false);
|
|
199
|
+
}
|
|
200
|
+
})["catch"](function (error) {
|
|
201
|
+
// uni.hideLoading();
|
|
202
|
+
resolve(false);
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// 【第 4 步】获取签 pi 页面
|
|
208
|
+
function getSignUrl(userInfo, config) {
|
|
209
|
+
// uni.showLoading({ title: '加载中' })
|
|
210
|
+
var params = {
|
|
211
|
+
contractId: contractId,
|
|
212
|
+
tenantType: 'PERSONAL',
|
|
213
|
+
// COMPANY(组织),PERSONAL(个人)
|
|
214
|
+
tenantName: userInfo.acctType === '20' ? userInfo.legalName : userInfo.userName,
|
|
215
|
+
contact: userInfo.acctType === '20' ? userInfo.legalMobile : userInfo.contactMobile,
|
|
216
|
+
canReturn: false,
|
|
217
|
+
// 页面是否显示返回按钮
|
|
218
|
+
canWithdraw: false,
|
|
219
|
+
// 页面是否显示撤回/回退/拒签按钮
|
|
220
|
+
rejectable: false,
|
|
221
|
+
// 页面是否显示拒签按钮
|
|
222
|
+
allowDownload: false,
|
|
223
|
+
// 页面是否显示下载按钮
|
|
224
|
+
allowPrint: false,
|
|
225
|
+
// 页面是否显示打印按钮
|
|
226
|
+
canViewDetail: false,
|
|
227
|
+
// 页面是否显示签署详情按钮
|
|
228
|
+
canMoreOperation: false,
|
|
229
|
+
// 页面是否显示"更多操作"按钮
|
|
230
|
+
autoClosePage: true,
|
|
231
|
+
// 操作完成自动关闭页面
|
|
232
|
+
language: 'ZH_CN',
|
|
233
|
+
deviceType: config.isPC || 'H5' // 取值范围:PC(返回 PC 页面),H5(返回 H5 页面);不传值默认为:根据请求的 UserAgent 自动判断返回的页面类型。
|
|
234
|
+
};
|
|
235
|
+
return new Promise(function (resolve) {
|
|
236
|
+
signurl(params, config).then(function (res) {
|
|
237
|
+
console.log(res, '页面结果');
|
|
238
|
+
if (res.data.code == 0) {
|
|
239
|
+
resolve(res.data.signUrl);
|
|
240
|
+
} else {
|
|
241
|
+
resolve(false);
|
|
242
|
+
}
|
|
243
|
+
// uni.hideLoading();
|
|
244
|
+
})["catch"](function (error) {
|
|
245
|
+
resolve(false);
|
|
246
|
+
// uni.hideLoading();
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// 下方是打开手写签批页面后 的后续操作
|
|
252
|
+
|
|
253
|
+
// 对外的方法 获取签批后的文件
|
|
254
|
+
export function getSignRes(_x6, _x7, _x8, _x9, _x0) {
|
|
255
|
+
return _getSignRes.apply(this, arguments);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// 轮询 签批状态
|
|
259
|
+
function _getSignRes() {
|
|
260
|
+
_getSignRes = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(documentIdVal, contractIdVal, name, autoUpload, config) {
|
|
261
|
+
var isSignSucc, newFile, params, uploadRes;
|
|
262
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
263
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
264
|
+
case 0:
|
|
265
|
+
_context3.next = 1;
|
|
266
|
+
return getCheckSignState(contractIdVal, config);
|
|
267
|
+
case 1:
|
|
268
|
+
isSignSucc = _context3.sent;
|
|
269
|
+
if (!isSignSucc) {
|
|
270
|
+
_context3.next = 8;
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
// 封存
|
|
274
|
+
getContractFinish(contractIdVal, config);
|
|
275
|
+
_context3.next = 2;
|
|
276
|
+
return handleSignApprovalDown(documentIdVal, name, config);
|
|
277
|
+
case 2:
|
|
278
|
+
newFile = _context3.sent;
|
|
279
|
+
console.log('newFile', newFile);
|
|
280
|
+
// 如果需要自动上传
|
|
281
|
+
if (!autoUpload) {
|
|
282
|
+
_context3.next = 6;
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
params = {
|
|
286
|
+
materiaBase: newFile,
|
|
287
|
+
open: true
|
|
288
|
+
};
|
|
289
|
+
console.log('params', params);
|
|
290
|
+
_context3.next = 3;
|
|
291
|
+
return fileUploadApi(params, config);
|
|
292
|
+
case 3:
|
|
293
|
+
uploadRes = _context3.sent;
|
|
294
|
+
// const uploadedFileObj = await uploadFilePromise(newFile, config)
|
|
295
|
+
console.log('签批完成后的文件地址', uploadRes);
|
|
296
|
+
if (!(uploadRes.code === 200)) {
|
|
297
|
+
_context3.next = 4;
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
return _context3.abrupt("return", uploadRes.data);
|
|
301
|
+
case 4:
|
|
302
|
+
return _context3.abrupt("return", false);
|
|
303
|
+
case 5:
|
|
304
|
+
_context3.next = 7;
|
|
305
|
+
break;
|
|
306
|
+
case 6:
|
|
307
|
+
return _context3.abrupt("return", newFile);
|
|
308
|
+
case 7:
|
|
309
|
+
_context3.next = 9;
|
|
310
|
+
break;
|
|
311
|
+
case 8:
|
|
312
|
+
return _context3.abrupt("return", false);
|
|
313
|
+
case 9:
|
|
314
|
+
case "end":
|
|
315
|
+
return _context3.stop();
|
|
316
|
+
}
|
|
317
|
+
}, _callee3);
|
|
318
|
+
}));
|
|
319
|
+
return _getSignRes.apply(this, arguments);
|
|
320
|
+
}
|
|
321
|
+
function getCheckSignState(contractIdVal, config) {
|
|
322
|
+
return new Promise(function (resolve) {
|
|
323
|
+
checkSignState({
|
|
324
|
+
contractId: contractIdVal
|
|
325
|
+
}, config).then(function (res) {
|
|
326
|
+
console.log('轮询结果---', res);
|
|
327
|
+
// console.log('轮询结果', JSON.parse(res.data));
|
|
328
|
+
// 签署完成
|
|
329
|
+
if (res.data !== 'null') {
|
|
330
|
+
res = JSON.parse(res.data);
|
|
331
|
+
if (res.status == 'SIGNED') {
|
|
332
|
+
resolve(true);
|
|
333
|
+
} else {
|
|
334
|
+
resolve(false);
|
|
335
|
+
}
|
|
336
|
+
} else {
|
|
337
|
+
resolve(false);
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// 封存电子签批
|
|
344
|
+
function getContractFinish(contractIdVal, config) {
|
|
345
|
+
contractFinish({
|
|
346
|
+
contractId: contractIdVal
|
|
347
|
+
}, config);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// 下载签署完的文档
|
|
351
|
+
function handleSignApprovalDown(documentIdVal, name, config) {
|
|
352
|
+
var params = {
|
|
353
|
+
documentId: documentIdVal,
|
|
354
|
+
type: 'pdf'
|
|
355
|
+
};
|
|
356
|
+
return new Promise(function (resolve) {
|
|
357
|
+
documentDownload(params, config).then(function (res) {
|
|
358
|
+
console.log('下载文件:', res);
|
|
359
|
+
// 返回来是base64格式的
|
|
360
|
+
// const blob = dataURLtoBlob(res.data); // 转成blob格式进行上传
|
|
361
|
+
// console.log(blob, '新文件的blob格式');
|
|
362
|
+
if (res.code === 200) {
|
|
363
|
+
resolve(res.data);
|
|
364
|
+
} else {
|
|
365
|
+
resolve(false);
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
}
|
package/es/index.d.ts
CHANGED
|
@@ -39,5 +39,7 @@ export type { PreviewMaterialProps } from './components/preview-material';
|
|
|
39
39
|
export { default as PreviewMaterial } from './components/preview-material';
|
|
40
40
|
export type { PrintButtonProps } from './components/print';
|
|
41
41
|
export { default as PrintButton } from './components/print';
|
|
42
|
+
export type { FileListProps } from './components/file-list';
|
|
43
|
+
export { default as FileList } from './components/file-list';
|
|
42
44
|
declare const bizCssPrefix = "bizpack";
|
|
43
45
|
export { bizCssPrefix };
|
package/es/index.js
CHANGED
|
@@ -25,5 +25,6 @@ export { default as AddressSelect } from "./components/address-select";
|
|
|
25
25
|
export { default as AddressCascader } from "./components/address-cascade";
|
|
26
26
|
export { default as PreviewMaterial } from "./components/preview-material";
|
|
27
27
|
export { default as PrintButton } from "./components/print";
|
|
28
|
+
export { default as FileList } from "./components/file-list";
|
|
28
29
|
var bizCssPrefix = 'bizpack';
|
|
29
30
|
export { bizCssPrefix };
|
package/es/style.js
CHANGED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports["default"] = CheckPoint;
|
|
6
|
+
var _message = _interopRequireDefault(require("@alifd/next/lib/message"));
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _icons = require("@ant-design/icons");
|
|
9
|
+
require("./checkPoint.scss");
|
|
10
|
+
function CheckPoint(props) {
|
|
11
|
+
var _resultData$at, _resultData$at2;
|
|
12
|
+
var checkPointData = props.checkPointData,
|
|
13
|
+
handleClose = props.handleClose;
|
|
14
|
+
var _useState = (0, _react.useState)(0),
|
|
15
|
+
resIndex = _useState[0],
|
|
16
|
+
setResIndex = _useState[1];
|
|
17
|
+
var _useState2 = (0, _react.useState)(null),
|
|
18
|
+
resIndexData = _useState2[0],
|
|
19
|
+
setResIndexData = _useState2[1];
|
|
20
|
+
var _useState3 = (0, _react.useState)([]),
|
|
21
|
+
resultData = _useState3[0],
|
|
22
|
+
setResultData = _useState3[1];
|
|
23
|
+
var _useState4 = (0, _react.useState)(0),
|
|
24
|
+
pageHeight = _useState4[0],
|
|
25
|
+
setPageHeight = _useState4[1];
|
|
26
|
+
var imgRef = (0, _react.useRef)();
|
|
27
|
+
var initData = function initData() {
|
|
28
|
+
var fileUrl = checkPointData.fileUrl,
|
|
29
|
+
_checkPointData$annot = checkPointData.annotations,
|
|
30
|
+
annotations = _checkPointData$annot === void 0 ? [] : _checkPointData$annot;
|
|
31
|
+
setTimeout(function () {
|
|
32
|
+
var iframe = document.getElementById('file_check_point');
|
|
33
|
+
iframe.src = fileUrl + "#toolbar=0";
|
|
34
|
+
}, 500);
|
|
35
|
+
setResIndexData(annotations[0]);
|
|
36
|
+
// 其中的page可能是乱序的,所以先排序一下
|
|
37
|
+
setResultData(annotations.sort(function (a, b) {
|
|
38
|
+
return a.page - b.page;
|
|
39
|
+
}));
|
|
40
|
+
var clientWidth = document.documentElement.clientWidth;
|
|
41
|
+
var _annotations$ = annotations[0],
|
|
42
|
+
scrollWidth = _annotations$.scrollWidth,
|
|
43
|
+
scrollHeight = _annotations$.scrollHeight;
|
|
44
|
+
var scale = clientWidth / scrollWidth;
|
|
45
|
+
setPageHeight(scrollHeight * scale);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// 获取标识的位置和大小 [方法]
|
|
49
|
+
var getTipDotStyle = function getTipDotStyle(item) {
|
|
50
|
+
var width = item.width,
|
|
51
|
+
height = item.height,
|
|
52
|
+
x = item.x,
|
|
53
|
+
y = item.y,
|
|
54
|
+
scrollWidth = item.scrollWidth,
|
|
55
|
+
scrollHeight = item.scrollHeight,
|
|
56
|
+
page = item.page;
|
|
57
|
+
console.log(width, height, x, y);
|
|
58
|
+
var img = imgRef.current;
|
|
59
|
+
console.log(img, 'refs');
|
|
60
|
+
var clientWidth = document.documentElement.clientWidth;
|
|
61
|
+
console.log('clientWidth-----', clientWidth);
|
|
62
|
+
|
|
63
|
+
// 算出一个系数,来动态生成下面的边框样式
|
|
64
|
+
var scale = clientWidth / scrollWidth;
|
|
65
|
+
|
|
66
|
+
// console.log('原始宽高', sourceImgWidth, sourceImgHeight);
|
|
67
|
+
console.log('原始宽高', scrollWidth, scrollHeight);
|
|
68
|
+
console.log('缩放系数', scale, scale);
|
|
69
|
+
return {
|
|
70
|
+
width: width * scale + 'px',
|
|
71
|
+
height: height * scale + 'px',
|
|
72
|
+
left: x * scale + 'px',
|
|
73
|
+
top: (page - 1) * pageHeight + y * scale + 'px'
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// 上一项(prev),下一项(next) [按钮]
|
|
78
|
+
var handleSwitch = function handleSwitch(state) {
|
|
79
|
+
if (state === 'next' && resIndex === resultData.length - 1) return _message["default"].notice('没有下一项了');
|
|
80
|
+
if (state === 'prev' && resIndex === 0) return _message["default"].notice('没有上一项了');
|
|
81
|
+
if (state === 'next') {
|
|
82
|
+
setResIndex(resIndex + 1);
|
|
83
|
+
setResIndexData(resultData[resIndex + 1]);
|
|
84
|
+
}
|
|
85
|
+
if (state === 'prev') {
|
|
86
|
+
setResIndex(resIndex - 1);
|
|
87
|
+
setResIndexData(resultData[resIndex - 1]);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
var checkOneDot = function checkOneDot(item, index) {
|
|
91
|
+
setResIndex(index);
|
|
92
|
+
setResIndexData(item);
|
|
93
|
+
};
|
|
94
|
+
(0, _react.useEffect)(function () {
|
|
95
|
+
if (checkPointData) {
|
|
96
|
+
initData();
|
|
97
|
+
}
|
|
98
|
+
}, [checkPointData]);
|
|
99
|
+
return /*#__PURE__*/_react.React.createElement("div", null, /*#__PURE__*/_react.React.createElement("div", {
|
|
100
|
+
className: "keyPoint-container"
|
|
101
|
+
}, /*#__PURE__*/_react.React.createElement("div", {
|
|
102
|
+
className: "tipDot-content",
|
|
103
|
+
style: {
|
|
104
|
+
height: ((_resultData$at = resultData.at(-1)) === null || _resultData$at === void 0 ? void 0 : _resultData$at.page) * pageHeight + 'px'
|
|
105
|
+
}
|
|
106
|
+
}, resultData.map(function (item, index) {
|
|
107
|
+
return /*#__PURE__*/_react.React.createElement("div", {
|
|
108
|
+
className: "tip-item " + (index === resIndex ? 'active' : ''),
|
|
109
|
+
key: index,
|
|
110
|
+
onClick: function onClick() {
|
|
111
|
+
return checkOneDot(item, index);
|
|
112
|
+
},
|
|
113
|
+
style: getTipDotStyle(item)
|
|
114
|
+
}, /*#__PURE__*/_react.React.createElement("div", {
|
|
115
|
+
className: "num " + (index === resIndex ? 'active' : '')
|
|
116
|
+
}, index + 1));
|
|
117
|
+
})), resIndexData && /*#__PURE__*/_react.React.createElement("div", {
|
|
118
|
+
className: "result-outter"
|
|
119
|
+
}, /*#__PURE__*/_react.React.createElement("div", {
|
|
120
|
+
className: "result-card"
|
|
121
|
+
}, /*#__PURE__*/_react.React.createElement("div", {
|
|
122
|
+
className: "result-title"
|
|
123
|
+
}, resIndex + 1, "\u3001", resIndexData.text), /*#__PURE__*/_react.React.createElement("div", {
|
|
124
|
+
className: "result-info"
|
|
125
|
+
}, /*#__PURE__*/_react.React.createElement(_icons.CheckCircleFilled, {
|
|
126
|
+
color: "#15bc83",
|
|
127
|
+
size: "20",
|
|
128
|
+
style: {
|
|
129
|
+
color: '#15bc83',
|
|
130
|
+
fontSize: '20px'
|
|
131
|
+
}
|
|
132
|
+
}), /*#__PURE__*/_react.React.createElement("div", {
|
|
133
|
+
className: "result-text"
|
|
134
|
+
}, resIndexData.reviewNotes)))), /*#__PURE__*/_react.React.createElement("div", {
|
|
135
|
+
className: "bottom-btn"
|
|
136
|
+
}, /*#__PURE__*/_react.React.createElement("div", {
|
|
137
|
+
className: "btn"
|
|
138
|
+
}, /*#__PURE__*/_react.React.createElement("div", {
|
|
139
|
+
onClick: handleClose
|
|
140
|
+
}, "\u8FD4\u56DE")), /*#__PURE__*/_react.React.createElement("div", {
|
|
141
|
+
className: "btn"
|
|
142
|
+
}, /*#__PURE__*/_react.React.createElement("div", {
|
|
143
|
+
onClick: function onClick() {
|
|
144
|
+
return handleSwitch('prev');
|
|
145
|
+
}
|
|
146
|
+
}, "\u4E0A\u4E00\u9879")), /*#__PURE__*/_react.React.createElement("div", {
|
|
147
|
+
className: "btn btn-blue"
|
|
148
|
+
}, /*#__PURE__*/_react.React.createElement("div", {
|
|
149
|
+
onClick: function onClick() {
|
|
150
|
+
return handleSwitch('next');
|
|
151
|
+
}
|
|
152
|
+
}, "\u4E0B\u4E00\u9879"))), /*#__PURE__*/_react.React.createElement("iframe", {
|
|
153
|
+
ref: imgRef,
|
|
154
|
+
id: "file_check_point",
|
|
155
|
+
frameBorder: "0",
|
|
156
|
+
height: "100%",
|
|
157
|
+
width: "100%",
|
|
158
|
+
style: {
|
|
159
|
+
height: ((_resultData$at2 = resultData.at(-1)) === null || _resultData$at2 === void 0 ? void 0 : _resultData$at2.page) * pageHeight + 'px'
|
|
160
|
+
}
|
|
161
|
+
})));
|
|
162
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
.keyPoint-container {
|
|
2
|
+
// position: sticky;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
// margin-top: -56px;
|
|
5
|
+
width: 100vw;
|
|
6
|
+
position: fixed;
|
|
7
|
+
z-index: 999;
|
|
8
|
+
left: 0;
|
|
9
|
+
top: 0;
|
|
10
|
+
background: #919191;
|
|
11
|
+
overflow-y: scroll;
|
|
12
|
+
#file_check_point {
|
|
13
|
+
overflow: visible !important;
|
|
14
|
+
overflow-clip-margin: unset !important;
|
|
15
|
+
}
|
|
16
|
+
.tipDot-content{
|
|
17
|
+
// height: 100vh;
|
|
18
|
+
width: 100%;
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 0;
|
|
21
|
+
left: 0;
|
|
22
|
+
// overflow: scroll;
|
|
23
|
+
.tip-item{
|
|
24
|
+
position: absolute;
|
|
25
|
+
border-radius: 2px;
|
|
26
|
+
border: 1px solid #15BC83;
|
|
27
|
+
background: rgba(21, 188, 131, 0.1);
|
|
28
|
+
&.active {
|
|
29
|
+
background: rgba(247, 98, 93, 0.1);
|
|
30
|
+
border: 1px solid #F7625D;
|
|
31
|
+
}
|
|
32
|
+
.num{
|
|
33
|
+
width: 20px;
|
|
34
|
+
height: 20px;
|
|
35
|
+
border-radius: 50%;
|
|
36
|
+
font-size: 10px;
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
align-items: center;
|
|
40
|
+
color: #ffffff;
|
|
41
|
+
margin-left: -20px;
|
|
42
|
+
background: #15BC83;
|
|
43
|
+
&.active {
|
|
44
|
+
background: #F7625D;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
.result-outter {
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
padding: 0 24px;
|
|
53
|
+
// border: 1px solid red;
|
|
54
|
+
position: fixed;
|
|
55
|
+
width: 100%;
|
|
56
|
+
bottom: 65px;
|
|
57
|
+
left: 0;
|
|
58
|
+
.result-card {
|
|
59
|
+
border-radius: 10px;
|
|
60
|
+
padding: 16px;
|
|
61
|
+
background: #ffffff;
|
|
62
|
+
border: 1px solid #ddd;
|
|
63
|
+
box-shadow: 0px 4px 10px 0px rgba(177, 188, 200, 0.25);
|
|
64
|
+
.result-title {
|
|
65
|
+
color: #333;
|
|
66
|
+
font-size: 14px;
|
|
67
|
+
margin-bottom: 8px;
|
|
68
|
+
}
|
|
69
|
+
.result-info{
|
|
70
|
+
font-size: 14px;
|
|
71
|
+
margin-bottom: 10px;
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: flex-start;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: 5px;
|
|
76
|
+
// 提示类型: error/judge/pass
|
|
77
|
+
.result-text{
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
}
|
|
83
|
+
.bottom-btn {
|
|
84
|
+
box-sizing: border-box;
|
|
85
|
+
position: fixed;
|
|
86
|
+
bottom: 0;
|
|
87
|
+
left: 0;
|
|
88
|
+
width: 100%;
|
|
89
|
+
background-color: #fff;
|
|
90
|
+
padding: 11px 0;
|
|
91
|
+
display: flex;
|
|
92
|
+
box-shadow: 0px 2px 16px 0px rgba(0, 0, 0, 0.1);
|
|
93
|
+
z-index: 200;
|
|
94
|
+
.btn {
|
|
95
|
+
margin: 0 10px;
|
|
96
|
+
flex: 1;
|
|
97
|
+
color: #323233;
|
|
98
|
+
background-color: #fff;
|
|
99
|
+
border-color: #ebedf0;
|
|
100
|
+
border-width: 1px;
|
|
101
|
+
border-style: solid;
|
|
102
|
+
border-radius: 100px;
|
|
103
|
+
padding: 0 12px;
|
|
104
|
+
font-size: 14px;
|
|
105
|
+
height: 40px;
|
|
106
|
+
position: relative;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: row;
|
|
111
|
+
box-sizing: border-box;
|
|
112
|
+
flex-direction: row;
|
|
113
|
+
}
|
|
114
|
+
.btn-blue {
|
|
115
|
+
color: white;
|
|
116
|
+
border-width: 0px;
|
|
117
|
+
background-image: linear-gradient(rgb(22, 120, 255), rgb(118, 173, 250));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|