cnhis-design-vue 3.3.3-beta.55 → 3.3.3-beta.57
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.
@@ -20,10 +20,12 @@ export declare class Print {
|
|
20
20
|
private _successCallbackFn;
|
21
21
|
private _errorCallbackFn;
|
22
22
|
private _cancelCallbackFn;
|
23
|
+
private _notifyPrintQueueMap;
|
23
24
|
constructor();
|
24
25
|
private readonly messageHandlerQueue;
|
25
26
|
private messageHandler;
|
26
27
|
private _initDomesticSystem;
|
28
|
+
private createQueueProgressNotifyCss;
|
27
29
|
getPicAndUpload(obj: any): Promise<void>;
|
28
30
|
private postMessage;
|
29
31
|
messageCollect(id: string, data: AnyObject): Promise<unknown>;
|
@@ -55,7 +57,7 @@ export declare class Print {
|
|
55
57
|
pageCount: any;
|
56
58
|
formatId: string;
|
57
59
|
};
|
58
|
-
_handleEventDirect({ templateId, formatId, number, svrUpdateIp, apptype, uuid, hideButtons, params, paramsArr, cmdid, print, signature, copies, printdlgshow, nobillnode, btnprint, messageTimeout }: AnyObject): Promise<any>;
|
60
|
+
_handleEventDirect({ templateId, formatId, number, svrUpdateIp, apptype, printname, uuid, priority, hideButtons, params, paramsArr, cmdid, print, signature, copies, printdlgshow, nobillnode, btnprint, messageTimeout }: AnyObject): Promise<any>;
|
59
61
|
_handleEventEditFormat({ templateId, formatId, number, params, token, messageTimeout }: AnyObject): Promise<any>;
|
60
62
|
_queryProxyOrigin(): Promise<void>;
|
61
63
|
_queryPrintFile(formatId: string, params?: string): Promise<any>;
|
@@ -68,7 +70,7 @@ export declare class Print {
|
|
68
70
|
_base64ToBlob(fileBase64: string, fileType: string): Blob;
|
69
71
|
preview({ iReportExecuteMode, hideButtons, templateId, number, formatId: originFormatId, formatItem, params, paramsArr, authorizationKey, signature, btnprint, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<any>;
|
70
72
|
printSync(data: AnyObject[], successCallbackFn: AnyFn, errorCallbackFn: AnyFn): Promise<void>;
|
71
|
-
printDirect({ iReportExecuteMode, templateId, number, formatId: originFormatId, formatItem, params, paramsArr, authorizationKey, print, signature, printdlgshow, nobillnode, copies, svrUpdateIp, apptype, uuid, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, cancelCallbackFn?: AnyFn, mode?: string): Promise<false | undefined>;
|
73
|
+
printDirect({ iReportExecuteMode, templateId, number, formatId: originFormatId, formatItem, params, paramsArr, authorizationKey, print, signature, printdlgshow, nobillnode, copies, svrUpdateIp, apptype, uuid, printname, priority, isShowQueueProgressNotify, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, cancelCallbackFn?: AnyFn, printQueueCallbackFn?: AnyFn, mode?: string): Promise<false | undefined>;
|
72
74
|
printToHiPrint({ templateId, formatId, params, authorizationKey }: any, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, cancelCallbackFn?: AnyFn): Promise<any>;
|
73
75
|
private _downloadPDF;
|
74
76
|
/**
|
@@ -2,7 +2,9 @@ import axios from 'axios';
|
|
2
2
|
import { cloneDeep, isArray } from 'lodash-es';
|
3
3
|
import { IdentityVerificationDialog, PreviewDialog } from './dialog.js';
|
4
4
|
import { isIReport, getFileUrl, useBrowserPrint } from './browserPrint.js';
|
5
|
-
import { getCurrentInstance } from 'vue';
|
5
|
+
import { h, getCurrentInstance } from 'vue';
|
6
|
+
import { createDiscreteApi, NIcon, NProgress } from 'naive-ui';
|
7
|
+
import { ReloadOutline } from '@vicons/ionicons5';
|
6
8
|
import { uuidGenerator } from '../../../../shared/utils/index.js';
|
7
9
|
import { format } from 'date-fns';
|
8
10
|
import { io } from 'socket.io-client';
|
@@ -30,6 +32,13 @@ const PREVIEWIREPOR = `${REMOTEPRINTORIGIN}/bi-api/reprot/print/open/client/prev
|
|
30
32
|
const ERRORMSG = "\u83B7\u53D6\u6587\u4EF6\u5931\u8D25\uFF01";
|
31
33
|
const QUERYPRINTORIGIN = `${REMOTEPRINTORIGIN}/bi-api/reprot/print/open/client/getRemote`;
|
32
34
|
const FILEURL = `${REMOTEPRINTORIGIN}/printService/file`;
|
35
|
+
const {
|
36
|
+
notification
|
37
|
+
} = createDiscreteApi(["notification"], {
|
38
|
+
notificationProviderProps: {
|
39
|
+
placement: "bottom-right"
|
40
|
+
}
|
41
|
+
});
|
33
42
|
let printInstance = null;
|
34
43
|
class Print {
|
35
44
|
constructor() {
|
@@ -51,6 +60,7 @@ class Print {
|
|
51
60
|
this._successCallbackFn = null;
|
52
61
|
this._errorCallbackFn = null;
|
53
62
|
this._cancelCallbackFn = null;
|
63
|
+
this._notifyPrintQueueMap = null;
|
54
64
|
this.messageHandlerQueue = [];
|
55
65
|
this.getIReportFormatId = (isIReport2, formatId) => {
|
56
66
|
return isIReport2 ? formatId.split("_")[1] : formatId;
|
@@ -61,6 +71,10 @@ class Print {
|
|
61
71
|
printInstance = this;
|
62
72
|
const _window = window;
|
63
73
|
this.CMonitor = _window.$CMonitor;
|
74
|
+
this._notifyPrintQueueMap = {
|
75
|
+
data: /* @__PURE__ */ new Map(),
|
76
|
+
callback: /* @__PURE__ */ new Map()
|
77
|
+
};
|
64
78
|
try {
|
65
79
|
this.webview = _window.top ? (_a = _window.top.chrome) == null ? void 0 : _a.webview : (_b = _window.chrome) == null ? void 0 : _b.webview;
|
66
80
|
} catch (error) {
|
@@ -110,8 +124,63 @@ class Print {
|
|
110
124
|
console.log("\u89E3\u6790e.data\u5931\u8D25\uFF0C" + _e);
|
111
125
|
this._handleMonitorNotify("\u89E3\u6790e.data\u5931\u8D25\uFF0C" + e);
|
112
126
|
}
|
113
|
-
if (["print", "pdf", "resetprint"].includes(data == null ? void 0 : data.cmd)) {
|
114
|
-
|
127
|
+
if (["print", "pdf", "resetprint", "printback"].includes(data == null ? void 0 : data.cmd)) {
|
128
|
+
if ((data == null ? void 0 : data.cmd) === "printback") {
|
129
|
+
const {
|
130
|
+
ext = {}
|
131
|
+
} = (data == null ? void 0 : data.data) || {};
|
132
|
+
const curUidDom = this._notifyPrintQueueMap.data.get(ext == null ? void 0 : ext.uuid);
|
133
|
+
const curUidCallback = this._notifyPrintQueueMap.callback.get(ext == null ? void 0 : ext.uuid);
|
134
|
+
const currentV = (ext == null ? void 0 : ext.currentcount) || 0;
|
135
|
+
const totalV = (ext == null ? void 0 : ext.totalcount) || 0;
|
136
|
+
if (curUidDom) {
|
137
|
+
const value = totalV ? parseInt((100 * currentV / totalV).toString()) : 0;
|
138
|
+
curUidDom.content = () => h("div", {}, [h("div", {
|
139
|
+
style: {
|
140
|
+
display: "flex",
|
141
|
+
alignItems: "center",
|
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) {
|
173
|
+
this._notifyPrintQueueMap.data.delete(ext == null ? void 0 : ext.uuid);
|
174
|
+
setTimeout(() => {
|
175
|
+
curUidDom == null ? void 0 : curUidDom.destroy();
|
176
|
+
}, 800);
|
177
|
+
}
|
178
|
+
}
|
179
|
+
if (curUidCallback) {
|
180
|
+
curUidCallback((data == null ? void 0 : data.data) || {});
|
181
|
+
currentV >= totalV && this._notifyPrintQueueMap.callback.delete(ext == null ? void 0 : ext.uuid);
|
182
|
+
}
|
183
|
+
}
|
115
184
|
const handler = this.messageHandlerQueue.shift();
|
116
185
|
if (!handler)
|
117
186
|
return console.log("\u5F53\u524D\u56DE\u6267", e, "\u6CA1\u6709\u53EF\u7528\u7684handler");
|
@@ -190,6 +259,24 @@ class Print {
|
|
190
259
|
cb && cb(false);
|
191
260
|
}
|
192
261
|
}
|
262
|
+
createQueueProgressNotifyCss() {
|
263
|
+
const notifyStyleDom = document.getElementById("queueProgressNotifyCss");
|
264
|
+
if (notifyStyleDom)
|
265
|
+
return;
|
266
|
+
const style = document.createElement("style");
|
267
|
+
style.textContent = `
|
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);
|
279
|
+
}
|
193
280
|
async getPicAndUpload(obj) {
|
194
281
|
try {
|
195
282
|
const isObject = (o) => Object.prototype.toString.call(o) === "[object Object]";
|
@@ -559,7 +646,9 @@ class Print {
|
|
559
646
|
number,
|
560
647
|
svrUpdateIp,
|
561
648
|
apptype,
|
649
|
+
printname,
|
562
650
|
uuid,
|
651
|
+
priority,
|
563
652
|
hideButtons,
|
564
653
|
params,
|
565
654
|
paramsArr,
|
@@ -578,7 +667,9 @@ class Print {
|
|
578
667
|
number,
|
579
668
|
svrUpdateIp,
|
580
669
|
apptype,
|
670
|
+
printname,
|
581
671
|
uuid,
|
672
|
+
priority,
|
582
673
|
hideButtons,
|
583
674
|
params,
|
584
675
|
cmdid,
|
@@ -924,9 +1015,12 @@ class Print {
|
|
924
1015
|
svrUpdateIp,
|
925
1016
|
apptype,
|
926
1017
|
uuid,
|
1018
|
+
printname,
|
1019
|
+
priority,
|
1020
|
+
isShowQueueProgressNotify = false,
|
927
1021
|
isDownloadFile = true,
|
928
1022
|
messageTimeout = 0
|
929
|
-
}, successCallbackFn, errorCallbackFn, cancelCallbackFn, mode = "printDirect") {
|
1023
|
+
}, successCallbackFn, errorCallbackFn, cancelCallbackFn, printQueueCallbackFn, mode = "printDirect") {
|
930
1024
|
const isObject = (o) => Object.prototype.toString.call(o) === "[object Object]";
|
931
1025
|
const iReportStatus = isIReport(originFormatId);
|
932
1026
|
const formatId = this.getIReportFormatId(iReportStatus, originFormatId);
|
@@ -992,6 +1086,53 @@ class Print {
|
|
992
1086
|
}];
|
993
1087
|
params = "";
|
994
1088
|
}
|
1089
|
+
if (uuid && printname) {
|
1090
|
+
if (isShowQueueProgressNotify) {
|
1091
|
+
this.createQueueProgressNotifyCss();
|
1092
|
+
const notifyDom = notification.create({
|
1093
|
+
title: `${printname}`,
|
1094
|
+
content: () => h("div", {}, [h("div", {
|
1095
|
+
style: {
|
1096
|
+
display: "flex",
|
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
|
+
}
|
1131
|
+
});
|
1132
|
+
this._notifyPrintQueueMap.data.set(uuid, notifyDom);
|
1133
|
+
}
|
1134
|
+
this._notifyPrintQueueMap.callback.set(uuid, printQueueCallbackFn);
|
1135
|
+
}
|
995
1136
|
const printdlgshowValue = printdlgshow != "0" ? printdlgshow : (formatItem == null ? void 0 : formatItem.showPrintDialog) ? "1" : "0";
|
996
1137
|
const result = await this._handleEventDirect({
|
997
1138
|
templateId,
|
@@ -1007,6 +1148,8 @@ class Print {
|
|
1007
1148
|
copies,
|
1008
1149
|
svrUpdateIp,
|
1009
1150
|
apptype,
|
1151
|
+
printname,
|
1152
|
+
priority,
|
1010
1153
|
uuid,
|
1011
1154
|
messageTimeout
|
1012
1155
|
});
|
@@ -1145,6 +1288,8 @@ class Print {
|
|
1145
1288
|
}
|
1146
1289
|
}, (err) => onReject(err), (err) => {
|
1147
1290
|
console.log(err);
|
1291
|
+
}, (result) => {
|
1292
|
+
console.log(result);
|
1148
1293
|
}, "downloadPDF");
|
1149
1294
|
}
|
1150
1295
|
async print({
|
@@ -18,7 +18,7 @@ export type FieldSetItem = Partial<{
|
|
18
18
|
hide: boolean;
|
19
19
|
[key: string]: any;
|
20
20
|
}>;
|
21
|
-
export type FieldSetColumnName = 'show' | 'editable' | 'required' | 'sort' | 'bold' | 'sortDirection' | 'sortPriority' | 'fixedWay' | 'alias' | 'columnWidth' | 'hideExpression' | 'isSearch' | 'isSum' | 'isAvg';
|
21
|
+
export type FieldSetColumnName = 'title' | 'show' | 'editable' | 'required' | 'sort' | 'bold' | 'sortDirection' | 'sortPriority' | 'fixedWay' | 'alias' | 'columnWidth' | 'hideExpression' | 'isSearch' | 'isSum' | 'isAvg';
|
22
22
|
export type FieldSetColumnItem = {
|
23
23
|
title: string;
|
24
24
|
type: 'text' | 'checkbox' | 'select' | 'input' | 'inputNumber' | 'color' | 'custom';
|
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.57",
|
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": "b23d52297f4db2219ed53d4026f16ae90ca52799"
|
78
78
|
}
|