cnhis-design-vue 3.3.3-beta.59 → 3.3.3-beta.61
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.
@@ -25,7 +25,7 @@ export declare class Print {
|
|
25
25
|
private readonly messageHandlerQueue;
|
26
26
|
private messageHandler;
|
27
27
|
private _initDomesticSystem;
|
28
|
-
private
|
28
|
+
private renderQueueProgressNotifyContent;
|
29
29
|
getPicAndUpload(obj: any): Promise<void>;
|
30
30
|
private postMessage;
|
31
31
|
messageCollect(id: string, data: AnyObject): Promise<unknown>;
|
@@ -3,8 +3,7 @@ import { cloneDeep, isArray } from 'lodash-es';
|
|
3
3
|
import { IdentityVerificationDialog, PreviewDialog } from './dialog.js';
|
4
4
|
import { isIReport, getFileUrl, useBrowserPrint } from './browserPrint.js';
|
5
5
|
import { h, getCurrentInstance } from 'vue';
|
6
|
-
import { createDiscreteApi,
|
7
|
-
import { ReloadOutline } from '@vicons/ionicons5';
|
6
|
+
import { createDiscreteApi, NProgress, NDivider } from 'naive-ui';
|
8
7
|
import { uuidGenerator } from '../../../../shared/utils/index.js';
|
9
8
|
import { format } from 'date-fns';
|
10
9
|
import { io } from 'socket.io-client';
|
@@ -73,7 +72,8 @@ class Print {
|
|
73
72
|
this.CMonitor = _window.$CMonitor;
|
74
73
|
this._notifyPrintQueueMap = {
|
75
74
|
data: /* @__PURE__ */ new Map(),
|
76
|
-
callback: /* @__PURE__ */ new Map()
|
75
|
+
callback: /* @__PURE__ */ new Map(),
|
76
|
+
dom: null
|
77
77
|
};
|
78
78
|
try {
|
79
79
|
this.webview = _window.top ? (_a = _window.top.chrome) == null ? void 0 : _a.webview : (_b = _window.chrome) == null ? void 0 : _b.webview;
|
@@ -134,45 +134,14 @@ class Print {
|
|
134
134
|
const currentV = (ext == null ? void 0 : ext.currentcount) || 0;
|
135
135
|
const totalV = (ext == null ? void 0 : ext.totalcount) || 0;
|
136
136
|
if (curUidDom) {
|
137
|
-
|
138
|
-
curUidDom.
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
fontSize: "12px",
|
143
|
-
marginBottom: "8px"
|
144
|
-
}
|
145
|
-
}, [h(NIcon, {
|
146
|
-
color: "#0e7a0d",
|
147
|
-
size: 12,
|
148
|
-
component: ReloadOutline,
|
149
|
-
style: {
|
150
|
-
animation: "rotateQueueProgressNotify 1s linear infinite",
|
151
|
-
willChange: "transform",
|
152
|
-
backfaceVisibility: "hidden"
|
153
|
-
}
|
154
|
-
}), h("span", {
|
155
|
-
style: {
|
156
|
-
color: "#0e7a0d",
|
157
|
-
marginLeft: "4px",
|
158
|
-
marginRight: "8px"
|
159
|
-
}
|
160
|
-
}, "\u6B63\u5728\u6253\u5370\u4E2D..."), h("span", {}, `${value}%`)]), h(NProgress, {
|
161
|
-
type: "line",
|
162
|
-
strokeWidth: 2,
|
163
|
-
percentage: value,
|
164
|
-
showIndicator: false,
|
165
|
-
processing: value < 100 ? true : false
|
166
|
-
}), h("div", {
|
167
|
-
style: {
|
168
|
-
marginTop: "6px",
|
169
|
-
fontSize: "12px"
|
170
|
-
}
|
171
|
-
}, `\u5DF2\u5B8C\u6210${currentV}\u6761\uFF0C\u5171${totalV}\u6761`)]);
|
172
|
-
if (value >= 100) {
|
137
|
+
curUidDom.currentV = currentV;
|
138
|
+
curUidDom.totalV = totalV;
|
139
|
+
curUidDom.progressValue = totalV ? parseInt((100 * currentV / totalV).toString()) : 0;
|
140
|
+
this.renderQueueProgressNotifyContent();
|
141
|
+
if (curUidDom.progressValue >= 100) {
|
173
142
|
this._notifyPrintQueueMap.data.delete(ext == null ? void 0 : ext.uuid);
|
174
143
|
setTimeout(() => {
|
175
|
-
|
144
|
+
this.renderQueueProgressNotifyContent();
|
176
145
|
}, 800);
|
177
146
|
}
|
178
147
|
}
|
@@ -259,23 +228,89 @@ class Print {
|
|
259
228
|
cb && cb(false);
|
260
229
|
}
|
261
230
|
}
|
262
|
-
|
263
|
-
const
|
264
|
-
|
231
|
+
renderQueueProgressNotifyContent() {
|
232
|
+
const clearNotifyDom = () => {
|
233
|
+
this._notifyPrintQueueMap.dom.destroy();
|
234
|
+
this._notifyPrintQueueMap.data.clear();
|
235
|
+
this._notifyPrintQueueMap.dom = null;
|
236
|
+
};
|
237
|
+
if (!this._notifyPrintQueueMap.dom) {
|
238
|
+
this._notifyPrintQueueMap.dom = notification.create({
|
239
|
+
title: "\u6253\u5370\u5217\u8868",
|
240
|
+
onClose: () => {
|
241
|
+
clearNotifyDom();
|
242
|
+
}
|
243
|
+
});
|
244
|
+
}
|
245
|
+
if (this._notifyPrintQueueMap.data.size > 0) {
|
246
|
+
const childrens = [];
|
247
|
+
const keys = Array.from(this._notifyPrintQueueMap.data.keys());
|
248
|
+
const lastKey = keys[keys.length - 1];
|
249
|
+
for (const [key, value] of this._notifyPrintQueueMap.data) {
|
250
|
+
const dom = h("div", {
|
251
|
+
style: {
|
252
|
+
boxSizing: "border-box",
|
253
|
+
marginBottom: lastKey === key ? 0 : "12px",
|
254
|
+
display: "flex",
|
255
|
+
flexDirection: "column"
|
256
|
+
}
|
257
|
+
}, [h("div", {
|
258
|
+
style: {
|
259
|
+
display: "flex",
|
260
|
+
alignItems: "center",
|
261
|
+
justifyContent: "between-space",
|
262
|
+
overflow: "hidden",
|
263
|
+
marginBottom: "4px"
|
264
|
+
}
|
265
|
+
}, [h("span", {
|
266
|
+
style: {
|
267
|
+
flex: 1,
|
268
|
+
fontSize: "14px",
|
269
|
+
fontWeight: 700,
|
270
|
+
marginRight: "6px",
|
271
|
+
overflow: "hidden",
|
272
|
+
whiteSpace: "noWrap",
|
273
|
+
textOverflow: "ellipsis"
|
274
|
+
}
|
275
|
+
}, value.printname), h("span", {
|
276
|
+
style: {
|
277
|
+
fontSize: "12px",
|
278
|
+
color: "rgba(30, 30, 30, 0.60)"
|
279
|
+
}
|
280
|
+
}, `${value.progressValue}%`)]), h(NProgress, {
|
281
|
+
type: "line",
|
282
|
+
strokeWidth: 2,
|
283
|
+
percentage: value.progressValue,
|
284
|
+
showIndicator: false,
|
285
|
+
processing: true
|
286
|
+
}), h("div", {
|
287
|
+
style: {
|
288
|
+
marginTop: "6px",
|
289
|
+
display: "flex",
|
290
|
+
alignItems: "center",
|
291
|
+
fontSize: "12px",
|
292
|
+
color: "rgba(30, 30, 30, 0.60)"
|
293
|
+
}
|
294
|
+
}, [h("span", {}, "\u7B2C"), h("span", {
|
295
|
+
style: {
|
296
|
+
color: "#FF0000"
|
297
|
+
}
|
298
|
+
}, value.currentV), h("span", {}, "\u4EFD/\u5171"), h("span", {
|
299
|
+
style: {
|
300
|
+
color: "#FF0000"
|
301
|
+
}
|
302
|
+
}, value.totalV), h("span", {}, "\u4EFD")]), lastKey === key ? null : h(NDivider, {
|
303
|
+
style: {
|
304
|
+
marginTop: "12px",
|
305
|
+
marginBottom: 0
|
306
|
+
}
|
307
|
+
})]);
|
308
|
+
childrens.push(dom);
|
309
|
+
}
|
310
|
+
this._notifyPrintQueueMap.dom.content = () => childrens;
|
265
311
|
return;
|
266
|
-
|
267
|
-
|
268
|
-
@keyframes rotateQueueProgressNotify {
|
269
|
-
from {
|
270
|
-
transform: rotate(0deg);
|
271
|
-
}
|
272
|
-
to {
|
273
|
-
transform: rotate(360deg);
|
274
|
-
}
|
275
|
-
}
|
276
|
-
`;
|
277
|
-
style.id = "queueProgressNotifyCss";
|
278
|
-
document.head.appendChild(style);
|
312
|
+
}
|
313
|
+
clearNotifyDom();
|
279
314
|
}
|
280
315
|
async getPicAndUpload(obj) {
|
281
316
|
try {
|
@@ -1088,48 +1123,14 @@ class Print {
|
|
1088
1123
|
}
|
1089
1124
|
if (uuid && printname) {
|
1090
1125
|
if (isShowQueueProgressNotify) {
|
1091
|
-
this.
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
alignItems: "center",
|
1098
|
-
fontSize: "12px",
|
1099
|
-
marginBottom: "8px"
|
1100
|
-
}
|
1101
|
-
}, [h(NIcon, {
|
1102
|
-
color: "#0e7a0d",
|
1103
|
-
size: 12,
|
1104
|
-
component: ReloadOutline,
|
1105
|
-
style: {
|
1106
|
-
animation: "rotateQueueProgressNotify 1s linear infinite",
|
1107
|
-
willChange: "transform",
|
1108
|
-
backfaceVisibility: "hidden"
|
1109
|
-
}
|
1110
|
-
}), h("span", {
|
1111
|
-
style: {
|
1112
|
-
color: "#0e7a0d",
|
1113
|
-
marginLeft: "4px",
|
1114
|
-
marginRight: "8px"
|
1115
|
-
}
|
1116
|
-
}, "\u6B63\u5728\u6253\u5370\u4E2D..."), h("span", {}, "0%")]), h(NProgress, {
|
1117
|
-
type: "line",
|
1118
|
-
strokeWidth: 2,
|
1119
|
-
percentage: 0,
|
1120
|
-
showIndicator: false,
|
1121
|
-
processing: true
|
1122
|
-
}), h("div", {
|
1123
|
-
style: {
|
1124
|
-
marginTop: "6px",
|
1125
|
-
fontSize: "12px"
|
1126
|
-
}
|
1127
|
-
}, `\u5DF2\u5B8C\u62100\u6761\uFF0C\u5171${paramsArr.length}\u6761`)]),
|
1128
|
-
onClose: () => {
|
1129
|
-
this._notifyPrintQueueMap.data.delete(uuid);
|
1130
|
-
}
|
1126
|
+
this._notifyPrintQueueMap.data.set(uuid, {
|
1127
|
+
printname,
|
1128
|
+
uuid,
|
1129
|
+
currentV: 0,
|
1130
|
+
totalV: paramsArr.length,
|
1131
|
+
progressValue: 0
|
1131
1132
|
});
|
1132
|
-
this.
|
1133
|
+
this.renderQueueProgressNotifyContent();
|
1133
1134
|
}
|
1134
1135
|
this._notifyPrintQueueMap.callback.set(uuid, printQueueCallbackFn);
|
1135
1136
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "cnhis-design-vue",
|
3
|
-
"version": "3.3.3-beta.
|
3
|
+
"version": "3.3.3-beta.61",
|
4
4
|
"license": "ISC",
|
5
5
|
"module": "./es/components/index.js",
|
6
6
|
"main": "./es/components/index.js",
|
@@ -74,5 +74,5 @@
|
|
74
74
|
"iOS 7",
|
75
75
|
"last 3 iOS versions"
|
76
76
|
],
|
77
|
-
"gitHead": "
|
77
|
+
"gitHead": "ca79a2e2af6d422573c63bc2237ea3f64fd59a6e"
|
78
78
|
}
|