fl-web-component 0.1.0
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 +24 -0
- package/dist/demo.html +10 -0
- package/dist/fl-web-component.common.js +316 -0
- package/dist/fl-web-component.common.js.map +1 -0
- package/dist/fl-web-component.css +1 -0
- package/dist/fl-web-component.umd.js +326 -0
- package/dist/fl-web-component.umd.js.map +1 -0
- package/dist/fl-web-component.umd.min.js +2 -0
- package/dist/fl-web-component.umd.min.js.map +1 -0
- package/package.json +47 -0
- package/packages/components/button/index.vue +22 -0
- package/packages/components/model/api/index.js +429 -0
- package/packages/components/model/api/mock/detecttree.js +58 -0
- package/packages/components/model/api/mock/getmodel-line.js +79336 -0
- package/packages/components/model/api/mock/init.js +1 -0
- package/packages/components/model/api/mock/pbstree.js +835 -0
- package/packages/components/model/api/mock/topology.json +3238 -0
- package/packages/components/model/components/TextOverTooltip/index.vue +84 -0
- package/packages/components/model/components/annotation-toolbar.vue +425 -0
- package/packages/components/model/components/check-proofing-model.vue +42 -0
- package/packages/components/model/components/clipping-type.vue +51 -0
- package/packages/components/model/components/com-dialogWrapper/Readme.md +53 -0
- package/packages/components/model/components/com-dialogWrapper/index.vue +117 -0
- package/packages/components/model/components/detect-panel.vue +327 -0
- package/packages/components/model/components/detect-tree.vue +460 -0
- package/packages/components/model/components/firstPer-panel.vue +111 -0
- package/packages/components/model/components/header-button.vue +546 -0
- package/packages/components/model/components/imageViewer/index.vue +127 -0
- package/packages/components/model/components/import-model.vue +127 -0
- package/packages/components/model/components/location-panel.vue +95 -0
- package/packages/components/model/components/measure-type.vue +59 -0
- package/packages/components/model/components/pbs-tree.vue +502 -0
- package/packages/components/model/components/proof-config.vue +80 -0
- package/packages/components/model/components/proof-for-pc.vue +123 -0
- package/packages/components/model/components/proof-history.vue +318 -0
- package/packages/components/model/components/proof-panel-detail.vue +567 -0
- package/packages/components/model/components/proof-panel.vue +770 -0
- package/packages/components/model/components/proof-project-user.vue +482 -0
- package/packages/components/model/components/proof-publish.vue +130 -0
- package/packages/components/model/components/proof-role.vue +535 -0
- package/packages/components/model/components/props-panel.vue +249 -0
- package/packages/components/model/index.vue +3413 -0
- package/packages/components/model/readme.md +31 -0
- package/packages/components/model/utils/annotation-tool.js +340 -0
- package/packages/components/model/utils/cursor.js +18 -0
- package/packages/components/model/utils/detect-v1.js +341 -0
- package/packages/components/model/utils/index.js +48 -0
- package/packages/components/model/utils/threejs/measure-angle.js +258 -0
- package/packages/components/model/utils/threejs/measure-area.js +269 -0
- package/packages/components/model/utils/threejs/measure-distance.js +207 -0
- package/packages/components/model/utils/threejs/measure-volume.js +94 -0
- package/packages/index.js +24 -0
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="header-button">
|
|
3
|
+
<el-tooltip
|
|
4
|
+
class="item"
|
|
5
|
+
effect="dark"
|
|
6
|
+
content="返回"
|
|
7
|
+
placement="top-start"
|
|
8
|
+
>
|
|
9
|
+
<el-button class="back" size="small" @click="$router.go(-1)" icon="el-icon-back"></el-button>
|
|
10
|
+
</el-tooltip>
|
|
11
|
+
<div class="left">
|
|
12
|
+
<el-tooltip
|
|
13
|
+
class="item"
|
|
14
|
+
effect="dark"
|
|
15
|
+
content="PBS树"
|
|
16
|
+
placement="top-start"
|
|
17
|
+
>
|
|
18
|
+
<div
|
|
19
|
+
:class="[
|
|
20
|
+
'btn-item',
|
|
21
|
+
'pbstree',
|
|
22
|
+
btnActived['pbsTree'] ? 'el-button-actived' : '',
|
|
23
|
+
proofingModel ? '' : 'icon-disabeld'
|
|
24
|
+
]"
|
|
25
|
+
@click="rightOperation('pbsTree')"
|
|
26
|
+
></div>
|
|
27
|
+
</el-tooltip>
|
|
28
|
+
<div class="split-line"></div>
|
|
29
|
+
<el-tooltip
|
|
30
|
+
class="item"
|
|
31
|
+
effect="dark"
|
|
32
|
+
content="属性"
|
|
33
|
+
placement="top-start"
|
|
34
|
+
>
|
|
35
|
+
<div
|
|
36
|
+
:class="[
|
|
37
|
+
'btn-item',
|
|
38
|
+
'property',
|
|
39
|
+
btnActived['property'] ? 'el-button-actived' : '',
|
|
40
|
+
proofingModel ? '' : 'icon-disabeld',
|
|
41
|
+
]"
|
|
42
|
+
@click="rightOperation('property')"
|
|
43
|
+
style="margin-right: 0px;"
|
|
44
|
+
></div>
|
|
45
|
+
</el-tooltip>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="left">
|
|
48
|
+
<el-tooltip
|
|
49
|
+
class="item"
|
|
50
|
+
effect="dark"
|
|
51
|
+
content="校审"
|
|
52
|
+
placement="top-start"
|
|
53
|
+
>
|
|
54
|
+
<div
|
|
55
|
+
:class="[
|
|
56
|
+
'btn-item',
|
|
57
|
+
'proof',
|
|
58
|
+
btnActived['proof'] ? 'el-button-actived' : '',
|
|
59
|
+
proofingModel ? '' : 'icon-disabeld',
|
|
60
|
+
|
|
61
|
+
]"
|
|
62
|
+
@click="rightOperation('proof')"
|
|
63
|
+
></div>
|
|
64
|
+
</el-tooltip>
|
|
65
|
+
<el-tooltip
|
|
66
|
+
class="item"
|
|
67
|
+
effect="dark"
|
|
68
|
+
content="碰撞检查"
|
|
69
|
+
placement="top-start"
|
|
70
|
+
>
|
|
71
|
+
<div
|
|
72
|
+
:class="[
|
|
73
|
+
'btn-item',
|
|
74
|
+
'detect',
|
|
75
|
+
btnActived['detect'] ? 'el-button-actived' : '',
|
|
76
|
+
proofingModel ? '' : 'icon-disabeld',
|
|
77
|
+
|
|
78
|
+
]"
|
|
79
|
+
@click="rightOperation('detect')"
|
|
80
|
+
></div>
|
|
81
|
+
</el-tooltip>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="left">
|
|
84
|
+
<el-tooltip
|
|
85
|
+
class="item"
|
|
86
|
+
effect="dark"
|
|
87
|
+
content="剖切"
|
|
88
|
+
placement="top-start"
|
|
89
|
+
:disabled="openClipping"
|
|
90
|
+
>
|
|
91
|
+
<div
|
|
92
|
+
:class="[
|
|
93
|
+
'btn-item',
|
|
94
|
+
'clip',
|
|
95
|
+
'popover-layout',
|
|
96
|
+
btnActived['clip'] ? 'el-button-actived' : '',
|
|
97
|
+
proofingModel ? '' : 'icon-disabeld',
|
|
98
|
+
|
|
99
|
+
]"
|
|
100
|
+
@click="clickClip('clipping')"
|
|
101
|
+
>
|
|
102
|
+
<div class="popover-container" v-if="openClipping">
|
|
103
|
+
<el-tooltip
|
|
104
|
+
class="item"
|
|
105
|
+
effect="dark"
|
|
106
|
+
content="全局剖切"
|
|
107
|
+
placement="top-start"
|
|
108
|
+
>
|
|
109
|
+
<div
|
|
110
|
+
:class="[
|
|
111
|
+
'btn-item',
|
|
112
|
+
'clipping-all',
|
|
113
|
+
btnActived['clippingAll'] ? 'el-button-actived' : '',
|
|
114
|
+
]"
|
|
115
|
+
@click.stop="rightOperation('clipping-all')"
|
|
116
|
+
></div
|
|
117
|
+
></el-tooltip>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</el-tooltip>
|
|
121
|
+
<el-tooltip
|
|
122
|
+
class="item"
|
|
123
|
+
effect="dark"
|
|
124
|
+
content="测量"
|
|
125
|
+
placement="top-start"
|
|
126
|
+
:disabled="openMeasure"
|
|
127
|
+
>
|
|
128
|
+
<div
|
|
129
|
+
:class="[
|
|
130
|
+
'btn-item',
|
|
131
|
+
'measure',
|
|
132
|
+
'popover-layout',
|
|
133
|
+
btnActived['measure'] ? 'el-button-actived' : '',
|
|
134
|
+
proofingModel ? '' : 'icon-disabeld',
|
|
135
|
+
|
|
136
|
+
]"
|
|
137
|
+
@click="clickMeasure('measure')"
|
|
138
|
+
>
|
|
139
|
+
<div class="popover-container" v-if="openMeasure">
|
|
140
|
+
<el-tooltip
|
|
141
|
+
class="item"
|
|
142
|
+
effect="dark"
|
|
143
|
+
content="长度"
|
|
144
|
+
placement="top-start"
|
|
145
|
+
>
|
|
146
|
+
<div
|
|
147
|
+
:class="[
|
|
148
|
+
'btn-item',
|
|
149
|
+
'distance',
|
|
150
|
+
btnActived['distance'] ? 'el-button-actived' : '',
|
|
151
|
+
]"
|
|
152
|
+
@click.stop="rightOperation('distance')"
|
|
153
|
+
></div
|
|
154
|
+
></el-tooltip>
|
|
155
|
+
<el-tooltip
|
|
156
|
+
class="item"
|
|
157
|
+
effect="dark"
|
|
158
|
+
content="面积"
|
|
159
|
+
placement="top-start"
|
|
160
|
+
>
|
|
161
|
+
<div
|
|
162
|
+
:class="[
|
|
163
|
+
'btn-item',
|
|
164
|
+
'area',
|
|
165
|
+
btnActived['area'] ? 'el-button-actived' : '',
|
|
166
|
+
]"
|
|
167
|
+
@click.stop="rightOperation('area')"
|
|
168
|
+
></div
|
|
169
|
+
></el-tooltip>
|
|
170
|
+
<el-tooltip
|
|
171
|
+
class="item"
|
|
172
|
+
effect="dark"
|
|
173
|
+
content="角度"
|
|
174
|
+
placement="top-start"
|
|
175
|
+
>
|
|
176
|
+
<div
|
|
177
|
+
:class="[
|
|
178
|
+
'btn-item',
|
|
179
|
+
'angle',
|
|
180
|
+
btnActived['angle'] ? 'el-button-actived' : '',
|
|
181
|
+
]"
|
|
182
|
+
@click.stop="rightOperation('angle')"
|
|
183
|
+
></div
|
|
184
|
+
></el-tooltip>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
</el-tooltip>
|
|
188
|
+
<el-tooltip
|
|
189
|
+
class="item"
|
|
190
|
+
effect="dark"
|
|
191
|
+
content="批注"
|
|
192
|
+
placement="top-start"
|
|
193
|
+
>
|
|
194
|
+
<div
|
|
195
|
+
:class="[
|
|
196
|
+
'btn-item',
|
|
197
|
+
'annotate',
|
|
198
|
+
btnActived['annotate'] ? 'el-button-actived' : '',
|
|
199
|
+
]"
|
|
200
|
+
@click="rightOperation('annotate')"
|
|
201
|
+
></div>
|
|
202
|
+
</el-tooltip>
|
|
203
|
+
<el-tooltip
|
|
204
|
+
class="item"
|
|
205
|
+
effect="dark"
|
|
206
|
+
content="第一视角"
|
|
207
|
+
placement="top-start"
|
|
208
|
+
>
|
|
209
|
+
<div
|
|
210
|
+
:class="[
|
|
211
|
+
'btn-item',
|
|
212
|
+
'first-person',
|
|
213
|
+
btnActived['firstPerson'] ? 'el-button-actived' : '',
|
|
214
|
+
proofingModel ? '' : 'icon-disabeld',
|
|
215
|
+
|
|
216
|
+
]"
|
|
217
|
+
@click="rightOperation('first-person')"
|
|
218
|
+
></div>
|
|
219
|
+
</el-tooltip>
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
</template>
|
|
223
|
+
<script>
|
|
224
|
+
export default {
|
|
225
|
+
name: 'HeaderButton',
|
|
226
|
+
components: {
|
|
227
|
+
// Item: () => import('@/layout/components/Sidebar/Item.vue')
|
|
228
|
+
},
|
|
229
|
+
props: {
|
|
230
|
+
currentRoute: {
|
|
231
|
+
type: String,
|
|
232
|
+
default: '',
|
|
233
|
+
},
|
|
234
|
+
drawName: {
|
|
235
|
+
type: String,
|
|
236
|
+
default: '',
|
|
237
|
+
},
|
|
238
|
+
btnVisiable: {
|
|
239
|
+
type: Object,
|
|
240
|
+
default() {
|
|
241
|
+
return {
|
|
242
|
+
obj: true,
|
|
243
|
+
menu: true,
|
|
244
|
+
mainView: true,
|
|
245
|
+
light: true,
|
|
246
|
+
mark: true,
|
|
247
|
+
search: true,
|
|
248
|
+
inspection: true,
|
|
249
|
+
continue: true,
|
|
250
|
+
property: true,
|
|
251
|
+
visiable: true,
|
|
252
|
+
layer: true,
|
|
253
|
+
};
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
closeRightOperationType: {
|
|
257
|
+
type: Object,
|
|
258
|
+
default() {
|
|
259
|
+
return {
|
|
260
|
+
type: '',
|
|
261
|
+
close: false,
|
|
262
|
+
};
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
proofingModel:{
|
|
266
|
+
type: Boolean,
|
|
267
|
+
default: false,
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
data() {
|
|
271
|
+
return {
|
|
272
|
+
rightType: '',
|
|
273
|
+
type: '',
|
|
274
|
+
openMeasure: false,
|
|
275
|
+
lightType: 'bright',
|
|
276
|
+
visiableType: '',
|
|
277
|
+
openClipping: false,
|
|
278
|
+
btnActived: {
|
|
279
|
+
proof: false,
|
|
280
|
+
detect: false,
|
|
281
|
+
mark: false,
|
|
282
|
+
property: false,
|
|
283
|
+
clip: false,
|
|
284
|
+
clippingAll: false,
|
|
285
|
+
annotate: false,
|
|
286
|
+
firstPerson: false,
|
|
287
|
+
angle: false,
|
|
288
|
+
area: false,
|
|
289
|
+
distance: false,
|
|
290
|
+
measure: false,
|
|
291
|
+
pbsTree: true,
|
|
292
|
+
},
|
|
293
|
+
};
|
|
294
|
+
},
|
|
295
|
+
watch: {
|
|
296
|
+
closeRightOperationType(param) {
|
|
297
|
+
console.log('closeRightOperationType', param);
|
|
298
|
+
|
|
299
|
+
this.btnActived[param.type] = !param.close;
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
created() {},
|
|
303
|
+
methods: {
|
|
304
|
+
mainView() {
|
|
305
|
+
this.$parent.mainView();
|
|
306
|
+
},
|
|
307
|
+
resetType() {
|
|
308
|
+
this.rightType = '';
|
|
309
|
+
},
|
|
310
|
+
rightOperation(name) {
|
|
311
|
+
if(!this.proofingModel){
|
|
312
|
+
return
|
|
313
|
+
}
|
|
314
|
+
// this.rightType = this.rightType === name ? '': name
|
|
315
|
+
this.btnActived[name] = !this.btnActived[name];
|
|
316
|
+
this.$emit('rightOperation', name);
|
|
317
|
+
// this.$parent.rightOperation(name)
|
|
318
|
+
},
|
|
319
|
+
leftInformation(reveal, conceal, type) {
|
|
320
|
+
type === this.type ? (this.type = '') : (this.type = type);
|
|
321
|
+
this.$parent.leftInformation(reveal, conceal);
|
|
322
|
+
},
|
|
323
|
+
clickClip(type) {
|
|
324
|
+
if(!this.proofingModel){
|
|
325
|
+
return
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
type === this.type ? (this.type = '') : (this.type = type);
|
|
329
|
+
this.openClipping = !this.openClipping;
|
|
330
|
+
if(this.openMeasure){
|
|
331
|
+
this.openMeasure = false
|
|
332
|
+
}
|
|
333
|
+
this.rightOperation(type);
|
|
334
|
+
},
|
|
335
|
+
clickMeasure(type) {
|
|
336
|
+
if(!this.proofingModel){
|
|
337
|
+
return
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
type === this.type ? (this.type = '') : (this.type = type);
|
|
341
|
+
this.openMeasure = !this.openMeasure;
|
|
342
|
+
if(this.openClipping){
|
|
343
|
+
this.openClipping = false
|
|
344
|
+
}
|
|
345
|
+
this.rightOperation(type);
|
|
346
|
+
},
|
|
347
|
+
setColorOpen(type) {
|
|
348
|
+
if (type === this.lightType) return;
|
|
349
|
+
this.lightType = type;
|
|
350
|
+
this.$parent.setColorOpen(type);
|
|
351
|
+
},
|
|
352
|
+
clickVisiable(type) {
|
|
353
|
+
type === this.type ? (this.type = '') : (this.type = type);
|
|
354
|
+
this.openHandleVisiable = !this.openHandleVisiable;
|
|
355
|
+
if (!this.openHandleVisiable) {
|
|
356
|
+
this.visiableType = '';
|
|
357
|
+
this.$emit('setHandleVisiable', '');
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
setHandleVisiable(type) {
|
|
361
|
+
if (type === this.visiableType) return;
|
|
362
|
+
this.visiableType = type;
|
|
363
|
+
this.$emit('setHandleVisiable', type);
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
};
|
|
367
|
+
</script>
|
|
368
|
+
<style lang="scss" scoped>
|
|
369
|
+
.header-name {
|
|
370
|
+
color: #2e3136;
|
|
371
|
+
font-size: 12px;
|
|
372
|
+
font-weight: bold;
|
|
373
|
+
margin-left: 4px;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// 大部分页面顶部按钮
|
|
377
|
+
.header-button {
|
|
378
|
+
width: 100%;
|
|
379
|
+
height: 58px;
|
|
380
|
+
display: flex;
|
|
381
|
+
align-items: center;
|
|
382
|
+
box-sizing: border-box;
|
|
383
|
+
padding: 0 16px;
|
|
384
|
+
// justify-content: space-between;
|
|
385
|
+
border-bottom: 1px solid #ddd;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.split-line {
|
|
389
|
+
width: 1px;
|
|
390
|
+
height: 17px;
|
|
391
|
+
background: #ddd;
|
|
392
|
+
margin: 0 10px;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.right-left {
|
|
396
|
+
margin-right: 16px;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.right {
|
|
400
|
+
display: flex;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.left,
|
|
404
|
+
.right-left,
|
|
405
|
+
.right-right {
|
|
406
|
+
border-radius: 8px;
|
|
407
|
+
border: 1px solid #ddd;
|
|
408
|
+
display: flex;
|
|
409
|
+
align-items: center;
|
|
410
|
+
padding: 4px 10px;
|
|
411
|
+
margin-right: 60px;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.btn-item {
|
|
415
|
+
width: 32px;
|
|
416
|
+
height: 32px;
|
|
417
|
+
display: inline-block;
|
|
418
|
+
border-radius: 4px;
|
|
419
|
+
background-position: center;
|
|
420
|
+
background-size: 26px;
|
|
421
|
+
background-repeat: no-repeat;
|
|
422
|
+
cursor: pointer;
|
|
423
|
+
|
|
424
|
+
&:hover {
|
|
425
|
+
border: 1px solid #c5deee;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.popover-container {
|
|
430
|
+
position: absolute;
|
|
431
|
+
left: 0;
|
|
432
|
+
top: 42px;
|
|
433
|
+
background-color: #fff;
|
|
434
|
+
display: flex;
|
|
435
|
+
border-radius: 8px;
|
|
436
|
+
padding: 2px 8px;
|
|
437
|
+
box-shadow: 0px 2px 10px -2px #2e3136;
|
|
438
|
+
z-index: 10;
|
|
439
|
+
|
|
440
|
+
.btn-item:hover {
|
|
441
|
+
border: none;
|
|
442
|
+
background-color: rgba(241, 241, 241, 1);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.popover-layout {
|
|
447
|
+
position: relative;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// .main-view{
|
|
451
|
+
// margin-right: 10px;
|
|
452
|
+
// }
|
|
453
|
+
.right-right .btn-item {
|
|
454
|
+
margin-right: 10px;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// .btn-item:hover{
|
|
458
|
+
// border: 1px solid #C5DEEE;
|
|
459
|
+
// }
|
|
460
|
+
.el-button-actived {
|
|
461
|
+
background-color: rgba(241, 241, 241, 1);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.proof {
|
|
465
|
+
background-image: url('../../../assets/proof/proof@2x.png');
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.detect {
|
|
469
|
+
background-image: url('../../../assets/proof/detect@2x.png');
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.property {
|
|
473
|
+
background-image: url('../../../assets/proof/property@2x.png');
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.annotate {
|
|
477
|
+
background-image: url('../../../assets/proof/annotate@2x.png');
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.clip {
|
|
481
|
+
background-image: url('../../../assets/proof/clip@2x.png');
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.first-person {
|
|
485
|
+
background-image: url('../../../assets/proof/first-person@2x.png');
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.measure {
|
|
489
|
+
background-image: url('../../../assets/proof/measure@2x.png');
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.clipping-all {
|
|
493
|
+
background-image: url('../../../assets/proof/clipping-all@2x.png');
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.clipping {
|
|
497
|
+
background-image: url('../../../assets/proof/clipping@2x.png');
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
.distance {
|
|
501
|
+
background-image: url('../../../assets/proof/distance@2x.png');
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
.area {
|
|
505
|
+
background-image: url('../../../assets/proof/area@2x.png');
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.angle {
|
|
509
|
+
background-image: url('../../../assets/proof/angle@2x.png');
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.pbstree {
|
|
513
|
+
background-image: url('../../../assets/proof/pbstree@2x.png');
|
|
514
|
+
}
|
|
515
|
+
.icon-disabeld{
|
|
516
|
+
cursor: not-allowed;
|
|
517
|
+
}
|
|
518
|
+
.back{
|
|
519
|
+
margin: 0 25px 0 10px;
|
|
520
|
+
padding: 12px;
|
|
521
|
+
border: 1px solid #ddd;
|
|
522
|
+
}
|
|
523
|
+
// .save{
|
|
524
|
+
// background-image: url('../images/header-button/tool_save@2x.png');
|
|
525
|
+
// margin-right: 10px;
|
|
526
|
+
// }
|
|
527
|
+
// .menu{
|
|
528
|
+
// background-image: url('../images/header-button/tool_list@2x.png');
|
|
529
|
+
// }
|
|
530
|
+
// .mergdraw{
|
|
531
|
+
// background-image: url('../images/header-button/tool_mergdraw@2x.png');
|
|
532
|
+
// }
|
|
533
|
+
// .visiableOrShow{
|
|
534
|
+
// position: relative;
|
|
535
|
+
// background-image: url('../images/header-button/tool_visiable@2x.png');
|
|
536
|
+
// background-size: 22px;
|
|
537
|
+
// }
|
|
538
|
+
// .obj-hide{
|
|
539
|
+
// background-image: url('../images/header-button/tool_hide@2x.png');
|
|
540
|
+
// background-size: 18px;
|
|
541
|
+
// }
|
|
542
|
+
// .obj-show{
|
|
543
|
+
// background-image: url('../images/header-button/tool_show@2x.png');
|
|
544
|
+
// background-size: 18px;
|
|
545
|
+
// }
|
|
546
|
+
</style>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: yangling
|
|
3
|
+
* @Date: 2024-08-27 19:02:05
|
|
4
|
+
* @LastEditors: yangling
|
|
5
|
+
* @LastEditTime: 2024-08-27 19:02:14
|
|
6
|
+
* @FilePath: \DocumentCollaboration\src\components\imageViewr\index.vue
|
|
7
|
+
* @Description: 图片放大缩小 拖动
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<div
|
|
11
|
+
class="imageView"
|
|
12
|
+
@mousedown="onMouseDown"
|
|
13
|
+
@mousemove="onMouseMove"
|
|
14
|
+
@mouseleave="onMouseUp"
|
|
15
|
+
@mouseup="onMouseUp"
|
|
16
|
+
>
|
|
17
|
+
<div v-if="isErrorImage" class="error-image">
|
|
18
|
+
<div class="image-slot">
|
|
19
|
+
<i class="image-icon el-icon-picture-outline"></i>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<img v-else :src="imageUrl" ref="image" @wheel="onWheel"/>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
export default {
|
|
28
|
+
props: {
|
|
29
|
+
imageUrl: {
|
|
30
|
+
type: String,
|
|
31
|
+
require: true
|
|
32
|
+
},
|
|
33
|
+
isErrorImage: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
data() {
|
|
39
|
+
return {
|
|
40
|
+
currentScale: 1, // 当前缩放比例
|
|
41
|
+
isDragging: false, // 是否正在拖拽图片
|
|
42
|
+
startX: 0, // 拖拽起始点x坐标
|
|
43
|
+
startY: 0, // 拖拽起始点y坐标
|
|
44
|
+
translateX: 0, // 图片平移x方向距离
|
|
45
|
+
translateY: 0, // 图片平移y方向距离
|
|
46
|
+
dragSpeed: 0.3, // 拖拽速度
|
|
47
|
+
zoomSpeed: 0.1, //控制缩放速度
|
|
48
|
+
maxScale: 5, //最大缩放值
|
|
49
|
+
minScale: 0.1 //最小缩放值
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
methods: {
|
|
53
|
+
// 鼠标按下事件处理函数
|
|
54
|
+
onMouseDown(e) {
|
|
55
|
+
e.preventDefault()
|
|
56
|
+
this.isDragging = true
|
|
57
|
+
this.startX = e.clientX
|
|
58
|
+
this.startY = e.clientY
|
|
59
|
+
this.$refs.image.style.cursor = 'grabbing'
|
|
60
|
+
},
|
|
61
|
+
// 鼠标移动事件处理函数
|
|
62
|
+
onMouseMove(e) {
|
|
63
|
+
if (!this.isDragging) return
|
|
64
|
+
const deltaX = (e.clientX - this.startX) * this.dragSpeed
|
|
65
|
+
const deltaY = (e.clientY - this.startY) * this.dragSpeed
|
|
66
|
+
this.translateX += deltaX
|
|
67
|
+
this.translateY += deltaY
|
|
68
|
+
this.$refs.image.style.transform = `scale(${this.currentScale}) translate(${this.translateX}px, ${this.translateY}px)`
|
|
69
|
+
this.startX = e.clientX
|
|
70
|
+
this.startY = e.clientY
|
|
71
|
+
},
|
|
72
|
+
// 鼠标松开事件处理函数
|
|
73
|
+
onMouseUp() {
|
|
74
|
+
this.isDragging = false
|
|
75
|
+
this.$refs.image.style.cursor = 'grab'
|
|
76
|
+
},
|
|
77
|
+
// 鼠标滚轮事件处理函数
|
|
78
|
+
onWheel(e) {
|
|
79
|
+
e.preventDefault()
|
|
80
|
+
const delta = e.deltaY > 0 ? -1 : 1
|
|
81
|
+
this.currentScale = Math.min(
|
|
82
|
+
this.maxScale,
|
|
83
|
+
Math.max(this.minScale, this.currentScale + delta * this.zoomSpeed)
|
|
84
|
+
)
|
|
85
|
+
this.$refs.image.style.transform = `scale(${this.currentScale}) translate(${this.translateX}px, ${this.translateY}px)`
|
|
86
|
+
},
|
|
87
|
+
// 重置图片缩放和移动
|
|
88
|
+
resetImage() {
|
|
89
|
+
this.currentScale = 1
|
|
90
|
+
this.translateX = 0
|
|
91
|
+
this.translateY = 0
|
|
92
|
+
this.$refs.image.style.transform = 'scale(1) translate(0, 0)'
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<style lang="scss" scoped>
|
|
99
|
+
.imageView {
|
|
100
|
+
width: 100%;
|
|
101
|
+
height: 100%;
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
display: flex;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
align-items: center;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.imageView .elImageclass {
|
|
109
|
+
width: 100%;
|
|
110
|
+
height: 100%;
|
|
111
|
+
touch-action: none;
|
|
112
|
+
user-drag: none;
|
|
113
|
+
-webkit-user-drag: none;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
img {
|
|
117
|
+
width: 100%;
|
|
118
|
+
height: 100%;
|
|
119
|
+
cursor: grab;
|
|
120
|
+
object-fit: contain !important;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.image-icon{
|
|
124
|
+
font-size: 50px;
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
</style>
|