提交 542abca4 作者: 翁进城

fix:

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