hoeditor-web 3.0.15 → 3.0.16
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/lib/hoeditor.umd.js +147 -47
- package/lib/hoeditor.umd.min.js +3 -3
- package/lib/lib.zip +0 -0
- package/package.json +1 -1
package/lib/hoeditor.umd.js
CHANGED
|
@@ -7613,7 +7613,7 @@ var component = (0,componentNormalizer/* default */.Z)(
|
|
|
7613
7613
|
|
|
7614
7614
|
/***/ }),
|
|
7615
7615
|
|
|
7616
|
-
/***/
|
|
7616
|
+
/***/ 72781:
|
|
7617
7617
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7618
7618
|
|
|
7619
7619
|
"use strict";
|
|
@@ -7625,7 +7625,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
7625
7625
|
"default": function() { return /* binding */ HoFormula; }
|
|
7626
7626
|
});
|
|
7627
7627
|
|
|
7628
|
-
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/controls/hoformula/HoFormula.vue?vue&type=template&id=
|
|
7628
|
+
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/controls/hoformula/HoFormula.vue?vue&type=template&id=6be449da&
|
|
7629
7629
|
var render = function render() {
|
|
7630
7630
|
var _vm = this,
|
|
7631
7631
|
_c = _vm._self._c;
|
|
@@ -7729,13 +7729,19 @@ var es_string_replace = __webpack_require__(15306);
|
|
|
7729
7729
|
var createImage = function createImage(data) {
|
|
7730
7730
|
var lateX = _this3.hoKFEditor.execCommand('get.source').replace(/\s/g, '');
|
|
7731
7731
|
if (data.width && data.height) {
|
|
7732
|
-
_this3.vueController.insertImage(data.img, data.width / 2, data.height / 2,
|
|
7732
|
+
_this3.vueController.insertImage(data.img, data.width / 2, data.height / 2, {
|
|
7733
|
+
isFormula: true,
|
|
7734
|
+
lateX: lateX
|
|
7735
|
+
});
|
|
7733
7736
|
_this3.closeFormula();
|
|
7734
7737
|
} else {
|
|
7735
7738
|
var img = new Image();
|
|
7736
7739
|
img.src = data.img;
|
|
7737
7740
|
img.onload = function () {
|
|
7738
|
-
_this3.vueController.insertImage(data.img, img.width / 2, img.height / 2,
|
|
7741
|
+
_this3.vueController.insertImage(data.img, img.width / 2, img.height / 2, {
|
|
7742
|
+
isFormula: true,
|
|
7743
|
+
lateX: lateX
|
|
7744
|
+
});
|
|
7739
7745
|
_this3.closeFormula();
|
|
7740
7746
|
};
|
|
7741
7747
|
}
|
|
@@ -7760,10 +7766,10 @@ var es_string_replace = __webpack_require__(15306);
|
|
|
7760
7766
|
});
|
|
7761
7767
|
;// CONCATENATED MODULE: ./src/components/controls/hoformula/HoFormula.vue?vue&type=script&lang=js&
|
|
7762
7768
|
/* harmony default export */ var hoformula_HoFormulavue_type_script_lang_js_ = (HoFormulavue_type_script_lang_js_);
|
|
7763
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/controls/hoformula/HoFormula.vue?vue&type=style&index=0&id=
|
|
7769
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/controls/hoformula/HoFormula.vue?vue&type=style&index=0&id=6be449da&prod&lang=scss&
|
|
7764
7770
|
// extracted by mini-css-extract-plugin
|
|
7765
7771
|
|
|
7766
|
-
;// CONCATENATED MODULE: ./src/components/controls/hoformula/HoFormula.vue?vue&type=style&index=0&id=
|
|
7772
|
+
;// CONCATENATED MODULE: ./src/components/controls/hoformula/HoFormula.vue?vue&type=style&index=0&id=6be449da&prod&lang=scss&
|
|
7767
7773
|
|
|
7768
7774
|
// EXTERNAL MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
|
|
7769
7775
|
var componentNormalizer = __webpack_require__(70713);
|
|
@@ -38082,12 +38088,12 @@ var DocController = /*#__PURE__*/function () {
|
|
|
38082
38088
|
*/
|
|
38083
38089
|
}, {
|
|
38084
38090
|
key: "insertImage",
|
|
38085
|
-
value: function insertImage(curDomRange, imagePath, width, height,
|
|
38091
|
+
value: function insertImage(curDomRange, imagePath, width, height, options) {
|
|
38086
38092
|
var domRange = curDomRange.normalize();
|
|
38087
38093
|
var startPath = domRange.startPath;
|
|
38088
38094
|
var hoEditorFactory = _HOEditorFactorys__WEBPACK_IMPORTED_MODULE_76__/* .HOEditorFactorys.instance */ .b.instance().getFactory(this._hoEditorFactoryID);
|
|
38089
38095
|
var parentNode = hoEditorFactory.docTree.getParentNode(startPath);
|
|
38090
|
-
var imageNode = new _treeNode_ImageNode__WEBPACK_IMPORTED_MODULE_47__/* .ImageNode */ .H(this._hoEditorFactoryID, domRange.npStart.roots, parentNode, _treeNode_BaseNode__WEBPACK_IMPORTED_MODULE_23__/* .NodeType.ntImage */ .Jq.ntImage, hoEditorFactory.gernerateCode.generateID("IMG"), imagePath, width, height,
|
|
38096
|
+
var imageNode = new _treeNode_ImageNode__WEBPACK_IMPORTED_MODULE_47__/* .ImageNode */ .H(this._hoEditorFactoryID, domRange.npStart.roots, parentNode, _treeNode_BaseNode__WEBPACK_IMPORTED_MODULE_23__/* .NodeType.ntImage */ .Jq.ntImage, hoEditorFactory.gernerateCode.generateID("IMG"), imagePath, width, height, options);
|
|
38091
38097
|
//插入该表达式节点
|
|
38092
38098
|
hoEditorFactory.undoService.begin();
|
|
38093
38099
|
hoEditorFactory.undoService.add(new _undoRedo_NodeInsertUndoUnit__WEBPACK_IMPORTED_MODULE_24__/* .NodeInsertUndoUnit */ .R(this._hoEditorFactoryID, startPath, imageNode));
|
|
@@ -51471,7 +51477,7 @@ var ImageNode = /*#__PURE__*/function (_BaseNode) {
|
|
|
51471
51477
|
function ImageNode(hoEditorFactoryID, rootNodes, pNode, nodeType, id, imageDataBase64String, width, height,
|
|
51472
51478
|
//scaleX?: number,
|
|
51473
51479
|
//scaleY?: number,
|
|
51474
|
-
|
|
51480
|
+
options, markImage, imageJson) {
|
|
51475
51481
|
var _this;
|
|
51476
51482
|
(0,classCallCheck/* default */.Z)(this, ImageNode);
|
|
51477
51483
|
_this = _super.call(this, hoEditorFactoryID, rootNodes, pNode, nodeType);
|
|
@@ -51490,7 +51496,7 @@ var ImageNode = /*#__PURE__*/function (_BaseNode) {
|
|
|
51490
51496
|
_this._height = height;
|
|
51491
51497
|
_this._imageDataBase64String = imageDataBase64String;
|
|
51492
51498
|
_this._remark = "";
|
|
51493
|
-
_this._isFormula = isFormula ? isFormula : false;
|
|
51499
|
+
_this._isFormula = options !== null && options !== void 0 && options.isFormula ? options.isFormula : false;
|
|
51494
51500
|
_this._markImage = markImage ? markImage : '';
|
|
51495
51501
|
_this._imageJson = imageJson ? imageJson : '';
|
|
51496
51502
|
//this._scaleX = scaleX ? scaleX : 1;
|
|
@@ -51703,7 +51709,9 @@ var ImageNode = /*#__PURE__*/function (_BaseNode) {
|
|
|
51703
51709
|
return new ImageNode(hoEditorFactoryID, rootNodes, pNode ? pNode : null, BaseNode/* NodeType.ntImage */.Jq.ntImage, json.id, json.imageDataBase64String, width, height,
|
|
51704
51710
|
//scaleX,
|
|
51705
51711
|
//scaleY,
|
|
51706
|
-
|
|
51712
|
+
{
|
|
51713
|
+
isFormula: isFormula
|
|
51714
|
+
}, json.markImage, json.imageJson);
|
|
51707
51715
|
}
|
|
51708
51716
|
}]);
|
|
51709
51717
|
return ImageNode;
|
|
@@ -70219,34 +70227,39 @@ var DrawMedicalExpression = /*#__PURE__*/function (_DrawCombineNode) {
|
|
|
70219
70227
|
key: "drawPermanentTeeth",
|
|
70220
70228
|
value: function drawPermanentTeeth() {
|
|
70221
70229
|
var topLeft = new createjs.Text(this._arrValues[0].split(',').join(''), this._textStyle.getStyleKey(), this._textStyle.color);
|
|
70230
|
+
var topRight = new createjs.Text(this._arrValues[1].split(',').join(''), this._textStyle.getStyleKey(), this._textStyle.color);
|
|
70231
|
+
var bottomLeft = new createjs.Text(this._arrValues[2].split(',').join(''), this._textStyle.getStyleKey(), this._textStyle.color);
|
|
70232
|
+
var bottomRight = new createjs.Text(this._arrValues[3].split(',').join(''), this._textStyle.getStyleKey(), this._textStyle.color);
|
|
70233
|
+
var lineX = new createjs.Shape();
|
|
70234
|
+
var lineY = new createjs.Shape();
|
|
70235
|
+
var maxWidth = Math.max(topLeft.getMeasuredWidth() + topRight.getMeasuredWidth(), bottomLeft.getMeasuredWidth() + bottomRight.getMeasuredWidth()) + 15;
|
|
70236
|
+
// const maxHeight = Math.max(topLeft.getMeasuredHeight() + bottomLeft.getMeasuredHeight(), topRight.getMeasuredHeight(), bottomRight.getMeasuredHeight());
|
|
70237
|
+
|
|
70238
|
+
var leftMaxWidth = Math.max(topLeft.getMeasuredWidth(), bottomLeft.getMeasuredWidth());
|
|
70239
|
+
this.dWidth = maxWidth;
|
|
70240
|
+
lineX.graphics.beginStroke(this._textStyle.color).moveTo(0, -this._dHeight / 2).lineTo(this.dWidth, -this._dHeight / 2);
|
|
70241
|
+
lineY.graphics.beginStroke(this._textStyle.color).moveTo(leftMaxWidth + 6, -this._dHeight).lineTo(leftMaxWidth + 6, 0);
|
|
70222
70242
|
topLeft.y = -this.dHeight / 2 - topLeft.getMeasuredHeight() / 2;
|
|
70223
|
-
topLeft.x =
|
|
70243
|
+
topLeft.x = 4;
|
|
70224
70244
|
topLeft.textAlign = "left";
|
|
70225
70245
|
topLeft.textBaseline = "alphabetic";
|
|
70226
|
-
this.addChild(topLeft);
|
|
70227
|
-
var topRight = new createjs.Text(this._arrValues[1].split(',').join(''), this._textStyle.getStyleKey(), this._textStyle.color);
|
|
70228
70246
|
topRight.y = topLeft.y;
|
|
70229
|
-
topRight.x =
|
|
70247
|
+
topRight.x = leftMaxWidth + 6 + 2;
|
|
70230
70248
|
topRight.textAlign = "left";
|
|
70231
70249
|
topRight.textBaseline = "alphabetic";
|
|
70232
|
-
this.addChild(topRight);
|
|
70233
|
-
var lineX = new createjs.Shape();
|
|
70234
|
-
lineX.graphics.beginStroke(this._textStyle.color).moveTo(0, -this._dHeight / 2).lineTo(this.dWidth, -this._dHeight / 2);
|
|
70235
|
-
this.addChild(lineX);
|
|
70236
|
-
var bottomLeft = new createjs.Text(this._arrValues[2].split(',').join(''), this._textStyle.getStyleKey(), this._textStyle.color);
|
|
70237
70250
|
bottomLeft.y = 0;
|
|
70238
|
-
bottomLeft.x =
|
|
70251
|
+
bottomLeft.x = 4;
|
|
70239
70252
|
bottomLeft.textAlign = "left";
|
|
70240
70253
|
bottomLeft.textBaseline = "alphabetic";
|
|
70241
|
-
this.addChild(bottomLeft);
|
|
70242
|
-
var bottomRight = new createjs.Text(this._arrValues[3].split(',').join(''), this._textStyle.getStyleKey(), this._textStyle.color);
|
|
70243
70254
|
bottomRight.y = 0;
|
|
70244
70255
|
bottomRight.x = topRight.x;
|
|
70245
70256
|
bottomRight.textAlign = "left";
|
|
70246
70257
|
bottomRight.textBaseline = "alphabetic";
|
|
70258
|
+
this.addChild(topLeft);
|
|
70259
|
+
this.addChild(topRight);
|
|
70260
|
+
this.addChild(lineX);
|
|
70261
|
+
this.addChild(bottomLeft);
|
|
70247
70262
|
this.addChild(bottomRight);
|
|
70248
|
-
var lineY = new createjs.Shape();
|
|
70249
|
-
lineY.graphics.beginStroke(this._textStyle.color).moveTo(this.dWidth / 2, -this._dHeight).lineTo(this.dWidth / 2, 0);
|
|
70250
70263
|
this.addChild(lineY);
|
|
70251
70264
|
}
|
|
70252
70265
|
}, {
|
|
@@ -88434,6 +88447,7 @@ var isMap = function isMap(map) {
|
|
|
88434
88447
|
/* harmony export */ "Nv": function() { return /* binding */ computedPoperPosition; },
|
|
88435
88448
|
/* harmony export */ "dv": function() { return /* binding */ dateFormatValueList; },
|
|
88436
88449
|
/* harmony export */ "eG": function() { return /* binding */ dateFormatList; },
|
|
88450
|
+
/* harmony export */ "fu": function() { return /* binding */ scaleRotateImage; },
|
|
88437
88451
|
/* harmony export */ "h9": function() { return /* binding */ dealImage; },
|
|
88438
88452
|
/* harmony export */ "j_": function() { return /* binding */ createPrintHTMLStyle; },
|
|
88439
88453
|
/* harmony export */ "tC": function() { return /* binding */ toolModalMove; },
|
|
@@ -88884,6 +88898,43 @@ var dealImage = function dealImage(base64, callback, qualitys, size, img) {
|
|
|
88884
88898
|
};
|
|
88885
88899
|
};
|
|
88886
88900
|
|
|
88901
|
+
var scaleRotateImage = function scaleRotateImage(base64, imageWidth, imageHeight, rotate, callback) {
|
|
88902
|
+
var image = new Image();
|
|
88903
|
+
image.src = base64;
|
|
88904
|
+
image.onload = function () {
|
|
88905
|
+
var canvas = document.createElement('canvas');
|
|
88906
|
+
var ctx = canvas.getContext('2d');
|
|
88907
|
+
canvas.width = imageWidth;
|
|
88908
|
+
canvas.height = imageHeight;
|
|
88909
|
+
canvas.style.width = canvas.width + 'px';
|
|
88910
|
+
canvas.style.height = canvas.height + 'px';
|
|
88911
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
88912
|
+
ctx.fillStyle = '#FFFFFF';
|
|
88913
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
88914
|
+
ctx.drawImage(image, 0, 0, canvas.width, canvas.height);
|
|
88915
|
+
var newImage = new Image();
|
|
88916
|
+
newImage.src = canvas.toDataURL('image/jpeg', 0.92);
|
|
88917
|
+
if (rotate !== 0 && rotate !== 360 && rotate !== -360) {
|
|
88918
|
+
newImage.onload = function () {
|
|
88919
|
+
ctx.fillStyle = '#FFFFFF';
|
|
88920
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
88921
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
88922
|
+
ctx.translate(canvas.width / 2, canvas.height / 2);
|
|
88923
|
+
ctx.rotate(rotate * Math.PI / 180);
|
|
88924
|
+
ctx.drawImage(newImage, -canvas.width / 2, -canvas.height / 2);
|
|
88925
|
+
var url = canvas.toDataURL('image/png', 1);
|
|
88926
|
+
callback(url);
|
|
88927
|
+
canvas = null;
|
|
88928
|
+
ctx = null;
|
|
88929
|
+
};
|
|
88930
|
+
} else {
|
|
88931
|
+
callback(canvas.toDataURL('image/jpeg', 1));
|
|
88932
|
+
canvas = null;
|
|
88933
|
+
ctx = null;
|
|
88934
|
+
}
|
|
88935
|
+
};
|
|
88936
|
+
};
|
|
88937
|
+
|
|
88887
88938
|
/***/ }),
|
|
88888
88939
|
|
|
88889
88940
|
/***/ 38205:
|
|
@@ -219488,7 +219539,7 @@ var map = {
|
|
|
219488
219539
|
"./expressionForm/ExpressionForm.vue": 7981,
|
|
219489
219540
|
"./findReplace/FindReplace.vue": 25918,
|
|
219490
219541
|
"./gestation/Gestation.vue": 6251,
|
|
219491
|
-
"./hoformula/HoFormula.vue":
|
|
219542
|
+
"./hoformula/HoFormula.vue": 72781,
|
|
219492
219543
|
"./hoprint/HoPrint.vue": 62321,
|
|
219493
219544
|
"./listsource/ListSource.vue": 47214,
|
|
219494
219545
|
"./localHistory/LocalHistory.vue": 89206,
|
|
@@ -255630,7 +255681,7 @@ Input.install = function (Vue) {
|
|
|
255630
255681
|
|
|
255631
255682
|
|
|
255632
255683
|
/* harmony default export */ var antd = ([es_button, input, input_number, es_checkbox, date_picker, time_picker, es_radio, es_select, es_tabs, es_dropdown, es_menu, es_upload, tooltip, table, popover, es_icon/* default */.Z, config_provider]);
|
|
255633
|
-
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDocs.vue?vue&type=template&id=
|
|
255684
|
+
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDocs.vue?vue&type=template&id=d29f666a&
|
|
255634
255685
|
var render = function render() {
|
|
255635
255686
|
var _vm = this,
|
|
255636
255687
|
_c = _vm._self._c;
|
|
@@ -255747,8 +255798,8 @@ var es_string_match = __webpack_require__(4723);
|
|
|
255747
255798
|
var es_number_constructor = __webpack_require__(9653);
|
|
255748
255799
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.json.stringify.js
|
|
255749
255800
|
var es_json_stringify = __webpack_require__(38862);
|
|
255750
|
-
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDoc.vue?vue&type=template&id=
|
|
255751
|
-
var
|
|
255801
|
+
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDoc.vue?vue&type=template&id=47dcd5c8&
|
|
255802
|
+
var HoDocvue_type_template_id_47dcd5c8_render = function render() {
|
|
255752
255803
|
var _vm = this,
|
|
255753
255804
|
_c = _vm._self._c;
|
|
255754
255805
|
return _c('div', {
|
|
@@ -255894,7 +255945,7 @@ var HoDocvue_type_template_id_2fc5e2ab_render = function render() {
|
|
|
255894
255945
|
}
|
|
255895
255946
|
}, [_vm._v("v " + _vm._s(_vm.version))])])])], 1);
|
|
255896
255947
|
};
|
|
255897
|
-
var
|
|
255948
|
+
var HoDocvue_type_template_id_47dcd5c8_staticRenderFns = [];
|
|
255898
255949
|
|
|
255899
255950
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
|
|
255900
255951
|
var es_array_filter = __webpack_require__(57327);
|
|
@@ -259400,7 +259451,7 @@ var SignNode = __webpack_require__(24701);
|
|
|
259400
259451
|
// EXTERNAL MODULE: ./src/editor/dom/treeNode/ParagraphNode.ts
|
|
259401
259452
|
var ParagraphNode = __webpack_require__(67945);
|
|
259402
259453
|
;// CONCATENATED MODULE: ./src/components/version.ts
|
|
259403
|
-
/* harmony default export */ var version = ('3.0.
|
|
259454
|
+
/* harmony default export */ var version = ('3.0.16');
|
|
259404
259455
|
// EXTERNAL MODULE: ./src/components/controls/poperTipText/PoperTipText.vue + 5 modules
|
|
259405
259456
|
var PoperTipText = __webpack_require__(15845);
|
|
259406
259457
|
;// CONCATENATED MODULE: ./src/components/controls/poperTipText/index.ts
|
|
@@ -259704,9 +259755,9 @@ var defaultHeight = Math.floor(1122 * DrawConfig/* DrawConfig.instance */.f.inst
|
|
|
259704
259755
|
});
|
|
259705
259756
|
},
|
|
259706
259757
|
setActiveDocIndex: function setActiveDocIndex(hoEditorId) {
|
|
259707
|
-
|
|
259708
|
-
|
|
259709
|
-
|
|
259758
|
+
if (hoEditorId !== this.hoEditorProvider.activeDocId) {
|
|
259759
|
+
this.$emit('setActiveDocIndex', hoEditorId);
|
|
259760
|
+
}
|
|
259710
259761
|
},
|
|
259711
259762
|
/**
|
|
259712
259763
|
* 双击弹出层关闭
|
|
@@ -260076,10 +260127,10 @@ var defaultHeight = Math.floor(1122 * DrawConfig/* DrawConfig.instance */.f.inst
|
|
|
260076
260127
|
});
|
|
260077
260128
|
;// CONCATENATED MODULE: ./src/components/HoDoc.vue?vue&type=script&lang=js&
|
|
260078
260129
|
/* harmony default export */ var components_HoDocvue_type_script_lang_js_ = (HoDocvue_type_script_lang_js_);
|
|
260079
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDoc.vue?vue&type=style&index=0&id=
|
|
260130
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDoc.vue?vue&type=style&index=0&id=47dcd5c8&prod&lang=scss&
|
|
260080
260131
|
// extracted by mini-css-extract-plugin
|
|
260081
260132
|
|
|
260082
|
-
;// CONCATENATED MODULE: ./src/components/HoDoc.vue?vue&type=style&index=0&id=
|
|
260133
|
+
;// CONCATENATED MODULE: ./src/components/HoDoc.vue?vue&type=style&index=0&id=47dcd5c8&prod&lang=scss&
|
|
260083
260134
|
|
|
260084
260135
|
;// CONCATENATED MODULE: ./src/components/HoDoc.vue
|
|
260085
260136
|
|
|
@@ -260092,8 +260143,8 @@ var defaultHeight = Math.floor(1122 * DrawConfig/* DrawConfig.instance */.f.inst
|
|
|
260092
260143
|
|
|
260093
260144
|
var HoDoc_component = (0,componentNormalizer/* default */.Z)(
|
|
260094
260145
|
components_HoDocvue_type_script_lang_js_,
|
|
260095
|
-
|
|
260096
|
-
|
|
260146
|
+
HoDocvue_type_template_id_47dcd5c8_render,
|
|
260147
|
+
HoDocvue_type_template_id_47dcd5c8_staticRenderFns,
|
|
260097
260148
|
false,
|
|
260098
260149
|
null,
|
|
260099
260150
|
null,
|
|
@@ -266083,6 +266134,7 @@ var commonParamList = __webpack_require__(30794);
|
|
|
266083
266134
|
|
|
266084
266135
|
|
|
266085
266136
|
|
|
266137
|
+
|
|
266086
266138
|
|
|
266087
266139
|
|
|
266088
266140
|
var VueController = /*#__PURE__*/function () {
|
|
@@ -267224,14 +267276,17 @@ var VueController = /*#__PURE__*/function () {
|
|
|
267224
267276
|
}
|
|
267225
267277
|
}
|
|
267226
267278
|
/**
|
|
267227
|
-
* 插入图片
|
|
267279
|
+
* 插入图片 options参数
|
|
267228
267280
|
* @param imagePath 路径
|
|
267229
267281
|
* @param width 宽
|
|
267230
267282
|
* @param height 高
|
|
267283
|
+
* @param options.rotate 旋转角度
|
|
267284
|
+
* @param options.scale 缩放比例
|
|
267285
|
+
* @param options.isFormula 是否为公式图片
|
|
267231
267286
|
*/
|
|
267232
267287
|
}, {
|
|
267233
267288
|
key: "insertImage",
|
|
267234
|
-
value: function insertImage(imagePath, width, height,
|
|
267289
|
+
value: function insertImage(imagePath, width, height, options) {
|
|
267235
267290
|
var hoEditorFactory = HOEditorFactorys/* HOEditorFactorys.instance */.b.instance().getFactory(this._hoEditorFactoryID);
|
|
267236
267291
|
if (hoEditorFactory.editController.canIsEdit(hoEditorFactory)) {
|
|
267237
267292
|
var _curDomRange = hoEditorFactory.docTree.curDomRange; //获取当前选中区域
|
|
@@ -267239,7 +267294,15 @@ var VueController = /*#__PURE__*/function () {
|
|
|
267239
267294
|
var endPath = _curDomRange.normalize().endPath;
|
|
267240
267295
|
var changingEvent = new NodeChangingEvent/* NodeChangingEvent */.Q(DocTree/* DocAction.daInsert */.gk.daInsert, startPath, endPath, NodeChangingEvent/* OperType.insertImage */.y.insertImage);
|
|
267241
267296
|
if (hoEditorFactory.docTree.changing(changingEvent)) {
|
|
267242
|
-
|
|
267297
|
+
if (options && options.rotate !== undefined) {
|
|
267298
|
+
var bounds = this.getMainBounds(width, height, options.scale);
|
|
267299
|
+
var callback = function callback(path) {
|
|
267300
|
+
hoEditorFactory.docController.insertImage(_curDomRange, path, bounds.imageWidth, bounds.imageHeight, options.isFormula);
|
|
267301
|
+
};
|
|
267302
|
+
(0,plugins_util/* scaleRotateImage */.fu)(imagePath, bounds.imageWidth, bounds.imageHeight, options.rotate, callback);
|
|
267303
|
+
} else {
|
|
267304
|
+
hoEditorFactory.docController.insertImage(_curDomRange, imagePath, width, height, options);
|
|
267305
|
+
}
|
|
267243
267306
|
}
|
|
267244
267307
|
}
|
|
267245
267308
|
}
|
|
@@ -272113,13 +272176,50 @@ var VueController = /*#__PURE__*/function () {
|
|
|
272113
272176
|
}
|
|
272114
272177
|
}, {
|
|
272115
272178
|
key: "getMainBounds",
|
|
272116
|
-
value: function getMainBounds() {
|
|
272179
|
+
value: function getMainBounds(imgWidth, imgHeight, scale) {
|
|
272180
|
+
var bounds = {
|
|
272181
|
+
width: 0,
|
|
272182
|
+
height: 0,
|
|
272183
|
+
imageWidth: 0,
|
|
272184
|
+
imageHeight: 0
|
|
272185
|
+
};
|
|
272117
272186
|
var hoEditorfactory = HOEditorFactorys/* HOEditorFactorys.instance */.b.instance().getFactory(this._hoEditorFactoryID);
|
|
272118
272187
|
var firstPageMainDoc = hoEditorfactory.drawTree.drawPages[0].drawMainDoc;
|
|
272119
|
-
|
|
272120
|
-
|
|
272121
|
-
|
|
272188
|
+
var mathWidth = hoEditorfactory.pageProperty.widthPixes - hoEditorfactory.pageProperty.leftMarginPixes - hoEditorfactory.pageProperty.rightMarginPixes;
|
|
272189
|
+
var mathHeight = hoEditorfactory.pageProperty.heightPixes - hoEditorfactory.pageProperty.topMarginPixes - hoEditorfactory.pageProperty.bottomMarginPixes - 20;
|
|
272190
|
+
bounds = {
|
|
272191
|
+
width: Math.max(mathWidth, firstPageMainDoc.docWidth),
|
|
272192
|
+
height: Math.min(firstPageMainDoc.dHeight, mathHeight),
|
|
272193
|
+
imageWidth: 0,
|
|
272194
|
+
imageHeight: 0
|
|
272122
272195
|
};
|
|
272196
|
+
if (imgWidth && imgHeight) {
|
|
272197
|
+
var widthScale = imgWidth / bounds.width;
|
|
272198
|
+
var heightScale = imgHeight / bounds.height;
|
|
272199
|
+
if (imgWidth > bounds.width && imgHeight <= bounds.height) {
|
|
272200
|
+
bounds.imageWidth = bounds.width;
|
|
272201
|
+
bounds.imageHeight = Math.floor(imgHeight / widthScale);
|
|
272202
|
+
} else if (imgWidth <= bounds.width && imgHeight > bounds.height) {
|
|
272203
|
+
bounds.imageHeight = bounds.height;
|
|
272204
|
+
bounds.imageWidth = Math.floor(imgWidth / heightScale);
|
|
272205
|
+
} else if (imgWidth > bounds.width && imgHeight > bounds.height) {
|
|
272206
|
+
if (widthScale > heightScale) {
|
|
272207
|
+
bounds.imageWidth = Math.floor(imgWidth / widthScale);
|
|
272208
|
+
bounds.imageHeight = Math.floor(imgHeight / widthScale);
|
|
272209
|
+
} else {
|
|
272210
|
+
bounds.imageHeight = Math.floor(imgHeight / heightScale);
|
|
272211
|
+
bounds.imageWidth = Math.floor(imgWidth / heightScale);
|
|
272212
|
+
}
|
|
272213
|
+
} else if (imgWidth <= bounds.width && imgHeight <= bounds.height) {
|
|
272214
|
+
bounds.imageHeight = imgHeight;
|
|
272215
|
+
bounds.imageWidth = imgWidth;
|
|
272216
|
+
}
|
|
272217
|
+
if (scale && scale <= 1) {
|
|
272218
|
+
bounds.imageWidth = bounds.imageWidth * scale;
|
|
272219
|
+
bounds.imageHeight = bounds.imageHeight * scale;
|
|
272220
|
+
}
|
|
272221
|
+
}
|
|
272222
|
+
return bounds;
|
|
272123
272223
|
}
|
|
272124
272224
|
}]);
|
|
272125
272225
|
return VueController;
|
|
@@ -278887,10 +278987,10 @@ var getFormula = function getFormula(tableFormular) {
|
|
|
278887
278987
|
});
|
|
278888
278988
|
;// CONCATENATED MODULE: ./src/components/HoDocs.vue?vue&type=script&lang=js&
|
|
278889
278989
|
/* harmony default export */ var components_HoDocsvue_type_script_lang_js_ = (HoDocsvue_type_script_lang_js_);
|
|
278890
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDocs.vue?vue&type=style&index=0&id=
|
|
278990
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDocs.vue?vue&type=style&index=0&id=d29f666a&prod&lang=scss&media=print&
|
|
278891
278991
|
// extracted by mini-css-extract-plugin
|
|
278892
278992
|
|
|
278893
|
-
;// CONCATENATED MODULE: ./src/components/HoDocs.vue?vue&type=style&index=0&id=
|
|
278993
|
+
;// CONCATENATED MODULE: ./src/components/HoDocs.vue?vue&type=style&index=0&id=d29f666a&prod&lang=scss&media=print&
|
|
278894
278994
|
|
|
278895
278995
|
;// CONCATENATED MODULE: ./src/components/HoDocs.vue
|
|
278896
278996
|
|