提交 542abca4 作者: 翁进城

fix:

1. 视图库增加ai筛选
2. 打开创建航点时关闭其它窗口
上级 257afc37
......@@ -9,8 +9,8 @@ export default class AI_API {
// 车牌
static plate(data) {
// return axios.post("http://183.62.225.251:9090/api/inflet/v1/tasks/e01d1d01-52e2-4883-a5de-0ae268764db0/predict", data); // 共达地
return axios.post("https://hawk.mmcuav.cn/plateaiapi/detect/image", data); // 自研
return axios.post("http://183.62.225.251:9090/api/inflet/v1/tasks/e01d1d01-52e2-4883-a5de-0ae268764db0/predict", data); // 共达地
// return axios.post("https://hawk.mmcuav.cn/plateaiapi/detect/image", data); // 自研
}
// 人流
......
......@@ -36,14 +36,23 @@ export default {
airwayList: [],
// 选择的航线
selectedAirwayId: "",
// 创建航线窗口
showAirwayEdit: false,
};
},
computed: {
...mapState("MMCFlightControlCenter", ["cesiumViewer", "useSTLAirway"]),
...mapState("MMCFlightControlCenter/uav", ["uav"]),
...mapState("MMCFlightControlCenter/hangar", ["hangar"]),
showAirwayEdit: {
get() {
return this.$store.state.MMCFlightControlCenter.showAirwayEdit;
},
set(value) {
this.$store.commit("MMCFlightControlCenter/setState", {
key: "showAirwayEdit",
value,
});
},
},
// 选择的航线
selectedAirway() {
let find = this.airwayList.find((item) => {
......@@ -144,7 +153,7 @@ export default {
callback: (res) => {
this.airwayList = res?.records || [];
this.$nextTick(() => {
if(id){
if (id) {
this.selectedAirwayId = id;
}
});
......
......@@ -93,7 +93,7 @@ export default {
},
computed: {
...mapState("MMCFlightControlCenter/hangar", ["hangar", "showPanel"]),
...mapState("MMCFlightControlCenter", []),
...mapState("MMCFlightControlCenter", ["showAirwayEdit"]),
// 收起列表按钮
listCollapse: {
get() {
......@@ -114,6 +114,9 @@ export default {
this.$nextTick(() => {
this.openTask = true;
})
},
showAirwayEdit(newVal){
this.playerCollapse = true;
}
},
methods: {
......
......@@ -16,13 +16,8 @@
<div slot="dialog">
<div class="hangar-ctrl dialog1027" v-if="showHangar">
<div class="dialog-header">
<img
class="dialog-header__icon"
src="../../../../../../assets/images/mount_head.png"
/>
<span class="dialog-header__title">
操作区域
</span>
<img class="dialog-header__icon" src="../../../../../../assets/images/mount_head.png" />
<span class="dialog-header__title">操作区域</span>
<span class="dialog-header__close" @click="showHangar = false;">关闭</span>
</div>
<div class="hangar-ctrl-list">
......@@ -38,11 +33,7 @@
</div>
</div>
</div>
<Logger
class="logger"
@exit="showLogger = false"
v-if="showLogger"
></Logger>
<Logger class="logger" @exit="showLogger = false" v-if="showLogger"></Logger>
<HangarMonitor
:uavMsg="uavRealTimeData.msg"
:weatherStation="hangarRealTimeData.weatherStation"
......@@ -129,9 +120,20 @@ export default {
};
},
computed: {
...mapState("MMCFlightControlCenter", ["showAirwayEdit"]),
...mapState("MMCFlightControlCenter/uav", ["uavRealTimeData"]),
...mapState("MMCFlightControlCenter/hangar", ["hangarRealTimeData"]),
},
watch: {
// 打开航线编辑时关闭所有窗口
showAirwayEdit(newVal){
if(newVal){
this.showHangar = false;
this.showLogger = false;
this.showMonitor = false;
}
}
},
methods: {
...mapActions("MMCFlightControlCenter/hangar", [
"out",
......@@ -189,7 +191,6 @@ export default {
this.showHangar = false;
}
},
},
};
</script>
......@@ -211,7 +212,6 @@ export default {
height: 32px;
.hangar-ctrl-header__title {
}
.hangar-ctrl-header__close {
......@@ -239,7 +239,7 @@ export default {
flex-direction: column;
justify-content: center;
align-items: center;
background: #3E3E3E;
background: #3e3e3e;
border-radius: 4.5px;
cursor: pointer;
gap: 3px;
......
......@@ -63,7 +63,7 @@ export default {
},
computed: {
...mapState("MMCFlightControlCenter", ["listCollapse"]),
...mapState("MMCFlightControlCenter", ["listCollapse", "showAirwayEdit"]),
...mapState("MMCFlightControlCenter/hangar", ["hangar"]),
count() {
let countObj = {
......@@ -91,7 +91,13 @@ export default {
},
},
},
watch: {},
watch: {
showAirwayEdit(newVal){
if(newVal){
this.listCollapse = true;
}
}
},
mounted() {
this.getList();
......
......@@ -42,8 +42,6 @@ export default {
airwayList: [],
// 选择的航线
selectedAirwayId: "",
// 创建航线窗口
showAirwayEdit: false,
};
},
computed: {
......@@ -63,8 +61,36 @@ export default {
};
}
},
// 创建航线窗口
showAirwayEdit: {
get() {
return this.$store.state.MMCFlightControlCenter.showAirwayEdit;
},
set(val) {
this.$store.commit("MMCFlightControlCenter/setState", {
key: "showAirwayEdit",
value: val,
});
},
},
listCollapse: {
get() {
return this.$store.state.MMCFlightControlCenter.listCollapse;
},
set(val) {
this.$store.commit("MMCFlightControlCenter/setState", {
key: "listCollapse",
value: val,
});
},
},
},
watch: {
showAirwayEdit(newVal){
if(newVal){
this.listCollapse = true;
}
},
selectedAirway() {
this.clearAirwayEntities();
if (this.selectedAirway.id !== -1) {
......
......@@ -12,7 +12,7 @@
v-model="aiType"
placeholder="全部"
@change="onChangeAiType"
v-if="viewLibTab == 0"
v-if="viewLibTab == 0 && fileType == '图片'"
size="small"
>
<el-option
......@@ -30,7 +30,7 @@
>全选</el-checkbox>
</div>
<div class="select">
<el-radio-group v-model="fileType" size="small">
<el-radio-group v-model="fileType" @change="onChangeFileType" size="small">
<el-radio-button label="图片"></el-radio-button>
<el-radio-button label="视频"></el-radio-button>
</el-radio-group>
......@@ -262,69 +262,38 @@ export default {
isIndeterminate: false,
selectAll: false, //全选
viewLibTab: 0, // 视图库tab索引, 0: 视图, 1: 机载
aiType: 1, // 图片类型
aiType: 0, // 图片类型
aiTypeList: [
// 普通图片或ai图片选项
{
id: 0,
value: "全部",
},
{
id: 1,
value: "图片",
value: "人脸识别",
},
{
id: 8,
// id: 2,
value: "车牌识别",
},
{
id: 3,
value: "人流识别",
},
{
id: 4,
value: "烟雾识别",
},
{
id: 2,
value: "AI图片",
id: 5,
value: "漏油识别",
},
{
id: 6,
value: "裸土识别",
},
// {
// id: 0,
// value: "全部",
// },
// {
// id: 1,
// value: "人脸识别",
// },
// {
// id: 2,
// value: "车辆识别",
// },
// {
// id: 9,
// value: "人流识别",
// },
// {
// id: 4,
// value: "游泳识别",
// },
// {
// id: 5,
// value: "跌倒检测",
// },
// {
// id: 6,
// value: "异物检测",
// },
// {
// id: 7,
// value: "火焰烟雾",
// },
// {
// id: 8,
// value: "车辆朝向",
// },
// {
// id: 9,
// value: "车辆类型检测",
// },
// {
// id: 10,
// value: "车道分割线",
// },
// {
// id: 11,
// value: "绿化带分割",
// },
// {
// id: 10,
// value: "车牌识别",
// },
], //视图库类型
fileType: "图片", //视图文件类型 0:图片;1:视频
photoList: [], //资源列表对应的对象
......@@ -354,9 +323,6 @@ export default {
},
},
watch: {
fileType() {
this.init();
},
},
mounted() {
this.init();
......@@ -385,28 +351,16 @@ export default {
fileType: this.fileType === "图片" ? 0 : 1,
deviceId: this.uav.deviceId,
type: parseInt(this.viewLibTab),
detectorType: this.aiType || "",
});
let photoList = res.data.list;
if (photoList.length === 0) {
this.noMore = true;
} else {
photoList.forEach((item) => {
item.imgList = item.viewLibraryRespVOS
.filter((item1) => {
// 过滤掉对应筛选下没图片链接的数据
if (this.viewLibTab == 0) {
return this.aiType == 1 ? item1.fileUrl : item1.aiImageUrl;
} else {
return item1.fileUrl;
}
})
.map((item1) => {
if (this.viewLibTab == 0) {
return this.aiType == 1 ? item1.fileUrl : item1.aiImageUrl;
} else {
return item1.fileUrl;
}
});
item.imgList = item.viewLibraryRespVOS.map((item1) => {
return item1.aiImageUrl || item1.fileUrl;
});
});
this.photoList = this.photoList.concat(photoList);
}
......@@ -417,6 +371,7 @@ export default {
*/
async onChangeViewLibTab(index) {
this.viewLibTab = index;
this.aiType = 0;
this.init();
},
/**
......@@ -430,6 +385,7 @@ export default {
*/
onChangeFileType(i) {
this.fileType = i;
this.aiType = 0;
this.init();
},
onDownload(url) {
......@@ -452,13 +408,13 @@ export default {
let req = [];
this.checkList.forEach((img) => {
// 绝对路径转相对路径
let arr = img.split('/');
let src = '/' + arr.slice(4).join('/');
debugger
let arr = img.split("/");
let src = "/" + arr.slice(4).join("/");
debugger;
req.push(
ViewLibrary.create({
fileUrl: src,
fileType: this.fileType === '图片' ? 0 : 1,
fileType: this.fileType === "图片" ? 0 : 1,
deviceId: this.uav.deviceId,
})
);
......@@ -712,6 +668,7 @@ export default {
&:hover {
.list-item__img-download {
display: initial;
position: absolute;
right: 0;
bottom: 0;
......@@ -730,6 +687,10 @@ export default {
cursor: pointer;
}
}
.list-item__img-download {
display: none;
}
}
}
.boxs {
......
......@@ -113,8 +113,22 @@ export default {
};
},
computed: {
...mapState("MMCFlightControlCenter", ["showAirwayEdit"]),
...mapState("MMCFlightControlCenter/uav", ["uav", "airlineData"]),
},
watch: {
// 打开航线编辑时关闭所有窗口
showAirwayEdit(newVal){
if(newVal){
this.showAlarmLamp = false;
this.showHealth = false;
this.showMMCGimbalP1 = false;
this.showMount = false;
this.showControlList = false;
this.showViewLib = false;
}
}
},
methods: {
hideAll(key) {
let arr = [
......
......@@ -50,37 +50,37 @@ export default {
{
title: "人脸识别",
type: "face",
typeId: 0,
typeId: 1,
img: require("./assets/images/人脸识别.svg"),
},
{
title: "车牌识别",
type: "plate",
typeId: 0,
typeId: 8,
img: require("./assets/images/车牌识别.svg"),
},
{
title: "人流识别",
type: "crowd",
typeId: 0,
typeId: 3,
img: require("./assets/images/人流识别.svg"),
},
{
title: "火焰烟雾",
title: "烟雾识别",
type: "smoke",
typeId: 0,
typeId: 4,
img: require("./assets/images/烟雾识别.svg"),
},
{
title: "漏油识别",
type: "oilLeak",
typeId: 0,
typeId: 5,
img: require("./assets/images/漏油识别.svg"),
},
{
title: "裸土识别",
type: "bareSoil",
typeId: 0,
typeId: 6,
img: require("./assets/images/裸土识别.svg"),
},
],
......@@ -116,8 +116,8 @@ export default {
}, */
];
switch (type) {
// 车牌识别
case "plate": {
// 车牌识别 自研
/* case "plate": {
let formData = new FormData();
formData.append("image", blob, `下载.jpeg`);
formData.append("iscount", 1);
......@@ -139,7 +139,7 @@ export default {
isSuccess = true;
}
break;
}
} */
case "face":
/* {
// 用的百度
......@@ -192,7 +192,7 @@ export default {
let res = await AI_API[type]({
image: base64,
});
let targets = [
/* let targets = [
{
bbox: {
box: {
......@@ -235,10 +235,10 @@ export default {
},
region_label: "",
},
];
]; */
results =
res?.data?.data?.targets?./* targets .*/ map((item) => {
res?.data?.data?.targets?./* targets. */map((item) => {
return {
x: item.bbox.box.left_top_x,
y: item.bbox.box.left_top_y,
......
......@@ -124,9 +124,25 @@ export default {
"showPlayer",
"showPanel",
]),
...mapState("MMCFlightControlCenter", ["userInfo"]),
...mapState("MMCFlightControlCenter", ["userInfo", "showAirwayEdit"]),
},
watch: {
showAirwayEdit(newVal) {
if (newVal) {
this.$store.commit("MMCFlightControlCenter/uav/setState", {
key: "showPlayer",
value: false,
});
this.$store.commit("MMCFlightControlCenter/uav/setState", {
key: "uav",
value: {
...this.uav,
showPlayer: false
},
});
}
},
},
methods: {
/**
* 接管无人机
......
......@@ -37,6 +37,7 @@
</template>
<script>
import { mapState } from "vuex";
import { Control_API } from "../../../../api";
import List from "./components/list";
// import data from "./data.json";
......@@ -54,6 +55,7 @@ export default {
};
},
computed: {
...mapState("MMCFlightControlCenter", ["showAirwayEdit"]),
// 收起列表按钮
listCollapse: {
get() {
......@@ -67,6 +69,13 @@ export default {
},
},
},
watch: {
showAirwayEdit(newVal) {
if (newVal) {
this.listCollapse = true;
}
},
},
mounted() {
this.initList();
this.timeHandle = setInterval(() => {
......@@ -162,7 +171,7 @@ export default {
}
}
.uav-search::v-deep {
.uav-search::v-deep {
flex-shrink: 0;
padding: 0 16px;
display: flex;
......
......@@ -39,6 +39,7 @@ export default {
wsUrl: '', //websocket的url
mqttUrl: '', //无人机的mqtt地址
mqttUrlHangar: '', //机库的mqtt地址
showAirwayEdit: false, //展开航线编辑
},
mutations: {
/**
......
......@@ -173,13 +173,14 @@ function initUavRealTimeData() {
down45Link 4/5G下行速率,单位字节/秒 Long
} */
flightMode: "UNKNOWN",
uploadAirline: { //上传的航线
finishedAction: '', //航点任务完成后,飞机将采取的行动
headingMode: '', //飞机在航点之间移动时的航向模式
uploadAirline: {
//上传的航线
finishedAction: "", //航点任务完成后,飞机将采取的行动
headingMode: "", //飞机在航点之间移动时的航向模式
isExitMissionOnRCSignalLostEnabled: Boolean, //飞机在航点之间移动时的航向模式
maxFlightSpeed: 0, //航线飞行最大速度,px4无人机默认最大12m
autoFlightSpeed: 0, //航线飞行速度默认5m
waypointList: null
waypointList: null,
},
};
}
......@@ -734,24 +735,24 @@ const actions = {
let dataSet = window.$mmc.$store.state.MMCMQTT.dataSet;
dataSet[state.uav.deviceId][261] = null;
window.$mmc.$store.commit('MMCMQTT/setSate', {
key: 'dataSet',
value: dataSet
})
commit('setState', {
key: 'uavRealTimeData',
window.$mmc.$store.commit("MMCMQTT/setSate", {
key: "dataSet",
value: dataSet,
});
commit("setState", {
key: "uavRealTimeData",
value: {
...state.uavRealTimeData,
uploadAirline: null
}
})
uploadAirline: null,
},
});
}
}, 1000);
// 做个保险, 要是因为各种原因导致没飞起, 超过一分钟删除循环定时器
setTimeout(() => {
clearInterval(time);
}, 60000)
}, 60000);
} catch (e) {
console.log("一键起飞失败", e);
data?.callback && data.callback(false);
......@@ -1300,8 +1301,9 @@ const actions = {
id: data?.id || state.uav.id,
});
if (
res.data.currentOperator &&
res.data.currentOperator ===
window.$mmc.$store.state.MMCFlightControlCenter.userInfo.userId
window.$mmc.$store.state.MMCFlightControlCenter.userInfo.userId
) {
return true;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论