cnhis-design-vue 3.1.30-beta.6 → 3.1.30
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/es/components/big-table/index.d.ts +0 -1
- package/es/components/big-table/index.js +0 -1
- package/es/components/button-print/index.d.ts +1268 -0
- package/es/components/button-print/index.js +1 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +1269 -3
- package/es/components/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +86 -44
- package/es/components/button-print/src/components/IdentityVerification.js +42 -11
- package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +1253 -0
- package/es/components/button-print/src/components/edit.js +142 -0
- package/es/components/button-print/src/components/edit.vue.d.ts +1237 -0
- package/es/components/button-print/src/utils/browserPrint.d.ts +1 -0
- package/es/components/button-print/src/utils/browserPrint.js +40 -0
- package/es/components/button-print/src/utils/index.d.ts +1 -0
- package/es/components/button-print/src/utils/index.js +1 -0
- package/es/components/button-print/style/index.css +1 -1
- package/es/components/iho-table/index.d.ts +7 -3
- package/es/components/iho-table/index.js +2 -0
- package/es/components/iho-table/src/IhoTable.js +8 -4
- package/es/components/iho-table/src/IhoTable.vue.d.ts +6 -2
- package/es/components/iho-table/src/components/IhoTableColumn.js +12 -9
- 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/{big-table → iho-table}/src/hooks/export.d.ts +1 -0
- package/es/components/iho-table/src/hooks/export.js +2 -0
- package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.d.ts +3 -1
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +1 -1
- package/es/components/{big-table → iho-table}/src/hooks/useColumnConfigAdaptor.d.ts +0 -0
- package/es/components/{big-table → iho-table}/src/hooks/useColumnConfigAdaptor.js +0 -0
- package/es/components/iho-table/src/hooks/useTableContext.d.ts +1 -1
- package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/filterPlugin/filter.d.ts +23 -0
- package/es/components/iho-table/src/plugins/filterPlugin/filter.js +99 -0
- package/es/components/iho-table/src/plugins/filterPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterPlugin/index.js +80 -0
- package/es/components/iho-table/src/plugins/filterPlugin/types.d.ts +14 -0
- package/es/components/iho-table/src/plugins/filterPlugin/types.js +8 -0
- package/es/components/iho-table/src/plugins/index.js +14 -12
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +4 -4
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +14 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js +12 -7
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +5 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +14 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue.d.ts +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +24 -10
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin.js +12 -7
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/seqRendererPlugin.js +8 -2
- package/es/components/iho-table/src/types/index.d.ts +32 -10
- package/es/components/iho-table/src/utils/index.d.ts +4 -1
- package/es/components/iho-table/src/utils/index.js +7 -1
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +1 -2
- package/es/components/index.js +3 -2
- package/es/components/keyboard/src/Keyboard.js +1 -1
- package/es/shared/types/index.d.ts +2 -2
- package/package.json +2 -2
- package/es/components/big-table/src/hooks/export.js +0 -1
|
@@ -3,6 +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 { useBrowserPrint } from './utils/browserPrint.js';
|
|
6
7
|
import IdentityVerification from './components/IdentityVerification.js';
|
|
7
8
|
import { format } from 'date-fns';
|
|
8
9
|
|
|
@@ -66,6 +67,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
66
67
|
printdlgshow: {
|
|
67
68
|
default: "0",
|
|
68
69
|
type: String
|
|
70
|
+
},
|
|
71
|
+
queryPrintFile: {
|
|
72
|
+
type: Function,
|
|
73
|
+
default: () => Promise.resolve({})
|
|
69
74
|
}
|
|
70
75
|
},
|
|
71
76
|
emits: ["success", "error", "clickoutside"],
|
|
@@ -87,7 +92,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
87
92
|
},
|
|
88
93
|
isInited: false,
|
|
89
94
|
watchPrintParamsReformatFn: null,
|
|
90
|
-
spinTimer: null
|
|
95
|
+
spinTimer: null,
|
|
96
|
+
fileObject: null
|
|
91
97
|
});
|
|
92
98
|
const options = reactive([{
|
|
93
99
|
label: props.printText,
|
|
@@ -173,6 +179,21 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
173
179
|
params = Object.assign({}, JSON.parse(getPrintParams(0)), obj);
|
|
174
180
|
return JSON.stringify(params);
|
|
175
181
|
};
|
|
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
|
+
};
|
|
176
197
|
const handleClickPrint = () => {
|
|
177
198
|
let len = state.printParams.length;
|
|
178
199
|
const callLocalServicesSuccessCbTmp = async (data) => {
|
|
@@ -187,26 +208,31 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
187
208
|
props.prevFn().catch(() => {
|
|
188
209
|
prevFnError();
|
|
189
210
|
return Promise.reject();
|
|
190
|
-
}).then(() => {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
211
|
+
}).then(async () => {
|
|
212
|
+
var _a;
|
|
213
|
+
if (((_a = currentFormatItem.value) == null ? void 0 : _a.printType) == 0) {
|
|
214
|
+
browserPrint("printDirect");
|
|
215
|
+
} else {
|
|
216
|
+
const queryParams = {
|
|
217
|
+
formatId: state.currentFormatId,
|
|
218
|
+
templateId: getTemplateIdByFormatId.value,
|
|
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 {
|
|
198
229
|
printInstance.printDirect({
|
|
199
230
|
...queryParams,
|
|
200
|
-
params:
|
|
201
|
-
},
|
|
231
|
+
params: getOnceParams()
|
|
232
|
+
}, (res) => {
|
|
233
|
+
callLocalServicesSuccessCb(res, "print");
|
|
234
|
+
}, callLocalServicesErrorCb);
|
|
202
235
|
}
|
|
203
|
-
} else {
|
|
204
|
-
printInstance.printDirect({
|
|
205
|
-
...queryParams,
|
|
206
|
-
params: getOnceParams()
|
|
207
|
-
}, (res) => {
|
|
208
|
-
callLocalServicesSuccessCb(res, "print");
|
|
209
|
-
}, callLocalServicesErrorCb);
|
|
210
236
|
}
|
|
211
237
|
}).finally(() => {
|
|
212
238
|
state.visible = false;
|
|
@@ -216,16 +242,21 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
216
242
|
props.prevFn().catch(() => {
|
|
217
243
|
prevFnError();
|
|
218
244
|
return Promise.reject();
|
|
219
|
-
}).then(() => {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
params
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
245
|
+
}).then(async () => {
|
|
246
|
+
var _a;
|
|
247
|
+
if (((_a = currentFormatItem.value) == null ? void 0 : _a.printType) == 0) {
|
|
248
|
+
browserPrint("preview");
|
|
249
|
+
} else {
|
|
250
|
+
const params = props.strategy === "MULTI" ? getPrintParams() : getOnceParams();
|
|
251
|
+
const queryParams = {
|
|
252
|
+
formatId: state.currentFormatId,
|
|
253
|
+
templateId: getTemplateIdByFormatId.value,
|
|
254
|
+
params
|
|
255
|
+
};
|
|
256
|
+
printInstance.preview(queryParams, (res) => {
|
|
257
|
+
callLocalServicesSuccessCb(res, "preview");
|
|
258
|
+
}, callLocalServicesErrorCb);
|
|
259
|
+
}
|
|
229
260
|
}).finally(() => {
|
|
230
261
|
state.visible = false;
|
|
231
262
|
});
|
|
@@ -234,18 +265,23 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
234
265
|
props.prevFn().catch(() => {
|
|
235
266
|
prevFnError();
|
|
236
267
|
return Promise.reject();
|
|
237
|
-
}).then(() => {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
268
|
+
}).then(async () => {
|
|
269
|
+
var _a;
|
|
270
|
+
if (((_a = currentFormatItem.value) == null ? void 0 : _a.printType) == 0) {
|
|
271
|
+
browserPrint("downloadPDF");
|
|
272
|
+
} else {
|
|
273
|
+
const params = props.strategy === "MULTI" ? getPrintParams() : getOnceParams();
|
|
274
|
+
const queryParams = {
|
|
275
|
+
formatId: state.currentFormatId,
|
|
276
|
+
templateId: getTemplateIdByFormatId.value,
|
|
277
|
+
print: {
|
|
278
|
+
print: "1",
|
|
279
|
+
type: "1"
|
|
280
|
+
},
|
|
281
|
+
params
|
|
282
|
+
};
|
|
283
|
+
printInstance.downloadPDF(queryParams, (res) => callLocalServicesSuccessCb(res, "preview"), callLocalServicesErrorCb);
|
|
284
|
+
}
|
|
249
285
|
}).finally(() => {
|
|
250
286
|
state.visible = false;
|
|
251
287
|
});
|
|
@@ -276,6 +312,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
276
312
|
break;
|
|
277
313
|
default:
|
|
278
314
|
state.currentFormatId = key;
|
|
315
|
+
state.fileObject = null;
|
|
279
316
|
state.visible = false;
|
|
280
317
|
break;
|
|
281
318
|
}
|
|
@@ -369,6 +406,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
369
406
|
var _a;
|
|
370
407
|
state.formatList = formatListResult ? formatFormatList(formatListResult.obj) : [];
|
|
371
408
|
state.currentFormatId = getDefaultFormatId(state.formatList, "defaultFlag");
|
|
409
|
+
state.fileObject = null;
|
|
372
410
|
if (!state.currentFormatId) {
|
|
373
411
|
$message.error("\u83B7\u53D6\u6253\u5370\u683C\u5F0F\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01");
|
|
374
412
|
return requestError();
|
|
@@ -423,7 +461,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
423
461
|
state.printParams = formatParams(state.templateParams, props.params);
|
|
424
462
|
};
|
|
425
463
|
const verifiySuccess = (token) => {
|
|
464
|
+
var _a;
|
|
426
465
|
state.identityVerification.visible = false;
|
|
466
|
+
if (((_a = currentFormatItem.value) == null ? void 0 : _a.printType) == 0)
|
|
467
|
+
return;
|
|
427
468
|
const queryParams = {
|
|
428
469
|
formatId: state.currentFormatId,
|
|
429
470
|
templateId: getTemplateIdByFormatId.value,
|
|
@@ -448,6 +489,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
448
489
|
deep: true
|
|
449
490
|
});
|
|
450
491
|
return (_ctx, _cache) => {
|
|
492
|
+
var _a;
|
|
451
493
|
return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(NDropdown), {
|
|
452
494
|
class: "c-dropdown",
|
|
453
495
|
placement: "bottom-start",
|
|
@@ -473,12 +515,12 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
473
515
|
_: 1
|
|
474
516
|
}, 8, ["onClick"])])]),
|
|
475
517
|
_: 3
|
|
476
|
-
}, 8, ["show", "options"]), createVNode(IdentityVerification, mergeProps({
|
|
518
|
+
}, 8, ["show", "options"]), createVNode(IdentityVerification, mergeProps(_ctx.$attrs, {
|
|
477
519
|
modelValue: state.identityVerification.visible,
|
|
478
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.identityVerification.visible = $event)
|
|
479
|
-
|
|
520
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.identityVerification.visible = $event),
|
|
521
|
+
printType: (_a = unref(currentFormatItem)) == null ? void 0 : _a.printType,
|
|
480
522
|
onSuccess: verifiySuccess
|
|
481
|
-
}), null, 16, ["modelValue"])], 64);
|
|
523
|
+
}), null, 16, ["modelValue", "printType"])], 64);
|
|
482
524
|
};
|
|
483
525
|
}
|
|
484
526
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { defineComponent,
|
|
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
|
+
import EditForm from './edit.js';
|
|
3
4
|
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
|
|
4
5
|
|
|
5
6
|
const _hoisted_1 = { class: "content" };
|
|
@@ -8,7 +9,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8
9
|
props: {
|
|
9
10
|
verifyUser: { type: Function, default: () => Promise.resolve() },
|
|
10
11
|
identityVerificationTitle: { default: "\u6253\u5370\u670D\u52A1\u8EAB\u4EFD\u6821\u9A8C" },
|
|
11
|
-
modelValue: { type: Boolean }
|
|
12
|
+
modelValue: { type: Boolean },
|
|
13
|
+
printType: { default: 1 }
|
|
12
14
|
},
|
|
13
15
|
emits: ["update:modelValue", "success", "close"],
|
|
14
16
|
setup(__props, { emit }) {
|
|
@@ -18,6 +20,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18
20
|
account: "",
|
|
19
21
|
password: ""
|
|
20
22
|
};
|
|
23
|
+
const editFormRef = ref(null);
|
|
24
|
+
const showEditForm = ref(false);
|
|
25
|
+
const token = ref("");
|
|
21
26
|
let form = reactive({ ...DEFAULT_FORM });
|
|
22
27
|
const rules = {
|
|
23
28
|
account: { required: true, message: "\u8BF7\u8F93\u5165\u8D26\u53F7" },
|
|
@@ -33,15 +38,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
33
38
|
};
|
|
34
39
|
const loading = ref(false);
|
|
35
40
|
const submit = async () => {
|
|
36
|
-
var _a;
|
|
41
|
+
var _a, _b;
|
|
37
42
|
try {
|
|
38
43
|
loading.value = true;
|
|
39
44
|
const { data = {} } = await props.verifyUser(form) || {};
|
|
40
45
|
if (data.result !== "SUCCESS") {
|
|
41
|
-
$message.error(data.resultMsg || "\
|
|
46
|
+
$message.error(data.resultMsg || "\u8EAB\u4EFD\u6821\u9A8C\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01");
|
|
42
47
|
return false;
|
|
43
48
|
}
|
|
44
|
-
|
|
49
|
+
if (props.printType == 1) {
|
|
50
|
+
emit("success", (_a = data.map) == null ? void 0 : _a.token);
|
|
51
|
+
} else {
|
|
52
|
+
showEditForm.value = true;
|
|
53
|
+
token.value = (_b = data.map) == null ? void 0 : _b.token;
|
|
54
|
+
}
|
|
45
55
|
} finally {
|
|
46
56
|
loading.value = false;
|
|
47
57
|
}
|
|
@@ -57,6 +67,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
57
67
|
}
|
|
58
68
|
});
|
|
59
69
|
};
|
|
70
|
+
const submitEditFile = async () => {
|
|
71
|
+
var _a;
|
|
72
|
+
try {
|
|
73
|
+
loading.value = true;
|
|
74
|
+
const data = await ((_a = editFormRef.value) == null ? void 0 : _a.submit(token.value));
|
|
75
|
+
if (!data)
|
|
76
|
+
return false;
|
|
77
|
+
emit("success", token.value);
|
|
78
|
+
} finally {
|
|
79
|
+
loading.value = false;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
60
82
|
watch(
|
|
61
83
|
() => props.modelValue,
|
|
62
84
|
(val) => {
|
|
@@ -68,17 +90,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
68
90
|
return (_ctx, _cache) => {
|
|
69
91
|
return openBlock(), createBlock(unref(NModal), {
|
|
70
92
|
preset: "dialog",
|
|
71
|
-
title: __props.identityVerificationTitle,
|
|
72
|
-
class: "standard-modal standard-modal-white authentication-modal",
|
|
93
|
+
title: showEditForm.value ? "\u7F16\u8F91" : __props.identityVerificationTitle,
|
|
94
|
+
class: "standard-modal standard-modal-white authentication-modal c-button-print-modal",
|
|
73
95
|
show: __props.modelValue,
|
|
74
96
|
"close-on-esc": false,
|
|
75
97
|
"show-icon": false,
|
|
76
98
|
style: normalizeStyle({ width: style.width, overflowY: "auto" }),
|
|
77
|
-
|
|
99
|
+
"positive-text": showEditForm.value ? "\u786E\u8BA4" : "",
|
|
100
|
+
"negative-text": showEditForm.value ? "\u53D6\u6D88" : "",
|
|
101
|
+
onClose: handleClickClose,
|
|
102
|
+
onNegativeClick: handleClickClose,
|
|
103
|
+
onPositiveClick: submitEditFile
|
|
78
104
|
}, {
|
|
79
105
|
default: withCtx(() => [
|
|
80
106
|
createElementVNode("div", _hoisted_1, [
|
|
81
|
-
|
|
107
|
+
showEditForm.value ? (openBlock(), createBlock(EditForm, mergeProps({
|
|
108
|
+
key: 0,
|
|
109
|
+
ref_key: "editFormRef",
|
|
110
|
+
ref: editFormRef
|
|
111
|
+
}, _ctx.$attrs), null, 16)) : (openBlock(), createBlock(unref(NForm), {
|
|
112
|
+
key: 1,
|
|
82
113
|
class: "login-form-button-print",
|
|
83
114
|
ref_key: "formRef",
|
|
84
115
|
ref: formRef,
|
|
@@ -126,11 +157,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
126
157
|
})
|
|
127
158
|
]),
|
|
128
159
|
_: 1
|
|
129
|
-
}, 8, ["model"])
|
|
160
|
+
}, 8, ["model"]))
|
|
130
161
|
])
|
|
131
162
|
]),
|
|
132
163
|
_: 1
|
|
133
|
-
}, 8, ["title", "show", "style"]);
|
|
164
|
+
}, 8, ["title", "show", "style", "positive-text", "negative-text"]);
|
|
134
165
|
};
|
|
135
166
|
}
|
|
136
167
|
});
|