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,502 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tree-box-item-card">
|
|
3
|
+
<!-- @keyup.enter.native="queryPbs" -->
|
|
4
|
+
<!-- @clear="getTree" -->
|
|
5
|
+
<el-input
|
|
6
|
+
placeholder="请输入关键字搜索"
|
|
7
|
+
v-model="filterVal"
|
|
8
|
+
prefix-icon="el-icon-search"
|
|
9
|
+
clearable
|
|
10
|
+
maxlength="30"
|
|
11
|
+
class="input-with-pbs"
|
|
12
|
+
>
|
|
13
|
+
<!-- <i class="el-icon-search el-input__icon search-icon" slot="suffix" @click="queryPbs"> </i> -->
|
|
14
|
+
</el-input>
|
|
15
|
+
|
|
16
|
+
<!-- :render-content="renderContent" -->
|
|
17
|
+
<el-scrollbar class="scrollbar">
|
|
18
|
+
<el-tree
|
|
19
|
+
v-if="treeEmptyText"
|
|
20
|
+
ref="tree"
|
|
21
|
+
:data="treeData"
|
|
22
|
+
show-checkbox
|
|
23
|
+
node-key="id"
|
|
24
|
+
:expand-on-click-node="false"
|
|
25
|
+
:current-node-key="currentKey"
|
|
26
|
+
:props="defaultProps"
|
|
27
|
+
@node-click="handleNodeClick"
|
|
28
|
+
:highlight-current="true"
|
|
29
|
+
:default-expanded-keys="expanded"
|
|
30
|
+
@check="handleCheckChange"
|
|
31
|
+
:filter-node-method="filterNode"
|
|
32
|
+
:check-strictly="true"
|
|
33
|
+
:empty-text=treeEmptyText
|
|
34
|
+
>
|
|
35
|
+
<span class="custom-tree-node" slot-scope="{ node, data }">
|
|
36
|
+
<!-- 自定义节点名称 -->
|
|
37
|
+
<!-- :style="cssNodeLabel" -->
|
|
38
|
+
<text-over-tooltip
|
|
39
|
+
class="node-label"
|
|
40
|
+
:content="node.label"
|
|
41
|
+
:ref-name="node.id"
|
|
42
|
+
>
|
|
43
|
+
<template slot="tooltip-content">
|
|
44
|
+
<slot
|
|
45
|
+
name="tree-node-label"
|
|
46
|
+
v-bind="{ node, data }"
|
|
47
|
+
>
|
|
48
|
+
<!-- 自定义节点图标 -->
|
|
49
|
+
<!-- <i
|
|
50
|
+
v-if="data.icon"
|
|
51
|
+
:class="data.icon"
|
|
52
|
+
style="margin-right: 3px"
|
|
53
|
+
/>
|
|
54
|
+
<i
|
|
55
|
+
v-else-if="!node.isLeaf"
|
|
56
|
+
:class="'el-icon-coin'"
|
|
57
|
+
style="margin-right: 3px"
|
|
58
|
+
/> -->
|
|
59
|
+
<span v-html="search(node.label, filterVal)" />
|
|
60
|
+
</slot>
|
|
61
|
+
</template>
|
|
62
|
+
</text-over-tooltip>
|
|
63
|
+
</span>
|
|
64
|
+
</el-tree>
|
|
65
|
+
<el-empty v-else></el-empty>
|
|
66
|
+
</el-scrollbar>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
<script>
|
|
70
|
+
import { proofInit, getPbsTree, getOriginalPbsTree } from '../api/index'
|
|
71
|
+
import { loading, loadingClose } from '../utils/index'
|
|
72
|
+
import _ from 'lodash'
|
|
73
|
+
import TextOverTooltip from "./TextOverTooltip/index.vue";
|
|
74
|
+
|
|
75
|
+
var projectId = null
|
|
76
|
+
var timeout = null //防抖时间戳
|
|
77
|
+
var checkedArr = []
|
|
78
|
+
|
|
79
|
+
let selectedIds = []
|
|
80
|
+
let allNodes = [];
|
|
81
|
+
const NODE_TYPES = {
|
|
82
|
+
model: 10,
|
|
83
|
+
pbsGrp: 0,
|
|
84
|
+
innerGrp: 1,
|
|
85
|
+
annotation: 11,
|
|
86
|
+
viewer: 12,
|
|
87
|
+
drawing: 13,
|
|
88
|
+
major: 14,
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default {
|
|
92
|
+
name: 'PbsTree',
|
|
93
|
+
props: {
|
|
94
|
+
folderId: {
|
|
95
|
+
type: String,
|
|
96
|
+
default() {
|
|
97
|
+
return ''
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
projectId: {
|
|
101
|
+
type: String,
|
|
102
|
+
default() {
|
|
103
|
+
return ''
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
version: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: ''
|
|
109
|
+
},
|
|
110
|
+
flag: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default() {
|
|
113
|
+
return false
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
pbsVersion: {
|
|
117
|
+
type: Object,
|
|
118
|
+
default() {
|
|
119
|
+
return {}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
components: {
|
|
124
|
+
TextOverTooltip
|
|
125
|
+
},
|
|
126
|
+
destroyed(){
|
|
127
|
+
this.resetData();
|
|
128
|
+
},
|
|
129
|
+
data() {
|
|
130
|
+
return {
|
|
131
|
+
defaultProps: {
|
|
132
|
+
label: 'groupName',
|
|
133
|
+
children: 'child',
|
|
134
|
+
// isLeaf: (data) => {
|
|
135
|
+
// return !data.leaf
|
|
136
|
+
// },
|
|
137
|
+
disabled: (data) => {
|
|
138
|
+
return data.type !== 0;
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
treeData: [],
|
|
142
|
+
treeEmptyText: '',
|
|
143
|
+
currentKey: null,
|
|
144
|
+
expanded: [],
|
|
145
|
+
checkedArr: [],
|
|
146
|
+
node: '',
|
|
147
|
+
filterVal: '',
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
watch: {
|
|
151
|
+
// 监听节点名称变化,进行筛选
|
|
152
|
+
filterVal(val) {
|
|
153
|
+
if (val) {
|
|
154
|
+
this.$refs.tree.filter(val);
|
|
155
|
+
} else {
|
|
156
|
+
// 清空树形搜索,则刷新数据,以使树重回手风琴模式
|
|
157
|
+
this.$refs.tree.filter('');
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
// folderId(val) {
|
|
162
|
+
// if (val) this.getTree()
|
|
163
|
+
// },
|
|
164
|
+
// projectId(val) {
|
|
165
|
+
// if (val) this.getTree()
|
|
166
|
+
// },
|
|
167
|
+
// flag(val) {
|
|
168
|
+
// if (val) this.getTree()
|
|
169
|
+
// },
|
|
170
|
+
},
|
|
171
|
+
created() {
|
|
172
|
+
},
|
|
173
|
+
methods: {
|
|
174
|
+
// // 搜索
|
|
175
|
+
// queryPbs() {
|
|
176
|
+
// if (!this.filterVal.trim()) {
|
|
177
|
+
// this.$message.warning('请输入位号')
|
|
178
|
+
// return
|
|
179
|
+
// }
|
|
180
|
+
// modelApi.select(this.filterVal.trim(), this.projectId, this.folderId, this.version).then(res => {
|
|
181
|
+
// this.$set(this, 'treeData', Object.freeze(res))
|
|
182
|
+
// this.expanded = this.expandNodes(res)
|
|
183
|
+
// if (res) {
|
|
184
|
+
// this.$nextTick(() => {
|
|
185
|
+
// this.$refs.tree.setCheckedNodes(res)
|
|
186
|
+
// })
|
|
187
|
+
// }
|
|
188
|
+
// }).catch(err => {
|
|
189
|
+
// this.treeData.splice(0)
|
|
190
|
+
// this.$message.warning(err.msg)
|
|
191
|
+
// })
|
|
192
|
+
// },
|
|
193
|
+
expandNodes(data) {
|
|
194
|
+
data.forEach(item => {
|
|
195
|
+
this.expanded.push(item.nodeId)
|
|
196
|
+
if (item.children) {
|
|
197
|
+
item.children.forEach(childrenItem => {
|
|
198
|
+
this.expanded.push(childrenItem.nodeId)
|
|
199
|
+
this.expandNodes(childrenItem.children)
|
|
200
|
+
})
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
return this.expanded
|
|
204
|
+
},
|
|
205
|
+
formatTree(data) {
|
|
206
|
+
if (data.type !== 0) {
|
|
207
|
+
data.disabled = true;
|
|
208
|
+
} else {
|
|
209
|
+
data.disabled = false;
|
|
210
|
+
}
|
|
211
|
+
if (data.child) {
|
|
212
|
+
data.child.forEach(childrenItem => {
|
|
213
|
+
this.formatTree(childrenItem)
|
|
214
|
+
})
|
|
215
|
+
}
|
|
216
|
+
return data
|
|
217
|
+
},
|
|
218
|
+
// 获取pbs节点
|
|
219
|
+
getPbsTree(params) {
|
|
220
|
+
this.treeEmptyText = '加载中...';
|
|
221
|
+
|
|
222
|
+
getOriginalPbsTree(params)
|
|
223
|
+
// getPbsTree(params)
|
|
224
|
+
.then((res) => {
|
|
225
|
+
// console.log('getOriginalPbsTree', res)
|
|
226
|
+
// res = this.formatTree(res)
|
|
227
|
+
|
|
228
|
+
if (res) {
|
|
229
|
+
this.treeData = [res];
|
|
230
|
+
this.allNodes = this.getAllNodes([res]);
|
|
231
|
+
}
|
|
232
|
+
}).catch(() => {
|
|
233
|
+
console.log('error')
|
|
234
|
+
this.treeData.splice(0)
|
|
235
|
+
}).finally(() => {
|
|
236
|
+
loadingClose()
|
|
237
|
+
this.treeEmptyText = '暂无数据';
|
|
238
|
+
})
|
|
239
|
+
},
|
|
240
|
+
getAllNodes(data) {
|
|
241
|
+
const allNodes = [];
|
|
242
|
+
data.forEach(node => {
|
|
243
|
+
allNodes.push(node);
|
|
244
|
+
if (node.child && node.child.length > 0) {
|
|
245
|
+
allNodes.push(...this.getAllNodes(node.child));
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
return allNodes;
|
|
249
|
+
},
|
|
250
|
+
handleNodeClick(data) {
|
|
251
|
+
this.node = data
|
|
252
|
+
if (data.type === NODE_TYPES.model) {
|
|
253
|
+
this.getModelIdsByNodeIds(projectId, data.objectId, 'PbsClick')
|
|
254
|
+
}
|
|
255
|
+
// if (data.nodeType === 'Pbs') {
|
|
256
|
+
// 这个有待考究 需不需要传版本数据 data里面没有版本数据的字段
|
|
257
|
+
// this.getModelIdsByNodeIds(projectId, data, 'PbsClick')
|
|
258
|
+
// }
|
|
259
|
+
},
|
|
260
|
+
// 选中节点
|
|
261
|
+
scrollTo(selectNodeId) {
|
|
262
|
+
const node = this.allNodes.find(item => item.objectId === selectNodeId)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
if (node?.id) {
|
|
266
|
+
this.$refs.tree.setCurrentKey(node.id)
|
|
267
|
+
this.expanded.push(node.id)
|
|
268
|
+
this.$set(this, 'currentKey', node.id)
|
|
269
|
+
this.$nextTick(() => {
|
|
270
|
+
const ele = document.querySelector('.is-current')
|
|
271
|
+
setTimeout(() => {
|
|
272
|
+
if (ele) {
|
|
273
|
+
ele.scrollIntoView({
|
|
274
|
+
block: 'center',
|
|
275
|
+
behavior: 'instant'
|
|
276
|
+
})
|
|
277
|
+
}
|
|
278
|
+
}, 400)
|
|
279
|
+
})
|
|
280
|
+
} else {
|
|
281
|
+
this.$message({
|
|
282
|
+
type: 'warning',
|
|
283
|
+
message: '未关联Pbs节点'
|
|
284
|
+
})
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
//获取复选框选中得到的数据
|
|
288
|
+
handleCheckChange(data, node) {
|
|
289
|
+
// type 为0的是组节点 加载模型 10是模型 (定位) 14是专业
|
|
290
|
+
console.log(data, node)
|
|
291
|
+
const tree = this.$refs.tree;
|
|
292
|
+
console.log(tree.getNode(data))
|
|
293
|
+
const currentNode = tree.getNode(data)
|
|
294
|
+
const nodeData = currentNode.data;
|
|
295
|
+
if (currentNode.checked) {
|
|
296
|
+
this.selectAllChildren([nodeData])
|
|
297
|
+
} else {
|
|
298
|
+
this.invertChildrenSelection([nodeData])
|
|
299
|
+
}
|
|
300
|
+
// selectedIds = ['100']
|
|
301
|
+
console.log(selectedIds)
|
|
302
|
+
const checkedKeys = selectedIds.map(item => item.id)
|
|
303
|
+
tree.setCheckedKeys(checkedKeys)
|
|
304
|
+
|
|
305
|
+
if (data.type === NODE_TYPES.pbsGrp) {
|
|
306
|
+
const groupIds = selectedIds.map(item => item.objectId)
|
|
307
|
+
this.getModelIdsByNodeIds(projectId, groupIds, 'checkChange')
|
|
308
|
+
}
|
|
309
|
+
// clearTimeout(timeout)
|
|
310
|
+
// // 过滤一下数据
|
|
311
|
+
// const checkedKeys = tree.getCheckedKeys();
|
|
312
|
+
// console.log(checkedKeys)
|
|
313
|
+
// // this.filterCheckArr(data)
|
|
314
|
+
// timeout = setTimeout(() => {
|
|
315
|
+
// this.getModelIdsByNodeIds(projectId, checkedKeys, 'checkChange')
|
|
316
|
+
// checkedKeys.splice(0)
|
|
317
|
+
// }, 500)
|
|
318
|
+
},
|
|
319
|
+
filterCheckArr(data) {
|
|
320
|
+
if (data.children.length === 0) {
|
|
321
|
+
checkedArr.push({ folderId: data.nodeFolderId, nodeId: data.nodeId, version: this.pbsVersion[data.nodeFolderId] })
|
|
322
|
+
} else {
|
|
323
|
+
for (let index = 0; index < data.children.length; index++) {
|
|
324
|
+
this.filterCheckArr(data.children[index])
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
// 获取当前选中的节点中所对应的模型信息集合
|
|
329
|
+
getModelIdsByNodeIds(projectId, nodes, type) {
|
|
330
|
+
// this.$emit('checkChange', nodes)
|
|
331
|
+
type === 'checkChange' && this.$emit('checkChange', nodes)
|
|
332
|
+
type === 'PbsClick' && this.$emit('pbsNodeClick', nodes)
|
|
333
|
+
|
|
334
|
+
// PbsApi.getModelIdsByNodeIds(projectId, parmas).then(res => {
|
|
335
|
+
// // type === 'checkChange' && this.$emit('checkChange', this.formatterMsg(res))
|
|
336
|
+
// // type === 'PbsClick' && this.$emit('PbsNodeClick', res, this.node)
|
|
337
|
+
// this.$emit('PbsNodeClick', res, this.node)
|
|
338
|
+
// }).catch((err) => {
|
|
339
|
+
// this.$message({
|
|
340
|
+
// type: 'warning',
|
|
341
|
+
// message: err.msg
|
|
342
|
+
// })
|
|
343
|
+
// })
|
|
344
|
+
},
|
|
345
|
+
// 整合数据
|
|
346
|
+
formatterMsg(data) {
|
|
347
|
+
//整合数据以对象形式传递,{key:[]},key为titleName,[]是batchId去重后组成的数组
|
|
348
|
+
const batchIdObj = {}
|
|
349
|
+
for (let i = 0; i < data.length; i++) {
|
|
350
|
+
if (data[i].batchIds) {
|
|
351
|
+
let batchIds = JSON.parse(data[i].batchIds)
|
|
352
|
+
for (let index = 0; index < batchIds.length; index++) {
|
|
353
|
+
const element = batchIds[index]
|
|
354
|
+
let modelPiece = element.titleName
|
|
355
|
+
if (Object.keys(batchIdObj).includes(modelPiece)) {
|
|
356
|
+
!batchIdObj[modelPiece].batchIds.find(item => item === element.batchId) && batchIdObj[modelPiece].batchIds.push(element.batchId)
|
|
357
|
+
} else {
|
|
358
|
+
batchIdObj[modelPiece] = {
|
|
359
|
+
folderId: '',
|
|
360
|
+
batchIds: []
|
|
361
|
+
}
|
|
362
|
+
if (!batchIdObj[modelPiece].batchIds.find(item => item === element.batchId)) {
|
|
363
|
+
batchIdObj[modelPiece].batchIds.push(element.batchId)
|
|
364
|
+
batchIdObj[modelPiece].folderId = data[i].groupId
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return batchIdObj
|
|
371
|
+
},
|
|
372
|
+
// 判断节点是否拥有子节点
|
|
373
|
+
hasChildren(data) {
|
|
374
|
+
return data.hasOwnProperty('child') && data.child.length > 0;
|
|
375
|
+
},
|
|
376
|
+
// 选中当前节点的所有子节点
|
|
377
|
+
selectAllChildren(items) {
|
|
378
|
+
const childIds = this.collectChildIdsRecursive(items);
|
|
379
|
+
selectedIds = _.uniqBy([...selectedIds, ...childIds], item => item.id);
|
|
380
|
+
},
|
|
381
|
+
// 取消选中当前节点的所有子节点
|
|
382
|
+
invertChildrenSelection(items) {
|
|
383
|
+
const childIds = this.collectChildIdsRecursive(items);
|
|
384
|
+
const ids = childIds.map(childItem => childItem.id)
|
|
385
|
+
selectedIds = selectedIds.filter(item => !ids.includes(item.id));
|
|
386
|
+
},
|
|
387
|
+
// 递归收集节点及其子节点的ID
|
|
388
|
+
collectChildIdsRecursive(items, result = []) {
|
|
389
|
+
items.forEach(item => {
|
|
390
|
+
item.type === NODE_TYPES.pbsGrp && result.push({objectId: item.objectId, id: item.id});
|
|
391
|
+
if (this.hasChildren(item)) this.collectChildIdsRecursive(item.child, result);
|
|
392
|
+
});
|
|
393
|
+
return result;
|
|
394
|
+
},
|
|
395
|
+
search(val, searchData) {
|
|
396
|
+
const Reg = new RegExp(searchData, 'ig')
|
|
397
|
+
if (val || val === 0) {
|
|
398
|
+
const res = val.toString().replace(Reg, `<span>$&</span>`)
|
|
399
|
+
return res
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
/* 查询节点名 */
|
|
403
|
+
filterNode(value, data, node) {
|
|
404
|
+
// console.log(value);
|
|
405
|
+
// if (!value) return true;
|
|
406
|
+
// 返回:祖先节点、包含搜索结果的节点及其后代节点
|
|
407
|
+
// let parentNode = node.parent,
|
|
408
|
+
// labels = [node.label],
|
|
409
|
+
// level = 1;
|
|
410
|
+
// while (level < node.level) {
|
|
411
|
+
// labels = [...labels, parentNode.label];
|
|
412
|
+
// parentNode = parentNode.parent;
|
|
413
|
+
// level++;
|
|
414
|
+
// }
|
|
415
|
+
// return labels.some((label) => label.indexOf(value) !== -1);
|
|
416
|
+
// 返回:祖先节点、包含搜索结果的节点
|
|
417
|
+
// 不区分大小写
|
|
418
|
+
if (!value) return true;
|
|
419
|
+
let nowVal = data[this.defaultProps.label].toUpperCase();
|
|
420
|
+
return nowVal.indexOf(value.toUpperCase()) !== -1;
|
|
421
|
+
// return node.label.indexOf(value) !== -1;
|
|
422
|
+
},
|
|
423
|
+
resetData(){
|
|
424
|
+
selectedIds = [];
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
</script>
|
|
429
|
+
<style lang="scss" scoped>
|
|
430
|
+
::v-deep .el-card__body {
|
|
431
|
+
height: 100%;
|
|
432
|
+
padding: 0;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
::v-deep .el-tree {
|
|
436
|
+
margin-top: 10px;
|
|
437
|
+
height: 100%;
|
|
438
|
+
// color: #fff;
|
|
439
|
+
background: none;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
::v-deep .el-tree__empty-text {
|
|
443
|
+
// color: #fff;
|
|
444
|
+
font-size: 12px;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
::v-deep .el-tree-node__content:hover {
|
|
448
|
+
background: rgba(255, 255, 255, 0.7);
|
|
449
|
+
display: inline-block;
|
|
450
|
+
min-width: 100%;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
::v-deep .el-tree-node:focus>.el-tree-node__content {
|
|
454
|
+
background: rgba(255, 255, 255, 0.7);
|
|
455
|
+
display: inline-block;
|
|
456
|
+
min-width: 100%;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.title {
|
|
460
|
+
font-size: 16px;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
::v-deep .el-tree-node>.el-tree-node__children {
|
|
464
|
+
overflow: unset;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
::v-deep .el-tree .is-disabled {
|
|
468
|
+
display: none;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
::v-deep .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
|
|
472
|
+
background: rgba(255, 255, 255, 0.7);
|
|
473
|
+
display: inline-block;
|
|
474
|
+
min-width: 100%;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
::v-deep
|
|
478
|
+
.el-tree--highlight-current
|
|
479
|
+
.el-tree-node.is-current
|
|
480
|
+
> .el-tree-node__content,
|
|
481
|
+
.is-checked .el-tree-node__content {
|
|
482
|
+
color: #148ff3;
|
|
483
|
+
font-weight: bold;
|
|
484
|
+
display: inline-block;
|
|
485
|
+
min-width: 100%;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
::v-deep .el-button--text {
|
|
489
|
+
font-size: 14px;
|
|
490
|
+
color: #2e3136;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
::v-deep .el-tree-node > .el-tree-node__content {
|
|
494
|
+
height: 32px;
|
|
495
|
+
line-height: 32px;
|
|
496
|
+
display: inline-block;
|
|
497
|
+
min-width: 100%;
|
|
498
|
+
}
|
|
499
|
+
::v-deep .scrollbar{
|
|
500
|
+
height: calc(100% - 25px);
|
|
501
|
+
}
|
|
502
|
+
</style>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="proof-config">
|
|
3
|
+
<ImportModel
|
|
4
|
+
ref="importModel"
|
|
5
|
+
:defaultParams="defaultParams"
|
|
6
|
+
@viewVersion="viewVersion"
|
|
7
|
+
/>
|
|
8
|
+
<ProofHistory
|
|
9
|
+
ref="proofHistory"
|
|
10
|
+
@viewVersion="viewVersion"
|
|
11
|
+
:defaultParams="defaultParams"
|
|
12
|
+
/>
|
|
13
|
+
<ProofProjectUser :defaultParams="defaultParams" />
|
|
14
|
+
<ProofRole :defaultParams="defaultParams" />
|
|
15
|
+
<ProofPublish
|
|
16
|
+
ref="proofPublish"
|
|
17
|
+
:defaultParams="defaultParams"
|
|
18
|
+
@getVersionList="getVersionList"
|
|
19
|
+
@publishVersion="publishVersion"
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
import ImportModel from './import-model.vue';
|
|
26
|
+
import ProofHistory from './proof-history.vue';
|
|
27
|
+
import ProofProjectUser from './proof-project-user.vue';
|
|
28
|
+
import ProofPublish from './proof-publish.vue';
|
|
29
|
+
import ProofRole from './proof-role.vue';
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
name: 'ProofConfig',
|
|
33
|
+
components: {
|
|
34
|
+
ImportModel,
|
|
35
|
+
ProofHistory,
|
|
36
|
+
ProofProjectUser,
|
|
37
|
+
ProofPublish,
|
|
38
|
+
ProofRole,
|
|
39
|
+
},
|
|
40
|
+
props: {
|
|
41
|
+
defaultParams: {
|
|
42
|
+
type: Object,
|
|
43
|
+
default() {
|
|
44
|
+
return {};
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
viewVersion(item) {
|
|
50
|
+
this.$emit('viewVersion', item);
|
|
51
|
+
},
|
|
52
|
+
openImportModelDialog() {
|
|
53
|
+
this.$refs.importModel.triggerDialog();
|
|
54
|
+
},
|
|
55
|
+
ableImportModelBtn() {
|
|
56
|
+
this.$refs.importModel.ableBtn();
|
|
57
|
+
},
|
|
58
|
+
abledProofPublishBtn() {
|
|
59
|
+
this.$refs.proofPublish.ableBtn();
|
|
60
|
+
},
|
|
61
|
+
getVersionList() {
|
|
62
|
+
this.$refs.proofHistory.getList();
|
|
63
|
+
},
|
|
64
|
+
publishVersion() {
|
|
65
|
+
this.$emit('publishVersion', null);
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<style lang="scss" scoped>
|
|
72
|
+
::v-deep.proof-config {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
& > div {
|
|
77
|
+
margin-right: 24px;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
</style>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<ProofPanel
|
|
4
|
+
ref="proofPanel"
|
|
5
|
+
:defaultParams="defaultParams"
|
|
6
|
+
@selectRow="handleClickProofList"
|
|
7
|
+
@clickSaveBtn="handleProofSavelBtn"
|
|
8
|
+
/>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import { setToken } from '@/utils/auth';
|
|
14
|
+
import * as modelApi from '../api/index';
|
|
15
|
+
import ProofPanel from './proof-panel.vue'
|
|
16
|
+
export default {
|
|
17
|
+
data() {
|
|
18
|
+
return {
|
|
19
|
+
defaultParams: {
|
|
20
|
+
projectId: "",
|
|
21
|
+
stageId: "",
|
|
22
|
+
client: "",
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
components: {
|
|
27
|
+
ProofPanel
|
|
28
|
+
},
|
|
29
|
+
created() {
|
|
30
|
+
this.initDefaultParams();
|
|
31
|
+
},
|
|
32
|
+
mounted() {
|
|
33
|
+
this.getData();
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
initDefaultParams() {
|
|
37
|
+
this.defaultParams.projectId = this.$route.query.projectId;
|
|
38
|
+
this.defaultParams.stageId = this.$route.query.stageId;
|
|
39
|
+
this.defaultParams.client = this.$route.query.client;
|
|
40
|
+
this.defaultParams.token = this.$route.query.token;
|
|
41
|
+
// this.defaultParams.toProjectId = this.$route.query.toProjectId;
|
|
42
|
+
|
|
43
|
+
if(this.defaultParams.token){
|
|
44
|
+
setToken(this.defaultParams.token);
|
|
45
|
+
}
|
|
46
|
+
this.getProofProjectId();
|
|
47
|
+
},
|
|
48
|
+
// 获取数据
|
|
49
|
+
getData() {
|
|
50
|
+
if (typeof qt !== "undefined") {
|
|
51
|
+
let that = this;
|
|
52
|
+
new that.QWebChannel(qt.webChannelTransport, channel => {
|
|
53
|
+
// 获取Qt注册的对象,设置到主窗口
|
|
54
|
+
window.webTransport = channel.objects.webTransport;
|
|
55
|
+
// 接收 C++ 发送的消息
|
|
56
|
+
webTransport.SendMessageToWeb.connect(message => {
|
|
57
|
+
that.dataLoading = true;
|
|
58
|
+
that.paraObj = JSON.parse(message);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
} else {
|
|
62
|
+
console.error("初始化qwebchannel失败");
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
getProofProjectId(){
|
|
66
|
+
modelApi.getProofProjectId({
|
|
67
|
+
toProjectId: this.$route.query.projectId
|
|
68
|
+
}).then(res => {
|
|
69
|
+
if(res.code === 200){
|
|
70
|
+
if(res.data !== 0){
|
|
71
|
+
this.defaultParams.projectId = res.data;
|
|
72
|
+
this.$refs.proofPanel.init();
|
|
73
|
+
}else{
|
|
74
|
+
this.$message({ type: 'error', message: '校审项目不存在' })
|
|
75
|
+
}
|
|
76
|
+
}else{
|
|
77
|
+
this.$message({ type: 'error', message: res.msg })
|
|
78
|
+
}
|
|
79
|
+
}).catch(err => {
|
|
80
|
+
console.log(err)
|
|
81
|
+
// this.$message({ type: 'error', message: err.msg })
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
handleProofSavelBtn(data) {
|
|
85
|
+
const postData = {
|
|
86
|
+
...data,
|
|
87
|
+
stageId: this.defaultParams.stageId
|
|
88
|
+
};
|
|
89
|
+
if (_.isEmpty(data.id)) {
|
|
90
|
+
postData.projectId = this.defaultParams.projectId;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
this.$refs.proofPanel.saveForm(postData);
|
|
94
|
+
},
|
|
95
|
+
handleClickProofList(data) {
|
|
96
|
+
const { position } = data;
|
|
97
|
+
// const { cameraPosition, cameraTarget } = JSON.parse(position);
|
|
98
|
+
|
|
99
|
+
// 向客户端发送数据
|
|
100
|
+
if (typeof qt !== "undefined") {
|
|
101
|
+
new this.QWebChannel(qt.webChannelTransport, function(channel) {
|
|
102
|
+
// 获取Qt注册的对象,设置到主窗口
|
|
103
|
+
window.webTransport = channel.objects.webTransport;
|
|
104
|
+
webTransport.AcceptWebData(position);
|
|
105
|
+
});
|
|
106
|
+
} else {
|
|
107
|
+
console.error("初始化qwebchannel失败");
|
|
108
|
+
}
|
|
109
|
+
// // 视点
|
|
110
|
+
// this.animateCamera(
|
|
111
|
+
// cameraPosition.x,
|
|
112
|
+
// cameraPosition.y,
|
|
113
|
+
// cameraPosition.z,
|
|
114
|
+
// cameraTarget.x,
|
|
115
|
+
// cameraTarget.y,
|
|
116
|
+
// cameraTarget.z
|
|
117
|
+
// );
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
</script>
|
|
122
|
+
|
|
123
|
+
<style lang="scss" scoped></style>
|