From 1a3d1542ffbec28850f07ff616bd62512e444f68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=B9=A6=E6=9F=B1?= Date: Thu, 14 Apr 2022 13:02:19 +0800 Subject: [PATCH 1/9] =?UTF-8?q?socket=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/demo/design/index.vue | 20 +++++++-- src/hiprint/hiprint.bundle.js | 81 ++++++++++++++++++++++++----------- 2 files changed, 71 insertions(+), 30 deletions(-) diff --git a/src/demo/design/index.vue b/src/demo/design/index.vue index 59de50c..171e659 100644 --- a/src/demo/design/index.vue +++ b/src/demo/design/index.vue @@ -193,10 +193,22 @@ export default { } }, mounted() { - console.log(this.$print) - hiprint.init({ - providers: [new defaultElementTypeProvider()] - }); + /*默认自动发起socket请求*/ + hiprint.init({ + providers: [new defaultElementTypeProvider()] + }); + /*手动发起socket连接start*/ + // hiprint.init({ + // providers: [new defaultElementTypeProvider()] + // },true); + // hiprint.connectSocket.start(function(){ + // //连接成功的的内容 + // },function(){ + // // 连接失败执行的内容 如果失败1.5s后执行 + // //如果不传,则失败时默认执行成功的回调 + // }) + /*手动发起socket连接end*/ + // 还原配置 hiprint.setConfig() // 替换配置 diff --git a/src/hiprint/hiprint.bundle.js b/src/hiprint/hiprint.bundle.js index 5fac70a..a61194c 100644 --- a/src/hiprint/hiprint.bundle.js +++ b/src/hiprint/hiprint.bundle.js @@ -5516,23 +5516,46 @@ var hiprint = function (t) { this.stop() this.start() }, - start: function start() { - var _this = this; - - var t = this; - window.WebSocket ? this.socket || (this.socket = io(this.host, { - reconnectionAttempts: 5 - }), this.socket.on("connect", function (e) { - t.opened = !0, console.log("Websocket opened."), _this.socket.on("successs", function (t) { - hinnn.event.trigger("printSuccess_" + t.templateId, t); - }), _this.socket.on("error", function (t) { - hinnn.event.trigger("printError_" + t.templateId, t); - }), _this.socket.on("printerList", function (e) { - t.printerList = e; - }), t.state = n; - }), this.socket.on("disconnect", function () { - t.opened = !1; - })) : console.log("WebSocket start fail"); + start: function start(success,error) { + var _this = this; + var t = this; + if(window.WebSocket){ + if(!this.socket){ + this.socket = io(this.host, { + reconnectionAttempts: 5 + }); + this.socket.on("connect", function (e) { + t.opened = !0, console.log("Websocket opened."); + _this.socket.on("successs", function (t) { + hinnn.event.trigger("printSuccess_" + t.templateId, t); + }); + _this.socket.on("error", function (t) { + hinnn.event.trigger("printError_" + t.templateId, t); + }) + _this.socket.on("printerList", function (e) { + t.printerList = e; + + success&&success(); + }); + t.state = n; + }); + this.socket.on("disconnect", function () { + t.opened = !1; + }) + //客户端未开启或未安装执行回调触发错误 + setTimeout(() => { + if(!t.opened){ + console.log("WebSocket connect error"); + error?(error()):(success&&success()) + } + },1500) + }else{ + success&&success(); + } + }else{ + console.log("WebSocket start fail"); + } + }, reconnect: function reconnect() { this.state !== n && this.state !== i || (this.stop(), this.ensureReconnectingState() && (console.log("Websocket reconnecting."), this.start())); @@ -8000,12 +8023,14 @@ var hiprint = function (t) { }), e; } - function mt(t) { - //清空历史初始化记录 - a.instance.allElementTypes = [] - p.a.instance.init(t), p.a.instance.providers.forEach(function (t) { - t.addElementTypes(a.instance); - }); + function mt(t,status) { + //添加是否默认请求状态 + window.disSocketRequest = status||false + //清空历史初始化记录 + a.instance.allElementTypes = [] + p.a.instance.init(t), p.a.instance.providers.forEach(function (t) { + t.addElementTypes(a.instance); + }); } function cig(t) { @@ -8033,6 +8058,8 @@ var hiprint = function (t) { return mt; }), n.d(e, "setConfig", function () { return cig; + }), n.d(e, "connectSocket", function () { + return hiwebSocket }), n.d(e, "PrintElementTypeManager", function () { return it; }), n.d(e, "PrintElementTypeGroup", function () { @@ -8046,7 +8073,9 @@ var hiprint = function (t) { }), n.d(e, "getHtml", function () { return gt; }), $(document).ready(function () { - hiwebSocket.hasIo() && hiwebSocket.start(); + if(hiwebSocket.hasIo()&&!window.disSocketRequest){ + hiwebSocket.start(); + } }); }]); @@ -8054,8 +8083,8 @@ var hiprint = function (t) { import defaultTypeProvider from './etypes/default-etyps-provider' var defaultElementTypeProvider = defaultTypeProvider(hiprint) - +var connectSocket = hiwebSocket.start export { hiprint, - defaultElementTypeProvider + defaultElementTypeProvider, } -- Gitee From 7e62582d22dd975b01798467decd0864631f9e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=B9=A6=E6=9F=B1?= Date: Thu, 14 Apr 2022 13:34:46 +0800 Subject: [PATCH 2/9] =?UTF-8?q?connectSocket=E6=96=B9=E6=B3=95=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/demo/design/index.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/demo/design/index.vue b/src/demo/design/index.vue index afa8ffb..f3dfdc6 100644 --- a/src/demo/design/index.vue +++ b/src/demo/design/index.vue @@ -198,6 +198,17 @@ export default { hiprint.init({ providers: [new defaultElementTypeProvider()] }); + //手动连接socket + // hiprint.init({ + // providers: [new defaultElementTypeProvider()] + // },true); + // hiprint.connectSocket.start(function(){ + // //成功回调 + // //获取打印机列表 直接打印等操作需在成功回调内执行 + // },function(){ + // //失败回调 + // //若无失败回调则默认执行成功回调 + // }) // 还原配置 hiprint.setConfig() // 替换配置 -- Gitee From e5436658170928245c7ab06b334db4fbbf1edc85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=B9=A6=E6=9F=B1?= Date: Sun, 17 Apr 2022 12:59:49 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E9=AB=98?= =?UTF-8?q?=E5=BA=A6=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hiprint/hiprint.bundle.js | 39 ++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/src/hiprint/hiprint.bundle.js b/src/hiprint/hiprint.bundle.js index 2737c53..30bcdf1 100644 --- a/src/hiprint/hiprint.bundle.js +++ b/src/hiprint/hiprint.bundle.js @@ -6684,14 +6684,22 @@ var hiprint = function (t) { try { if (n) { - var l = parseInt(o.a.pt.toPx(this.options.getWidth() || 20)), - u = parseInt(o.a.pt.toPx(this.options.getHeight() || 20)); - new QRCode(a[0], { - width: l, - height: u, - colorDark: this.options.color || "#000000", - useSVG: !0 + //去除行高对高度的影响 + t.css('line-height',0) + //默认二维码永远居中 + a.css('text-align','center') + // var l = parseInt(o.a.pt.toPx(this.options.getWidth() || 20)), + // u = parseInt(o.a.pt.toPx(this.options.getHeight() || 20)), + var lpt = this.options.getWidth() || 20, + upt = this.options.getHeight() || 20 + var box = $('
').css({"width":(lpt>upt?upt:lpt)+'pt',"height":(lpt>upt?upt:lpt)+'pt','display':'inline-block'}) + new QRCode(box[0], { + width: "100%", + height: "100%", + colorDark: this.options.color || "#000000", + useSVG: !0 }).makeCode(n); + a.html(box) } } catch (t) { console.log(t), a.html("二维码生成失败"); @@ -7914,7 +7922,7 @@ var hiprint = function (t) { }, t; }(), ct = function () { - function t(t) { + function t(t,startcb) { var e = this; this.tempimageBase64 = {}, this.id = s.a.instance.guid(), s.a.instance.setPrintTemplateById(this.id, this); var n = t || {}; @@ -7923,6 +7931,7 @@ var hiprint = function (t) { n.template && i.panels.forEach(function (t) { e.printPanels.push(new pt(t, e.id)); }), n.fields && (this.fields = n.fields), n.settingContainer && new ut(this, n.settingContainer), n.paginationContainer && (this.printPaginationCreator = new dt(n.paginationContainer, this), this.printPaginationCreator.buildPagination()), this.initAutoSave(); + startcb&&startcb(); } return t.prototype.design = function (t, e) { @@ -8218,14 +8227,16 @@ var hiprint = function (t) { } - function mt(t,status) { - //添加是否默认请求状态 - window.disSocketRequest = status||false + function mt(t,cb) { //清空历史初始化记录 a.instance.allElementTypes = [] p.a.instance.init(t), p.a.instance.providers.forEach(function (t) { t.addElementTypes(a.instance); }); + //status true: 手动请求 false:自动请求 function:自动请求时 直接打印回调(打印操作放入回调正常打印) + if(hiwebSocket.hasIo()){ + hiwebSocket.start(cb); + } } @@ -8269,9 +8280,9 @@ var hiprint = function (t) { }), n.d(e, "getHtml", function () { return gt; }), $(document).ready(function () { - if(hiwebSocket.hasIo()&&!window.disSocketRequest){ - hiwebSocket.start(); - } + // if(hiwebSocket.hasIo()&&!window.disSocketRequest){ + // hiwebSocket.start(); + // } }); }]); -- Gitee From 37529913324869e4a3b0307dc0317fa27e127047 Mon Sep 17 00:00:00 2001 From: lanmo <1298956120@qq.com> Date: Wed, 20 Apr 2022 01:01:21 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E8=A1=A8=E5=A4=B4?= =?UTF-8?q?=E6=8B=96=E5=8A=A8=E9=94=99=E4=B9=B1=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hiprint/hiprint.bundle.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/hiprint/hiprint.bundle.js b/src/hiprint/hiprint.bundle.js index 8ab17fb..a1e2173 100644 --- a/src/hiprint/hiprint.bundle.js +++ b/src/hiprint/hiprint.bundle.js @@ -4488,7 +4488,14 @@ var hiprint = function (t) { g.a.instance.draging = !1; var i = parseFloat(e.dragingGrip.target.css("left").replace("px", "")), o = r.a.px.toPt(i - e.dragingGrip.left); - s.cell.width = s.cell.width + o, s.nextGrip.cell.width = s.nextGrip.cell.width - o, t.resizeTableCellWidth(), s.target.removeClass("columngripDraging"), e.updateColumnGrips(); + if(s.cell.width + o < 20){ + o = 20 - s.cell.width + }else if(s.nextGrip.cell.width - o < 20){ + o = s.nextGrip.cell.width - 20 + } + s.cell.width = s.cell.width + o; + s.nextGrip.cell.width = s.nextGrip.cell.width - o; + t.resizeTableCellWidth(), s.target.removeClass("columngripDraging"), e.updateColumnGrips(); } }); } -- Gitee From d4a3709ac9fcdb86a221801ceab3b5f0ab4bdab0 Mon Sep 17 00:00:00 2001 From: lanmo <1298956120@qq.com> Date: Wed, 20 Apr 2022 01:04:41 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=88=97=E6=9C=80?= =?UTF-8?q?=E5=B0=8F=E5=AE=BD=E5=BA=A6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hiprint/hiprint.bundle.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hiprint/hiprint.bundle.js b/src/hiprint/hiprint.bundle.js index a1e2173..01c4edd 100644 --- a/src/hiprint/hiprint.bundle.js +++ b/src/hiprint/hiprint.bundle.js @@ -4486,12 +4486,12 @@ var hiprint = function (t) { }, onStopDrag: function onStopDrag(n) { g.a.instance.draging = !1; - var i = parseFloat(e.dragingGrip.target.css("left").replace("px", "")), - o = r.a.px.toPt(i - e.dragingGrip.left); - if(s.cell.width + o < 20){ - o = 20 - s.cell.width - }else if(s.nextGrip.cell.width - o < 20){ - o = s.nextGrip.cell.width - 20 + var i = parseFloat(e.dragingGrip.target.css("left").replace("px", "")),o = r.a.px.toPt(i - e.dragingGrip.left);\ + //表格列宽限制 最小宽度为10pt + if(s.cell.width + o < 10){ + o = 10 - s.cell.width + }else if(s.nextGrip.cell.width - o < 10){ + o = s.nextGrip.cell.width - 10 } s.cell.width = s.cell.width + o; s.nextGrip.cell.width = s.nextGrip.cell.width - o; -- Gitee From 6352438659f0d18018861ef28de39cd404ed6786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=B9=A6=E6=9F=B1?= Date: Wed, 20 Apr 2022 09:55:16 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hiprint/hiprint.bundle.js | 3 ++- yarn.lock | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hiprint/hiprint.bundle.js b/src/hiprint/hiprint.bundle.js index 01c4edd..4b66100 100644 --- a/src/hiprint/hiprint.bundle.js +++ b/src/hiprint/hiprint.bundle.js @@ -1881,6 +1881,7 @@ var hiprint = function (t) { return r; }, TableExcelHelper.createRowTarget = function (t, e, n, i) { var o = $(""); + console.log(t) o.data("rowData", e), t.rowColumns.forEach(function (t, i) { var r = $(""); if ("first" == n.tableHeaderRepeat || "none" == n.tableHeaderRepeat) { @@ -4486,7 +4487,7 @@ var hiprint = function (t) { }, onStopDrag: function onStopDrag(n) { g.a.instance.draging = !1; - var i = parseFloat(e.dragingGrip.target.css("left").replace("px", "")),o = r.a.px.toPt(i - e.dragingGrip.left);\ + var i = parseFloat(e.dragingGrip.target.css("left").replace("px", "")),o = r.a.px.toPt(i - e.dragingGrip.left); //表格列宽限制 最小宽度为10pt if(s.cell.width + o < 10){ o = 10 - s.cell.width diff --git a/yarn.lock b/yarn.lock index 7b889f9..8e23352 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2751,6 +2751,11 @@ concat-stream@^1.5.0: readable-stream "^2.2.2" typedarray "^0.0.6" +concurrent-tasks@^1.0.7: + version "1.0.7" + resolved "https://registry.npmmirror.com/concurrent-tasks/-/concurrent-tasks-1.0.7.tgz#fb3f11bc80ea5bc12f3055c25cb7c679459a77a0" + integrity sha512-2FJzuFm0eK8jmPIazy/Un9r6eo+bBeSC36ONvopgNBEL3NB0ck44I9kLu+NJgyuuLjwwtaAreujTKOBCmfCgDg== + connect-history-api-fallback@^1.6.0: version "1.6.0" resolved "https://registry.npmmirror.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" -- Gitee From 3849a471eba94822b5877f7838c929735069141b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=B9=A6=E6=9F=B1?= Date: Wed, 20 Apr 2022 10:01:40 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=88=97=E5=AE=BD?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hiprint/hiprint.bundle.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hiprint/hiprint.bundle.js b/src/hiprint/hiprint.bundle.js index 30bcdf1..012a925 100644 --- a/src/hiprint/hiprint.bundle.js +++ b/src/hiprint/hiprint.bundle.js @@ -4439,6 +4439,12 @@ var hiprint = function (t) { g.a.instance.draging = !1; var i = parseFloat(e.dragingGrip.target.css("left").replace("px", "")), o = r.a.px.toPt(i - e.dragingGrip.left); + //表格列宽限制 最小宽度为10pt + if(s.cell.width + o < 10){ + o = 10 - s.cell.width + }else if(s.nextGrip.cell.width - o < 10){ + o = s.nextGrip.cell.width - 10 + } s.cell.width = s.cell.width + o, s.nextGrip.cell.width = s.nextGrip.cell.width - o, t.resizeTableCellWidth(), s.target.removeClass("columngripDraging"), e.updateColumnGrips(); } }); -- Gitee From eb2a96b5aae5b99ba68864e7ba680336788e26e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=B9=A6=E6=9F=B1?= Date: Thu, 21 Apr 2022 17:26:57 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E6=A0=87=E5=B0=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hiprint/css/image/l_img.svg | 1 + src/hiprint/css/image/v_img.svg | 1 + src/hiprint/hiprint.bundle.js | 23 +++++++++++++++++------ 3 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 src/hiprint/css/image/l_img.svg create mode 100644 src/hiprint/css/image/v_img.svg diff --git a/src/hiprint/css/image/l_img.svg b/src/hiprint/css/image/l_img.svg new file mode 100644 index 0000000..75e4793 --- /dev/null +++ b/src/hiprint/css/image/l_img.svg @@ -0,0 +1 @@ +0801602403504012020028039020100180260370601402203303001090170250360501302103202903011019027038070150230340310 \ No newline at end of file diff --git a/src/hiprint/css/image/v_img.svg b/src/hiprint/css/image/v_img.svg new file mode 100644 index 0000000..895b1fa --- /dev/null +++ b/src/hiprint/css/image/v_img.svg @@ -0,0 +1 @@ +801602403504012020028039020100180260370601402203303001090170250360501302103202903011019027038070150230340310 \ No newline at end of file diff --git a/src/hiprint/hiprint.bundle.js b/src/hiprint/hiprint.bundle.js index 012a925..275bd17 100644 --- a/src/hiprint/hiprint.bundle.js +++ b/src/hiprint/hiprint.bundle.js @@ -18,7 +18,6 @@ function _instanceof(left, right) { return left instanceof right; } } - function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { @@ -50,7 +49,8 @@ import './plugins/JsBarcode.all.min.js' import './plugins/qrcode.js' // 直接打印需要 import io from './plugins/socket.io' - +import lline from './css/image/l_img.svg' +import vline from './css/image/v_img.svg' window.io = io; // pdf import jsPDF from './plugins/jspdf/jspdf.min.js' @@ -1229,7 +1229,7 @@ var hiprint = function (t) { }) : t.options[e.name] = n; }), this.updateDesignViewFromOptions(), _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger("hiprintTemplateDataChanged_" + this.templateId); }, BasePrintElement.prototype.getReizeableShowPoints = function () { - return ["s", "e"]; + return ["s", "e", "rotate"]; }, BasePrintElement.prototype.onResize = function (t, e, n, i, o) { this.updateSizeAndPositionOptions(o, i, n, e); }, BasePrintElement.prototype.getOrderIndex = function () { @@ -5413,10 +5413,14 @@ var hiprint = function (t) { name: "sw", target: n('
') }, + k = { + name: "rotate", + target: n('
') + }, h = function h() { var t = [], i = e.options.showPoints; - return n.each([r, a, p, s, l, u, d, c], function (e, o) { + return n.each([r, a, p, s, l, u, d, c, k], function (e, o) { n.inArray(o.name, i) > -1 && t.push(o.target); }), t; }; @@ -5457,6 +5461,7 @@ var hiprint = function (t) { var i = this, o = 0, r = 0, + du = 0, a = t.width(), p = t.height(), s = t.offset().left, @@ -5494,11 +5499,17 @@ var hiprint = function (t) { t.on("mousedown", ".sw", function (e) { o = e.pageX, r = e.pageY, a = t.width(), p = t.height(), y = !0, s = u.offset().left; }); + var rotate = !1; + t.on("mousedown", ".rotate", function (e) { + o = e.pageX, du = 0,rotate = !0; + }); var b = !1; t.on("mousedown", function (t) { i.options.onBeforeResize(), o = t.pageX, r = t.pageY, l = u.offset().top, s = u.offset().left, b = !1; }), n(i.options.stage).on("mousemove", function (e) { - if (d) { + if (rotate) {//旋转时移动事件 + var n = e.pageX - o; + } else if (d) { var n = e.pageX - o; t.css({ width: "100%" @@ -6362,7 +6373,7 @@ var hiprint = function (t) { }, t.prototype.getContentHeight = function (t) { return this.getPaperFooter(t) - this.paperHeader; }, t.prototype.createRuler = function () { - this.target.append('
\n \n \n
'); + this.target.append('
\n \n \n
'); }, t.prototype.displayHeight = function () { return this.mmheight - p.a.instance.paperHeightTrim + "mm"; }, t.prototype.displayWidth = function () { -- Gitee From 64e4b34bf7bdb88d138188656b0da55b2e9b50e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=B9=A6=E6=9F=B1?= Date: Fri, 22 Apr 2022 09:55:09 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=A0=87=E5=B0=BA=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E6=A0=87=E5=B0=BA=E8=BE=B9=E7=95=8C=E7=BB=86=E8=8A=82?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hiprint/css/hiprint.css | 4 +++- src/hiprint/hiprint.bundle.js | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/hiprint/css/hiprint.css b/src/hiprint/css/hiprint.css index 3689278..3e58135 100644 --- a/src/hiprint/css/hiprint.css +++ b/src/hiprint/css/hiprint.css @@ -669,7 +669,9 @@ font-weight: normal;*/ border-top: 1px solid rgb(201, 190, 190); border-left: 1px solid rgb(201, 190, 190); padding-left: 15px; - margin: -16px + padding-top:15px; + margin: -16px; + box-sizing: content-box!important; } .hiprint_rul_wrapper .h_img { diff --git a/src/hiprint/hiprint.bundle.js b/src/hiprint/hiprint.bundle.js index f1ebd92..9da723c 100644 --- a/src/hiprint/hiprint.bundle.js +++ b/src/hiprint/hiprint.bundle.js @@ -50,7 +50,9 @@ import './plugins/JsBarcode.all.min.js' import './plugins/qrcode.js' // 直接打印需要 import io from './plugins/socket.io' - +//引入标尺 +import lImg from './css/image/l_img.svg' +import vImg from './css/image/v_img.svg' window.io = io; // pdf import jsPDF from './plugins/jspdf/jspdf.min.js' @@ -6504,7 +6506,7 @@ var hiprint = function (t) { }, t.prototype.getContentHeight = function (t) { return this.getPaperFooter(t) - this.paperHeader; }, t.prototype.createRuler = function () { - this.target.append('
\n \n \n
'); + this.target.append('
\n \n \n
'); }, t.prototype.displayHeight = function () { return this.mmheight - p.a.instance.paperHeightTrim + "mm"; }, t.prototype.displayWidth = function () { -- Gitee