Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
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
cd0ee0b5
Commit
cd0ee0b5
authored
Sep 06, 2024
by
李苏
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增标记列表与溯源功能和模型联动
parent
ff4a3322
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
139 additions
and
4 deletions
+139
-4
index.vue
src/views/yhlywsytst/yhlywsytst/index.vue
+139
-4
No files found.
src/views/yhlywsytst/yhlywsytst/index.vue
View file @
cd0ee0b5
...
@@ -274,6 +274,32 @@
...
@@ -274,6 +274,32 @@
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 溯源标记列表-->
<div
v-show=
"sylbshow"
class=
"sylb"
>
<div
class=
"full data-box1"
style=
"position: relative;"
>
<i
@
click=
"sylbshow=false"
style=
"position: absolute;right: 1px;top: 2px;color: #68D8FE;cursor: pointer;z-index: 999;"
class=
"el-icon-error"
></i>
<i
class=
"topL"
></i>
<i
class=
"topR"
></i>
<i
class=
"bottomL"
></i>
<i
class=
"bottomR"
></i>
<div
class=
"data-title1"
>
<b
class=
"data-title-left"
>
[
</b>
<span>
溯源列表
</span>
<b
class=
"data-title-right"
>
]
</b>
</div>
<div
class=
"full"
style=
"padding: 10px;;padding-top: 15px;height: calc(100% - 14px);"
>
<div
class=
"full tagContainer"
>
<el-tag
:key=
"index"
@
click=
"clickTag(item.model.name)"
:class=
"
{
'tagActive':item.model.name==selectedModel.name,
'tagNoActive':item.model.name!=selectedModel.name
}" style="cursor: pointer;overflow: hidden;text-align: center;"
v-for="(item,index) in jzReMaterialQue">
{{
item
.
model
.
name
}}
</el-tag>
</div>
</div>
</div>
</div>
<!-- 右侧操作边框-->
<!-- 右侧操作边框-->
<!--
<div
class=
"rightOpt"
ref=
"rightOpt"
>
<!--
<div
class=
"rightOpt"
ref=
"rightOpt"
>
...
@@ -447,8 +473,11 @@
...
@@ -447,8 +473,11 @@
modelLoader
:
null
,
modelLoader
:
null
,
/* */
/* */
reMaterialQue
:
[],
reMaterialQue
:
[],
jzReMaterialQue
:
[],
jzReMaterialQue
:
[
allFlowObject
:
[]
],
allFlowObject
:
[],
sylbshow
:
false
}
}
},
},
...
@@ -488,8 +517,7 @@
...
@@ -488,8 +517,7 @@
apiGetYwxx
()
{
apiGetYwxx
()
{
this
.
$post
(
'ywxxgl/uywxx/query'
,
{
this
.
$post
(
'ywxxgl/uywxx/query'
,
{
sbxxCode
:
this
.
selectedModel
.
name
,
sbxxCode
:
this
.
selectedModel
.
name
,
}
}).
then
(
res
=>
{
).
then
(
res
=>
{
this
.
ywlistData
=
res
.
data
.
records
||
[]
this
.
ywlistData
=
res
.
data
.
records
||
[]
})
})
},
},
...
@@ -500,6 +528,65 @@
...
@@ -500,6 +528,65 @@
this
.
jxlistData
=
res
.
data
.
records
||
[]
this
.
jxlistData
=
res
.
data
.
records
||
[]
})
})
},
},
clickTag
(
code
)
{
if
(
!
code
)
{
return
}
else
{
this
.
sbxxQueryParams
.
code
=
code
.
replace
(
/
\s
+/g
,
''
);
/* 查询*/
let
iscx
=
false
this
.
viewer
.
scene
.
traverse
((
model
)
=>
{
if
(
model
.
isMesh
)
{
if
(
model
.
name
==
this
.
sbxxQueryParams
.
code
)
{
this
.
selectedModel
=
model
iscx
=
true
/* 执行并情况材料队列 */
this
.
reMaterialQue
.
forEach
(
item
=>
{
item
.
revert
()
})
this
.
reMaterialQue
.
splice
(
0
,
this
.
reMaterialQue
.
length
)
/* 添加材质模型队列*/
let
reMaterialQueItem
=
{
model
,
material
:
model
.
material
.
clone
(),
revert
:
function
()
{
this
.
model
.
material
=
this
.
material
}
}
this
.
reMaterialQue
.
push
(
reMaterialQueItem
)
model
.
material
=
new
THREE
.
MeshPhongMaterial
({
color
:
new
THREE
.
Color
(
'rgba(255, 255, 0, 0.8)'
),
transparent
:
true
,
opacity
:
0.8
,
wireframe
:
false
,
})
/* */
if
(
this
.
xzjj
)
{
const
object
=
model
;
if
(
object
)
{
this
.
viewer
.
cameraControl
.
fitTo
(
object
);
}
}
}
}
});
if
(
iscx
==
false
)
{
this
.
sbcxwcxdxx
=
true
this
.
sbcxwcxdxxText
=
'未查询到设备!'
setTimeout
(()
=>
{
this
.
sbcxwcxdxx
=
false
},
2000
)
}
}
},
sbcx
()
{
sbcx
()
{
if
(
!
this
.
sbxxQueryParams
.
code
)
{
if
(
!
this
.
sbxxQueryParams
.
code
)
{
this
.
sbcxwcxdxx
=
true
this
.
sbcxwcxdxx
=
true
...
@@ -569,6 +656,7 @@
...
@@ -569,6 +656,7 @@
this
.
jzReMaterialQue
.
forEach
(
item
=>
{
this
.
jzReMaterialQue
.
forEach
(
item
=>
{
item
.
revert
()
item
.
revert
()
})
})
this
.
jzReMaterialQue
.
splice
(
0
,
this
.
jzReMaterialQue
.
length
)
this
.
$post
(
'ksh/query'
,
this
.
$post
(
'ksh/query'
,
this
.
queryParams
this
.
queryParams
).
then
(
res
=>
{
).
then
(
res
=>
{
...
@@ -579,6 +667,7 @@
...
@@ -579,6 +667,7 @@
this
.
viewer
.
scene
.
traverse
((
model
)
=>
{
this
.
viewer
.
scene
.
traverse
((
model
)
=>
{
if
(
model
.
isMesh
)
{
if
(
model
.
isMesh
)
{
if
(
sbxxCodeList
.
includes
(
model
.
name
))
{
if
(
sbxxCodeList
.
includes
(
model
.
name
))
{
let
jzReMaterialQueItem
=
{
let
jzReMaterialQueItem
=
{
model
,
model
,
material
:
model
.
material
.
clone
(),
material
:
model
.
material
.
clone
(),
...
@@ -597,6 +686,13 @@
...
@@ -597,6 +686,13 @@
}
}
}
}
});
});
if
(
this
.
jzReMaterialQue
.
length
!=
0
)
{
this
.
viewer
.
cameraControl
.
fitTo
(
this
.
jzReMaterialQue
[
0
].
model
);
this
.
sylbshow
=
true
this
.
clickTag
(
this
.
jzReMaterialQue
[
0
].
model
.
name
)
}
else
{
this
.
sylbshow
=
false
}
...
@@ -1180,6 +1276,18 @@
...
@@ -1180,6 +1276,18 @@
background-color
:
rgba
(
0
,
0
,
0
,
0
.6
);
background-color
:
rgba
(
0
,
0
,
0
,
0
.6
);
}
}
.sylb
{
top
:
215px
;
right
:
15px
;
/* 使元素居中 */
position
:
absolute
;
height
:
250px
;
width
:
28%
;
z-index
:
12
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.6
);
}
.topL
{
.topL
{
width
:
20px
;
width
:
20px
;
...
@@ -1315,4 +1423,31 @@
...
@@ -1315,4 +1423,31 @@
height
:
calc
(
100%
-
4vh
);
height
:
calc
(
100%
-
4vh
);
overflow
:
hidden
;
overflow
:
hidden
;
}
}
.tagContainer
{
overflow
:
auto
;
display
:
grid
;
grid-template-columns
:
repeat
(
4
,
1fr
);
/* 每行展示5个 */
grid-auto-rows
:
40px
;
/* 每个项目的高度为40px */
gap
:
10px
;
/* 可选:设置项目之间的间距 */
}
.
tagContainer
:
:-
webkit-scrollbar
{
display
:
none
;
/* 对于WebKit浏览器 */
}
.tagActive
{
background-color
:
#83c7e3
;
color
:
#fff
;
}
.tagNoActive
{
background-color
:
rgba
(
0
,
0
,
0
,
0
.6
);
color
:
#68D8FE
;
}
</
style
>
</
style
>
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