cnhis-design-vue 3.1.30 → 3.1.31-beta.1
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 +22 -45
- package/es/components/button-print/index.js +1 -1
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +22 -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 +22 -30
- package/es/components/button-print/src/components/edit.js +22 -12
- package/es/components/button-print/src/components/edit.vue.d.ts +7 -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 +40 -3
- package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +3 -2
- package/es/components/form-render/src/hooks/useBusinessBinding.js +16 -6
- package/es/components/form-render/src/utils/business.js +1 -1
- package/es/components/iho-table/index.d.ts +5 -3
- package/es/components/iho-table/src/IhoTable.js +1 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +5 -3
- package/es/components/iho-table/src/components/IhoTableColumn.js +6 -3
- package/es/components/iho-table/src/constants/index.d.ts +1 -1
- package/es/components/iho-table/src/constants/index.js +1 -0
- package/es/components/iho-table/src/plugins/filterPlugin/filter.js +163 -73
- package/es/components/iho-table/src/plugins/filterPlugin/filter.vue.d.ts +126 -0
- package/es/components/iho-table/src/plugins/filterPlugin/index.js +6 -12
- package/es/components/iho-table/src/plugins/filterPlugin/types.d.ts +0 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +2 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separateUtils.d.ts +2 -4
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separateUtils.js +2 -17
- package/es/components/iho-table/src/types/index.d.ts +10 -2
- package/es/components/iho-table/src/utils/index.d.ts +8 -0
- package/es/components/iho-table/src/utils/index.js +30 -2
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- 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/components/iho-table/src/plugins/filterPlugin/filter.d.ts +0 -23
- 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,11 @@ 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
|
-
default: () => Promise<void>;
|
|
362
|
-
};
|
|
363
|
-
}, {
|
|
361
|
+
EditForm: import("vue").DefineComponent<{}, {
|
|
362
|
+
HOST: string;
|
|
363
|
+
SAVEIREPORT: string;
|
|
364
|
+
instance: import("axios").AxiosInstance;
|
|
364
365
|
$message: import("naive-ui").MessageApi;
|
|
365
|
-
props: {
|
|
366
|
-
saveIReportFormat: Function;
|
|
367
|
-
};
|
|
368
366
|
fileList: import("vue").Ref<{
|
|
369
367
|
key: string;
|
|
370
368
|
value: {
|
|
@@ -402,7 +400,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
402
400
|
fullPath?: string | null | undefined;
|
|
403
401
|
}[];
|
|
404
402
|
}[]>;
|
|
405
|
-
submit: (
|
|
403
|
+
submit: (datas: import("../../../../shared/types").AnyObject) => Promise<unknown>;
|
|
406
404
|
onChange: (data: {
|
|
407
405
|
file: import("naive-ui").UploadFileInfo;
|
|
408
406
|
fileList: import("naive-ui").UploadFileInfo[];
|
|
@@ -1579,15 +1577,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1579
1577
|
}>;
|
|
1580
1578
|
NSpace: any;
|
|
1581
1579
|
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
|
-
}>;
|
|
1580
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
1591
1581
|
}, 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
1582
|
verifyUser: {
|
|
1593
1583
|
type: FunctionConstructor;
|
|
@@ -1603,10 +1593,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1603
1593
|
type: BooleanConstructor;
|
|
1604
1594
|
required: true;
|
|
1605
1595
|
};
|
|
1606
|
-
|
|
1607
|
-
type:
|
|
1608
|
-
required:
|
|
1609
|
-
|
|
1596
|
+
formatId: {
|
|
1597
|
+
type: StringConstructor;
|
|
1598
|
+
required: false;
|
|
1599
|
+
};
|
|
1600
|
+
templateId: {
|
|
1601
|
+
type: StringConstructor;
|
|
1602
|
+
required: false;
|
|
1610
1603
|
};
|
|
1611
1604
|
}>> & {
|
|
1612
1605
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -1615,6 +1608,5 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1615
1608
|
}, {
|
|
1616
1609
|
verifyUser: Function;
|
|
1617
1610
|
identityVerificationTitle: string;
|
|
1618
|
-
printType: string | number;
|
|
1619
1611
|
}>;
|
|
1620
1612
|
export default _default;
|
|
@@ -1,16 +1,16 @@
|
|
|
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 HOST = window.location.host;
|
|
12
|
+
const SAVEIREPORT = `${HOST}/bi-api/reprot/print/open/client/saveIReportFormat`;
|
|
13
|
+
const instance = axios.create({});
|
|
14
14
|
const $message = useMessage();
|
|
15
15
|
const fileList = ref([
|
|
16
16
|
{
|
|
@@ -22,7 +22,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
22
|
value: []
|
|
23
23
|
}
|
|
24
24
|
]);
|
|
25
|
-
function submit(
|
|
25
|
+
function submit(datas) {
|
|
26
26
|
return new Promise((resolve, reject) => {
|
|
27
27
|
var _a, _b, _c, _d;
|
|
28
28
|
const isOk = fileList.value.every((file) => file.value.length > 0);
|
|
@@ -30,14 +30,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
30
30
|
$message.warning("\u8BF7\u5148\u4E0A\u4F20\u6587\u4EF6");
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
const jrxml = (_b = (_a = fileList.value.find((file) => file.key === "jrxml")) == null ? void 0 : _a.value) == null ? void 0 : _b[0];
|
|
34
|
+
const jasper = (_d = (_c = fileList.value.find((file) => file.key === "jasper")) == null ? void 0 : _c.value) == null ? void 0 : _d[0];
|
|
35
|
+
const data = {
|
|
36
|
+
jrxml: jrxml == null ? void 0 : jrxml.file,
|
|
37
|
+
jasper: jasper == null ? void 0 : jasper.file,
|
|
38
|
+
...datas
|
|
37
39
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
const params = new FormData();
|
|
41
|
+
Object.keys(data).forEach((v) => {
|
|
42
|
+
params.append(v, data[v]);
|
|
43
|
+
});
|
|
44
|
+
instance.post(SAVEIREPORT, params, {
|
|
45
|
+
headers: {
|
|
46
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
47
|
+
}
|
|
48
|
+
}).then(({ data: data2 }) => {
|
|
49
|
+
if ((data2 == null ? void 0 : data2.result) !== "SUCCESS") {
|
|
50
|
+
$message.error((data2 == null ? void 0 : data2.resultMsg) || "\u4E0A\u4F20\u6587\u4EF6\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01");
|
|
41
51
|
reject();
|
|
42
52
|
} else {
|
|
43
53
|
resolve("SUCCESS");
|
|
@@ -1,16 +1,11 @@
|
|
|
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
|
+
HOST: string;
|
|
6
|
+
SAVEIREPORT: string;
|
|
7
|
+
instance: import("axios").AxiosInstance;
|
|
10
8
|
$message: import("naive-ui").MessageApi;
|
|
11
|
-
props: {
|
|
12
|
-
saveIReportFormat: Function;
|
|
13
|
-
};
|
|
14
9
|
fileList: import("vue").Ref<{
|
|
15
10
|
key: string;
|
|
16
11
|
value: {
|
|
@@ -48,7 +43,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
48
43
|
fullPath?: string | null | undefined;
|
|
49
44
|
}[];
|
|
50
45
|
}[]>;
|
|
51
|
-
submit: (
|
|
46
|
+
submit: (datas: AnyObject) => Promise<unknown>;
|
|
52
47
|
onChange: (data: {
|
|
53
48
|
file: UploadFileInfo;
|
|
54
49
|
fileList: UploadFileInfo[];
|
|
@@ -1225,13 +1220,5 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1225
1220
|
}>;
|
|
1226
1221
|
NSpace: any;
|
|
1227
1222
|
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
|
-
}>;
|
|
1223
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
1237
1224
|
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,12 @@ 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 HOST = window.location.host;
|
|
21
|
+
const PRINTIREPORT = `${HOST}/fdp-api/print/assembly/printIReport`;
|
|
22
|
+
const ERRORMSG = "\u83B7\u53D6\u6587\u4EF6\u5931\u8D25\uFF01";
|
|
17
23
|
class Print {
|
|
18
24
|
constructor() {
|
|
19
25
|
this.dialog = new IdentityVerificationDialog();
|
|
@@ -220,7 +226,27 @@ class Print {
|
|
|
220
226
|
};
|
|
221
227
|
return await this._queryServicesPrint(queryParams);
|
|
222
228
|
}
|
|
229
|
+
async _queryPrintFile(formatId, params = "") {
|
|
230
|
+
const { data } = await httpFn({
|
|
231
|
+
method: "post",
|
|
232
|
+
url: PRINTIREPORT,
|
|
233
|
+
responseType: "blob",
|
|
234
|
+
params: {
|
|
235
|
+
formatId: formatId.split("_")[1],
|
|
236
|
+
params
|
|
237
|
+
}
|
|
238
|
+
}) || {};
|
|
239
|
+
return data;
|
|
240
|
+
}
|
|
223
241
|
async preview({ templateId, formatId, params = "" }, successCallbackFn, errorCallbackFn) {
|
|
242
|
+
if (isIReport(formatId)) {
|
|
243
|
+
const data = await this._queryPrintFile(formatId, params);
|
|
244
|
+
if (!data)
|
|
245
|
+
return errorCallbackFn == null ? void 0 : errorCallbackFn(ERRORMSG);
|
|
246
|
+
useBrowserPrint(data, "preview");
|
|
247
|
+
successCallbackFn == null ? void 0 : successCallbackFn({ file: data });
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
224
250
|
const testResult = await this._testConnection();
|
|
225
251
|
if (!this._handleResultTest(testResult, errorCallbackFn))
|
|
226
252
|
return false;
|
|
@@ -237,7 +263,15 @@ class Print {
|
|
|
237
263
|
return false;
|
|
238
264
|
successCallbackFn && successCallbackFn(handledResult);
|
|
239
265
|
}
|
|
240
|
-
async printDirect({ templateId, formatId, params = "", print, printdlgshow, nobillnode }, successCallbackFn, errorCallbackFn) {
|
|
266
|
+
async printDirect({ templateId, formatId, params = "", print, printdlgshow, nobillnode }, successCallbackFn, errorCallbackFn, mode = "printDirect") {
|
|
267
|
+
if (isIReport(formatId)) {
|
|
268
|
+
const data = await this._queryPrintFile(formatId, params);
|
|
269
|
+
if (!data)
|
|
270
|
+
return errorCallbackFn == null ? void 0 : errorCallbackFn(ERRORMSG);
|
|
271
|
+
useBrowserPrint(data, mode);
|
|
272
|
+
successCallbackFn == null ? void 0 : successCallbackFn({ file: data });
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
241
275
|
const testResult = await this._testConnection();
|
|
242
276
|
if (!this._handleResultTest(testResult, errorCallbackFn))
|
|
243
277
|
return false;
|
|
@@ -269,13 +303,16 @@ class Print {
|
|
|
269
303
|
async (res) => {
|
|
270
304
|
if (!res)
|
|
271
305
|
onReject(null);
|
|
306
|
+
if (isIReport(params.formatId))
|
|
307
|
+
return onResolve(res);
|
|
272
308
|
onResolve(await this._downloadPDF(getFiledir(res.filedir)));
|
|
273
309
|
function getFiledir(filedir) {
|
|
274
310
|
const result = JSON.parse(filedir);
|
|
275
311
|
return isArray(result) ? result[0] || "" : "";
|
|
276
312
|
}
|
|
277
313
|
},
|
|
278
|
-
(err) => onReject(err)
|
|
314
|
+
(err) => onReject(err),
|
|
315
|
+
"downloadPDF"
|
|
279
316
|
);
|
|
280
317
|
}
|
|
281
318
|
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;
|