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,84 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: luoxue
|
|
3
|
+
* @Date: 2022-09-05 15:40:46
|
|
4
|
+
* @LastEditors: luoxue
|
|
5
|
+
* @LastEditTime: 2023-06-15 16:14:10
|
|
6
|
+
* @FilePath: \cms-ui\src\components\TextOverTooltip\index.vue
|
|
7
|
+
* @Description: 单行文本溢出显示省略号,鼠标悬浮展现完整内容(单行展示)
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<div class="text-over-tooltip">
|
|
11
|
+
<el-tooltip
|
|
12
|
+
:effect="effect"
|
|
13
|
+
:content="content"
|
|
14
|
+
:disabled="isDisableTooltip"
|
|
15
|
+
:placement="placement"
|
|
16
|
+
>
|
|
17
|
+
<div class="isEllipsis" @mouseover="onMouseOver(refName)">
|
|
18
|
+
<span :ref="refName">
|
|
19
|
+
<slot name="tooltip-content">
|
|
20
|
+
<span>{{ content }}</span>
|
|
21
|
+
</slot>
|
|
22
|
+
</span>
|
|
23
|
+
</div>
|
|
24
|
+
</el-tooltip>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
export default {
|
|
30
|
+
name: "TextOverTooltip",
|
|
31
|
+
props: {
|
|
32
|
+
// 显示的文字内容
|
|
33
|
+
content: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
// 子元素标识(如在同一页面中调用多次组件,此参数不可重复)
|
|
38
|
+
refName: {
|
|
39
|
+
type: [String, Number],
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
// 默认主题
|
|
43
|
+
effect: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "dark",
|
|
46
|
+
},
|
|
47
|
+
// tooltip 出现的位置
|
|
48
|
+
placement: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: "top",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
data() {
|
|
54
|
+
return {
|
|
55
|
+
// 是否禁止提示
|
|
56
|
+
isDisableTooltip: true,
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
methods: {
|
|
60
|
+
// 鼠标移入事件: 判断内容的宽度contentWidth是否大于父级的宽度
|
|
61
|
+
onMouseOver(str) {
|
|
62
|
+
if (!this.$refs[str]) return;
|
|
63
|
+
let parentWidth = this.$refs[str].parentNode.offsetWidth;
|
|
64
|
+
let contentWidth = this.$refs[str].offsetWidth;
|
|
65
|
+
// 判断是否禁用tooltip功能
|
|
66
|
+
this.isDisableTooltip = contentWidth <= parentWidth;
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<style lang="scss" scoped>
|
|
73
|
+
.text-over-tooltip {
|
|
74
|
+
width: 100%;
|
|
75
|
+
height: 100%;
|
|
76
|
+
vertical-align: middle;
|
|
77
|
+
/* 文字超出宽度显示省略号 单行*/
|
|
78
|
+
.isEllipsis {
|
|
79
|
+
white-space: nowrap;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
text-overflow: ellipsis;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
</style>
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="toolbar">
|
|
3
|
+
<el-tooltip
|
|
4
|
+
class="item"
|
|
5
|
+
effect="dark"
|
|
6
|
+
content="提示:双击空白处输入文字"
|
|
7
|
+
placement="top-start"
|
|
8
|
+
>
|
|
9
|
+
<el-button
|
|
10
|
+
type="text"
|
|
11
|
+
class="icon_toolbar icon_title"
|
|
12
|
+
:class="[type === 'Text' ? 'icon_active' : '']"
|
|
13
|
+
title="文本"
|
|
14
|
+
@click="handleDrawCanvas({ cursor: 'text', type: 'Text' })"
|
|
15
|
+
/>
|
|
16
|
+
</el-tooltip>
|
|
17
|
+
<!-- <el-button
|
|
18
|
+
type="text"
|
|
19
|
+
class="icon_toolbar icon_line"
|
|
20
|
+
:class="[type === 'Line' ? 'icon_active' : '']"
|
|
21
|
+
title="画笔"
|
|
22
|
+
@click="handleDrawCanvas({ cursor: 'crosshair', type: 'Line' })"
|
|
23
|
+
slot="reference"
|
|
24
|
+
/> -->
|
|
25
|
+
<el-button
|
|
26
|
+
type="text"
|
|
27
|
+
class="icon_toolbar icon_rectangle"
|
|
28
|
+
:class="[type === 'Rect' ? 'icon_active' : '']"
|
|
29
|
+
title="矩形"
|
|
30
|
+
@click="handleDrawCanvas({ cursor: 'crosshair', type: 'Rect' })"
|
|
31
|
+
/>
|
|
32
|
+
<el-button
|
|
33
|
+
type="text"
|
|
34
|
+
class="icon_toolbar icon_circle"
|
|
35
|
+
:class="[type === 'Circle' ? 'icon_active' : '']"
|
|
36
|
+
title="圆形"
|
|
37
|
+
@click="handleDrawCanvas({ cursor: 'crosshair', type: 'Circle' })"
|
|
38
|
+
/>
|
|
39
|
+
<el-button
|
|
40
|
+
type="text"
|
|
41
|
+
class="icon_toolbar icon_rubber"
|
|
42
|
+
:class="[type === 'Rubber' ? 'icon_active' : '']"
|
|
43
|
+
title="橡皮擦"
|
|
44
|
+
@click="handleDrawCanvas({ cursor: 'eraser', type: 'Rubber' })"
|
|
45
|
+
/>
|
|
46
|
+
<el-popover
|
|
47
|
+
popper-class="toolbar_stroke-width"
|
|
48
|
+
placement="top"
|
|
49
|
+
width="100"
|
|
50
|
+
v-model="visible"
|
|
51
|
+
>
|
|
52
|
+
<el-button
|
|
53
|
+
type="text"
|
|
54
|
+
class="icon_toolbar icon_stroke_width_1x"
|
|
55
|
+
:class="[strokeWidth === 1 ? 'icon_active' : '']"
|
|
56
|
+
@click="handleDrawCanvas({ strokeWidth: 1 })"
|
|
57
|
+
title="默认"
|
|
58
|
+
/>
|
|
59
|
+
<el-button
|
|
60
|
+
type="text"
|
|
61
|
+
class="icon_toolbar icon_stroke_width_2x"
|
|
62
|
+
:class="[strokeWidth === 3 ? 'icon_active' : '']"
|
|
63
|
+
@click="handleDrawCanvas({ strokeWidth: 3 })"
|
|
64
|
+
title="粗"
|
|
65
|
+
/>
|
|
66
|
+
<el-button
|
|
67
|
+
type="text"
|
|
68
|
+
class="icon_toolbar icon_stroke_width_3x"
|
|
69
|
+
:class="[strokeWidth === 5 ? 'icon_active' : '']"
|
|
70
|
+
@click="handleDrawCanvas({ strokeWidth: 5 })"
|
|
71
|
+
title="加粗"
|
|
72
|
+
/>
|
|
73
|
+
<el-button
|
|
74
|
+
type="text"
|
|
75
|
+
class="icon_toolbar icon_mark_stroke"
|
|
76
|
+
title="粗细"
|
|
77
|
+
slot="reference"
|
|
78
|
+
/>
|
|
79
|
+
</el-popover>
|
|
80
|
+
|
|
81
|
+
<el-button type="text" class="icon_toolbar icon_color" title="颜色">
|
|
82
|
+
<el-color-picker
|
|
83
|
+
v-model="defaultColor"
|
|
84
|
+
popper-class="popperClass"
|
|
85
|
+
@change="colorChange"
|
|
86
|
+
></el-color-picker>
|
|
87
|
+
</el-button>
|
|
88
|
+
<el-button
|
|
89
|
+
type="text"
|
|
90
|
+
class="text_toolbar icon_clear"
|
|
91
|
+
@click="handleClear"
|
|
92
|
+
title="清除"
|
|
93
|
+
></el-button>
|
|
94
|
+
<el-button
|
|
95
|
+
type="text"
|
|
96
|
+
class="text_toolbar icon_cancel"
|
|
97
|
+
@click="cancel"
|
|
98
|
+
title="取消"
|
|
99
|
+
></el-button>
|
|
100
|
+
<el-button
|
|
101
|
+
type="text"
|
|
102
|
+
class="text_toolbar icon_save"
|
|
103
|
+
@click="saveDrawing"
|
|
104
|
+
title="保存"
|
|
105
|
+
></el-button>
|
|
106
|
+
</div>
|
|
107
|
+
</template>
|
|
108
|
+
|
|
109
|
+
<script>
|
|
110
|
+
export default {
|
|
111
|
+
name: 'DrawToolbar',
|
|
112
|
+
data() {
|
|
113
|
+
return {
|
|
114
|
+
type: '',
|
|
115
|
+
defaultColor: '#A90A0A',
|
|
116
|
+
strokeWidth: 1,
|
|
117
|
+
visible: false,
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
methods: {
|
|
121
|
+
saveDrawing() {
|
|
122
|
+
this.$emit('save');
|
|
123
|
+
},
|
|
124
|
+
// 当前显示的颜色发生改变时
|
|
125
|
+
colorChange(val) {
|
|
126
|
+
if (val) {
|
|
127
|
+
this.$emit('colorChange', val);
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
uploadByUrl(url, data) {
|
|
131
|
+
return fetch(url, {
|
|
132
|
+
mode: 'cors', // 解决跨域
|
|
133
|
+
headers: { 'Content-Type': 'application/octet-stream' },
|
|
134
|
+
method: 'PUT',
|
|
135
|
+
body: data,
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
handleDrawCanvas({ cursorStyle, type, strokeWidth }) {
|
|
139
|
+
if (type === this.type) return;
|
|
140
|
+
if (type) {
|
|
141
|
+
this.type = type;
|
|
142
|
+
}
|
|
143
|
+
if (strokeWidth) {
|
|
144
|
+
this.strokeWidth = strokeWidth;
|
|
145
|
+
}
|
|
146
|
+
this.$emit('handleDraw', {
|
|
147
|
+
cursor: cursorStyle,
|
|
148
|
+
type: this.type,
|
|
149
|
+
strokeWidth: this.strokeWidth,
|
|
150
|
+
});
|
|
151
|
+
// if (actived !== this.type) { this.type = actived }
|
|
152
|
+
// if (style !== 'eraser') this.cursorStyle = style
|
|
153
|
+
// else if (style === 'eraser') this.cursorStyle = `url('${cursors.eraser}') 15 15, auto`
|
|
154
|
+
// this.canDraw = false
|
|
155
|
+
// let sx, sy, mx, my, arcDownX, arcDownY, arcMoveX, arcMoveY
|
|
156
|
+
// let text = document.getElementById("text")
|
|
157
|
+
// //鼠标按下
|
|
158
|
+
// let mousedown = (e) => {
|
|
159
|
+
// this.ctx_front.strokeStyle = this.defaultColor
|
|
160
|
+
// this.ctx_front.lineWidth = this.slide
|
|
161
|
+
// e = e || window.event
|
|
162
|
+
// sx = e.clientX - canvas_front.offsetLeft
|
|
163
|
+
// sy = e.clientY - canvas_front.offsetTop
|
|
164
|
+
// arcDownX = e.screenX
|
|
165
|
+
// arcDownY = e.screenY
|
|
166
|
+
// const cbx = this.ctx_base.getImageData( e.offsetX - 12, e.offsetY - 12, 12, 12)
|
|
167
|
+
// this.ctx_front.moveTo(sx, sy)
|
|
168
|
+
// this.canDraw = true
|
|
169
|
+
// switch (type) {
|
|
170
|
+
// case '橡皮':
|
|
171
|
+
// this.ctx_front.putImageData( cbx, e.offsetX - 12, e.offsetY - 12)
|
|
172
|
+
// this.ctx_back.putImageData(cbx, e.offsetX - 12, e.offsetY - 12)
|
|
173
|
+
// break
|
|
174
|
+
// case '文本':
|
|
175
|
+
// this.handleTextBlur()
|
|
176
|
+
// this.text = ""
|
|
177
|
+
// text.style.fontSize = 14 + this.slide * 10 + "px"
|
|
178
|
+
// text.style.color = this.defaultColor
|
|
179
|
+
// text.style.left = e.offsetX + canvas_front.offsetLeft - 20 + "px"
|
|
180
|
+
// text.style.top = e.offsetY + canvas_front.offsetTop - 10 + "px"
|
|
181
|
+
// text.style.zIndex = 10
|
|
182
|
+
// text.style.display = "block"
|
|
183
|
+
// this.tl = e.offsetX - 20
|
|
184
|
+
// this.tt = e.offsetY + 10
|
|
185
|
+
// break
|
|
186
|
+
// }
|
|
187
|
+
// }
|
|
188
|
+
// let mousemove = (e) => {
|
|
189
|
+
// e = e || window.event
|
|
190
|
+
// mx = e.clientX - canvas_front.offsetLeft
|
|
191
|
+
// my = e.clientY - canvas_front.offsetTop
|
|
192
|
+
// arcMoveX = e.screenX;
|
|
193
|
+
// arcMoveY = e.screenY;
|
|
194
|
+
// const cbx = this.ctx_base.getImageData( e.offsetX - 12, e.offsetY - 12, 12, 12)
|
|
195
|
+
// if (this.canDraw) {
|
|
196
|
+
// switch (type) {
|
|
197
|
+
// case '折线':
|
|
198
|
+
// this.handleFromCanvas()
|
|
199
|
+
// this.ctx_front.beginPath()
|
|
200
|
+
// this.ctx_front.moveTo(sx - 200 + create_canvas.scrollLeft, sy - 39 + create_canvas.scrollTop)
|
|
201
|
+
// this.ctx_front.lineTo(mx - 200 + create_canvas.scrollLeft, my - 39 + create_canvas.scrollTop)
|
|
202
|
+
// this.ctx_front.stroke()
|
|
203
|
+
// break
|
|
204
|
+
// case '圆形':
|
|
205
|
+
// this.handleFromCanvas()
|
|
206
|
+
// this.ctx_front.beginPath()
|
|
207
|
+
// // eslint-disable-next-line no-case-declarations
|
|
208
|
+
// let rds = Math.sqrt(Math.pow( (arcDownX - arcMoveX), 2) + (arcDownY - arcMoveY), 2 )
|
|
209
|
+
// this.ctx_front.arc(sx - 200 + create_canvas.scrollLeft, sy - 39 + create_canvas.scrollTop, rds, 0, Math.PI * 2, false)
|
|
210
|
+
// this.ctx_front.stroke()
|
|
211
|
+
// break
|
|
212
|
+
// case '矩形':
|
|
213
|
+
// this.handleFromCanvas()
|
|
214
|
+
// this.ctx_front.beginPath()
|
|
215
|
+
// this.ctx_front.moveTo(sx - 200 + create_canvas.scrollLeft, sy - 39 + create_canvas.scrollTop)
|
|
216
|
+
// this.ctx_front.lineTo(mx - 200 + create_canvas.scrollLeft, sy - 39 + create_canvas.scrollTop)
|
|
217
|
+
// this.ctx_front.lineTo(mx - 200 + create_canvas.scrollLeft, my - 39 + create_canvas.scrollTop)
|
|
218
|
+
// this.ctx_front.lineTo(sx - 200 + create_canvas.scrollLeft, my - 39 + create_canvas.scrollTop)
|
|
219
|
+
// this.ctx_front.lineTo(sx - 200 + create_canvas.scrollLeft, sy - 39 + create_canvas.scrollTop)
|
|
220
|
+
// this.ctx_front.stroke()
|
|
221
|
+
// break
|
|
222
|
+
// case '橡皮':
|
|
223
|
+
// this.ctx_front.putImageData(cbx, e.offsetX - 12, e.offsetY - 12)
|
|
224
|
+
// this.ctx_back.putImageData(cbx, e.offsetX - 12, e.offsetY - 12)
|
|
225
|
+
// break
|
|
226
|
+
// }
|
|
227
|
+
// }
|
|
228
|
+
// }
|
|
229
|
+
// let mouseup = () => {
|
|
230
|
+
// if (this.canDraw) {
|
|
231
|
+
// this.canDraw = false
|
|
232
|
+
// this.ctx_front.closePath()
|
|
233
|
+
// if (type !== 6) {
|
|
234
|
+
// this.handleSaveCanvasStore()
|
|
235
|
+
// }
|
|
236
|
+
// }
|
|
237
|
+
// }
|
|
238
|
+
// canvas_front.onmousedown = (e) => mousedown(e)
|
|
239
|
+
// canvas_front.onmousemove = (e) => mousemove(e)
|
|
240
|
+
// canvas_front.onmouseup = (e) => mouseup(e)
|
|
241
|
+
// canvas_front.onmouseout = (e) => mouseup(e)
|
|
242
|
+
// canvas_front.onmouseleave = (e) => mouseup(e)
|
|
243
|
+
},
|
|
244
|
+
/** 失焦或者回车绘制文本,框隐藏*/
|
|
245
|
+
handleTextBlur() {
|
|
246
|
+
let text = document.getElementById('text');
|
|
247
|
+
this.ctx_front.font = `300 ${text.style.fontSize} sans-serif`;
|
|
248
|
+
this.ctx_front.fillStyle = this.defaultColor;
|
|
249
|
+
this.ctx_front.fillText(this.text, this.tl, this.tt);
|
|
250
|
+
text.style.display = 'none';
|
|
251
|
+
this.text = '';
|
|
252
|
+
text.value = '';
|
|
253
|
+
this.handleSaveCanvasStore();
|
|
254
|
+
},
|
|
255
|
+
/** 保存绘制*/
|
|
256
|
+
handleSaveCanvasStore() {
|
|
257
|
+
let url = canvas_front.toDataURL();
|
|
258
|
+
let image = new Image();
|
|
259
|
+
image.src = url;
|
|
260
|
+
image.onload = () => {
|
|
261
|
+
this.ctx_front.clearRect(0, 0, canvas_front.width, canvas_front.height);
|
|
262
|
+
this.ctx_front.drawImage(image, 0, 0, image.width, image.height);
|
|
263
|
+
this.ctx_back.drawImage(image, 0, 0, image.width, image.height);
|
|
264
|
+
const url2 = canvas_back.toDataURL();
|
|
265
|
+
this.currentImg.url = url2;
|
|
266
|
+
this.currentImg.index += 1;
|
|
267
|
+
this.canvasStore.push(url2);
|
|
268
|
+
};
|
|
269
|
+
},
|
|
270
|
+
handleFromCanvas() {
|
|
271
|
+
this.ctx_front.clearRect(0, 0, canvas_front.width, canvas_front.height);
|
|
272
|
+
},
|
|
273
|
+
cancel() {
|
|
274
|
+
this.$emit('closeDrawing');
|
|
275
|
+
},
|
|
276
|
+
handleClear() {
|
|
277
|
+
this.$emit('handleClear');
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
};
|
|
281
|
+
</script>
|
|
282
|
+
<style lang="scss" scoped>
|
|
283
|
+
// P标签样式
|
|
284
|
+
.classification_title {
|
|
285
|
+
margin: 0 0 10px 0;
|
|
286
|
+
color: #fff;
|
|
287
|
+
font-size: 14px;
|
|
288
|
+
cursor: default;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// 工具栏样式
|
|
292
|
+
.toolbar {
|
|
293
|
+
z-index: 10;
|
|
294
|
+
width: 520px;
|
|
295
|
+
padding: 6px 16px;
|
|
296
|
+
border-radius: 6px;
|
|
297
|
+
box-shadow: 0px 2px 8px 0px rgba(6, 29, 44, 0.25);
|
|
298
|
+
background-color: #fff;
|
|
299
|
+
position: relative;
|
|
300
|
+
left: 50%;
|
|
301
|
+
top: 50%;
|
|
302
|
+
box-sizing: border-box;
|
|
303
|
+
transform: translate(-50%, -50%);
|
|
304
|
+
display: flex;
|
|
305
|
+
justify-content: space-around;
|
|
306
|
+
}
|
|
307
|
+
// 工具栏图标
|
|
308
|
+
.icon_toolbar,
|
|
309
|
+
.text_toolbar {
|
|
310
|
+
float: left;
|
|
311
|
+
width: 40px;
|
|
312
|
+
height: 40px;
|
|
313
|
+
padding: 0px !important;
|
|
314
|
+
background-repeat: no-repeat;
|
|
315
|
+
background-size: 24px;
|
|
316
|
+
background-position: center;
|
|
317
|
+
}
|
|
318
|
+
.icon_toolbar:hover,
|
|
319
|
+
.text_toolbar:hover,
|
|
320
|
+
.icon_active {
|
|
321
|
+
background-color: rgba(238, 238, 238, 1);
|
|
322
|
+
}
|
|
323
|
+
.icon_title {
|
|
324
|
+
background-image: url(~@/assets/draw-tool/mark_font@2x.png);
|
|
325
|
+
}
|
|
326
|
+
.icon_line {
|
|
327
|
+
background-image: url(~@/assets/draw-tool/mark_polyline@2x.png);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.icon_rectangle {
|
|
331
|
+
background-image: url(~@/assets/draw-tool/mark_rectangle@2x.png);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.icon_circle {
|
|
335
|
+
background-image: url(~@/assets/draw-tool/mark_cercle@2x.png);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.icon_rubber {
|
|
339
|
+
background-image: url(~@/assets/draw-tool/mark_eraser@2x.png);
|
|
340
|
+
}
|
|
341
|
+
.icon_color {
|
|
342
|
+
background-image: url(~@/assets/draw-tool/mark_color@2x.png);
|
|
343
|
+
}
|
|
344
|
+
.icon_clear {
|
|
345
|
+
background-image: url(~@/assets/draw-tool/mark_clear@2x.png);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.icon_cancel {
|
|
349
|
+
background-image: url(~@/assets/draw-tool/mark_exit@2x.png);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.icon_stroke_width_1x {
|
|
353
|
+
background-image: url(~@/assets/draw-tool/stroke_width_1x.png);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.icon_stroke_width_2x {
|
|
357
|
+
background-image: url(~@/assets/draw-tool/stroke_width_2x.png);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.icon_stroke_width_3x {
|
|
361
|
+
background-image: url(~@/assets/draw-tool/stroke_width_3x.png);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.icon_save {
|
|
365
|
+
background-image: url(~@/assets/draw-tool/mark_finish@2x.png);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.icon_mark_stroke {
|
|
369
|
+
background-image: url(~@/assets/draw-tool/mark_stroke.png);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// 调色盘设置
|
|
373
|
+
::v-deep .icon_color .el-color-picker__trigger {
|
|
374
|
+
opacity: 0;
|
|
375
|
+
filter: alpha(opacity=0);
|
|
376
|
+
}
|
|
377
|
+
::v-deep .el-color-picker--medium,
|
|
378
|
+
::v-deep .el-color-picker--medium .el-color-picker__trigger {
|
|
379
|
+
width: 24px !important;
|
|
380
|
+
height: 24px !important;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// 画布
|
|
384
|
+
.create_canvas {
|
|
385
|
+
position: relative;
|
|
386
|
+
width: 100%;
|
|
387
|
+
height: 100%;
|
|
388
|
+
overflow: auto;
|
|
389
|
+
box-sizing: border-box;
|
|
390
|
+
// padding: 20px;
|
|
391
|
+
|
|
392
|
+
canvas {
|
|
393
|
+
position: absolute;
|
|
394
|
+
overflow: auto;
|
|
395
|
+
// top: 20px;
|
|
396
|
+
// left: 20px;
|
|
397
|
+
}
|
|
398
|
+
#ctx_front {
|
|
399
|
+
z-index: 5;
|
|
400
|
+
}
|
|
401
|
+
#ctx_back {
|
|
402
|
+
z-index: 3;
|
|
403
|
+
}
|
|
404
|
+
#ctx_base {
|
|
405
|
+
z-index: 1;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
#text {
|
|
409
|
+
position: absolute;
|
|
410
|
+
z-index: -1;
|
|
411
|
+
resize: none;
|
|
412
|
+
outline: none;
|
|
413
|
+
border: 1px dashed #eeeeee;
|
|
414
|
+
overflow: hidden;
|
|
415
|
+
background: transparent;
|
|
416
|
+
line-height: 30px;
|
|
417
|
+
display: none;
|
|
418
|
+
}
|
|
419
|
+
</style>
|
|
420
|
+
<style lang="scss">
|
|
421
|
+
.toolbar_stroke-width {
|
|
422
|
+
display: flex;
|
|
423
|
+
justify-content: space-around;
|
|
424
|
+
}
|
|
425
|
+
</style>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="show">
|
|
3
|
+
<el-empty>
|
|
4
|
+
<el-button type="text" @click="handleClick">载入模型</el-button>
|
|
5
|
+
</el-empty>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import * as modelApi from "../api/index";
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
name: 'CheckProofingModel',
|
|
14
|
+
data() {
|
|
15
|
+
return {
|
|
16
|
+
show: false,
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
defaultParams: {
|
|
21
|
+
type: Object,
|
|
22
|
+
default() {
|
|
23
|
+
return {};
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
mounted() {
|
|
28
|
+
},
|
|
29
|
+
methods: {
|
|
30
|
+
handleClick(){
|
|
31
|
+
this.$emit('click')
|
|
32
|
+
},
|
|
33
|
+
showCheckProofingModel(){
|
|
34
|
+
this.show = true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<style type="scss" scoped>
|
|
41
|
+
|
|
42
|
+
</style>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="clipping-type action-box">
|
|
3
|
+
<div v-for="item of clippingList" :key="item.id" :class="[active === item.id ? 'active' : 'unactive', 'btn-item']" @click="clippingType(item.id)"><span class="span-txt">{{item.name}}</span><img :src="item.imgUrl" :alt="item.name" class="btn-bg"></div>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script>
|
|
7
|
+
export default {
|
|
8
|
+
name: 'ClippingType',
|
|
9
|
+
data() {
|
|
10
|
+
return {
|
|
11
|
+
active: '',
|
|
12
|
+
clippingList: [
|
|
13
|
+
{ name: '全局剖切', id: 'all', imgUrl: require('@/assets/clipping-all.png') },
|
|
14
|
+
// { name: '局部剖切', id: 'local', imgUrl: require('@/assets/clipping-local.png') }
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
methods: {
|
|
19
|
+
clippingType(type) {
|
|
20
|
+
if (type !== this.active) {
|
|
21
|
+
this.$set(this, 'active', type)
|
|
22
|
+
this.$emit('clippingType', type)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
<style lang="scss" scoped>
|
|
29
|
+
.clipping-type{
|
|
30
|
+
height: 45px;
|
|
31
|
+
}
|
|
32
|
+
.btn-item{
|
|
33
|
+
height: 45px;
|
|
34
|
+
line-height: 45px;
|
|
35
|
+
padding: 0 10px;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
.btn-bg{
|
|
39
|
+
display: inline-block;
|
|
40
|
+
vertical-align: middle;
|
|
41
|
+
}
|
|
42
|
+
.unactive{
|
|
43
|
+
color: #fff;
|
|
44
|
+
}
|
|
45
|
+
.span-txt{
|
|
46
|
+
padding-right: 5px;
|
|
47
|
+
}
|
|
48
|
+
.active{
|
|
49
|
+
background: rgba(255, 255, 255, 0.5);
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<!-- 使用方法 样例 -->
|
|
2
|
+
<template>
|
|
3
|
+
<div class="trigger_dialog">
|
|
4
|
+
<!-- 触发弹窗操作 -->
|
|
5
|
+
<el-button type="primary" @click="dialogVisible = true">触发对话框</el-button>
|
|
6
|
+
<!-- 弹窗组件 -->
|
|
7
|
+
<DialogWrapper
|
|
8
|
+
v-if="dialogVisible"
|
|
9
|
+
dialog-title="触发对话框"
|
|
10
|
+
:visible.sync="dialogVisible"
|
|
11
|
+
:popup-width="'35%'"
|
|
12
|
+
@handleClose="handleClose"
|
|
13
|
+
@submitDialogData="submitDialogData"
|
|
14
|
+
>
|
|
15
|
+
弹窗内容
|
|
16
|
+
</DialogWrapper>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
export default {
|
|
22
|
+
components: {
|
|
23
|
+
// 弹窗引入,如注册全局组件则克直接使用
|
|
24
|
+
DialogWrapper: () => import('./DialogWrapper.vue')
|
|
25
|
+
},
|
|
26
|
+
props: {},
|
|
27
|
+
data() {
|
|
28
|
+
return {
|
|
29
|
+
dialogVisible: false // 弹框状态
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
computed: { },
|
|
33
|
+
watch: {},
|
|
34
|
+
created() {},
|
|
35
|
+
mounted() {},
|
|
36
|
+
methods: {
|
|
37
|
+
/* 弹窗 修改是否让页面显示与隐藏的事件 */
|
|
38
|
+
updateVisible(val) {
|
|
39
|
+
this.dialogVisible = val
|
|
40
|
+
},
|
|
41
|
+
/* 弹窗 确认 操作 */
|
|
42
|
+
submitDialogData() {
|
|
43
|
+
this.dialogVisible = false
|
|
44
|
+
},
|
|
45
|
+
/* 弹窗 关闭 操作 */
|
|
46
|
+
handleClose() {
|
|
47
|
+
this.dialogVisible = false
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
<style lang="scss" scoped>
|
|
53
|
+
</style>
|