ydb-components-material 0.1.162 → 0.1.164
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.b0b8da74.js +1 -0
- 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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/dist/BizComps.js +1 -1
- package/dist/BizComps.js.map +1 -1
- package/es/api.js +5 -0
- package/es/components/file-list/index.js +42 -10
- package/es/components/file-list/item.js +8 -3
- package/es/components/scene-tree/index.js +1 -1
- package/lib/api.js +6 -1
- package/lib/components/file-list/index.js +42 -10
- package/lib/components/file-list/item.js +8 -3
- package/lib/components/scene-tree/index.js +1 -1
- package/lowcode_es/meta.js +1 -1
- package/lowcode_lib/meta.js +1 -1
- package/package.json +3 -3
- package/build/docs/umi.2cb4e8e7.js +0 -1
package/es/api.js
CHANGED
|
@@ -160,4 +160,9 @@ export var getIcons = function getIcons(params, config) {
|
|
|
160
160
|
};
|
|
161
161
|
export var getGuideImg = function getGuideImg(params, config) {
|
|
162
162
|
return get(config.baseUrl + "/declaration/material/file/files/api/presigned-url", params, config);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// 查字典项
|
|
166
|
+
export var getDictByCode = function getDictByCode(params, config) {
|
|
167
|
+
return get(config.baseUrl + "/configuration/item-dict/queryByCode", params, config);
|
|
163
168
|
};
|
|
@@ -2,6 +2,7 @@ import _Balloon from "@alifd/next/es/balloon";
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import React, { useEffect, useState } from 'react';
|
|
4
4
|
import { getFileExtension } from "./file.js";
|
|
5
|
+
import { getDictByCode } from "../../api";
|
|
5
6
|
import Merge from "./merge";
|
|
6
7
|
import FileItem from "./item";
|
|
7
8
|
import "./index.scss";
|
|
@@ -15,8 +16,8 @@ var MATERIAL_TYPE = {
|
|
|
15
16
|
var MATERIAL_FORMAT = {
|
|
16
17
|
1: 'doc',
|
|
17
18
|
2: 'docx',
|
|
18
|
-
3: '
|
|
19
|
-
4: '
|
|
19
|
+
3: 'pdf',
|
|
20
|
+
4: 'ofd',
|
|
20
21
|
5: 'xlsx',
|
|
21
22
|
6: 'xls',
|
|
22
23
|
7: 'png',
|
|
@@ -54,6 +55,37 @@ var FileList = function FileList(_ref) {
|
|
|
54
55
|
var _useState = useState(fileList),
|
|
55
56
|
fileArray = _useState[0],
|
|
56
57
|
setFileArray = _useState[1];
|
|
58
|
+
// 材料格式字典:value -> key,替换硬编码的 MATERIAL_FORMAT
|
|
59
|
+
var _useState2 = useState({}),
|
|
60
|
+
materialSpecMap = _useState2[0],
|
|
61
|
+
setMaterialSpecMap = _useState2[1];
|
|
62
|
+
useEffect(function () {
|
|
63
|
+
// 页面初始化时查询材料格式字典
|
|
64
|
+
getDictByCode({
|
|
65
|
+
dictCode: 'material_spec'
|
|
66
|
+
}, {
|
|
67
|
+
token: token,
|
|
68
|
+
tokenTY: tokenTY,
|
|
69
|
+
baseUrl: baseUrl,
|
|
70
|
+
env: env,
|
|
71
|
+
isPC: isPC
|
|
72
|
+
}).then(function (res) {
|
|
73
|
+
if (res && Array.isArray(res.data)) {
|
|
74
|
+
var map = {};
|
|
75
|
+
res.data.forEach(function (item) {
|
|
76
|
+
map[item.key] = item.value;
|
|
77
|
+
});
|
|
78
|
+
setMaterialSpecMap(map);
|
|
79
|
+
}
|
|
80
|
+
})["catch"](function (err) {
|
|
81
|
+
console.error('查询材料格式字典失败', err);
|
|
82
|
+
});
|
|
83
|
+
}, []);
|
|
84
|
+
|
|
85
|
+
// 根据字典映射格式 code 为格式名,字典未加载时退回硬编码 MATERIAL_FORMAT
|
|
86
|
+
var formatName = function formatName(code) {
|
|
87
|
+
return materialSpecMap[code] || MATERIAL_FORMAT[code] || code;
|
|
88
|
+
};
|
|
57
89
|
useEffect(function () {
|
|
58
90
|
var stored = localStorage.getItem(tokenTY);
|
|
59
91
|
console.log('fileList-stored', stored);
|
|
@@ -66,17 +98,17 @@ var FileList = function FileList(_ref) {
|
|
|
66
98
|
setFileArray(fileList);
|
|
67
99
|
}
|
|
68
100
|
}, [fileList]);
|
|
69
|
-
var
|
|
70
|
-
showMerge =
|
|
71
|
-
setShowMerge =
|
|
72
|
-
var
|
|
101
|
+
var _useState3 = useState(false),
|
|
102
|
+
showMerge = _useState3[0],
|
|
103
|
+
setShowMerge = _useState3[1];
|
|
104
|
+
var _useState4 = useState({
|
|
73
105
|
materialName: '',
|
|
74
106
|
fileList: [],
|
|
75
107
|
index: 0,
|
|
76
108
|
subIndex: 0
|
|
77
109
|
}),
|
|
78
|
-
curMerge =
|
|
79
|
-
setCurMerge =
|
|
110
|
+
curMerge = _useState4[0],
|
|
111
|
+
setCurMerge = _useState4[1];
|
|
80
112
|
var convertNumbersToChinese = function convertNumbersToChinese(str) {
|
|
81
113
|
// 定义基础映射关系
|
|
82
114
|
var digitMap = {
|
|
@@ -106,7 +138,7 @@ var FileList = function FileList(_ref) {
|
|
|
106
138
|
materialType = item.materialType;
|
|
107
139
|
if (!materialSpec) return '';
|
|
108
140
|
var formatText = materialSpec.split(',').map(function (i) {
|
|
109
|
-
return
|
|
141
|
+
return formatName(i);
|
|
110
142
|
}).join('、');
|
|
111
143
|
var sizeText = materialSize ? "\u5355\u4E2A\u4E0D\u8D85\u8FC7\u3010" + materialSize + "MB\u3011" : '';
|
|
112
144
|
return "\u9700\u4E0A\u4F20\u3010" + MATERIAL_TYPE[materialType] + "\u3011\uFF0C\u652F\u6301\u3010" + formatText + "\u3011\u683C\u5F0F\u3002" + sizeText;
|
|
@@ -123,7 +155,7 @@ var FileList = function FileList(_ref) {
|
|
|
123
155
|
var groupId = fileArray[index].subMaterials[subIndex].groupId;
|
|
124
156
|
if (!materialSpec) return '';
|
|
125
157
|
var formatText = materialSpec.split(',').map(function (i) {
|
|
126
|
-
return
|
|
158
|
+
return formatName(i);
|
|
127
159
|
}).join('、');
|
|
128
160
|
var sameGroupIdMaterials = subMaterials.filter(function (m) {
|
|
129
161
|
return m.groupId === groupId;
|
|
@@ -577,9 +577,14 @@ var FileItem = function FileItem(_ref) {
|
|
|
577
577
|
var safeSignatureAgentRole = signatureAgentRole !== null && signatureAgentRole !== void 0 ? signatureAgentRole : [];
|
|
578
578
|
var safeSignSelfRole = signSelfRole !== null && signSelfRole !== void 0 ? signSelfRole : [];
|
|
579
579
|
var safeSignAgentRole = signAgentRole !== null && signAgentRole !== void 0 ? signAgentRole : [];
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
580
|
+
// 区分自办/代办场景:代办(signerInfo 非空)看 AgentRole,自办看 SelfRole
|
|
581
|
+
var isAgent = Object.keys(signerInfo).length > 0;
|
|
582
|
+
var safeSignatureRole = isAgent ? safeSignatureAgentRole : safeSignatureSelfRole;
|
|
583
|
+
var safeSignRole = isAgent ? safeSignAgentRole : safeSignSelfRole;
|
|
584
|
+
// 自己不需要签署、但需要别人签署时,直接打开维护签署人信息
|
|
585
|
+
var notNeedSelfSign = !safeSignatureRole.includes(SELF) && !safeSignRole.includes(SELF);
|
|
586
|
+
var needOtherSignInScenario = safeSignatureRole.includes(OTHER) || safeSignRole.includes(OTHER);
|
|
587
|
+
if (notNeedSelfSign && needOtherSignInScenario) {
|
|
583
588
|
setShowSignerInfo(true);
|
|
584
589
|
return;
|
|
585
590
|
}
|
|
@@ -92,7 +92,7 @@ var SceneTree = function SceneTree(_ref) {
|
|
|
92
92
|
if (Array.isArray(targetOption.mutuallyExclusiveOptions) && targetOption.mutuallyExclusiveOptions.length) {
|
|
93
93
|
targetOption.mutuallyExclusiveOptions.forEach(function (mutuallyExclusiveOption) {
|
|
94
94
|
var targetMutuallyExclusiveOption = targetNodeOfCurTree.options.find(function (option) {
|
|
95
|
-
return option.
|
|
95
|
+
return option.groupId === mutuallyExclusiveOption;
|
|
96
96
|
});
|
|
97
97
|
console.log('targetMutuallyExclusiveOption--', targetMutuallyExclusiveOption);
|
|
98
98
|
if (targetMutuallyExclusiveOption) {
|
package/lib/api.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.signurl = exports.signFileDownApi = exports.qrySealApi = exports.previewApi = exports.post = exports.onlinePreview = exports.getUrlById = exports.getSignOrderIdApi = exports.getSignFileApi = exports.getSealUrlApi = exports.getPcSealUrlApi = exports.getMaterialPreview = exports.getMaterialLib = exports.getIcons = exports.getGuideImg = exports.get = exports.fileUploadApi = exports.documentDownload = exports.createbycategory = exports.contractSignUrl = exports.contractFinish = exports.checkSignState = void 0;
|
|
5
|
+
exports.signurl = exports.signFileDownApi = exports.qrySealApi = exports.previewApi = exports.post = exports.onlinePreview = exports.getUrlById = exports.getSignOrderIdApi = exports.getSignFileApi = exports.getSealUrlApi = exports.getPcSealUrlApi = exports.getMaterialPreview = exports.getMaterialLib = exports.getIcons = exports.getGuideImg = exports.getDictByCode = exports.get = exports.fileUploadApi = exports.documentDownload = exports.createbycategory = exports.contractSignUrl = exports.contractFinish = exports.checkSignState = void 0;
|
|
6
6
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
7
7
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
8
|
var _axios = _interopRequireDefault(require("axios"));
|
|
@@ -165,4 +165,9 @@ var getIcons = exports.getIcons = function getIcons(params, config) {
|
|
|
165
165
|
};
|
|
166
166
|
var getGuideImg = exports.getGuideImg = function getGuideImg(params, config) {
|
|
167
167
|
return get(config.baseUrl + "/declaration/material/file/files/api/presigned-url", params, config);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
// 查字典项
|
|
171
|
+
var getDictByCode = exports.getDictByCode = function getDictByCode(params, config) {
|
|
172
|
+
return get(config.baseUrl + "/configuration/item-dict/queryByCode", params, config);
|
|
168
173
|
};
|
|
@@ -7,6 +7,7 @@ var _balloon = _interopRequireDefault(require("@alifd/next/lib/balloon"));
|
|
|
7
7
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _file = require("./file.js");
|
|
10
|
+
var _api = require("../../api");
|
|
10
11
|
var _merge = _interopRequireDefault(require("./merge"));
|
|
11
12
|
var _item = _interopRequireDefault(require("./item"));
|
|
12
13
|
require("./index.scss");
|
|
@@ -21,8 +22,8 @@ var MATERIAL_TYPE = {
|
|
|
21
22
|
var MATERIAL_FORMAT = {
|
|
22
23
|
1: 'doc',
|
|
23
24
|
2: 'docx',
|
|
24
|
-
3: '
|
|
25
|
-
4: '
|
|
25
|
+
3: 'pdf',
|
|
26
|
+
4: 'ofd',
|
|
26
27
|
5: 'xlsx',
|
|
27
28
|
6: 'xls',
|
|
28
29
|
7: 'png',
|
|
@@ -60,6 +61,37 @@ var FileList = function FileList(_ref) {
|
|
|
60
61
|
var _useState = (0, _react.useState)(fileList),
|
|
61
62
|
fileArray = _useState[0],
|
|
62
63
|
setFileArray = _useState[1];
|
|
64
|
+
// 材料格式字典:value -> key,替换硬编码的 MATERIAL_FORMAT
|
|
65
|
+
var _useState2 = (0, _react.useState)({}),
|
|
66
|
+
materialSpecMap = _useState2[0],
|
|
67
|
+
setMaterialSpecMap = _useState2[1];
|
|
68
|
+
(0, _react.useEffect)(function () {
|
|
69
|
+
// 页面初始化时查询材料格式字典
|
|
70
|
+
(0, _api.getDictByCode)({
|
|
71
|
+
dictCode: 'material_spec'
|
|
72
|
+
}, {
|
|
73
|
+
token: token,
|
|
74
|
+
tokenTY: tokenTY,
|
|
75
|
+
baseUrl: baseUrl,
|
|
76
|
+
env: env,
|
|
77
|
+
isPC: isPC
|
|
78
|
+
}).then(function (res) {
|
|
79
|
+
if (res && Array.isArray(res.data)) {
|
|
80
|
+
var map = {};
|
|
81
|
+
res.data.forEach(function (item) {
|
|
82
|
+
map[item.key] = item.value;
|
|
83
|
+
});
|
|
84
|
+
setMaterialSpecMap(map);
|
|
85
|
+
}
|
|
86
|
+
})["catch"](function (err) {
|
|
87
|
+
console.error('查询材料格式字典失败', err);
|
|
88
|
+
});
|
|
89
|
+
}, []);
|
|
90
|
+
|
|
91
|
+
// 根据字典映射格式 code 为格式名,字典未加载时退回硬编码 MATERIAL_FORMAT
|
|
92
|
+
var formatName = function formatName(code) {
|
|
93
|
+
return materialSpecMap[code] || MATERIAL_FORMAT[code] || code;
|
|
94
|
+
};
|
|
63
95
|
(0, _react.useEffect)(function () {
|
|
64
96
|
var stored = localStorage.getItem(tokenTY);
|
|
65
97
|
console.log('fileList-stored', stored);
|
|
@@ -72,17 +104,17 @@ var FileList = function FileList(_ref) {
|
|
|
72
104
|
setFileArray(fileList);
|
|
73
105
|
}
|
|
74
106
|
}, [fileList]);
|
|
75
|
-
var
|
|
76
|
-
showMerge =
|
|
77
|
-
setShowMerge =
|
|
78
|
-
var
|
|
107
|
+
var _useState3 = (0, _react.useState)(false),
|
|
108
|
+
showMerge = _useState3[0],
|
|
109
|
+
setShowMerge = _useState3[1];
|
|
110
|
+
var _useState4 = (0, _react.useState)({
|
|
79
111
|
materialName: '',
|
|
80
112
|
fileList: [],
|
|
81
113
|
index: 0,
|
|
82
114
|
subIndex: 0
|
|
83
115
|
}),
|
|
84
|
-
curMerge =
|
|
85
|
-
setCurMerge =
|
|
116
|
+
curMerge = _useState4[0],
|
|
117
|
+
setCurMerge = _useState4[1];
|
|
86
118
|
var convertNumbersToChinese = function convertNumbersToChinese(str) {
|
|
87
119
|
// 定义基础映射关系
|
|
88
120
|
var digitMap = {
|
|
@@ -112,7 +144,7 @@ var FileList = function FileList(_ref) {
|
|
|
112
144
|
materialType = item.materialType;
|
|
113
145
|
if (!materialSpec) return '';
|
|
114
146
|
var formatText = materialSpec.split(',').map(function (i) {
|
|
115
|
-
return
|
|
147
|
+
return formatName(i);
|
|
116
148
|
}).join('、');
|
|
117
149
|
var sizeText = materialSize ? "\u5355\u4E2A\u4E0D\u8D85\u8FC7\u3010" + materialSize + "MB\u3011" : '';
|
|
118
150
|
return "\u9700\u4E0A\u4F20\u3010" + MATERIAL_TYPE[materialType] + "\u3011\uFF0C\u652F\u6301\u3010" + formatText + "\u3011\u683C\u5F0F\u3002" + sizeText;
|
|
@@ -129,7 +161,7 @@ var FileList = function FileList(_ref) {
|
|
|
129
161
|
var groupId = fileArray[index].subMaterials[subIndex].groupId;
|
|
130
162
|
if (!materialSpec) return '';
|
|
131
163
|
var formatText = materialSpec.split(',').map(function (i) {
|
|
132
|
-
return
|
|
164
|
+
return formatName(i);
|
|
133
165
|
}).join('、');
|
|
134
166
|
var sameGroupIdMaterials = subMaterials.filter(function (m) {
|
|
135
167
|
return m.groupId === groupId;
|
|
@@ -583,9 +583,14 @@ var FileItem = function FileItem(_ref) {
|
|
|
583
583
|
var safeSignatureAgentRole = signatureAgentRole !== null && signatureAgentRole !== void 0 ? signatureAgentRole : [];
|
|
584
584
|
var safeSignSelfRole = signSelfRole !== null && signSelfRole !== void 0 ? signSelfRole : [];
|
|
585
585
|
var safeSignAgentRole = signAgentRole !== null && signAgentRole !== void 0 ? signAgentRole : [];
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
586
|
+
// 区分自办/代办场景:代办(signerInfo 非空)看 AgentRole,自办看 SelfRole
|
|
587
|
+
var isAgent = Object.keys(signerInfo).length > 0;
|
|
588
|
+
var safeSignatureRole = isAgent ? safeSignatureAgentRole : safeSignatureSelfRole;
|
|
589
|
+
var safeSignRole = isAgent ? safeSignAgentRole : safeSignSelfRole;
|
|
590
|
+
// 自己不需要签署、但需要别人签署时,直接打开维护签署人信息
|
|
591
|
+
var notNeedSelfSign = !safeSignatureRole.includes(SELF) && !safeSignRole.includes(SELF);
|
|
592
|
+
var needOtherSignInScenario = safeSignatureRole.includes(OTHER) || safeSignRole.includes(OTHER);
|
|
593
|
+
if (notNeedSelfSign && needOtherSignInScenario) {
|
|
589
594
|
setShowSignerInfo(true);
|
|
590
595
|
return;
|
|
591
596
|
}
|
|
@@ -98,7 +98,7 @@ var SceneTree = function SceneTree(_ref) {
|
|
|
98
98
|
if (Array.isArray(targetOption.mutuallyExclusiveOptions) && targetOption.mutuallyExclusiveOptions.length) {
|
|
99
99
|
targetOption.mutuallyExclusiveOptions.forEach(function (mutuallyExclusiveOption) {
|
|
100
100
|
var targetMutuallyExclusiveOption = targetNodeOfCurTree.options.find(function (option) {
|
|
101
|
-
return option.
|
|
101
|
+
return option.groupId === mutuallyExclusiveOption;
|
|
102
102
|
});
|
|
103
103
|
console.log('targetMutuallyExclusiveOption--', targetMutuallyExclusiveOption);
|
|
104
104
|
if (targetMutuallyExclusiveOption) {
|
package/lowcode_es/meta.js
CHANGED
|
@@ -98,7 +98,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
|
|
|
98
98
|
packageName = 'ydb-components-material';
|
|
99
99
|
}
|
|
100
100
|
if (version === void 0) {
|
|
101
|
-
version = '0.1.
|
|
101
|
+
version = '0.1.164';
|
|
102
102
|
}
|
|
103
103
|
if (basicLibraryVersion === void 0) {
|
|
104
104
|
basicLibraryVersion = {
|
package/lowcode_lib/meta.js
CHANGED
|
@@ -103,7 +103,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
|
|
|
103
103
|
packageName = 'ydb-components-material';
|
|
104
104
|
}
|
|
105
105
|
if (version === void 0) {
|
|
106
|
-
version = '0.1.
|
|
106
|
+
version = '0.1.164';
|
|
107
107
|
}
|
|
108
108
|
if (basicLibraryVersion === void 0) {
|
|
109
109
|
basicLibraryVersion = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ydb-components-material",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.164",
|
|
4
4
|
"description": "ydb-components-material",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -102,10 +102,10 @@
|
|
|
102
102
|
},
|
|
103
103
|
"componentConfig": {
|
|
104
104
|
"isComponentLibrary": true,
|
|
105
|
-
"materialSchema": "https://unpkg.com/ydb-components-material@0.1.
|
|
105
|
+
"materialSchema": "https://unpkg.com/ydb-components-material@0.1.164/build/lowcode/assets-prod.json"
|
|
106
106
|
},
|
|
107
107
|
"lcMeta": {
|
|
108
108
|
"type": "component"
|
|
109
109
|
},
|
|
110
|
-
"homepage": "https://unpkg.com/ydb-components-material@0.1.
|
|
110
|
+
"homepage": "https://unpkg.com/ydb-components-material@0.1.164/build/index.html"
|
|
111
111
|
}
|