ydb-components-material 0.1.210 → 0.1.212
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.4eade7fa.js → umi.7c36bbcf.js} +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/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/components/file-list/item.js +61 -39
- package/lib/components/file-list/item.js +61 -39
- package/lowcode_es/meta.js +1 -1
- package/lowcode_lib/meta.js +1 -1
- package/package.json +3 -3
|
@@ -516,7 +516,7 @@ var FileItem = function FileItem(_ref) {
|
|
|
516
516
|
return k + 1;
|
|
517
517
|
});
|
|
518
518
|
setIsShowSignPage(true);
|
|
519
|
-
|
|
519
|
+
saveStorage();
|
|
520
520
|
};
|
|
521
521
|
|
|
522
522
|
// 签章
|
|
@@ -1099,53 +1099,75 @@ var FileItem = function FileItem(_ref) {
|
|
|
1099
1099
|
// - 外层组件会修改 file.loading,需要在 loading 变为 false 时启动轮询
|
|
1100
1100
|
// - 轮询自身会把 loading 置为 true,所以必须幂等,且不能在依赖变化时清理定时器
|
|
1101
1101
|
useEffect(function () {
|
|
1102
|
-
if (
|
|
1102
|
+
if (pollingRef.current) return;
|
|
1103
|
+
|
|
1104
|
+
// 只把「读取/解析本地签批信息」放在 try 里,避免后面的逻辑异常被静默吞掉
|
|
1105
|
+
var signInfo = null;
|
|
1103
1106
|
try {
|
|
1104
1107
|
var stored = localStorage.getItem(fileId);
|
|
1105
1108
|
if (!stored) return;
|
|
1106
1109
|
console.log('stored---', stored);
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1110
|
+
signInfo = JSON.parse(stored);
|
|
1111
|
+
} catch (e) {
|
|
1112
|
+
console.error('读取签批信息失败', e);
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1115
|
+
var _ref11 = signInfo || {},
|
|
1116
|
+
contrId = _ref11.contractId,
|
|
1117
|
+
docId = _ref11.documentId,
|
|
1118
|
+
nameVal = _ref11.fileName,
|
|
1119
|
+
originalUrl = _ref11.fileUrl;
|
|
1120
|
+
console.log('docId', docId, contrId, nameVal);
|
|
1121
|
+
if (!(docId && contrId && nameVal)) return;
|
|
1122
|
+
originalUrlRef.current = originalUrl || '';
|
|
1123
|
+
localStorage.removeItem(fileId);
|
|
1124
|
+
pollingRef.current = true;
|
|
1125
|
+
// openLoading()
|
|
1126
|
+
setSignPolling(true);
|
|
1127
|
+
// 先启动轮询,避免 valChange 抛错或触发刷新导致轮询没起来
|
|
1128
|
+
// 兜底:连续 10 次轮询仍未成功则结束轮询,避免无限请求
|
|
1129
|
+
var pollCount = 0;
|
|
1130
|
+
timerRef.current = setInterval(function () {
|
|
1131
|
+
console.log('start polling----');
|
|
1132
|
+
getSignedFile(docId, contrId, nameVal)["catch"](function (e) {
|
|
1133
|
+
// 单次请求异常按失败处理,避免未处理的 rejection 打断轮询
|
|
1134
|
+
console.error('轮询签批结果异常', e);
|
|
1135
|
+
return false;
|
|
1136
|
+
}).then(function (success) {
|
|
1137
|
+
// 成功时 getSignedFile 内部会清除轮询并关闭 loading
|
|
1138
|
+
if (!success) {
|
|
1139
|
+
pollCount += 1;
|
|
1140
|
+
if (pollCount >= 10) {
|
|
1141
|
+
clearInterval(timerRef.current);
|
|
1142
|
+
timerRef.current = null;
|
|
1143
|
+
pollingRef.current = false;
|
|
1144
|
+
closeLoading();
|
|
1145
|
+
setSignPolling(false);
|
|
1146
|
+
try {
|
|
1136
1147
|
valChange(_extends({}, file, {
|
|
1137
1148
|
loading: false
|
|
1138
1149
|
}), fileIndex, index, subIndex);
|
|
1139
|
-
|
|
1150
|
+
} catch (e) {
|
|
1151
|
+
console.error('更新文件 loading 状态失败', e);
|
|
1140
1152
|
}
|
|
1141
|
-
|
|
1142
|
-
pollingRef.current = false;
|
|
1143
|
-
setSignPolling(false);
|
|
1153
|
+
_Message.error('签批结果获取失败,请重试');
|
|
1144
1154
|
}
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1155
|
+
} else {
|
|
1156
|
+
pollingRef.current = false;
|
|
1157
|
+
setSignPolling(false);
|
|
1158
|
+
}
|
|
1159
|
+
});
|
|
1160
|
+
}, 3000);
|
|
1161
|
+
|
|
1162
|
+
// 再把 loading 标记到 file 对象上;即使这里抛错也不能影响已启动的轮询
|
|
1163
|
+
try {
|
|
1164
|
+
valChange(_extends({}, file, {
|
|
1165
|
+
loading: true
|
|
1166
|
+
}), fileIndex, index, subIndex);
|
|
1167
|
+
} catch (e) {
|
|
1168
|
+
console.error('更新文件 loading 状态失败', e);
|
|
1169
|
+
}
|
|
1170
|
+
}, [fileId]);
|
|
1149
1171
|
|
|
1150
1172
|
// 仅在卸载时清理定时器;不能放进上面的 effect,否则 loading 变化会清掉正在进行的轮询
|
|
1151
1173
|
useEffect(function () {
|
|
@@ -522,7 +522,7 @@ var FileItem = function FileItem(_ref) {
|
|
|
522
522
|
return k + 1;
|
|
523
523
|
});
|
|
524
524
|
setIsShowSignPage(true);
|
|
525
|
-
|
|
525
|
+
saveStorage();
|
|
526
526
|
};
|
|
527
527
|
|
|
528
528
|
// 签章
|
|
@@ -1105,53 +1105,75 @@ var FileItem = function FileItem(_ref) {
|
|
|
1105
1105
|
// - 外层组件会修改 file.loading,需要在 loading 变为 false 时启动轮询
|
|
1106
1106
|
// - 轮询自身会把 loading 置为 true,所以必须幂等,且不能在依赖变化时清理定时器
|
|
1107
1107
|
(0, _react.useEffect)(function () {
|
|
1108
|
-
if (
|
|
1108
|
+
if (pollingRef.current) return;
|
|
1109
|
+
|
|
1110
|
+
// 只把「读取/解析本地签批信息」放在 try 里,避免后面的逻辑异常被静默吞掉
|
|
1111
|
+
var signInfo = null;
|
|
1109
1112
|
try {
|
|
1110
1113
|
var stored = localStorage.getItem(fileId);
|
|
1111
1114
|
if (!stored) return;
|
|
1112
1115
|
console.log('stored---', stored);
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1116
|
+
signInfo = JSON.parse(stored);
|
|
1117
|
+
} catch (e) {
|
|
1118
|
+
console.error('读取签批信息失败', e);
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
var _ref11 = signInfo || {},
|
|
1122
|
+
contrId = _ref11.contractId,
|
|
1123
|
+
docId = _ref11.documentId,
|
|
1124
|
+
nameVal = _ref11.fileName,
|
|
1125
|
+
originalUrl = _ref11.fileUrl;
|
|
1126
|
+
console.log('docId', docId, contrId, nameVal);
|
|
1127
|
+
if (!(docId && contrId && nameVal)) return;
|
|
1128
|
+
originalUrlRef.current = originalUrl || '';
|
|
1129
|
+
localStorage.removeItem(fileId);
|
|
1130
|
+
pollingRef.current = true;
|
|
1131
|
+
// openLoading()
|
|
1132
|
+
setSignPolling(true);
|
|
1133
|
+
// 先启动轮询,避免 valChange 抛错或触发刷新导致轮询没起来
|
|
1134
|
+
// 兜底:连续 10 次轮询仍未成功则结束轮询,避免无限请求
|
|
1135
|
+
var pollCount = 0;
|
|
1136
|
+
timerRef.current = setInterval(function () {
|
|
1137
|
+
console.log('start polling----');
|
|
1138
|
+
getSignedFile(docId, contrId, nameVal)["catch"](function (e) {
|
|
1139
|
+
// 单次请求异常按失败处理,避免未处理的 rejection 打断轮询
|
|
1140
|
+
console.error('轮询签批结果异常', e);
|
|
1141
|
+
return false;
|
|
1142
|
+
}).then(function (success) {
|
|
1143
|
+
// 成功时 getSignedFile 内部会清除轮询并关闭 loading
|
|
1144
|
+
if (!success) {
|
|
1145
|
+
pollCount += 1;
|
|
1146
|
+
if (pollCount >= 10) {
|
|
1147
|
+
clearInterval(timerRef.current);
|
|
1148
|
+
timerRef.current = null;
|
|
1149
|
+
pollingRef.current = false;
|
|
1150
|
+
closeLoading();
|
|
1151
|
+
setSignPolling(false);
|
|
1152
|
+
try {
|
|
1142
1153
|
valChange((0, _extends3["default"])({}, file, {
|
|
1143
1154
|
loading: false
|
|
1144
1155
|
}), fileIndex, index, subIndex);
|
|
1145
|
-
|
|
1156
|
+
} catch (e) {
|
|
1157
|
+
console.error('更新文件 loading 状态失败', e);
|
|
1146
1158
|
}
|
|
1147
|
-
|
|
1148
|
-
pollingRef.current = false;
|
|
1149
|
-
setSignPolling(false);
|
|
1159
|
+
_message["default"].error('签批结果获取失败,请重试');
|
|
1150
1160
|
}
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1161
|
+
} else {
|
|
1162
|
+
pollingRef.current = false;
|
|
1163
|
+
setSignPolling(false);
|
|
1164
|
+
}
|
|
1165
|
+
});
|
|
1166
|
+
}, 3000);
|
|
1167
|
+
|
|
1168
|
+
// 再把 loading 标记到 file 对象上;即使这里抛错也不能影响已启动的轮询
|
|
1169
|
+
try {
|
|
1170
|
+
valChange((0, _extends3["default"])({}, file, {
|
|
1171
|
+
loading: true
|
|
1172
|
+
}), fileIndex, index, subIndex);
|
|
1173
|
+
} catch (e) {
|
|
1174
|
+
console.error('更新文件 loading 状态失败', e);
|
|
1175
|
+
}
|
|
1176
|
+
}, [fileId]);
|
|
1155
1177
|
|
|
1156
1178
|
// 仅在卸载时清理定时器;不能放进上面的 effect,否则 loading 变化会清掉正在进行的轮询
|
|
1157
1179
|
(0, _react.useEffect)(function () {
|
package/lowcode_es/meta.js
CHANGED
|
@@ -101,7 +101,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
|
|
|
101
101
|
packageName = 'ydb-components-material';
|
|
102
102
|
}
|
|
103
103
|
if (version === void 0) {
|
|
104
|
-
version = '0.1.
|
|
104
|
+
version = '0.1.212';
|
|
105
105
|
}
|
|
106
106
|
if (basicLibraryVersion === void 0) {
|
|
107
107
|
basicLibraryVersion = {
|
package/lowcode_lib/meta.js
CHANGED
|
@@ -106,7 +106,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
|
|
|
106
106
|
packageName = 'ydb-components-material';
|
|
107
107
|
}
|
|
108
108
|
if (version === void 0) {
|
|
109
|
-
version = '0.1.
|
|
109
|
+
version = '0.1.212';
|
|
110
110
|
}
|
|
111
111
|
if (basicLibraryVersion === void 0) {
|
|
112
112
|
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.212",
|
|
4
4
|
"description": "ydb-components-material",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -103,10 +103,10 @@
|
|
|
103
103
|
},
|
|
104
104
|
"componentConfig": {
|
|
105
105
|
"isComponentLibrary": true,
|
|
106
|
-
"materialSchema": "https://unpkg.com/ydb-components-material@0.1.
|
|
106
|
+
"materialSchema": "https://unpkg.com/ydb-components-material@0.1.212/build/lowcode/assets-prod.json"
|
|
107
107
|
},
|
|
108
108
|
"lcMeta": {
|
|
109
109
|
"type": "component"
|
|
110
110
|
},
|
|
111
|
-
"homepage": "https://unpkg.com/ydb-components-material@0.1.
|
|
111
|
+
"homepage": "https://unpkg.com/ydb-components-material@0.1.212/build/index.html"
|
|
112
112
|
}
|