orion-design 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +5 -0
- package/dist/components/Button/Button.vue.d.ts +2 -0
- package/dist/components/Button/index.d.ts +4 -0
- package/dist/components/Button/index.js +27 -0
- package/dist/components/Button/index.js.map +1 -0
- package/dist/components/Flex/Col.d.ts +4 -4
- package/dist/components/Flex/Item.d.ts +4 -4
- package/dist/components/Flex/Row.d.ts +4 -4
- package/dist/components/Flex/index.d.ts +4 -4
- package/dist/components/Flex/index.js +95 -127
- package/dist/components/Flex/index.js.map +1 -0
- package/dist/components/Form/Form.d.ts +21 -0
- package/dist/components/Form/Form.js +5 -0
- package/dist/components/Form/Form.js.map +1 -0
- package/dist/components/Form/Form.vue.d.ts +465 -0
- package/dist/components/Form/PasswordInput/PasswordInput.d.ts +15 -0
- package/dist/components/Form/PasswordInput/PasswordInput.js +2 -0
- package/dist/components/Form/PasswordInput/PasswordInput.js.map +1 -0
- package/dist/components/Form/PasswordInput/PasswordInput.vue.d.ts +3 -0
- package/dist/components/Form/PasswordInput/index.d.ts +1 -0
- package/dist/components/Form/PasswordInput/index.js +2 -0
- package/dist/components/Form/PasswordInput/index.js.map +1 -0
- package/dist/components/Form/StringInput/StringInput.d.ts +15 -0
- package/dist/components/Form/StringInput/StringInput.js +2 -0
- package/dist/components/Form/StringInput/StringInput.js.map +1 -0
- package/dist/components/Form/StringInput/StringInput.vue.d.ts +3 -0
- package/dist/components/Form/StringInput/index.d.ts +1 -0
- package/dist/components/Form/StringInput/index.js +2 -0
- package/dist/components/Form/StringInput/index.js.map +1 -0
- package/dist/components/Form/Textarea/Textarea.d.ts +16 -0
- package/dist/components/Form/Textarea/Textarea.js +2 -0
- package/dist/components/Form/Textarea/Textarea.js.map +1 -0
- package/dist/components/Form/Textarea/Textarea.vue.d.ts +3 -0
- package/dist/components/Form/Textarea/index.d.ts +1 -0
- package/dist/components/Form/Textarea/index.js +2 -0
- package/dist/components/Form/Textarea/index.js.map +1 -0
- package/dist/components/Form/hooks/useForm.d.ts +4 -0
- package/dist/components/Form/hooks/useForm.js +21 -0
- package/dist/components/Form/hooks/useForm.js.map +1 -0
- package/dist/components/Form/index.d.ts +273 -0
- package/dist/components/Form/index.js +194 -0
- package/dist/components/Form/index.js.map +1 -0
- package/dist/components/Modal/index.d.ts +1 -14
- package/dist/components/Modal/useModal.d.ts +1 -1
- package/dist/components/Modal/useModal.js +7 -7
- package/dist/components/Modal/useModal.js.map +1 -0
- package/dist/components/Pagetable/Pagetable.d.ts +79 -0
- package/dist/components/Pagetable/columns/PagetableDatecolumn.d.ts +88 -0
- package/dist/components/Pagetable/columns/PagetableStringcolumn.d.ts +62 -0
- package/dist/components/Pagetable/index.d.ts +60 -0
- package/dist/components/Pagetable/index.js +144 -0
- package/dist/components/Pagetable/index.js.map +1 -0
- package/dist/components/Pagetable/interface.d.ts +10 -0
- package/dist/components/Pagetable/interface.js +2 -0
- package/dist/components/Pagetable/interface.js.map +1 -0
- package/dist/components/Space/index.d.ts +9 -9
- package/dist/components/_util/arrays.d.ts +5 -0
- package/dist/components/_util/arrays.js +8 -0
- package/dist/components/_util/arrays.js.map +1 -0
- package/dist/components/_util/browser.d.ts +3 -0
- package/dist/components/_util/browser.js +9 -0
- package/dist/components/_util/browser.js.map +1 -0
- package/dist/components/_util/classNames.js +20 -27
- package/dist/components/_util/classNames.js.map +1 -0
- package/dist/components/_util/dom/aria.d.ts +30 -0
- package/dist/components/_util/dom/aria.js +46 -0
- package/dist/components/_util/dom/aria.js.map +1 -0
- package/dist/components/_util/dom/element.d.ts +3 -0
- package/dist/components/_util/dom/element.js +18 -0
- package/dist/components/_util/dom/element.js.map +1 -0
- package/dist/components/_util/dom/event.d.ts +6 -0
- package/dist/components/_util/dom/event.js +10 -0
- package/dist/components/_util/dom/event.js.map +1 -0
- package/dist/components/_util/dom/index.d.ts +6 -0
- package/dist/components/_util/dom/index.js +39 -0
- package/dist/components/_util/dom/index.js.map +1 -0
- package/dist/components/_util/dom/position.d.ts +7 -0
- package/dist/components/_util/dom/position.js +30 -0
- package/dist/components/_util/dom/position.js.map +1 -0
- package/dist/components/_util/dom/scroll.d.ts +11 -0
- package/dist/components/_util/dom/scroll.js +78 -0
- package/dist/components/_util/dom/scroll.js.map +1 -0
- package/dist/components/_util/dom/style.d.ts +9 -0
- package/dist/components/_util/dom/style.js +58 -0
- package/dist/components/_util/dom/style.js.map +1 -0
- package/dist/components/_util/easings.d.ts +1 -0
- package/dist/components/_util/easings.js +8 -0
- package/dist/components/_util/easings.js.map +1 -0
- package/dist/components/_util/error.d.ts +3 -0
- package/dist/components/_util/error.js +22 -0
- package/dist/components/_util/error.js.map +1 -0
- package/dist/components/_util/functions.d.ts +1 -0
- package/dist/components/_util/functions.js +6 -0
- package/dist/components/_util/functions.js.map +1 -0
- package/dist/components/_util/i18n.d.ts +1 -0
- package/dist/components/_util/i18n.js +5 -0
- package/dist/components/_util/i18n.js.map +1 -0
- package/dist/components/_util/index.d.ts +15 -0
- package/dist/components/_util/index.js +140 -0
- package/dist/components/_util/index.js.map +1 -0
- package/dist/components/_util/isValid.js +4 -4
- package/dist/components/_util/isValid.js.map +1 -0
- package/dist/components/_util/objects.d.ts +8 -0
- package/dist/components/_util/objects.js +17 -0
- package/dist/components/_util/objects.js.map +1 -0
- package/dist/components/_util/props-util/index.d.ts +4 -4
- package/dist/components/_util/props-util/index.js +23 -50
- package/dist/components/_util/props-util/index.js.map +1 -0
- package/dist/components/_util/props-util/initDefaultProps.d.ts +2 -2
- package/dist/components/_util/props-util/initDefaultProps.js +13 -24
- package/dist/components/_util/props-util/initDefaultProps.js.map +1 -0
- package/dist/components/_util/raf.d.ts +2 -0
- package/dist/components/_util/raf.js +7 -0
- package/dist/components/_util/raf.js.map +1 -0
- package/dist/components/_util/rand.d.ts +12 -0
- package/dist/components/_util/rand.js +6 -0
- package/dist/components/_util/rand.js.map +1 -0
- package/dist/components/_util/strings.d.ts +6 -0
- package/dist/components/_util/strings.js +11 -0
- package/dist/components/_util/strings.js.map +1 -0
- package/dist/components/_util/throttleByRaf.d.ts +4 -0
- package/dist/components/_util/throttleByRaf.js +16 -0
- package/dist/components/_util/throttleByRaf.js.map +1 -0
- package/dist/components/_util/type.d.ts +1 -1
- package/dist/components/_util/type.js +48 -65
- package/dist/components/_util/type.js.map +1 -0
- package/dist/components/_util/types.d.ts +10 -0
- package/dist/components/_util/types.js +25 -0
- package/dist/components/_util/types.js.map +1 -0
- package/dist/components/_util/typescript.d.ts +12 -0
- package/dist/components/_util/typescript.js +5 -0
- package/dist/components/_util/typescript.js.map +1 -0
- package/dist/components/_util/util.d.ts +1 -1
- package/dist/components/_util/util.js +46 -74
- package/dist/components/_util/util.js.map +1 -0
- package/dist/components/_util/vue/global-node.d.ts +3 -0
- package/dist/components/_util/vue/global-node.js +21 -0
- package/dist/components/_util/vue/global-node.js.map +1 -0
- package/dist/components/_util/vue/icon.d.ts +23 -0
- package/dist/components/_util/vue/icon.js +154 -0
- package/dist/components/_util/vue/icon.js.map +1 -0
- package/dist/components/_util/vue/index.d.ts +9 -0
- package/dist/components/_util/vue/index.js +44 -0
- package/dist/components/_util/vue/index.js.map +1 -0
- package/dist/components/_util/vue/install.d.ts +6 -0
- package/dist/components/_util/vue/install.js +21 -0
- package/dist/components/_util/vue/install.js.map +1 -0
- package/dist/components/_util/vue/props/index.d.ts +3 -0
- package/dist/components/_util/vue/props/index.js +9 -0
- package/dist/components/_util/vue/props/index.js.map +1 -0
- package/dist/components/_util/vue/props/runtime.d.ts +29 -0
- package/dist/components/_util/vue/props/runtime.js +37 -0
- package/dist/components/_util/vue/props/runtime.js.map +1 -0
- package/dist/components/_util/vue/props/types.d.ts +120 -0
- package/dist/components/_util/vue/props/types.js +2 -0
- package/dist/components/_util/vue/props/types.js.map +1 -0
- package/dist/components/_util/vue/props/util.d.ts +8 -0
- package/dist/components/_util/vue/props/util.js +2 -0
- package/dist/components/_util/vue/props/util.js.map +1 -0
- package/dist/components/_util/vue/refs.d.ts +3 -0
- package/dist/components/_util/vue/refs.js +12 -0
- package/dist/components/_util/vue/refs.js.map +1 -0
- package/dist/components/_util/vue/size.d.ts +2 -0
- package/dist/components/_util/vue/size.js +6 -0
- package/dist/components/_util/vue/size.js.map +1 -0
- package/dist/components/_util/vue/typescript.d.ts +5 -0
- package/dist/components/_util/vue/typescript.js +2 -0
- package/dist/components/_util/vue/typescript.js.map +1 -0
- package/dist/components/_util/vue/validator.d.ts +3 -0
- package/dist/components/_util/vue/validator.js +7 -0
- package/dist/components/_util/vue/validator.js.map +1 -0
- package/dist/components/_util/vue/vnode.d.ts +50 -0
- package/dist/components/_util/vue/vnode.js +68 -0
- package/dist/components/_util/vue/vnode.js.map +1 -0
- package/dist/components/_util/vue-types/index.d.ts +3 -3
- package/dist/components/_util/vue-types/index.js +275 -417
- package/dist/components/_util/vue-types/index.js.map +1 -0
- package/dist/components/components.d.ts +4 -0
- package/dist/components/components.js +18 -12
- package/dist/components/components.js.map +1 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +25 -24
- package/dist/components/index.js.map +1 -0
- package/dist/components-BZukhWDk.js +106 -0
- package/dist/components-BZukhWDk.js.map +1 -0
- package/dist/error/OrionError.js +7 -12
- package/dist/error/OrionError.js.map +1 -0
- package/dist/functions-DzLqXvGt.js +33 -0
- package/dist/functions-DzLqXvGt.js.map +1 -0
- package/dist/index-C8JNJPWW.js +8 -0
- package/dist/index-C8JNJPWW.js.map +1 -0
- package/dist/index.css +1 -44
- package/dist/index.d.ts +1 -1
- package/dist/index.js +24 -14
- package/dist/index.js.map +1 -0
- package/dist/print/LodopFuncs.js +48 -111
- package/dist/print/LodopFuncs.js.map +1 -0
- package/dist/print/index.d.ts +2 -2
- package/dist/print/index.js +111 -220
- package/dist/print/index.js.map +1 -0
- package/dist/request/ErrorHandlerChain.js +17 -15
- package/dist/request/ErrorHandlerChain.js.map +1 -0
- package/dist/request/RequestFilterChain.d.ts +1 -1
- package/dist/request/RequestFilterChain.js +16 -14
- package/dist/request/RequestFilterChain.js.map +1 -0
- package/dist/request/ResponseParserChain.d.ts +1 -1
- package/dist/request/ResponseParserChain.js +17 -15
- package/dist/request/ResponseParserChain.js.map +1 -0
- package/dist/request/disivion/DateSerializer.js +25 -46
- package/dist/request/disivion/DateSerializer.js.map +1 -0
- package/dist/request/disivion/DivisionErrorHandler.d.ts +1 -1
- package/dist/request/disivion/DivisionErrorHandler.js +30 -52
- package/dist/request/disivion/DivisionErrorHandler.js.map +1 -0
- package/dist/request/disivion/DivisionResponseParser.d.ts +2 -2
- package/dist/request/disivion/DivisionResponseParser.js +13 -25
- package/dist/request/disivion/DivisionResponseParser.js.map +1 -0
- package/dist/request/disivion/index.d.ts +3 -3
- package/dist/request/disivion/index.js +230 -480
- package/dist/request/disivion/index.js.map +1 -0
- package/dist/request/error/BizExceptionResponseError.d.ts +2 -2
- package/dist/request/error/BizExceptionResponseError.js +8 -15
- package/dist/request/error/BizExceptionResponseError.js.map +1 -0
- package/dist/request/error/ExceptionResponseError.d.ts +2 -2
- package/dist/request/error/ExceptionResponseError.js +8 -15
- package/dist/request/error/ExceptionResponseError.js.map +1 -0
- package/dist/request/error/ResponseError.d.ts +1 -1
- package/dist/request/error/ResponseError.js +7 -14
- package/dist/request/error/ResponseError.js.map +1 -0
- package/dist/request/error/SessionExceptionResponseError.d.ts +2 -2
- package/dist/request/error/SessionExceptionResponseError.js +8 -15
- package/dist/request/error/SessionExceptionResponseError.js.map +1 -0
- package/dist/request/index.js +11 -17
- package/dist/request/index.js.map +1 -0
- package/dist/style/index.d.ts +0 -3
- package/dist/style/index.js +1 -0
- package/dist/style/index.js.map +1 -0
- package/dist/utils/DateUtil.js +36 -50
- package/dist/utils/DateUtil.js.map +1 -0
- package/dist/utils/NumberUtil.js +9 -8
- package/dist/utils/NumberUtil.js.map +1 -0
- package/dist/utils/cloneDeep.js +5 -1
- package/dist/utils/cloneDeep.js.map +1 -0
- package/dist/utils/delay.js +6 -4
- package/dist/utils/delay.js.map +1 -0
- package/dist/utils/functions.d.ts +1 -0
- package/dist/utils/functions.js +6 -0
- package/dist/utils/functions.js.map +1 -0
- package/dist/utils/index.js +15 -9
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/md5.js +121 -244
- package/dist/utils/md5.js.map +1 -0
- package/dist/utils/uuid.js +28 -58
- package/dist/utils/uuid.js.map +1 -0
- package/dist/utils/vue/install.d.ts +6 -0
- package/dist/utils/vue/install.js +21 -0
- package/dist/utils/vue/install.js.map +1 -0
- package/dist/utils/vue/typescript.d.ts +5 -0
- package/dist/utils/vue/typescript.js +2 -0
- package/dist/utils/vue/typescript.js.map +1 -0
- package/dist/version/index.d.ts +1 -1
- package/dist/version/index.js +5 -6
- package/dist/version/index.js.map +1 -0
- package/dist/version/version.d.ts +1 -1
- package/dist/version/version.js +5 -3
- package/dist/version/version.js.map +1 -0
- package/dist/vite.svg +1 -0
- package/global.d.ts +6 -0
- package/package.json +52 -63
- package/dist/components-DhjIbmR3.js +0 -128
package/dist/index.js
CHANGED
@@ -1,14 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
1
|
+
import { default as e } from "./error/OrionError.js";
|
2
|
+
import { install as a } from "./components/index.js";
|
3
|
+
import { default as l } from "./version/version.js";
|
4
|
+
import { OButton as m } from "./components/Button/index.js";
|
5
|
+
import { default as p } from "./components/Modal/useModal.js";
|
6
|
+
import { a as d, i } from "./components-BZukhWDk.js";
|
7
|
+
import { Colflex as O, Flexitem as B, Rowflex as F } from "./components/Flex/index.js";
|
8
|
+
import { default as b } from "./components/Pagetable/index.js";
|
9
|
+
import { default as g } from "./components/Form/index.js";
|
10
|
+
export {
|
11
|
+
m as Button,
|
12
|
+
O as Colflex,
|
13
|
+
B as Flexitem,
|
14
|
+
g as Form,
|
15
|
+
d as Modal,
|
16
|
+
e as OrionError,
|
17
|
+
b as Pagetable,
|
18
|
+
F as Rowflex,
|
19
|
+
i as Space,
|
20
|
+
a as install,
|
21
|
+
p as useOModal,
|
22
|
+
l as version
|
23
|
+
};
|
24
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
package/dist/print/LodopFuncs.js
CHANGED
@@ -1,128 +1,65 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
var CreatedOKLodopObject, CLodopIsLocal;
|
4
|
-
//==判断是否需要CLodop(那些不支持插件的浏览器):==
|
5
|
-
function needCLodop() {
|
1
|
+
var u, y;
|
2
|
+
function p() {
|
6
3
|
try {
|
7
|
-
var
|
8
|
-
if (
|
9
|
-
|
10
|
-
if (
|
11
|
-
if (
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
if (verFF[0] >= 41 || x64) return true;
|
20
|
-
} else if (verOPR) {
|
21
|
-
verOPR = verOPR[0].match(/\d+/);
|
22
|
-
if (verOPR[0] >= 32) return true;
|
23
|
-
} else if (!verTrident && !verIE) {
|
24
|
-
var verChrome = ua.match(/Chrome\D?\d+/i);
|
25
|
-
if (verChrome) {
|
26
|
-
verChrome = verChrome[0].match(/\d+/);
|
27
|
-
if (verChrome[0] >= 41) return true;
|
28
|
-
}
|
4
|
+
var e = navigator.userAgent;
|
5
|
+
if (e.match(/Windows\sPhone/i) || e.match(/iPhone|iPod|iPad/i) || e.match(/Android/i) || e.match(/Edge\D?\d+/i)) return !0;
|
6
|
+
var r = e.match(/Trident\D?\d+/i), f = e.match(/MSIE\D?\d+/i), n = e.match(/OPR\D?\d+/i), i = e.match(/Firefox\D?\d+/i), s = e.match(/x64/i);
|
7
|
+
if (!r && !f && s) return !0;
|
8
|
+
if (i) {
|
9
|
+
if (i = i[0].match(/\d+/), i[0] >= 41 || s) return !0;
|
10
|
+
} else if (n) {
|
11
|
+
if (n = n[0].match(/\d+/), n[0] >= 32) return !0;
|
12
|
+
} else if (!r && !f) {
|
13
|
+
var d = e.match(/Chrome\D?\d+/i);
|
14
|
+
if (d && (d = d[0].match(/\d+/), d[0] >= 41))
|
15
|
+
return !0;
|
29
16
|
}
|
30
|
-
return
|
31
|
-
} catch
|
32
|
-
return
|
17
|
+
return !1;
|
18
|
+
} catch {
|
19
|
+
return !0;
|
33
20
|
}
|
34
21
|
}
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
var
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
head.insertBefore(JS1, head.firstChild);
|
43
|
-
var JS2 = document.createElement('script');
|
44
|
-
JS2.async = true;
|
45
|
-
JS2.defer = true;
|
46
|
-
JS2.src = 'http://localhost:18000/CLodopfuncs.js?priority=0';
|
47
|
-
head.insertBefore(JS2, head.firstChild);
|
48
|
-
CLodopIsLocal = !!(JS1.src + JS2.src).match(/\/\/localho|\/\/127.0.0./i);
|
49
|
-
if (JS1.attachEvent) {
|
50
|
-
var onChange = function () {
|
51
|
-
if (window.event.srcElement.readyState == 'loaded') ;
|
22
|
+
if (p()) {
|
23
|
+
var l = document.head || document.getElementsByTagName("head")[0] || document.documentElement, o = document.createElement("script");
|
24
|
+
o.src = "http://localhost:8000/CLodopfuncs.js?priority=1", o.async = !0, o.defer = !0, l.insertBefore(o, l.firstChild);
|
25
|
+
var a = document.createElement("script");
|
26
|
+
if (a.async = !0, a.defer = !0, a.src = "http://localhost:18000/CLodopfuncs.js?priority=0", l.insertBefore(a, l.firstChild), y = !!(o.src + a.src).match(/\/\/localho|\/\/127.0.0./i), o.attachEvent) {
|
27
|
+
var b = function() {
|
28
|
+
window.event.srcElement.readyState == "loaded";
|
52
29
|
};
|
53
|
-
|
54
|
-
JS2.attachEvent('onreadystatechange', onChange);
|
30
|
+
o.attachEvent("onreadystatechange", b), a.attachEvent("onreadystatechange", b);
|
55
31
|
}
|
56
32
|
}
|
57
|
-
|
58
|
-
|
59
|
-
// dareway
|
60
|
-
var strHtmInstall = "<br><font color='#FF00FF'>打印控件未安装!安装后请刷新页面或重新进入。</font>";
|
61
|
-
var strHtmUpdate = "<br><font color='#FF00FF'>打印控件需要升级!升级后请重新进入。</font>";
|
62
|
-
var strHtm64_Install = "<br><font color='#FF00FF'>打印控件未安装!安装后请刷新页面或重新进入。</font>";
|
63
|
-
var strHtm64_Update = "<br><font color='#FF00FF'>打印控件需要升级!升级后请重新进入。</font>";
|
64
|
-
var strHtmFireFox = "<br><br><font color='#FF00FF'>(注意:如曾安装过Lodop旧版附件npActiveXPLugin,请在【工具】->【附加组件】->【扩展】中先卸它)</font>";
|
65
|
-
var strHtmChrome = "<br><br><font color='#FF00FF'>(如果此前正常,仅因浏览器升级或重安装而出问题,需重新执行以上安装)</font>";
|
66
|
-
var strCLodopInstall_1 = "<br><font color='#FF00FF'>Web打印服务CLodop未安装启动";
|
67
|
-
var strCLodopInstall_2 = '<br>(若此前已安装过,请确认是否打开)';
|
68
|
-
var strCLodopInstall_3 = ',成功后请刷新本页面。</font>';
|
69
|
-
var strCLodopUpdate = "<br><font color='#FF00FF'>Web打印服务CLodop需升级!升级后请刷新页面。</font>";
|
70
|
-
// dareway
|
71
|
-
var LODOP;
|
33
|
+
function g(e, r) {
|
34
|
+
var f = "<br><font color='#FF00FF'>打印控件未安装!安装后请刷新页面或重新进入。</font>", n = "<br><font color='#FF00FF'>打印控件需要升级!升级后请重新进入。</font>", i = "<br><font color='#FF00FF'>打印控件未安装!安装后请刷新页面或重新进入。</font>", s = "<br><font color='#FF00FF'>打印控件需要升级!升级后请重新进入。</font>", d = "<br><br><font color='#FF00FF'>(注意:如曾安装过Lodop旧版附件npActiveXPLugin,请在【工具】->【附加组件】->【扩展】中先卸它)</font>", h = "<br><br><font color='#FF00FF'>(如果此前正常,仅因浏览器升级或重安装而出问题,需重新执行以上安装)</font>", C = "<br><font color='#FF00FF'>Web打印服务CLodop未安装启动", v = "<br>(若此前已安装过,请确认是否打开)", H = ",成功后请刷新本页面。</font>", A = "<br><font color='#FF00FF'>Web打印服务CLodop需升级!升级后请刷新页面。</font>", t;
|
72
35
|
try {
|
73
|
-
var
|
74
|
-
|
75
|
-
if (needCLodop()) {
|
36
|
+
var c = navigator.userAgent, m = !!c.match(/MSIE/i) || !!c.match(/Trident/i);
|
37
|
+
if (p()) {
|
76
38
|
try {
|
77
|
-
|
78
|
-
} catch
|
79
|
-
|
80
|
-
|
39
|
+
t = getCLodop();
|
40
|
+
} catch {
|
41
|
+
}
|
42
|
+
if (!t) {
|
43
|
+
console.log("lodop控件加载失败,请检查lodop控件是否已经安装并启动,如未启动可以在系统托盘中【右键->启动智慧医院打印服务】手动启动。");
|
81
44
|
return;
|
82
45
|
}
|
83
|
-
if (
|
84
|
-
document.body.innerHTML =
|
46
|
+
if (t)
|
47
|
+
CLODOP.CVERSION < "4.0.8.8" && (document.body.innerHTML = A + document.body.innerHTML), r && r.parentNode && r.parentNode.removeChild(r), e && e.parentNode && e.parentNode.removeChild(e);
|
48
|
+
else {
|
49
|
+
document.body.innerHTML = C + (y ? v : "") + H + document.body.innerHTML;
|
85
50
|
return;
|
86
|
-
} else {
|
87
|
-
if (CLODOP.CVERSION < '4.0.8.8') {
|
88
|
-
document.body.innerHTML = strCLodopUpdate + document.body.innerHTML;
|
89
|
-
}
|
90
|
-
if (oEMBED && oEMBED.parentNode) oEMBED.parentNode.removeChild(oEMBED);
|
91
|
-
if (oOBJECT && oOBJECT.parentNode) oOBJECT.parentNode.removeChild(oOBJECT);
|
92
51
|
}
|
93
52
|
} else {
|
94
|
-
var
|
95
|
-
|
96
|
-
|
97
|
-
if (isIE) LODOP = oOBJECT;else LODOP = oEMBED;
|
98
|
-
} else if (!CreatedOKLodopObject) {
|
99
|
-
LODOP = document.createElement('object');
|
100
|
-
LODOP.setAttribute('width', 0);
|
101
|
-
LODOP.setAttribute('height', 0);
|
102
|
-
LODOP.setAttribute('style', 'position:absolute;left:0px;top:-100px;width:0px;height:0px;');
|
103
|
-
if (isIE) LODOP.setAttribute('classid', 'clsid:2105C259-1E0C-4534-8141-A753534CB4CA');else LODOP.setAttribute('type', 'application/x-print-lodop');
|
104
|
-
document.documentElement.appendChild(LODOP);
|
105
|
-
CreatedOKLodopObject = LODOP;
|
106
|
-
} else LODOP = CreatedOKLodopObject;
|
107
|
-
//==Lodop插件未安装时提示下载地址:==
|
108
|
-
if (!LODOP || !LODOP.VERSION) {
|
109
|
-
if (ua.indexOf('Chrome') >= 0) document.body.innerHTML = strHtmChrome + document.body.innerHTML;
|
110
|
-
if (ua.indexOf('Firefox') >= 0) document.body.innerHTML = strHtmFireFox + document.body.innerHTML;
|
111
|
-
document.body.innerHTML = (is64IE ? strHtm64_Install : strHtmInstall) + document.body.innerHTML;
|
112
|
-
return LODOP;
|
113
|
-
}
|
114
|
-
}
|
115
|
-
if (LODOP.VERSION < '6.2.2.6') {
|
116
|
-
if (!needCLodop()) document.body.innerHTML = (is64IE ? strHtm64_Update : strHtmUpdate) + document.body.innerHTML;
|
53
|
+
var F = m && !!c.match(/x64/i);
|
54
|
+
if (e || r ? m ? t = e : t = r : u ? t = u : (t = document.createElement("object"), t.setAttribute("width", 0), t.setAttribute("height", 0), t.setAttribute("style", "position:absolute;left:0px;top:-100px;width:0px;height:0px;"), m ? t.setAttribute("classid", "clsid:2105C259-1E0C-4534-8141-A753534CB4CA") : t.setAttribute("type", "application/x-print-lodop"), document.documentElement.appendChild(t), u = t), !t || !t.VERSION)
|
55
|
+
return c.indexOf("Chrome") >= 0 && (document.body.innerHTML = h + document.body.innerHTML), c.indexOf("Firefox") >= 0 && (document.body.innerHTML = d + document.body.innerHTML), document.body.innerHTML = (F ? i : f) + document.body.innerHTML, t;
|
117
56
|
}
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
//=======================================================
|
122
|
-
return LODOP;
|
123
|
-
} catch (err) {
|
124
|
-
alert('getLodop出错:' + err);
|
57
|
+
return t.VERSION < "6.2.2.6" && (p() || (document.body.innerHTML = (F ? s : n) + document.body.innerHTML)), t.SET_LICENSES("山大地纬软件股份有限公司", "CC9365E1BB34FA000175B357CD91F188454", "山大地緯軟件股份有限公司", "82F5D8E72ECF427F20ADD7E937E13D817E1"), t.SET_LICENSES("THIRD LICENSE", "", "Shanda DareWay Software Co., Ltd", "1485033B74404D944BEA7FFAFB213175AF4"), t;
|
58
|
+
} catch (L) {
|
59
|
+
alert("getLodop出错:" + L);
|
125
60
|
}
|
126
61
|
}
|
127
|
-
|
128
|
-
|
62
|
+
export {
|
63
|
+
g as getLodop
|
64
|
+
};
|
65
|
+
//# sourceMappingURL=LodopFuncs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"LodopFuncs.js","sources":["../../src/print/LodopFuncs.ts"],"sourcesContent":["//@ts-nocheck\r\n//==本JS是加载Lodop插件及CLodop服务的综合示例,可直接使用,建议看懂后融进自己页面程序==\r\nvar CreatedOKLodopObject, CLodopIsLocal, CLodopJsState\r\n\r\n//==判断是否需要CLodop(那些不支持插件的浏览器):==\r\nfunction needCLodop() {\r\n try {\r\n var ua = navigator.userAgent\r\n if (ua.match(/Windows\\sPhone/i)) return true\r\n if (ua.match(/iPhone|iPod|iPad/i)) return true\r\n if (ua.match(/Android/i)) return true\r\n if (ua.match(/Edge\\D?\\d+/i)) return true\r\n\r\n var verTrident = ua.match(/Trident\\D?\\d+/i)\r\n var verIE = ua.match(/MSIE\\D?\\d+/i)\r\n var verOPR = ua.match(/OPR\\D?\\d+/i)\r\n var verFF = ua.match(/Firefox\\D?\\d+/i)\r\n var x64 = ua.match(/x64/i)\r\n if (!verTrident && !verIE && x64) return true\r\n else if (verFF) {\r\n verFF = verFF[0].match(/\\d+/)\r\n if (verFF[0] >= 41 || x64) return true\r\n } else if (verOPR) {\r\n verOPR = verOPR[0].match(/\\d+/)\r\n if (verOPR[0] >= 32) return true\r\n } else if (!verTrident && !verIE) {\r\n var verChrome = ua.match(/Chrome\\D?\\d+/i)\r\n if (verChrome) {\r\n verChrome = verChrome[0].match(/\\d+/)\r\n if (verChrome[0] >= 41) return true\r\n }\r\n }\r\n return false\r\n } catch (err) {\r\n return true\r\n }\r\n}\r\n\r\n//==引用CLodop的主JS,用双端口8000和18000(以防其中一个被占):==\r\nif (needCLodop()) {\r\n var head = document.head || document.getElementsByTagName('head')[0] || document.documentElement\r\n\r\n var JS1 = document.createElement('script')\r\n JS1.src = 'http://localhost:8000/CLodopfuncs.js?priority=1'\r\n JS1.async = true\r\n JS1.defer = true\r\n head.insertBefore(JS1, head.firstChild)\r\n\r\n var JS2 = document.createElement('script')\r\n JS2.async = true\r\n JS2.defer = true\r\n JS2.src = 'http://localhost:18000/CLodopfuncs.js?priority=0'\r\n head.insertBefore(JS2, head.firstChild)\r\n\r\n CLodopIsLocal = !!(JS1.src + JS2.src).match(/\\/\\/localho|\\/\\/127.0.0./i)\r\n\r\n if (JS1.attachEvent) {\r\n CLodopJsState = 'loading'\r\n var onChange = function () {\r\n if (window.event.srcElement.readyState == 'loaded') CLodopJsState = 'complete'\r\n }\r\n JS1.attachEvent('onreadystatechange', onChange)\r\n JS2.attachEvent('onreadystatechange', onChange)\r\n }\r\n}\r\n\r\n//==获取LODOP对象主过程,判断是否安装、需否升级:==\r\nexport function getLodop(oOBJECT, oEMBED) {\r\n // dareway\r\n var strHtmInstall = \"<br><font color='#FF00FF'>打印控件未安装!安装后请刷新页面或重新进入。</font>\"\r\n var strHtmUpdate = \"<br><font color='#FF00FF'>打印控件需要升级!升级后请重新进入。</font>\"\r\n var strHtm64_Install = \"<br><font color='#FF00FF'>打印控件未安装!安装后请刷新页面或重新进入。</font>\"\r\n var strHtm64_Update = \"<br><font color='#FF00FF'>打印控件需要升级!升级后请重新进入。</font>\"\r\n var strHtmFireFox = \"<br><br><font color='#FF00FF'>(注意:如曾安装过Lodop旧版附件npActiveXPLugin,请在【工具】->【附加组件】->【扩展】中先卸它)</font>\"\r\n var strHtmChrome = \"<br><br><font color='#FF00FF'>(如果此前正常,仅因浏览器升级或重安装而出问题,需重新执行以上安装)</font>\"\r\n var strCLodopInstall_1 = \"<br><font color='#FF00FF'>Web打印服务CLodop未安装启动\"\r\n var strCLodopInstall_2 = '<br>(若此前已安装过,请确认是否打开)'\r\n var strCLodopInstall_3 = ',成功后请刷新本页面。</font>'\r\n var strCLodopUpdate = \"<br><font color='#FF00FF'>Web打印服务CLodop需升级!升级后请刷新页面。</font>\"\r\n // dareway\r\n\r\n var LODOP\r\n try {\r\n var ua = navigator.userAgent\r\n var isIE = !!ua.match(/MSIE/i) || !!ua.match(/Trident/i)\r\n if (needCLodop()) {\r\n try {\r\n LODOP = getCLodop()\r\n } catch (err) {}\r\n if (!LODOP /* && (document.readyState !== \"complete\" || (isIE && CLodopJsState == \"loading\"))*/) {\r\n console.log('lodop控件加载失败,请检查lodop控件是否已经安装并启动,如未启动可以在系统托盘中【右键->启动智慧医院打印服务】手动启动。')\r\n return\r\n }\r\n if (!LODOP) {\r\n document.body.innerHTML = strCLodopInstall_1 + (CLodopIsLocal ? strCLodopInstall_2 : '') + strCLodopInstall_3 + document.body.innerHTML\r\n return\r\n } else {\r\n if (CLODOP.CVERSION < '4.0.8.8') {\r\n document.body.innerHTML = strCLodopUpdate + document.body.innerHTML\r\n }\r\n if (oEMBED && oEMBED.parentNode) oEMBED.parentNode.removeChild(oEMBED)\r\n if (oOBJECT && oOBJECT.parentNode) oOBJECT.parentNode.removeChild(oOBJECT)\r\n }\r\n } else {\r\n var is64IE = isIE && !!ua.match(/x64/i)\r\n //==如果页面有Lodop就直接使用,否则新建:==\r\n if (oOBJECT || oEMBED) {\r\n if (isIE) LODOP = oOBJECT\r\n else LODOP = oEMBED\r\n } else if (!CreatedOKLodopObject) {\r\n LODOP = document.createElement('object')\r\n LODOP.setAttribute('width', 0)\r\n LODOP.setAttribute('height', 0)\r\n LODOP.setAttribute('style', 'position:absolute;left:0px;top:-100px;width:0px;height:0px;')\r\n if (isIE) LODOP.setAttribute('classid', 'clsid:2105C259-1E0C-4534-8141-A753534CB4CA')\r\n else LODOP.setAttribute('type', 'application/x-print-lodop')\r\n document.documentElement.appendChild(LODOP)\r\n CreatedOKLodopObject = LODOP\r\n } else LODOP = CreatedOKLodopObject\r\n //==Lodop插件未安装时提示下载地址:==\r\n if (!LODOP || !LODOP.VERSION) {\r\n if (ua.indexOf('Chrome') >= 0) document.body.innerHTML = strHtmChrome + document.body.innerHTML\r\n if (ua.indexOf('Firefox') >= 0) document.body.innerHTML = strHtmFireFox + document.body.innerHTML\r\n document.body.innerHTML = (is64IE ? strHtm64_Install : strHtmInstall) + document.body.innerHTML\r\n return LODOP\r\n }\r\n }\r\n if (LODOP.VERSION < '6.2.2.6') {\r\n if (!needCLodop()) document.body.innerHTML = (is64IE ? strHtm64_Update : strHtmUpdate) + document.body.innerHTML\r\n }\r\n //===如下空白位置适合调用统一功能(如注册语句、语言选择等):==\r\n\r\n LODOP.SET_LICENSES('山大地纬软件股份有限公司', 'CC9365E1BB34FA000175B357CD91F188454', '山大地緯軟件股份有限公司', '82F5D8E72ECF427F20ADD7E937E13D817E1')\r\n LODOP.SET_LICENSES('THIRD LICENSE', '', 'Shanda DareWay Software Co., Ltd', '1485033B74404D944BEA7FFAFB213175AF4')\r\n\r\n //=======================================================\r\n return LODOP\r\n } catch (err) {\r\n alert('getLodop出错:' + err)\r\n }\r\n}\r\n"],"names":["CreatedOKLodopObject","CLodopIsLocal","needCLodop","ua","verTrident","verIE","verOPR","verFF","x64","verChrome","head","JS1","JS2","onChange","getLodop","oOBJECT","oEMBED","strHtmInstall","strHtmUpdate","strHtm64_Install","strHtm64_Update","strHtmFireFox","strHtmChrome","strCLodopInstall_1","strCLodopInstall_2","strCLodopInstall_3","strCLodopUpdate","LODOP","isIE","is64IE","err"],"mappings":"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"}
|
package/dist/print/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export declare function lodopInit(): Promise<unknown>;
|
2
|
-
export declare function getPrinterList():
|
3
|
-
export declare function getPrinterNameList():
|
2
|
+
export declare function getPrinterList(): never[];
|
3
|
+
export declare function getPrinterNameList(): never[];
|
4
4
|
export declare function getDefaultPrinter(): Promise<any>;
|
5
5
|
export interface PrintParaI {
|
6
6
|
direction?: 1 | 2 | 3 | 0;
|
package/dist/print/index.js
CHANGED
@@ -1,235 +1,126 @@
|
|
1
|
-
import
|
2
|
-
import { getLodop } from
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
const LODOP = getLodop();
|
8
|
-
return new Promise(resolve => {
|
9
|
-
resolve(LODOP);
|
1
|
+
import d from "../error/OrionError.js";
|
2
|
+
import { getLodop as c } from "./LodopFuncs.js";
|
3
|
+
function R() {
|
4
|
+
const _ = c();
|
5
|
+
return new Promise((e) => {
|
6
|
+
e(_);
|
10
7
|
});
|
11
8
|
}
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
value: i,
|
20
|
-
content: LODOP.GET_PRINTER_NAME(i)
|
9
|
+
function g() {
|
10
|
+
R();
|
11
|
+
const _ = [], e = LODOP.GET_PRINTER_COUNT();
|
12
|
+
for (let t = 0; t < e; t++)
|
13
|
+
_.push({
|
14
|
+
value: t,
|
15
|
+
content: LODOP.GET_PRINTER_NAME(t)
|
21
16
|
});
|
22
|
-
|
23
|
-
return printers;
|
17
|
+
return _;
|
24
18
|
}
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
value: prname,
|
34
|
-
content: prname
|
19
|
+
function h() {
|
20
|
+
R();
|
21
|
+
const _ = [], e = LODOP.GET_PRINTER_COUNT();
|
22
|
+
for (let t = 0; t < e; t++) {
|
23
|
+
const i = LODOP.GET_PRINTER_NAME(t);
|
24
|
+
_.push({
|
25
|
+
value: i,
|
26
|
+
content: i
|
35
27
|
});
|
36
28
|
}
|
37
|
-
return
|
29
|
+
return _;
|
38
30
|
}
|
39
|
-
|
40
|
-
|
41
|
-
async function getDefaultPrinter() {
|
42
|
-
const LODOP = await lodopInit();
|
43
|
-
return LODOP.GET_PRINTER_NAME(-1); // 获取默认打印机名称(-1是指定默认打印机)
|
31
|
+
async function l() {
|
32
|
+
return (await R()).GET_PRINTER_NAME(-1);
|
44
33
|
}
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
page_type = print_para.page_type;
|
70
|
-
}
|
71
|
-
let direction = 1;
|
72
|
-
if (print_para.direction) {
|
73
|
-
direction = print_para.direction;
|
74
|
-
}
|
75
|
-
let print_duplex = 0;
|
76
|
-
if (print_para.print_duplex) {
|
77
|
-
print_duplex = print_para.print_duplex;
|
78
|
-
}
|
79
|
-
let print_defaultsource = 0;
|
80
|
-
if (print_para.print_defaultsource) {
|
81
|
-
print_defaultsource = print_para.print_defaultsource;
|
82
|
-
}
|
83
|
-
// 历史问题,防止重复打印的问题
|
84
|
-
LODOP.PRINT_INIT('');
|
85
|
-
if (print_para.print_mode_map) {
|
86
|
-
Object.keys(print_para.print_mode_map).map(item => {
|
87
|
-
LODOP.SET_PRINT_MODE(item, print_para.print_mode_map[item]);
|
88
|
-
});
|
89
|
-
}
|
90
|
-
LODOP.SET_PRINT_MODE('PRINT_DUPLEX', print_duplex ? print_duplex : 0);
|
91
|
-
LODOP.SET_PRINT_MODE('PRINT_DEFAULTSOURCE', print_defaultsource ? print_defaultsource : 0);
|
92
|
-
LODOP.SET_PRINT_PAGESIZE(direction, page_width, page_height, page_type);
|
93
|
-
LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', new URL(pdfurl, import.meta.url));
|
94
|
-
LODOP.SET_SHOW_MODE('HIDE_PAPER_BOARD', true); // 移除预览的线条
|
95
|
-
LODOP.SET_PREVIEW_WINDOW(0, 0, 0, 0, 0, '预览查看.开始打印'); // 适高,工具条,弹出选择打印机,窗口宽,窗口高,窗口名
|
96
|
-
LODOP.SET_PRINT_MODE('CATCH_PRINT_STATUS', true); //返回打印机状态
|
97
|
-
return new Promise(resolve => {
|
98
|
-
LODOP.On_Return = function (TaskID, Value) {
|
99
|
-
resolve(Value);
|
100
|
-
};
|
101
|
-
LODOP.PREVIEW();
|
34
|
+
async function s(_) {
|
35
|
+
if (!_)
|
36
|
+
throw new d("打印异常:入参为空,请检查");
|
37
|
+
const { pdfurl: e, print_para: t = {} } = _;
|
38
|
+
if (!e)
|
39
|
+
throw new d("打印异常:未知的文件地址[" + e + "],无法进行打印");
|
40
|
+
const i = await R();
|
41
|
+
let P = 0;
|
42
|
+
t.page_width != 0 && typeof t.page_width < "u" && (P = t.page_width);
|
43
|
+
let f = 0;
|
44
|
+
t.page_height != 0 && typeof t.page_height < "u" && (f = t.page_height);
|
45
|
+
let u = "";
|
46
|
+
t.page_type && (u = t.page_type);
|
47
|
+
let T = 1;
|
48
|
+
t.direction && (T = t.direction);
|
49
|
+
let o = 0;
|
50
|
+
t.print_duplex && (o = t.print_duplex);
|
51
|
+
let n = 0;
|
52
|
+
return t.print_defaultsource && (n = t.print_defaultsource), i.PRINT_INIT(""), t.print_mode_map && Object.keys(t.print_mode_map).map((E) => {
|
53
|
+
i.SET_PRINT_MODE(E, t.print_mode_map[E]);
|
54
|
+
}), i.SET_PRINT_MODE("PRINT_DUPLEX", o || 0), i.SET_PRINT_MODE("PRINT_DEFAULTSOURCE", n || 0), i.SET_PRINT_PAGESIZE(T, P, f, u), i.ADD_PRINT_PDF(0, 0, "100%", "100%", new URL(e, import.meta.url)), i.SET_SHOW_MODE("HIDE_PAPER_BOARD", !0), i.SET_PREVIEW_WINDOW(0, 0, 0, 0, 0, "预览查看.开始打印"), i.SET_PRINT_MODE("CATCH_PRINT_STATUS", !0), new Promise((E) => {
|
55
|
+
i.On_Return = function(I, N) {
|
56
|
+
E(N);
|
57
|
+
}, i.PREVIEW();
|
102
58
|
});
|
103
59
|
}
|
104
|
-
async function
|
105
|
-
if (!
|
106
|
-
throw new
|
107
|
-
}
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
printer
|
112
|
-
} = params;
|
113
|
-
if (!pdfurl) {
|
114
|
-
throw new OrionError('打印异常:未知的文件地址[' + pdfurl + '],无法进行打印');
|
115
|
-
}
|
116
|
-
if (printer) {
|
117
|
-
return await printWithCertainPrinter(pdfurl, print_para, printer);
|
118
|
-
} else {
|
119
|
-
// 没设置打印机
|
120
|
-
return await printNeedSelectPrinter(pdfurl, print_para);
|
121
|
-
}
|
60
|
+
async function w(_) {
|
61
|
+
if (!_)
|
62
|
+
throw new d("打印异常:入参为空,请检查");
|
63
|
+
const { pdfurl: e, print_para: t = {}, printer: i } = _;
|
64
|
+
if (!e)
|
65
|
+
throw new d("打印异常:未知的文件地址[" + e + "],无法进行打印");
|
66
|
+
return i ? await O(e, t, i) : await r(e, t);
|
122
67
|
}
|
123
|
-
async function
|
124
|
-
if (!
|
125
|
-
throw new
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
let print_duplex = 0;
|
148
|
-
if (print_para.print_duplex) {
|
149
|
-
print_duplex = print_para.print_duplex;
|
150
|
-
}
|
151
|
-
let print_defaultsource = 0;
|
152
|
-
if (print_para.print_defaultsource) {
|
153
|
-
print_defaultsource = print_para.print_defaultsource;
|
154
|
-
}
|
155
|
-
const LODOP = await lodopInit();
|
156
|
-
// 指定打印设备(打印机)
|
157
|
-
LODOP.PRINT_INIT('');
|
158
|
-
// 设置了打印机
|
159
|
-
if (pr_name === -1) {
|
160
|
-
LODOP.SET_PRINTER_INDEXA(LODOP.GET_PRINTER_NAME(-1));
|
161
|
-
} else {
|
162
|
-
LODOP.SET_PRINTER_INDEXA(pr_name);
|
163
|
-
}
|
164
|
-
LODOP.SET_PRINT_PAGESIZE(direction, page_width, page_height, page_type);
|
165
|
-
if (print_para.print_mode_map) {
|
166
|
-
Object.keys(print_para.print_mode_map).map(item => {
|
167
|
-
LODOP.SET_PRINT_MODE(item, print_para.print_mode_map[item]);
|
168
|
-
});
|
169
|
-
}
|
170
|
-
LODOP.SET_PRINT_MODE('PRINT_DUPLEX', print_duplex ? print_duplex : 0);
|
171
|
-
LODOP.SET_PRINT_MODE('PRINT_DEFAULTSOURCE', print_defaultsource ? print_defaultsource : 0);
|
172
|
-
LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', new URL(pdfurl, import.meta.url));
|
173
|
-
LODOP.SET_PRINT_MODE('CATCH_PRINT_STATUS', true); //返回打印机状态
|
174
|
-
return new Promise(resolve => {
|
175
|
-
LODOP.On_Return = function (TaskID, Value) {
|
176
|
-
resolve(Value);
|
177
|
-
};
|
178
|
-
LODOP.PRINT();
|
68
|
+
async function O(_, e = {}, t) {
|
69
|
+
if (!_)
|
70
|
+
throw new d("打印异常:未知的文件地址[" + _ + "],无法进行打印");
|
71
|
+
if (!t)
|
72
|
+
throw new d("打印异常:未设置打印机,无法进行打印");
|
73
|
+
let i = 0;
|
74
|
+
e.page_width != 0 && typeof e.page_width < "u" && (i = e.page_width);
|
75
|
+
let P = 0;
|
76
|
+
e.page_height != 0 && typeof e.page_height < "u" && (P = e.page_height);
|
77
|
+
let f = "";
|
78
|
+
e.page_type && (f = e.page_type);
|
79
|
+
let u = 1;
|
80
|
+
e.direction && (u = e.direction);
|
81
|
+
let T = 0;
|
82
|
+
e.print_duplex && (T = e.print_duplex);
|
83
|
+
let o = 0;
|
84
|
+
e.print_defaultsource && (o = e.print_defaultsource);
|
85
|
+
const n = await R();
|
86
|
+
return n.PRINT_INIT(""), t === -1 ? n.SET_PRINTER_INDEXA(n.GET_PRINTER_NAME(-1)) : n.SET_PRINTER_INDEXA(t), n.SET_PRINT_PAGESIZE(u, i, P, f), e.print_mode_map && Object.keys(e.print_mode_map).map((E) => {
|
87
|
+
n.SET_PRINT_MODE(E, e.print_mode_map[E]);
|
88
|
+
}), n.SET_PRINT_MODE("PRINT_DUPLEX", T || 0), n.SET_PRINT_MODE("PRINT_DEFAULTSOURCE", o || 0), n.ADD_PRINT_PDF(0, 0, "100%", "100%", new URL(_, import.meta.url)), n.SET_PRINT_MODE("CATCH_PRINT_STATUS", !0), new Promise((E) => {
|
89
|
+
n.On_Return = function(I, N) {
|
90
|
+
E(N);
|
91
|
+
}, n.PRINT();
|
179
92
|
});
|
180
93
|
}
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
direction = print_para.direction;
|
203
|
-
}
|
204
|
-
let print_duplex = 0;
|
205
|
-
if (print_para.print_duplex) {
|
206
|
-
print_duplex = print_para.print_duplex;
|
207
|
-
}
|
208
|
-
let print_defaultsource = 0;
|
209
|
-
if (print_para.print_defaultsource) {
|
210
|
-
print_defaultsource = print_para.print_defaultsource;
|
211
|
-
}
|
212
|
-
// 历史问题,防止重复打印的问题
|
213
|
-
LODOP.PRINT_INIT('');
|
214
|
-
if (print_para.print_mode_map) {
|
215
|
-
Object.keys(print_para.print_mode_map).map(item => {
|
216
|
-
LODOP.SET_PRINT_MODE(item, print_para.print_mode_map[item]);
|
217
|
-
});
|
218
|
-
}
|
219
|
-
LODOP.SET_PRINT_MODE('PRINT_DUPLEX', print_duplex ? print_duplex : 0);
|
220
|
-
LODOP.SET_PRINT_MODE('PRINT_DEFAULTSOURCE', print_defaultsource ? print_defaultsource : 0);
|
221
|
-
LODOP.SET_PRINT_PAGESIZE(direction, page_width, page_height, page_type);
|
222
|
-
LODOP.ADD_PRINT_PDF(0, 0, '100%', '100%', url);
|
223
|
-
LODOP.SET_SHOW_MODE('HIDE_PAPER_BOARD', true); // 移除预览的线条
|
224
|
-
LODOP.SET_PREVIEW_WINDOW(0, 0, 0, 0, 0, '预览查看.开始打印'); // 适高,工具条,弹出选择打印机,窗口宽,窗口高,窗口名
|
225
|
-
//返回打印机状态
|
226
|
-
LODOP.SET_PRINT_MODE('CATCH_PRINT_STATUS', true);
|
227
|
-
return new Promise(resolve => {
|
228
|
-
LODOP.On_Return = function (TaskID, Value) {
|
229
|
-
resolve(Value);
|
230
|
-
};
|
231
|
-
LODOP.PRINTA();
|
94
|
+
async function r(_, e = {}) {
|
95
|
+
if (_ === null || _ === "" || typeof _ > "u")
|
96
|
+
throw new d("打印异常:未知的文件地址[" + _ + "],无法进行打印");
|
97
|
+
const t = await R();
|
98
|
+
let i = 0;
|
99
|
+
e.page_width != 0 && typeof e.page_width < "u" && (i = e.page_width);
|
100
|
+
let P = 0;
|
101
|
+
e.page_height != 0 && typeof e.page_height < "u" && (P = e.page_height);
|
102
|
+
let f = "";
|
103
|
+
e.page_type && (f = e.page_type);
|
104
|
+
let u = 1;
|
105
|
+
e.direction && (u = e.direction);
|
106
|
+
let T = 0;
|
107
|
+
e.print_duplex && (T = e.print_duplex);
|
108
|
+
let o = 0;
|
109
|
+
return e.print_defaultsource && (o = e.print_defaultsource), t.PRINT_INIT(""), e.print_mode_map && Object.keys(e.print_mode_map).map((n) => {
|
110
|
+
t.SET_PRINT_MODE(n, e.print_mode_map[n]);
|
111
|
+
}), t.SET_PRINT_MODE("PRINT_DUPLEX", T || 0), t.SET_PRINT_MODE("PRINT_DEFAULTSOURCE", o || 0), t.SET_PRINT_PAGESIZE(u, i, P, f), t.ADD_PRINT_PDF(0, 0, "100%", "100%", _), t.SET_SHOW_MODE("HIDE_PAPER_BOARD", !0), t.SET_PREVIEW_WINDOW(0, 0, 0, 0, 0, "预览查看.开始打印"), t.SET_PRINT_MODE("CATCH_PRINT_STATUS", !0), new Promise((n) => {
|
112
|
+
t.On_Return = function(E, I) {
|
113
|
+
n(I);
|
114
|
+
}, t.PRINTA();
|
232
115
|
});
|
233
116
|
}
|
234
|
-
|
235
|
-
|
117
|
+
export {
|
118
|
+
l as getDefaultPrinter,
|
119
|
+
g as getPrinterList,
|
120
|
+
h as getPrinterNameList,
|
121
|
+
R as lodopInit,
|
122
|
+
s as preview,
|
123
|
+
w as print,
|
124
|
+
r as printNeedSelectPrinter
|
125
|
+
};
|
126
|
+
//# sourceMappingURL=index.js.map
|