fl-web-component 1.0.10 → 1.0.12
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/README.md +47 -25
- package/dist/fl-web-component.common.1.js +10906 -10863
- package/dist/fl-web-component.common.2.js +340 -329
- package/dist/fl-web-component.common.3.js +7642 -7742
- package/dist/fl-web-component.common.js +30557 -19371
- package/dist/fl-web-component.css +1 -1
- package/package.json +7 -19
- package/packages/components/com-flcanvas/index.vue +58 -9
- package/src/main.js +1 -0
- package/dist/demo.html +0 -10
- package/dist/fl-web-component.umd.1.js +0 -13216
- package/dist/fl-web-component.umd.2.js +0 -1358
- package/dist/fl-web-component.umd.3.js +0 -7839
- package/dist/fl-web-component.umd.js +0 -47631
- package/dist/fl-web-component.umd.min.1.js +0 -16
- package/dist/fl-web-component.umd.min.2.js +0 -3
- package/dist/fl-web-component.umd.min.3.js +0 -21
- package/dist/fl-web-component.umd.min.js +0 -301
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";#fl-model[data-v-6e37e043],#konva-container[data-v-
|
|
1
|
+
@charset "UTF-8";#fl-model[data-v-6e37e043],#konva-container[data-v-300b3063]{width:100%;height:100%;cursor:pointer}#konva-container[data-v-300b3063]{z-index:3;overflow:hidden}span[data-v-f547d5c6]{font-weight:bolder}.text[data-v-f547d5c6]{margin-top:20px}.line[data-v-f547d5c6]{border-bottom:1px solid #dcdfe6;margin:20px 0}.center[data-v-f547d5c6]{display:flex;flex-direction:column;align-items:center}.center .cen span[data-v-f547d5c6],.center .top span[data-v-f547d5c6]{color:"#53a8ff";display:inline-block;width:30px;height:30px;text-align:center;line-height:30px;border:1px solid;padding:5px;margin-bottom:10px;background-color:#e9f3ff}.center .cen span[data-v-f547d5c6]{margin:10px}.button[data-v-f547d5c6]{display:flex;justify-content:end;margin-top:20px}@font-face{font-family:iconfont;src:url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.woff2?t=1646635700216) format("woff2"),url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.woff?t=1646635700216) format("woff"),url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.ttf?t=1646635700216) format("truetype")}.iconfont[data-v-f547d5c6]{font-family:iconfont!important;font-size:50px;font-style:normal;color:"#53a8ff";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-shubiao[data-v-f547d5c6]:before{content:""}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fl-web-component",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vue-cli-service serve",
|
|
6
6
|
"lint": "eslint \"{src,packages}/**/*.{vue,js}\" --fix",
|
|
7
7
|
"prettier": "prettier --write \"packages/**/*.{js,css,less,scss,vue,html}\"",
|
|
8
|
-
"watch": "
|
|
9
|
-
"build": "npm run lint && vue-cli-service build --target lib --name fl-web-component ./src/main.js",
|
|
8
|
+
"watch": "vue-cli-service build --watch --mode production --target lib --name fl-web-component --formats commonjs ./src/main.js",
|
|
9
|
+
"build": "npm run lint && vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js",
|
|
10
|
+
"build:test": "vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js",
|
|
10
11
|
"publish": "npm run build && npm publish"
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
"main": "dist/fl-web-component.common.js",
|
|
19
20
|
"dependencies": {
|
|
20
21
|
"camera-controls": "^2.9.0",
|
|
21
|
-
"core-js": "^3.
|
|
22
|
+
"core-js": "^3.42.0",
|
|
22
23
|
"dxf-parser": "^1.1.2",
|
|
23
24
|
"element-ui": "2.15.14",
|
|
24
25
|
"html2canvas": "^1.4.1",
|
|
@@ -26,28 +27,15 @@
|
|
|
26
27
|
"konva": "^9.3.14",
|
|
27
28
|
"lodash": "^4.17.21",
|
|
28
29
|
"meshline": "^3.3.1",
|
|
30
|
+
"regenerator-runtime": "^0.14.1",
|
|
29
31
|
"three": "^0.176.0",
|
|
30
32
|
"three.path": "^1.0.1",
|
|
31
33
|
"vue": "^2.6.11"
|
|
32
34
|
},
|
|
33
35
|
"devDependencies": {
|
|
34
36
|
"@babel/core": "^7.12.16",
|
|
35
|
-
"@babel/plugin-proposal-class-properties": "^7.0.0",
|
|
36
|
-
"@babel/plugin-proposal-decorators": "^7.0.0",
|
|
37
|
-
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
|
|
38
|
-
"@babel/plugin-proposal-function-sent": "^7.0.0",
|
|
39
|
-
"@babel/plugin-proposal-json-strings": "^7.0.0",
|
|
40
|
-
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
|
|
41
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
|
|
42
|
-
"@babel/plugin-proposal-optional-chaining": "^7.17.12",
|
|
43
|
-
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
|
|
44
|
-
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
|
45
|
-
"@babel/plugin-syntax-import-meta": "^7.0.0",
|
|
46
|
-
"@babel/plugin-syntax-jsx": "^7.17.12",
|
|
47
|
-
"@babel/plugin-transform-object-rest-spread": "^7.25.9",
|
|
48
|
-
"@babel/plugin-transform-runtime": "^7.0.0",
|
|
49
37
|
"@babel/preset-env": "^7.0.0",
|
|
50
|
-
"@babel/runtime-
|
|
38
|
+
"@babel/runtime-corejs3": "^7.27.1",
|
|
51
39
|
"@vue/cli-plugin-babel": "~4.4.0",
|
|
52
40
|
"@vue/cli-plugin-eslint": "~4.4.0",
|
|
53
41
|
"@vue/cli-service": "~4.4.0",
|
|
@@ -4,6 +4,26 @@
|
|
|
4
4
|
</template>
|
|
5
5
|
|
|
6
6
|
<script>
|
|
7
|
+
function base64ToBlob(base64) {
|
|
8
|
+
const byteCharacters = atob(base64);
|
|
9
|
+
const byteArrays = [];
|
|
10
|
+
|
|
11
|
+
for (let offset = 0; offset < byteCharacters.length; offset += 512) {
|
|
12
|
+
const slice = byteCharacters.slice(offset, offset + 512);
|
|
13
|
+
const byteNumbers = new Array(slice.length);
|
|
14
|
+
for (let i = 0; i < slice.length; i++) {
|
|
15
|
+
byteNumbers[i] = slice.charCodeAt(i);
|
|
16
|
+
}
|
|
17
|
+
const byteArray = new Uint8Array(byteNumbers);
|
|
18
|
+
byteArrays.push(byteArray);
|
|
19
|
+
}
|
|
20
|
+
return new Blob(byteArrays, { type: 'application/pdf' });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
function createObjectURL(blob) {
|
|
25
|
+
return URL.createObjectURL(blob);
|
|
26
|
+
}
|
|
7
27
|
|
|
8
28
|
|
|
9
29
|
|
|
@@ -100,11 +120,21 @@
|
|
|
100
120
|
|
|
101
121
|
methods: {
|
|
102
122
|
loadDxf(data){
|
|
123
|
+
|
|
124
|
+
console.log("ok");
|
|
125
|
+
|
|
103
126
|
const parser = new DxfParser();
|
|
104
127
|
let dxf = parser.parse(data);
|
|
105
128
|
let entities = formatEntity(dxf.entities);
|
|
129
|
+
|
|
130
|
+
console.log(entities);
|
|
131
|
+
|
|
106
132
|
let layers = dxf.tables.layer.layers;
|
|
107
133
|
//加载图纸
|
|
134
|
+
|
|
135
|
+
console.log("layers");
|
|
136
|
+
console.log(layers);
|
|
137
|
+
|
|
108
138
|
for (let key in layers) {
|
|
109
139
|
if (entities[key]) {
|
|
110
140
|
let group = [];
|
|
@@ -142,12 +172,25 @@
|
|
|
142
172
|
let y1=entity.y1;
|
|
143
173
|
let x2=entity.x2;
|
|
144
174
|
let y2=entity.y2;
|
|
145
|
-
|
|
146
|
-
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
if(x1!=undefined&&y1!=undefined&&x2!=undefined&&y2!=undefined) {
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
context.moveTo(x1, -parseFloat(y1));
|
|
181
|
+
context.lineTo(x2, -parseFloat(y2));
|
|
182
|
+
}
|
|
147
183
|
}
|
|
148
184
|
if(entity.type === "polyline"){
|
|
185
|
+
let flag=false;
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
149
189
|
let points=entity.points;
|
|
150
190
|
let closed = entity.closed;
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
151
194
|
for(let j = 0; j < points.length; j++){
|
|
152
195
|
let index = j % 2;
|
|
153
196
|
if(index === 0){
|
|
@@ -183,10 +226,11 @@
|
|
|
183
226
|
scale = Number((boundingRect.width / boundingRect.height).toFixed(1));
|
|
184
227
|
scale = scale < 2 ? 2 : scale
|
|
185
228
|
}
|
|
229
|
+
/*
|
|
186
230
|
konvaStage.scale({
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
})
|
|
231
|
+
x: scale,
|
|
232
|
+
y: scale,
|
|
233
|
+
})*/
|
|
190
234
|
const boundingScale = konvaLayer.getClientRect();
|
|
191
235
|
//平移视口
|
|
192
236
|
const x =
|
|
@@ -195,14 +239,19 @@
|
|
|
195
239
|
const y =
|
|
196
240
|
this.$refs.svgDraw.clientHeight / 2 -
|
|
197
241
|
(Math.ceil(boundingScale.height) / 2 + boundingScale.y);
|
|
198
|
-
|
|
199
|
-
konvaStage.
|
|
242
|
+
|
|
243
|
+
konvaStage.scale({
|
|
244
|
+
x:2,
|
|
245
|
+
y:2
|
|
246
|
+
})
|
|
247
|
+
// konvaStage.setX(x);
|
|
248
|
+
konvaStage.setY(750);
|
|
200
249
|
|
|
201
250
|
|
|
202
251
|
|
|
203
252
|
|
|
204
253
|
},
|
|
205
|
-
toPdf(){
|
|
254
|
+
toPdf(name){
|
|
206
255
|
// get data URL with default settings
|
|
207
256
|
|
|
208
257
|
// open in new window
|
|
@@ -228,7 +277,7 @@
|
|
|
228
277
|
konvaStage.height()
|
|
229
278
|
);
|
|
230
279
|
|
|
231
|
-
pdf.save(
|
|
280
|
+
pdf.save(name+".pdf");
|
|
232
281
|
// var imgData = canvas.toDataURL('image/png');
|
|
233
282
|
//doc.text("Hello world!", 10, 10);
|
|
234
283
|
//doc.save("a4.pdf");
|
package/src/main.js
CHANGED
|
@@ -2,6 +2,7 @@ import FlModel from '../packages/components/com-graphics/index.vue';
|
|
|
2
2
|
import Fl2dcanvas from '../packages/components/com-flcanvas/index.vue';
|
|
3
3
|
import FLPerControl from '../packages/components/com-graphics/per-control.vue';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
+
|
|
5
6
|
const components = [
|
|
6
7
|
FlModel,
|
|
7
8
|
Fl2dcanvas,
|
package/dist/demo.html
DELETED