fl-web-component 2.1.2 → 2.1.4
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/dist/fl-web-component.common.js +229 -287
- package/dist/fl-web-component.common.js.map +1 -1
- package/dist/fl-web-component.css +1 -1
- package/package.json +1 -1
- package/packages/components/com-flcanvas/components/entityFormatting.js +28 -14
- package/packages/components/com-flcanvas/index.vue +159 -260
- package/packages/components/com-graphics/mock.json +57 -83
|
@@ -2313,6 +2313,13 @@ Factory_1.Factory.addGetterSetter(Node_1.Node, 'kaleidoscopeAngle', 0, (0, Valid
|
|
|
2313
2313
|
|
|
2314
2314
|
/***/ }),
|
|
2315
2315
|
|
|
2316
|
+
/***/ "1d6a":
|
|
2317
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2318
|
+
|
|
2319
|
+
// extracted by mini-css-extract-plugin
|
|
2320
|
+
|
|
2321
|
+
/***/ }),
|
|
2322
|
+
|
|
2316
2323
|
/***/ "1f21":
|
|
2317
2324
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2318
2325
|
|
|
@@ -65997,7 +66004,7 @@ module.exports = document && document.documentElement;
|
|
|
65997
66004
|
/***/ "9224":
|
|
65998
66005
|
/***/ (function(module) {
|
|
65999
66006
|
|
|
66000
|
-
module.exports = JSON.parse("{\"name\":\"fl-web-component\",\"version\":\"2.1.
|
|
66007
|
+
module.exports = JSON.parse("{\"name\":\"fl-web-component\",\"version\":\"2.1.4\",\"scripts\":{\"postinstall\":\"patch-package\",\"tip1\":\"仅调试本组件不涉及业务组件,请执行dev\",\"dev\":\"vue-cli-service serve\",\"lint\":\"eslint \\\"{src,packages}/**/*.{vue,js}\\\" --fix\",\"prettier\":\"prettier --write \\\"packages/**/*.{js,css,less,scss,vue,html}\\\"\",\"=\":\"=============================================================\",\"tip2\":\"同时调试本组件与业务组件,请执行watch,生产模式监听请执行watch:prod\",\"watch\":\"vue-cli-service build --watch --mode development --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"watch:prod\":\"vue-cli-service build --watch --mode production --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build\":\"npm run lint && vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build:test\":\"vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"publish:base\":\"npm run build && npm publish --registry https://registry.npmjs.org/\",\"publish:beta:base\":\"npm run build && npm publish --tag beta --registry https://registry.npmjs.org/\",\"==\":\"=============================================================\",\"tip3\":\"发版注意: 【测试版执行publish:beta】【修改bug执行publish:fix】【新增功能执行publish:feat】【新特性执行publish:perf】\",\"publish:beta\":\"npm version prerelease --preid=beta && npm run publish:beta:base\",\"publish:fix\":\"npm version patch && npm run publish:base\",\"publish:feat\":\"npm version minor && npm run publish:base\",\"publish:perf\":\"npm version major && npm run publish:base\"},\"files\":[\"dist\",\"packages\",\"src\"],\"main\":\"dist/fl-web-component.common.js\",\"dependencies\":{\"camera-controls\":\"2.9.0\",\"core-js\":\"^3.42.0\",\"dxf-parser\":\"^1.1.2\",\"element-ui\":\"2.15.14\",\"fflate\":\"^0.8.2\",\"html2canvas\":\"^1.4.1\",\"jspdf\":\"^3.0.1\",\"konva\":\"^9.3.12\",\"lodash\":\"^4.17.21\",\"meshline\":\"^3.3.1\",\"regenerator-runtime\":\"^0.14.1\",\"svg-pan-zoom\":\"^3.6.2\",\"three\":\"^0.176.0\",\"three.path\":\"^1.0.1\",\"vue\":\"^2.6.11\"},\"devDependencies\":{\"@babel/core\":\"^7.12.16\",\"@babel/plugin-proposal-nullish-coalescing-operator\":\"^7.18.6\",\"@babel/plugin-proposal-optional-chaining\":\"^7.21.0\",\"@babel/preset-env\":\"^7.0.0\",\"@babel/runtime-corejs3\":\"^7.27.1\",\"@vue/cli-plugin-babel\":\"~4.4.0\",\"@vue/cli-plugin-eslint\":\"~4.4.0\",\"@vue/cli-service\":\"~4.4.0\",\"babel-eslint\":\"^10.1.0\",\"babel-loader\":\"^8.0.0\",\"copy-webpack-plugin\":\"^4.0.1\",\"eslint\":\"^6.7.2\",\"eslint-config-prettier\":\"^6.15.0\",\"eslint-plugin-prettier\":\"^3.4.1\",\"eslint-plugin-vue\":\"^6.2.2\",\"patch-package\":\"^6.4.7\",\"prettier\":\"^2.8.8\",\"sass\":\"1.32.13\",\"sass-loader\":\"10.1.1\",\"vue-template-compiler\":\"^2.6.11\",\"worker-loader\":\"^3.0.8\"},\"browserslist\":[\"> 1%\",\"last 2 versions\"]}");
|
|
66001
66008
|
|
|
66002
66009
|
/***/ }),
|
|
66003
66010
|
|
|
@@ -68918,13 +68925,6 @@ var store = global[SHARED] || (global[SHARED] = {});
|
|
|
68918
68925
|
|
|
68919
68926
|
/***/ }),
|
|
68920
68927
|
|
|
68921
|
-
/***/ "b36d":
|
|
68922
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
68923
|
-
|
|
68924
|
-
// extracted by mini-css-extract-plugin
|
|
68925
|
-
|
|
68926
|
-
/***/ }),
|
|
68927
|
-
|
|
68928
68928
|
/***/ "b5e0":
|
|
68929
68929
|
/***/ (function(module, exports) {
|
|
68930
68930
|
|
|
@@ -69071,17 +69071,6 @@ module.exports = __webpack_require__("5524").Object.assign;
|
|
|
69071
69071
|
|
|
69072
69072
|
module.exports = __webpack_require__("051b");
|
|
69073
69073
|
|
|
69074
|
-
/***/ }),
|
|
69075
|
-
|
|
69076
|
-
/***/ "ba73":
|
|
69077
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
69078
|
-
|
|
69079
|
-
"use strict";
|
|
69080
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_11780588_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("b36d");
|
|
69081
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_11780588_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_11780588_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
|
|
69082
|
-
/* unused harmony reexport * */
|
|
69083
|
-
|
|
69084
|
-
|
|
69085
69074
|
/***/ }),
|
|
69086
69075
|
|
|
69087
69076
|
/***/ "bbce":
|
|
@@ -87663,6 +87652,17 @@ module.exports = {
|
|
|
87663
87652
|
__esModule: true
|
|
87664
87653
|
};
|
|
87665
87654
|
|
|
87655
|
+
/***/ }),
|
|
87656
|
+
|
|
87657
|
+
/***/ "f8f3":
|
|
87658
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
87659
|
+
|
|
87660
|
+
"use strict";
|
|
87661
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_525e15e8_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1d6a");
|
|
87662
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_525e15e8_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_525e15e8_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
|
|
87663
|
+
/* unused harmony reexport * */
|
|
87664
|
+
|
|
87665
|
+
|
|
87666
87666
|
/***/ }),
|
|
87667
87667
|
|
|
87668
87668
|
/***/ "f8f9":
|
|
@@ -88142,7 +88142,7 @@ if (typeof window !== 'undefined') {
|
|
|
88142
88142
|
// Indicate to webpack that this file can be concatenated
|
|
88143
88143
|
/* harmony default export */ var setPublicPath = (null);
|
|
88144
88144
|
|
|
88145
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
88145
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"2220037a-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/index.vue?vue&type=template&id=b87e98f6&scoped=true
|
|
88146
88146
|
var com_graphicsvue_type_template_id_b87e98f6_scoped_true_render = function render() {
|
|
88147
88147
|
var _vm = this,
|
|
88148
88148
|
_c = _vm._self._c;
|
|
@@ -139522,8 +139522,8 @@ var component = normalizeComponent(
|
|
|
139522
139522
|
)
|
|
139523
139523
|
|
|
139524
139524
|
/* harmony default export */ var com_graphics = (component.exports);
|
|
139525
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
139526
|
-
var
|
|
139525
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"2220037a-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-flcanvas/index.vue?vue&type=template&id=525e15e8&scoped=true
|
|
139526
|
+
var com_flcanvasvue_type_template_id_525e15e8_scoped_true_render = function render() {
|
|
139527
139527
|
var _vm = this,
|
|
139528
139528
|
_c = _vm._self._c;
|
|
139529
139529
|
return _c('div', {
|
|
@@ -139536,9 +139536,9 @@ var com_flcanvasvue_type_template_id_11780588_scoped_true_render = function rend
|
|
|
139536
139536
|
}
|
|
139537
139537
|
});
|
|
139538
139538
|
};
|
|
139539
|
-
var
|
|
139539
|
+
var com_flcanvasvue_type_template_id_525e15e8_scoped_true_staticRenderFns = [];
|
|
139540
139540
|
|
|
139541
|
-
// CONCATENATED MODULE: ./packages/components/com-flcanvas/index.vue?vue&type=template&id=
|
|
139541
|
+
// CONCATENATED MODULE: ./packages/components/com-flcanvas/index.vue?vue&type=template&id=525e15e8&scoped=true
|
|
139542
139542
|
|
|
139543
139543
|
// EXTERNAL MODULE: ./node_modules/konva/lib/index.js
|
|
139544
139544
|
var lib = __webpack_require__("362d");
|
|
@@ -144761,7 +144761,7 @@ function drawArc(recordDxf, entity, group, key, configParams) {
|
|
|
144761
144761
|
var hex = rgb.hex;
|
|
144762
144762
|
var startAngle, endAngle;
|
|
144763
144763
|
if (hex == '#FFFFFF') {
|
|
144764
|
-
hex = '#
|
|
144764
|
+
hex = '#000000';
|
|
144765
144765
|
}
|
|
144766
144766
|
if (entity.type === 'CIRCLE') {
|
|
144767
144767
|
startAngle = entity.startAngle || 0;
|
|
@@ -144799,7 +144799,7 @@ function drawArc(recordDxf, entity, group, key, configParams) {
|
|
|
144799
144799
|
// entityId: key,
|
|
144800
144800
|
// isGroup: false,
|
|
144801
144801
|
// points: list,
|
|
144802
|
-
// stroke: configParams ? configParams.color : "#
|
|
144802
|
+
// stroke: configParams ? configParams.color : "#000000",
|
|
144803
144803
|
// customColor: configParams ? configParams.color : "",
|
|
144804
144804
|
// strokeWidth: width,
|
|
144805
144805
|
// lineCap: "round",
|
|
@@ -144810,6 +144810,12 @@ function drawArc(recordDxf, entity, group, key, configParams) {
|
|
|
144810
144810
|
// group.add(line);
|
|
144811
144811
|
}
|
|
144812
144812
|
function drawEllpse(recordDxf, entity, group, key, configParams) {
|
|
144813
|
+
var color = entity.color;
|
|
144814
|
+
var rgb = decimalToRGBHex(color);
|
|
144815
|
+
var hex = rgb.hex;
|
|
144816
|
+
if (hex == '#FFFFFF') {
|
|
144817
|
+
hex = '#000000';
|
|
144818
|
+
}
|
|
144813
144819
|
var xrad = Math.sqrt(Math.pow(parseFloat(entity.majorAxisEndPoint.x), 2) + Math.pow(parseFloat(entity.majorAxisEndPoint.y), 2));
|
|
144814
144820
|
var yrad = xrad * parseFloat(entity.axisRatio);
|
|
144815
144821
|
var rotation = Math.atan2(parseFloat(entity.majorAxisEndPoint.y), parseFloat(entity.majorAxisEndPoint.x));
|
|
@@ -144828,8 +144834,8 @@ function drawEllpse(recordDxf, entity, group, key, configParams) {
|
|
|
144828
144834
|
points: list,
|
|
144829
144835
|
name: key.replace(/\s*/g, ''),
|
|
144830
144836
|
entityId: key,
|
|
144831
|
-
stroke: configParams ? configParams.color :
|
|
144832
|
-
customColor: configParams ? configParams.color :
|
|
144837
|
+
stroke: configParams ? configParams.color : hex,
|
|
144838
|
+
customColor: configParams ? configParams.color : hex,
|
|
144833
144839
|
strokeWidth: width,
|
|
144834
144840
|
visible: configParams ? configParams.visible : true,
|
|
144835
144841
|
oldstrokeLength: width,
|
|
@@ -144840,7 +144846,7 @@ function drawEllpse(recordDxf, entity, group, key, configParams) {
|
|
|
144840
144846
|
// entityId: key,
|
|
144841
144847
|
// isGroup: false,
|
|
144842
144848
|
// points: list,
|
|
144843
|
-
// stroke: configParams ? configParams.color : "#
|
|
144849
|
+
// stroke: configParams ? configParams.color : "#000000",
|
|
144844
144850
|
// customColor: configParams ? configParams.color : "",
|
|
144845
144851
|
// strokeWidth: width,
|
|
144846
144852
|
// lineCap: "round",
|
|
@@ -144855,6 +144861,9 @@ function drawLine(recordDxf, entity, group, key, configParams) {
|
|
|
144855
144861
|
var color = entity.color;
|
|
144856
144862
|
var rgb = decimalToRGBHex(color);
|
|
144857
144863
|
var hex = rgb.hex;
|
|
144864
|
+
if (hex == '#FFFFFF') {
|
|
144865
|
+
hex = '#000000';
|
|
144866
|
+
}
|
|
144858
144867
|
var x1 = entity.vertices[0].x;
|
|
144859
144868
|
var y1 = entity.vertices[0].y;
|
|
144860
144869
|
var x2 = entity.vertices[1].x;
|
|
@@ -144884,7 +144893,7 @@ function drawLine(recordDxf, entity, group, key, configParams) {
|
|
|
144884
144893
|
// entityId: key,
|
|
144885
144894
|
// isGroup: false,
|
|
144886
144895
|
// points: [x1, -parseFloat(y1), parseFloat(x2), -parseFloat(y2)],
|
|
144887
|
-
// stroke: configParams ? configParams.color : "#
|
|
144896
|
+
// stroke: configParams ? configParams.color : "#000000",
|
|
144888
144897
|
// customColor: configParams ? configParams.color : "",
|
|
144889
144898
|
// strokeWidth: width,
|
|
144890
144899
|
// //lineCap: "round",
|
|
@@ -144902,7 +144911,7 @@ function entityFormatting_drawText(recordDxf, entity, group, key, configParams)
|
|
|
144902
144911
|
var rgb = decimalToRGBHex(color);
|
|
144903
144912
|
var hex = rgb.hex;
|
|
144904
144913
|
if (hex == '#FFFFFF') {
|
|
144905
|
-
hex = '#
|
|
144914
|
+
hex = '#000000';
|
|
144906
144915
|
}
|
|
144907
144916
|
var text = entity.text;
|
|
144908
144917
|
var fontSize = entity.textHeight;
|
|
@@ -144987,13 +144996,12 @@ function entityFormatting_drawText(recordDxf, entity, group, key, configParams)
|
|
|
144987
144996
|
});
|
|
144988
144997
|
// group.add(dim);
|
|
144989
144998
|
}
|
|
144990
|
-
function drawHatch(recordDxf, entity, group, key, configParams) {}
|
|
144991
144999
|
function drawLwLine(recordDxf, entity, group, key, configParams, lineTypes) {
|
|
144992
145000
|
var color = entity.color;
|
|
144993
145001
|
var rgb = decimalToRGBHex(color);
|
|
144994
145002
|
var hex = rgb.hex;
|
|
144995
145003
|
if (hex == '#FFFFFF') {
|
|
144996
|
-
hex = '#
|
|
145004
|
+
hex = '#000000';
|
|
144997
145005
|
}
|
|
144998
145006
|
var closed = entity.shape;
|
|
144999
145007
|
var list = [];
|
|
@@ -145053,6 +145061,12 @@ function drawLwLine(recordDxf, entity, group, key, configParams, lineTypes) {
|
|
|
145053
145061
|
}
|
|
145054
145062
|
}
|
|
145055
145063
|
function drawSpline(recordDxf, entity, group, key, configParams) {
|
|
145064
|
+
var color = entity.color;
|
|
145065
|
+
var rgb = decimalToRGBHex(color);
|
|
145066
|
+
var hex = rgb.hex;
|
|
145067
|
+
if (hex == '#FFFFFF') {
|
|
145068
|
+
hex = '#000000';
|
|
145069
|
+
}
|
|
145056
145070
|
var points = getBSplinePolyline(entity.controlPoints, entity.degreeOfSplineCurve, entity.knotValues, 100);
|
|
145057
145071
|
var list = [];
|
|
145058
145072
|
for (var i = 0; i < points.length; i++) {
|
|
@@ -145066,8 +145080,8 @@ function drawSpline(recordDxf, entity, group, key, configParams) {
|
|
|
145066
145080
|
name: key.replace(/\s*/g, ''),
|
|
145067
145081
|
entityId: key,
|
|
145068
145082
|
isGroup: false,
|
|
145069
|
-
stroke: configParams ? configParams :
|
|
145070
|
-
customColor: configParams ? configParams.color :
|
|
145083
|
+
stroke: configParams ? configParams : hex,
|
|
145084
|
+
customColor: configParams ? configParams.color : hex,
|
|
145071
145085
|
strokeWidth: width,
|
|
145072
145086
|
visible: configParams ? configParams.visible : true,
|
|
145073
145087
|
oldstrokeLength: width
|
|
@@ -145077,7 +145091,7 @@ function drawSpline(recordDxf, entity, group, key, configParams) {
|
|
|
145077
145091
|
// entityId: key,
|
|
145078
145092
|
// isGroup: false,
|
|
145079
145093
|
// points: list,
|
|
145080
|
-
// stroke: configParams ? configParams : "#
|
|
145094
|
+
// stroke: configParams ? configParams : "#000000",
|
|
145081
145095
|
// customColor: configParams ? configParams.color : "",
|
|
145082
145096
|
// strokeWidth: width,
|
|
145083
145097
|
// lineCap: "round",
|
|
@@ -145945,6 +145959,7 @@ function downloadPDF(base64, fileName) {
|
|
|
145945
145959
|
});
|
|
145946
145960
|
_this2.konvaStage.on('click', function (e) {
|
|
145947
145961
|
var target = _this2.konvaStage.mouseClickEndShape;
|
|
145962
|
+
console.log(e);
|
|
145948
145963
|
_this2.$emit('leftClick', target ? target.attrs : null);
|
|
145949
145964
|
});
|
|
145950
145965
|
});
|
|
@@ -145968,7 +145983,8 @@ function downloadPDF(base64, fileName) {
|
|
|
145968
145983
|
x: scale,
|
|
145969
145984
|
y: scale
|
|
145970
145985
|
});
|
|
145971
|
-
|
|
145986
|
+
|
|
145987
|
+
// this.konvaStage.batchDraw();
|
|
145972
145988
|
}
|
|
145973
145989
|
},
|
|
145974
145990
|
calculateScaleAndPosition: function calculateScaleAndPosition(contentBounds, stageWidth, stageHeight) {
|
|
@@ -146061,23 +146077,95 @@ function downloadPDF(base64, fileName) {
|
|
|
146061
146077
|
},
|
|
146062
146078
|
//思路是计算居中包围盒,然后排除脏数据。
|
|
146063
146079
|
loadDxf: function loadDxf(data) {
|
|
146064
|
-
var
|
|
146065
|
-
_this$$refs$
|
|
146066
|
-
|
|
146067
|
-
var _this = this;
|
|
146080
|
+
var _this$$refs$svgDraw,
|
|
146081
|
+
_this$$refs$svgDraw2,
|
|
146082
|
+
_this3 = this;
|
|
146068
146083
|
this.bounds = null;
|
|
146069
146084
|
this.konvaLayer.destroyChildren();
|
|
146070
|
-
var
|
|
146071
|
-
|
|
146072
|
-
// 在这里处理数据为空的时候
|
|
146073
|
-
if (dxf.entities.length === 0) {
|
|
146085
|
+
var flag = this.formatDrawData(data, 'updateBounds');
|
|
146086
|
+
if (!flag) {
|
|
146074
146087
|
this.$emit('error', {
|
|
146075
146088
|
type: 'entityEmpty'
|
|
146076
146089
|
});
|
|
146077
146090
|
return;
|
|
146078
146091
|
}
|
|
146092
|
+
|
|
146093
|
+
//缩放视口
|
|
146094
|
+
var scale = 1;
|
|
146095
|
+
var boundingRect = this.konvaLayer.getClientRect();
|
|
146096
|
+
var ratio = Number((((_this$$refs$svgDraw = this.$refs.svgDraw) === null || _this$$refs$svgDraw === void 0 ? void 0 : _this$$refs$svgDraw.clientWidth) / boundingRect.width).toFixed(1));
|
|
146097
|
+
if (ratio > 2) {
|
|
146098
|
+
scale = Number((boundingRect.width / boundingRect.height).toFixed(1));
|
|
146099
|
+
scale = scale < 2 ? 2 : scale;
|
|
146100
|
+
}
|
|
146101
|
+
var boundingScale = this.konvaLayer.getClientRect();
|
|
146102
|
+
//平移视口
|
|
146103
|
+
var x = ((_this$$refs$svgDraw2 = this.$refs.svgDraw) === null || _this$$refs$svgDraw2 === void 0 ? void 0 : _this$$refs$svgDraw2.clientWidth) / 2 - (Math.ceil(boundingScale.width) / 2 + boundingScale.x / 2);
|
|
146104
|
+
var y = this.$refs.svgDraw.clientHeight / 2 - (Math.ceil(boundingScale.height) / 2 + boundingScale.y);
|
|
146105
|
+
|
|
146106
|
+
// this.konvaStage.scale({
|
|
146107
|
+
// x: 2,
|
|
146108
|
+
// y: 2,
|
|
146109
|
+
// });
|
|
146110
|
+
// this.konvaStage.setX(0);
|
|
146111
|
+
// this.konvaStage.setY(750); // 750
|
|
146112
|
+
|
|
146113
|
+
// this.activedSvgPan.zoom.x = 0;
|
|
146114
|
+
// this.activedSvgPan.zoom.y = 750;
|
|
146115
|
+
// this.activedSvgPan.x = x;
|
|
146116
|
+
// this.activedSvgPan.y = x;
|
|
146117
|
+
setTimeout(function () {
|
|
146118
|
+
_this3.centerDraw();
|
|
146119
|
+
_this3.$emit('loaded');
|
|
146120
|
+
}, 100);
|
|
146121
|
+
},
|
|
146122
|
+
toPdf: function toPdf(name) {
|
|
146123
|
+
//this.konvaStage.scale({
|
|
146124
|
+
//x: this.activedSvgPan.zoom.x,
|
|
146125
|
+
//y: this.activedSvgPan.zoom.y,
|
|
146126
|
+
//});
|
|
146127
|
+
//this.konvaStage.setX(this.activedSvgPan.x);
|
|
146128
|
+
//this.konvaStage.setY(this.activedSvgPan.y);
|
|
146129
|
+
// get data URL with default settings
|
|
146130
|
+
|
|
146131
|
+
// open in new window
|
|
146132
|
+
this.konvaLayer.getCanvas().setPixelRatio(2);
|
|
146133
|
+
var jpegURL = this.konvaStage.toDataURL({
|
|
146134
|
+
mimeType: 'image/jpeg',
|
|
146135
|
+
quality: 1,
|
|
146136
|
+
pixelRatio: 2
|
|
146137
|
+
});
|
|
146138
|
+
var pageData = this.konvaLayer.canvas.toDataURL('image/jpeg', 2);
|
|
146139
|
+
var img = new Image();
|
|
146140
|
+
img.src = jpegURL;
|
|
146141
|
+
var pdf = new jspdf_es_min["a" /* default */]('l', 'px', [this.konvaStage.width(), this.konvaStage.height()]);
|
|
146142
|
+
pdf.addImage(this.konvaStage.toDataURL({
|
|
146143
|
+
pixelRatio: 2
|
|
146144
|
+
}), 0, 0, this.konvaStage.width(), this.konvaStage.height());
|
|
146145
|
+
pdf.save(name + '.pdf');
|
|
146146
|
+
// var imgData = canvas.toDataURL('image/png');
|
|
146147
|
+
//doc.text("Hello world!", 10, 10);
|
|
146148
|
+
//doc.save("a4.pdf");
|
|
146149
|
+
},
|
|
146150
|
+
// 处理图纸数据
|
|
146151
|
+
formatDrawData: function formatDrawData(data, fn) {
|
|
146152
|
+
var _this4 = this;
|
|
146153
|
+
var _this = this;
|
|
146079
146154
|
var parser2 = new dxf_parser_DxfParser_DxfParser();
|
|
146080
146155
|
var dxf2 = parser2.parseSync(data);
|
|
146156
|
+
// const parser = new DxfParser();
|
|
146157
|
+
// let dxf = parser.parse(data);
|
|
146158
|
+
// 在这里处理数据为空的时候
|
|
146159
|
+
// if (dxf.entities.length === 0) {
|
|
146160
|
+
// this.$emit('error', {
|
|
146161
|
+
// type: 'entityEmpty'
|
|
146162
|
+
// })
|
|
146163
|
+
// return
|
|
146164
|
+
// }
|
|
146165
|
+
if (dxf2.entities.length === 0) {
|
|
146166
|
+
return false;
|
|
146167
|
+
}
|
|
146168
|
+
console.log(dxf2);
|
|
146081
146169
|
var hatchEntitys = dxf2.entities.filter(function (item) {
|
|
146082
146170
|
return item.type === 'HATCH';
|
|
146083
146171
|
});
|
|
@@ -146216,7 +146304,7 @@ function downloadPDF(base64, fileName) {
|
|
|
146216
146304
|
// }
|
|
146217
146305
|
}
|
|
146218
146306
|
//加载图纸
|
|
146219
|
-
var entities = formatEntity(
|
|
146307
|
+
var entities = formatEntity(dxf2.entities);
|
|
146220
146308
|
for (var key in entities) {
|
|
146221
146309
|
if (entities[key]) {
|
|
146222
146310
|
var group = [];
|
|
@@ -146225,7 +146313,7 @@ function downloadPDF(base64, fileName) {
|
|
|
146225
146313
|
var _configParams = _layerConfig && Object.keys(_layerConfig).length > 0 ? _layerConfig : null;
|
|
146226
146314
|
for (var _i3 = 0; _i3 < l; _i3++) {
|
|
146227
146315
|
var type = entities[key][_i3].type;
|
|
146228
|
-
handleFn(type,
|
|
146316
|
+
handleFn(type, dxf2, entities[key][_i3], group, key, _configParams, this.konvaLayer, dxf2.tables.lineType.lineTypes
|
|
146229
146317
|
// this.recordLayerConfig
|
|
146230
146318
|
);
|
|
146231
146319
|
}
|
|
@@ -146240,9 +146328,6 @@ function downloadPDF(base64, fileName) {
|
|
|
146240
146328
|
return item.type !== 'text';
|
|
146241
146329
|
});
|
|
146242
146330
|
if (shapeGroup.length > 0) {
|
|
146243
|
-
// if (group[0]?.stroke) {
|
|
146244
|
-
// group[0].stroke = '#000';
|
|
146245
|
-
// }
|
|
146246
146331
|
// 根据颜色分组
|
|
146247
146332
|
var colorGroup = lodash_default.a.groupBy(shapeGroup, 'stroke');
|
|
146248
146333
|
var _loop = function _loop() {
|
|
@@ -146276,8 +146361,8 @@ function downloadPDF(base64, fileName) {
|
|
|
146276
146361
|
var v2 = {};
|
|
146277
146362
|
v2.x = x2;
|
|
146278
146363
|
v2.y = y2;
|
|
146279
|
-
_this
|
|
146280
|
-
_this
|
|
146364
|
+
_this[fn](v1);
|
|
146365
|
+
_this[fn](v2);
|
|
146281
146366
|
}
|
|
146282
146367
|
if (_entity3.type === 'polyline') {
|
|
146283
146368
|
context.strokeStyle = _entity3.stroke;
|
|
@@ -146287,16 +146372,16 @@ function downloadPDF(base64, fileName) {
|
|
|
146287
146372
|
for (var _j = 0; _j < points.length; _j++) {
|
|
146288
146373
|
var index = _j % 2;
|
|
146289
146374
|
if (index === 0) {
|
|
146290
|
-
var
|
|
146291
|
-
var
|
|
146375
|
+
var x = points[_j];
|
|
146376
|
+
var y = points[_j + 1];
|
|
146292
146377
|
var point = {};
|
|
146293
|
-
point.x =
|
|
146294
|
-
point.y =
|
|
146295
|
-
_this
|
|
146378
|
+
point.x = x;
|
|
146379
|
+
point.y = y;
|
|
146380
|
+
_this[fn](point);
|
|
146296
146381
|
if (_j === 0) {
|
|
146297
|
-
context.moveTo(
|
|
146382
|
+
context.moveTo(x, y);
|
|
146298
146383
|
} else {
|
|
146299
|
-
context.lineTo(
|
|
146384
|
+
context.lineTo(x, y);
|
|
146300
146385
|
}
|
|
146301
146386
|
}
|
|
146302
146387
|
if (closed) {
|
|
@@ -146315,7 +146400,12 @@ function downloadPDF(base64, fileName) {
|
|
|
146315
146400
|
},
|
|
146316
146401
|
shapeType: 'shape'
|
|
146317
146402
|
});
|
|
146318
|
-
if (
|
|
146403
|
+
if (_this4.konvaLayer) {
|
|
146404
|
+
_this4.konvaLayer.add(customShape);
|
|
146405
|
+
// 直接在这里调用draw 能拿到最新数据 不执行的话 就会导致最后执行 导致bounds的数据出错
|
|
146406
|
+
_this4.konvaLayer.draw();
|
|
146407
|
+
}
|
|
146408
|
+
;
|
|
146319
146409
|
};
|
|
146320
146410
|
for (var colorKey in colorGroup) {
|
|
146321
146411
|
_loop();
|
|
@@ -146323,244 +146413,96 @@ function downloadPDF(base64, fileName) {
|
|
|
146323
146413
|
}
|
|
146324
146414
|
}
|
|
146325
146415
|
}
|
|
146326
|
-
|
|
146327
|
-
var scale = 1;
|
|
146328
|
-
var boundingRect = this.konvaLayer.getClientRect();
|
|
146329
|
-
var ratio = Number((((_this$$refs$svgDraw = this.$refs.svgDraw) === null || _this$$refs$svgDraw === void 0 ? void 0 : _this$$refs$svgDraw.clientWidth) / boundingRect.width).toFixed(1));
|
|
146330
|
-
if (ratio > 2) {
|
|
146331
|
-
scale = Number((boundingRect.width / boundingRect.height).toFixed(1));
|
|
146332
|
-
scale = scale < 2 ? 2 : scale;
|
|
146333
|
-
}
|
|
146334
|
-
// this.konvaStage.scale({
|
|
146335
|
-
// x: scale,
|
|
146336
|
-
// y: scale,
|
|
146337
|
-
//})
|
|
146338
|
-
var boundingScale = this.konvaLayer.getClientRect();
|
|
146339
|
-
//平移视口
|
|
146340
|
-
var x = ((_this$$refs$svgDraw2 = this.$refs.svgDraw) === null || _this$$refs$svgDraw2 === void 0 ? void 0 : _this$$refs$svgDraw2.clientWidth) / 2 - (Math.ceil(boundingScale.width) / 2 + boundingScale.x / 2);
|
|
146341
|
-
var y = this.$refs.svgDraw.clientHeight / 2 - (Math.ceil(boundingScale.height) / 2 + boundingScale.y);
|
|
146342
|
-
|
|
146343
|
-
// this.konvaStage.scale({
|
|
146344
|
-
// x: 2,
|
|
146345
|
-
// y: 2,
|
|
146346
|
-
// });
|
|
146347
|
-
// this.konvaStage.setX(0);
|
|
146348
|
-
// this.konvaStage.setY(750); // 750
|
|
146349
|
-
|
|
146350
|
-
// this.activedSvgPan.zoom.x = 0;
|
|
146351
|
-
// this.activedSvgPan.zoom.y = 750;
|
|
146352
|
-
// this.activedSvgPan.x = x;
|
|
146353
|
-
// this.activedSvgPan.y = x;
|
|
146354
|
-
setTimeout(function () {
|
|
146355
|
-
_this3.centerDraw();
|
|
146356
|
-
_this3.$emit('loaded');
|
|
146357
|
-
}, 100);
|
|
146358
|
-
},
|
|
146359
|
-
toPdf: function toPdf(name) {
|
|
146360
|
-
//this.konvaStage.scale({
|
|
146361
|
-
//x: this.activedSvgPan.zoom.x,
|
|
146362
|
-
//y: this.activedSvgPan.zoom.y,
|
|
146363
|
-
//});
|
|
146364
|
-
//this.konvaStage.setX(this.activedSvgPan.x);
|
|
146365
|
-
//this.konvaStage.setY(this.activedSvgPan.y);
|
|
146366
|
-
// get data URL with default settings
|
|
146367
|
-
|
|
146368
|
-
// open in new window
|
|
146369
|
-
this.konvaLayer.getCanvas().setPixelRatio(2);
|
|
146370
|
-
var jpegURL = this.konvaStage.toDataURL({
|
|
146371
|
-
mimeType: 'image/jpeg',
|
|
146372
|
-
quality: 1,
|
|
146373
|
-
pixelRatio: 2
|
|
146374
|
-
});
|
|
146375
|
-
var pageData = this.konvaLayer.canvas.toDataURL('image/jpeg', 2);
|
|
146376
|
-
var img = new Image();
|
|
146377
|
-
img.src = jpegURL;
|
|
146378
|
-
var pdf = new jspdf_es_min["a" /* default */]('l', 'px', [this.konvaStage.width(), this.konvaStage.height()]);
|
|
146379
|
-
pdf.addImage(this.konvaStage.toDataURL({
|
|
146380
|
-
pixelRatio: 2
|
|
146381
|
-
}), 0, 0, this.konvaStage.width(), this.konvaStage.height());
|
|
146382
|
-
pdf.save(name + '.pdf');
|
|
146383
|
-
// var imgData = canvas.toDataURL('image/png');
|
|
146384
|
-
//doc.text("Hello world!", 10, 10);
|
|
146385
|
-
//doc.save("a4.pdf");
|
|
146416
|
+
return true;
|
|
146386
146417
|
},
|
|
146387
146418
|
toPdfs: function toPdfs(list) {
|
|
146388
|
-
var
|
|
146389
|
-
var _this = this;
|
|
146419
|
+
var _this5 = this;
|
|
146390
146420
|
return new Promise(function (resolve, reject) {
|
|
146391
|
-
var pdf = new jspdf_es_min["a" /* default */]('l', 'px', [
|
|
146421
|
+
var pdf = new jspdf_es_min["a" /* default */]('l', 'px', [_this5.konvaStage.width(), _this5.konvaStage.height()]);
|
|
146392
146422
|
var exportPixelRatio = 2; // 可以 2/3/4 自己调
|
|
146393
146423
|
var index = 0;
|
|
146394
|
-
|
|
146395
|
-
|
|
146424
|
+
var length = list.length;
|
|
146425
|
+
do {
|
|
146426
|
+
var data = list[index];
|
|
146396
146427
|
//先绘制图面
|
|
146397
|
-
|
|
146398
|
-
|
|
146399
|
-
var
|
|
146400
|
-
|
|
146401
|
-
|
|
146402
|
-
var
|
|
146403
|
-
//先计算包围
|
|
146404
|
-
for (var key in entities) {
|
|
146405
|
-
if (entities[key]) {
|
|
146406
|
-
var group = [];
|
|
146407
|
-
var l = entities[key].length;
|
|
146408
|
-
var layerConfig = _this4.recordLayerConfig[key];
|
|
146409
|
-
var configParams = layerConfig && Object.keys(layerConfig).length > 0 ? layerConfig : null;
|
|
146410
|
-
for (var i = 0; i < l; i++) {
|
|
146411
|
-
var type = entities[key][i].type;
|
|
146412
|
-
handleFn(type, dxf, entities[key][i], group, key, configParams, _this4.konvaLayer, _this4.recordLayerConfig);
|
|
146413
|
-
}
|
|
146414
|
-
for (var _i6 = 0; _i6 < group.length; _i6++) {
|
|
146415
|
-
var entity = group[_i6];
|
|
146416
|
-
if (entity.type === 'line') {
|
|
146417
|
-
var x1 = entity.x1;
|
|
146418
|
-
var y1 = entity.y1;
|
|
146419
|
-
var x2 = entity.x2;
|
|
146420
|
-
var y2 = entity.y2;
|
|
146421
|
-
var v1 = {};
|
|
146422
|
-
v1.x = x1;
|
|
146423
|
-
v1.y = y1;
|
|
146424
|
-
var v2 = {};
|
|
146425
|
-
v2.x = x2;
|
|
146426
|
-
v2.y = y2;
|
|
146427
|
-
_this.updateBounds1(v1);
|
|
146428
|
-
_this.updateBounds1(v2);
|
|
146429
|
-
}
|
|
146430
|
-
if (entity.type === 'polyline') {
|
|
146431
|
-
var flag = false;
|
|
146432
|
-
var points = entity.points;
|
|
146433
|
-
var closed = entity.closed;
|
|
146434
|
-
for (var j = 0; j < points.length; j++) {
|
|
146435
|
-
var _index = j % 2;
|
|
146436
|
-
if (_index === 0) {
|
|
146437
|
-
var _x2 = points[j];
|
|
146438
|
-
var _y2 = points[j + 1];
|
|
146439
|
-
var point = {};
|
|
146440
|
-
point.x = _x2;
|
|
146441
|
-
point.y = _y2;
|
|
146442
|
-
_this.updateBounds1(point);
|
|
146443
|
-
}
|
|
146444
|
-
}
|
|
146445
|
-
}
|
|
146446
|
-
}
|
|
146447
|
-
}
|
|
146448
|
-
}
|
|
146449
|
-
var _loop2 = function _loop2() {
|
|
146450
|
-
if (entities[_key]) {
|
|
146451
|
-
var _group = [];
|
|
146452
|
-
var _l = entities[_key].length;
|
|
146453
|
-
var _layerConfig2 = _this4.recordLayerConfig[_key];
|
|
146454
|
-
var _configParams2 = _layerConfig2 && Object.keys(_layerConfig2).length > 0 ? _layerConfig2 : null;
|
|
146455
|
-
for (var _i7 = 0; _i7 < _l; _i7++) {
|
|
146456
|
-
var _type = entities[_key][_i7].type;
|
|
146457
|
-
handleFn(_type, dxf, entities[_key][_i7], _group, _key, _configParams2, _this4.konvaLayer, _this4.recordLayerConfig);
|
|
146458
|
-
}
|
|
146459
|
-
if (!_this4.konvaLayer) return {
|
|
146460
|
-
v: void 0
|
|
146461
|
-
};
|
|
146462
|
-
for (var _i8 = 0; _i8 < _group.length; _i8++) {
|
|
146463
|
-
var _entity4 = _group[_i8];
|
|
146464
|
-
if (_entity4.type === 'text') {
|
|
146465
|
-
if (_this4.konvaLayer) _this4.konvaLayer.add(_entity4.obj);
|
|
146466
|
-
}
|
|
146467
|
-
}
|
|
146468
|
-
if (_group.length > 0) {
|
|
146469
|
-
var _group$;
|
|
146470
|
-
if ((_group$ = _group[0]) !== null && _group$ !== void 0 && _group$.stroke) {
|
|
146471
|
-
_group[0].stroke = '#000';
|
|
146472
|
-
}
|
|
146473
|
-
var customShape = new lib_default.a.Shape({
|
|
146474
|
-
x: 0,
|
|
146475
|
-
y: 0,
|
|
146476
|
-
strokeWidth: 0.2,
|
|
146477
|
-
name: _key.replace(/\s*/g, ''),
|
|
146478
|
-
entityId: _key,
|
|
146479
|
-
stroke: _group[0].stroke,
|
|
146480
|
-
customColor: _configParams2 ? _configParams2.color : '',
|
|
146481
|
-
//visible: configParams ? configParams.visible :true,
|
|
146482
|
-
sceneFunc: function sceneFunc(context, shape) {
|
|
146483
|
-
context.beginPath();
|
|
146484
|
-
for (var _i9 = 0; _i9 < _group.length; _i9++) {
|
|
146485
|
-
var _entity5 = _group[_i9];
|
|
146486
|
-
if (_entity5.type === 'line') {
|
|
146487
|
-
context.strokeStyle = _entity5.stroke;
|
|
146488
|
-
var _x3 = _entity5.x1;
|
|
146489
|
-
var _y3 = _entity5.y1;
|
|
146490
|
-
var _x4 = _entity5.x2;
|
|
146491
|
-
var _y4 = _entity5.y2;
|
|
146492
|
-
if (_x3 != undefined && _y3 != undefined && _x4 != undefined && _y4 != undefined) {
|
|
146493
|
-
context.moveTo(_x3, -parseFloat(_y3));
|
|
146494
|
-
context.lineTo(_x4, -parseFloat(_y4));
|
|
146495
|
-
}
|
|
146496
|
-
}
|
|
146497
|
-
if (_entity5.type === 'polyline') {
|
|
146498
|
-
context.strokeStyle = _entity5.stroke;
|
|
146499
|
-
var _flag = false;
|
|
146500
|
-
var _points = _entity5.points;
|
|
146501
|
-
var _closed = _entity5.closed;
|
|
146502
|
-
for (var _j2 = 0; _j2 < _points.length; _j2++) {
|
|
146503
|
-
var _index2 = _j2 % 2;
|
|
146504
|
-
if (_index2 === 0) {
|
|
146505
|
-
var _x5 = _points[_j2];
|
|
146506
|
-
var _y5 = _points[_j2 + 1];
|
|
146507
|
-
if (_j2 === 0) {
|
|
146508
|
-
context.moveTo(_x5, _y5);
|
|
146509
|
-
} else {
|
|
146510
|
-
context.lineTo(_x5, _y5);
|
|
146511
|
-
}
|
|
146512
|
-
}
|
|
146513
|
-
if (_closed) {
|
|
146514
|
-
if (_j2 === _points.length - 1) {
|
|
146515
|
-
context.lineTo(_points[0], _points[1]);
|
|
146516
|
-
}
|
|
146517
|
-
}
|
|
146518
|
-
}
|
|
146519
|
-
}
|
|
146520
|
-
}
|
|
146521
|
-
// context.closePath();
|
|
146522
|
-
context.fillStrokeShape(shape);
|
|
146523
|
-
}
|
|
146524
|
-
});
|
|
146525
|
-
if (_this4.konvaLayer) _this4.konvaLayer.add(customShape);
|
|
146526
|
-
}
|
|
146527
|
-
}
|
|
146528
|
-
},
|
|
146529
|
-
_ret;
|
|
146530
|
-
for (var _key in entities) {
|
|
146531
|
-
_ret = _loop2();
|
|
146532
|
-
if (_ret) return _ret.v;
|
|
146533
|
-
}
|
|
146534
|
-
var _this4$calculateScale = _this4.calculateScaleAndPosition(_this.bounds1, _this4.konvaStage.width(), _this4.konvaStage.height(), 0.05 // 5% 边距
|
|
146428
|
+
|
|
146429
|
+
_this5.konvaLayer.destroyChildren();
|
|
146430
|
+
var flag = _this5.formatDrawData(data, 'updateBounds1');
|
|
146431
|
+
// 这步还没执行完就执行下面的代码了
|
|
146432
|
+
if (flag) {
|
|
146433
|
+
var _this5$calculateScale = _this5.calculateScaleAndPosition(_this5.bounds1, _this5.konvaStage.width(), _this5.konvaStage.height(), 0.05 // 5% 边距
|
|
146535
146434
|
),
|
|
146536
|
-
scale =
|
|
146537
|
-
x =
|
|
146538
|
-
y =
|
|
146539
|
-
|
|
146540
|
-
|
|
146435
|
+
scale = _this5$calculateScale.scale,
|
|
146436
|
+
x = _this5$calculateScale.x,
|
|
146437
|
+
y = _this5$calculateScale.y;
|
|
146438
|
+
_this5.bounds1 = null;
|
|
146439
|
+
_this5.konvaStage.position({
|
|
146541
146440
|
x: x,
|
|
146542
146441
|
y: y
|
|
146543
146442
|
});
|
|
146544
|
-
|
|
146443
|
+
_this5.konvaStage.scale({
|
|
146545
146444
|
x: scale,
|
|
146546
146445
|
y: scale
|
|
146547
146446
|
});
|
|
146548
|
-
|
|
146447
|
+
|
|
146448
|
+
// this.konvaStage.batchDraw();
|
|
146549
146449
|
//添加成功移动视口位置 pageIdx === 0
|
|
146550
146450
|
|
|
146551
146451
|
if (index === 0) {
|
|
146552
|
-
pdf.addImage(
|
|
146452
|
+
pdf.addImage(_this5.konvaStage.toDataURL({
|
|
146553
146453
|
pixelRatio: 2
|
|
146554
|
-
}), 0, 0,
|
|
146454
|
+
}), 0, 0, _this5.konvaStage.width(), _this5.konvaStage.height());
|
|
146555
146455
|
} else {
|
|
146556
146456
|
pdf.addPage();
|
|
146557
|
-
pdf.addImage(
|
|
146457
|
+
pdf.addImage(_this5.konvaStage.toDataURL({
|
|
146558
146458
|
pixelRatio: 2
|
|
146559
|
-
}), 0, 0,
|
|
146459
|
+
}), 0, 0, _this5.konvaStage.width(), _this5.konvaStage.height());
|
|
146560
146460
|
}
|
|
146561
146461
|
index++;
|
|
146562
146462
|
}
|
|
146563
|
-
}
|
|
146463
|
+
} while (index < length);
|
|
146464
|
+
// for (let pageIdx = 0; pageIdx < list.length; pageIdx++) {
|
|
146465
|
+
// let data = list[pageIdx];
|
|
146466
|
+
// //先绘制图面
|
|
146467
|
+
// this.bounds1 = null;
|
|
146468
|
+
// this.konvaLayer.destroyChildren();
|
|
146469
|
+
// let flag = this.formatDrawData(data, 'updateBounds1')
|
|
146470
|
+
// // 这步还没执行完就执行下面的代码了
|
|
146471
|
+
// if (flag) {
|
|
146472
|
+
// const { scale, x, y } = this.calculateScaleAndPosition(
|
|
146473
|
+
// this.bounds1,
|
|
146474
|
+
// this.konvaStage.width(),
|
|
146475
|
+
// this.konvaStage.height(),
|
|
146476
|
+
// 0.05 // 5% 边距
|
|
146477
|
+
// );
|
|
146478
|
+
// this.konvaStage.position({ x: x, y: y });
|
|
146479
|
+
// this.konvaStage.scale({ x: scale, y: scale });
|
|
146480
|
+
|
|
146481
|
+
// this.konvaStage.batchDraw();
|
|
146482
|
+
// //添加成功移动视口位置 pageIdx === 0
|
|
146483
|
+
|
|
146484
|
+
// if (index === 0) {
|
|
146485
|
+
// pdf.addImage(
|
|
146486
|
+
// this.konvaStage.toDataURL({ pixelRatio: 2 }),
|
|
146487
|
+
// 0,
|
|
146488
|
+
// 0,
|
|
146489
|
+
// this.konvaStage.width(),
|
|
146490
|
+
// this.konvaStage.height()
|
|
146491
|
+
// );
|
|
146492
|
+
// } else {
|
|
146493
|
+
// pdf.addPage();
|
|
146494
|
+
// pdf.addImage(
|
|
146495
|
+
// this.konvaStage.toDataURL({ pixelRatio: 2 }),
|
|
146496
|
+
// 0,
|
|
146497
|
+
// 0,
|
|
146498
|
+
// this.konvaStage.width(),
|
|
146499
|
+
// this.konvaStage.height()
|
|
146500
|
+
// );
|
|
146501
|
+
// }
|
|
146502
|
+
// index++
|
|
146503
|
+
// }
|
|
146504
|
+
|
|
146505
|
+
// }
|
|
146564
146506
|
if (index > 0) {
|
|
146565
146507
|
pdf.save('批量导出.pdf');
|
|
146566
146508
|
resolve();
|
|
@@ -146584,16 +146526,16 @@ function downloadPDF(base64, fileName) {
|
|
|
146584
146526
|
},
|
|
146585
146527
|
// 更改图纸的色系 区分明暗两种 darkness 暗色系 bright 明亮
|
|
146586
146528
|
setColorScheme: function setColorScheme(colorType) {
|
|
146587
|
-
var
|
|
146529
|
+
var _this6 = this;
|
|
146588
146530
|
// const backgroundColor = colorType === "darkness" ? "#000" : "transparent";
|
|
146589
146531
|
var color = colorType === 'darkness' ? '#fff' : '#000';
|
|
146590
146532
|
// konvaStage.container().style.background = backgroundColor;
|
|
146591
146533
|
this.konvaLayer.children.forEach(function (item) {
|
|
146592
|
-
|
|
146534
|
+
_this6.traverseLayer(item, color);
|
|
146593
146535
|
});
|
|
146594
146536
|
},
|
|
146595
146537
|
traverseLayer: function traverseLayer(obj, color) {
|
|
146596
|
-
var
|
|
146538
|
+
var _this7 = this;
|
|
146597
146539
|
if (!obj.attrs.isGroup) {
|
|
146598
146540
|
if (color === '#fff') {
|
|
146599
146541
|
var setColor = obj.attrs.customColor === '#000' || obj.attrs.customColor === '#000000' || obj.attrs.customColor === 'rgb(0, 0, 0)' || obj.attrs.customColor === 'rgba(0, 0, 0, 1)' ? color : obj.attrs.customColor;
|
|
@@ -146612,7 +146554,7 @@ function downloadPDF(base64, fileName) {
|
|
|
146612
146554
|
}
|
|
146613
146555
|
} else {
|
|
146614
146556
|
obj.children.forEach(function (item) {
|
|
146615
|
-
|
|
146557
|
+
_this7.traverseLayer(item, color);
|
|
146616
146558
|
});
|
|
146617
146559
|
}
|
|
146618
146560
|
}
|
|
@@ -146623,8 +146565,8 @@ function downloadPDF(base64, fileName) {
|
|
|
146623
146565
|
});
|
|
146624
146566
|
// CONCATENATED MODULE: ./packages/components/com-flcanvas/index.vue?vue&type=script&lang=js
|
|
146625
146567
|
/* harmony default export */ var components_com_flcanvasvue_type_script_lang_js = (com_flcanvasvue_type_script_lang_js);
|
|
146626
|
-
// EXTERNAL MODULE: ./packages/components/com-flcanvas/index.vue?vue&type=style&index=0&id=
|
|
146627
|
-
var
|
|
146568
|
+
// EXTERNAL MODULE: ./packages/components/com-flcanvas/index.vue?vue&type=style&index=0&id=525e15e8&prod&lang=scss&scoped=true
|
|
146569
|
+
var com_flcanvasvue_type_style_index_0_id_525e15e8_prod_lang_scss_scoped_true = __webpack_require__("f8f3");
|
|
146628
146570
|
|
|
146629
146571
|
// CONCATENATED MODULE: ./packages/components/com-flcanvas/index.vue
|
|
146630
146572
|
|
|
@@ -146637,17 +146579,17 @@ var com_flcanvasvue_type_style_index_0_id_11780588_prod_lang_scss_scoped_true =
|
|
|
146637
146579
|
|
|
146638
146580
|
var com_flcanvas_component = normalizeComponent(
|
|
146639
146581
|
components_com_flcanvasvue_type_script_lang_js,
|
|
146640
|
-
|
|
146641
|
-
|
|
146582
|
+
com_flcanvasvue_type_template_id_525e15e8_scoped_true_render,
|
|
146583
|
+
com_flcanvasvue_type_template_id_525e15e8_scoped_true_staticRenderFns,
|
|
146642
146584
|
false,
|
|
146643
146585
|
null,
|
|
146644
|
-
"
|
|
146586
|
+
"525e15e8",
|
|
146645
146587
|
null
|
|
146646
146588
|
|
|
146647
146589
|
)
|
|
146648
146590
|
|
|
146649
146591
|
/* harmony default export */ var com_flcanvas = (com_flcanvas_component.exports);
|
|
146650
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
146592
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"2220037a-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/per-control.vue?vue&type=template&id=f547d5c6&scoped=true
|
|
146651
146593
|
var per_controlvue_type_template_id_f547d5c6_scoped_true_render = function render() {
|
|
146652
146594
|
var _vm = this,
|
|
146653
146595
|
_c = _vm._self._c;
|
|
@@ -146755,7 +146697,7 @@ var per_control_component = normalizeComponent(
|
|
|
146755
146697
|
)
|
|
146756
146698
|
|
|
146757
146699
|
/* harmony default export */ var per_control = (per_control_component.exports);
|
|
146758
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
146700
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"2220037a-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/pid.vue?vue&type=template&id=2572c0e2&scoped=true
|
|
146759
146701
|
var pidvue_type_template_id_2572c0e2_scoped_true_render = function render() {
|
|
146760
146702
|
var _vm = this,
|
|
146761
146703
|
_c = _vm._self._c;
|
|
@@ -146802,7 +146744,7 @@ var browserify_default = /*#__PURE__*/__webpack_require__.n(browserify);
|
|
|
146802
146744
|
var html2canvas = __webpack_require__("c0e9");
|
|
146803
146745
|
var html2canvas_default = /*#__PURE__*/__webpack_require__.n(html2canvas);
|
|
146804
146746
|
|
|
146805
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
146747
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"2220037a-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/component/ann-tool.vue?vue&type=template&id=4b17bce0&scoped=true
|
|
146806
146748
|
var ann_toolvue_type_template_id_4b17bce0_scoped_true_render = function render() {
|
|
146807
146749
|
var _vm = this,
|
|
146808
146750
|
_c = _vm._self._c;
|