提交 5c5c0f60 作者: cenweixin

接口v3转v4:

1. 【无人机】航线列表(部分字段待确认)
2. 【机库】航线列表(部分字段待确认)
3. 【设备详情】判断无人机是否接管:由无人机详情接口更改为设备详情接口
上级 a0854f3e
流水线 #10322 已失败 于阶段
......@@ -37,7 +37,8 @@ class Control_API {
// 获取航线列表
static getUavRouteList(params) {
return request({
url: "/dms/route/page",
// url: "/dms/route/page",
url: "/admin-api/uas/flight-line/page",
method: "get",
params,
});
......@@ -222,6 +223,14 @@ class Control_API {
params
});
}
// 设备详情详情
static getDeviceDetail(params) {
return request({
url: `/admin-api/uas/device/get`,
method: "get",
params
});
}
}
......
......@@ -23,7 +23,7 @@
<div class="tb-tr" v-for="item in airwayData.records" :key="item.id">
<div class="td">{{ item.id || "暂无" }}</div>
<div class="td">
<div>{{ item.name || "暂无" }}</div>
<div>{{ item.flightName || "暂无" }}</div>
</div>
<div class="td">{{ item.organizationName || "暂无" }}</div>
<!-- 空域状态 -->
......@@ -40,8 +40,8 @@
<!-- 安全状态 -->
<div
class="td"
:style="{ color: item.isSafe == 1 ? '#19D864' : '' }"
>{{ item.isSafe == 1 ? "安全" : "待确定" }}</div>
:style="{ color: item.safe == 1 ? '#19D864' : '' }"
>{{ item.safe == 1 ? "安全" : "待确定" }}</div>
<!-- 航线标签 -->
<div class="td">
<!-- <span v-for="item2 in item.labelList"
......@@ -77,13 +77,14 @@ export default {
airwayData: {
current: 1,
records: [],
size: 10,
size: 1,
total: 0,
},
};
},
computed: {
...mapState("MMCFlightControlCenter", ["useSTLAirway"]),
...mapState("MMCFlightControlCenter/hangar", ["hangar"]),
},
mounted() {
this.getAirway();
......@@ -91,7 +92,7 @@ export default {
methods: {
async changeLine(item) {
try {
if (item.isSafe != 1) {
if (item.safe != 1) {
await this.$confirm(
"此航线为非安全航线,开始任务前请确认航线安全!",
"安全确认",
......@@ -108,10 +109,11 @@ export default {
async getAirway() {
if (this.useSTLAirway) {
let res = await Control_API.getUavRouteList({
page: this.airwayData.current,
pageNo: this.airwayData.current,
pageSize: this.airwayData.size,
// nestId: this.hangar.id, // TODO 目前还没有新增航线操作
});
if (res?.code === 200) {
if (res?.code === 0) {
let statusMap = {
1: "可用",
2: "待申请",
......@@ -119,17 +121,22 @@ export default {
4: "通过",
5: "驳回",
};
this.airwayData = res.data || {
current: 1,
this.airwayData = res.data.list && {
current: this.airwayData.current,
records: res.data.list,
size: this.airwayData.size,
total: res.data.total,
} || {
current: this.airwayData.current,
records: [],
size: 10,
total: 0,
size: this.airwayData.size,
total: this.airwayData.total,
};
this.airwayData.records = this.airwayData.records?.map((item) => {
let content = [];
try{
content = JSON.parse(item.content).content
content = JSON.parse(item.content).content // TODO 待确认字段
}catch(e){
console.log(e);
}
......
......@@ -23,7 +23,7 @@
<div class="tb-tr" v-for="item in airwayData.records" :key="item.id">
<div class="td">{{ item.id || "暂无" }}</div>
<div class="td">
<div>{{ item.name || "暂无" }}</div>
<div>{{ item.flightName || "暂无" }}</div>
</div>
<div class="td">{{ item.organizationName || "暂无" }}</div>
<!-- 空域状态 -->
......@@ -39,8 +39,8 @@
<!-- 安全状态 -->
<div
class="td"
:style="{ color: item.isSafe == 1 ? '#19D864' : '' }"
>{{ item.isSafe == 1 ? "安全" : "待确定" }}</div>
:style="{ color: item.safe == 1 ? '#19D864' : '' }"
>{{ item.safe == 1 ? "安全" : "待确定" }}</div>
<!-- 航线标签 -->
<div class="td">
<!-- <span v-for="item2 in item.labelList"
......@@ -76,7 +76,7 @@ export default {
airwayData: {
current: 1,
records: [],
size: 10,
size: 1,
total: 0,
},
};
......@@ -90,7 +90,7 @@ export default {
methods: {
async changeLine(item) {
try {
if (item.isSafe != 1) {
if (item.safe != 1) {
await this.$confirm(
"此航线为非安全航线,开始任务前请确认航线安全!",
"安全确认",
......@@ -107,10 +107,10 @@ export default {
async getAirway() {
if (this.useSTLAirway) {
let res = await Control_API.getUavRouteList({
page: this.airwayData.current,
pageNo: this.airwayData.current,
pageSize: this.airwayData.size,
});
if (res?.code === 200) {
if (res?.code === 0) {
let statusMap = {
1: "可用",
2: "待申请",
......@@ -118,17 +118,22 @@ export default {
4: "通过",
5: "驳回",
};
this.airwayData = res.data || {
current: 1,
this.airwayData = res.data.list && {
current: this.airwayData.current,
records: res.data.list,
size: this.airwayData.size,
total: res.data.total,
} || {
current: this.airwayData.current,
records: [],
size: 10,
total: 0,
size: this.airwayData.size,
total: this.airwayData.total,
};
this.airwayData.records = this.airwayData.records?.map((item) => {
let content = [];
try{
content = JSON.parse(item.content).content
content = JSON.parse(item.content).content // TODO 待确认字段
}catch(e){
console.log(e);
}
......
......@@ -49,7 +49,7 @@
:class="'blue'"
:title="device.name"
>{{device.name}}</span>
<span style="color:#31DB24 " class="dib" v-if=" device.isOnline">(在线)</span>
<span style="color:#31DB24 " class="dib" v-if="device.isOnline">(在线)</span>
<span v-else class="dib">(离线)</span>
<div class="symbol-icon-box">
<!-- <template v-if="device.modelName && device.modelName.includes('入云龙1')">
......@@ -83,15 +83,16 @@
title="视频"
@click="onShowPlayer(device)"
></div>
<div
v-if="device.isOnline"
class="iconfont icon-kongzhi_xianxing"
:class="{ active: uav && device.deviceId === uav.deviceId && uav.showPanel }"
title="控制面板"
@click="onShowPanel(device)"
></div>
<div class="jieg" title="接管无人机 " v-if="device.isOnline" @click="onTakeOver(device)">
<div
class="jieg" title="接管无人机"
@click="onTakeOver(device)"
>
<img src="./assets/images/jieguan_active.svg" v-if="device.currentOperator" />
<img src="./assets/images/jieguan.svg" v-else />
</div>
......
......@@ -1190,14 +1190,11 @@ const actions = {
* @param { Number } data.id 无人机id
*/
async isTakeOver({ state }, data) {
let res = await Control_API.uavDetail({ id: data?.id || state.uav.id });
if (
res.data.currentOperator !==
window.$mmc.$store.state.MMCFlightControlCenter.userInfo.id
) {
return false;
let res = await Control_API.getDeviceDetail({ id: data?.id || state.uav.id });
if (res.data.currentOperator === window.$mmc.$store.state.MMCFlightControlCenter.userInfo.userId) {
return true;
}
return true;
return false;
},
};
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论