Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
mmc-stl-vue2
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
mmc-stl-vue2
Commits
7867144a
提交
7867144a
authored
12月 28, 2024
作者:
温凯
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:任务库-创建航线新增所属单位
上级
006121a3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
164 行增加
和
30 行删除
+164
-30
taskInfo.js
...components/MMCFlightControlCenter/api/modules/taskInfo.js
+15
-1
index.vue
...ist/components/normalTask/components/airwayEdit/index.vue
+82
-28
index.vue
...eft/components/airwayList/components/airwayEdit/index.vue
+67
-1
没有找到文件。
src/components/MMCFlightControlCenter/api/modules/taskInfo.js
浏览文件 @
7867144a
...
...
@@ -29,4 +29,17 @@ export default class TaskInfo {
data
});
}
}
/**
* 全部单位
* @param {*} params
* @returns
*/
static
listAll
(
params
)
{
return
request
({
url
:
'/admin-api/system/dept/simple-list'
,
method
:
'get'
,
params
,
});
}
}
\ No newline at end of file
src/components/MMCFlightControlCenter/components/hangar/components/controlPanel/components/controlLeft/components/airwayList/components/normalTask/components/airwayEdit/index.vue
浏览文件 @
7867144a
...
...
@@ -15,28 +15,30 @@
<el-form-item
label=
"航线名称"
required
>
<el-input
clearable
v-model=
"name"
></el-input>
</el-form-item>
<el-form-item
label=
"所属单位:"
required
>
<el-cascader
ref=
"CascaderRef"
v-model=
"departmentId"
:options=
"orgList"
clearable
:show-all-levels=
"false"
placeholder=
"请选择所属单位"
:props=
"
{
children: 'children',
label: 'name',
value: 'id',
checkStrictly: true,
emitPath: false,
}" @change="changeNode">
</el-cascader>
</el-form-item>
<el-form-item
label=
"航线速度"
prop=
"speed"
>
<el-input
clearable
v-model=
"curForm.speed"
></el-input>
</el-form-item>
<el-form-item
label=
"目标位置"
prop=
"address"
>
<el-autocomplete
:popper-append-to-body=
"false"
v-model=
"curForm.address"
:fetch-suggestions=
"onAddressInput"
placeholder=
"请输入目标位置"
:trigger-on-focus=
"false"
@
select=
"
(item) =>
{
onAddressChange(item, 'end');
}
"
clearable
>
<el-autocomplete
:popper-append-to-body=
"false"
v-model=
"curForm.address"
:fetch-suggestions=
"onAddressInput"
placeholder=
"请输入目标位置"
:trigger-on-focus=
"false"
@
select=
"(item) =>
{
onAddressChange(item, 'end');
}
" clearable>
<template
slot-scope=
"
{ item }">
<div>
<span
style=
"font-size: 14px; color: #9e9e9e"
>
{{
item
.
name
item
.
name
}}
</span>
<span
style=
"font-size: 12px; color: #999; margin-left: 12px"
>
{{
item
.
address
}}
</span>
...
...
@@ -58,27 +60,23 @@
<el-input
clearable
v-model=
"curForm.label"
></el-input>
</el-form-item>
<el-form-item
label=
"航点动作"
>
<el-button
type=
"text"
@
click=
"showActions = true"
>
{{
curForm.actions.length
}}个动作
</el-button>
<el-button
type=
"text"
@
click=
"showActions = true"
>
{{
curForm.actions.length
}}个动作
</el-button>
</el-form-item>
<el-form-item
label=
"航线总里程"
>
{{
distance
}}m
</el-form-item>
<el-form-item
label=
"预计飞行时间"
>
{{
time
}}
</el-form-item>
<el-form-item
label=
"航线总里程"
>
{{
distance
}}m
</el-form-item>
<el-form-item
label=
"预计飞行时间"
>
{{
time
}}
</el-form-item>
</el-form>
<div
class=
"ae-btns"
>
<el-button
type=
"primary"
@
click=
"onSave"
:loading=
"saveLoading"
>
保存
</el-button>
<el-button
type=
"danger"
@
click=
"onDel"
>
删除航点
</el-button>
</div>
</div>
<Actions
v-if=
"showActions"
@
close=
"showActions = false"
@
save=
"onActionsSave"
:selectActions=
"curForm.actions"
></Actions>
<Actions
v-if=
"showActions"
@
close=
"showActions = false"
@
save=
"onActionsSave"
:selectActions=
"curForm.actions"
>
</Actions>
</div>
</template>
<
script
>
import
{
Map
,
AirLine
}
from
"../../../../../../../../../../../../api"
;
import
{
Map
,
AirLine
,
TaskInfo
}
from
"../../../../../../../../../../../../api"
;
import
{
mapState
}
from
"vuex"
;
import
Utils
from
"../../../../../../../../../../../../components/cesiumLayer/lib/cesium/utils"
;
import
{
nanoid
}
from
"nanoid"
;
...
...
@@ -115,7 +113,9 @@ export default {
inject
:
[
"rootNode"
],
data
()
{
return
{
orgList
:
[],
name
:
""
,
//航线名
departmentId
:
""
,
//部门id
form
:
[],
//表单集合
pageIndex
:
0
,
//当前页码
locationIcon
:
null
,
//定位图标
...
...
@@ -158,6 +158,7 @@ export default {
},
mounted
()
{
let
viewer
=
this
.
cesiumViewer
;
this
.
getOrgList
()
this
.
dataSource
=
new
Cesium
.
CustomDataSource
(
"airway_edit"
);
viewer
.
dataSources
.
add
(
this
.
dataSource
);
this
.
handler
=
new
Cesium
.
ScreenSpaceEventHandler
(
viewer
.
canvas
);
//获取事件对象
...
...
@@ -184,6 +185,7 @@ export default {
Cesium
.
ScreenSpaceEventType
.
LEFT_CLICK
);
this
.
pickerPointInit
();
},
beforeDestroy
()
{
this
.
handler
.
removeInputAction
(
...
...
@@ -201,12 +203,63 @@ export default {
this
.
dataSource
.
show
=
false
;
},
methods
:
{
async
getOrgList
()
{
let
data
=
await
TaskInfo
.
listAll
();
let
res
=
data
.
data
;
const
config
=
{
id
:
"id"
,
parentId
:
"parentId"
,
childrenList
:
"children"
,
};
const
childrenListMap
=
{};
const
nodeIds
=
{};
const
tree
=
[];
for
(
const
d
of
res
)
{
const
parentId
=
d
[
config
.
parentId
];
if
(
childrenListMap
[
parentId
]
==
null
)
{
childrenListMap
[
parentId
]
=
[];
}
nodeIds
[
d
[
config
.
id
]]
=
d
;
childrenListMap
[
parentId
].
push
(
d
);
}
for
(
const
d
of
res
)
{
const
parentId
=
d
[
config
.
parentId
];
if
(
nodeIds
[
parentId
]
==
null
)
{
tree
.
push
(
d
);
}
}
for
(
const
t
of
tree
)
{
adaptToChildrenList
(
t
);
}
function
adaptToChildrenList
(
o
)
{
if
(
childrenListMap
[
o
[
config
.
id
]]
!==
null
)
{
o
[
config
.
childrenList
]
=
childrenListMap
[
o
[
config
.
id
]];
}
if
(
o
[
config
.
childrenList
])
{
for
(
const
c
of
o
[
config
.
childrenList
])
{
adaptToChildrenList
(
c
);
}
}
}
this
.
orgList
=
tree
;
},
changeNode
()
{
this
.
$refs
.
CascaderRef
.
dropDownVisible
=
false
;
},
// 保存航线
async
onSave
()
{
if
(
!
this
.
name
)
{
this
.
$message
.
warning
(
"请输入航线名称"
);
return
;
}
if
(
!
this
.
departmentId
)
{
this
.
$message
.
warning
(
"请选择所属机构"
);
return
;
}
if
(
this
.
form
.
length
===
0
)
{
this
.
$message
.
warning
(
"请点击地图选择航点"
);
return
;
...
...
@@ -248,6 +301,7 @@ export default {
content
:
waypoints
,
distance
:
this
.
distance
,
dutyOrganizationId
:
""
,
departmentId
:
this
.
departmentId
,
name
:
this
.
name
,
speed
:
this
.
form
[
0
].
speed
,
};
...
...
@@ -256,6 +310,7 @@ export default {
flightName
:
airway
.
name
||
`
${
this
.
userInfo
.
username
}
-巡查}`
,
pointCount
:
airway
.
content
.
length
,
distance
:
airway
.
distance
,
departmentId
:
airway
.
departmentId
,
sourceType
:
1
,
linePointSaveReqVOS
:
airway
.
content
.
map
((
point
)
=>
({
latitude
:
point
.
coordinate
.
latitude
,
...
...
@@ -279,7 +334,7 @@ export default {
this
.
$message
.
success
(
"创建航线成功"
);
this
.
$emit
(
"addDone"
,
res
.
data
);
this
.
$emit
(
"close"
);
}
catch
(
e
)
{}
}
catch
(
e
)
{
}
this
.
saveLoading
=
false
;
// 通过事件创建会出现重复创建的情况, 改为标准化里创建
...
...
@@ -302,7 +357,6 @@ export default {
* 动作保存
*/
onActionsSave
(
actions
)
{
console
.
log
(
"动作"
,
actions
);
this
.
curForm
.
actions
=
actions
;
this
.
showActions
=
false
;
},
...
...
@@ -606,8 +660,8 @@ export default {
<
style
lang=
"scss"
scoped
>
.airway-edit
{
position
:
absolute
;
top
:
0px
;
width
:
351px
;
top
:
0px
;
width
:
351px
;
z-index
:
2
;
.dialog-content
{
...
...
src/components/MMCFlightControlCenter/components/uavApplications/components/controlPanel/components/controlLeft/components/airwayList/components/airwayEdit/index.vue
浏览文件 @
7867144a
...
...
@@ -15,6 +15,16 @@
<el-form-item
label=
"航线名称"
required
>
<el-input
clearable
v-model=
"name"
></el-input>
</el-form-item>
<el-form-item
label=
"所属单位:"
required
>
<el-cascader
ref=
"CascaderRef"
v-model=
"departmentId"
:options=
"orgList"
clearable
:show-all-levels=
"false"
placeholder=
"请选择所属单位"
:props=
"
{
children: 'children',
label: 'name',
value: 'id',
checkStrictly: true,
emitPath: false,
}" @change="changeNode">
</el-cascader>
</el-form-item>
<el-form-item
label=
"航线速度"
prop=
"speed"
>
<el-input
clearable
v-model=
"curForm.speed"
></el-input>
</el-form-item>
...
...
@@ -86,7 +96,7 @@
</template>
<
script
>
import
{
Map
,
AirLine
}
from
"../../../../../../../../../../api"
;
import
{
Map
,
AirLine
,
TaskInfo
}
from
"../../../../../../../../../../api"
;
import
{
mapState
}
from
"vuex"
;
import
Utils
from
"../../../../../../../../../../components/cesiumLayer/lib/cesium/utils"
;
import
{
nanoid
}
from
"nanoid"
;
...
...
@@ -123,7 +133,9 @@ export default {
inject
:
[
"rootNode"
],
data
()
{
return
{
orgList
:
[],
name
:
""
,
//航线名
departmentId
:
''
,
//部门id
flightLabel
:
""
,
//航线标签
form
:
[],
//表单集合
pageIndex
:
0
,
//当前页码
...
...
@@ -168,6 +180,7 @@ export default {
},
mounted
()
{
let
viewer
=
this
.
cesiumViewer
;
this
.
getOrgList
();
this
.
dataSource
=
new
Cesium
.
CustomDataSource
(
this
.
dataSourceName
);
viewer
.
dataSources
.
add
(
this
.
dataSource
);
this
.
handler
=
new
Cesium
.
ScreenSpaceEventHandler
(
viewer
.
canvas
);
//获取事件对象
...
...
@@ -212,6 +225,53 @@ export default {
this
.
dataSource
.
show
=
false
;
},
methods
:
{
changeNode
()
{
this
.
$refs
.
CascaderRef
.
dropDownVisible
=
false
;
},
async
getOrgList
()
{
let
data
=
await
TaskInfo
.
listAll
();
let
res
=
data
.
data
;
const
config
=
{
id
:
"id"
,
parentId
:
"parentId"
,
childrenList
:
"children"
,
};
const
childrenListMap
=
{};
const
nodeIds
=
{};
const
tree
=
[];
for
(
const
d
of
res
)
{
const
parentId
=
d
[
config
.
parentId
];
if
(
childrenListMap
[
parentId
]
==
null
)
{
childrenListMap
[
parentId
]
=
[];
}
nodeIds
[
d
[
config
.
id
]]
=
d
;
childrenListMap
[
parentId
].
push
(
d
);
}
for
(
const
d
of
res
)
{
const
parentId
=
d
[
config
.
parentId
];
if
(
nodeIds
[
parentId
]
==
null
)
{
tree
.
push
(
d
);
}
}
for
(
const
t
of
tree
)
{
adaptToChildrenList
(
t
);
}
function
adaptToChildrenList
(
o
)
{
if
(
childrenListMap
[
o
[
config
.
id
]]
!==
null
)
{
o
[
config
.
childrenList
]
=
childrenListMap
[
o
[
config
.
id
]];
}
if
(
o
[
config
.
childrenList
])
{
for
(
const
c
of
o
[
config
.
childrenList
])
{
adaptToChildrenList
(
c
);
}
}
}
this
.
orgList
=
tree
;
},
async
getLabel
()
{
this
.
rootNode
.
$emit
(
"getLabelList"
,
{
callback
:
(
data
)
=>
{
...
...
@@ -225,6 +285,10 @@ export default {
this
.
$message
.
warning
(
"请输入航线名称"
);
return
;
}
if
(
!
this
.
departmentId
)
{
this
.
$message
.
warning
(
"请选择所属机构"
);
return
;
}
if
(
this
.
form
.
length
===
0
)
{
this
.
$message
.
warning
(
"请点击地图选择航点"
);
return
;
...
...
@@ -269,6 +333,7 @@ export default {
content
:
waypoints
,
distance
:
this
.
distance
,
dutyOrganizationId
:
""
,
departmentId
:
this
.
departmentId
,
//部门id
name
:
this
.
name
,
speed
:
this
.
form
[
0
].
speed
,
};
...
...
@@ -277,6 +342,7 @@ export default {
flightName
:
airway
.
name
||
`
${
this
.
userInfo
.
username
}
-巡查}`
,
pointCount
:
airway
.
content
.
length
,
distance
:
airway
.
distance
,
departmentId
:
airway
.
departmentId
,
sourceType
:
1
,
linePointSaveReqVOS
:
airway
.
content
.
map
((
point
)
=>
({
latitude
:
point
.
coordinate
.
latitude
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论