提交 8f756cf5 作者: 翁进城

feat: 无人机列表更改为V4接口

上级 82bf688e
流水线 #10101 已失败 于阶段
...@@ -8,7 +8,7 @@ module.exports = defineConfig({ ...@@ -8,7 +8,7 @@ module.exports = defineConfig({
plugins: [new NodePolyfillPlugin()], plugins: [new NodePolyfillPlugin()],
}, },
devServer: { devServer: {
https: true, https: false,
port: 9000, port: 9000,
client: { client: {
overlay: false, overlay: false,
......
...@@ -3,21 +3,6 @@ import request_uav from "../request_uav"; ...@@ -3,21 +3,6 @@ import request_uav from "../request_uav";
class Control_API { class Control_API {
/** /**
* 无人机token登录
* @param {*} data
* @returns
*/
static login(data) {
return request({
url: "/crm/account/loginInfo",
method: "post",
data,
headers: {
token: window.localStorage.getItem("tmj_token"),
},
});
}
/**
* 无人机接管更新状态 * 无人机接管更新状态
* @param {*} id //设备id * @param {*} id //设备id
* @returns * @returns
...@@ -32,7 +17,7 @@ class Control_API { ...@@ -32,7 +17,7 @@ class Control_API {
// 获取无人机树结构列表 // 获取无人机树结构列表
static getUavTree(params) { static getUavTree(params) {
return request({ return request({
url: "/dms/uav/tree", url: "/admin-api/uas/drive/getTree",
// url: '/crm/personalCenter/list?id=4', // url: '/crm/personalCenter/list?id=4',
method: "get", method: "get",
params, params,
......
import axios from 'axios'; import axios from "axios";
import Vue from 'vue'; import Vue from "vue";
import { resetMessage } from './message'; import { resetMessage } from "./message";
import router from '../router'; import router from "../router";
import store from '../store'; import store from "../store";
let prodUrl = 'https://tmj.mmcuav.cn'; let prodUrl = "http://192.168.5.80:30080";
let devUrl = 'https://test.tmj.mmcuav.cn/' let devUrl = "http://192.168.5.80:30080";
const $axios = axios.create({ const $axios = axios.create({
// baseURL: process.env.VUE_APP_BASE_API_TG // baseURL: process.env.VUE_APP_BASE_API_TG
// withCredentials: true // withCredentials: true
}); });
Vue.prototype.$http = axios;
const loading = null; const loading = null;
/** /**
...@@ -22,7 +20,7 @@ const loading = null; ...@@ -22,7 +20,7 @@ const loading = null;
*/ */
$axios.interceptors.request.use( $axios.interceptors.request.use(
(config) => { (config) => {
if(store.state.devMode){ if (store.state.devMode) {
config.baseURL = devUrl; config.baseURL = devUrl;
} else { } else {
config.baseURL = prodUrl; config.baseURL = prodUrl;
...@@ -30,14 +28,14 @@ $axios.interceptors.request.use( ...@@ -30,14 +28,14 @@ $axios.interceptors.request.use(
const token = store.state.token; const token = store.state.token;
if (token) { if (token) {
config.headers['token'] = token; config.headers["Authorization"] = "Bearer " + token;
// config.headers['channel'] = 'channel'; // 渠道 主平台 子平台 后台
console.log('config', config)
} }
config.headers["Tenant-Id"] = 1;
config.headers["terminal"] = 2; // 1 为管理后台 2 为前端项目
return config; return config;
}, },
(error) => { (error) => {
console.log('进来了2....'); console.log("请求出错");
return Promise.reject(error); return Promise.reject(error);
} }
); );
...@@ -47,40 +45,25 @@ $axios.interceptors.request.use( ...@@ -47,40 +45,25 @@ $axios.interceptors.request.use(
*/ */
$axios.interceptors.response.use( $axios.interceptors.response.use(
(response) => { (response) => {
console.log('请求的URL:', response.config.url); console.log("请求的URL:", response.config.url);
if (loading) { if (loading) {
loading.close(); loading.close();
} }
console.log('回应参数...', response); console.log("回应参数...", response);
const status = response.status; const status = response.status;
const res = response.data; const res = response.data;
// 请求成功返回response.data // 请求成功返回response.data
if ((status >= 200 && status < 300) || status === 304) { if ((status >= 200 && status < 300) || status === 304) {
switch (res.code) { switch (res.code) {
case 200: case 0:
return Promise.resolve(response.data); return Promise.resolve(res);
case 525:
if (store.state.isIframe) {
resetMessage.error(response.data.msg);
}
return Promise.resolve(response.data);
case 401:
return Promise.reject(response);
case 403:
if (store.state.isIframe) {
resetMessage.error(response.data.msg);
}
break;
default: default:
if (response.config.responseType === 'blob') { if (response.config.responseType === "blob") {
return Promise.resolve(response.data); return Promise.resolve(res);
} }
resetMessage.error(response?.data?.msg || '网络请求错误'); resetMessage.error(res?.msg || "网络请求错误");
return Promise.reject(response.data); return Promise.reject(res);
} }
} else { } else {
return Promise.reject(response); return Promise.reject(response);
...@@ -95,38 +78,24 @@ $axios.interceptors.response.use( ...@@ -95,38 +78,24 @@ $axios.interceptors.response.use(
switch (error.response.data.code) { switch (error.response.data.code) {
case 401: case 401:
// 返回401 清除token信息并跳转到登陆页面 // 返回401 清除token信息并跳转到登陆页面
// store.commit("user/LOGIN_OUT");
// router.replace({
// path: "/login",
// query: {
// redirect: router.currentRoute.fullPath,
// },
// });
break; break;
case 403: case 403:
// 返回403 清除token信息并跳转到登陆页面 // 返回403 清除token信息并跳转到登陆页面
// store.commit("user/LOGIN_OUT"); resetMessage.error("token过期");
resetMessage.error('token过期');
/* router.replace({
path: "/login",
query: {
redirect: router.currentRoute.fullPath,
},
}); */
break; break;
case 404: case 404:
resetMessage.error('网络请求不存在'); resetMessage.error("网络请求不存在");
break; break;
default: default:
// 统一错误提示弹窗 // 统一错误提示弹窗
resetMessage.error(error.response?.data?.msg || '网络请求错误'); resetMessage.error(error.response?.data?.msg || "网络请求错误");
} }
} else { } else {
// 请求超时或者网络有问题 // 请求超时或者网络有问题
if (error.message.includes('timeout')) { if (error.message.includes("timeout")) {
resetMessage.error('请求超时!请检查网络是否正常'); resetMessage.error("请求超时!请检查网络是否正常");
} else { } else {
resetMessage.error('请求失败,请检查网络是否已连接'); resetMessage.error("请求失败,请检查网络是否已连接");
} }
} }
return Promise.reject(error); return Promise.reject(error);
......
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
this.hangar?.uav?.streamConfiguration this.hangar?.uav?.streamConfiguration
?.find((v) => v.videoType === 1) ?.find((v) => v.videoType === 1)
?.streamUrlMessage.map((v) => ({ ?.streamUrlMessage.map((v) => ({
url: /* coverStreamUrl(v.streamUrl, this.hangar.uav.hardId) */ v.streamUrl, url: /* coverStreamUrl(v.streamUrl, this.hangar.uav.deviceId) */ v.streamUrl,
brand: v.streamType, brand: v.streamType,
})) || [] })) || []
); );
......
...@@ -2,16 +2,16 @@ import { Base64 } from "js-base64"; ...@@ -2,16 +2,16 @@ import { Base64 } from "js-base64";
/** /**
* 转换流地址, 这样后端才可统计播放情况 * 转换流地址, 这样后端才可统计播放情况
* @param {*} url * @param {*} url
* @param {*} hardId * @param {*} deviceId
* @returns * @returns
*/ */
export function coverStreamUrl(url, hardId) { export function coverStreamUrl(url, deviceId) {
if (url.includes("https://live.mmcuav.cn")) { if (url.includes("https://live.mmcuav.cn")) {
const str = Base64.encode( const str = Base64.encode(
JSON.stringify({ JSON.stringify({
token: localStorage.getItem("tmj_token"), token: localStorage.getItem("tmj_token"),
actionId: new Date().getTime().toString(), actionId: new Date().getTime().toString(),
deviceHardId: hardId, deviceHardId: deviceId,
environment: process.env.VUE_APP_ENV === "dev" ? "sit" : "prod", environment: process.env.VUE_APP_ENV === "dev" ? "sit" : "prod",
}) })
); );
......
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
<img class="left-bar-item__icon" src="./assets/images/carAI2.png" /> <img class="left-bar-item__icon" src="./assets/images/carAI2.png" />
<div class="left-bar-item__text">车辆识别</div> <div class="left-bar-item__text">车辆识别</div>
</div> </div>
<Face v-if="openFace" class="ai-dialog" :uavId="uav.hardId" @close="openFace = false" /> <Face v-if="openFace" class="ai-dialog" :uavId="uav.deviceId" @close="openFace = false" />
<Car v-if="openPlate" class="ai-dialog" :uavId="uav.hardId" @close="openPlate = false" /> <Car v-if="openPlate" class="ai-dialog" :uavId="uav.deviceId" @close="openPlate = false" />
<Traffic <Traffic
v-if="openTraffic" v-if="openTraffic"
class="ai-dialog" class="ai-dialog"
:uavId="uav.hardId" :uavId="uav.deviceId"
@close="openTraffic = false" @close="openTraffic = false"
/> />
<Jm v-if="openModeling" :device="device" class="jm-dialog" @close="openModeling = false"></Jm> <Jm v-if="openModeling" :device="device" class="jm-dialog" @close="openModeling = false"></Jm>
......
...@@ -135,7 +135,7 @@ export default { ...@@ -135,7 +135,7 @@ export default {
*/ */
onClear() { onClear() {
let dataSet = this.$store.state.MMCMQTT.dataSet; let dataSet = this.$store.state.MMCMQTT.dataSet;
dataSet[this.hangar.hardId][3] = null; dataSet[this.hangar.deviceId][3] = null;
this.$store.commit("MMCMQTT/setState", { this.$store.commit("MMCMQTT/setState", {
key: "dataSet", key: "dataSet",
value: { value: {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
> >
<el-checkbox <el-checkbox
:disabled="device.online !== 1" :disabled="device.online !== 1"
:value="hangar && device.hardId === hangar.hardId && device.isCheck" :value="hangar && device.deviceId === hangar.deviceId && device.isCheck"
@change="(e) => handClick(e, device)" @change="(e) => handClick(e, device)"
></el-checkbox> ></el-checkbox>
</el-tooltip> </el-tooltip>
......
...@@ -7,10 +7,10 @@ export default { ...@@ -7,10 +7,10 @@ export default {
...mapState("MMCFlightControlCenter/uav", ["uav"]), ...mapState("MMCFlightControlCenter/uav", ["uav"]),
// mqtt实时数据 // mqtt实时数据
mqttDataSetHangar() { mqttDataSetHangar() {
return this.$store.state.MMCMQTT?.dataSet?.[this.hangar?.hardId]; return this.$store.state.MMCMQTT?.dataSet?.[this.hangar?.deviceId];
}, },
mqttDataSetUav() { mqttDataSetUav() {
return this.$store.state.MMCMQTT?.dataSet?.[this.uav?.hardId]; return this.$store.state.MMCMQTT?.dataSet?.[this.uav?.deviceId];
}, },
mqttUrl() { mqttUrl() {
return this.$store.getters["MMCFlightControlCenter/mqttUrl"]; return this.$store.getters["MMCFlightControlCenter/mqttUrl"];
......
...@@ -276,7 +276,7 @@ export default { ...@@ -276,7 +276,7 @@ export default {
}, },
}, },
mounted() { mounted() {
this.GAStopic = "GAS/RECEIVE/" + this.$uav.hardId; this.GAStopic = "GAS/RECEIVE/" + this.$uav.deviceId;
// this.initMqtt(); // this.initMqtt();
this.click_billboard(); this.click_billboard();
}, },
...@@ -392,7 +392,7 @@ export default { ...@@ -392,7 +392,7 @@ export default {
this.statrTime = setInterval(async () => { this.statrTime = setInterval(async () => {
const data = await Control_API.gasRecords({ const data = await Control_API.gasRecords({
size: 1, size: 1,
mountHardId: this.$uav.hardId, mountHardId: this.$uav.deviceId,
sort: "-id", sort: "-id",
// startTime: dayjs().format("YYYY-MM-DD HH:mm:ss"), // startTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
}); });
...@@ -411,10 +411,10 @@ export default { ...@@ -411,10 +411,10 @@ export default {
}, 1000); }, 1000);
}, },
async opengasRecordsFn() { async opengasRecordsFn() {
await Control_API.opengasRecords(this.$uav.hardId); await Control_API.opengasRecords(this.$uav.deviceId);
}, },
async delgasRecordsFn() { async delgasRecordsFn() {
await Control_API.delgasRecords(this.$uav.hardId); await Control_API.delgasRecords(this.$uav.deviceId);
}, },
switchFn() { switchFn() {
if (this.GSAFlag) { if (this.GSAFlag) {
...@@ -464,7 +464,7 @@ export default { ...@@ -464,7 +464,7 @@ export default {
if (GSAentities.length == 0) { if (GSAentities.length == 0) {
let entities = viewer.entities; let entities = viewer.entities;
console.log(entities, "entities"); console.log(entities, "entities");
this.uavModel = entities.getById(`model_${this.$uav.hardId}`); this.uavModel = entities.getById(`model_${this.$uav.deviceId}`);
console.log(this.uavModel, "this.uavModel"); console.log(this.uavModel, "this.uavModel");
if (this.uavModel) { if (this.uavModel) {
let time = Cesium.JulianDate.now(); let time = Cesium.JulianDate.now();
......
...@@ -27,12 +27,12 @@ ...@@ -27,12 +27,12 @@
<img class="left-bar-item__icon" src="./assets/images/ksjm.png" /> <img class="left-bar-item__icon" src="./assets/images/ksjm.png" />
<div class="left-bar-item__text">快速建模</div> <div class="left-bar-item__text">快速建模</div>
</div> --> </div> -->
<Face v-if="openFace" class="ai-dialog" :uavId="uav.hardId" @close="openFace = false" /> <Face v-if="openFace" class="ai-dialog" :uavId="uav.deviceId" @close="openFace = false" />
<Car v-if="openPlate" class="ai-dialog" :uavId="uav.hardId" @close="openPlate = false" /> <Car v-if="openPlate" class="ai-dialog" :uavId="uav.deviceId" @close="openPlate = false" />
<Traffic <Traffic
v-if="openTraffic" v-if="openTraffic"
class="ai-dialog" class="ai-dialog"
:uavId="uav.hardId" :uavId="uav.deviceId"
@close="openTraffic = false" @close="openTraffic = false"
/> />
<Jm v-if="openModeling" :device="device" class="jm-dialog" @close="openModeling = false"></Jm> <Jm v-if="openModeling" :device="device" class="jm-dialog" @close="openModeling = false"></Jm>
......
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
}, },
type: 531, type: 531,
}; };
let topic = `PX4/OBTAIN/${this.uav.hardId}`; let topic = `PX4/OBTAIN/${this.uav.deviceId}`;
this.$store.dispatch("MMCMQTT/publish", { this.$store.dispatch("MMCMQTT/publish", {
topic, topic,
data, data,
...@@ -105,7 +105,7 @@ export default { ...@@ -105,7 +105,7 @@ export default {
}, },
type: 531, type: 531,
}; };
let topic = `PX4/OBTAIN/${this.uav.hardId}`; let topic = `PX4/OBTAIN/${this.uav.deviceId}`;
this.$store.dispatch("MMCMQTT/publish", { this.$store.dispatch("MMCMQTT/publish", {
topic, topic,
data, data,
...@@ -124,7 +124,7 @@ export default { ...@@ -124,7 +124,7 @@ export default {
}, },
type: 531, type: 531,
}; };
let topic = `PX4/OBTAIN/${this.uav.hardId}`; let topic = `PX4/OBTAIN/${this.uav.deviceId}`;
this.$store.dispatch("MMCMQTT/publish", { this.$store.dispatch("MMCMQTT/publish", {
topic, topic,
data, data,
...@@ -143,7 +143,7 @@ export default { ...@@ -143,7 +143,7 @@ export default {
}, },
type: 531, type: 531,
}; };
let topic = `PX4/OBTAIN/${this.uav.hardId}`; let topic = `PX4/OBTAIN/${this.uav.deviceId}`;
this.$store.dispatch("MMCMQTT/publish", { this.$store.dispatch("MMCMQTT/publish", {
topic, topic,
data, data,
......
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
}, },
onClear() { onClear() {
let dataSet = this.$store.state.MMCMQTT.dataSet; let dataSet = this.$store.state.MMCMQTT.dataSet;
dataSet[this.uav.hardId][270] = null; dataSet[this.uav.deviceId][270] = null;
this.$store.commit("MMCMQTT/setState", { this.$store.commit("MMCMQTT/setState", {
key: "dataSet", key: "dataSet",
value: { value: {
......
...@@ -188,7 +188,7 @@ export default { ...@@ -188,7 +188,7 @@ export default {
endTime: this.search.endTime, endTime: this.search.endTime,
pageNo: this.search.pageNo, pageNo: this.search.pageNo,
pageSize: this.search.pageSize, pageSize: this.search.pageSize,
deviceHardId: this.uav.hardId, deviceHardId: this.uav.deviceId,
mark: this.type == "VPN" ? "公网" : this.type == "SPE" ? "专网" : "", mark: this.type == "VPN" ? "公网" : this.type == "SPE" ? "专网" : "",
}; };
this.flag = false; this.flag = false;
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
/> />
<MountController <MountController
@webscoketFn="(data) => fun(data)" @webscoketFn="(data) => fun(data)"
v-if="uav && uav.hardId" v-if="uav && uav.deviceId"
ref="MountControllerRef" ref="MountControllerRef"
/> />
<AlarmLamp v-if="showAlarmLamp" :uav="uav" @close="showAlarmLamp = false" /> <AlarmLamp v-if="showAlarmLamp" :uav="uav" @close="showAlarmLamp = false" />
......
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
class="timeStr" class="timeStr"
ref="timeStr" ref="timeStr"
:class="infoflag ? 'timeStrStyle' : ''" :class="infoflag ? 'timeStrStyle' : ''"
v-if="device.hardId" v-if="device.deviceId"
v-show="isInfoShow && !device.videos.osd" v-show="isInfoShow && !device.videos.osd"
>{{ timeStr || "" }}</div> >{{ timeStr || "" }}</div>
<div <div
class="wsDataleft" class="wsDataleft"
ref="wsDataleft" ref="wsDataleft"
:class="infoflag ? 'leftStyle' : ''" :class="infoflag ? 'leftStyle' : ''"
v-if="device.hardId" v-if="device.deviceId"
v-show="isInfoShow && !device.videos.osd" v-show="isInfoShow && !device.videos.osd"
> >
<div>经度:{{ wsData.longitude || 0 }}</div> <div>经度:{{ wsData.longitude || 0 }}</div>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
class="wsDataright" class="wsDataright"
ref="wsDataright" ref="wsDataright"
:class="infoflag ? 'rightStyle' : ''" :class="infoflag ? 'rightStyle' : ''"
v-if="device.hardId" v-if="device.deviceId"
v-show="isInfoShow && !device.videos.osd" v-show="isInfoShow && !device.videos.osd"
> >
<div>盐城</div> <div>盐城</div>
......
...@@ -395,7 +395,7 @@ ...@@ -395,7 +395,7 @@
</div> </div>
</div> </div>
<FaceAI v-if="faceAiShow" :uavId="pid" @closeface="faceAiShow = false" /> <FaceAI v-if="faceAiShow" :uavId="pid" @closeface="faceAiShow = false" />
<CarAI v-if="carAiShow" :uavId="device.hardId" :list="carList" @closecar="carAiShow = false" /> <CarAI v-if="carAiShow" :uavId="device.deviceId" :list="carList" @closecar="carAiShow = false" />
<Traffic v-if="trafficShow" :trafficData="trafficData" @close="trafficShow = false" /> <Traffic v-if="trafficShow" :trafficData="trafficData" @close="trafficShow = false" />
<carTraffic <carTraffic
v-if="cartrafficShow" v-if="cartrafficShow"
...@@ -750,7 +750,7 @@ export default { ...@@ -750,7 +750,7 @@ export default {
}, },
async checkUseOperateFn(device) { async checkUseOperateFn(device) {
// 查看是否有控制权限 // 查看是否有控制权限
let res = await API.FCKERNEL.checkUseOperate({ hardId: device }); let res = await API.FCKERNEL.checkUseOperate({ deviceId: device });
if (res.code == 201) { if (res.code == 201) {
this.$message.warning(res.msg); this.$message.warning(res.msg);
return false; return false;
...@@ -763,7 +763,7 @@ export default { ...@@ -763,7 +763,7 @@ export default {
}, },
async VideoModelChange() { async VideoModelChange() {
let res = await API.FCKERNEL.checkUseOperate({ let res = await API.FCKERNEL.checkUseOperate({
hardId: this.device.hardId, deviceId: this.device.deviceId,
}); });
if (res.code == 201) { if (res.code == 201) {
this.$message.warning(res.msg); this.$message.warning(res.msg);
...@@ -820,11 +820,11 @@ export default { ...@@ -820,11 +820,11 @@ export default {
}, },
//车流密度 //车流密度
async carFrame() { async carFrame() {
this.carFlow(this.device.hardId); this.carFlow(this.device.deviceId);
}, },
//人流密度 //人流密度
async frame() { async frame() {
this.flow(this.device.hardId); this.flow(this.device.deviceId);
}, },
/** /**
* 截图 * 截图
...@@ -880,7 +880,7 @@ export default { ...@@ -880,7 +880,7 @@ export default {
//游泳识别 //游泳识别
async aiIdentifyType(aiType) { async aiIdentifyType(aiType) {
const data = { const data = {
hardId: this.device.hardId, deviceId: this.device.deviceId,
mqttType: true, mqttType: true,
aiType, aiType,
id: this.device.id, id: this.device.id,
...@@ -894,7 +894,7 @@ export default { ...@@ -894,7 +894,7 @@ export default {
const data = new FormData(); const data = new FormData();
data.append("addtime", dayjs().format("YYYY-MM-DD HH:mm:ss")); data.append("addtime", dayjs().format("YYYY-MM-DD HH:mm:ss"));
data.append("file", blob); data.append("file", blob);
data.append("hardId", this.device.hardId); data.append("deviceId", this.device.deviceId);
data.append("name", this.device.name); data.append("name", this.device.name);
data.append("imageType", 1); data.append("imageType", 1);
data.append("sortie", this.flightSortie || ""); data.append("sortie", this.flightSortie || "");
...@@ -922,7 +922,7 @@ export default { ...@@ -922,7 +922,7 @@ export default {
// 人脸车牌识别 // 人脸车牌识别
handle(command) { handle(command) {
// this.getcanvas(command); // this.getcanvas(command);
this.getcanvasFaceCar(command, this.device.hardId, this.device.id); this.getcanvasFaceCar(command, this.device.deviceId, this.device.id);
}, },
/** /**
* 居中 * 居中
...@@ -954,7 +954,7 @@ export default { ...@@ -954,7 +954,7 @@ export default {
// if mountStatus =1 代表启用 屏幕指点功能 // if mountStatus =1 代表启用 屏幕指点功能
if ( if (
mountData.mountStatus == 1 && mountData.mountStatus == 1 &&
device.hardId == mountData.hardId && device.deviceId == mountData.deviceId &&
mountData.moveType == "wrj" mountData.moveType == "wrj"
) { ) {
let evt = window.event || el; let evt = window.event || el;
...@@ -993,7 +993,7 @@ export default { ...@@ -993,7 +993,7 @@ export default {
let mounteList = { data: buffer, ...mountData }; let mounteList = { data: buffer, ...mountData };
if (buffer) { if (buffer) {
if (this.device.network === 1) { if (this.device.network === 1) {
let topic = "PX4/OBTAIN/" + this.device.hardId; let topic = "PX4/OBTAIN/" + this.device.deviceId;
this.$store.dispatch("MMCMQTT/publish", { this.$store.dispatch("MMCMQTT/publish", {
topic: topic, topic: topic,
data: { data: {
...@@ -1018,7 +1018,7 @@ export default { ...@@ -1018,7 +1018,7 @@ export default {
cmdBuffer: mounteList.data.join(","), cmdBuffer: mounteList.data.join(","),
cmdName: mounteList.name, cmdName: mounteList.name,
}, },
deviceHardId: mounteList.hardId, deviceHardId: mounteList.deviceId,
}; };
this.$store.dispatch("MMCGroundStation/publish", sendData); this.$store.dispatch("MMCGroundStation/publish", sendData);
} }
......
...@@ -15,18 +15,18 @@ ...@@ -15,18 +15,18 @@
/> />
</div> </div>
<div class="online-info"> <div class="online-info">
(共 {{data.online + data.offline}} (共 {{data.onLineCount + data.offLineCount}}
<span <span
class="ml10" class="ml10"
:class="{ online: data.online }" :class="{ online: data.onLineCount }"
>{{ data.online }} 在线</span> >{{ data.onLineCount }} 在线</span>
/ /
{{ data.offline }} 离线) {{ data.offLineCount }} 离线)
</div> </div>
</div> </div>
<div class="uav-item-child-box" :class="{ collapse: data.collapse }"> <div class="uav-item-child-box" :class="{ collapse: data.collapse }">
<Item <Item
v-for="child in data.childs" v-for="child in data.child"
:key="child.id" :key="child.id"
:data="child" :data="child"
:level="level+1" :level="level+1"
...@@ -34,20 +34,25 @@ ...@@ -34,20 +34,25 @@
/> />
<div <div
class="device-item-box" class="device-item-box"
:class="{ online: device.online == 1 }" :class="{ online: device.status == 1 }"
v-for="device in data.uavs" v-for="device in data.driveMonitorReqVOList"
:key="`device_${device.id}`" :key="`device_${device.deviceId}`"
> >
<div class="device-name"> <div class="device-name">
<!-- <span
style="margin-right:10px"
:class="device.status==1&&device.currentOperator==1? 'blue' : device.status==1&&device.currentOperator!=1 ?'yellow':'' "
:title="device.name"
>{{device.name}}</span> -->
<span <span
style="margin-right:10px" style="margin-right:10px"
:class="device.online==1&&device.currentOperator==1? 'blue' : device.online==1&&device.currentOperator!=1 ?'yellow':'' " :class="'blue'"
:title="device.name" :title="device.name"
>{{device.name}}</span> >{{device.name}}</span>
<span style="color:#31DB24 " class="dib" v-if=" device.online == 1 ">(在线)</span> <span style="color:#31DB24 " class="dib" v-if=" device.status == 1 ">(在线)</span>
<span v-else class="dib">(离线)</span> <span v-else class="dib">(离线)</span>
<div class="symbol-icon-box"> <div class="symbol-icon-box">
<template v-if="device.modelName && device.modelName.includes('入云龙1')"> <!-- <template v-if="device.modelName && device.modelName.includes('入云龙1')">
<div class="uav_version status-icon cp"> <div class="uav_version status-icon cp">
<img src="./assets/images/I.svg" /> <img src="./assets/images/I.svg" />
</div> </div>
...@@ -62,25 +67,31 @@ ...@@ -62,25 +67,31 @@
<div class="uav_version status-icon cp"> <div class="uav_version status-icon cp">
<img src="./assets/images/cq.svg" /> <img src="./assets/images/cq.svg" />
</div> </div>
</template> -->
<template>
<div class="uav_version status-icon cp">
<img src="./assets/images/I.svg" />
<img src="./assets/images/I.svg" />
</div>
</template> </template>
</div> </div>
</div> </div>
<div class="device-fns"> <div class="device-fns">
<div <div
class="iconfont icon-luxiang_xianxing" class="iconfont icon-luxiang_xianxing"
:class="{ active: uav && device.id === uav.id && uav.showPlayer }" :class="{ active: uav && device.deviceId === uav.deviceId && uav.showPlayer }"
title="视频" title="视频"
@click="onShowPlayer(device)" @click="onShowPlayer(device)"
></div> ></div>
<div <div
v-if="device.online" v-if="device.status"
class="iconfont icon-kongzhi_xianxing" class="iconfont icon-kongzhi_xianxing"
:class="{ active: uav && device.id === uav.id && uav.showPanel }" :class="{ active: uav && device.deviceId === uav.deviceId && uav.showPanel }"
title="控制面板" title="控制面板"
@click="onShowPanel(device)" @click="onShowPanel(device)"
></div> ></div>
<div class="jieg" title="接管无人机 " v-if="device.online" @click="onTakeOver(device)"> <div class="jieg" title="接管无人机 " v-if="device.status" @click="onTakeOver(device)">
<img src="./assets/images/jieguan_active.svg" v-if="device.currentOperator" /> <img src="./assets/images/jieguan_active.svg" v-if="device.currentOperator" />
<img src="./assets/images/jieguan.svg" v-else /> <img src="./assets/images/jieguan.svg" v-else />
</div> </div>
...@@ -181,7 +192,7 @@ export default { ...@@ -181,7 +192,7 @@ export default {
*/ */
async onShowPanel(item) { async onShowPanel(item) {
// 选中与取消选中 // 选中与取消选中
if (this.uav?.hardId === item.hardId) { if (this.uav?.deviceId === item.deviceId) {
// 已打开播放器的情况下只需要展示数据面板 // 已打开播放器的情况下只需要展示数据面板
if (this.showPlayer && !this.showPanel) { if (this.showPlayer && !this.showPanel) {
this.$store.commit("MMCFlightControlCenter/uav/setState", { this.$store.commit("MMCFlightControlCenter/uav/setState", {
...@@ -215,12 +226,6 @@ export default { ...@@ -215,12 +226,6 @@ export default {
if (this.uav) { if (this.uav) {
this.$store.dispatch("MMCFlightControlCenter/uav/unsubscribe"); this.$store.dispatch("MMCFlightControlCenter/uav/unsubscribe");
} }
if (!item.streamConfiguration) {
let res = await Control_API.uavDetail({
id: item.id,
});
item.streamConfiguration = res.data.streamConfiguration;
}
this.$store.commit("MMCFlightControlCenter/uav/setState", { this.$store.commit("MMCFlightControlCenter/uav/setState", {
key: "showPanel", key: "showPanel",
value: true, value: true,
...@@ -258,7 +263,7 @@ export default { ...@@ -258,7 +263,7 @@ export default {
*/ */
async onShowPlayer(item) { async onShowPlayer(item) {
// 选中与取消选中 // 选中与取消选中
if (this.uav?.hardId === item.hardId) { if (this.uav?.deviceId === item.deviceId) {
if (this.showPlayer) { if (this.showPlayer) {
// 已显示播放器则关掉 // 已显示播放器则关掉
this.$store.commit("MMCFlightControlCenter/uav/setState", { this.$store.commit("MMCFlightControlCenter/uav/setState", {
...@@ -279,11 +284,11 @@ export default { ...@@ -279,11 +284,11 @@ export default {
} }
} else { } else {
// 在未打开播放器的情况下,有uav信息,到此步时肯定已经展开了面板,判断是否有流媒体信息, 并显示播放器 // 在未打开播放器的情况下,有uav信息,到此步时肯定已经展开了面板,判断是否有流媒体信息, 并显示播放器
if (!this.uav.streamConfiguration) { if (!this.uav.deviceStreamReqVOList) {
let res = await Control_API.uavDetail({ let res = await Control_API.uavDetail({
id: item.id, id: item.id,
}); });
item.streamConfiguration = res.data.streamConfiguration; item.deviceStreamReqVOList = res.data.deviceStreamReqVOList;
} }
this.$store.commit("MMCFlightControlCenter/uav/setState", { this.$store.commit("MMCFlightControlCenter/uav/setState", {
key: "showPlayer", key: "showPlayer",
...@@ -315,7 +320,7 @@ export default { ...@@ -315,7 +320,7 @@ export default {
let res = await Control_API.uavDetail({ let res = await Control_API.uavDetail({
id: item.id, id: item.id,
}); });
item.streamConfiguration = res.data.streamConfiguration; item.deviceStreamReqVOList = res.data.deviceStreamReqVOList;
this.$store.commit("MMCFlightControlCenter/uav/setState", { this.$store.commit("MMCFlightControlCenter/uav/setState", {
key: "showPlayer", key: "showPlayer",
value: true, value: true,
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
"updatetime": "2024-03-18 15:15:18", "updatetime": "2024-03-18 15:15:18",
"name": "肇庆无人机test", "name": "肇庆无人机test",
"sn": "3987462549735735363", "sn": "3987462549735735363",
"hardId": "3987462549735735363", "deviceId": "3987462549735735363",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
"updatetime": "2024-03-16 14:02:52", "updatetime": "2024-03-16 14:02:52",
"name": "mock-小旋风II-交通事故处置-006", "name": "mock-小旋风II-交通事故处置-006",
"sn": "mock-小旋风-deviceHardId-006", "sn": "mock-小旋风-deviceHardId-006",
"hardId": "mock-小旋风-deviceHardId-006", "deviceId": "mock-小旋风-deviceHardId-006",
"status": 1, "status": 1,
"online": 1, "online": 1,
"cateId": 39, "cateId": 39,
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
"updatetime": "2024-03-16 14:04:37", "updatetime": "2024-03-16 14:04:37",
"name": "mock-入云龙-景区安全巡查-002", "name": "mock-入云龙-景区安全巡查-002",
"sn": "mock-小旋风-deviceHardId-002", "sn": "mock-小旋风-deviceHardId-002",
"hardId": "mock-小旋风-deviceHardId-002", "deviceId": "mock-小旋风-deviceHardId-002",
"status": 1, "status": 1,
"online": 1, "online": 1,
"cateId": 39, "cateId": 39,
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
"updatetime": "2024-02-27 16:23:57", "updatetime": "2024-02-27 16:23:57",
"name": "MMC301R22205363", "name": "MMC301R22205363",
"sn": "MMC301R22205363", "sn": "MMC301R22205363",
"hardId": "MMC301R22205363", "deviceId": "MMC301R22205363",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
"updatetime": "2024-03-05 09:11:02", "updatetime": "2024-03-05 09:11:02",
"name": "盐城8189", "name": "盐城8189",
"sn": "MMC301R22208189", "sn": "MMC301R22208189",
"hardId": "MMC301R22208189", "deviceId": "MMC301R22208189",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
"updatetime": "2024-03-18 14:57:30", "updatetime": "2024-03-18 14:57:30",
"name": "盐城气体检测", "name": "盐城气体检测",
"sn": "4852153673897607219", "sn": "4852153673897607219",
"hardId": "4852153673897607219", "deviceId": "4852153673897607219",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
"updatetime": "2024-02-08 14:38:38", "updatetime": "2024-02-08 14:38:38",
"name": "盐城气体检测无人机", "name": "盐城气体检测无人机",
"sn": "MMC301R22208140", "sn": "MMC301R22208140",
"hardId": "MMC301R22208140", "deviceId": "MMC301R22208140",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
"updatetime": "2024-03-18 14:43:46", "updatetime": "2024-03-18 14:43:46",
"name": "盐城鹰巢", "name": "盐城鹰巢",
"sn": "LMMC3R2KUAV202311001", "sn": "LMMC3R2KUAV202311001",
"hardId": "LMMC3R2KUAV202311001", "deviceId": "LMMC3R2KUAV202311001",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -313,7 +313,7 @@ ...@@ -313,7 +313,7 @@
"updatetime": "2024-03-15 13:44:31", "updatetime": "2024-03-15 13:44:31",
"name": "测试鹰巢", "name": "测试鹰巢",
"sn": "MMC301X22306027", "sn": "MMC301X22306027",
"hardId": "MMC301X22306027", "deviceId": "MMC301X22306027",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -348,7 +348,7 @@ ...@@ -348,7 +348,7 @@
"updatetime": "2023-12-28 11:11:38", "updatetime": "2023-12-28 11:11:38",
"name": "鹰巢2", "name": "鹰巢2",
"sn": "MMC301X22306038", "sn": "MMC301X22306038",
"hardId": "MMC301X22306038", "deviceId": "MMC301X22306038",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -383,7 +383,7 @@ ...@@ -383,7 +383,7 @@
"updatetime": "2023-12-28 15:33:21", "updatetime": "2023-12-28 15:33:21",
"name": "鹰巢22222", "name": "鹰巢22222",
"sn": "MMC301X22306023", "sn": "MMC301X22306023",
"hardId": "MMC301X22306023", "deviceId": "MMC301X22306023",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -418,7 +418,7 @@ ...@@ -418,7 +418,7 @@
"updatetime": "2023-12-28 15:33:48", "updatetime": "2023-12-28 15:33:48",
"name": "大疆001", "name": "大疆001",
"sn": "1234561", "sn": "1234561",
"hardId": "1234561", "deviceId": "1234561",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 45, "cateId": 45,
...@@ -453,7 +453,7 @@ ...@@ -453,7 +453,7 @@
"updatetime": "2023-12-28 15:33:50", "updatetime": "2023-12-28 15:33:50",
"name": "测试设备", "name": "测试设备",
"sn": "1234567891234567891012", "sn": "1234567891234567891012",
"hardId": "1234567891012", "deviceId": "1234567891012",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -488,7 +488,7 @@ ...@@ -488,7 +488,7 @@
"updatetime": "2024-03-18 10:32:40", "updatetime": "2024-03-18 10:32:40",
"name": "mock-入云龙II-应急救援抛投-007", "name": "mock-入云龙II-应急救援抛投-007",
"sn": "mock-小旋风-deviceHardId-007", "sn": "mock-小旋风-deviceHardId-007",
"hardId": "mock-小旋风-deviceHardId-007", "deviceId": "mock-小旋风-deviceHardId-007",
"status": 1, "status": 1,
"online": 1, "online": 1,
"cateId": 39, "cateId": 39,
...@@ -523,7 +523,7 @@ ...@@ -523,7 +523,7 @@
"updatetime": "2024-03-13 18:25:04", "updatetime": "2024-03-13 18:25:04",
"name": "mock-入云龙II-洪涝灾害应急巡查-001", "name": "mock-入云龙II-洪涝灾害应急巡查-001",
"sn": "mock-小旋风-deviceHardId-001", "sn": "mock-小旋风-deviceHardId-001",
"hardId": "mock-小旋风-deviceHardId-001", "deviceId": "mock-小旋风-deviceHardId-001",
"status": 1, "status": 1,
"online": 1, "online": 1,
"cateId": 39, "cateId": 39,
...@@ -583,7 +583,7 @@ ...@@ -583,7 +583,7 @@
"updatetime": "2023-09-07 09:43:47", "updatetime": "2023-09-07 09:43:47",
"name": "乌鲁木齐市-入云龙2", "name": "乌鲁木齐市-入云龙2",
"sn": "3472927426180284439", "sn": "3472927426180284439",
"hardId": "3472927426180284439", "deviceId": "3472927426180284439",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 46, "cateId": 46,
...@@ -626,7 +626,7 @@ ...@@ -626,7 +626,7 @@
"updatetime": "2023-12-26 17:50:23", "updatetime": "2023-12-26 17:50:23",
"name": "福建科比特红", "name": "福建科比特红",
"sn": "4852153630946099246", "sn": "4852153630946099246",
"hardId": "4852153630946099246", "deviceId": "4852153630946099246",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -661,7 +661,7 @@ ...@@ -661,7 +661,7 @@
"updatetime": "2024-03-04 16:13:18", "updatetime": "2024-03-04 16:13:18",
"name": "福建无人机", "name": "福建无人机",
"sn": "6427006125642350639", "sn": "6427006125642350639",
"hardId": "6427006125642350639", "deviceId": "6427006125642350639",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -704,7 +704,7 @@ ...@@ -704,7 +704,7 @@
"updatetime": "2023-08-25 15:34:34", "updatetime": "2023-08-25 15:34:34",
"name": "山西指挥车入云龙", "name": "山西指挥车入云龙",
"sn": "3617042597074960431", "sn": "3617042597074960431",
"hardId": "3617042597074960431", "deviceId": "3617042597074960431",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 46, "cateId": 46,
...@@ -747,7 +747,7 @@ ...@@ -747,7 +747,7 @@
"updatetime": "2024-02-26 17:27:41", "updatetime": "2024-02-26 17:27:41",
"name": "神思项目测试", "name": "神思项目测试",
"sn": "3987462549734752306", "sn": "3987462549734752306",
"hardId": "3987462549734752306", "deviceId": "3987462549734752306",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -782,7 +782,7 @@ ...@@ -782,7 +782,7 @@
"updatetime": "2024-02-26 18:40:51", "updatetime": "2024-02-26 18:40:51",
"name": "神思入云龙2", "name": "神思入云龙2",
"sn": "MMC301R22208087", "sn": "MMC301R22208087",
"hardId": "MMC301R22208087", "deviceId": "MMC301R22208087",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -817,7 +817,7 @@ ...@@ -817,7 +817,7 @@
"updatetime": "2024-03-13 18:25:04", "updatetime": "2024-03-13 18:25:04",
"name": "mock-小旋风II-河长制水利常态化巡查-004", "name": "mock-小旋风II-河长制水利常态化巡查-004",
"sn": "mock-小旋风-deviceHardId-004", "sn": "mock-小旋风-deviceHardId-004",
"hardId": "mock-小旋风-deviceHardId-004", "deviceId": "mock-小旋风-deviceHardId-004",
"status": 1, "status": 1,
"online": 1, "online": 1,
"cateId": 39, "cateId": 39,
...@@ -860,7 +860,7 @@ ...@@ -860,7 +860,7 @@
"updatetime": "2024-03-18 10:59:32", "updatetime": "2024-03-18 10:59:32",
"name": "肇庆鹰巢", "name": "肇庆鹰巢",
"sn": "LMMC3X2KUAV202311051", "sn": "LMMC3X2KUAV202311051",
"hardId": "LMMC3X2KUAV202311051", "deviceId": "LMMC3X2KUAV202311051",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -895,7 +895,7 @@ ...@@ -895,7 +895,7 @@
"updatetime": "2024-03-11 15:02:59", "updatetime": "2024-03-11 15:02:59",
"name": "入云龙2", "name": "入云龙2",
"sn": "6427006134231695394", "sn": "6427006134231695394",
"hardId": "6427006134231695394", "deviceId": "6427006134231695394",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -938,7 +938,7 @@ ...@@ -938,7 +938,7 @@
"updatetime": "2023-11-24 10:47:57", "updatetime": "2023-11-24 10:47:57",
"name": "M10-1", "name": "M10-1",
"sn": "YYD700000200", "sn": "YYD700000200",
"hardId": "YYD700000200", "deviceId": "YYD700000200",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -988,7 +988,7 @@ ...@@ -988,7 +988,7 @@
"updatetime": "2024-03-13 18:25:04", "updatetime": "2024-03-13 18:25:04",
"name": "mock-小旋风II-AI车辆识别巡查-005", "name": "mock-小旋风II-AI车辆识别巡查-005",
"sn": "mock-小旋风-deviceHardId-005", "sn": "mock-小旋风-deviceHardId-005",
"hardId": "mock-小旋风-deviceHardId-005", "deviceId": "mock-小旋风-deviceHardId-005",
"status": 1, "status": 1,
"online": 1, "online": 1,
"cateId": 39, "cateId": 39,
...@@ -1023,7 +1023,7 @@ ...@@ -1023,7 +1023,7 @@
"updatetime": "2024-03-13 18:25:04", "updatetime": "2024-03-13 18:25:04",
"name": "mock-入云龙-防溺水巡查-003", "name": "mock-入云龙-防溺水巡查-003",
"sn": "mock-小旋风-deviceHardId-003", "sn": "mock-小旋风-deviceHardId-003",
"hardId": "mock-小旋风-deviceHardId-003", "deviceId": "mock-小旋风-deviceHardId-003",
"status": 1, "status": 1,
"online": 1, "online": 1,
"cateId": 39, "cateId": 39,
...@@ -1069,7 +1069,7 @@ ...@@ -1069,7 +1069,7 @@
"updatetime": "2023-12-20 14:55:44", "updatetime": "2023-12-20 14:55:44",
"name": "无人机1", "name": "无人机1",
"sn": "3987462545440571438", "sn": "3987462545440571438",
"hardId": "3987462545440571438", "deviceId": "3987462545440571438",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -1104,7 +1104,7 @@ ...@@ -1104,7 +1104,7 @@
"updatetime": "2023-12-19 11:12:41", "updatetime": "2023-12-19 11:12:41",
"name": "福建公安版", "name": "福建公安版",
"sn": "XLC100000200", "sn": "XLC100000200",
"hardId": "XLC100000200", "deviceId": "XLC100000200",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -1139,7 +1139,7 @@ ...@@ -1139,7 +1139,7 @@
"updatetime": "2023-12-19 11:12:37", "updatetime": "2023-12-19 11:12:37",
"name": "福建标准版", "name": "福建标准版",
"sn": "IPE000000200", "sn": "IPE000000200",
"hardId": "IPE000000200", "deviceId": "IPE000000200",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -1174,7 +1174,7 @@ ...@@ -1174,7 +1174,7 @@
"updatetime": "2023-12-19 11:12:47", "updatetime": "2023-12-19 11:12:47",
"name": "肇庆测试机", "name": "肇庆测试机",
"sn": "3617042524062351414", "sn": "3617042524062351414",
"hardId": "3617042524062351414", "deviceId": "3617042524062351414",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -1209,7 +1209,7 @@ ...@@ -1209,7 +1209,7 @@
"updatetime": "2024-01-31 11:33:41", "updatetime": "2024-01-31 11:33:41",
"name": "MMC9058", "name": "MMC9058",
"sn": "MMC301R22209058", "sn": "MMC301R22209058",
"hardId": "MMC301R22209058", "deviceId": "MMC301R22209058",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -1244,7 +1244,7 @@ ...@@ -1244,7 +1244,7 @@
"updatetime": "2023-12-19 11:11:30", "updatetime": "2023-12-19 11:11:30",
"name": "飞控中心无人机", "name": "飞控中心无人机",
"sn": "MMC301R22208058", "sn": "MMC301R22208058",
"hardId": "MMC301R22208058", "deviceId": "MMC301R22208058",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -1279,7 +1279,7 @@ ...@@ -1279,7 +1279,7 @@
"updatetime": "2023-12-19 11:11:03", "updatetime": "2023-12-19 11:11:03",
"name": "肇庆无人机5", "name": "肇庆无人机5",
"sn": "3987462545441423395", "sn": "3987462545441423395",
"hardId": "3987462545441423395", "deviceId": "3987462545441423395",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -1314,7 +1314,7 @@ ...@@ -1314,7 +1314,7 @@
"updatetime": "2023-12-19 11:11:22", "updatetime": "2023-12-19 11:11:22",
"name": "肇庆无人机2", "name": "肇庆无人机2",
"sn": "3617042597077385265", "sn": "3617042597077385265",
"hardId": "3617042597077385265", "deviceId": "3617042597077385265",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 39, "cateId": 39,
...@@ -1349,7 +1349,7 @@ ...@@ -1349,7 +1349,7 @@
"updatetime": "2024-03-13 16:37:30", "updatetime": "2024-03-13 16:37:30",
"name": "肇庆无人机", "name": "肇庆无人机",
"sn": "3987462549736914976", "sn": "3987462549736914976",
"hardId": "3987462549736914976", "deviceId": "3987462549736914976",
"status": 1, "status": 1,
"online": 0, "online": 0,
"cateId": 40, "cateId": 40,
......
...@@ -3,11 +3,11 @@ export default { ...@@ -3,11 +3,11 @@ export default {
computed: { computed: {
// mqtt实时数据 // mqtt实时数据
mqttDataSet() { mqttDataSet() {
return this.$store.state.MMCMQTT?.dataSet?.[this.uav?.hardId]; return this.$store.state.MMCMQTT?.dataSet?.[this.uav?.deviceId];
}, },
// 地面站实时数据 // 地面站实时数据
gsDataSet() { gsDataSet() {
return this.$store.state.MMCGroundStation?.dataSet?.[this.uav?.hardId]; return this.$store.state.MMCGroundStation?.dataSet?.[this.uav?.deviceId];
}, },
mqttUrl() { mqttUrl() {
return this.$store.getters["MMCFlightControlCenter/mqttUrl"]; return this.$store.getters["MMCFlightControlCenter/mqttUrl"];
......
...@@ -193,7 +193,7 @@ export default { ...@@ -193,7 +193,7 @@ export default {
}); });
this.$store.commit("MMCFlightControlCenter/setState", { this.$store.commit("MMCFlightControlCenter/setState", {
key: "token", key: "token",
value: this.userInfo.token, value: this.userInfo.accessToken,
}); });
this.$store.commit("MMCFlightControlCenter/setState", { this.$store.commit("MMCFlightControlCenter/setState", {
key: "userInfo", key: "userInfo",
......
...@@ -116,17 +116,17 @@ const actions = { ...@@ -116,17 +116,17 @@ const actions = {
*/ */
subscribe({ state, dispatch }) { subscribe({ state, dispatch }) {
window.$mmc.$store.dispatch("MMCMQTT/subscribe", { window.$mmc.$store.dispatch("MMCMQTT/subscribe", {
topic: "APRON/RECEIVE/" + state.hangar.hardId, topic: "APRON/RECEIVE/" + state.hangar.deviceId,
callback(ok) { callback(ok) {
ok && ok &&
console.log("mqtt订阅主题", "APRON/RECEIVE/" + state.hangar.hardId); console.log("mqtt订阅主题", "APRON/RECEIVE/" + state.hangar.deviceId);
}, },
}); });
window.$mmc.$store.dispatch("MMCMQTT/subscribe", { window.$mmc.$store.dispatch("MMCMQTT/subscribe", {
topic: "PROCESS/RECEIVE/" + state.hangar.hardId, topic: "PROCESS/RECEIVE/" + state.hangar.deviceId,
callback(ok) { callback(ok) {
ok && ok &&
console.log("mqtt订阅主题", "PROCESS/RECEIVE/" + state.hangar.hardId); console.log("mqtt订阅主题", "PROCESS/RECEIVE/" + state.hangar.deviceId);
}, },
}); });
}, },
...@@ -136,22 +136,22 @@ const actions = { ...@@ -136,22 +136,22 @@ const actions = {
*/ */
unsubscribe({ state, dispatch }) { unsubscribe({ state, dispatch }) {
window.$mmc.$store.dispatch("MMCMQTT/unsubscribe", { window.$mmc.$store.dispatch("MMCMQTT/unsubscribe", {
topic: "APRON/RECEIVE/" + state.hangar.hardId, topic: "APRON/RECEIVE/" + state.hangar.deviceId,
callback(ok) { callback(ok) {
ok && ok &&
console.log( console.log(
"mqtt取消订阅主题", "mqtt取消订阅主题",
"APRON/RECEIVE/" + state.hangar.hardId "APRON/RECEIVE/" + state.hangar.deviceId
); );
}, },
}); });
window.$mmc.$store.dispatch("MMCMQTT/unsubscribe", { window.$mmc.$store.dispatch("MMCMQTT/unsubscribe", {
topic: "PROCESS/RECEIVE/" + state.hangar.hardId, topic: "PROCESS/RECEIVE/" + state.hangar.deviceId,
callback(ok) { callback(ok) {
ok && ok &&
console.log( console.log(
"mqtt取消订阅主题", "mqtt取消订阅主题",
"PROCESS/RECEIVE/" + state.hangar.hardId "PROCESS/RECEIVE/" + state.hangar.deviceId
); );
}, },
}); });
...@@ -178,7 +178,7 @@ const actions = { ...@@ -178,7 +178,7 @@ const actions = {
*/ */
out({ state, commit, dispatch }, data) { out({ state, commit, dispatch }, data) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.hardId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 2059, cmdControlType: 2059,
}, },
...@@ -194,7 +194,7 @@ const actions = { ...@@ -194,7 +194,7 @@ const actions = {
*/ */
in({ state, commit, dispatch }, data) { in({ state, commit, dispatch }, data) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.hardId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 2073, cmdControlType: 2073,
}, },
...@@ -210,7 +210,7 @@ const actions = { ...@@ -210,7 +210,7 @@ const actions = {
*/ */
chargeStart({ state, commit, dispatch }, data) { chargeStart({ state, commit, dispatch }, data) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.hardId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 2060, cmdControlType: 2060,
}, },
...@@ -226,7 +226,7 @@ const actions = { ...@@ -226,7 +226,7 @@ const actions = {
*/ */
chargeEnd({ state, commit, dispatch }, data) { chargeEnd({ state, commit, dispatch }, data) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.hardId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 2071, cmdControlType: 2071,
}, },
...@@ -242,7 +242,7 @@ const actions = { ...@@ -242,7 +242,7 @@ const actions = {
*/ */
warmUp({ state, commit, dispatch }, data) { warmUp({ state, commit, dispatch }, data) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.hardId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 2072, cmdControlType: 2072,
}, },
...@@ -258,7 +258,7 @@ const actions = { ...@@ -258,7 +258,7 @@ const actions = {
*/ */
dormancy({ state, commit, dispatch }, data) { dormancy({ state, commit, dispatch }, data) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.hardId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 2061, cmdControlType: 2061,
}, },
...@@ -274,7 +274,7 @@ const actions = { ...@@ -274,7 +274,7 @@ const actions = {
*/ */
processExit({ state, commit, dispatch }, data) { processExit({ state, commit, dispatch }, data) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.hardId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 100001, cmdControlType: 100001,
}, },
...@@ -294,15 +294,15 @@ const actions = { ...@@ -294,15 +294,15 @@ const actions = {
// 生成架次號 // 生成架次號
const getFlightSortic = await Control_API.getFlightSortic({ const getFlightSortic = await Control_API.getFlightSortic({
taskId: state.airlineData.id, taskId: state.airlineData.id,
deviceHardId: data.uav.hardId, deviceHardId: data.uav.deviceId,
}); });
// 一键任务指令 // 一键任务指令
const waypointList = state.airlineData?.content; const waypointList = state.airlineData?.content;
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PROCESS/OBTAIN/" + state.hangar.hardId, topic: "PROCESS/OBTAIN/" + state.hangar.deviceId,
data: { data: {
cmdControlType: 100004, cmdControlType: 100004,
uavDeviceId: data.uav.hardId, uavDeviceId: data.uav.deviceId,
wayLineObj: { wayLineObj: {
taskId: state.airlineData.id, taskId: state.airlineData.id,
flightSortiesID: getFlightSortic.data, flightSortiesID: getFlightSortic.data,
......
...@@ -283,7 +283,7 @@ const actions = { ...@@ -283,7 +283,7 @@ const actions = {
}, },
// 通过mqtt更新实时采集数据 // 通过mqtt更新实时采集数据
updateByMQTT({ commit, state, dispatch }, data) { updateByMQTT({ commit, state, dispatch }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
// console.log(data,'datadata'); // console.log(data,'datadata');
// mqtt链路 // mqtt链路
const type258 = data[258]?.data || {}; const type258 = data[258]?.data || {};
...@@ -448,9 +448,9 @@ const actions = { ...@@ -448,9 +448,9 @@ const actions = {
subscribe({ state, dispatch }) { subscribe({ state, dispatch }) {
if (state.uav.network === 1) { if (state.uav.network === 1) {
window.$mmc.$store.dispatch("MMCMQTT/subscribe", { window.$mmc.$store.dispatch("MMCMQTT/subscribe", {
topic: "PX4/RECEIVE/" + state.uav.hardId, topic: "PX4/RECEIVE/" + state.uav.deviceId,
callback(ok) { callback(ok) {
ok && console.log("mqtt订阅主题", "PX4/RECEIVE/" + state.uav.hardId); ok && console.log("mqtt订阅主题", "PX4/RECEIVE/" + state.uav.deviceId);
}, },
}); });
} else { } else {
...@@ -474,7 +474,7 @@ const actions = { ...@@ -474,7 +474,7 @@ const actions = {
// 订阅取数据不一定有用, ws的订阅需要后端做了处理才生效, 未处理则会收到所有无人机的数据, 负担非常大 // 订阅取数据不一定有用, ws的订阅需要后端做了处理才生效, 未处理则会收到所有无人机的数据, 负担非常大
window.$mmc.$store.dispatch( window.$mmc.$store.dispatch(
"MMCGroundStation/subscribe", "MMCGroundStation/subscribe",
state.uav.hardId state.uav.deviceId
); );
}, },
}) })
...@@ -493,17 +493,17 @@ const actions = { ...@@ -493,17 +493,17 @@ const actions = {
unsubscribe({ state, dispatch }) { unsubscribe({ state, dispatch }) {
if (state.uav.network === 1) { if (state.uav.network === 1) {
window.$mmc.$store.dispatch("MMCMQTT/unsubscribe", { window.$mmc.$store.dispatch("MMCMQTT/unsubscribe", {
topic: "PX4/RECEIVE/" + state.uav.hardId, topic: "PX4/RECEIVE/" + state.uav.deviceId,
callback(ok) { callback(ok) {
ok && ok &&
console.log("mqtt取消订阅主题", "PX4/RECEIVE/" + state.uav.hardId); console.log("mqtt取消订阅主题", "PX4/RECEIVE/" + state.uav.deviceId);
}, },
}); });
} else { } else {
// 地面站取消订阅后需要关闭ws连接 // 地面站取消订阅后需要关闭ws连接
window.$mmc.$store.dispatch( window.$mmc.$store.dispatch(
"MMCGroundStation/unsubscribe", "MMCGroundStation/unsubscribe",
state.uav.hardId state.uav.deviceId
); );
window.$mmc.$store.dispatch("MMCGroundStation/end"); window.$mmc.$store.dispatch("MMCGroundStation/end");
} }
...@@ -531,7 +531,7 @@ const actions = { ...@@ -531,7 +531,7 @@ const actions = {
// 'modelRequest' // 'modelRequest'
// ); // );
const entity = window.$mmc.viewer.entities.add({ const entity = window.$mmc.viewer.entities.add({
id: "model_" + state.uav.hardId, id: "model_" + state.uav.deviceId,
orientation: new Cesium.CallbackProperty(() => { orientation: new Cesium.CallbackProperty(() => {
const posData = UAVDataParser(state.uavRealTimeData); const posData = UAVDataParser(state.uavRealTimeData);
return posData.orientation; return posData.orientation;
...@@ -573,7 +573,7 @@ const actions = { ...@@ -573,7 +573,7 @@ const actions = {
if (!state.airlineEntity) { if (!state.airlineEntity) {
// 创建航线 // 创建航线
const airlineEntity = window.$mmc.viewer.entities.add({ const airlineEntity = window.$mmc.viewer.entities.add({
id: "airline_" + state.uav.hardId, id: "airline_" + state.uav.deviceId,
polyline: { polyline: {
positions: new Cesium.CallbackProperty((time, result) => { positions: new Cesium.CallbackProperty((time, result) => {
return positions; return positions;
...@@ -611,17 +611,17 @@ const actions = { ...@@ -611,17 +611,17 @@ const actions = {
*/ */
async takeOff({ state }, data) { async takeOff({ state }, data) {
console.log(state.airlineData, data); console.log(state.airlineData, data);
if (state.uav.network == 1) { if (state.uav.network == 2) {
try { try {
// 生成架次號 // 生成架次號
const getFlightSortic = await Control_API.getFlightSortic({ const getFlightSortic = await Control_API.getFlightSortic({
taskId: state.airlineData.id, taskId: state.airlineData.id,
deviceHardId: state.uav.hardId, deviceHardId: state.uav.deviceId,
}); });
// 上传航线指令 // 上传航线指令
const waypointList = state.airlineData?.content; const waypointList = state.airlineData?.content;
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: window.$mmc.$store.state.MMCMQTT.orders.航线上传, type: window.$mmc.$store.state.MMCMQTT.orders.航线上传,
data: { data: {
...@@ -640,7 +640,7 @@ const actions = { ...@@ -640,7 +640,7 @@ const actions = {
// 告诉飞控开始任务,并且把架次号和 任务id传过去 // 告诉飞控开始任务,并且把架次号和 任务id传过去
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: window.$mmc.$store.state.MMCMQTT.orders.绑定任务id, type: window.$mmc.$store.state.MMCMQTT.orders.绑定任务id,
data: { data: {
...@@ -656,7 +656,7 @@ const actions = { ...@@ -656,7 +656,7 @@ const actions = {
// 起飞指令 // 起飞指令
setTimeout(() => { setTimeout(() => {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: window.$mmc.$store.state.MMCMQTT.orders.航线一键起飞, type: window.$mmc.$store.state.MMCMQTT.orders.航线一键起飞,
data: { data: {
...@@ -680,7 +680,7 @@ const actions = { ...@@ -680,7 +680,7 @@ const actions = {
data: { data: {
cmdValue: state.airlineData?.id, cmdValue: state.airlineData?.id,
}, },
deviceHardId: state.uav.hardId, deviceHardId: state.uav.deviceId,
}); });
// 起飞指令 // 起飞指令
...@@ -688,7 +688,7 @@ const actions = { ...@@ -688,7 +688,7 @@ const actions = {
window.$mmc.$store.dispatch("MMCGroundStation/order", { window.$mmc.$store.dispatch("MMCGroundStation/order", {
order: "起飞", order: "起飞",
data: {}, data: {},
deviceHardId: state.uav.hardId, deviceHardId: state.uav.deviceId,
}); });
data?.callback && data.callback(true); data?.callback && data.callback(true);
}, 3000); }, 3000);
...@@ -700,11 +700,11 @@ const actions = { ...@@ -700,11 +700,11 @@ const actions = {
*/ */
async takeEnd({ state }, data) { async takeEnd({ state }, data) {
console.log(state.airlineData, data); console.log(state.airlineData, data);
if (state.uav.network == 1) { if (state.uav.network == 2) {
try { try {
// 结束航线指令 // 结束航线指令
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: 525, type: 525,
data: null, data: null,
...@@ -726,7 +726,7 @@ const actions = { ...@@ -726,7 +726,7 @@ const actions = {
cmdFunction: 2280, cmdFunction: 2280,
taskId: state.airlineData.id, taskId: state.airlineData.id,
}, },
deviceHardId: state.uav.hardId, deviceHardId: state.uav.deviceId,
}); });
} catch (e) { } catch (e) {
console.log("任务结束失败", e); console.log("任务结束失败", e);
...@@ -738,7 +738,7 @@ const actions = { ...@@ -738,7 +738,7 @@ const actions = {
// window.$mmc.$store.dispatch("MMCGroundStation/order", { // window.$mmc.$store.dispatch("MMCGroundStation/order", {
// order: "起飞", // order: "起飞",
// data: {}, // data: {},
// deviceHardId: state.uav.hardId, // deviceHardId: state.uav.deviceId,
// }); // });
// data?.callback && data.callback(true); // data?.callback && data.callback(true);
// }, 3000); // }, 3000);
...@@ -750,9 +750,9 @@ const actions = { ...@@ -750,9 +750,9 @@ const actions = {
* @param {*} data * @param {*} data
*/ */
land({ state }, data) { land({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: window.$mmc.$store.state.MMCMQTT.orders.原地降落, type: window.$mmc.$store.state.MMCMQTT.orders.原地降落,
}, },
...@@ -765,7 +765,7 @@ const actions = { ...@@ -765,7 +765,7 @@ const actions = {
window.$mmc.$store.dispatch("MMCGroundStation/order", { window.$mmc.$store.dispatch("MMCGroundStation/order", {
order: "降落", order: "降落",
data: {}, data: {},
deviceHardId: state.uav.hardId, deviceHardId: state.uav.deviceId,
}); });
data?.callback && data.callback(true); data?.callback && data.callback(true);
} }
...@@ -776,9 +776,9 @@ const actions = { ...@@ -776,9 +776,9 @@ const actions = {
* @param {*} data * @param {*} data
*/ */
pauseFly({ state }, data) { pauseFly({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: window.$mmc.$store.state.MMCMQTT.orders.暂停航线任务, type: window.$mmc.$store.state.MMCMQTT.orders.暂停航线任务,
}, },
...@@ -791,7 +791,7 @@ const actions = { ...@@ -791,7 +791,7 @@ const actions = {
window.$mmc.$store.dispatch("MMCGroundStation/order", { window.$mmc.$store.dispatch("MMCGroundStation/order", {
order: "悬停", order: "悬停",
data: {}, data: {},
deviceHardId: state.uav.hardId, deviceHardId: state.uav.deviceId,
}); });
data?.callback && data.callback(true); data?.callback && data.callback(true);
} }
...@@ -802,9 +802,9 @@ const actions = { ...@@ -802,9 +802,9 @@ const actions = {
* @param {*} data * @param {*} data
*/ */
continueFly({ state }, data) { continueFly({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: window.$mmc.$store.state.MMCMQTT.orders.继续航线任务, type: window.$mmc.$store.state.MMCMQTT.orders.继续航线任务,
}, },
...@@ -817,7 +817,7 @@ const actions = { ...@@ -817,7 +817,7 @@ const actions = {
window.$mmc.$store.dispatch("MMCGroundStation/order", { window.$mmc.$store.dispatch("MMCGroundStation/order", {
order: "航线模式", order: "航线模式",
data: {}, data: {},
deviceHardId: state.uav.hardId, deviceHardId: state.uav.deviceId,
}); });
data?.callback && data.callback(true); data?.callback && data.callback(true);
} }
...@@ -828,9 +828,9 @@ const actions = { ...@@ -828,9 +828,9 @@ const actions = {
* @param {*} data * @param {*} data
*/ */
returnFlight({ state }, data) { returnFlight({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: window.$mmc.$store.state.MMCMQTT.orders.返航, type: window.$mmc.$store.state.MMCMQTT.orders.返航,
}, },
...@@ -843,7 +843,7 @@ const actions = { ...@@ -843,7 +843,7 @@ const actions = {
window.$mmc.$store.dispatch("MMCGroundStation/order", { window.$mmc.$store.dispatch("MMCGroundStation/order", {
order: "返航", order: "返航",
data: {}, data: {},
deviceHardId: state.uav.hardId, deviceHardId: state.uav.deviceId,
}); });
data?.callback && data.callback(true); data?.callback && data.callback(true);
} }
...@@ -854,9 +854,9 @@ const actions = { ...@@ -854,9 +854,9 @@ const actions = {
* @param {*} data * @param {*} data
*/ */
routeControl({ state }, data) { routeControl({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: window.$mmc.$store.state.MMCMQTT.orders.航线控制, type: window.$mmc.$store.state.MMCMQTT.orders.航线控制,
data: { data: {
...@@ -880,9 +880,9 @@ const actions = { ...@@ -880,9 +880,9 @@ const actions = {
* 手动模式 * 手动模式
*/ */
modeManual({ state }, data) { modeManual({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: window.$mmc.$store.state.MMCMQTT.orders.无人机模式切换, type: window.$mmc.$store.state.MMCMQTT.orders.无人机模式切换,
data: "POSITION", data: "POSITION",
...@@ -900,9 +900,9 @@ const actions = { ...@@ -900,9 +900,9 @@ const actions = {
* 自动模式 * 自动模式
*/ */
modeAuto({ state }, data) { modeAuto({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: window.$mmc.$store.state.MMCMQTT.orders.无人机模式切换, type: window.$mmc.$store.state.MMCMQTT.orders.无人机模式切换,
data: "AUTO_MISSION", data: "AUTO_MISSION",
...@@ -927,9 +927,9 @@ const actions = { ...@@ -927,9 +927,9 @@ const actions = {
}, },
"xxx" "xxx"
); );
if (state.uav.network == 1) { if (state.uav.network == 2) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: 514, type: 514,
data: data, data: data,
...@@ -944,9 +944,9 @@ const actions = { ...@@ -944,9 +944,9 @@ const actions = {
* 摇杆控制 * 摇杆控制
*/ */
modeLAND({ state }, data) { modeLAND({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: window.$mmc.$store.state.MMCMQTT.orders.无人机模式切换, type: window.$mmc.$store.state.MMCMQTT.orders.无人机模式切换,
data: "LAND", data: "LAND",
...@@ -964,9 +964,9 @@ const actions = { ...@@ -964,9 +964,9 @@ const actions = {
* @param {*} data * @param {*} data
*/ */
changeYGPermissions({ state }, data) { changeYGPermissions({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: 534, type: 534,
data: { data: {
...@@ -991,9 +991,9 @@ const actions = { ...@@ -991,9 +991,9 @@ const actions = {
* 返航模式 * 返航模式
*/ */
modeAUTO_RTL({ state }, data) { modeAUTO_RTL({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: window.$mmc.$store.state.MMCMQTT.orders.无人机模式切换, type: window.$mmc.$store.state.MMCMQTT.orders.无人机模式切换,
data: "AUTO_RTL", data: "AUTO_RTL",
...@@ -1009,9 +1009,9 @@ const actions = { ...@@ -1009,9 +1009,9 @@ const actions = {
* 航线模式 * 航线模式
*/ */
modeAUTO_MISSION({ state }, data) { modeAUTO_MISSION({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: window.$mmc.$store.state.MMCMQTT.orders.无人机模式切换, type: window.$mmc.$store.state.MMCMQTT.orders.无人机模式切换,
data: "AUTO_MISSION", data: "AUTO_MISSION",
...@@ -1028,9 +1028,9 @@ const actions = { ...@@ -1028,9 +1028,9 @@ const actions = {
* GPS/定点模式 * GPS/定点模式
*/ */
modePOSITION({ state }, data) { modePOSITION({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: window.$mmc.$store.state.MMCMQTT.orders.无人机模式切换, type: window.$mmc.$store.state.MMCMQTT.orders.无人机模式切换,
data: "POSITION", data: "POSITION",
...@@ -1054,7 +1054,7 @@ const actions = { ...@@ -1054,7 +1054,7 @@ const actions = {
* @param {number} data.dbID //历史记录id * @param {number} data.dbID //历史记录id
*/ */
videoTranscribe({ state }, data) { videoTranscribe({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
const streamData = { const streamData = {
data: { data: {
data: { data: {
...@@ -1074,7 +1074,7 @@ const actions = { ...@@ -1074,7 +1074,7 @@ const actions = {
streamData.data.data.recordControl = data.recordControl; streamData.data.data.recordControl = data.recordControl;
} }
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: streamData, data: streamData,
callback() { callback() {
data?.callback && data.callback(true); data?.callback && data.callback(true);
...@@ -1087,7 +1087,7 @@ const actions = { ...@@ -1087,7 +1087,7 @@ const actions = {
* 查询录制视频状态 * 查询录制视频状态
*/ */
videoTranscribeStatus({ state }, data) { videoTranscribeStatus({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
const streamData = { const streamData = {
data: { data: {
data: {}, data: {},
...@@ -1101,7 +1101,7 @@ const actions = { ...@@ -1101,7 +1101,7 @@ const actions = {
// streamData.data.data.recordControl = this.record; // streamData.data.data.recordControl = this.record;
// } // }
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: streamData, data: streamData,
callback() { callback() {
data?.callback && data.callback(true); data?.callback && data.callback(true);
...@@ -1120,7 +1120,7 @@ const actions = { ...@@ -1120,7 +1120,7 @@ const actions = {
* @param {number} data.dbID //历史记录id * @param {number} data.dbID //历史记录id
*/ */
takePhotos({ state }, data) { takePhotos({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
const streamData = { const streamData = {
data: { data: {
data: { data: {
...@@ -1138,7 +1138,7 @@ const actions = { ...@@ -1138,7 +1138,7 @@ const actions = {
streamData.data.messageID = 1007; streamData.data.messageID = 1007;
} }
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: streamData, data: streamData,
callback() { callback() {
data?.callback && data.callback(true); data?.callback && data.callback(true);
...@@ -1154,9 +1154,9 @@ const actions = { ...@@ -1154,9 +1154,9 @@ const actions = {
* @param {*} data.mountId 挂载的id * @param {*} data.mountId 挂载的id
*/ */
mountDirective({ state }, data) { mountDirective({ state }, data) {
if (state.uav.network == 1) { if (state.uav.network == 2) {
window.$mmc.$store.dispatch("MMCMQTT/publish", { window.$mmc.$store.dispatch("MMCMQTT/publish", {
topic: "PX4/OBTAIN/" + state.uav.hardId, topic: "PX4/OBTAIN/" + state.uav.deviceId,
data: { data: {
type: window.$mmc.$store.state.MMCMQTT.orders.云台控制指令can包透传, type: window.$mmc.$store.state.MMCMQTT.orders.云台控制指令can包透传,
data: { data: {
...@@ -1181,7 +1181,7 @@ const actions = { ...@@ -1181,7 +1181,7 @@ const actions = {
cmdBuffer: buff, cmdBuffer: buff,
cmdName: state.selectMount.gimbalName, cmdName: state.selectMount.gimbalName,
}, },
deviceHardId: state.uav.hardId, deviceHardId: state.uav.deviceId,
}); });
} }
}, },
......
...@@ -47,7 +47,8 @@ ...@@ -47,7 +47,8 @@
}, },
"rules": { "rules": {
"vue/multi-word-component-names": "off", "vue/multi-word-component-names": "off",
"no-undef": "off" "no-undef": "off",
"no-debugger": "off"
} }
}, },
"browserslist": [ "browserslist": [
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<iframe <iframe
id="iframe" id="iframe"
ref="iframe" ref="iframe"
src="https://localhost:9000/" src="http://localhost:9000/"
style="width: 1920px; height: 1000px;" style="width: 1920px; height: 1000px;"
anonymous anonymous
allowfullscreen="true" allowfullscreen="true"
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
data() { data() {
return { return {
isIframeReady: false, //是否接收到iframe里的ready事件 isIframeReady: false, //是否接收到iframe里的ready事件
baseUrl: "https://test.tmj.mmcuav.cn", baseUrl: "http://192.168.5.80:30080",
devMode: false, devMode: false,
scene1: false, // 场景类型 true: 无人机 false: 机库 scene1: false, // 场景类型 true: 无人机 false: 机库
useSTLAirway: false, // 使用标准航线库 useSTLAirway: false, // 使用标准航线库
...@@ -184,13 +184,13 @@ export default { ...@@ -184,13 +184,13 @@ export default {
immediate: true, immediate: true,
handler() { handler() {
if (this.devMode) { if (this.devMode) {
this.account = "mmctest@admin"; this.account = "admin";
this.password = "test@Admin001"; this.password = "mmc@123456";
this.baseUrl = "https://test.tmj.mmcuav.cn"; this.baseUrl = "http://192.168.5.80:30080";
} else { } else {
this.account = "mmcadmin@kbt001"; this.account = "admin";
this.password = "TMJMMC@kbta0227&adm"; this.password = "mmc@123456";
this.baseUrl = "https://tmj.mmcuav.cn"; this.baseUrl = "http://192.168.5.80:30080";
} }
this.postIframe({ this.postIframe({
type: "param", type: "param",
...@@ -635,25 +635,20 @@ export default { ...@@ -635,25 +635,20 @@ export default {
let formData = new FormData(); let formData = new FormData();
formData.append("userAccount", this.account); formData.append("userAccount", this.account);
formData.append("password", Base64.encode(this.password)); formData.append("password", Base64.encode(this.password));
let res1 = await fetch(this.baseUrl + "/crm/login", { let res = await fetch(this.baseUrl + "/admin-api/system/auth/login", {
method: "post", method: "post",
headers: { headers: {
// "Content-Type": "multipart/form-data", "Content-Type": "application/json",
}, "Tenant-Id": 1,
body: formData, "terminal": 2
}); },
let data1 = await res1.json(); body: JSON.stringify({
username: this.account,
if (data1.code == 200) { password: this.password,
await fetch(this.baseUrl + "/crm/user/platformPermission", { }),
method: "get",
headers: {
Token: data1.data.token,
},
}); });
this.userInfo = data1.data; this.userInfo = (await res.json()).data;
this.init(); this.init();
}
}, },
}, },
}; };
......
...@@ -15,7 +15,7 @@ module.exports = defineConfig({ ...@@ -15,7 +15,7 @@ module.exports = defineConfig({
], ],
}, },
devServer: { devServer: {
https: true, https: false,
client: { client: {
overlay: false, overlay: false,
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论