Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zghywpc-vue
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李苏
zghywpc-vue
Commits
77eb5233
Commit
77eb5233
authored
Sep 10, 2024
by
李苏
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决 接口高亮和单选的颜色冲突的问题bug
parent
e5d1a624
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
index.vue
src/views/yhlywsytst/yhlywsytst/index.vue
+27
-4
No files found.
src/views/yhlywsytst/yhlywsytst/index.vue
View file @
77eb5233
...
...
@@ -655,6 +655,8 @@
let
params
=
_
.
cloneDeep
(
this
.
queryParams
)
delete
params
.
sbxxCode
/* 先清空 选中的机组*/
this
.
jzReMaterialQue
.
forEach
(
item
=>
{
item
.
revert
()
})
...
...
@@ -667,16 +669,28 @@
let
sbxxList
=
res
.
data
.
records
||
[]
this
.
$success
(
`已标记
${
sbxxList
.
length
}
个设备`
)
const
sbxxCodeList
=
sbxxList
.
map
(
item
=>
item
.
sbxxCode
)
/* 解决 先缓存选中色,后渲染黄色,默认选中时颜色不对
bug: 1默认还原为原色
2.高亮为黄色触发默认选中(黄色存储在另一个队列)
3.默认选中会还原上一个颜色
4.还原为原色,触发选中。变为选中色,清除为原色,覆盖了亮色
*/
if
(
sbxxCodeList
.
length
!=
0
){
this
.
reMaterialQue
.
forEach
(
item
=>
{
item
.
revert
()
})
}
this
.
reMaterialQue
.
splice
(
0
,
this
.
reMaterialQue
.
length
)
/* 分割,在渲染高亮清空选中的*/
this
.
viewer
.
scene
.
traverse
((
model
)
=>
{
if
(
model
.
isMesh
)
{
if
(
sbxxCodeList
.
includes
(
model
.
name
))
{
console
.
log
(
model
.
name
,
'ces'
)
let
jzReMaterialQueItem
=
{
model
,
material
:
model
.
material
.
clone
(),
material
:
model
.
old
material
.
clone
(),
revert
:
function
()
{
model
.
material
=
this
.
material
this
.
model
.
material
=
this
.
material
}
}
this
.
jzReMaterialQue
.
push
(
jzReMaterialQueItem
)
...
...
@@ -691,6 +705,8 @@
}
});
if
(
this
.
jzReMaterialQue
.
length
!=
0
)
{
this
.
viewer
.
cameraControl
.
fitTo
(
this
.
jzReMaterialQue
[
0
].
model
);
this
.
sylbshow
=
true
this
.
clickTag
(
this
.
jzReMaterialQue
[
0
].
model
.
name
)
...
...
@@ -917,6 +933,11 @@
model
.
addEventListener
(
"loaded"
,
()
=>
{
this
.
loading
=
false
this
.
viewer
.
scene
.
traverse
(
model
=>
{
if
(
model
.
isMesh
)
{
model
.
oldmaterial
=
model
.
material
.
clone
()
}
})
});
this
.
viewer
.
scene
.
add
(
model
);
...
...
@@ -976,6 +997,7 @@
model
=
intersects
[
0
].
object
}
this
.
selectedModel
=
model
/* 执行并情况材料队列 */
this
.
reMaterialQue
.
forEach
(
item
=>
{
item
.
revert
()
...
...
@@ -991,6 +1013,7 @@
this
.
model
.
material
=
this
.
material
}
}
this
.
reMaterialQue
.
push
(
reMaterialQueItem
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment