cnhis-design-vue 3.1.13-beta.0 → 3.1.13-beta.11
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/packages/big-table/src/BigTable.vue.d.ts +3 -16
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +40 -21
- package/es/packages/big-table/src/bigTableEmits.js +2 -1
- package/es/packages/big-table/src/utils.js +2 -1
- package/es/packages/big-table/style/index.css +5 -0
- package/es/packages/bpmn-workflow/src/BpmnWorkflow.d.ts +5 -0
- package/es/packages/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/packages/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/packages/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/packages/button-print/index.d.ts +15 -1
- package/es/packages/button-print/src/ButtonPrint.vue.d.ts +199 -185
- package/es/packages/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +39 -4
- package/es/packages/button-print/src/utils/print.d.ts +41 -0
- package/es/packages/button-print/src/utils/print.js +325 -0
- package/es/packages/fabric-chart/index.d.ts +3 -4
- package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +3 -4
- package/es/packages/fabric-chart/src/FabricChart.vue_vue_type_script_setup_true_lang.js +24 -18
- package/es/packages/fabric-chart/src/hooks/useBottom.js +1 -2
- package/es/packages/fabric-chart/src/hooks/useCenter.js +89 -19
- package/es/packages/fabric-chart/src/hooks/useCumputedPoint.d.ts +2 -2
- package/es/packages/fabric-chart/src/hooks/useCumputedPoint.js +27 -13
- package/es/packages/fabric-chart/src/hooks/useDraw.d.ts +1 -1
- package/es/packages/fabric-chart/src/hooks/useDraw.js +64 -7
- package/es/packages/fabric-chart/src/hooks/useLeft.js +83 -22
- package/es/packages/fabric-chart/src/hooks/useOther.js +3 -2
- package/es/packages/fabric-chart/src/hooks/useShadow.js +1 -1
- package/es/packages/fabric-chart/src/hooks/useTop.js +6 -4
- package/es/packages/fabric-chart/src/interface.d.ts +2 -2
- package/es/packages/fabric-chart/src/utils/index.d.ts +6823 -2
- package/es/packages/form-render/index.d.ts +311 -0
- package/es/packages/form-render/src/FormRender.vue.d.ts +313 -2
- package/es/packages/form-render/src/FormRender.vue_vue_type_script_setup_true_lang.js +58 -27
- package/es/packages/form-render/src/components/renderer/cascader.d.ts +7 -1
- package/es/packages/form-render/src/components/renderer/cascader.js +65 -53
- package/es/packages/form-render/src/components/renderer/formItem.d.ts +8 -293
- package/es/packages/form-render/src/components/renderer/formItem.js +137 -2
- package/es/packages/form-render/src/components/renderer/input.js +3 -3
- package/es/packages/form-render/src/components/renderer/select.d.ts +7 -5
- package/es/packages/form-render/src/components/renderer/select.js +35 -40
- package/es/packages/form-render/src/components/renderer/simpleComponent.js +2 -15
- package/es/packages/form-render/src/constants/index.d.ts +2 -1
- package/es/packages/form-render/src/constants/index.js +2 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +4 -2
- package/es/packages/form-render/src/hooks/useFormContext.d.ts +2 -1
- package/es/packages/form-render/src/hooks/useFormContext.js +13 -2
- package/es/packages/form-render/src/types/fieldItem.d.ts +58 -7
- package/es/packages/form-render/src/types/index.d.ts +5 -0
- package/es/packages/form-render/src/utils/index.d.ts +13 -4
- package/es/packages/form-render/src/utils/index.js +44 -3
- package/es/packages/form-render/style/index.css +44 -6
- package/es/packages/form-table/src/hooks/useNuiThemeOverrides.d.ts +4 -0
- package/es/packages/form-table/src/hooks/useNuiThemeOverrides.js +18 -0
- package/es/packages/index.css +228 -8
- package/es/packages/index.d.ts +5 -1
- package/es/packages/index.js +12 -1
- package/es/packages/scale-view/src/hooks/scaleview-init.js +1 -5
- package/es/packages/scale-view/src/hooks/scaleview-submit.js +1 -6
- package/es/packages/scale-view/src/hooks/scaleview-validate.js +0 -3
- package/es/packages/shortcut-provider/index.d.ts +17 -0
- package/es/packages/shortcut-provider/index.js +13 -0
- package/es/packages/shortcut-provider/src/ShortcutProvider.js +4 -0
- package/es/packages/shortcut-provider/src/ShortcutProvider.vue.d.ts +15 -0
- package/es/packages/shortcut-provider/src/ShortcutProvider.vue_vue_type_script_setup_true_lang.js +32 -0
- package/es/packages/shortcut-provider/src/constants/index.d.ts +7 -0
- package/es/packages/shortcut-provider/src/constants/index.js +8 -0
- package/es/packages/shortcut-provider/src/hooks/index.d.ts +2 -0
- package/es/packages/shortcut-provider/src/hooks/index.js +2 -0
- package/es/packages/shortcut-provider/src/hooks/useShortcutSignature.d.ts +4 -0
- package/es/packages/shortcut-provider/src/hooks/useShortcutSignature.js +12 -0
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.d.ts +30 -0
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +157 -0
- package/es/packages/shortcut-provider/src/types/index.d.ts +30 -0
- package/es/packages/shortcut-provider/src/types/index.js +1 -0
- package/es/packages/shortcut-provider/src/utils/index.d.ts +7 -0
- package/es/packages/shortcut-provider/src/utils/index.js +49 -0
- package/es/packages/shortcut-provider/style/index.css +3 -0
- package/es/packages/shortcut-setter/constant/index.d.ts +4 -0
- package/es/packages/shortcut-setter/constant/index.js +7 -0
- package/es/packages/shortcut-setter/index.d.ts +4258 -0
- package/es/packages/shortcut-setter/index.js +11 -0
- package/es/packages/shortcut-setter/src/ShortcutSetter.js +4 -0
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +4258 -0
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue_vue_type_script_setup_true_lang.js +38 -0
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +4 -0
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +4238 -0
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue_vue_type_script_setup_true_lang.js +125 -0
- package/es/packages/shortcut-setter/style/index.css +8 -0
- package/es/packages/steps-wheel/index.d.ts +548 -0
- package/es/packages/steps-wheel/index.js +11 -0
- package/es/packages/steps-wheel/src/StepsWheel.js +4 -0
- package/es/packages/steps-wheel/src/StepsWheel.vue.d.ts +547 -0
- package/es/packages/steps-wheel/src/StepsWheel.vue_vue_type_script_setup_true_lang.js +252 -0
- package/es/packages/steps-wheel/style/index.css +161 -0
- package/es/packages/time-line/index.d.ts +1 -0
- package/es/packages/time-line/src/TimeLine.vue.d.ts +1 -0
- package/es/packages/time-line/src/TimeLine.vue_vue_type_script_setup_true_lang.js +6 -1
- package/es/packages/time-line/style/index.css +7 -2
- package/es/src/types/index.d.ts +1 -0
- package/package.json +153 -153
- package/es/packages/button-print/src/utils/print.es.min.d.ts +0 -2
- package/es/packages/button-print/src/utils/print.es.min.js +0 -2532
- package/test.ts +0 -326
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent, reactive, computed, onMounted, watch, openBlock, createElementBlock, Fragment, createVNode, unref, withCtx, renderSlot, withModifiers, createCommentVNode, createTextVNode, toDisplayString, mergeProps } from 'vue';
|
|
1
|
+
import { defineComponent, reactive, computed, onMounted, onUnmounted, watch, openBlock, createElementBlock, Fragment, createVNode, unref, withCtx, renderSlot, withModifiers, createCommentVNode, createTextVNode, toDisplayString, mergeProps } from 'vue';
|
|
2
2
|
import { useMessage, NDropdown, NButton, NIcon } from 'naive-ui';
|
|
3
3
|
import { ChevronDown } from '@vicons/ionicons5';
|
|
4
|
-
import
|
|
4
|
+
import Print from './utils/print.js';
|
|
5
5
|
import './components/IdentityVerification.js';
|
|
6
6
|
import moment from 'moment';
|
|
7
7
|
import script$1 from './components/IdentityVerification.vue_vue_type_script_setup_true_lang.js';
|
|
@@ -28,6 +28,10 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
28
28
|
default: "\u6253\u5370\u9884\u89C8",
|
|
29
29
|
type: String
|
|
30
30
|
},
|
|
31
|
+
pdfLoadText: {
|
|
32
|
+
default: "\u4E0B\u8F7Dpdf",
|
|
33
|
+
type: String
|
|
34
|
+
},
|
|
31
35
|
formatEditText: {
|
|
32
36
|
default: "\u683C\u5F0F\u7F16\u8F91",
|
|
33
37
|
type: String
|
|
@@ -63,7 +67,7 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
63
67
|
}) {
|
|
64
68
|
const props = __props;
|
|
65
69
|
const $message = useMessage();
|
|
66
|
-
let printInstance
|
|
70
|
+
let printInstance;
|
|
67
71
|
const state = reactive({
|
|
68
72
|
spinning: false,
|
|
69
73
|
visible: false,
|
|
@@ -84,6 +88,9 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
84
88
|
}, {
|
|
85
89
|
label: props.previewText,
|
|
86
90
|
key: "previewText"
|
|
91
|
+
}, {
|
|
92
|
+
label: props.pdfLoadText,
|
|
93
|
+
key: "downloadPdf"
|
|
87
94
|
}, {
|
|
88
95
|
label: props.formatEditText,
|
|
89
96
|
key: "formatEditText"
|
|
@@ -207,6 +214,28 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
207
214
|
state.visible = false;
|
|
208
215
|
});
|
|
209
216
|
};
|
|
217
|
+
const handleClickPdf = async () => {
|
|
218
|
+
props.prevFn().catch(() => {
|
|
219
|
+
prevFnError();
|
|
220
|
+
return Promise.reject();
|
|
221
|
+
}).then(() => {
|
|
222
|
+
const params = props.strategy === "MULTI" ? getPrintParams() : getOnceParams();
|
|
223
|
+
const queryParams = {
|
|
224
|
+
formatId: state.currentFormatId,
|
|
225
|
+
templateId: getTemplateIdByFormatId(state.currentFormatId),
|
|
226
|
+
print: {
|
|
227
|
+
print: "1",
|
|
228
|
+
type: "1"
|
|
229
|
+
},
|
|
230
|
+
params
|
|
231
|
+
};
|
|
232
|
+
printInstance.printDirect(queryParams, (res) => {
|
|
233
|
+
callLocalServicesSuccessCb(res, "preview");
|
|
234
|
+
}, callLocalServicesErrorCb);
|
|
235
|
+
}).finally(() => {
|
|
236
|
+
state.visible = false;
|
|
237
|
+
});
|
|
238
|
+
};
|
|
210
239
|
const handleClickEdit = () => {
|
|
211
240
|
props.prevFn().catch(() => {
|
|
212
241
|
prevFnError();
|
|
@@ -228,6 +257,9 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
228
257
|
case "formatEditText":
|
|
229
258
|
handleClickEdit();
|
|
230
259
|
break;
|
|
260
|
+
case "downloadPdf":
|
|
261
|
+
handleClickPdf();
|
|
262
|
+
break;
|
|
231
263
|
default:
|
|
232
264
|
state.currentFormatId = key;
|
|
233
265
|
state.visible = false;
|
|
@@ -241,7 +273,7 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
241
273
|
const instantiatePrintSDK = () => {
|
|
242
274
|
if (printInstance)
|
|
243
275
|
return false;
|
|
244
|
-
printInstance = new
|
|
276
|
+
printInstance = new Print();
|
|
245
277
|
};
|
|
246
278
|
const getDefaultFormatId = (list, key) => {
|
|
247
279
|
if (!(list == null ? void 0 : list.length))
|
|
@@ -395,6 +427,9 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
395
427
|
onMounted(() => {
|
|
396
428
|
state.isInited = false;
|
|
397
429
|
});
|
|
430
|
+
onUnmounted(() => {
|
|
431
|
+
printInstance == null ? void 0 : printInstance.destroy();
|
|
432
|
+
});
|
|
398
433
|
watch(() => props.params, (val) => {
|
|
399
434
|
if (!(val == null ? void 0 : val.length))
|
|
400
435
|
return false;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AnyObject, Func } from '../../../../../es/src/types';
|
|
2
|
+
export default class Print {
|
|
3
|
+
private readonly webview;
|
|
4
|
+
private currentMessageHandler?;
|
|
5
|
+
constructor();
|
|
6
|
+
private readonly messageHandlerStack;
|
|
7
|
+
private messageHandler;
|
|
8
|
+
private postMessage;
|
|
9
|
+
destroy(): void;
|
|
10
|
+
_testConnection(): Promise<unknown>;
|
|
11
|
+
_queryServicesPrint(params: AnyObject): Promise<any>;
|
|
12
|
+
_callPrintWithFile(queryParams: AnyObject): Promise<any>;
|
|
13
|
+
_handleResult(data: AnyObject, errorCallbackFn?: Func): false | AnyObject;
|
|
14
|
+
_handleResultTest(result: any, errorCallbackFn?: Func): boolean;
|
|
15
|
+
_handleEventQueryPrintData(templateId: string, formatId: string, params: AnyObject, errorCallbackFn?: Func): Promise<false | {
|
|
16
|
+
file: any;
|
|
17
|
+
printerName: any;
|
|
18
|
+
pageCount: any;
|
|
19
|
+
formatId: string;
|
|
20
|
+
}>;
|
|
21
|
+
_handleQueryPrintDataResult(printData: AnyObject, formatId: string, errorCallbackFn?: Func): false | {
|
|
22
|
+
file: any;
|
|
23
|
+
printerName: any;
|
|
24
|
+
pageCount: any;
|
|
25
|
+
formatId: string;
|
|
26
|
+
};
|
|
27
|
+
_handleEventDirect({ templateId, formatId, params, cmdid, print, printdlgshow, nobillnode }: AnyObject): Promise<any>;
|
|
28
|
+
_handleEventEditFormat({ templateId, formatId, params, token }: AnyObject): Promise<any>;
|
|
29
|
+
preview({ templateId, formatId, params }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | undefined>;
|
|
30
|
+
printDirect({ templateId, formatId, params, print, printdlgshow, nobillnode }: AnyObject, successCallbackFn: Func, errorCallbackFn: Func): Promise<false | undefined>;
|
|
31
|
+
print({ templateId, formatId, params }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | undefined>;
|
|
32
|
+
queryPrintData({ templateId, formatId, params }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | {
|
|
33
|
+
file: any;
|
|
34
|
+
printerName: any;
|
|
35
|
+
pageCount: any;
|
|
36
|
+
formatId: string;
|
|
37
|
+
}>;
|
|
38
|
+
printFileData({ formatId, file, printerName }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | AnyObject>;
|
|
39
|
+
editPrintFormat({ templateId, formatId, params, token }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | undefined>;
|
|
40
|
+
addPrintFormat({ templateId, params, token }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | undefined>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
|
|
3
|
+
const PRINT_ORIGIN = "http://127.0.0.1:11111";
|
|
4
|
+
const EDIT_LOCAL_URL = `${PRINT_ORIGIN}/services/print`;
|
|
5
|
+
const PRINT_URL = `${PRINT_ORIGIN}/PrintLocal`;
|
|
6
|
+
const PRINT_CMD_ID = "7";
|
|
7
|
+
const PREVIEW_CMD_ID = "8";
|
|
8
|
+
const PRINTER_NAME_DEFAULT = "Default";
|
|
9
|
+
const testHttpFn = axios.create({
|
|
10
|
+
timeout: 1e3,
|
|
11
|
+
withCredentials: false
|
|
12
|
+
});
|
|
13
|
+
const httpFn = axios.create({ withCredentials: false });
|
|
14
|
+
class Print {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.messageHandlerStack = [];
|
|
17
|
+
var _a;
|
|
18
|
+
const _window = window;
|
|
19
|
+
this.webview = (_a = _window.chrome) == null ? void 0 : _a.webview;
|
|
20
|
+
if (!this.webview)
|
|
21
|
+
return;
|
|
22
|
+
this.currentMessageHandler = this.messageHandler.bind(this);
|
|
23
|
+
this.webview.addEventListener("message", this.currentMessageHandler);
|
|
24
|
+
}
|
|
25
|
+
messageHandler(e) {
|
|
26
|
+
const handler = this.messageHandlerStack.pop();
|
|
27
|
+
if (!handler)
|
|
28
|
+
return console.log("\u5F53\u524D\u56DE\u6267", e, "\u6CA1\u6709\u53EF\u7528\u7684handler");
|
|
29
|
+
const { resolve, reject } = handler;
|
|
30
|
+
try {
|
|
31
|
+
console.log(e);
|
|
32
|
+
resolve(JSON.parse(e.data));
|
|
33
|
+
} catch (e2) {
|
|
34
|
+
reject(e2);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async postMessage(data) {
|
|
38
|
+
if (!this.webview)
|
|
39
|
+
return Promise.reject();
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
this.messageHandlerStack.push({ resolve, reject });
|
|
42
|
+
this.webview.postMessage(data);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
destroy() {
|
|
46
|
+
if (this.webview && this.currentMessageHandler) {
|
|
47
|
+
this.webview.removeEventListener("message", this.currentMessageHandler);
|
|
48
|
+
this.currentMessageHandler = void 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
_testConnection() {
|
|
52
|
+
if (this.webview)
|
|
53
|
+
return Promise.resolve(true);
|
|
54
|
+
return new Promise((resolve) => {
|
|
55
|
+
testHttpFn({
|
|
56
|
+
url: `${PRINT_ORIGIN}/test`,
|
|
57
|
+
method: "get",
|
|
58
|
+
withCredentials: false,
|
|
59
|
+
params: {
|
|
60
|
+
inputdata: {
|
|
61
|
+
result: "success"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}).then(({ data }) => {
|
|
65
|
+
if (data.result !== "success") {
|
|
66
|
+
resolve(false);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
resolve(true);
|
|
70
|
+
}).catch((err) => {
|
|
71
|
+
resolve(false);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
_queryServicesPrint(params) {
|
|
76
|
+
if (this.webview) {
|
|
77
|
+
return this.postMessage({ exec: "print", data: { inputData: params } });
|
|
78
|
+
}
|
|
79
|
+
return httpFn({
|
|
80
|
+
url: EDIT_LOCAL_URL,
|
|
81
|
+
method: "get",
|
|
82
|
+
params: {
|
|
83
|
+
inputData: JSON.stringify(params)
|
|
84
|
+
}
|
|
85
|
+
}).then(({ data }) => {
|
|
86
|
+
return data;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
_callPrintWithFile(queryParams) {
|
|
90
|
+
const defaultQueryParams = {
|
|
91
|
+
cmdid: PRINT_CMD_ID,
|
|
92
|
+
flag: "1"
|
|
93
|
+
};
|
|
94
|
+
const params = {
|
|
95
|
+
inputData: JSON.stringify(Object.assign({}, defaultQueryParams, queryParams))
|
|
96
|
+
};
|
|
97
|
+
if (this.webview) {
|
|
98
|
+
return this.postMessage({ exec: "print", data: transformData(params) });
|
|
99
|
+
}
|
|
100
|
+
return httpFn({
|
|
101
|
+
url: PRINT_URL,
|
|
102
|
+
method: "post",
|
|
103
|
+
data: params,
|
|
104
|
+
transformRequest: [transformData]
|
|
105
|
+
}).then(({ data }) => {
|
|
106
|
+
return data;
|
|
107
|
+
});
|
|
108
|
+
function transformData(oldData) {
|
|
109
|
+
let newStr = "";
|
|
110
|
+
for (const item in oldData) {
|
|
111
|
+
newStr += encodeURIComponent(item) + "=" + encodeURIComponent(oldData[item]) + "&";
|
|
112
|
+
}
|
|
113
|
+
newStr = newStr.slice(0, -1);
|
|
114
|
+
return newStr;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
_handleResult(data, errorCallbackFn) {
|
|
118
|
+
if (data.result !== "success") {
|
|
119
|
+
const message = data.message || data.Message;
|
|
120
|
+
const errorMsgObj = {
|
|
121
|
+
type: "printError",
|
|
122
|
+
message,
|
|
123
|
+
result: data.result,
|
|
124
|
+
errinfo: data.errinfo
|
|
125
|
+
};
|
|
126
|
+
errorCallbackFn == null ? void 0 : errorCallbackFn(errorMsgObj);
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
return data;
|
|
130
|
+
}
|
|
131
|
+
_handleResultTest(result, errorCallbackFn) {
|
|
132
|
+
if (!result) {
|
|
133
|
+
console.log("notInstalledApp");
|
|
134
|
+
errorCallbackFn == null ? void 0 : errorCallbackFn({
|
|
135
|
+
type: "notInstalledApp",
|
|
136
|
+
message: "\u8BF7\u6253\u5F00\u6253\u5370\u670D\u52A1\u5668\u63D2\u4EF6"
|
|
137
|
+
});
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
async _handleEventQueryPrintData(templateId, formatId, params, errorCallbackFn) {
|
|
143
|
+
const queryParams = {
|
|
144
|
+
templateId,
|
|
145
|
+
formatId,
|
|
146
|
+
params,
|
|
147
|
+
cmdid: PRINT_CMD_ID
|
|
148
|
+
};
|
|
149
|
+
const printData = await this._queryServicesPrint(queryParams);
|
|
150
|
+
return this._handleQueryPrintDataResult(printData, formatId, errorCallbackFn);
|
|
151
|
+
}
|
|
152
|
+
_handleQueryPrintDataResult(printData, formatId, errorCallbackFn) {
|
|
153
|
+
if (!(printData == null ? void 0 : printData.file)) {
|
|
154
|
+
try {
|
|
155
|
+
const message = printData.message || printData.Message;
|
|
156
|
+
console.log(message);
|
|
157
|
+
errorCallbackFn == null ? void 0 : errorCallbackFn({
|
|
158
|
+
type: "queryPrintDataFailure",
|
|
159
|
+
message
|
|
160
|
+
});
|
|
161
|
+
} catch (err) {
|
|
162
|
+
console.log(err);
|
|
163
|
+
}
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
file: printData.file,
|
|
168
|
+
printerName: printData.defprinter,
|
|
169
|
+
pageCount: printData.pagecount,
|
|
170
|
+
formatId
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
async _handleEventDirect({
|
|
174
|
+
templateId,
|
|
175
|
+
formatId,
|
|
176
|
+
params,
|
|
177
|
+
cmdid,
|
|
178
|
+
print,
|
|
179
|
+
printdlgshow = "1",
|
|
180
|
+
nobillnode = "1"
|
|
181
|
+
}) {
|
|
182
|
+
const queryParams = {
|
|
183
|
+
templateId,
|
|
184
|
+
formatId,
|
|
185
|
+
params,
|
|
186
|
+
cmdid,
|
|
187
|
+
nobillnode,
|
|
188
|
+
printdlgshow
|
|
189
|
+
};
|
|
190
|
+
if (print) {
|
|
191
|
+
try {
|
|
192
|
+
print = JSON.parse(print);
|
|
193
|
+
} catch (error) {
|
|
194
|
+
}
|
|
195
|
+
queryParams.print = print;
|
|
196
|
+
}
|
|
197
|
+
return await this._queryServicesPrint(queryParams);
|
|
198
|
+
}
|
|
199
|
+
async _handleEventEditFormat({ templateId, formatId = "", params = "", token }) {
|
|
200
|
+
const DEFAULT_PARAMS = {};
|
|
201
|
+
let formatParams = {};
|
|
202
|
+
try {
|
|
203
|
+
formatParams = Object.assign({}, DEFAULT_PARAMS, JSON.parse(params));
|
|
204
|
+
} catch (error) {
|
|
205
|
+
formatParams = DEFAULT_PARAMS;
|
|
206
|
+
}
|
|
207
|
+
const queryParams = {
|
|
208
|
+
templateId,
|
|
209
|
+
formatId,
|
|
210
|
+
cmdid: "9",
|
|
211
|
+
token,
|
|
212
|
+
params: JSON.stringify(formatParams)
|
|
213
|
+
};
|
|
214
|
+
return await this._queryServicesPrint(queryParams);
|
|
215
|
+
}
|
|
216
|
+
async preview({ templateId, formatId, params = "" }, successCallbackFn, errorCallbackFn) {
|
|
217
|
+
const testResult = await this._testConnection();
|
|
218
|
+
if (!this._handleResultTest(testResult, errorCallbackFn))
|
|
219
|
+
return false;
|
|
220
|
+
const result = await this._handleEventDirect({
|
|
221
|
+
templateId,
|
|
222
|
+
formatId,
|
|
223
|
+
params,
|
|
224
|
+
cmdid: PREVIEW_CMD_ID
|
|
225
|
+
});
|
|
226
|
+
if (!result)
|
|
227
|
+
return false;
|
|
228
|
+
const handledResult = this._handleResult(result, errorCallbackFn);
|
|
229
|
+
if (!handledResult)
|
|
230
|
+
return false;
|
|
231
|
+
successCallbackFn && successCallbackFn(handledResult);
|
|
232
|
+
}
|
|
233
|
+
async printDirect({ templateId, formatId, params = "", print, printdlgshow, nobillnode }, successCallbackFn, errorCallbackFn) {
|
|
234
|
+
const testResult = await this._testConnection();
|
|
235
|
+
if (!this._handleResultTest(testResult, errorCallbackFn))
|
|
236
|
+
return false;
|
|
237
|
+
const result = await this._handleEventDirect({
|
|
238
|
+
templateId,
|
|
239
|
+
formatId,
|
|
240
|
+
params,
|
|
241
|
+
cmdid: PRINT_CMD_ID,
|
|
242
|
+
print,
|
|
243
|
+
printdlgshow,
|
|
244
|
+
nobillnode
|
|
245
|
+
});
|
|
246
|
+
if (!result)
|
|
247
|
+
return false;
|
|
248
|
+
const handledResult = this._handleResult(result, errorCallbackFn);
|
|
249
|
+
if (!handledResult)
|
|
250
|
+
return false;
|
|
251
|
+
successCallbackFn && successCallbackFn(handledResult);
|
|
252
|
+
}
|
|
253
|
+
async print({ templateId, formatId, params = "" }, successCallbackFn, errorCallbackFn) {
|
|
254
|
+
const testResult = await this._testConnection();
|
|
255
|
+
if (!this._handleResultTest(testResult, errorCallbackFn))
|
|
256
|
+
return false;
|
|
257
|
+
const printData = await this.queryPrintData({ templateId, formatId, params }, void 0, errorCallbackFn);
|
|
258
|
+
if (!printData)
|
|
259
|
+
return false;
|
|
260
|
+
const handledResult = this.printFileData({
|
|
261
|
+
formatId,
|
|
262
|
+
file: printData.file,
|
|
263
|
+
printerName: printData.printerName
|
|
264
|
+
}, void 0, errorCallbackFn);
|
|
265
|
+
if (!handledResult)
|
|
266
|
+
return false;
|
|
267
|
+
successCallbackFn && successCallbackFn(handledResult);
|
|
268
|
+
}
|
|
269
|
+
async queryPrintData({ templateId, formatId, params = "" }, successCallbackFn, errorCallbackFn) {
|
|
270
|
+
const testResult = await this._testConnection();
|
|
271
|
+
if (!this._handleResultTest(testResult, errorCallbackFn))
|
|
272
|
+
return false;
|
|
273
|
+
const result = await this._handleEventQueryPrintData(templateId, formatId, params, errorCallbackFn);
|
|
274
|
+
if (!result)
|
|
275
|
+
return false;
|
|
276
|
+
successCallbackFn && successCallbackFn(result);
|
|
277
|
+
return result;
|
|
278
|
+
}
|
|
279
|
+
async printFileData({ formatId, file, printerName = PRINTER_NAME_DEFAULT }, successCallbackFn, errorCallbackFn) {
|
|
280
|
+
const testResult = await this._testConnection();
|
|
281
|
+
if (!this._handleResultTest(testResult, errorCallbackFn))
|
|
282
|
+
return false;
|
|
283
|
+
const result = await this._callPrintWithFile({
|
|
284
|
+
formatId,
|
|
285
|
+
printname: printerName,
|
|
286
|
+
file
|
|
287
|
+
});
|
|
288
|
+
const handledResult = this._handleResult(result, errorCallbackFn);
|
|
289
|
+
if (!handledResult)
|
|
290
|
+
return false;
|
|
291
|
+
successCallbackFn && successCallbackFn(handledResult);
|
|
292
|
+
return handledResult;
|
|
293
|
+
}
|
|
294
|
+
async editPrintFormat({ templateId, formatId, params, token }, successCallbackFn, errorCallbackFn) {
|
|
295
|
+
const testResult = await this._testConnection();
|
|
296
|
+
if (!this._handleResultTest(testResult, errorCallbackFn))
|
|
297
|
+
return false;
|
|
298
|
+
const result = await this._handleEventEditFormat({
|
|
299
|
+
templateId,
|
|
300
|
+
formatId,
|
|
301
|
+
params,
|
|
302
|
+
token
|
|
303
|
+
});
|
|
304
|
+
const handledResult = this._handleResult(result, errorCallbackFn);
|
|
305
|
+
if (!handledResult)
|
|
306
|
+
return false;
|
|
307
|
+
successCallbackFn && successCallbackFn(handledResult);
|
|
308
|
+
}
|
|
309
|
+
async addPrintFormat({ templateId, params, token }, successCallbackFn, errorCallbackFn) {
|
|
310
|
+
const testResult = await this._testConnection();
|
|
311
|
+
if (!this._handleResultTest(testResult, errorCallbackFn))
|
|
312
|
+
return false;
|
|
313
|
+
const result = await this._handleEventEditFormat({
|
|
314
|
+
templateId,
|
|
315
|
+
params,
|
|
316
|
+
token
|
|
317
|
+
});
|
|
318
|
+
const handledResult = this._handleResult(result, errorCallbackFn);
|
|
319
|
+
if (!handledResult)
|
|
320
|
+
return false;
|
|
321
|
+
successCallbackFn && successCallbackFn(handledResult);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export { Print as default };
|
|
@@ -30,9 +30,8 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
30
30
|
originY: import("vue").ComputedRef<number>;
|
|
31
31
|
xCellWidth: import("vue").ComputedRef<number>;
|
|
32
32
|
yCellHeight: import("vue").ComputedRef<number>;
|
|
33
|
-
xScaleList: import("vue").ComputedRef<number[]>;
|
|
34
33
|
iconsWidth: import("vue").ComputedRef<any>;
|
|
35
|
-
|
|
34
|
+
xScaleList: import("vue").ComputedRef<any[]>;
|
|
36
35
|
breatheYCell: import("vue").ComputedRef<number>;
|
|
37
36
|
pulseYCell: import("vue").ComputedRef<number>;
|
|
38
37
|
temperatureYCell: import("vue").ComputedRef<number>;
|
|
@@ -50,9 +49,9 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
50
49
|
endY: number;
|
|
51
50
|
}>;
|
|
52
51
|
propItems: any;
|
|
53
|
-
cumputedX: (value: string | number) =>
|
|
52
|
+
cumputedX: (value: string | number) => any;
|
|
54
53
|
cumputedY: (type: import("./src/interface").IPointType, scaleValueList: number[], value: string | number) => number;
|
|
55
|
-
getXValue: (pointX: number) => string;
|
|
54
|
+
getXValue: (pointX: number) => string | undefined;
|
|
56
55
|
getYValue: (type: import("./src/interface").IPointType, pointY: number) => number;
|
|
57
56
|
pointTipProps: {
|
|
58
57
|
show: boolean;
|
|
@@ -30,9 +30,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
30
|
originY: import("vue").ComputedRef<number>;
|
|
31
31
|
xCellWidth: import("vue").ComputedRef<number>;
|
|
32
32
|
yCellHeight: import("vue").ComputedRef<number>;
|
|
33
|
-
xScaleList: import("vue").ComputedRef<number[]>;
|
|
34
33
|
iconsWidth: import("vue").ComputedRef<any>;
|
|
35
|
-
|
|
34
|
+
xScaleList: import("vue").ComputedRef<any[]>;
|
|
36
35
|
breatheYCell: import("vue").ComputedRef<number>;
|
|
37
36
|
pulseYCell: import("vue").ComputedRef<number>;
|
|
38
37
|
temperatureYCell: import("vue").ComputedRef<number>;
|
|
@@ -50,9 +49,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
50
49
|
endY: number;
|
|
51
50
|
}>;
|
|
52
51
|
propItems: any;
|
|
53
|
-
cumputedX: (value: string | number) =>
|
|
52
|
+
cumputedX: (value: string | number) => any;
|
|
54
53
|
cumputedY: (type: import("./interface").IPointType, scaleValueList: number[], value: string | number) => number;
|
|
55
|
-
getXValue: (pointX: number) => string;
|
|
54
|
+
getXValue: (pointX: number) => string | undefined;
|
|
56
55
|
getYValue: (type: import("./interface").IPointType, pointY: number) => number;
|
|
57
56
|
pointTipProps: {
|
|
58
57
|
show: boolean;
|
|
@@ -60,7 +60,7 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
60
60
|
return grid.mainYCell * grid.subYCell;
|
|
61
61
|
});
|
|
62
62
|
const endX = computed(() => {
|
|
63
|
-
const { width, right = null } = props.data;
|
|
63
|
+
const { width, right = null, top } = props.data;
|
|
64
64
|
if (!right)
|
|
65
65
|
return width;
|
|
66
66
|
const endWidth = right.width || 50;
|
|
@@ -69,17 +69,14 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
69
69
|
const originX = computed(() => {
|
|
70
70
|
const { top, left } = props.data;
|
|
71
71
|
const originX2 = top.titleWidth + iconsWidth.value;
|
|
72
|
-
|
|
73
|
-
return originX2 + residue;
|
|
72
|
+
return originX2;
|
|
74
73
|
});
|
|
75
74
|
const endY = computed(() => {
|
|
76
75
|
const { bottom = null, height } = props.data;
|
|
77
76
|
if (!bottom)
|
|
78
77
|
return height;
|
|
79
78
|
const endHeight = bottom.height || 30;
|
|
80
|
-
|
|
81
|
-
const residue = (endY2 - originY.value) % gridYNumber.value;
|
|
82
|
-
return endY2 - residue;
|
|
79
|
+
return height - endHeight;
|
|
83
80
|
});
|
|
84
81
|
const originY = computed(() => {
|
|
85
82
|
const { top } = props.data;
|
|
@@ -94,25 +91,35 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
94
91
|
const yCellHeight = computed(() => {
|
|
95
92
|
return (endY.value - originY.value) / gridYNumber.value;
|
|
96
93
|
});
|
|
94
|
+
const iconsWidth = computed(() => {
|
|
95
|
+
var _a, _b;
|
|
96
|
+
const { left } = props.data;
|
|
97
|
+
return ((_a = left.icons) == null ? void 0 : _a.show) && (((_b = left.icons) == null ? void 0 : _b.width) || 100) || 0;
|
|
98
|
+
});
|
|
97
99
|
const xScaleList = computed(() => {
|
|
98
100
|
const { top } = props.data;
|
|
99
101
|
const dateList = top.date.list;
|
|
100
|
-
const
|
|
102
|
+
const times = top.xScalevalue.times;
|
|
103
|
+
let left = originX.value - xCellWidth.value;
|
|
104
|
+
function getDate(date) {
|
|
105
|
+
return String(date).length < 9 ? `20${date}` : date;
|
|
106
|
+
}
|
|
101
107
|
const timeList = dateList.map((item) => {
|
|
102
|
-
return
|
|
103
|
-
|
|
108
|
+
return times.map((v) => {
|
|
109
|
+
left += xCellWidth.value;
|
|
110
|
+
const start = new Date(`${getDate(item)} ${v.start}`).getTime();
|
|
111
|
+
const end = new Date(`${getDate(item)} ${v.end}`).getTime();
|
|
112
|
+
return {
|
|
113
|
+
start,
|
|
114
|
+
end,
|
|
115
|
+
left,
|
|
116
|
+
center: left + xCellWidth.value / 2,
|
|
117
|
+
scaleCell: (end - start) / xCellWidth.value
|
|
118
|
+
};
|
|
104
119
|
});
|
|
105
120
|
});
|
|
106
121
|
return timeList.flat();
|
|
107
122
|
});
|
|
108
|
-
const iconsWidth = computed(() => {
|
|
109
|
-
var _a, _b;
|
|
110
|
-
const { left } = props.data;
|
|
111
|
-
return ((_a = left.icons) == null ? void 0 : _a.show) && (((_b = left.icons) == null ? void 0 : _b.width) || 100) || 0;
|
|
112
|
-
});
|
|
113
|
-
const xScaleCell = computed(() => {
|
|
114
|
-
return xScaleList.value[1] - xScaleList.value[0];
|
|
115
|
-
});
|
|
116
123
|
const breatheYCell = computed(() => {
|
|
117
124
|
var _a;
|
|
118
125
|
const { yScaleValue, spaceGridNumber = 5 } = props.data.left;
|
|
@@ -222,7 +229,6 @@ var script = /* @__PURE__ */ defineComponent({
|
|
|
222
229
|
xCellWidth: xCellWidth.value,
|
|
223
230
|
yCellHeight: yCellHeight.value,
|
|
224
231
|
xScaleList: xScaleList.value,
|
|
225
|
-
xScaleCell: xScaleCell.value,
|
|
226
232
|
breatheYCell: breatheYCell.value,
|
|
227
233
|
pulseYCell: pulseYCell.value,
|
|
228
234
|
temperatureYCell: temperatureYCell.value,
|
|
@@ -5,7 +5,6 @@ import { defaultBorderStyle, drawTextGroup, defaultTextStyle, defaultRectStyle,
|
|
|
5
5
|
function useBottom(canvas, propItems) {
|
|
6
6
|
const {
|
|
7
7
|
xScaleList,
|
|
8
|
-
xScaleCell,
|
|
9
8
|
originX,
|
|
10
9
|
endX,
|
|
11
10
|
endY,
|
|
@@ -35,7 +34,7 @@ function useBottom(canvas, propItems) {
|
|
|
35
34
|
let text = "";
|
|
36
35
|
bottomBreathingList.forEach((v, i) => {
|
|
37
36
|
const time = new Date(v.time).getTime();
|
|
38
|
-
if (time >= item && time < +item +
|
|
37
|
+
if (time >= item && time < +item + item.scaleCell)
|
|
39
38
|
text = v.value;
|
|
40
39
|
});
|
|
41
40
|
const style = flag ? {
|