提交 307fa50b 作者: 翁进城

fix:

1. 删除无用文件
2. 刷新恢复当前任务航线
3. 挂载录像修正
上级 234bd52c
<!-- 飞控中心电池--> <!-- 飞控中心电池-->
<template> <template>
<div class="cpt-observe-mspace-dashboard-battery"> <div class="cpt-observe-mspace-dashboard-battery" v-if="isShow">
<div class="battery-inner" v-for="(item,index) in _batteryList" :key="index"> <div class="battery-inner" v-for="(item,index) in _batteryList" :key="index">
<div class="dec mr9 f12">{{index+1}}</div> <div class="dec mr9 f12">{{index+1}}</div>
<div class="size-wrap"> <div class="size-wrap">
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
<div class="size-inner"> <div class="size-inner">
<div class="dianchigai"></div> <div class="dianchigai"></div>
<div <div
v-if="item.statusType !=3" v-if="item.statusType !==3"
class="size-inner-box" class="size-inner-box"
:style="`height: ${item.chargeRemaining || 100}%; ${setColor(item.chargeRemaining || 100)}`" :style="`height: ${item.chargeRemaining || 100}%; ${setColor(item.chargeRemaining || 100)}`"
></div> ></div>
</div> </div>
</div> </div>
<span v-if="item.statusType == 3" class="size__text">{{"已关机"}}</span> <span v-if="item.statusType === 3" class="size__text">{{"已关机"}}</span>
<span v-else class="size__text">{{item.chargeRemaining || 100}}%</span> <span v-else class="size__text">{{item.chargeRemaining || 100}}%</span>
</div> </div>
...@@ -53,10 +53,17 @@ export default { ...@@ -53,10 +53,17 @@ export default {
}, },
}, },
data() { data() {
return {}; return {
isShow: true,
};
}, },
computed: { computed: {
_batteryList() { _batteryList() {
console.log('电池信息', this.batteryList)
this.isShow = false;
this.$nextTick(() => {
this.isShow = true;
})
if (this.batteryList.length > 0) { if (this.batteryList.length > 0) {
return this.batteryList; return this.batteryList;
} else { } else {
......
...@@ -11,4 +11,22 @@ export default class TaskInfo { ...@@ -11,4 +11,22 @@ export default class TaskInfo {
data data
}); });
} }
// 获取航线
static getRoute(data) {
return request({
url: `/admin-api/bpm/task-info/getreoute`,
method: "post",
data
});
}
// 获取任务信息
static getTaskInfoRecord(data) {
return request({
url: `/admin-api/bpm/task-info/getTaskInfoRecord`,
method: "post",
data
});
}
} }
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<script> <script>
import { Utils } from "../../../../../../../../../../lib/cesium"; import { Utils } from "../../../../../../../../../../lib/cesium";
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
import { Control_API } from "../../../../../../../../../../api"; import { Control_API, TaskInfo } from "../../../../../../../../../../api";
import AirwayEdit from "./components/airwayEdit"; import AirwayEdit from "./components/airwayEdit";
const airwayEntities = []; // 航线实体 const airwayEntities = []; // 航线实体
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
}, },
computed: { computed: {
...mapState("MMCFlightControlCenter", ["cesiumViewer", "useSTLAirway"]), ...mapState("MMCFlightControlCenter", ["cesiumViewer", "useSTLAirway"]),
...mapState("MMCFlightControlCenter/uav", ["uav"]), ...mapState("MMCFlightControlCenter/uav", ["uav", "uavRealTimeData"]),
...mapState("MMCFlightControlCenter/hangar", ["hangar"]), ...mapState("MMCFlightControlCenter/hangar", ["hangar"]),
showAirwayEdit: { showAirwayEdit: {
get() { get() {
...@@ -129,7 +129,18 @@ export default { ...@@ -129,7 +129,18 @@ export default {
}, },
}); });
} */ } */
this.getAirwayList();
await this.getAirwayList();
// 获取正在飞行的航线
console.log('当前飞行状态', this.uavRealTimeData.isFlying);
if (this.uav && this.uavRealTimeData.isFlying) {
let res = await TaskInfo.getTaskInfoRecord({
deviceId: this.uav.deviceId,
});
if (res.code === 0) {
this.selectedAirwayId = res.data.reouteId;
}
}
}, },
beforeDestroy() { beforeDestroy() {
this.bus.$off("startTask", this.onStartTask); this.bus.$off("startTask", this.onStartTask);
...@@ -146,19 +157,22 @@ export default { ...@@ -146,19 +157,22 @@ export default {
* 更新任务列表 * 更新任务列表
*/ */
getAirwayList(id) { getAirwayList(id) {
console.log("getAirwayList", this.taskListAll); return new Promise((resolve) => {
this.rootNode.$emit("airwayListGet", { console.log("getAirwayList", this.taskListAll);
pageNo: 1, this.rootNode.$emit("airwayListGet", {
pageSize: 100, pageNo: 1,
hangar: this.hangar, pageSize: 100,
callback: (res) => { hangar: this.hangar,
this.airwayList = res?.records || []; callback: (res) => {
this.$nextTick(() => { this.airwayList = res?.records || [];
if (id) { this.$nextTick(() => {
this.selectedAirwayId = id; if (id) {
} this.selectedAirwayId = id;
}); }
}, resolve();
});
},
});
}); });
}, },
/** /**
......
<template> <template>
<div> <div>
<Player ref="player" @close="$emit('close')" :url="selectUrl" :name="name" :label="label" style="height: 200px;" /> <Player
ref="player"
@close="$emit('close')"
:url="selectUrl"
:name="name"
:label="label"
style="height: 200px;"
/>
<el-select v-model="selectUrl" class="select" popper-class="mmc"> <el-select v-model="selectUrl" class="select" popper-class="mmc">
<el-option <el-option
v-for="item in streamOptions" v-for="item in streamOptions"
...@@ -110,6 +117,20 @@ export default { ...@@ -110,6 +117,20 @@ export default {
} }
}, },
}, },
selectUrl() {
// 记录用的流是否为清流
if (this.selectUrl.toLowerCase().includes("pzsp://")) {
this.$store.commit("MMCFlightControlCenter/uav/setState", {
key: "isQingLiu",
value: true,
});
} else {
this.$store.commit("MMCFlightControlCenter/uav/setState", {
key: "isQingLiu",
value: false,
});
}
},
}, },
mounted() { mounted() {
this.selectUrl = this.streamOptions[0]?.url || ""; this.selectUrl = this.streamOptions[0]?.url || "";
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<script> <script>
import { Utils } from "../../../../../../../../lib/cesium"; import { Utils } from "../../../../../../../../lib/cesium";
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
import { Control_API } from "../../../../../../../../api"; import { Control_API, TaskInfo } from "../../../../../../../../api";
import AirwayEdit from "./components/airwayEdit"; import AirwayEdit from "./components/airwayEdit";
const airwayEntities = []; // 航线实体 const airwayEntities = []; // 航线实体
...@@ -86,8 +86,8 @@ export default { ...@@ -86,8 +86,8 @@ export default {
}, },
}, },
watch: { watch: {
showAirwayEdit(newVal){ showAirwayEdit(newVal) {
if(newVal){ if (newVal) {
this.listCollapse = true; this.listCollapse = true;
} }
}, },
...@@ -109,42 +109,22 @@ export default { ...@@ -109,42 +109,22 @@ export default {
}, },
async created() { async created() {
this.bus.$on("startTask", this.onStartTask); this.bus.$on("startTask", this.onStartTask);
/* let res = await Control_API.getUavRouteList({ this.bus.$on("refreshAirway", this.getAirwayList);
pageNo: 1, await this.getAirwayList();
pageSize: 100, // 获取正在飞行的航线
}); console.log("当前飞行状态", this.uavRealTimeData.isFlying);
if (res?.code === 0) { if (this.uav && this.uavRealTimeData.isFlying) {
let airwayList = []; let res = await TaskInfo.getTaskInfoRecord({
for (let i = 0; i < res.data.list.length; i++) { deviceId: this.uav.deviceId,
let item = res.data.list[i]; });
let flightCourseJson; if (res.code === 0) {
try { this.selectedAirwayId = res.data.reouteId;
flightCourseJson = JSON.parse(item.flightCourseJson);
} catch (e) {
console.log(e);
}
// 转换成飞控中心能接受的数据协议
let content = flightCourseJson
? await this.$store.dispatch(
"MMCFlightControlCenter/apiPointsToFKZXPoints",
{
list: flightCourseJson?.linePointSaveReqVOS || [],
actionListKey: "pointActionSaveReqVOS",
}
)
: null;
airwayList.push({
name: item.flightName,
id: item.id,
content: content,
});
} }
this.airwayList = airwayList; }
} */
this.getAirwayList();
}, },
beforeDestroy() { beforeDestroy() {
this.bus.$off("startTask", this.onStartTask); this.bus.$off("startTask", this.onStartTask);
this.bus.$off("refreshAirway", this.getAirwayList);
this.clearAirwayEntities(); this.clearAirwayEntities();
}, },
methods: { methods: {
...@@ -158,18 +138,21 @@ export default { ...@@ -158,18 +138,21 @@ export default {
* 更新任务列表 * 更新任务列表
*/ */
getAirwayList(id) { getAirwayList(id) {
console.log("getAirwayList", this.taskListAll); return new Promise((resolve) => {
this.rootNode.$emit("airwayListGet", { console.log("getAirwayList", this.taskListAll);
pageNo: 1, this.rootNode.$emit("airwayListGet", {
pageSize: 100, pageNo: 1,
callback: (res) => { pageSize: 100,
this.airwayList = res?.records || []; callback: (res) => {
this.$nextTick(() => { this.airwayList = res?.records || [];
if (id) { this.$nextTick(() => {
this.selectedAirwayId = id; if (id) {
} this.selectedAirwayId = id;
}); }
}, resolve();
});
},
});
}); });
}, },
/** /**
......
...@@ -116,9 +116,9 @@ export default { ...@@ -116,9 +116,9 @@ export default {
* 挂载录像 * 挂载录像
*/ */
mountRecord(streamData) { mountRecord(streamData) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { console.log("挂载录像", streamData);
topic: "PX4/OBTAIN/" + this.uav.deviceId, this.$store.dispatch("MMCFlightControlCenter/uav/videoTranscribe", {
data: streamData, recordControl: streamData.data.data.status || streamData.data.data.recordControl || false,
callback: () => { callback: () => {
if (streamData.data.data.recordControl) { if (streamData.data.data.recordControl) {
this.$message.success(`录像开始`); this.$message.success(`录像开始`);
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<el-table-column label="当前控制单位" align="center" prop="takeUserName"></el-table-column> <el-table-column label="当前控制单位" align="center" prop="takeUserName"></el-table-column>
<el-table-column label="操作" align="center" prop="name"> <el-table-column label="操作" align="center" prop="name">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="onExit(scope.row)" type="text" size="small" v-if="scope.takeStats">退出接管</el-button> <el-button @click="onExit(scope.row)" type="text" size="small" v-if="scope.row.takeStats">退出接管</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
<template>
<div class="content" v-interact>
<div class="content_head">
<div class="left">
<img src="../../assets/images/mount_head.png" />
<div class="font">车流识别</div>
</div>
<div class="right" @click="() => $emit('close')">关闭</div>
</div>
<div class="content_box">
<div class="items">
<div class="car_item">
<div class="image">
<img :src="baseUrl + trafficData.imagePath" alt="" />
</div>
<div class="info">
<div class="row">
<div class="title">发现车辆:</div>
<div class="props">{{ trafficData.total || "0" }}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import data from "./data";
export default {
props:{
trafficData:{
type: Object,
default: () => {}
}
},
data() {
return {
// ...data,
baseUrl: process.env.VUE_APP_IMG_URL,
};
},
methods: {
},
mounted() {
},
};
</script>
<style lang="scss" scoped>
.content {
position: fixed;
z-index: 101;
top: calc(50% - 120px);
left: calc(50% + 80px);
margin-right: 16px;
width: 468px;
max-height: 635px;
margin-bottom: 190px;
background: rgba(0, 39, 121, 0.5);
box-shadow: 0px 2px 8px 0px rgba(1, 162, 255, 0.7),
inset 0px 0px 64px 0px rgba(26, 138, 227, 0.35),
inset 0px 0px 8px 0px #019aff;
backdrop-filter: blur(2px);
border-radius: 10px 10px 0px 0px;
.content_head {
display: flex;
justify-content: space-between;
height: 32px;
background: linear-gradient(
180deg,
#9198ff 0%,
rgba(45, 81, 153, 0.45) 40%,
#05091a 100%
);
box-shadow: inset 0px 0px 10px 2px #3f9dff;
border-radius: 10px 10px 0px 0px;
align-items: center;
padding: 0 16px;
.left {
display: flex;
align-items: center;
.font {
font-size: 20px;
font-family: YouSheBiaoTiHei;
color: #14faff;
line-height: 26px;
text-shadow: 0px 1px 1px rgba(2, 32, 56, 0.2);
background: linear-gradient(
135deg,
#e3aa77 0%,
#f5cda9 38%,
#f9ecd3 58%,
#fcdbb1 79%,
#edb07a 100%
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
.right {
font-size: 14px;
font-family: MicrosoftYaHei;
color: #d2dfff;
margin-right: 8px;
cursor: pointer;
}
}
.content_box {
width: 100%;
max-height: 600px;
// padding: 0 16px;
// overflow: auto;
position: relative;
.items {
width: 100%;
height: 100%;
display: flex;
align-content: flex-start;
flex-wrap: wrap;
justify-content: space-between;
.car_item {
margin: 11px auto;
width: 90%;
height: 300px;
border: 1px solid #43deff;
padding: 4px 4px 0 4px;
.image {
position: relative;
width: 100%;
height: 90%;
img {
width: 100%;
height: 100%;
}
.tip {
position: absolute;
bottom: 0;
width: 204px;
height: 16px;
background: #000000;
opacity: 0.8;
font-size: 12px;
font-family: MicrosoftYaHei;
color: #b7bfc8;
text-align: center;
line-height: 16px;
}
}
.info {
width: 204px;
height: 53px;
// border: 1px solid #43deff;
background: url("../../assets/images/info.png");
.row {
margin-left: 9px;
padding-top: 7px;
display: flex;
.title {
font-size: 14px;
font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
font-weight: bold;
color: #b7cae2;
}
.props {
// width: 150px;
// height: 19px;
font-size: 14px;
font-family: MicrosoftYaHei;
color: #b7cae2;
word-wrap: break-word;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
// &:hover {
// background: url("../../assets/images/infos.png");
// }
}
}
}
.detail {
display: flex;
flex-direction: column;
margin-top: 12px;
.image {
position: relative;
width: 436px;
height: 255px;
img {
width: 436px;
height: 255px;
}
.tip {
position: absolute;
bottom: 0;
width: 436px;
height: 31px;
background: #000000;
opacity: 0.8;
font-size: 14px;
font-family: MicrosoftYaHei;
color: #b7bfc8;
text-align: center;
line-height: 31px;
}
}
.info {
// display: flex;
// justify-content: space-between;
// flex-wrap: wrap;
.row {
margin-top: 16px;
display: flex;
justify-content: space-between;
.col {
display: flex;
}
.title {
// flex: 1;
flex-shrink: 0;
font-size: 16px;
font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
font-weight: bold;
color: #ffffff;
line-height: 21px;
}
.props {
font-size: 16px;
font-family: MicrosoftYaHei;
color: #c5ebff;
line-height: 21px;
}
}
}
.btn {
margin: 20px 0;
// position: absolute;
// bottom: 0;
align-self: center;
width: 79px;
height: 32px;
background: rgba(23, 70, 216, 0.2);
box-shadow: 0px 2px 4px 0px rgba(23, 33, 60, 0.5),
inset 0px 0px 16px 0px rgba(33, 137, 255, 0.4),
inset 0px 0px 4px 0px #00a7ff;
border-radius: 6px;
// border: 1px solid;
border-image: linear-gradient(
180deg,
rgba(138, 218, 255, 1),
rgba(82, 179, 255, 0)
)
1 1;
font-size: 12px;
font-family: MicrosoftYaHei;
color: #00ffff;
text-align: center;
line-height: 32px;
}
}
}
}
</style>
export default {
list: [
// {
// userName: '何元高',
// birthday: '1974-01-11',
// occurTime: '2022-02-25 08:44;55',
// address: '江苏省盐城市亭湖区人民北路66号华府景城31幢1605室',
// idCard: '320902197401112539',
// labels: ['省内人员'],
// similarity: '63',
// img: 'http://32.128.10.139:30080/components/osg-default/_/video_face_cropped/20220225-ca5ae89e-000a580ae000af-00000020-00000c10',
// imgs:'http://32.128.6.48/uploads/2022/02/25/b4e2793c-bba1-475d-9702-6a9c3f7a1adf.jpeg',
// show: false
// },
]
}
\ No newline at end of file
<template>
<div class="content" v-interact>
<div class="content_head">
<div class="left">
<img src="../../assets/images/mount_head.png" />
<div class="font">人脸识别</div>
</div>
<div class="right" @click="() => $emit('closeface')">关闭</div>
</div>
<div class="content_box">
<div class="face-item" v-for="item in list" :key="item.name">
<div class="avatar xiangsi" :class="item.similarity >= 80 ? 'cheng' : ''">
<div class="avatar-box left">
<img :src="baseUrl + item.recordImageUrl" />
<!-- <img :src="item.snapImageUrl" /> -->
</div>
<div class="compare-box" @click="infoFn(item)">
<div class="value">{{ Number(item.similarity).toFixed(2) }}%</div>
<div class="label cp">相似度</div>
</div>
<div class="avatar-box right">
<img :src="baseUrl + item.snapImageUrl" />
</div>
</div>
<div class="detail" v-if="item.show">
<div class="image">
<div class="left">
<img :src="baseUrl + item.recordImageUrl" alt />
<div class="tip">比对照片</div>
</div>
<div class="right">
<img :src="baseUrl + item.snapImageUrl" alt />
<div class="tip">抓拍照片</div>
</div>
</div>
<div class="ds">
<div class="row">
<div class="title">姓名:</div>
<div class="props">{{ item.userName || '暂无' }}</div>
</div>
<div class="row">
<div class="title">身份证号:</div>
<div class="props">{{ item.idCard || '暂无' }}</div>
</div>
<div class="row">
<div class="title">出生年份:</div>
<div class="props">{{ item.birthday || '暂无' }}</div>
</div>
<div class="row">
<div class="title">发现时间:</div>
<div class="props">{{ item.occurTime || '暂无' }}</div>
</div>
<div class="row">
<div class="title">发现地点:</div>
<div class="props">{{ item.addr || item.address || '暂无' }}</div>
</div>
<div class="row">
<div class="title">AI识别:</div>
<div
class="props border"
>{{ item.labels && item.labels.length > 0 ? item.labels[0] : '暂无' }}</div>
</div>
</div>
</div>
<div class="down" @click="item.show = !item.show">
<img v-if="!item.show" src="../../assets/images/down.png" alt />
<img v-else src="../../assets/images/up.png" alt />
</div>
</div>
</div>
</div>
</template>
<script>
import data from "./data";
export default {
props: ["uavId"],
data() {
return {
...data,
baseUrl: process.env.VUE_APP_IMG_URL,
};
},
methods: {
async get_face_list() {
if (!this.uavId) {
this.$message.error("请选择无人机");
return;
}
/* let data = {
aiFacePid: this.uavId,
};
let res = await API.AIUSE.getFaceuavvideoMsg(data);
for (let i = 0; i < res.length; i++) {
let item = res[i];
if (res.length == 1) {
item.show = true;
} else {
item.show = false;
}
if (Number(item.longi) && Number(item.lati)) {
let address = await API.MAP.AiRegeo({
location: `${item.longi},${item.lati}`,
});
item.addr =
address.province.value +
address.city.value +
address.dist.value +
address.road.roadname +
address.poi;
}
}
this.list = res || []; */
},
},
mounted() {
this.get_face_list();
},
};
</script>
<style lang="scss" scoped>
.content {
z-index: 101;
position: fixed;
top: 16vh;
left: calc(50%);
margin-left: -234px;
width: 468px;
max-height: 635px;
background: rgba(0, 39, 121, 0.5);
box-shadow: 0px 2px 8px 0px rgba(1, 162, 255, 0.7),
inset 0px 0px 64px 0px rgba(26, 138, 227, 0.35),
inset 0px 0px 8px 0px #019aff;
backdrop-filter: blur(2px);
border-radius: 10px 10px 0px 0px;
.content_head {
display: flex;
justify-content: space-between;
height: 32px;
background: linear-gradient(
180deg,
#9198ff 0%,
rgba(45, 81, 153, 0.45) 40%,
#05091a 100%
);
box-shadow: inset 0px 0px 10px 2px #3f9dff;
border-radius: 10px 10px 0px 0px;
align-items: center;
padding: 0 16px;
.left {
display: flex;
align-items: center;
.font {
font-size: 20px;
font-family: YouSheBiaoTiHei;
color: #14faff;
line-height: 26px;
text-shadow: 0px 1px 1px rgba(2, 32, 56, 0.2);
background: linear-gradient(
135deg,
#e3aa77 0%,
#f5cda9 38%,
#f9ecd3 58%,
#fcdbb1 79%,
#edb07a 100%
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
.right {
font-size: 14px;
font-family: MicrosoftYaHei;
color: #d2dfff;
margin-right: 8px;
cursor: pointer;
}
}
.content_box {
width: 436px;
max-height: 600px;
padding: 0 16px;
overflow: auto;
.face-item {
position: relative;
margin-bottom: 15px;
&:last-child {
margin-bottom: 0;
}
.avatar {
display: flex;
justify-content: space-between;
align-items: center;
height: 130px;
position: relative;
margin-bottom: 15px;
.avatar-box {
width: 130px;
height: 130px;
// box-sizing: border-box;
// display: flex;
// align-items: center;
img {
width: 88px;
height: 88px;
margin-top: 21px;
}
&.left {
margin-left: 7px;
}
&.right {
display: flex;
justify-content: flex-end;
margin-right: 6px;
}
}
.compare-box {
width: 74px;
height: 74px;
border-radius: 74px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: absolute;
left: 50%;
transform: translateX(-50%);
cursor: pointer;
.value {
font-size: 24px;
font-family: UniDreamLED;
color: #ffffff;
line-height: 28px;
}
.label {
font-size: 16px;
font-family: MicrosoftYaHei;
color: #c7ebff;
line-height: 21px;
letter-spacing: 1px;
}
}
}
.detail {
width: 404px;
height: 379px;
padding: 16px;
.image {
height: 150px;
display: flex;
justify-content: space-between;
.left,
.right {
position: relative;
width: 198px;
height: 150px;
img {
width: 198px;
height: 150px;
}
.tip {
position: absolute;
bottom: 0;
width: 198px;
height: 27px;
background: #0c1120;
opacity: 0.8;
font-size: 14px;
font-family: MicrosoftYaHeiUI;
color: #aee9ff;
line-height: 27px;
text-align: center;
}
}
}
.ds {
.row {
margin-top: 16px;
display: flex;
.title {
white-space: nowrap;
width: 70px;
font-size: 14px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #ffffff;
line-height: 18px;
}
.props {
// position: absolute;
margin-left: 30px;
font-size: 16px;
font-family: MicrosoftYaHeiUI;
color: #aee9ff;
line-height: 20px;
}
.border {
width: 70px;
height: 23px;
border-radius: 8px;
border: 1px solid #ff4a4a;
font-size: 14px;
font-family: MicrosoftYaHeiUI;
color: #ff4a4a;
line-height: 23px;
text-align: center;
}
}
}
}
.down {
width: 436px;
height: 20px;
box-shadow: inset 0px 0px 12px 0px #019aff;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 8px;
.icon {
}
}
}
}
}
.xiangsi {
background-image: url("../../assets/images/lan.png");
background-size: 100% 100%;
}
.cheng {
background-image: url("../../assets/images/cheng.png");
background-size: 100% 100%;
}
</style>
\ No newline at end of file
...@@ -68,8 +68,7 @@ ...@@ -68,8 +68,7 @@
@click="getActive(10,!videoStatus ? 'start' : 'end')" @click="getActive(10,!videoStatus ? 'start' : 'end')"
> >
<!-- <div class="num">2/3</div> --> <!-- <div class="num">2/3</div> -->
<div v-if="videoStatus == 0" class="name">开始录像</div> <div v-if="videoStatus == 0" class="name">停止录像</div>
<div v-if="videoStatus == 2" class="name">结束录像</div>
<div v-if="videoStatus == 1" class="name">录像中</div> <div v-if="videoStatus == 1" class="name">录像中</div>
</div> </div>
</div> </div>
...@@ -247,7 +246,7 @@ export default { ...@@ -247,7 +246,7 @@ export default {
}); });
} }
} }
console.log(this.aiList, "save"); console.log("save", this.aiList, this.pointList);
}, },
getPoint() { getPoint() {
let blob = this.$parent.screenShot(); let blob = this.$parent.screenShot();
...@@ -421,14 +420,14 @@ export default { ...@@ -421,14 +420,14 @@ export default {
) { ) {
this.pointList[this.pointList.length - 1].actions.push(data); this.pointList[this.pointList.length - 1].actions.push(data);
} }
this.videoStatus = 2; this.videoStatus = 0;
} }
}, },
getDe() { getDe() {
this.active = 2; this.active = 2;
this.aiShow = false; this.aiShow = false;
this.stayShow = false; this.stayShow = false;
console.log(this.aiList, "123"); console.log(this.aiList, "航点动作");
// setTimeout(() => { // setTimeout(() => {
if (this.pointInfo && this.pointInfo.aiList) { if (this.pointInfo && this.pointInfo.aiList) {
...@@ -489,6 +488,16 @@ export default { ...@@ -489,6 +488,16 @@ export default {
}); });
let time = parseInt(distance / 6); let time = parseInt(distance / 6);
let aiList = this.aiList
.filter((item) => item.switch)
.map((item) => {
return {
id: item.id,
type: item.type,
isSingle: item.check,
};
});
let waypoints = this.pointList.map((val) => { let waypoints = this.pointList.map((val) => {
return { return {
altitude: val.alt, altitude: val.alt,
...@@ -500,6 +509,7 @@ export default { ...@@ -500,6 +509,7 @@ export default {
speed: this.speed, speed: this.speed,
stay: 0, stay: 0,
waypointActions: val.actions, waypointActions: val.actions,
aiList: aiList,
}; };
}); });
let data = { let data = {
...@@ -512,6 +522,9 @@ export default { ...@@ -512,6 +522,9 @@ export default {
this.rootNode.$emit("airwayAdd", { this.rootNode.$emit("airwayAdd", {
airway: data, airway: data,
callback: () => {
this.bus.$emit("refreshAirway");
},
}); });
this.$emit("close"); this.$emit("close");
}, 0); }, 0);
......
...@@ -350,34 +350,19 @@ ...@@ -350,34 +350,19 @@
@dblclick.native.stop @dblclick.native.stop
></PointList> ></PointList>
</div> </div>
<FaceAI v-if="faceAiShow" :uavId="pid" @closeface="faceAiShow = false" />
<CarAI v-if="carAiShow" :uavId="uav.deviceId" :list="carList" @closecar="carAiShow = false" />
<Traffic v-if="trafficShow" :trafficData="trafficData" @close="trafficShow = false" />
<carTraffic
v-if="cartrafficShow"
:trafficData="cartrafficData"
@close="cartrafficShow = false"
/>
</div> </div>
</template> </template>
<script> <script>
import { ViewLibrary } from "../../../../api"; import { ViewLibrary } from "../../../../api";
import dayjs from "dayjs"; import dayjs from "dayjs";
import FaceAI from "./components/faceai";
import CarAI from "./components/carai";
import Traffic from "./components/traffic";
import carTraffic from "./components/carTraffic";
import LiveNVRPlayer from "./components/livenvr/index.vue"; import LiveNVRPlayer from "./components/livenvr/index.vue";
import QingLiuPlayer from "./components/qingliu"; import QingLiuPlayer from "./components/qingliu";
import SRSPlayer from "./components/srs"; import SRSPlayer from "./components/srs";
import { saveAs } from "file-saver";
import { to_moveMount } from "../../../../utils/to_moveMount.js"; import { to_moveMount } from "../../../../utils/to_moveMount.js";
import { newDate } from "../../../../utils/formatDate";
import Obstacle from "./components/obstacle"; import Obstacle from "./components/obstacle";
import PointList from "./components/pointList"; import PointList from "./components/pointList";
import videoModelChange from "./components/videoModelChange"; import videoModelChange from "./components/videoModelChange";;
import fkutils from "./methods/utils";
import { mapState } from "vuex"; import { mapState } from "vuex";
import AiList from "./components/aiList"; import AiList from "./components/aiList";
...@@ -386,10 +371,6 @@ export default { ...@@ -386,10 +371,6 @@ export default {
components: { components: {
QingLiuPlayer, QingLiuPlayer,
LiveNVRPlayer, LiveNVRPlayer,
FaceAI,
CarAI,
Traffic,
carTraffic,
PointList, PointList,
Obstacle, Obstacle,
SRSPlayer, SRSPlayer,
...@@ -411,16 +392,6 @@ export default { ...@@ -411,16 +392,6 @@ export default {
showInfo: false, //清流视频信息展示 showInfo: false, //清流视频信息展示
infoData: null, //清流信息 infoData: null, //清流信息
raw_msg: 0, raw_msg: 0,
carList: [], //车牌识别结果
aiVisible: false, //打开ai
pid: null,
faceAiShow: false,
carAiShow: false,
trafficShow: false,
cartrafficShow: false,
trafficData: {},
cartrafficData: {},
showPlayer: true, // 显示播放器, 用于刷新播放器 showPlayer: true, // 显示播放器, 用于刷新播放器
smallFPV: true, // FPV小化显示 smallFPV: true, // FPV小化显示
isStatus: false, isStatus: false,
...@@ -454,10 +425,7 @@ export default { ...@@ -454,10 +425,7 @@ export default {
seven: -15, seven: -15,
}, },
isInfoShow: false, isInfoShow: false,
openOSD: true, // 是否开启OSD
showFlywayAction: false, //显示航点动作 showFlywayAction: false, //显示航点动作
showContinueFly: false, //显示继续飞行对话框
continueFlyContent: "", //继续飞行对话框内容
}; };
}, },
computed: { computed: {
...@@ -644,7 +612,6 @@ export default { ...@@ -644,7 +612,6 @@ export default {
window.removeEventListener("resize", this.fullScreenChangeFn); window.removeEventListener("resize", this.fullScreenChangeFn);
}, },
methods: { methods: {
...fkutils,
startLinePoint() { startLinePoint() {
let gps = {}; let gps = {};
if (this.uavRealTimeData) { if (this.uavRealTimeData) {
......
// import API from "../../../../../api";
import axios from 'axios';
import { Utils } from "../../../../../lib/cesium";
import { zoomTo } from "./zoomTo";
import pngAisu from '../assets/images/aisu.png';
import pngAier from '../assets/images/aier.png';
import pngAiing from '../assets/images/aiing.png';
// 识别类型 2 车牌(公安) 3:人流 4:火焰烟雾 5:漏油识别6.裸土识别8.车牌(共达地)
let urlList = {
2: "http://183.62.225.251:9090/api/inflet/v1/tasks/e01d1d01-52e2-4883-a5de-0ae268764db0/predict",
3: "http://183.62.225.251:9090/api/inflet/v1/tasks/18493235-4dd0-4f54-ab55-c1856ca7e3a5/predict",
4: "http://183.62.225.251:9090/api/inflet/v1/tasks/fca2eb65-8b99-4109-9f9e-a9f7fd06ac1f/predict",
5: "http://183.62.225.251:9002/detect/image",
6: "http://183.62.225.251:9090/api/inflet/v1/tasks/05a9d657-8339-4575-bced-04b60b74c690/predict",
8: "http://183.62.225.251:9090/api/inflet/v1/tasks/e01d1d01-52e2-4883-a5de-0ae268764db0/predict",
}
export default {
// 人脸车牌识别
async getcanvasFaceCar(command, deviceHardId, id) {
/**
* command人脸or车牌,a人脸,b车牌
* id代表设备id
* deviceHardId代表无人机序列号
*/
let blob = this.screenShot();
let fd = new FormData();
fd.append("uploadFiles", blob, `下载.jpeg`);
let res = await API.MAPMANAGE.fileUpload(fd);
if (command == "a") {
this.aiuse(res[0].storage, deviceHardId, id);
} else {
this.plate(res[0].storage, deviceHardId, id);
}
},
getPopup(flag, val) {
let scene = viewer.scene
this.aiPopup = new Cesium.BillboardCollection({
scene,
show: true,
});
this.aiPopup.add({
position: Utils.transformWGS842Cartesian({
lng: Number(this.uavData.locationCoordinate3D.longitude),
lat: Number(this.uavData.locationCoordinate3D.latitude),
alt: Number(this.uavData.locationCoordinate3D.altitude),
}),
image: flag ? pngAisu : pngAier,
scale: 1,
width: 54,
height: 89,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
horizontalOrigin: Cesium.VerticalOrigin.CENTER,
id: 258,//字444444
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(
0,
2.2e5
),
scaleByDistance: new Cesium.NearFarScalar(2.5e4, 0.7, 2.2e7, 0),
disableDepthTestDistance: Number.POSITIVE_INFINITY,
});
scene.primitives.add(this.aiPopup);
},
// 人脸
async aiuseV2(url, deviceHardId, single, aiData) {
let data = {
imageUrl: url,
deviceHardId: deviceHardId,
};
if (aiData) {
//区域识别
let res = await API.AIUSE.aiphoto(data);
if (res.code == 200) {
let datapid = {
aiFacePid: res.pid,
};
let resFace = await API.AIUSE.getFaceuavvideoMsg(datapid);
for (let i = 0; i < resFace.length; i++) {
if (resFace[i].idCard == aiData.faceData.id) {
this.$emit("fn", {
data: "POSITION",
type: 513
});
// this.$emit("AIDialog", true, "当前位置识别到人");
this.getPopup(true)
this.pid = res.pid;
this.faceAiShow = true;
}
}
} else {
if (single) {
this.getPopup(false)
}
}
} else {
let res = await API.AIUSE.aiphoto(data);
if (res.code == 200) {
this.$emit("fn", {
data: "POSITION",
type: 513
});
this.$emit("AIDialog", true, "当前位置识别到人");
this.getPopup(true)
this.pid = res.pid;
this.faceAiShow = true;
} else {
if (single) {
this.getPopup(false)
}
}
}
},
// 车牌
async plateV2(url, deviceHardId, single, aiData) {
let data = {
imgUrl: url,
deviceHardId: deviceHardId,
};
if (aiData) {
//区域识别
let res = await API.AIUSE.palteId(data);
if (res.code == 200) {
res.data.forEach(val => {
if (val.plateNum == aiData.carData.carnum) {
this.$emit("fn", {
data: "POSITION",
type: 513
});
// this.$emit("AIDialog", true, "当前位置识别到车辆");
this.getPopup(true)
this.carList = res.data;
this.carAiShow = true;
}
})
} else {
if (single) {
this.getPopup(false)
}
}
} else {
let res = await API.AIUSE.palteId(data);
if (res.code == 200) {
this.$emit("fn", {
data: "POSITION",
type: 513
});
this.$emit("AIDialog", true, "当前位置识别到车辆");
this.getPopup(true)
this.carList = res.data;
this.carAiShow = true;
} else {
if (single) {
this.getPopup(false)
}
}
}
},
//人流识别
async flowV2(url, deviceHardId, single) {
let data = {
imageUrl: url,
deviceHardId: deviceHardId,
};
let res2 = await API.FCKERNEL.crowdDensity(data);
if (res2 && res2.total) {
this.$emit("fn", {
data: "POSITION",
type: 513
});
this.$emit("AIDialog", true, "当前位置识别到人群");
this.getPopup(true)
this.trafficShow = true;
this.trafficData = res2;
} else {
if (single) {
this.getPopup(false)
}
}
},
//ai识别
async aiIdentify(aiData, flag, single) {
let {
mqttType, //发送数据类型 true 代表无人机 false 代表机库
deviceHardId,
id,
aiType, // 识别类型 2 车牌(公安) 3:人流 4:火焰烟雾 5:漏油识别6.裸土识别8.车牌(共达地)
} = aiData
let blob = this.screenShot();
let data = {
image: null,
};
if (aiType > 1 && aiType != 5 && aiType != 2 && aiType != 10) {
blobToBase64(blob, async (base64DataUrl) => {
data.image = base64DataUrl;
let res = await axios.post(
urlList[aiType],
data
);
if (res.data.data.targets && res.data.data.targets.length > 0) {
this.timerList.forEach(v => {
clearInterval(v)
})
this.timerList = []
if (flag) {
if (aiType != 10) {
this.$message.success("识别成功!")
}
} else {
if (this.uav.network == 2) {
this.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + this.uav.deviceId,
data: {
type: window.$mmc.$store.state.MMCMQTT.orders.无人机模式切换,
data: "HOLD",
},
callback() {
},
});
} else {
}
if (aiType == 4) {
await this.$confirm("当前区域识别到烟雾", "提示", {
cancelButtonText: "取消",
confirmButtonText: "继续飞行",
customClass: "uav_controlPane",
showClose: false,
})
this.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + this.uav.deviceId,
data: {
type: window.$mmc.$store.state.MMCMQTT.orders.无人机模式切换,
data: "AUTO_MISSION",
},
callback() {
},
});
} else if (aiType == 5) {
await this.$confirm("当前识别到有漏油", "提示", {
cancelButtonText: "取消",
confirmButtonText: "继续飞行",
customClass: "uav_controlPane",
showClose: false,
})
this.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + this.uav.deviceId,
data: {
type: window.$mmc.$store.state.MMCMQTT.orders.无人机模式切换,
data: "AUTO_MISSION",
},
callback() {
},
});
}
// else if (aiType == 6) { //
// this.$emit("AIDialog", true, "当前区域识别到异物");
// }
else if (aiType == 7) { }
this.getPopup(true)
}
// }
let fd = new FormData();
fd.append("uploadFiles", blob, `下载.jpeg`);
let res2 = await API.MAPMANAGE.fileUpload(fd);
let carJson = res.data.data //出鬼了,无人机识别车辆没用,机库有用,才写的
if (aiType != 2) {
let data2 = {
aiType: aiType,
imageUrl: res2[0].storage,
deviceHardId: deviceHardId,
jsonData: JSON.stringify(res.data.data),
};
let swimres = await API.FCKERNEL.insertSwimmingMonitor(data2);
} else {
let arr = []
carJson.targets.forEach(val => {
let data = {
plate_detection: null
}
data.plate_detection = {
x: val.bbox.box.left_top_x,
y: val.bbox.box.left_top_y,
w: val.bbox.box.right_bottom_x - val.bbox.box.left_top_x,
h: val.bbox.box.right_bottom_y - val.bbox.box.left_top_y
}
data.plate_number = val.bbox.label
data.imageUrl = res2[0].storage
data.deviceHardId = deviceHardId
arr.push(data)
})
let resCar = await API.FCKERNEL.addPlateInfoByNumber(arr);
// console.log(Array.isArray(resCar),"dfsfaf");
if (Array.isArray(resCar)) {
this.carList = resCar;
this.carAiShow = true;
} else {
this.$message.error(resCar)
}
}
// process.env.VUE_APP_IMG_URL +
let imgshowurl = process.env.VUE_APP_IMG_URL + res2[0].url;
let jsondata = {
jsonData: JSON.stringify(res.data.data)
}
this.$emit("imgUrl", imgshowurl, aiType, jsondata);
} else {
if (single) {
this.getPopup(false)
}
// this.$message.error("无识别结果!")
if (flag) {
this.photoSelf(deviceHardId, true)
}
}
});
} else {
if (aiType == 5) {
let fds = new FormData();
fds.append("image", blob, `下载.jpeg`);
fds.append("iscount", 1);
let res = await axios.post(
urlList[aiType],
fds
);
if (res && res.data && res.data.data && res.data.data.data.length > 0) {
this.timerList.forEach(v => {
clearInterval(v)
})
this.timerList = []
if (flag) {
if (aiType != 10) {
this.$message.success("识别成功!")
}
} else {
if (mqttType) {
this.$emit("fn", {
data: "HOLD",
type: 513
}, "wrj");
} else if (!mqttType) {
// } else {
this.$emit("fn", {
data: "POSITION",
type: 513
});
}
this.getPopup(true)
}
// }
let fd = new FormData();
fd.append("uploadFiles", blob, `下载.jpeg`);
let res2 = await API.MAPMANAGE.fileUpload(fd);
if (aiType != 2) {
let data2 = {
aiType: aiType,
imageUrl: res2[0].storage,
deviceHardId: deviceHardId,
jsonData: JSON.stringify(res.data.data),
};
let swimres = await API.FCKERNEL.insertSwimmingMonitor(data2);
}
// process.env.VUE_APP_IMG_URL +
let imgshowurl = process.env.VUE_APP_IMG_URL + res2[0].url;
let jsondata = {
jsonData: JSON.stringify(res.data.data)
}
this.$emit("imgUrl", imgshowurl, aiType, jsondata);
} else {
if (single) {
this.getPopup(false)
}
// this.$message.error("无识别结果!")
if (flag) {
this.photoSelf(deviceHardId, true)
}
}
} else if(aiType == 10){
// let token = await API.MAPMANAGE.getToken();
// console.log(token,"token");
// let data = {
// image_type: "BASE64",
// }
let fd = new FormData();
fd.append("image", blob, `下载.jpeg`);
let res = await API.MAPMANAGE.detect(fd);
if (res.code == 0) {
let fd2 = new FormData();
fd2.append("uploadFiles", blob, `下载.jpeg`);
let res2 = await API.MAPMANAGE.fileUpload(fd2);
let data2 = {
aiType: aiType,
imageUrl: res2[0].storage,
deviceHardId: deviceHardId,
jsonData: JSON.stringify(res.data),
};
let swimres = await API.FCKERNEL.insertSwimmingMonitor(data2);
let imgshowurl = process.env.VUE_APP_IMG_URL + res2[0].url;
let jsondata = {
jsonData: JSON.stringify(res.data)
}
this.$emit("imgUrl", imgshowurl, aiType, jsondata);
} else {
if (flag) {
this.photoSelf(deviceHardId, true)
}
}
console.log(res,"baidures");
// blobToBase64(blob, async (base64DataUrl) => {
// data.image = base64DataUrl;
// })
} else {
if (aiType != 0) {
let fd = new FormData();
fd.append("uploadFiles", blob, `下载.jpeg`);
let res = await API.MAPMANAGE.fileUpload(fd);
if (aiData.spaceFlag) {
if (aiType == 1) {
this.aiuseV2(res[0].storage, deviceHardId, single, aiData.spaceFlag)
}
} else {
if (aiType == 1) {
this.aiuse()
} else if (aiType == 2) {
this.plate()
}
}
}
}
}
function blobToBase64(blob, callback) {
let reader = new FileReader();
reader.onload = () => {
callback(reader.result);
};
reader.readAsDataURL(blob);
}
},
async aiIdentify_zd(aiData, flag, single) {
let flightMode = this.$store.state.shoudong.Mstate
if (flightMode != '航线模式') {
return false
}
let {
mqttType, //发送数据类型 true 代表无人机 false 代表鹰巢
deviceHardId,
id,
aiType, // 识别类型 4 代表游泳 5:跌倒检测 6:异物检测7:火焰烟雾8:车辆朝向9:车辆类型检测 10:车道分割线
} = aiData
let blob = this.screenShot();
let data = {
image: null,
};
if (aiType > 3) {
blobToBase64(blob, async (base64DataUrl) => {
data.image = base64DataUrl;
// console.log(aiData.aiType,"aiTypeaiTypev");
let res = await axios.post(
urlList[aiType],
data
);
// if(this.indexswim == 10){
if (res.data.data.targets && res.data.data.targets.length > 0) {
// clearInterval(this.AISetInterval);
// this.AISetInterval = null;
this.timerList.forEach(v => {
clearInterval(v)
})
this.timerList = []
// if (aiType == 4) {
if (flag) {
if (aiType != 12) {
this.$message.success("识别成功!")
}
} else {
if (mqttType) {
this.$emit("fn", {
data: "HOLD",
type: 513
}, "wrj");
} else if(!mqttType && aiType != 6) {
this.$emit("fn", {
data: "POSITION",
type: 513
});
}
if (aiType == 4) {
this.$emit("AIDialog", true, "当前识别到有人游泳");
} else if (aiType == 5) {
this.$emit("AIDialog", true, "当前识别到有人员跌倒");
} else if (aiType == 6) { //
// this.$emit("AIDialog", true, "当前区域识别到异物");
this.$emit("continue")
// let deviceTyoe = null
// if (mqttType) {
// deviceTyoe = 0
// } else {
// deviceTyoe = 1
// }
// // 识别到异物后机载拍照三张
// // stream 视频播放类型 deviceTyoe 代表无人机类型
// let stream = this.$store.state.fckernel.stream
// this.photoNX(id, stream, deviceTyoe, true)
// this.photoNX(id, stream, deviceTyoe, true)
// this.photoNX(id, stream, deviceTyoe, true)
} else if (aiType == 7) {
this.$emit("AIDialog", true, "当前区域识别到烟雾");
}
this.getPopup(true)
}
// }
let fd = new FormData();
fd.append("uploadFiles", blob, `下载.jpeg`);
let res2 = await API.MAPMANAGE.fileUpload(fd);
let carJson = res.data.data//出鬼了,无人机识别车辆没用,鹰巢有用,才写的
if (aiType != 12) {
let data2 = {
aiType: aiType,
imageUrl: res2[0].storage,
deviceHardId: deviceHardId,
jsonData: JSON.stringify(res.data.data),
};
let swimres = await API.FCKERNEL.insertSwimmingMonitor(data2);
} else {
let arr = []
carJson.targets.forEach(val => {
let data = {
plate_detection: null
}
data.plate_detection = {
x: val.bbox.box.left_top_x,
y: val.bbox.box.left_top_y,
w: val.bbox.box.right_bottom_x - val.bbox.box.left_top_x,
h: val.bbox.box.right_bottom_y - val.bbox.box.left_top_y
}
data.plate_number = val.bbox.label
data.imageUrl = res2[0].storage
data.deviceHardId = deviceHardId
arr.push(data)
})
let resCar = await API.FCKERNEL.addPlateInfoByNumber(arr);
// console.log(Array.isArray(resCar),"dfsfaf");
if (Array.isArray(resCar)) {
this.carList = resCar;
this.carAiShow = true;
} else {
this.$message.error(resCar)
}
}
// process.env.VUE_APP_IMG_URL +
let imgshowurl = process.env.VUE_APP_IMG_URL + res2[0].url;
let jsondata = {
jsonData: JSON.stringify(res.data.data)
}
this.$emit("imgUrl", imgshowurl, aiType, jsondata);
} else {
if (single) {
this.getPopup(false)
}
// this.$message.error("无识别结果!")
if (flag) {
this.photoSelf(deviceHardId, true)
}
}
});
} else if (aiType <= 3) {
let fd = new FormData();
fd.append("uploadFiles", blob, `下载.jpeg`);
let res = await API.MAPMANAGE.fileUpload(fd);
if (aiData.spaceFlag) {
if (aiType == 1) {
this.aiuseV2(res[0].storage, deviceHardId, single, aiData.spaceFlag)
} else if (aiType == 2) {
this.plateV2(res[0].storage, deviceHardId, single, aiData.spaceFlag)
} else if (aiType == 3) {
this.flowV2(res[0].storage, deviceHardId, single, aiData.spaceFlag);
}
} else {
if (aiType == 1) {
this.aiuseV2(res[0].storage, deviceHardId, single)
} else if (aiType == 2) {
this.plateV2(res[0].storage, deviceHardId, single)
} else if (aiType == 3) {
this.flowV2(res[0].storage, deviceHardId, single);
}
}
}
function blobToBase64(blob, callback) {
let reader = new FileReader();
reader.onload = () => {
callback(reader.result);
};
reader.readAsDataURL(blob);
}
},
// 人脸
async aiuse(url, deviceHardId, id) {
let data = {
imageUrl: url,
deviceHardId: deviceHardId,
};
if (id) {
this.$el_message("正在识别中...", () => { }, "info", 0);
}
let res = await API.AIUSE.aiphoto(data);
let dataRun = {
taskId: this.taskId,
deviceId: id,
};
if (res.code == 200) {
if (this.taskId && id) {
dataRun.typeId = 5;
let run = await API.FCKERNEL.saveDeviceRunMonitorLog(dataRun);
}
if (id) {
this.$el_message("识别成功!", () => { }, "success");
}
this.pid = res.pid;
this.faceAiShow = true;
} else if (res.code == 201) {
if (id) {
this.$el_message(res.message, () => { }, "error");
}
if (this.taskId && id) {
dataRun.typeId = 7;
let run = await API.FCKERNEL.saveDeviceRunMonitorLog(dataRun);
}
} else {
if (id) {
this.$el_message(res.message, () => { }, "error");
}
if (this.taskId && id) {
dataRun.typeId = 6;
let run = await API.FCKERNEL.saveDeviceRunMonitorLog(dataRun);
}
}
},
// 车牌
async plate(url, deviceHardId, id) {
let data = {
imgUrl: url,
deviceHardId: deviceHardId,
};
if (id) {
this.$el_message("正在识别中...", () => { }, "info", 0);
}
let res = await API.AIUSE.palteId(data);
let dataRun = {
taskId: this.taskId,
deviceId: id,
};
if (res.code == 200) {
if (this.taskId && id) {
dataRun.typeId = 8;
let run = await API.FCKERNEL.saveDeviceRunMonitorLog(dataRun);
}
if (id) {
this.$el_message("识别完成", () => { }, "success");
}
this.carList = res.data;
this.carAiShow = true;
} else if (res.code == 201) {
if (id) {
this.$el_message(res.message, () => { }, "error");
}
if (this.taskId && id) {
dataRun.typeId = 10;
let run = await API.FCKERNEL.saveDeviceRunMonitorLog(dataRun);
}
} else {
if (id) {
this.$el_message(res.message, () => { }, "error");
}
if (this.taskId && id) {
dataRun.typeId = 9;
let run = await API.FCKERNEL.saveDeviceRunMonitorLog(dataRun);
}
}
},
//车流识别
async carFlow(deviceHardId) {
let blob = this.screenShot();
let fd = new FormData();
fd.append("uploadFiles", blob, `下载.jpeg`);
let res = await API.MAPMANAGE.fileUpload(fd);
let data = {
// imageUrl:"http://32.128.6.52:9000/uploads/2023/12/06/16976801912736.png",
imageUrl: res[0].storage,
deviceHardId: deviceHardId,
};
let res2 = await API.FCKERNEL.carCrowdDensity(data);
// console.log(res2,"SSSSS");
// return
if (res2 && res2.total) {
this.cartrafficShow = true;
this.cartrafficData = res2;
let jsondata = {
jsonData: JSON.stringify(res2.location)
}
this.$emit("imgUrl", process.env.VUE_APP_IMG_URL+res[0].url, 13,jsondata);
}
else {
this.$el_message("识别失败!", () => { }, "error");
}
},
//人流识别
async flow(deviceHardId) {
let blob = this.screenShot();
let fd = new FormData();
fd.append("uploadFiles", blob, `下载.jpeg`);
let res = await API.MAPMANAGE.fileUpload(fd);
let data = {
// imageUrl:"http://32.128.6.52:9000/uploads/2023/05/26/2f183488-ad62-41c2-bb89-736ade5d8f36.png",
imageUrl: res[0].storage,
deviceHardId: deviceHardId,
};
let res2 = await API.FCKERNEL.crowdDensity(data);
// console.log(res2,"SSSSS");
// return
if (res2 && res2.total) {
this.trafficShow = true;
this.trafficData = res2;
let jsondata = {
jsonData: JSON.stringify(res2.data)
}
// this.$emit("imgUrl", res[0].storage, 3,jsondata);
}
else {
this.$el_message("识别失败!", () => { }, "error");
}
},
async mount_angle() {
let mount = this.$store.state.fckernel.mount
let data = {
"type": 514,
"data": {
"mountId": mount.mountId,//挂载ID
"payload": [165, 79, 17, 85, 170, 220, 12, 26, 11, 0, 0, 64, 0, 0, 0, 0, 0, 93, 221]
}
}
this.$emit("fn", data, "wrj");
this.$emit("fn", data, "wrj");
},
CAMERA_ZOOM(data) {
if (data.actions.length > 0) {
data.actions.forEach(item => {
if (item.actionType == "CAMERA_ZOOM") {
let mount = this.$store.state.fckernel.mount
let buffer = zoomTo(item.param2)
let data = {
"type": 514,
"data": {
"mountId": mount.mountId,//挂载ID
"payload": buffer
}
}
this.$emit("fn", data, "wrj");
}
});
}
},
async lineAi(val, aiData) {
let aiDataLine = aiData
let progress = val.waypointIndex
// if(val.isFinish){
if (this.lineInfo.points) {
let data = this.lineInfo.points[progress - 1]
console.log(progress, data, '航点');
// 执行变倍操作
this.CAMERA_ZOOM(data)
// 如果是异物识别挂载调整90°
let yw = data.ailist.filter(item => item.id == 6)
if (yw && yw[0].switch) {
this.mount_angle()
//如果是异物识别挂载调整90°
val.isFinishAction = true
console.log('挂载调整90°');
}
let timer = null
if (val.isFinishAction) {
console.log(data.ailist, 'data.ailist');
if (data.ailist) {
console.log(this.aiPopup, 'this.aiPopup-----');
if (!this.aiPopup) {
let scene = viewer.scene
this.aiPopup = new Cesium.BillboardCollection({
scene,
show: true,
});
this.aiPopup.add({
position: Utils.transformWGS842Cartesian({
lng: Number(this.uavData.locationCoordinate3D.longitude),
lat: Number(this.uavData.locationCoordinate3D.latitude),
alt: Number(this.uavData.locationCoordinate3D.altitude),
}),
image: pngAiing,
scale: 1,
width: 54,
height: 89,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
horizontalOrigin: Cesium.VerticalOrigin.CENTER,
id: 258,//字444444
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(
0,
2.2e5
),
scaleByDistance: new Cesium.NearFarScalar(2.5e4, 0.7, 2.2e7, 0),
disableDepthTestDistance: Number.POSITIVE_INFINITY,
});
scene.primitives.add(this.aiPopup);
this.$emit("getAiPopup", this.aiPopup)
}
data.ailist.forEach(item => {
console.log(item.check, 'item.check');
if (item.check) {
aiDataLine.aiType = item.id
if (this.lineInfo.carData || this.lineInfo.faceData) {
aiDataLine.spaceFlag = true
aiDataLine.carData = this.lineInfo.carData
aiDataLine.faceData = this.lineInfo.faceData
} else {
aiDataLine.spaceFlag = false
}
this.aiIdentify(aiDataLine, false, true)
} else if (!item.check && item.switch) {
if (this.timers.indexOf(item.id) == -1) {
timer = setInterval(() => {
this.aiIdentify_zd(aiDataLine, false)
}, 300);
this.timers.push(item.id)
this.timerList.push(timer)
} else {
aiDataLine.aiType = item.id,
timer = setInterval(() => {
this.aiIdentify_zd(aiDataLine, false)
}, 300);
this.timerList.push(timer)
}
} else if (!item.switch && item.history) {
console.log('结束航点');
let num = this.timers.indexOf(item.id)
// console.log(num,"mmmm");
if (this.timers.indexOf(item.id) > -1) {
this.timers.splice(num, 1)
clearInterval(this.timerList[num])
this.timerList.splice(num, 1)
// console.log(this.timerList,"222");
}
}
})
}
}
}
}
// }
}
\ No newline at end of file
...@@ -1175,7 +1175,11 @@ const actions = { ...@@ -1175,7 +1175,11 @@ const actions = {
}, },
type: 528, type: 528,
}; };
if (data.playerFormat.toLocaleLowerCase() == "qingliu") { let isQingLiu = state.isQingLiu;
if(data.isQingLiu !== undefined){
isQingLiu = data.isQingLiu;
}
if (isQingLiu) {
streamData.data.messageID = 1017; streamData.data.messageID = 1017;
streamData.data.data.status = data.recordControl; streamData.data.data.status = data.recordControl;
} else { } else {
...@@ -1241,7 +1245,11 @@ const actions = { ...@@ -1241,7 +1245,11 @@ const actions = {
}, },
type: 528, type: 528,
}; };
if (data.isQingLiu) { let isQingLiu = state.isQingLiu;
if(data.isQingLiu !== undefined){
isQingLiu = data.isQingLiu;
}
if (isQingLiu) {
streamData.data.messageID = 1016; streamData.data.messageID = 1016;
} else { } else {
streamData.data.messageID = 1007; streamData.data.messageID = 1007;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论