Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
mmc-stl-vue2
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
mmc-stl-vue2
Commits
8bdc61f3
提交
8bdc61f3
authored
8月 06, 2025
作者:
温凯
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'v4' 到 'v4_master'
V4 查看合并请求
!10
上级
cfb8b7d6
8d19e538
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
185 行增加
和
35 行删除
+185
-35
index.js
iframe/src/i18n/index.js
+1
-1
ru.js
iframe/src/i18n/locales/ru.js
+4
-4
index.vue
...ControlCenter/components/hangar/components/list/index.vue
+40
-1
index.vue
...ponents/uavList/components/list/components/item/index.vue
+3
-2
index.vue
...Applications/components/uavList/components/list/index.vue
+51
-1
index.vue
...r/components/uavApplications/components/uavList/index.vue
+0
-0
index.vue
src/components/MMCFlightControlCenter/index.vue
+86
-26
没有找到文件。
iframe/src/i18n/index.js
浏览文件 @
8bdc61f3
...
...
@@ -25,7 +25,7 @@ const mergedMessages = {
}
const
i18n
=
new
VueI18n
({
locale
:
localStorage
.
getItem
(
'language'
)
||
'
en
'
,
// 从localStorage获取语言设置,默认英文
locale
:
localStorage
.
getItem
(
'language'
)
||
'
zh
'
,
// 从localStorage获取语言设置,默认英文
fallbackLocale
:
'zh'
,
// 回退语言
messages
:
mergedMessages
})
...
...
iframe/src/i18n/locales/ru.js
浏览文件 @
8bdc61f3
...
...
@@ -292,10 +292,10 @@ export default {
// "定时飞行": "Запланированный ",
// "周期飞行": "Периодический ",
// "蛙跳飞行": "Прыжковый ",
常态飞行
:
"
Обычн.
"
,
定时飞行
:
"
Запл.
"
,
周期飞行
:
"
Период.
"
,
蛙跳飞行
:
"
Прыжк.
"
,
常态飞行
:
"
стандарт
"
,
定时飞行
:
"
регулярный
"
,
周期飞行
:
"
цикл
"
,
蛙跳飞行
:
"
чехарда
"
,
// airwayEdit组件
手动规划
:
"Ручное планирование"
,
...
...
src/components/MMCFlightControlCenter/components/hangar/components/list/index.vue
浏览文件 @
8bdc61f3
...
...
@@ -47,12 +47,12 @@
import
{
Control_API
}
from
"../../../../api"
;
import
Item
from
"./components/item"
;
import
{
mapState
}
from
"vuex"
;
import
mock
from
'./mock'
;
export
default
{
name
:
"List"
,
props
:
{},
components
:
{
Item
},
inject
:
[
"bus"
],
data
()
{
return
{
list
:
/* mock */
[],
...
...
@@ -102,6 +102,7 @@ export default {
mounted
()
{
this
.
getList
();
this
.
bus
.
$on
(
"uas-device-getTree-message"
,
this
.
initList
);
this
.
bus
.
$on
(
"update-hangar-list"
,
this
.
updateHangarList
);
// this.timeHandle = setInterval(() => {
// this.getList();
// }, 10000);
...
...
@@ -123,6 +124,44 @@ export default {
onUavSearch
()
{
this
.
getList
();
},
/**
* 更新机库列表数据
*/
updateHangarList
(
data
)
{
console
.
log
(
'接收到hangar列表更新数据:'
,
data
);
// 保留原有的isCheck和collapse状态
const
oldList
=
this
.
list
;
const
newList
=
JSON
.
parse
(
JSON
.
stringify
(
data
)).
map
(
newItem
=>
{
const
oldItem
=
oldList
.
find
(
old
=>
old
.
id
===
newItem
.
id
);
if
(
oldItem
)
{
if
(
oldItem
.
isCheck
!==
undefined
)
{
newItem
.
isCheck
=
oldItem
.
isCheck
;
}
if
(
oldItem
.
collapse
!==
undefined
)
{
newItem
.
collapse
=
oldItem
.
collapse
;
}
}
// 如果有子设备,也需要保留子设备的isCheck和collapse状态
if
(
newItem
.
children
&&
oldItem
&&
oldItem
.
children
)
{
newItem
.
children
=
newItem
.
children
.
map
(
newChild
=>
{
const
oldChild
=
oldItem
.
children
.
find
(
old
=>
old
.
id
===
newChild
.
id
);
if
(
oldChild
)
{
if
(
oldChild
.
isCheck
!==
undefined
)
{
newChild
.
isCheck
=
oldChild
.
isCheck
;
}
if
(
oldChild
.
collapse
!==
undefined
)
{
newChild
.
collapse
=
oldChild
.
collapse
;
}
}
return
newChild
;
});
}
return
newItem
;
});
this
.
list
=
newList
;
},
},
};
</
script
>
...
...
src/components/MMCFlightControlCenter/components/uavApplications/components/uavList/components/list/components/item/index.vue
浏览文件 @
8bdc61f3
...
...
@@ -3,7 +3,7 @@
<div
class=
"uav-item-box"
>
<div
class=
"uav-item-inner"
@
click=
"$set(data, 'collapse', !data.collapse)"
@
click=
"$set(data, 'collapse', !data.collapse)"
>
<div
class=
"title-box"
>
<span
...
...
@@ -91,7 +91,8 @@
</div>
</
template
>
-->
<
template
>
<div
class=
"uav_version status-icon cp"
>
<div
class=
"uav_versioncp"
>
<!-- status-icon -->
<!--
<img
src=
"./assets/images/I.svg"
/>
<img
src=
"./assets/images/I.svg"
/>
-->
{{
device
.
modelName
}}
...
...
src/components/MMCFlightControlCenter/components/uavApplications/components/uavList/components/list/index.vue
浏览文件 @
8bdc61f3
...
...
@@ -39,13 +39,63 @@ export default {
},
watch
:
{
list
:
{
immediate
:
true
,
deep
:
true
,
handler
(
val
)
{
if
(
!
val
||
!
Array
.
isArray
(
val
))
{
this
.
wsList
=
[];
return
;
}
// 保留原有的状态(collapse 和 isCheck)
if
(
this
.
wsList
&&
this
.
wsList
.
length
>
0
)
{
const
preserveStates
=
(
newItems
,
oldItems
)
=>
{
newItems
.
forEach
(
newItem
=>
{
const
oldItem
=
oldItems
.
find
(
old
=>
old
.
deptId
===
newItem
.
deptId
);
if
(
oldItem
)
{
// 保留 collapse 状态
if
(
oldItem
.
hasOwnProperty
(
'collapse'
))
{
this
.
$set
(
newItem
,
'collapse'
,
oldItem
.
collapse
);
}
else
{
// 如果旧数据没有 collapse 属性,设置默认值为 false(收起状态)
this
.
$set
(
newItem
,
'collapse'
,
false
);
}
// 保留 isCheck 状态
if
(
oldItem
.
hasOwnProperty
(
'isCheck'
))
{
this
.
$set
(
newItem
,
'isCheck'
,
oldItem
.
isCheck
);
}
}
else
{
// 如果是新项目,设置默认的 collapse 状态
this
.
$set
(
newItem
,
'collapse'
,
false
);
}
// 处理子项
if
(
newItem
.
child
&&
oldItem
&&
oldItem
.
child
)
{
preserveStates
(
newItem
.
child
,
oldItem
.
child
);
}
});
};
preserveStates
(
val
,
this
.
wsList
);
}
else
{
// 初始化时确保每个项目都有 collapse 状态
const
initializeStates
=
(
items
)
=>
{
items
.
forEach
(
item
=>
{
if
(
!
item
.
hasOwnProperty
(
'collapse'
))
{
this
.
$set
(
item
,
'collapse'
,
false
);
}
// 处理子项
if
(
item
.
child
&&
Array
.
isArray
(
item
.
child
))
{
initializeStates
(
item
.
child
);
}
});
};
initializeStates
(
val
);
}
this
.
wsList
=
val
;
},
},
},
mounted
()
{
this
.
wsList
=
this
.
list
;
// watcher with immediate: true will handle initialization
},
methods
:
{
},
...
...
src/components/MMCFlightControlCenter/components/uavApplications/components/uavList/index.vue
浏览文件 @
8bdc61f3
差异被折叠。
点击展开。
src/components/MMCFlightControlCenter/index.vue
浏览文件 @
8bdc61f3
...
...
@@ -91,9 +91,10 @@ export default {
},
data
()
{
return
{
time
:
null
,
bus
:
new
Vue
(),
ws
:
null
,
uavWs
:
null
uavWs
:
null
};
},
provide
()
{
...
...
@@ -103,14 +104,6 @@ export default {
};
},
watch
:
{
'scene'
:
{
handler
(
newVal
)
{
if
(
newVal
)
{
this
.
reset
()
}
},
},
userInfo
:
{
immediate
:
true
,
handler
()
{
...
...
@@ -200,6 +193,7 @@ export default {
},
beforeCreate
()
{
clearInterval
(
this
.
time
)
crashMonitor
({
alert
:
this
.
$alert
,
});
...
...
@@ -228,11 +222,12 @@ export default {
window
.
$mmc_stl
.
viewer
=
this
.
cesiumViewer
;
}
// 连接ws监听接管请求数据
let
url
=
this
.
url
.
wsUrl
let
token
=
this
.
$store
.
state
.
MMCFlightControlCenter
.
token
const
socket
=
new
WebSocket
(
`
${
url
}
/infra/ws?token=
${
token
}
`
);
const
uavSocket
=
new
WebSocket
(
`
${
url
}
/ua
v
/ws?token=
${
token
}
`
);
const
uavSocket
=
new
WebSocket
(
`
${
url
}
/ua
s
/ws?token=
${
token
}
`
);
this
.
ws
=
socket
;
this
.
uavWs
=
uavSocket
;
socket
.
onopen
=
function
()
{
...
...
@@ -286,11 +281,6 @@ export default {
// 接管申请同意
case
"uas-device-take-agree-message"
:
console
.
log
(
'同意接管'
)
this
.
bus
.
$emit
(
"uas-device-take-agree-message"
,
{
type
,
content
,
msg
,
});
break
;
// 接管申请拒绝
...
...
@@ -308,7 +298,7 @@ export default {
title
:
"接管消息"
,
message
:
msg
,
duration
:
30000
,
offset
:
40
offset
:
40
});
break
;
...
...
@@ -318,12 +308,34 @@ export default {
title
:
"接管消息"
,
message
:
msg
,
duration
:
30000
,
offset
:
40
offset
:
40
});
break
;
}
};
uavSocket
.
onopen
=
function
()
{
uavSocket
.
onopen
=
()
=>
{
let
user
=
JSON
.
parse
(
localStorage
.
getItem
(
'tmj'
))
let
{
projectId
}
=
this
.
$store
.
state
.
MMCFlightControlCenter
;
if
(
user
){
clearInterval
(
this
.
time
)
this
.
time
=
setInterval
(()
=>
{
const
scene
=
this
.
getQueryParam
(
'scene'
);
uavSocket
.
send
(
JSON
.
stringify
({
type
:
"uas-device-getTree-message"
,
content
:
JSON
.
stringify
(
{
text
:
JSON
.
stringify
({
deviceType
:
scene
,
projectId
:
projectId
,
serchKey
:
this
.
getCurrentSearchKey
(),
}),
toUserId
:
user
.
user
.
userId
,
},)
}));
},
6000
);
}
};
uavSocket
.
onmessage
=
(
event
)
=>
{
let
data
=
JSON
.
parse
(
event
.
data
||
"{}"
);
...
...
@@ -332,17 +344,22 @@ export default {
const
msg
=
content
.
message
;
switch
(
type
)
{
case
"uas-device-take-message"
:
console
.
log
(
msg
,
'msg'
);
break
;
break
;
// 刷新无人机列表
case
"uas-device-getTree-message"
:
this
.
bus
.
$emit
(
"uas-device-getTree-message"
,
{
type
,
content
,
msg
,
});
break
;
let
res
=
JSON
.
parse
(
data
.
content
)
const
scene
=
this
.
getQueryParam
(
'scene'
);
// 根据scene值决定更新哪个组件的数据
if
(
scene
==
1
)
{
// scene为1时,更新uavList组件的数据
this
.
bus
.
$emit
(
"update-uav-list"
,
res
.
text
);
}
else
if
(
scene
==
2
)
{
// scene为2时,更新hangar list组件的数据
this
.
bus
.
$emit
(
"update-hangar-list"
,
res
.
text
);
}
break
;
}
};
},
...
...
@@ -351,6 +368,49 @@ export default {
this
.
uavWs
.
close
();
},
methods
:
{
// 获取当前搜索关键字
getCurrentSearchKey
()
{
const
scene
=
this
.
getQueryParam
(
'scene'
);
if
(
scene
==
1
)
{
// 无人机场景,获取 uavList 组件的搜索内容
const
uavListComponent
=
this
.
$children
.
find
(
child
=>
child
.
$options
.
name
===
'UavApplications'
);
if
(
uavListComponent
)
{
const
uavList
=
uavListComponent
.
$children
.
find
(
child
=>
child
.
$options
.
name
===
'UavList'
||
child
.
uavSearchContent
!==
undefined
);
return
uavList
?
uavList
.
uavSearchContent
||
''
:
''
;
}
}
else
if
(
scene
==
2
)
{
// 机库场景,获取 hangar 组件的搜索内容
const
hangarComponent
=
this
.
$children
.
find
(
child
=>
child
.
$options
.
name
===
'Hangar'
);
if
(
hangarComponent
)
{
const
hangarList
=
hangarComponent
.
$children
.
find
(
child
=>
child
.
$options
.
name
===
'List'
||
child
.
searchContent
!==
undefined
);
return
hangarList
?
hangarList
.
searchContent
||
''
:
''
;
}
}
return
''
;
},
// 处理搜索变化事件
getQueryParam
(
paramName
)
{
// 获取当前页面的完整 URL
const
url
=
window
.
location
.
href
;
// 检查 URL 中是否包含 hash 部分
const
hashIndex
=
url
.
indexOf
(
'#'
);
if
(
hashIndex
!==
-
1
)
{
// 如果有 hash 部分,提取 hash 部分
const
hash
=
url
.
substring
(
hashIndex
+
1
);
// 去掉 '#' 符号
const
hashParams
=
new
URLSearchParams
(
hash
.
split
(
'?'
)[
1
]);
// 提取 hash 中的查询参数部分
const
value
=
hashParams
.
get
(
paramName
);
if
(
value
!==
null
)
{
return
value
;
// 如果在 hash 中找到参数,直接返回
}
}
// 如果在 hash 中没有找到,检查普通的查询参数
const
searchParams
=
new
URLSearchParams
(
window
.
location
.
search
);
return
searchParams
.
get
(
paramName
);
// 返回普通查询参数中的值
},
reset
()
{
let
cesiumEl
=
document
.
querySelector
(
".cesium-viewer"
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论