diff --git a/src/hiprint/hiprint.bundle.js b/src/hiprint/hiprint.bundle.js index 9da723c85a75a5758bc704182a24978c1e4c0806..86925fc149f06de60e6dd25c16261ed28a81eafa 100644 --- a/src/hiprint/hiprint.bundle.js +++ b/src/hiprint/hiprint.bundle.js @@ -1244,11 +1244,18 @@ var hiprint = function (t) { onBeforeDrag: function onBeforeDrag(t) { _HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.draging = !0, n.designTarget.focus(), n.createLineOfPosition(e); }, + getScale:function getScale (){ + return n.designPaper.scale||1 + }, onStopDrag: function onStopDrag(t) { + //普通元素拖动结束事件history _HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.draging = !1, n.removeLineOfPosition(); } }), this.designTarget.hireizeable({ showPoints: n.getReizeableShowPoints(), + getScale:function getScale (){ + return n.designPaper.scale||1 + }, onBeforeResize: function onBeforeResize() { _HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.draging = !0; }, @@ -1266,6 +1273,7 @@ var hiprint = function (t) { }, BasePrintElement.prototype.getPrintElementEntity = function (t) { return t ? new _entity_PrintElementEntity__WEBPACK_IMPORTED_MODULE_0__.a(void 0, this.options.getPrintElementOptionEntity(), this.printElementType.getPrintElementTypeEntity()) : new _entity_PrintElementEntity__WEBPACK_IMPORTED_MODULE_0__.a(this.printElementType.tid, this.options.getPrintElementOptionEntity()); }, BasePrintElement.prototype.submitOption = function () { + // 右侧选项修改模版数据触发history var t = this; this.getPrintElementOptionItems().forEach(function (e) { var n = e.getValue(); @@ -1279,7 +1287,8 @@ var hiprint = function (t) { this.options.setRotate(r), _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger("hiprintTemplateDataChanged_" + this.templateId); }, BasePrintElement.prototype.onResize = function (t, e, n, i, o) { this.updateSizeAndPositionOptions(o, i, n, e); - }, BasePrintElement.prototype.getOrderIndex = function () { + }, + BasePrintElement.prototype.getOrderIndex = function () { return this.options.getTop(); }, BasePrintElement.prototype.getHtml = function (t, e, n) { var i = 0; @@ -1710,8 +1719,6 @@ var hiprint = function (t) { return this.title; }, t.prototype.beginEdit = function (t) { var e = this; - console.log(t) - console.log(e) if (e.tableOptions.options.fields && e.tableOptions.options.fields.length) { this.editor = r.Instance.createSelect("select"), t.getTarget().html(""), this.editor.init(e.tableOptions.options.fields, t), this.editor.setValue(this.field || ""), $(this.editor.target).keydown(function (n) { 13 == n.keyCode && e.endEdit(t); @@ -3820,7 +3827,8 @@ var hiprint = function (t) { return t.init(), t.printElementOptionItems[e]; }, t._printElementOptionItems = [new o(), new r(), new a(), new p(), new i(), new s(), new l(), new pt(), new u(), new d(), new c(), new h(), new f(), new g(), new m(), new v(), new y(), new b(), new E(), new T(), new P(), new _(), new w(), new x(), new C(), new O(), new H(), new D(), new I(), new R(), new M(), new M2(), new S(), new B(), new F(), new L(), new A(), new z(), new k(), new st(), new N(), new V(), new W(), new j(), new U(), new K(), new G(), new q(), new X(), new Y(), new Q(), new J(), new Z(), new tt(), new et(), new nt(), new it(), new ot(), new at(), new lt(), new ut(), new it(), new dt(), new ct(), new ht(), new ft(), new gt(), new mt(), new vt(), new yt(), new bt(), new Tt(), new Et(), new Pt(), new _t(), new wt(), new xt(),new tableColumnH(),new tableE(),new tablept()], t; }(); -}, function (t, e, n) { +}, +function (t, e, n) { "use strict"; n.d(e, "a", function () { @@ -3897,7 +3905,8 @@ var hiprint = function (t) { this.rowIndex = t, this.cell = e; }; }(); -}, function (t, e, n) { +}, +function (t, e, n) { "use strict"; n.d(e, "a", function () { @@ -3912,7 +3921,8 @@ var hiprint = function (t) { return this.id += 1, this.id; }, t.id = 1, t; }(); -}, function (t, e, n) { +}, +function (t, e, n) { "use strict"; n.d(e, "a", function () { @@ -3957,7 +3967,8 @@ var hiprint = function (t) { }), t; }, e; }(r.a); -}, function (t, e, n) { +}, +function (t, e, n) { "use strict"; n.d(e, "a", function () { @@ -4006,7 +4017,8 @@ var hiprint = function (t) { }), t; }, t; }(); -}, function (t, e, n) { +}, +function (t, e, n) { "use strict"; n.d(e, "a", function () { @@ -4036,7 +4048,8 @@ var hiprint = function (t) { }; }, t; }(); -}, function (module, __webpack_exports__, __webpack_require__) { +}, +function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.d(__webpack_exports__, "a", function () { @@ -4297,6 +4310,9 @@ var hiprint = function (t) { onBeforeDrag: function onBeforeDrag(t) { _HiPrintlib__WEBPACK_IMPORTED_MODULE_9__.a.instance.draging = !0, n.createLineOfPosition(e); }, + getScale:function getScale (){ + return n.designPaper.scale||1 + }, onStopDrag: function onStopDrag(t) { _HiPrintlib__WEBPACK_IMPORTED_MODULE_9__.a.instance.draging = !1, n.removeLineOfPosition(); } @@ -4306,6 +4322,9 @@ var hiprint = function (t) { onBeforeResize: function onBeforeResize() { _HiPrintlib__WEBPACK_IMPORTED_MODULE_9__.a.instance.draging = !0; }, + getScale:function getScale (){ + return n.designPaper.scale||1 + }, onResize: function onResize(t, i, o, r, a) { n.onResize(t, i, o, r, a), n.hitable && n.hitable.updateColumnGrips(), n.createLineOfPosition(e); }, @@ -4392,7 +4411,8 @@ var hiprint = function (t) { return gridColumnsFooterFormatter; }, TablePrintElement; }(_BasePrintElement__WEBPACK_IMPORTED_MODULE_0__.a); -}, function (t, e, n) { +}, +function (t, e, n) { "use strict"; var i = function () { @@ -4520,6 +4540,10 @@ var hiprint = function (t) { if (g.a.instance.draging = !0, !s.nextGrip) return !1; e.dragingGrip = s, e.dragingGrip.left = parseFloat(e.dragingGrip.target.css("left").replace("px", "")), s.target.addClass("columngripDraging"); }, + getScale:function getScale (){ + // 待群主大大修复 返回scale属性 + return 1 + }, onStopDrag: function onStopDrag(n) { g.a.instance.draging = !1; var i = parseFloat(e.dragingGrip.target.css("left").replace("px", "")), @@ -4990,7 +5014,8 @@ var hiprint = function (t) { this.resizer.updateRowGrips(); }, t; }(); -}, function (t, e, n) { +}, +function (t, e, n) { "use strict"; n.d(e, "a", function () { @@ -5002,7 +5027,8 @@ var hiprint = function (t) { this.tid = t, this.options = e, this.printElementType = n; }; }(); -}, function (t, e, n) { +}, +function (t, e, n) { "use strict"; var i = n(3), @@ -5079,7 +5105,8 @@ var hiprint = function (t) { })), e; }, e; }(i.a); -}, function (t, e, n) { +}, +function (t, e, n) { "use strict"; n.d(e, "a", function () { @@ -5091,7 +5118,8 @@ var hiprint = function (t) { this.rowColumns = []; }; }(); -}, function (t, e, n) { +}, +function (t, e, n) { "use strict"; n.d(e, "a", function () { @@ -5107,18 +5135,23 @@ var hiprint = function (t) { return this.target.find(".hi-grid-col:eq(" + t + ")"); }, t; }(); -}, function (t, e, n) { +}, +function (t, e, n) { t.exports = n(33); -}, function (t, e) { +}, +function (t, e) { !function (t) { function e(e) { + var n = t.data(e.data.target, "hidraggable"), i = n.options, o = n.proxy, r = e.data, - a = r.startLeft + e.pageX - r.startX, - p = r.startTop + e.pageY - r.startY; + a = r.startLeft + (e.pageX - r.startX) / n.options.getScale() , + p = r.startTop + (e.pageY - r.startY) / n.options.getScale() ; o && (o.parent()[0] == document.body ? (a = null != i.deltaX && null != i.deltaX ? e.pageX + i.deltaX : e.pageX - e.data.offsetWidth, p = null != i.deltaY && null != i.deltaY ? e.pageY + i.deltaY : e.pageY - e.data.offsetHeight) : (null != i.deltaX && null != i.deltaX && (a += e.data.offsetWidth + i.deltaX), null != i.deltaY && null != i.deltaY && (p += e.data.offsetHeight + i.deltaY))), e.data.parent != document.body && (a += t(e.data.parent).scrollLeft(), p += t(e.data.parent).scrollTop()), "h" == i.axis ? r.left = a : "v" == i.axis ? r.top = p : (r.left = a, r.top = p); + + } function n(e) { @@ -5149,6 +5182,7 @@ var hiprint = function (t) { } function o(i) { + // 移动开始动作 var o = t.data(i.data.target, "hidraggable"); e(i); if (i.data.target.className.startsWith('resize-panel') || i.data.target.className.startsWith('hiprint-printElement')) { @@ -5269,7 +5303,6 @@ var hiprint = function (t) { u = e.pageX - o.left; return Math.min(p, s, l, u) > n.options.edge; } - t.data(this, "hidraggable", { options: n, handle: p @@ -5287,6 +5320,7 @@ var hiprint = function (t) { }).bind("mousedown.hidraggable", { target: this }, function (e) { + var ops = t.data(e.data.target, "hidraggable") if (0 != s(e)) { t(this).css("cursor", ""); var n = t(e.data.target).position(), @@ -5304,22 +5338,23 @@ var hiprint = function (t) { target: e.data.target, parent: t(e.data.target).parent()[0] }; - var tr = p.target.style.transform && parseInt(p.target.style.transform.slice(7,-1)); - if (tr) { - var rad = tr * Math.PI / 180, - width = t(e.data.target).outerWidth(), - height = t(e.data.target).outerHeight(), - sin = Math.sin(rad), - cos = Math.cos(rad); - var w = Math.abs(width * cos) + Math.abs(height * sin), - h = Math.abs(width * sin) + Math.abs(height * cos); - var diffW = (w - width) / 2, diffH = (h - height) / 2; - p.left += diffW, p.top += diffH, p.startLeft += diffW, p.startTop += diffH; - } - var ptr = t('.hiprint-printPaper')[0].style.transform && parseFloat(t('.hiprint-printPaper')[0].style.transform.slice(6,-1)); - if (ptr) { - p.left /= ptr, p.top /= ptr, p.startLeft /= ptr, p.startTop /= ptr; - } + + var ptr = ops.options.getScale() + if (ptr) { + p.left /= ptr, p.top /= ptr, p.startLeft /= ptr, p.startTop /= ptr; + } + var tr = p.target.style.transform && parseInt(p.target.style.transform.slice(7,-1)); + if (tr) { + var rad = tr * Math.PI / 180, + width = t(e.data.target).outerWidth(), + height = t(e.data.target).outerHeight(), + sin = Math.sin(rad), + cos = Math.cos(rad); + var w = Math.abs(width * cos) + Math.abs(height * sin), + h = Math.abs(width * sin) + Math.abs(height * cos); + var diffW = (w - width) / 2, diffH = (h - height) / 2; + p.left += diffW, p.top += diffH, p.startLeft += diffW, p.startTop += diffH; + } t.extend(e.data, p); // 旋转时不允许移动 if ('r resizebtn' == e.target.className) { @@ -5370,6 +5405,7 @@ var hiprint = function (t) { disabled: !1, edge: 0, axis: null, + getScale:function getScale(t){}, onBeforeDrag: function onBeforeDrag(t) { }, onStartDrag: function onStartDrag(t) { @@ -5634,15 +5670,16 @@ var hiprint = function (t) { 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) { + console.log(i.options.getScale()) if (d) { - var n = e.pageX - o; + var n = (e.pageX - o) / i.options.getScale(); t.css({ width: "100%" }), u.css({ width: i.numHandlerText(a + n) }), i.options.onResize(e, void 0, i.numHandler(a + n), void 0, void 0); } else if (c) { - var E = e.pageY - r; + var E = (e.pageY - r) / i.options.getScale(); t.css({ height: "100%" }), u.css({ @@ -5651,39 +5688,42 @@ var hiprint = function (t) { } else if (rt) { t.css({ height: "100%" }); var eo = e.pageX, er = e.pageY; - var AB = {}, AC = {}; - AB.X = o - s, AB.Y = r - l, AC.X = eo - s, AC.Y = er - l; - var direct = (AB.X * AC.Y) - (AB.Y * AC.X); - var lAB = Math.sqrt(Math.pow(s - o, 2) + Math.pow(l - r, 2)), - lAC = Math.sqrt(Math.pow(s - eo, 2) + Math.pow(l - er, 2)), - lBC = Math.sqrt(Math.pow(o - eo, 2) + Math.pow(r - er, 2)); - var cosA = (Math.pow(lAB, 2) + Math.pow(lAC, 2) - Math.pow(lBC, 2)) / (2 * lAB * lAC); - var angle = Math.round(Math.acos(cosA) * 180 / Math.PI); + var direct = (eo - o) * 360 / 100; + o = e.pageX + // var AB = {}, AC = {}; + // AB.X = o - s, AB.Y = r - l, AC.X = eo - s, AC.Y = er - l; + // var direct = (AB.X * AC.Y) - (AB.Y * AC.X); + // var lAB = Math.sqrt(Math.pow(s - o, 2) + Math.pow(l - r, 2)), + // lAC = Math.sqrt(Math.pow(s - eo, 2) + Math.pow(l - er, 2)), + // lBC = Math.sqrt(Math.pow(o - eo, 2) + Math.pow(r - er, 2)); + // var cosA = (Math.pow(lAB, 2) + Math.pow(lAC, 2) - Math.pow(lBC, 2)) / (2 * lAB * lAC); + // var angle = Math.round(Math.acos(cosA) * 180 / Math.PI); var lastAngle = (u[0].style.transform && parseInt(u[0].style.transform.slice(7,-1))) || 0; - var R = lastAngle + (direct > 0 ? angle : -angle); + // var R = lastAngle + (direct > 0 ? angle : -angle); + var R = lastAngle + direct ; if (Math.abs(R) > 360) { R = R % 360 } u.css({ transform: "rotate(" + R + "deg)" }); i.options.onResize(e, void 0, void 0, void 0, void 0, R); - } else h ? (n = e.pageX - o, t.css({ + } else h ? (n = (e.pageX - o) / i.options.getScale(), t.css({ width: "100%" }), u.css({ width: i.numHandlerText(a - n), left: i.numHandlerText(i.options.noDrag ? void 0 : i.numHandler(s + n)) - }), i.options.onResize(e, void 0, i.numHandler(a - n), void 0, i.options.noDrag ? void 0 : i.numHandler(s + n))) : f ? (E = e.pageY - r, t.css({ + }), i.options.onResize(e, void 0, i.numHandler(a - n), void 0, i.options.noDrag ? void 0 : i.numHandler(s + n))) : f ? (E = (e.pageY - r) / i.options.getScale(), t.css({ height: "100%" }), u.css({ height: i.numHandlerText(p - E), top: i.numHandlerText(i.options.noDrag ? void 0 : l + E) - }), i.options.onResize(e, i.numHandler(p - E), void 0, i.options.noDrag ? void 0 : i.numHandler(l + E), void 0)) : g ? (n = e.pageX - o, E = e.pageY - r, t.css({ + }), i.options.onResize(e, i.numHandler(p - E), void 0, i.options.noDrag ? void 0 : i.numHandler(l + E), void 0)) : g ? (n = (e.pageX - o) / i.options.getScale(), E = (e.pageY - r) / i.options.getScale(), t.css({ height: "100%", width: "100%" }), u.css({ height: i.numHandlerText(p - E), top: i.numHandlerText(i.options.noDrag ? void 0 : l + E), width: i.numHandlerText(a + n) - }), i.options.onResize(e, i.numHandler(p - E), i.numHandler(a + n), i.options.noDrag ? void 0 : i.numHandler(l + E), void 0)) : m ? (n = e.pageX - o, E = e.pageY - r, t.css({ + }), i.options.onResize(e, i.numHandler(p - E), i.numHandler(a + n), i.options.noDrag ? void 0 : i.numHandler(l + E), void 0)) : m ? (n = (e.pageX - o) / i.options.getScale(), E = (e.pageY - r) / i.options.getScale(), t.css({ height: "100%", width: "100%" }), u.css({ @@ -5691,20 +5731,20 @@ var hiprint = function (t) { top: i.numHandlerText(i.options.noDrag ? void 0 : l + E), width: i.numHandlerText(a - n), left: i.numHandlerText(i.options.noDrag ? void 0 : s + n) - }), i.options.onResize(e, i.numHandler(p - E), i.numHandler(a - n), i.options.noDrag ? void 0 : i.numHandler(l + E), i.options.noDrag ? void 0 : i.numHandler(s + n))) : v ? (n = e.pageX - o, E = e.pageY - r, t.css({ + }), i.options.onResize(e, i.numHandler(p - E), i.numHandler(a - n), i.options.noDrag ? void 0 : i.numHandler(l + E), i.options.noDrag ? void 0 : i.numHandler(s + n))) : v ? (n = (e.pageX - o) / i.options.getScale(), E = (e.pageY - r) / i.options.getScale(), t.css({ width: "100%", height: "100%" }), u.css({ width: i.numHandlerText(a + n), height: i.numHandlerText(p + E) - }), i.options.onResize(e, i.numHandler(p + E), i.numHandler(a + n), void 0, void 0)) : y ? (n = e.pageX - o, E = e.pageY - r, t.css({ + }), i.options.onResize(e, i.numHandler(p + E), i.numHandler(a + n), void 0, void 0)) : y ? (n = (e.pageX - o) / i.options.getScale(), E = (e.pageY - r) / i.options.getScale(), t.css({ width: "100%", height: "100%" }), u.css({ width: i.numHandlerText(a - n), left: i.numHandlerText(i.options.noDrag ? void 0 : s + n), height: i.numHandlerText(p + E) - }), i.options.onResize(e, i.numHandler(p + E), i.numHandler(a - n), i.numHandler(otundefinedop), i.options.noDrag ? void 0 : i.numHandler(s + n))) : b && (n = e.pageX - o, E = e.pageY - r, u.css({ + }), i.options.onResize(e, i.numHandler(p + E), i.numHandler(a - n), i.numHandler(otundefinedop), i.options.noDrag ? void 0 : i.numHandler(s + n))) : b && (n = (e.pageX - o) / i.options.getScale(), E = (e.pageY - r) / i.options.getScale(), u.css({ left: i.numHandlerText(i.options.noDrag ? void 0 : s + n), top: i.numHandlerText(i.options.noDrag ? void 0 : l + E) }), i.options.onResize(e, void 0, void 0, i.options.noDrag ? void 0 : i.numHandler(l + E), i.options.noDrag ? void 0 : i.numHandler(s + n))); @@ -6484,6 +6524,9 @@ var hiprint = function (t) { onBeforeDrag: function onBeforeDrag(t) { s.a.instance.draging = !0; }, + getScale:function getScale (){ + return i.scale||1 + }, onStopDrag: function onStopDrag(t) { s.a.instance.draging = !1, i.footerLinetarget.removeClass("hidefooterLinetarget"), i.headerLinetarget.removeClass("hideheaderLinetarget"); } @@ -7374,6 +7417,9 @@ var hiprint = function (t) { onBeforeResize: function onBeforeResize() { s.a.instance.draging = !0; }, + getScale:function getScale (){ + return n.designPaper.scale||1 + }, onResize: function onResize(t, i, o, r, a) { n.onResize(t, i, o, r, a), n.hitable.updateColumnGrips(), n.createLineOfPosition(e); }, @@ -7872,6 +7918,9 @@ var hiprint = function (t) { onBeforeDrag: function onBeforeDrag(t) { e.mouseRect.target.focus(), s.a.instance.draging = !0, e.mouseRect.mouseRectSelectedElement || (e.mouseRect.mouseRectSelectedElement = e.getElementInRect(e.mouseRect)); }, + getScale:function getScale (){ + return e.designPaper.scale||1 + }, onStopDrag: function onStopDrag(t) { s.a.instance.draging = !1; }