cnhis-design-vue 3.1.31-beta.0 → 3.1.31-beta.2
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/README.md +123 -123
- package/es/components/button-print/index.d.ts +23 -45
- package/es/components/button-print/index.js +1 -1
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +23 -45
- package/es/components/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +46 -84
- package/es/components/button-print/src/components/IdentityVerification.js +15 -6
- package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +23 -30
- package/es/components/button-print/src/components/edit.js +23 -12
- package/es/components/button-print/src/components/edit.vue.d.ts +8 -20
- package/es/components/button-print/src/utils/browserPrint.d.ts +2 -1
- package/es/components/button-print/src/utils/browserPrint.js +5 -1
- package/es/components/button-print/src/utils/dialog.d.ts +1 -1
- package/es/components/button-print/src/utils/dialog.js +4 -2
- package/es/components/button-print/src/utils/index.js +1 -1
- package/es/components/button-print/src/utils/print.d.ts +3 -2
- package/es/components/button-print/src/utils/print.js +41 -3
- package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +3 -2
- package/es/components/form-render/src/hooks/useBusinessBinding.js +20 -17
- package/es/components/iho-table/index.d.ts +36 -36
- package/es/components/iho-table/src/IhoTable.vue.d.ts +36 -36
- package/es/components/index.js +1 -1
- package/es/components/keyboard/src/Keyboard.js +2 -2
- package/es/shared/assets/img/failure.js +1 -1
- package/es/shared/assets/img/icon-asc.js +1 -1
- package/es/shared/assets/img/icon-desc.js +1 -1
- package/es/shared/assets/img/no-permission.js +1 -1
- package/es/shared/assets/img/nodata.js +1 -1
- package/es/shared/assets/img/notfound.js +1 -1
- package/es/shared/assets/img/qr.js +1 -1
- package/es/shared/assets/img/success.js +1 -1
- package/es/shared/assets/img/video.js +1 -1
- package/es/shared/assets/img/video_default_cover.js +1 -1
- package/es/shared/assets/img/video_hover.js +1 -1
- package/es/shared/assets/img/video_play_hover.js +1 -1
- package/es/shared/assets/img/xb_big.js +1 -1
- package/es/shared/assets/img/xb_small.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/tapable/index.d.ts +0 -139
|
@@ -3,7 +3,7 @@ import { isObject } from '@vue/shared';
|
|
|
3
3
|
import { useMessage, NDropdown, NButton, NIcon } from 'naive-ui';
|
|
4
4
|
import { ChevronDown } from '@vicons/ionicons5';
|
|
5
5
|
import { Print } from './utils/print.js';
|
|
6
|
-
import {
|
|
6
|
+
import { isIReport } from './utils/browserPrint.js';
|
|
7
7
|
import IdentityVerification from './components/IdentityVerification.js';
|
|
8
8
|
import { format } from 'date-fns';
|
|
9
9
|
|
|
@@ -67,10 +67,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
67
67
|
printdlgshow: {
|
|
68
68
|
default: "0",
|
|
69
69
|
type: String
|
|
70
|
-
},
|
|
71
|
-
queryPrintFile: {
|
|
72
|
-
type: Function,
|
|
73
|
-
default: () => Promise.resolve({})
|
|
74
70
|
}
|
|
75
71
|
},
|
|
76
72
|
emits: ["success", "error", "clickoutside"],
|
|
@@ -92,8 +88,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
92
88
|
},
|
|
93
89
|
isInited: false,
|
|
94
90
|
watchPrintParamsReformatFn: null,
|
|
95
|
-
spinTimer: null
|
|
96
|
-
fileObject: null
|
|
91
|
+
spinTimer: null
|
|
97
92
|
});
|
|
98
93
|
const options = reactive([{
|
|
99
94
|
label: props.printText,
|
|
@@ -179,21 +174,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
179
174
|
params = Object.assign({}, JSON.parse(getPrintParams(0)), obj);
|
|
180
175
|
return JSON.stringify(params);
|
|
181
176
|
};
|
|
182
|
-
const browserPrint = async (mode) => {
|
|
183
|
-
if (state.fileObject) {
|
|
184
|
-
useBrowserPrint(state.fileObject, mode);
|
|
185
|
-
} else {
|
|
186
|
-
const queryParams = {
|
|
187
|
-
formatId: state.currentFormatId,
|
|
188
|
-
params: getOnceParams()
|
|
189
|
-
};
|
|
190
|
-
const {
|
|
191
|
-
data
|
|
192
|
-
} = await props.queryPrintFile(queryParams) || {};
|
|
193
|
-
state.fileObject = data;
|
|
194
|
-
useBrowserPrint(data, mode);
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
177
|
const handleClickPrint = () => {
|
|
198
178
|
let len = state.printParams.length;
|
|
199
179
|
const callLocalServicesSuccessCbTmp = async (data) => {
|
|
@@ -208,31 +188,26 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
208
188
|
props.prevFn().catch(() => {
|
|
209
189
|
prevFnError();
|
|
210
190
|
return Promise.reject();
|
|
211
|
-
}).then(
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
printdlgshow: props.printdlgshow
|
|
220
|
-
};
|
|
221
|
-
if (props.strategy === "MULTI") {
|
|
222
|
-
for (let i = 0; i < state.printParams.length; i++) {
|
|
223
|
-
printInstance.printDirect({
|
|
224
|
-
...queryParams,
|
|
225
|
-
params: getPrintParams(i)
|
|
226
|
-
}, callLocalServicesSuccessCbTmp, callLocalServicesErrorCb);
|
|
227
|
-
}
|
|
228
|
-
} else {
|
|
191
|
+
}).then(() => {
|
|
192
|
+
const queryParams = {
|
|
193
|
+
formatId: state.currentFormatId,
|
|
194
|
+
templateId: getTemplateIdByFormatId.value,
|
|
195
|
+
printdlgshow: props.printdlgshow
|
|
196
|
+
};
|
|
197
|
+
if (props.strategy === "MULTI") {
|
|
198
|
+
for (let i = 0; i < state.printParams.length; i++) {
|
|
229
199
|
printInstance.printDirect({
|
|
230
200
|
...queryParams,
|
|
231
|
-
params:
|
|
232
|
-
},
|
|
233
|
-
callLocalServicesSuccessCb(res, "print");
|
|
234
|
-
}, callLocalServicesErrorCb);
|
|
201
|
+
params: getPrintParams(i)
|
|
202
|
+
}, callLocalServicesSuccessCbTmp, callLocalServicesErrorCb);
|
|
235
203
|
}
|
|
204
|
+
} else {
|
|
205
|
+
printInstance.printDirect({
|
|
206
|
+
...queryParams,
|
|
207
|
+
params: getOnceParams()
|
|
208
|
+
}, (res) => {
|
|
209
|
+
callLocalServicesSuccessCb(res, "print");
|
|
210
|
+
}, callLocalServicesErrorCb);
|
|
236
211
|
}
|
|
237
212
|
}).finally(() => {
|
|
238
213
|
state.visible = false;
|
|
@@ -242,21 +217,16 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
242
217
|
props.prevFn().catch(() => {
|
|
243
218
|
prevFnError();
|
|
244
219
|
return Promise.reject();
|
|
245
|
-
}).then(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
};
|
|
256
|
-
printInstance.preview(queryParams, (res) => {
|
|
257
|
-
callLocalServicesSuccessCb(res, "preview");
|
|
258
|
-
}, callLocalServicesErrorCb);
|
|
259
|
-
}
|
|
220
|
+
}).then(() => {
|
|
221
|
+
const params = props.strategy === "MULTI" ? getPrintParams() : getOnceParams();
|
|
222
|
+
const queryParams = {
|
|
223
|
+
formatId: state.currentFormatId,
|
|
224
|
+
templateId: getTemplateIdByFormatId.value,
|
|
225
|
+
params
|
|
226
|
+
};
|
|
227
|
+
printInstance.preview(queryParams, (res) => {
|
|
228
|
+
callLocalServicesSuccessCb(res, "preview");
|
|
229
|
+
}, callLocalServicesErrorCb);
|
|
260
230
|
}).finally(() => {
|
|
261
231
|
state.visible = false;
|
|
262
232
|
});
|
|
@@ -265,23 +235,18 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
265
235
|
props.prevFn().catch(() => {
|
|
266
236
|
prevFnError();
|
|
267
237
|
return Promise.reject();
|
|
268
|
-
}).then(
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
},
|
|
281
|
-
params
|
|
282
|
-
};
|
|
283
|
-
printInstance.downloadPDF(queryParams, (res) => callLocalServicesSuccessCb(res, "preview"), callLocalServicesErrorCb);
|
|
284
|
-
}
|
|
238
|
+
}).then(() => {
|
|
239
|
+
const params = props.strategy === "MULTI" ? getPrintParams() : getOnceParams();
|
|
240
|
+
const queryParams = {
|
|
241
|
+
formatId: state.currentFormatId,
|
|
242
|
+
templateId: getTemplateIdByFormatId.value,
|
|
243
|
+
print: {
|
|
244
|
+
print: "1",
|
|
245
|
+
type: "1"
|
|
246
|
+
},
|
|
247
|
+
params
|
|
248
|
+
};
|
|
249
|
+
printInstance.downloadPDF(queryParams, (res) => callLocalServicesSuccessCb(res, "preview"), callLocalServicesErrorCb);
|
|
285
250
|
}).finally(() => {
|
|
286
251
|
state.visible = false;
|
|
287
252
|
});
|
|
@@ -312,7 +277,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
312
277
|
break;
|
|
313
278
|
default:
|
|
314
279
|
state.currentFormatId = key;
|
|
315
|
-
state.fileObject = null;
|
|
316
280
|
state.visible = false;
|
|
317
281
|
break;
|
|
318
282
|
}
|
|
@@ -406,7 +370,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
406
370
|
var _a;
|
|
407
371
|
state.formatList = formatListResult ? formatFormatList(formatListResult.obj) : [];
|
|
408
372
|
state.currentFormatId = getDefaultFormatId(state.formatList, "defaultFlag");
|
|
409
|
-
state.fileObject = null;
|
|
410
373
|
if (!state.currentFormatId) {
|
|
411
374
|
$message.error("\u83B7\u53D6\u6253\u5370\u683C\u5F0F\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01");
|
|
412
375
|
return requestError();
|
|
@@ -461,10 +424,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
461
424
|
state.printParams = formatParams(state.templateParams, props.params);
|
|
462
425
|
};
|
|
463
426
|
const verifiySuccess = (token) => {
|
|
464
|
-
var _a;
|
|
465
427
|
state.identityVerification.visible = false;
|
|
466
|
-
if ((
|
|
467
|
-
return;
|
|
428
|
+
if (isIReport(state.currentFormatId))
|
|
429
|
+
return callLocalServicesSuccessCb(null, "edit");
|
|
468
430
|
const queryParams = {
|
|
469
431
|
formatId: state.currentFormatId,
|
|
470
432
|
templateId: getTemplateIdByFormatId.value,
|
|
@@ -489,7 +451,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
489
451
|
deep: true
|
|
490
452
|
});
|
|
491
453
|
return (_ctx, _cache) => {
|
|
492
|
-
var _a;
|
|
493
454
|
return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(NDropdown), {
|
|
494
455
|
class: "c-dropdown",
|
|
495
456
|
placement: "bottom-start",
|
|
@@ -518,9 +479,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
518
479
|
}, 8, ["show", "options"]), createVNode(IdentityVerification, mergeProps(_ctx.$attrs, {
|
|
519
480
|
modelValue: state.identityVerification.visible,
|
|
520
481
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.identityVerification.visible = $event),
|
|
521
|
-
|
|
482
|
+
formatId: state.currentFormatId,
|
|
483
|
+
templateId: unref(getTemplateIdByFormatId),
|
|
522
484
|
onSuccess: verifiySuccess
|
|
523
|
-
}), null, 16, ["modelValue", "
|
|
485
|
+
}), null, 16, ["modelValue", "formatId", "templateId"])], 64);
|
|
524
486
|
};
|
|
525
487
|
}
|
|
526
488
|
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { defineComponent, ref, reactive, watch, openBlock, createBlock, unref, normalizeStyle, withCtx, createElementVNode, mergeProps, createVNode, createTextVNode } from 'vue';
|
|
2
2
|
import { useMessage, NModal, NForm, NFormItem, NInput, NButton } from 'naive-ui';
|
|
3
3
|
import EditForm from './edit.js';
|
|
4
|
+
import '../utils/print.js';
|
|
5
|
+
import { isIReport } from '../utils/browserPrint.js';
|
|
4
6
|
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
|
|
5
7
|
|
|
6
8
|
const _hoisted_1 = { class: "content" };
|
|
@@ -10,7 +12,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10
12
|
verifyUser: { type: Function, default: () => Promise.resolve() },
|
|
11
13
|
identityVerificationTitle: { default: "\u6253\u5370\u670D\u52A1\u8EAB\u4EFD\u6821\u9A8C" },
|
|
12
14
|
modelValue: { type: Boolean },
|
|
13
|
-
|
|
15
|
+
formatId: null,
|
|
16
|
+
templateId: null
|
|
14
17
|
},
|
|
15
18
|
emits: ["update:modelValue", "success", "close"],
|
|
16
19
|
setup(__props, { emit }) {
|
|
@@ -46,11 +49,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
46
49
|
$message.error(data.resultMsg || "\u8EAB\u4EFD\u6821\u9A8C\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01");
|
|
47
50
|
return false;
|
|
48
51
|
}
|
|
49
|
-
if (props.
|
|
50
|
-
emit("success", (_a = data.map) == null ? void 0 : _a.token);
|
|
51
|
-
} else {
|
|
52
|
+
if (isIReport(props.formatId || "")) {
|
|
52
53
|
showEditForm.value = true;
|
|
53
|
-
token.value = (
|
|
54
|
+
token.value = (_a = data.map) == null ? void 0 : _a.token;
|
|
55
|
+
} else {
|
|
56
|
+
emit("success", (_b = data.map) == null ? void 0 : _b.token);
|
|
54
57
|
}
|
|
55
58
|
} finally {
|
|
56
59
|
loading.value = false;
|
|
@@ -71,7 +74,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
71
74
|
var _a;
|
|
72
75
|
try {
|
|
73
76
|
loading.value = true;
|
|
74
|
-
const data = await ((_a = editFormRef.value) == null ? void 0 : _a.submit(
|
|
77
|
+
const data = await ((_a = editFormRef.value) == null ? void 0 : _a.submit({
|
|
78
|
+
authorizationKey: token.value,
|
|
79
|
+
id: props.formatId,
|
|
80
|
+
templateId: props.templateId,
|
|
81
|
+
datasourceName: null,
|
|
82
|
+
dataSourceId: null
|
|
83
|
+
}));
|
|
75
84
|
if (!data)
|
|
76
85
|
return false;
|
|
77
86
|
emit("success", token.value);
|
|
@@ -15,10 +15,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
15
15
|
type: BooleanConstructor;
|
|
16
16
|
required: true;
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
type:
|
|
20
|
-
required:
|
|
21
|
-
|
|
18
|
+
formatId: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
required: false;
|
|
21
|
+
};
|
|
22
|
+
templateId: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
required: false;
|
|
22
25
|
};
|
|
23
26
|
}, {
|
|
24
27
|
$message: import("naive-ui").MessageApi;
|
|
@@ -30,7 +33,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
33
|
verifyUser: Function;
|
|
31
34
|
identityVerificationTitle: string;
|
|
32
35
|
modelValue: boolean;
|
|
33
|
-
|
|
36
|
+
formatId?: string | undefined;
|
|
37
|
+
templateId?: string | undefined;
|
|
34
38
|
};
|
|
35
39
|
emit: (event: "close" | "success" | "update:modelValue", ...args: any[]) => void;
|
|
36
40
|
editFormRef: import("vue").Ref<{
|
|
@@ -354,17 +358,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
354
358
|
readonly ignorePathChange: boolean;
|
|
355
359
|
}>;
|
|
356
360
|
NInput: any;
|
|
357
|
-
EditForm: import("vue").DefineComponent<{
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
};
|
|
363
|
-
}, {
|
|
361
|
+
EditForm: import("vue").DefineComponent<{}, {
|
|
362
|
+
PROTOCOL: string;
|
|
363
|
+
HOST: string;
|
|
364
|
+
SAVEIREPORT: string;
|
|
365
|
+
instance: import("axios").AxiosInstance;
|
|
364
366
|
$message: import("naive-ui").MessageApi;
|
|
365
|
-
props: {
|
|
366
|
-
saveIReportFormat: Function;
|
|
367
|
-
};
|
|
368
367
|
fileList: import("vue").Ref<{
|
|
369
368
|
key: string;
|
|
370
369
|
value: {
|
|
@@ -402,7 +401,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
402
401
|
fullPath?: string | null | undefined;
|
|
403
402
|
}[];
|
|
404
403
|
}[]>;
|
|
405
|
-
submit: (
|
|
404
|
+
submit: (datas: import("../../../../shared/types").AnyObject) => Promise<unknown>;
|
|
406
405
|
onChange: (data: {
|
|
407
406
|
file: import("naive-ui").UploadFileInfo;
|
|
408
407
|
fileList: import("naive-ui").UploadFileInfo[];
|
|
@@ -1579,15 +1578,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1579
1578
|
}>;
|
|
1580
1579
|
NSpace: any;
|
|
1581
1580
|
Archive: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
1582
|
-
},
|
|
1583
|
-
saveIReportFormat: {
|
|
1584
|
-
type: FunctionConstructor;
|
|
1585
|
-
required: true;
|
|
1586
|
-
default: () => Promise<void>;
|
|
1587
|
-
};
|
|
1588
|
-
}>>, {
|
|
1589
|
-
saveIReportFormat: Function;
|
|
1590
|
-
}>;
|
|
1581
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
1591
1582
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "success" | "update:modelValue")[], "close" | "success" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1592
1583
|
verifyUser: {
|
|
1593
1584
|
type: FunctionConstructor;
|
|
@@ -1603,10 +1594,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1603
1594
|
type: BooleanConstructor;
|
|
1604
1595
|
required: true;
|
|
1605
1596
|
};
|
|
1606
|
-
|
|
1607
|
-
type:
|
|
1608
|
-
required:
|
|
1609
|
-
|
|
1597
|
+
formatId: {
|
|
1598
|
+
type: StringConstructor;
|
|
1599
|
+
required: false;
|
|
1600
|
+
};
|
|
1601
|
+
templateId: {
|
|
1602
|
+
type: StringConstructor;
|
|
1603
|
+
required: false;
|
|
1610
1604
|
};
|
|
1611
1605
|
}>> & {
|
|
1612
1606
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -1615,6 +1609,5 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1615
1609
|
}, {
|
|
1616
1610
|
verifyUser: Function;
|
|
1617
1611
|
identityVerificationTitle: string;
|
|
1618
|
-
printType: string | number;
|
|
1619
1612
|
}>;
|
|
1620
1613
|
export default _default;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { defineComponent, ref, openBlock, createBlock, unref, withCtx, createVNode, createElementBlock, Fragment, renderList, createElementVNode, createTextVNode, toDisplayString } from 'vue';
|
|
2
2
|
import { useMessage, NForm, NFormItem, NSpace, NUpload, NUploadDragger, NIcon, NText, NP } from 'naive-ui';
|
|
3
3
|
import { Archive } from '@vicons/ionicons5';
|
|
4
|
+
import axios from 'axios';
|
|
4
5
|
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
|
|
5
6
|
|
|
6
7
|
const _hoisted_1 = { style: { "margin-bottom": "12px" } };
|
|
7
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
9
|
__name: "edit",
|
|
9
|
-
props: {
|
|
10
|
-
saveIReportFormat: { type: Function, default: () => Promise.resolve() }
|
|
11
|
-
},
|
|
12
10
|
setup(__props, { expose }) {
|
|
13
|
-
const
|
|
11
|
+
const PROTOCOL = window.location.protocol;
|
|
12
|
+
const HOST = window.location.host;
|
|
13
|
+
const SAVEIREPORT = `${PROTOCOL}//${HOST}/bi-api/reprot/print/open/client/saveIReportFormat`;
|
|
14
|
+
const instance = axios.create({});
|
|
14
15
|
const $message = useMessage();
|
|
15
16
|
const fileList = ref([
|
|
16
17
|
{
|
|
@@ -22,7 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
23
|
value: []
|
|
23
24
|
}
|
|
24
25
|
]);
|
|
25
|
-
function submit(
|
|
26
|
+
function submit(datas) {
|
|
26
27
|
return new Promise((resolve, reject) => {
|
|
27
28
|
var _a, _b, _c, _d;
|
|
28
29
|
const isOk = fileList.value.every((file) => file.value.length > 0);
|
|
@@ -30,14 +31,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
30
31
|
$message.warning("\u8BF7\u5148\u4E0A\u4F20\u6587\u4EF6");
|
|
31
32
|
return;
|
|
32
33
|
}
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
const jrxml = (_b = (_a = fileList.value.find((file) => file.key === "jrxml")) == null ? void 0 : _a.value) == null ? void 0 : _b[0];
|
|
35
|
+
const jasper = (_d = (_c = fileList.value.find((file) => file.key === "jasper")) == null ? void 0 : _c.value) == null ? void 0 : _d[0];
|
|
36
|
+
const data = {
|
|
37
|
+
jrxml: jrxml == null ? void 0 : jrxml.file,
|
|
38
|
+
jasper: jasper == null ? void 0 : jasper.file,
|
|
39
|
+
...datas
|
|
37
40
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
const params = new FormData();
|
|
42
|
+
Object.keys(data).forEach((v) => {
|
|
43
|
+
params.append(v, data[v]);
|
|
44
|
+
});
|
|
45
|
+
instance.post(SAVEIREPORT, params, {
|
|
46
|
+
headers: {
|
|
47
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
48
|
+
}
|
|
49
|
+
}).then(({ data: data2 }) => {
|
|
50
|
+
if ((data2 == null ? void 0 : data2.result) !== "SUCCESS") {
|
|
51
|
+
$message.error((data2 == null ? void 0 : data2.resultMsg) || "\u4E0A\u4F20\u6587\u4EF6\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01");
|
|
41
52
|
reject();
|
|
42
53
|
} else {
|
|
43
54
|
resolve("SUCCESS");
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { UploadFileInfo } from 'naive-ui';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}, {
|
|
3
|
+
import { AnyObject } from '../../../../../es/shared/types';
|
|
4
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
5
|
+
PROTOCOL: string;
|
|
6
|
+
HOST: string;
|
|
7
|
+
SAVEIREPORT: string;
|
|
8
|
+
instance: import("axios").AxiosInstance;
|
|
10
9
|
$message: import("naive-ui").MessageApi;
|
|
11
|
-
props: {
|
|
12
|
-
saveIReportFormat: Function;
|
|
13
|
-
};
|
|
14
10
|
fileList: import("vue").Ref<{
|
|
15
11
|
key: string;
|
|
16
12
|
value: {
|
|
@@ -48,7 +44,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
48
44
|
fullPath?: string | null | undefined;
|
|
49
45
|
}[];
|
|
50
46
|
}[]>;
|
|
51
|
-
submit: (
|
|
47
|
+
submit: (datas: AnyObject) => Promise<unknown>;
|
|
52
48
|
onChange: (data: {
|
|
53
49
|
file: UploadFileInfo;
|
|
54
50
|
fileList: UploadFileInfo[];
|
|
@@ -1225,13 +1221,5 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1225
1221
|
}>;
|
|
1226
1222
|
NSpace: any;
|
|
1227
1223
|
Archive: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
1228
|
-
},
|
|
1229
|
-
saveIReportFormat: {
|
|
1230
|
-
type: FunctionConstructor;
|
|
1231
|
-
required: true;
|
|
1232
|
-
default: () => Promise<void>;
|
|
1233
|
-
};
|
|
1234
|
-
}>>, {
|
|
1235
|
-
saveIReportFormat: Function;
|
|
1236
|
-
}>;
|
|
1224
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
1237
1225
|
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare function useBrowserPrint(data: Blob, mode
|
|
1
|
+
export declare function useBrowserPrint(data: Blob, mode?: string): void;
|
|
2
|
+
export declare function isIReport(formatId: string): boolean;
|
|
@@ -36,5 +36,9 @@ function useBrowserPrint(data, mode) {
|
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
+
function isIReport(formatId) {
|
|
40
|
+
var _a;
|
|
41
|
+
return (_a = formatId == null ? void 0 : formatId.includes) == null ? void 0 : _a.call(formatId, "iReport");
|
|
42
|
+
}
|
|
39
43
|
|
|
40
|
-
export { useBrowserPrint };
|
|
44
|
+
export { isIReport, useBrowserPrint };
|
|
@@ -3,6 +3,6 @@ import { ComponentInternalInstance } from 'vue';
|
|
|
3
3
|
export declare class IdentityVerificationDialog {
|
|
4
4
|
rendered: boolean;
|
|
5
5
|
static createMsg(message: string): string;
|
|
6
|
-
show(instance: ComponentInternalInstance, title: string, api: Func): Promise<string>;
|
|
6
|
+
show(instance: ComponentInternalInstance, title: string, api: Func, formatId?: string, templateId?: string): Promise<string>;
|
|
7
7
|
private createProviderWrapper;
|
|
8
8
|
}
|
|
@@ -8,7 +8,7 @@ class IdentityVerificationDialog {
|
|
|
8
8
|
static createMsg(message) {
|
|
9
9
|
return `[IdentityVerificationDialog] ${message}`;
|
|
10
10
|
}
|
|
11
|
-
show(instance, title, api) {
|
|
11
|
+
show(instance, title, api, formatId, templateId) {
|
|
12
12
|
if (this.rendered)
|
|
13
13
|
return Promise.reject(IdentityVerificationDialog.createMsg("\u8BF7\u52FF\u91CD\u590D\u6253\u5F00\u5F39\u7A97"));
|
|
14
14
|
return new Promise((resolve, reject) => {
|
|
@@ -25,7 +25,9 @@ class IdentityVerificationDialog {
|
|
|
25
25
|
"identityVerificationTitle": title,
|
|
26
26
|
"onClose": onClose,
|
|
27
27
|
"onAfterLeave": () => unmount(container),
|
|
28
|
-
"onSuccess": onSuccess
|
|
28
|
+
"onSuccess": onSuccess,
|
|
29
|
+
"formatId": formatId,
|
|
30
|
+
"templateId": templateId
|
|
29
31
|
}, null), instance)
|
|
30
32
|
}), container);
|
|
31
33
|
mount(container);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Print } from './print.js';
|
|
2
|
-
export { useBrowserPrint } from './browserPrint.js';
|
|
2
|
+
export { isIReport, useBrowserPrint } from './browserPrint.js';
|
|
@@ -32,8 +32,9 @@ export declare class Print {
|
|
|
32
32
|
};
|
|
33
33
|
_handleEventDirect({ templateId, formatId, params, cmdid, print, printdlgshow, nobillnode }: AnyObject): Promise<any>;
|
|
34
34
|
_handleEventEditFormat({ templateId, formatId, params, token }: AnyObject): Promise<any>;
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
_queryPrintFile(formatId: string, params?: string): Promise<any>;
|
|
36
|
+
preview({ templateId, formatId, params }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<any>;
|
|
37
|
+
printDirect({ templateId, formatId, params, print, printdlgshow, nobillnode }: AnyObject, successCallbackFn: Func, errorCallbackFn: Func, mode?: string): Promise<any>;
|
|
37
38
|
private _downloadPDF;
|
|
38
39
|
/**
|
|
39
40
|
* 下载pdf
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { isArray } from 'lodash-es';
|
|
3
3
|
import { IdentityVerificationDialog } from './dialog.js';
|
|
4
|
+
import { isIReport, useBrowserPrint } from './browserPrint.js';
|
|
4
5
|
|
|
5
6
|
const PRINT_ORIGIN = "http://127.0.0.1:11111";
|
|
6
7
|
const EDIT_LOCAL_URL = `${PRINT_ORIGIN}/services/print`;
|
|
@@ -13,7 +14,13 @@ const testHttpFn = axios.create({
|
|
|
13
14
|
timeout: 1e3,
|
|
14
15
|
withCredentials: false
|
|
15
16
|
});
|
|
16
|
-
const httpFn = axios.create({
|
|
17
|
+
const httpFn = axios.create({
|
|
18
|
+
withCredentials: false
|
|
19
|
+
});
|
|
20
|
+
const PROTOCOL = window.location.protocol;
|
|
21
|
+
const HOST = window.location.host;
|
|
22
|
+
const PRINTIREPORT = `${PROTOCOL}//${HOST}/fdp-api/print/assembly/printIReport`;
|
|
23
|
+
const ERRORMSG = "\u83B7\u53D6\u6587\u4EF6\u5931\u8D25\uFF01";
|
|
17
24
|
class Print {
|
|
18
25
|
constructor() {
|
|
19
26
|
this.dialog = new IdentityVerificationDialog();
|
|
@@ -220,7 +227,27 @@ class Print {
|
|
|
220
227
|
};
|
|
221
228
|
return await this._queryServicesPrint(queryParams);
|
|
222
229
|
}
|
|
230
|
+
async _queryPrintFile(formatId, params = "") {
|
|
231
|
+
const { data } = await httpFn({
|
|
232
|
+
method: "post",
|
|
233
|
+
url: PRINTIREPORT,
|
|
234
|
+
responseType: "blob",
|
|
235
|
+
params: {
|
|
236
|
+
formatId: formatId.split("_")[1],
|
|
237
|
+
params
|
|
238
|
+
}
|
|
239
|
+
}) || {};
|
|
240
|
+
return data;
|
|
241
|
+
}
|
|
223
242
|
async preview({ templateId, formatId, params = "" }, successCallbackFn, errorCallbackFn) {
|
|
243
|
+
if (isIReport(formatId)) {
|
|
244
|
+
const data = await this._queryPrintFile(formatId, params);
|
|
245
|
+
if (!data)
|
|
246
|
+
return errorCallbackFn == null ? void 0 : errorCallbackFn(ERRORMSG);
|
|
247
|
+
useBrowserPrint(data, "preview");
|
|
248
|
+
successCallbackFn == null ? void 0 : successCallbackFn({ file: data });
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
224
251
|
const testResult = await this._testConnection();
|
|
225
252
|
if (!this._handleResultTest(testResult, errorCallbackFn))
|
|
226
253
|
return false;
|
|
@@ -237,7 +264,15 @@ class Print {
|
|
|
237
264
|
return false;
|
|
238
265
|
successCallbackFn && successCallbackFn(handledResult);
|
|
239
266
|
}
|
|
240
|
-
async printDirect({ templateId, formatId, params = "", print, printdlgshow, nobillnode }, successCallbackFn, errorCallbackFn) {
|
|
267
|
+
async printDirect({ templateId, formatId, params = "", print, printdlgshow, nobillnode }, successCallbackFn, errorCallbackFn, mode = "printDirect") {
|
|
268
|
+
if (isIReport(formatId)) {
|
|
269
|
+
const data = await this._queryPrintFile(formatId, params);
|
|
270
|
+
if (!data)
|
|
271
|
+
return errorCallbackFn == null ? void 0 : errorCallbackFn(ERRORMSG);
|
|
272
|
+
useBrowserPrint(data, mode);
|
|
273
|
+
successCallbackFn == null ? void 0 : successCallbackFn({ file: data });
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
241
276
|
const testResult = await this._testConnection();
|
|
242
277
|
if (!this._handleResultTest(testResult, errorCallbackFn))
|
|
243
278
|
return false;
|
|
@@ -269,13 +304,16 @@ class Print {
|
|
|
269
304
|
async (res) => {
|
|
270
305
|
if (!res)
|
|
271
306
|
onReject(null);
|
|
307
|
+
if (isIReport(params.formatId))
|
|
308
|
+
return onResolve(res);
|
|
272
309
|
onResolve(await this._downloadPDF(getFiledir(res.filedir)));
|
|
273
310
|
function getFiledir(filedir) {
|
|
274
311
|
const result = JSON.parse(filedir);
|
|
275
312
|
return isArray(result) ? result[0] || "" : "";
|
|
276
313
|
}
|
|
277
314
|
},
|
|
278
|
-
(err) => onReject(err)
|
|
315
|
+
(err) => onReject(err),
|
|
316
|
+
"downloadPDF"
|
|
279
317
|
);
|
|
280
318
|
}
|
|
281
319
|
async print({ templateId, formatId, params = "" }, successCallbackFn, errorCallbackFn) {
|
|
@@ -4,6 +4,7 @@ import { FIELD_BUSINESS_TYPE } from '../constants';
|
|
|
4
4
|
export declare class BusinessCollector {
|
|
5
5
|
private formModel;
|
|
6
6
|
private businessFormatter?;
|
|
7
|
+
private readonly typeLockMap;
|
|
7
8
|
private readonly typeCollector;
|
|
8
9
|
private readonly fieldNameCollector;
|
|
9
10
|
constructor(formModel: Form, businessFormatter?: FormBusinessFormatter | undefined);
|
|
@@ -14,12 +15,12 @@ export declare class BusinessCollector {
|
|
|
14
15
|
private getType;
|
|
15
16
|
private getValueByField;
|
|
16
17
|
getValueByType(type: FIELD_BUSINESS_TYPE): unknown;
|
|
17
|
-
setValueByType(type: FIELD_BUSINESS_TYPE, value: unknown
|
|
18
|
+
setValueByType(type: FIELD_BUSINESS_TYPE, value: unknown): void;
|
|
18
19
|
registerChangeBusiness(type: FIELD_BUSINESS_TYPE, handler: () => void): this;
|
|
19
20
|
registerBlurBusiness(type: FIELD_BUSINESS_TYPE, handler: () => void): this;
|
|
20
21
|
private changeHandlerMap;
|
|
21
22
|
private blurHandlerMap;
|
|
22
|
-
trigger(fieldName: string, triggerType?: 'change' | 'blur'):
|
|
23
|
+
trigger(fieldName: string, triggerType?: 'change' | 'blur'): Map<FIELD_BUSINESS_TYPE, number> | undefined;
|
|
23
24
|
}
|
|
24
25
|
export declare function useBusinessBinding(): {
|
|
25
26
|
create: (formModel: Form, formatter?: FormBusinessFormatter) => BusinessCollector;
|