Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
mmc-stl-vue2
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
mmc-stl-vue2
Commits
27917c45
提交
27917c45
authored
5月 30, 2025
作者:
温凯
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(uav列表项): 添加MQTT连接检查并优化面板显示逻辑
上级
51b7abae
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
143 行增加
和
36 行删除
+143
-36
index.vue
...ponents/uavList/components/list/components/item/index.vue
+143
-36
没有找到文件。
src/components/MMCFlightControlCenter/components/uavApplications/components/uavList/components/list/components/item/index.vue
浏览文件 @
27917c45
<
template
>
<
template
>
<div
class=
"cpt-app-uav-list"
>
<div
class=
"cpt-app-uav-list"
>
<div
class=
"uav-item-box"
>
<div
class=
"uav-item-box"
>
<div
class=
"uav-item-inner"
@
click=
"$set(data, 'collapse', !data.collapse)"
>
<div
class=
"uav-item-inner"
@
click=
"$set(data, 'collapse', !data.collapse)"
>
<div
class=
"title-box"
>
<div
class=
"title-box"
>
<span
class=
"el-icon-caret-right"
:class=
"
{ collapse: data.collapse }">
</span>
<span
<img
class=
"level-icon"
src=
"./assets/images/uav_item1_1.png"
v-if=
"level === 1"
/>
class=
"el-icon-caret-right"
<img
class=
"level-icon"
src=
"./assets/images/uav_item2.svg"
v-if=
"level === 2"
/>
:class=
"
{ collapse: data.collapse }"
<img
class=
"level-icon"
src=
"./assets/images/uav_item3.svg"
v-if=
"level === 3"
/>
>
</span>
<img
class=
"level-icon"
src=
"./assets/images/uav_item1_1.png"
v-if=
"level === 1"
/>
<img
class=
"level-icon"
src=
"./assets/images/uav_item2.svg"
v-if=
"level === 2"
/>
<img
class=
"level-icon"
src=
"./assets/images/uav_item3.svg"
v-if=
"level === 3"
/>
<div
class=
"org-name"
:title=
"data.name"
>
{{
data
.
name
}}
</div>
<div
class=
"org-name"
:title=
"data.name"
>
{{
data
.
name
}}
</div>
<i
class=
"refresh-icon el-icon-refresh-right"
v-if=
"level === 1"
@
click
.
stop=
"$emit('refresh')"
/>
<i
class=
"refresh-icon el-icon-refresh-right"
v-if=
"level === 1"
@
click
.
stop=
"$emit('refresh')"
/>
</div>
</div>
<div
class=
"online-info"
>
<div
class=
"online-info"
>
(共
{{
data
.
onLineCount
+
data
.
offLineCount
}}
架
(共
{{
data
.
onLineCount
+
data
.
offLineCount
}}
架
<span
class=
"ml10"
:class=
"
{ online: data.onLineCount }">
{{
data
.
onLineCount
}}
在线
</span>
<span
class=
"ml10"
:class=
"
{ online: data.onLineCount }"
>
{{
data
.
onLineCount
}}
在线
</span
>
/
/
{{
data
.
offLineCount
}}
离线)
{{
data
.
offLineCount
}}
离线)
</div>
</div>
</div>
</div>
<div
class=
"uav-item-child-box"
:class=
"
{ collapse: data.collapse }">
<div
class=
"uav-item-child-box"
:class=
"
{ collapse: data.collapse }">
<Item
v-for=
"child in data.child"
:key=
"child.deptId"
:data=
"child"
:level=
"level + 1"
<Item
@
refresh=
"$emit('refresh')"
/>
v-for=
"child in data.child"
<div
class=
"device-item-box"
:class=
"
{ online: device.isOnline }" v-for="device in data.deviceDOList"
:key=
"child.deptId"
:key="`device_${device.deviceId}`">
:data=
"child"
:level=
"level + 1"
@
refresh=
"$emit('refresh')"
/>
<div
class=
"device-item-box"
:class=
"
{ online: device.isOnline }"
v-for="device in data.deviceDOList"
:key="`device_${device.deviceId}`"
>
<div
class=
"device-name"
>
<div
class=
"device-name"
>
<!--
<span
<!--
<span
style=
"margin-right:10px"
style=
"margin-right:10px"
:class=
"device.status==1&&device.currentOperator==1? 'blue' : device.status==1&&device.currentOperator!=1 ?'yellow':'' "
:class=
"device.status==1&&device.currentOperator==1? 'blue' : device.status==1&&device.currentOperator!=1 ?'yellow':'' "
:title=
"device.name"
:title=
"device.name"
>
{{
device
.
name
}}
</span>
-->
>
{{
device
.
name
}}
</span>
-->
<span
class=
"device-name-text"
style=
"margin-right:10px"
:class=
"'blue'"
:title=
"device.name"
>
{{
device
.
name
}}
</span>
<span
<span
style=
"color:#31DB24 "
class=
"dib"
v-if=
"device.isOnline"
>
(在线)
</span>
class=
"device-name-text"
style=
"margin-right: 10px"
:class=
"'blue'"
:title=
"device.name"
>
{{
device
.
name
}}
</span
>
<span
style=
"color: #31db24"
class=
"dib"
v-if=
"device.isOnline"
>
(在线)
</span
>
<span
v-else
class=
"dib"
>
(离线)
</span>
<span
v-else
class=
"dib"
>
(离线)
</span>
<div
class=
"symbol-icon-box"
>
<div
class=
"symbol-icon-box"
>
<!--
<template
v-if=
"device.modelName && device.modelName.includes('入云龙1')"
>
<!--
<template
v-if=
"device.modelName && device.modelName.includes('入云龙1')"
>
...
@@ -58,27 +99,67 @@
...
@@ -58,27 +99,67 @@
</div>
</div>
</div>
</div>
<div
class=
"device-fns"
>
<div
class=
"device-fns"
>
<div
v-if=
"showVideoPanel"
class=
"iconfont icon-luxiang_xianxing"
<div
:class=
"{ active: uav && device.deviceId === uav.deviceId && uav.showPlayer }"
title=
"视频"
v-if=
"showVideoPanel"
@
click=
"onShowPlayer(device)"
v-hover
></div>
class=
"iconfont icon-luxiang_xianxing"
<div
class=
"iconfont icon-kongzhi_xianxing"
:class=
"{
:class=
"{ active: uav && device.deviceId === uav.deviceId && uav.showPanel }"
title=
"控制面板"
active:
@
click=
"onShowPanel(device)"
v-hover
></div>
uav && device.deviceId === uav.deviceId && uav.showPlayer,
<div
class=
"takeover"
title=
"接管"
@
click=
"onTakeOver(device, data.name)"
v-hover
>
}"
<img
src=
"./assets/images/jieguan_active.svg"
v-if=
"device.currentOperator === userInfo.id"
/>
title=
"视频"
@
click=
"onShowPlayer(device)"
v-hover
></div>
<div
class=
"iconfont icon-kongzhi_xianxing"
:class=
"{
active:
uav && device.deviceId === uav.deviceId && uav.showPanel,
}"
title=
"控制面板"
@
click=
"onShowPanel(device)"
v-hover
></div>
<div
class=
"takeover"
title=
"接管"
@
click=
"onTakeOver(device, data.name)"
v-hover
>
<img
src=
"./assets/images/jieguan_active.svg"
v-if=
"device.currentOperator === userInfo.id"
/>
<img
src=
"./assets/images/jieguan.svg"
v-else
/>
<img
src=
"./assets/images/jieguan.svg"
v-else
/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<el-dialog
title=
"接管确认"
:visible
.
sync=
"takeOverVisible"
width=
"20%"
:modal-append-to-body=
"false"
<el-dialog
:append-to-body=
"false"
:close-on-click-modal=
"false"
@
close=
"takeLoading = false"
>
title=
"接管确认"
:visible
.
sync=
"takeOverVisible"
width=
"20%"
:modal-append-to-body=
"false"
:append-to-body=
"false"
:close-on-click-modal=
"false"
@
close=
"takeLoading = false"
>
<span>
是否请求接管 {{ departmentName }} 下的 {{ takeDevice.name }}
</span>
<span>
是否请求接管 {{ departmentName }} 下的 {{ takeDevice.name }}
</span>
<span
slot=
"footer"
class=
"dialog-footer"
>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"takeOverVisible = false"
>
取 消
</el-button>
<el-button
@
click=
"takeOverVisible = false"
>
取 消
</el-button>
<el-button
@
click=
"onForceTakeOver"
type=
"danger"
:loading=
"forceTakeLoading"
>
强制接管
</el-button>
<el-button
<el-button
type=
"primary"
@
click=
"onApplyTakeOver"
:loading=
"takeLoading"
>
确 认
</el-button>
@
click=
"onForceTakeOver"
type=
"danger"
:loading=
"forceTakeLoading"
>
强制接管
</el-button
>
<el-button
type=
"primary"
@
click=
"onApplyTakeOver"
:loading=
"takeLoading"
>
确 认
</el-button
>
</span>
</span>
</el-dialog>
</el-dialog>
</div>
</div>
...
@@ -124,8 +205,14 @@ export default {
...
@@ -124,8 +205,14 @@ export default {
"userInfo"
,
"userInfo"
,
"showAirwayEdit"
,
"showAirwayEdit"
,
"deptId"
,
"deptId"
,
'showVideoPanel'
,
"showVideoPanel"
,
]),
]),
mqttUrl
()
{
return
this
.
$store
.
state
.
MMCFlightControlCenter
.
mqttUrl
;
},
mqttToken
()
{
return
this
.
$store
.
state
.
MMCFlightControlCenter
.
mqttToken
;
},
},
},
watch
:
{
watch
:
{
showAirwayEdit
(
newVal
)
{
showAirwayEdit
(
newVal
)
{
...
@@ -160,7 +247,7 @@ export default {
...
@@ -160,7 +247,7 @@ export default {
title
:
"接管消息"
,
title
:
"接管消息"
,
message
:
msg
,
message
:
msg
,
duration
:
30000
,
duration
:
30000
,
offset
:
40
offset
:
40
,
});
});
this
.
$emit
(
"refresh"
);
this
.
$emit
(
"refresh"
);
this
.
takeOverVisible
=
false
;
this
.
takeOverVisible
=
false
;
...
@@ -169,7 +256,7 @@ export default {
...
@@ -169,7 +256,7 @@ export default {
title
:
"接管消息"
,
title
:
"接管消息"
,
message
:
msg
,
message
:
msg
,
duration
:
30000
,
duration
:
30000
,
offset
:
40
offset
:
40
,
});
});
this
.
$message
.
warning
(
"申请接管拒绝"
);
this
.
$message
.
warning
(
"申请接管拒绝"
);
}
}
...
@@ -196,7 +283,7 @@ export default {
...
@@ -196,7 +283,7 @@ export default {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
if
(
this
.
takeLoading
)
{
if
(
this
.
takeLoading
)
{
this
.
$message
.
error
(
`接管失败,申请单位未同意`
);
this
.
$message
.
error
(
`接管失败,申请单位未同意`
);
this
.
takeLoading
=
false
this
.
takeLoading
=
false
;
}
}
},
5500
);
},
5500
);
},
},
...
@@ -214,7 +301,7 @@ export default {
...
@@ -214,7 +301,7 @@ export default {
this
.
takeOverVisible
=
false
;
this
.
takeOverVisible
=
false
;
this
.
$emit
(
"refresh"
);
this
.
$emit
(
"refresh"
);
}
}
}
catch
(
e
)
{
}
}
catch
(
e
)
{}
this
.
forceTakeLoading
=
false
;
this
.
forceTakeLoading
=
false
;
},
},
...
@@ -256,7 +343,7 @@ export default {
...
@@ -256,7 +343,7 @@ export default {
this
.
$message
.
success
(
`已退出接管
${
uav
.
name
}
`
);
this
.
$message
.
success
(
`已退出接管
${
uav
.
name
}
`
);
this
.
$emit
(
"refresh"
);
this
.
$emit
(
"refresh"
);
}
}
}
catch
(
e
)
{
}
}
catch
(
e
)
{}
}
else
{
}
else
{
// 已被接管且接管人不是自已的情况下, 需要申请接管
// 已被接管且接管人不是自已的情况下, 需要申请接管
this
.
takeDevice
=
uav
;
this
.
takeDevice
=
uav
;
...
@@ -264,9 +351,30 @@ export default {
...
@@ -264,9 +351,30 @@ export default {
}
}
},
},
/**
/**
* 显示面板
* 显示面板
点击面板时判断mqtt是否连接
*/
*/
async
onShowPanel
(
item
)
{
async
onShowPanel
(
item
)
{
let
client
=
this
.
$store
.
state
.
MMCMQTT
.
client
;
console
.
log
(
"client"
,
client
);
if
(
!
client
||
!
client
.
connected
)
{
try
{
this
.
$store
.
dispatch
(
"MMCMQTT/init"
,
{
url
:
this
.
mqttUrl
,
password
:
this
.
mqttToken
,
})
.
then
(()
=>
{
console
.
log
(
"mqtt连接成功"
);
});
}
catch
(
e
)
{
console
.
log
(
"mqtt失败"
,
e
);
}
// setTimeout(() => {
// this.onShowPanel(item);
// }, 200);
// return;
}
// 选中与取消选中
// 选中与取消选中
if
(
this
.
uav
?.
deviceId
===
item
.
deviceId
)
{
if
(
this
.
uav
?.
deviceId
===
item
.
deviceId
)
{
// 已打开播放器的情况下只需要展示数据面板
// 已打开播放器的情况下只需要展示数据面板
...
@@ -523,12 +631,12 @@ export default {
...
@@ -523,12 +631,12 @@ export default {
width
:
calc
(
100%
-
90px
);
width
:
calc
(
100%
-
90px
);
white-space
:
nowrap
;
white-space
:
nowrap
;
font-size
:
13px
;
font-size
:
13px
;
.device-name-text{
.device-name-text
{
display
:
inline-block
;
display
:
inline-block
;
max-width
:
100%
;
max-width
:
100%
;
white-space
:
nowrap
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
overflow
:
hidden
overflow
:
hidden
;
}
}
}
}
...
@@ -634,4 +742,4 @@ export default {
...
@@ -634,4 +742,4 @@ export default {
height
:
8px
;
height
:
8px
;
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论