ydb-components-material 0.1.21 → 0.1.23

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 (55) hide show
  1. package/build/docs/404.html +3 -3
  2. package/build/docs/_demos/:uuid +3 -3
  3. package/build/docs/colorful-button.html +3 -3
  4. package/build/docs/colorful-input.html +3 -3
  5. package/build/docs/index.html +3 -3
  6. package/build/docs/static/close.e2e8764a.svg +1 -0
  7. package/build/docs/umi.d170f160.js +1 -0
  8. package/build/docs/{umi.4278bf7b.css → umi.e536bfab.css} +1 -1
  9. package/build/docs/~demos/:uuid.html +3 -3
  10. package/build/docs/~demos/colorful-button-demo.html +3 -3
  11. package/build/docs/~demos/colorful-input-demo.html +3 -3
  12. package/build/lowcode/assets-daily.json +11 -11
  13. package/build/lowcode/assets-dev.json +2 -2
  14. package/build/lowcode/assets-prod.json +11 -11
  15. package/build/lowcode/index.js +1 -1
  16. package/build/lowcode/meta.js +1 -1
  17. package/build/lowcode/preview.js +8 -8
  18. package/build/lowcode/render/default/view.css +1 -1
  19. package/build/lowcode/render/default/view.js +1 -1
  20. package/build/lowcode/view.css +1 -1
  21. package/build/lowcode/view.js +1 -1
  22. package/dist/BizComps.css +1 -1
  23. package/dist/BizComps.js +1 -1
  24. package/dist/BizComps.js.map +1 -1
  25. package/es/api.js +27 -7
  26. package/es/components/file-item/file.js +65 -5
  27. package/es/components/file-item/icon/close.svg +1 -0
  28. package/es/components/file-item/index.d.ts +9 -5
  29. package/es/components/file-item/index.js +320 -63
  30. package/es/components/file-item/index.scss +42 -3
  31. package/es/components/file-item/seal.js +111 -12
  32. package/es/components/file-item/sealUtil.js +129 -32
  33. package/es/components/file-item/sign.js +20 -16
  34. package/es/components/file-item/signUtil.js +3 -3
  35. package/es/components/scene-tree/index.js +1 -0
  36. package/es/utils.js +0 -0
  37. package/lib/api.js +28 -8
  38. package/lib/components/file-item/file.js +66 -5
  39. package/lib/components/file-item/icon/close.svg +1 -0
  40. package/lib/components/file-item/index.d.ts +9 -5
  41. package/lib/components/file-item/index.js +321 -64
  42. package/lib/components/file-item/index.scss +42 -3
  43. package/lib/components/file-item/seal.js +110 -11
  44. package/lib/components/file-item/sealUtil.js +128 -31
  45. package/lib/components/file-item/sign.js +20 -16
  46. package/lib/components/file-item/signUtil.js +3 -3
  47. package/lib/components/scene-tree/index.js +1 -0
  48. package/lib/utils.js +1 -0
  49. package/lowcode/file-item/meta.ts +63 -15
  50. package/lowcode_es/file-item/meta.js +60 -15
  51. package/lowcode_es/meta.js +1 -1
  52. package/lowcode_lib/file-item/meta.js +60 -15
  53. package/lowcode_lib/meta.js +1 -1
  54. package/package.json +3 -3
  55. package/build/docs/umi.b1d4b795.js +0 -1
package/es/api.js CHANGED
@@ -1,11 +1,14 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  export var post = /*#__PURE__*/function () {
4
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(url, data, config) {
4
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(url, data, config, noJson) {
5
5
  var res;
6
6
  return _regeneratorRuntime.wrap(function (_context) {
7
7
  while (1) switch (_context.prev = _context.next) {
8
8
  case 0:
9
+ if (noJson === void 0) {
10
+ noJson = false;
11
+ }
9
12
  _context.next = 1;
10
13
  return fetch(url, {
11
14
  method: 'POST',
@@ -16,7 +19,8 @@ export var post = /*#__PURE__*/function () {
16
19
  },
17
20
  body: JSON.stringify(data)
18
21
  }).then(function (response) {
19
- return response.json();
22
+ console.log('response', response, response.body);
23
+ return noJson ? response.text() : response.json();
20
24
  }).then(function (res) {
21
25
  return res;
22
26
  })["catch"](function (err) {
@@ -31,7 +35,7 @@ export var post = /*#__PURE__*/function () {
31
35
  }
32
36
  }, _callee);
33
37
  }));
34
- return function post(_x, _x2, _x3) {
38
+ return function post(_x, _x2, _x3, _x4) {
35
39
  return _ref.apply(this, arguments);
36
40
  };
37
41
  }();
@@ -63,7 +67,7 @@ export var get = /*#__PURE__*/function () {
63
67
  }
64
68
  }, _callee2);
65
69
  }));
66
- return function get(_x4, _x5, _x6) {
70
+ return function get(_x5, _x6, _x7) {
67
71
  return _ref2.apply(this, arguments);
68
72
  };
69
73
  }();
@@ -96,15 +100,31 @@ export var documentDownload = function documentDownload(params, config) {
96
100
  return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/signapproval/api/documentDownload", params, config);
97
101
  };
98
102
  export var qrySealApi = function qrySealApi(params, config) {
99
- return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/sign/api/qrySeal", params, config);
103
+ return post(config.baseUrl + "/declaration/center/sign/api/qrySeal", params, config);
100
104
  };
101
105
 
106
+ // 获取电子签章页面
107
+ export var getSignOrderIdApi = function getSignOrderIdApi(params, config) {
108
+ return post(config.baseUrl + "/declaration/center/sign/api/outSignCreateSiggOrder", params, config);
109
+ };
102
110
  // 获取电子签章页面
103
111
  export var getSealUrlApi = function getSealUrlApi(params, config) {
104
- return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/sign/api/signWebByDirect", params, config);
112
+ return post(config.baseUrl + "/declaration/center/sign/api/signWebByDirectMobile", params, config, true);
105
113
  };
106
114
 
107
115
  // 电子签章-下载文件
108
116
  export var signFileDownApi = function signFileDownApi(params, config) {
109
- return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/sign/api/fileDownloadBySign", params, config);
117
+ return post(config.baseUrl + "/declaration/center/sign/api/fileDownloadBySign", params, config);
118
+ };
119
+
120
+ // 预览
121
+ export var previewApi = function previewApi(params, config) {
122
+ return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/center/sign/api/preview", params, config);
123
+ };
124
+ // 材料库
125
+ export var getMaterialLib = function getMaterialLib(params, config) {
126
+ return post("https://zwfwpt.sxzwfw.gov.cn/DeclarationAPI/declaration/material/queryFileByCardNo", params, config);
127
+ };
128
+ export var getSignFileApi = function getSignFileApi(params, config) {
129
+ return post(config.baseUrl + "/declaration/center/sign/api/getSignFileList", params, config);
110
130
  };
@@ -93,18 +93,17 @@ export function dataURLtoBlob(dataUrl) {
93
93
  }
94
94
 
95
95
  // 上传文件至申报端的服务器 [方法]
96
- export function uploadFilePromise(url, token) {
97
- // const { baseURL } = apiConfig
96
+ export function uploadFilePromise(url, baseUrl, token) {
98
97
  return new Promise(function (resolve, reject) {
99
98
  var formData = new FormData();
100
99
  formData.append('file', url);
101
100
  formData.append('open', true);
102
101
  formData.append('open', 'true');
103
- fetch('http://172.16.132.12:5005/declaration/material/file/files/api', {
102
+ fetch(baseUrl + "/declaration/material/file/files/api", {
104
103
  method: 'POST',
105
104
  body: formData,
106
105
  header: {
107
- // Authorization: 'rjvntrnggysagvpqhi7qfasqpd2hz736qap5vkikjgni3h3g4a5gcsawoooosvb2523mo5ifltk22vdki2u5q6vd2ceefhy5sk6e2kofxadn354ridcbcypgqgcljs27bhdnviiza7hdnbnwlh6e4yxe45kapm7y3wb6qqod5wysmjirbl6iwtaz3tzve7rdxq6blrfdqygjsfi5iosrwmpiumocr52tufnpcan2hdzydamjvbso2hmbrp32aymb2cahlcv2liswbhpwiqvf72anhnyycoyr3lwfp4xufasn7cbb2sxq'
106
+ Authorization: token
108
107
  }
109
108
  }).then(function (response) {
110
109
  return response.json();
@@ -161,4 +160,65 @@ export function uploadFilePromise(url, token) {
161
160
  // }
162
161
  // })
163
162
  });
164
- }
163
+ }
164
+
165
+ // 初始化材料格式 [方法]
166
+ export var initFormat = function initFormat(materialSpec) {
167
+ var materialSpecArr = materialSpec.split(',');
168
+ var arr = [{
169
+ key: '1',
170
+ value: 'doc'
171
+ }, {
172
+ key: '2',
173
+ value: 'docx'
174
+ }, {
175
+ key: '3',
176
+ value: 'pdf'
177
+ }, {
178
+ key: '4',
179
+ value: 'ofd'
180
+ }, {
181
+ key: '5',
182
+ value: 'xlsx'
183
+ }, {
184
+ key: '6',
185
+ value: 'xls'
186
+ }, {
187
+ key: '7',
188
+ value: 'png'
189
+ }, {
190
+ key: '8',
191
+ value: 'jpg'
192
+ }, {
193
+ key: '9',
194
+ value: 'jpeg'
195
+ }, {
196
+ key: '10',
197
+ value: 'gif'
198
+ }, {
199
+ key: '11',
200
+ value: 'bmp'
201
+ }, {
202
+ key: '12',
203
+ value: 'zip'
204
+ }, {
205
+ key: '13',
206
+ value: 'rar'
207
+ }, {
208
+ key: '14',
209
+ value: 'mp3'
210
+ }, {
211
+ key: '15',
212
+ value: 'mp4'
213
+ }, {
214
+ key: '16',
215
+ value: 'xml'
216
+ }];
217
+ var formatArr = [];
218
+ arr.forEach(function (ele) {
219
+ if (materialSpecArr.includes(ele.key)) {
220
+ formatArr.push(ele.value);
221
+ }
222
+ });
223
+ return formatArr;
224
+ };
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><defs><clipPath id="master_svg0_106_93607"><rect x="0" y="0" width="24" height="24" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_106_93607)"><path d="M10.62774178125,12.00024228125L3.78474200125,5.15724198125C3.40573692325,4.77823618125,3.40573692325,4.16374743125,3.7847423512500002,3.7847423512500002C4.16374779125,3.40573692325,4.77823648125,3.40573692325,5.15724198125,3.78474200125L12.00024228125,10.62774178125L18.843241281250002,3.78474200125C19.222301281249997,3.40605306625,19.83653228125,3.40620327025,20.21540428125,3.78507745125C20.59428028125,4.16395199125,20.59443128125,4.77818178125,20.21574428125,5.15724198125L13.37274168125,12.00024228125L20.21574028125,18.843241281250002C20.59474528125,19.22224728125,20.59474528125,19.83673828125,20.21574028125,20.21574028125C19.83673428125,20.59474528125,19.22224428125,20.59474528125,18.843241281250002,20.21574428125L12.00024228125,13.37274168125L5.15724198125,20.21574428125C4.77818178125,20.59443128125,4.16395163125,20.59428028125,3.78507709125,20.21540428125C3.40620291225,19.83653228125,3.40605306625,19.222301281249997,3.78474200125,18.843241281250002L10.62774178125,12.00024228125Z" fill="#FFFFFF" fill-opacity="1" style="mix-blend-mode:passthrough"/></g></svg>
@@ -4,24 +4,28 @@ export interface FileItemProps {
4
4
  /**
5
5
  * 标题
6
6
  */
7
- file: string;
7
+ fileUrl: string;
8
8
  fileName: string;
9
+ fileId: string;
9
10
  fileType: string;
10
11
  guideImg: string;
11
12
  checkImg: string;
12
- approvalUrl: string;
13
- signatureUrl: string;
13
+ signatureEnable: boolean;
14
+ signEnable: boolean;
14
15
  token: string;
15
16
  accessToken: string;
16
- isApproval: boolean;
17
- isSignature: boolean;
17
+ isSigned: boolean;
18
+ isSealed: boolean;
18
19
  materialList: any[];
19
20
  maxFileSize: number;
21
+ spec: string;
20
22
  isInValid: boolean;
21
23
  isShowLib: boolean;
22
24
  userInfo: any;
25
+ baseUrl: string;
23
26
  del: () => void;
24
27
  valChange: (value: any) => void;
28
+ download: (value: any) => void;
25
29
  }
26
30
  declare const FileItem: React.FC<FileItemProps>;
27
31
  export default FileItem;