提交 11ceb171 作者: “kai”

WIP: FKZX 主题硬编码尝试 + 功能开发(未建立 token 体系)

主题尝试(绿/蓝方向,硬编码半成品):
- 深色背景 #222222/#3c3c3c 替换为深绿/深蓝主题色(#0b1816/#0c1f1b/#2e9bff 等)

功能开发:
- MMCMQTT store 扩展、m10Telemetry 遥测组件、resource 资源模块、menuIcons 菜单图标
- iframe 多语言(i18n) 与 xianghai-reserve 地图 geojson 数据

注:后续将在 theme-a/theme-b 上重做为变量化 token 主题体系
上级 181f3f7c
This source diff could not be displayed because it is too large. You can view the blob instead.
export default {
common: {
资源:"Resource",
是否启动瞄准镜: "Enable Targeting镜",
截屏成功: "Screenshot Successful",
拍照完成: "Photo Completed",
......
export default {
common: {
资源: "Ресурс",
是否启动瞄准镜: "Включить целивание",
截屏成功: "Скриншот успешен",
截图: "Скриншот",
......
export default {
common: {
资源: "资源",
是否启动瞄准镜: "是否启动瞄准镜",
截屏成功: "截屏成功",
AI识别: "AI识别",
......
......@@ -18,7 +18,7 @@
<span v-else class="size__text">{{item.chargeRemaining || 100}}%</span>
</div>
<div style="marin-left: 12px">
<div style="marin-left: 12px" v-if="showVoltage">
<div class="voltage-box">
<div class="voltage-value f12 ml10 jcsb">
{{ item.voltage === -1 ? '-' : Number(item.voltage).toFixed(0) }}
......@@ -33,6 +33,11 @@
<script>
export default {
props: {
// 是否展示电压(v)行;M10 无电压数据,仅展示百分比
showVoltage: {
type: Boolean,
default: true,
},
// 电池列表
batteryList: {
type: Array,
......
<template>
<div class="m10-telemetry">
<!-- 头部:设备标识 -->
<div class="m10-head">
<span class="dot" :class="{ fly: isFlying }"></span>
<span class="m10-name">{{ deviceName }}</span>
<span class="m10-tag">M10</span>
<span class="m10-code">{{ txt0(m10.uavCode) }}</span>
<span class="m10-state">{{ stateText }}</span>
<span class="m10-time">{{ txt0(m10.Time) }}</span>
</div>
<!-- 主体:姿态球 | 飞行参数 | 电量(一整块,竖线分隔) -->
<div class="m10-body">
<!-- 左:姿态 / 航向(原版 Ball 姿态球,去掉最外环油门圆环) -->
<div class="sect sect-att">
<Ball class="att-ball" :uav-data="uavData"></Ball>
<div class="att-caption">
<span>航向<b>{{ yawVal }}<i>°</i></b></span>
<span>俯仰<b>{{ num0(m10.pitch) }}<i>°</i></b></span>
<span>横滚<b>{{ num0(m10.roll) }}<i>°</i></b></span>
</div>
</div>
<div class="xian"></div>
<!-- 中:飞行参数(LED 数值 + 标签,对齐原版 Info 风格) -->
<div class="sect sect-info">
<div class="info-grid">
<div class="info-cell" v-for="(c, i) in cells" :key="i">
<div class="val" :title="c.val">
{{ c.val }}<span class="unit" v-if="c.unit">{{ c.unit }}</span>
</div>
<div class="lab">{{ c.lab }}</div>
</div>
</div>
</div>
<div class="xian"></div>
<!-- 右:电量(原版 battery 组件) -->
<div class="sect sect-batt">
<battery :battery-list="m10BatteryList" :show-voltage="false"></battery>
</div>
</div>
</div>
</template>
<script>
import Ball from "../ball/index.vue";
import battery from "../battery/index.vue";
// M10 飞行状态英文 → 中文映射
const STATE_MAP = {
OnGround: "在地面上",
Land: "降落",
SemiAuto: "半自动",
Takingoff: "正在起飞",
Rtl: "归航",
Mission: "航线",
Unknown: "未知",
};
export default {
name: "M10Telemetry",
components: { Ball, battery },
props: {
uavData: { type: Object, default: () => ({}) },
device: { type: Object, default: () => ({}) },
},
computed: {
m10() {
return (this.uavData && this.uavData.m10) || {};
},
isFlying() {
return !!(this.uavData && this.uavData.isFlying);
},
deviceName() {
return (this.device && this.device.name) || this.m10.uavCode || "M10";
},
yawVal() {
return this.num0(this.m10.yaw);
},
// 飞行状态:英文 → 中文(命中映射用中文,未命中保留原值,缺值显示 "-")
stateText() {
const s = this.m10.state;
if (!this.has(s)) return "-";
return STATE_MAP[s] !== undefined ? STATE_MAP[s] : String(s);
},
// 飞行参数表:数值类取 0,经纬度缺值取 "-"
cells() {
const m = this.m10;
const n = (v, d = 1) => this.num0(v, d);
const coord = (v) => (this.has(v) ? this.num0(v, 6) : "-");
// 排列按 3 列 × 4 行,分组:高度 / 距离·时间·速度 / 三轴速度 / 坐标
return [
{ lab: "相对高度", val: n(m.relativeAlt), unit: "m" },
{ lab: "绝对高度", val: n(m.elevation), unit: "m" },
{ lab: "气压高度", val: n(m.BaroAlt), unit: "m" },
{ lab: "飞行距离", val: n(m.flyDistance), unit: "km" },
{ lab: "飞行时间", val: n(m.flyTime, 0), unit: "s" },
{ lab: "空速", val: n(m.Airspeed), unit: "m/s" },
{ lab: "地速", val: n(m.Groundspeed), unit: "m/s" },
{ lab: "速度 X", val: n(m.SpeedX), unit: "m/s" },
{ lab: "速度 Y", val: n(m.SpeedY), unit: "m/s" },
{ lab: "速度 Z", val: n(m.SpeedZ), unit: "m/s" },
{ lab: "纬度", val: coord(m.latitude), unit: "" },
{ lab: "经度", val: coord(m.longitude), unit: "" },
];
},
// 把 M10 的 remainpower 字符串(如 "86%")构造成 battery 组件需要的数组
m10BatteryList() {
const rp = this.m10.remainpower;
let pct = 0;
if (this.has(rp)) {
const num = parseInt(rp, 10);
if (isFinite(num)) pct = num;
}
// 注意:battery 组件内部高度/文本用 `chargeRemaining || 100` 兜底满电,
// 数字 0 会被当成「未传值」从而误显 100%。故统一以字符串形式传入,
// 缺值时为 "0"(显示 0%,符合面板「缺值默认显示 0」约定),有值如 "86"。
return [
{
chargeRemaining: String(pct),
statusType: 1, // 1=开机(避免显示“已关机”)
voltage: -1, // 无电压数据,组件会显示 "-"
},
];
},
},
methods: {
// 是否有有效数据(非空字符串 / 非 null / 非 undefined;数值 0 视为有数据)
has(v) {
return v !== "" && v !== null && v !== undefined;
},
// 数值类字段:有数据按位数格式化,缺值显示 "0"
num0(v, digits = 1) {
if (!this.has(v)) return "0";
const num = Number(v);
return isFinite(num) ? num.toFixed(digits) : String(v);
},
// 文本类字段:有数据原样显示,缺值显示 "-"
txt0(v) {
return this.has(v) ? String(v) : "-";
},
},
};
</script>
<style scoped lang="scss">
.m10-telemetry {
background: rgba(22, 30, 38, 0.88);
backdrop-filter: blur(2px);
border: 1px solid rgba(112, 218, 249, 0.28);
border-radius: 6px;
padding: 7px 12px 9px;
color: #e6f6ff;
pointer-events: auto;
}
/* ---------- 头部 ---------- */
.m10-head {
display: flex;
align-items: center;
height: 20px;
margin-bottom: 5px;
}
.dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: #6b7c88;
margin-right: 7px;
flex-shrink: 0;
&.fly {
background: #36e07f;
box-shadow: 0 0 6px #36e07f;
}
}
.m10-name {
font-size: 13px;
font-weight: 600;
color: #70daf9;
letter-spacing: 1px;
margin-right: 7px;
white-space: nowrap;
}
.m10-tag {
font-size: 10px;
line-height: 14px;
color: #0c1a22;
background: #70daf9;
border-radius: 3px;
padding: 0 5px;
font-weight: 700;
flex-shrink: 0;
}
.m10-code {
font-size: 10px;
color: #8aa6b8;
font-family: "DIN", "Consolas", monospace;
margin-left: 10px;
white-space: nowrap;
}
.m10-state {
font-size: 10px;
line-height: 14px;
color: #36e07f;
border: 1px solid rgba(54, 224, 127, 0.45);
border-radius: 3px;
padding: 0 5px;
margin-left: 9px;
white-space: nowrap;
}
.m10-time {
margin-left: auto;
font-size: 10px;
color: #8aa6b8;
font-family: "DIN", "Consolas", monospace;
letter-spacing: 0.5px;
white-space: nowrap;
}
/* ---------- 主体 ---------- */
.m10-body {
display: flex;
align-items: center;
}
.sect {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-width: 0;
}
/* 姿态段:原版 Ball 姿态球(130px),已去掉最外环油门圆环,无溢出。
宽度按「航向 359.9° / 俯仰 -180.0° / 横滚 -180.0°」的最长一行预留,
避免真实数值(如 200.1° / -3.0°)撑破换行。 */
.sect-att {
width: 204px;
flex-shrink: 0;
}
.att-ball {
width: 130px;
height: 130px;
}
.att-caption {
display: flex;
justify-content: space-between;
align-items: center;
gap: 5px;
width: 100%;
padding: 0 2px;
margin-top: 3px;
font-size: 10px;
color: #8aa6b8;
span {
white-space: nowrap;
}
b {
margin-left: 2px;
font-family: "DIN", "Consolas", monospace;
font-weight: 600;
color: #e6f6ff;
i {
font-style: normal;
font-size: 9px;
color: #8aa6b8;
}
}
}
/* 竖线分隔(对齐原版 .xian 的渐变竖线) */
.xian {
width: 1px;
align-self: stretch;
margin: 2px 12px;
background: linear-gradient(
to bottom,
rgba(112, 218, 249, 0) 0%,
rgba(112, 218, 249, 0.7) 50%,
rgba(112, 218, 249, 0) 100%
);
}
/* 飞行参数:3 列 × 4 行,整体加宽让经纬度等长数值不被省略,对齐原版 Info(LED 数值在上、标签在下) */
.sect-info {
width: 358px;
flex-shrink: 0;
}
.info-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 6px 12px;
}
.info-cell {
min-width: 0;
.val {
font-family: "UniDreamLED", "DIN", "Consolas", monospace;
font-size: 15px;
line-height: 18px;
color: #00f5ff;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
.unit {
font-size: 9px;
color: #7d95a5;
margin-left: 2px;
}
}
.lab {
margin-top: 1px;
font-size: 10px;
line-height: 13px;
color: #8aa6b8;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
/* 电量段:原版 battery 组件宽 110px */
.sect-batt {
width: 118px;
flex-shrink: 0;
}
</style>
<!-- 飞控新版鹰视1027 -->
<template>
<div class="nest_controlBox">
<throttleGauge
v-if="uavData"
:uavData="uavData"
:throttleValue="uavData.accelerator || 0"
style="transform: translateX(35px);"
></throttleGauge>
<div class="nest_control">
<Info class :uav-data="uavData"></Info>
<div class="xian"></div>
<battery :batteryList="uavData.batteryList"></battery>
</div>
<obstacle :uav-data="uavData" style="transform: translateX(-35px);"></obstacle>
<div class="nest_controlBox" :class="{ 'm10-box': isM10Mode }">
<!-- M10 私有协议:仅展示遥测面板,无油门/避障等控制相关组件 -->
<m10-telemetry
v-if="isM10Mode"
:uav-data="uavData"
:device="device"
></m10-telemetry>
<template v-else>
<throttleGauge
v-if="uavData"
:uavData="uavData"
:throttleValue="uavData.accelerator || 0"
style="transform: translateX(35px);"
></throttleGauge>
<div class="nest_control">
<Info class :uav-data="uavData"></Info>
<div class="xian"></div>
<battery :batteryList="uavData.batteryList"></battery>
</div>
<obstacle :uav-data="uavData" style="transform: translateX(-35px);"></obstacle>
</template>
</div>
</template>
<script>
......@@ -20,6 +28,7 @@ import throttleGauge from "./components/throttleGauge";
import Info from "./components/info/index";
import battery from "./components/battery/index";
import obstacle from "./components/obstacle";
import m10Telemetry from "./components/m10Telemetry";
export default {
name: "MMCDataTransferPanel",
......@@ -27,6 +36,11 @@ export default {
return {};
},
props: {
// M10 设备模式(由控制面板根据 modelId===19 传入)
isM10: {
type: Boolean,
default: false,
},
// 无人机实时数据
uavData: {
type: Object,
......@@ -66,12 +80,16 @@ export default {
default: () => ({}),
},
},
components: { Info, battery, obstacle, throttleGauge },
components: { Info, battery, obstacle, throttleGauge, m10Telemetry },
mounted() {},
computed: {
props_obj() {
let { data } = this;
},
// M10 模式:显式 prop 或设备 modelId===19
isM10Mode() {
return this.isM10 || (this.device && this.device.modelId === 19);
},
},
};
</script>
......@@ -90,6 +108,12 @@ export default {
backdrop-filter: blur(1px);
padding: 0 60px 0 40px;
}
// M10 模式放开固定高度,避免遥测面板被裁切
&.m10-box {
height: auto;
min-height: 200px;
padding: 12px 0;
}
}
.xian {
width: 0.3px;
......
......@@ -4,4 +4,5 @@ export { default as Map } from './modules/map';
export { default as AI_API} from './modules/ai';
export { default as ViewLibrary } from './modules/viewLibrary';
export { default as TaskInfo } from './modules/taskInfo';
export { default as System } from './modules/system';
\ No newline at end of file
export { default as System } from './modules/system';
export { default as Resource_API } from './modules/resource';
\ No newline at end of file
import request from "../request";
export default class Resource_API {
/**
* 获取资源类型列表
*/
static getAllTypeList() {
return request({
url: "/admin-api/system/resource-type/getAllTypeList",
method: "get",
});
}
/**
* 根据资源类型获取资源信息列表
* @param {Object} params { typeId }
*/
static getResourceInfoList(params) {
return request({
url: "/admin-api/system/resource-info/getResourceInfoList",
method: "get",
params,
});
}
}
......@@ -236,6 +236,8 @@ export default {
// 关闭地图深度检测
this.viewer.scene.globe.depthTestAgainstTerrain = false;
// 加载向海保护区边界 GeoJSON(/fkzx/fk 页也要展示;同主项目 CesiumLayer 样式)
this.loadXianghaiGeoJson(this.viewer);
// 飞向指定的经纬度
window.$mmc_stl.flyTo = function (lng, lat) {
this.viewer.camera.flyTo({
......@@ -243,6 +245,105 @@ export default {
});
};
},
// 加载向海保护区精确边界 GeoJSON(数据源 ./geo/xianghai-reserve.geojson)
// 样式与主项目一致:科技蓝 #2E9BFF 描边 + 半透明填充 + 仅居中地块挂名称标注
// 注:不主动飞行镜头,fk 页相机由项目坐标(userInfo.latitude/longitude)接管,避免互相抢镜头
async loadXianghaiGeoJson(viewerRef) {
if (!viewerRef) return;
const outerStroke = Cesium.Color.fromCssColorString("#2E9BFF");
const outerFill = Cesium.Color.fromCssColorString("#2E9BFF").withAlpha(0.25);
const zoneStroke = Cesium.Color.fromCssColorString("#1E7FD6");
const zoneFill = Cesium.Color.fromCssColorString("#1E7FD6").withAlpha(0.12);
const roleOf = (e) => {
try {
return e.properties && e.properties.role
? e.properties.role.getValue()
: "zone";
} catch (err) {
return "zone";
}
};
try {
const ds = await Cesium.GeoJsonDataSource.load(
"./geo/xianghai-reserve.geojson",
{
stroke: outerStroke,
strokeWidth: 3,
fill: outerFill,
clampToGround: false,
}
);
ds.entities.values.forEach((e) => {
if (!e.polygon) return;
e.polygon.height = 0;
e.polygon.material = roleOf(e) === "outer" ? outerFill : zoneFill;
// 多边形 outlineWidth 多数平台无效,改用贴地折线加粗描边
e.polygon.outline = false;
});
viewerRef.dataSources.add(ds);
const now = Cesium.JulianDate.now();
const blocks = [];
ds.entities.values.forEach((e) => {
if (!e.polygon) return;
const hierarchy = e.polygon.hierarchy.getValue(now);
if (!hierarchy || !hierarchy.positions) return;
const center = Cesium.BoundingSphere.fromPoints(hierarchy.positions).center;
const carto = Cesium.Cartographic.fromCartesian(center);
blocks.push({
role: roleOf(e),
hierarchy,
center,
lon: carto.longitude,
lat: carto.latitude,
});
});
// 仅取地理上最居中的地块挂名称标注,其余仅描边
let midBlock = blocks[0];
if (blocks.length > 1) {
const mLon = blocks.reduce((s, b) => s + b.lon, 0) / blocks.length;
const mLat = blocks.reduce((s, b) => s + b.lat, 0) / blocks.length;
let minD = Infinity;
blocks.forEach((b) => {
const d = (b.lon - mLon) ** 2 + (b.lat - mLat) ** 2;
if (d < minD) {
minD = d;
midBlock = b;
}
});
}
blocks.forEach((b) => {
viewerRef.entities.add({
polyline: {
positions: b.hierarchy.positions,
width: b.role === "outer" ? 2.5 : 1.2,
material: b.role === "outer" ? outerStroke : zoneStroke,
clampToGround: true,
arcType: Cesium.ArcType.GEODESIC,
},
});
if (b === midBlock) {
viewerRef.entities.add({
position: b.center,
label: {
text: "向海国家级自然保护区",
font: "15px 'Microsoft YaHei', sans-serif",
fillColor: Cesium.Color.WHITE,
outlineColor: Cesium.Color.fromCssColorString("#1E5FB4"),
outlineWidth: 4,
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
pixelOffset: new Cesium.Cartesian2(0, -6),
disableDepthTestDistance: Number.POSITIVE_INFINITY,
},
});
}
});
return ds;
} catch (e) {
console.warn("[CesiumLayer][micro] 加载保护区 GeoJSON 失败:", e);
}
},
},
};
</script>
......
......@@ -264,7 +264,7 @@ export default {
.taskListBox {
height: 100%;
width: 100%;
background: #222222;
background: #071916;
border-radius: 12px;
transition: 0.3s;
display: flex;
......
......@@ -106,7 +106,7 @@ export default {
.cpt_video {
width: 100%;
height: 100%;
background: #333;
background: #111b19;
align-items: center;
position: relative;
......
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Group 14</title>
<defs>
<path d="M18.9997575,17 C18.5226673,17 18.1236104,15.2235369 18.0237898,12.5016495 L20.9252206,12.5011161 C20.6222882,15.2233048 19.4768789,17 18.9997575,17 Z M5.97596777,12.5016495 C5.87614716,15.2235369 5.47709023,17 5,17 C4.52287861,17 3.37746938,15.2233048 3.07453696,12.5011161 Z M9.67703296,15 C9.26812837,15 8.90041962,14.7510491 8.74855627,14.3713907 L8,12.5 L16,12.5 L15.2514437,14.3713907 C15.0995804,14.7510491 14.7318716,15 14.322967,15 L13,15 C13,15.5522847 12.5522847,15.5844911 12,15.5844911 C11.4477153,15.5844911 11,15.5522847 11,15 L9.67703296,15 Z M22.8189624,7.04540212 C23.81694,6.86846088 24,7.24865498 24,7.49941004 C24,7.75013566 23.8247568,8.09148039 22.8189624,7.95338852 C22.058729,7.84902497 21.0878763,7.78922048 20.6087468,7.66931719 C20.5988255,7.68161949 20.5878687,7.69324487 20.5761101,7.7041639 L20.5761101,8.42293619 L21.0436479,8.42293619 L21.0790782,9.00011773 C21.3054647,9.00217792 21.5238464,8.99614105 21.7002588,9.09364709 C21.7706099,9.13249647 21.8361173,9.17790903 21.8956118,9.22882525 C21.9548391,9.27965319 22.0079532,9.33574933 22.0538852,9.39623074 C22.1577751,9.53279218 22.2237836,9.69204518 22.2442943,9.86139314 L22.2468999,9.88379039 C22.2515767,9.92884978 22.2527458,9.97417405 22.2504075,10.0193512 L22.2483364,10.0472815 C22.2455971,10.0807449 22.2416553,10.1142967 22.2347405,10.1490257 C22.2297965,10.1747781 22.2231489,10.200766 22.2155659,10.2268421 C22.2128267,10.2364073 22.209553,10.2457076 22.2064464,10.2551257 C22.203039,10.2658387 22.2000326,10.2765222 22.205511,10.30148 C22.055188,10.6947711 21.6469108,10.9761936 21.1648751,10.9997681 C21.0984452,10.99975 21.0329975,10.9997315 20.9685319,10.9997127 L20.9970544,10.9990287 C20.998846,11.0462369 20.9997575,11.095676 20.9997575,11.1474512 C20.9997575,11.4398135 20.9894922,11.724437 20.9703607,12.0005519 L18.0090844,12.0009074 C18.0029349,11.7246813 17.9997575,11.439939 17.9997575,11.1474512 C17.9997575,11.0948962 18.0027945,11.0447483 18.0086434,10.9968972 L17.8276078,10.9972554 C17.1025137,10.9950889 17.3759609,10.9915216 17,10.9865534 C17,11.6766843 16.6666667,12.0217498 16,12.0217498 L8,12.0217498 C7.39029693,12.0217498 7.08544539,11.6810892 7.08544539,10.9997681 C6.94555516,10.9957095 6.87863661,10.9924341 6.82365457,10.9899418 L6.7594994,10.9873269 C6.72638032,10.9862074 6.68876933,10.9853698 6.63348284,10.9848142 L6.49543624,10.9840788 C6.43896076,10.983959 6.37072325,10.9839644 6.28681745,10.9840952 L5.98938656,10.9834351 C5.99636388,11.0353215 6,11.0899454 6,11.1474512 C6,11.439939 5.99682266,11.7246813 5.99067313,12.0009074 L3.02939689,12.0005519 C3.01026531,11.724437 3,11.4398135 3,11.1474512 C3,11.095676 3.00091154,11.0462369 3.00270311,10.9990287 L2.93300188,10.9996504 C2.90140065,10.9980611 2.87010006,10.9952945 2.806931,10.9865534 C2.78658729,10.9835514 2.76624358,10.9805789 2.70855296,10.9682766 C2.69094847,10.9642445 2.67331057,10.9602124 2.61655529,10.9439074 C2.58692496,10.9348131 2.55756187,10.9246887 2.52886688,10.9135637 C2.51440247,10.9080306 2.5001719,10.902056 2.48594132,10.8959637 L2.44508687,10.8775692 C2.43229272,10.8714769 2.41979921,10.8649137 2.40723889,10.8584682 L2.3654825,10.8361887 C2.35506011,10.8301847 2.34500517,10.8237687 2.3347164,10.8174409 C2.3196841,10.8082289 2.30455159,10.7992818 2.28196973,10.7836243 C2.2202705,10.7412137 2.16364884,10.6933878 2.10268452,10.6308462 C2.08795287,10.6151004 2.07372229,10.5990015 2.04840122,10.5686578 C2.03510598,10.5522056 2.02244545,10.5351943 1.9998636,10.5032319 L1.96542293,10.4493137 C1.96371927,10.4463411 1.96178177,10.4433391 1.95172684,10.4255037 C1.9429747,10.4098757 1.93475704,10.3941299 1.92694025,10.378031 L1.91037131,10.3421541 C1.90475925,10.3291749 1.8991472,10.316078 1.88765584,10.2873236 L1.87733366,10.2552434 C1.87419358,10.2458254 1.87095328,10.2364073 1.86834769,10.2268421 C1.86063111,10.2008837 1.85411711,10.1746604 1.84890591,10.148231 C1.84222489,10.1142967 1.83818287,10.0806272 1.83557728,10.0472815 L1.83337254,10.0194689 C1.8311344,9.97426234 1.83233698,9.92908523 1.83688007,9.88402584 C1.8376818,9.87631483 1.83871736,9.86863325 1.83961929,9.86103996 C1.90121831,9.35426164 2.37405509,9.00562139 3,9 L3.00946617,8.42293619 L3.46644805,8.42293619 L3.46644805,7.73715644 C3.43771966,7.71782004 3.41203113,7.69542279 3.39128656,7.66931719 C2.91212369,7.78933821 1.94127104,7.84902497 1.18103759,7.95338852 C0.175109576,8.09148039 0,7.75013566 0,7.49941004 C0,7.24865498 0.183059991,6.8685786 1.18103759,7.04540212 C1.91230881,7.1749589 2.88549982,7.22337346 3.37575318,7.3332701 C3.43721858,7.24082625 3.5498272,7.17807862 3.68030755,7.17807862 C3.81065428,7.17807862 3.92339652,7.24082625 3.98486192,7.3332701 C4.47511528,7.22337346 5.44817267,7.1749589 6.1795441,7.04540212 C7.1775217,6.86846088 7.36048148,7.24865498 7.36048148,7.49941004 C7.36048148,7.75013566 7.1853719,8.09148039 6.1795441,7.95338852 C5.41931066,7.84902497 4.44849141,7.78922048 3.96932854,7.66931719 C3.95940723,7.68173721 3.94845035,7.69324487 3.93672516,7.7041639 L3.93672516,8.42293619 L4.40426305,8.42293619 L4.39479688,8.98757997 L9.03844005,8.99203819 L11,8.5 L13,8.5 L15.0222651,8.99952762 L19.6393849,8.9872268 L19.6488511,8.42293619 L20.1058329,8.42293619 L20.1058329,7.73715644 C20.077138,7.71782004 20.0515496,7.69542279 20.0306715,7.66943491 C19.5515086,7.78933821 18.5806893,7.84902497 17.8204559,7.95338852 C16.8146281,8.09148039 16.6393849,7.75013566 16.6393849,7.49941004 C16.6393849,7.24865498 16.8224783,6.8685786 17.8204559,7.04540212 C18.5516937,7.1749589 19.5248847,7.22337346 20.0151381,7.3332701 C20.0766035,7.24082625 20.1892121,7.17807862 20.3196925,7.17807862 C20.4500726,7.17807862 20.5628148,7.24082625 20.6242468,7.3332701 C21.1145002,7.22337346 22.0875576,7.1749589 22.8189624,7.04540212 Z" id="path-1"></path>
</defs>
<g id="套用鹰视改" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="驾驶中心-无人机应用" transform="translate(-18.000000, -70.000000)">
<g id="编组-6" transform="translate(0.000000, 57.000000)">
<g id="编组-3" transform="translate(14.000000, 9.000000)">
<g id="icon/行业-公安-copy" transform="translate(4.000000, 4.000000)">
<rect id="icon" x="0" y="0" width="24" height="24"></rect>
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<use id="Mask" fill="#FFFFFF" fill-rule="nonzero" xlink:href="#path-1"></use>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750472000655" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4665" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M571.733 234.667a46.933 46.933 0 0 1 46.72 42.624l298.88 0.042-42.666 85.334-0.214 6.4A85.333 85.333 0 0 1 789.333 448v-85.376l-128 0.043c0 23.552-22.912 42.666-51.2 42.666h-153.6c-28.288 0-51.2-19.114-51.2-42.666l-128-0.043V448A85.333 85.333 0 0 1 192 362.667l-42.667-85.334 298.88-0.042 0.043-0.811a46.933 46.933 0 0 1 46.677-41.813h76.8z m-358.4-85.334c10.752 0 19.627 23.851 21.12 54.87 31.232-3.2 59.734-12.203 80.982-12.203 16.768 0 47.232 7.68 47.232 21.333s-30.464 21.334-47.232 21.334c-21.291 0-49.75-9.003-80.982-12.288-1.493 31.146-10.368 54.954-21.12 54.954s-19.626-23.85-21.12-54.869c-31.232 3.2-59.733 12.203-80.981 12.203-16.768 0-47.232-7.68-47.232-21.334S94.464 192 111.232 192c21.29 0 49.75 9.003 80.981 12.288 1.494-31.147 10.368-54.955 21.12-54.955z m640 0c10.752 0 19.627 23.851 21.12 54.87 31.232-3.2 59.734-12.203 80.982-12.203 16.768 0 47.232 7.68 47.232 21.333s-30.464 21.334-47.232 21.334c-21.291 0-49.75-9.003-80.982-12.288-1.493 31.146-10.368 54.954-21.12 54.954s-19.626-23.85-21.12-54.869c-31.232 3.2-59.733 12.203-80.981 12.203-16.768 0-47.232-7.68-47.232-21.334S734.464 192 751.232 192c21.29 0 49.75 9.003 80.981 12.288 1.494-31.147 10.368-54.955 21.12-54.955zM646.7 567.68c0-30.72-23.339-55.68-52.182-55.68H393.515c-28.843 0-52.182 24.917-52.182 55.68v187.307c0 30.72 23.339 55.68 52.182 55.68h201.002c28.843 0 52.182-24.96 52.182-55.68 0-2.006 0.853-3.84 2.346-4.992a5.461 5.461 0 0 1 5.12-0.982l44.032 14.08c11.179 3.584 22.912-3.242 26.24-15.274 0.598-2.091 0.896-4.267 0.896-6.443V580.437c0-12.544-9.472-22.698-21.12-22.698a19.755 19.755 0 0 0-6.016 0.938l-44.8 14.336a4.907 4.907 0 0 1-4.608-0.853 5.717 5.717 0 0 1-2.09-4.48zM426.667 704.939v-87.211c0-11.264 10.666-20.395 23.808-20.395 4.48 0 8.917 1.11 12.714 3.158l80.427 43.605c11.093 6.059 14.379 18.645 7.339 28.16a22.4 22.4 0 0 1-7.339 6.272l-80.427 43.648c-11.093 5.973-25.813 3.2-32.853-6.315a18.304 18.304 0 0 1-3.67-10.922z" p-id="4666" fill="#ffffff"></path></svg>
\ No newline at end of file
<template>
<!--
FKZX 左侧菜单图标的微应用内副本(违法取证/日常巡检/生物多样性)
- 显示时机:与右侧工具栏/资源按钮一致——**选中(接管)无人机后才出现**(v-show 保位置不重置)
- 位置:视频播放器右侧(默认 top:20%; left:calc(35%+730px),随 .player 尺寸走)
- 可整条鼠标拖动(transform 位移,不回弹)
- 高亮当前菜单(rootNode.menuName)
- 点击(非拖动)→ postMessage 通知主项目切换菜单(event: menuChange)
-->
<div
class="fk-menu-icons"
ref="root"
v-show="visible"
:style="dragStyle"
@mousedown="onDragStart"
>
<div
class="fmi-item"
v-for="item in menus"
:key="item.name"
:class="{ active: item.name === menuName }"
:style="{ '--mc': item.color, '--icon': `url(${item.icon})` }"
@click="onItemClick(item)"
>
<i class="fmi-icon"></i>
<span class="fmi-text">{{ item.label }}</span>
</div>
</div>
</template>
<script>
import uavIcon from "./assets/uav.svg";
import uavVideoIcon from "./assets/uavVideo.svg";
import { mapState } from "vuex";
export default {
name: "FkMenuIcons",
inject: ["rootNode"],
data() {
return {
menus: [
{
name: "违法取证",
label: this.tf("dataCenter.违法取证", "违法取证"),
color: "#E9B949",
icon: uavIcon,
},
{
name: "日常巡检",
label: this.tf("common.日常巡检", "日常巡检"),
color: "#4AA3EF",
icon: uavIcon,
},
{
name: "生物多样性",
label: this.tf("common.生物多样性", "生物多样性"),
color: "#63D18C",
icon: uavVideoIcon,
},
],
tx: 0, // 拖动位移 X
ty: 0, // 拖动位移 Y
};
},
computed: {
...mapState("MMCFlightControlCenter/uav", ["uav"]),
// 当前左侧菜单名(与主项目菜单联动)
menuName() {
return (this.rootNode && this.rootNode.menuName) || "";
},
// 与右侧工具栏(ControlPanel v-if="uav && showPanel")保持一致:
// 未选中/未接管无人机时不显示,选中设备后才浮现
visible() {
return !!this.uav;
},
dragStyle() {
return { transform: `translate(${this.tx}px, ${this.ty}px)` };
},
},
methods: {
// i18n 兜底:key 不存在时退回中文(避免 micro 端缺命名空间显示 key 本身)
tf(key, fallback) {
try {
const v = this.$t(key);
return v && v !== key ? v : fallback;
} catch (e) {
return fallback;
}
},
// 按下开始拖动:document 级 mousemove/mouseup,位移超 3px 视为拖动
onDragStart(e) {
if (e.button !== 0) return;
e.preventDefault(); // 阻止选中文字/图片原生拖拽
const state = {
startX: e.clientX,
startY: e.clientY,
startTx: this.tx,
startTy: this.ty,
moved: false,
};
this._dragState = state; // 非响应式,仅内部用
const move = (ev) => {
const dx = ev.clientX - state.startX;
const dy = ev.clientY - state.startY;
if (Math.abs(dx) > 3 || Math.abs(dy) > 3) {
state.moved = true;
}
this.tx = state.startTx + dx;
this.ty = state.startTy + dy;
};
const up = () => {
document.removeEventListener("mousemove", move);
document.removeEventListener("mouseup", up);
};
document.addEventListener("mousemove", move);
document.addEventListener("mouseup", up);
},
// 点击切换菜单:拖动结束的那次 click 不触发(moved 标记在下一次 mousedown 才复位)
onItemClick(item) {
if (this._dragState && this._dragState.moved) return;
if (item.name === this.menuName) return; // 已是当前菜单
window.parent.postMessage(
{
module: "MMCFlightControlCenter",
type: "event",
event: "menuChange",
data: { name: item.name },
},
"*"
);
},
},
};
</script>
<style lang="scss" scoped>
.fk-menu-icons {
position: absolute;
// 视频播放器(.player)为 left:35% + 宽718px,图标条默认贴其右侧(+12px 间隙),同 top 起点
top: 20%;
left: calc(35% + 730px);
z-index: 20;
display: flex;
flex-direction: column;
gap: 6px;
cursor: move;
user-select: none;
.fmi-item {
width: 48px;
padding: 6px 0 4px;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
gap: 3px;
border: 1px solid transparent;
border-radius: 6px;
background: rgba(8, 34, 30, 0.6);
transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
// 图标 mask 染色(与主项目左侧菜单同款做法)
.fmi-icon {
display: block;
width: 24px;
height: 24px;
background-color: var(--mc);
-webkit-mask-image: var(--icon);
mask-image: var(--icon);
-webkit-mask-size: contain;
mask-size: contain;
-webkit-mask-position: center;
mask-position: center;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
}
.fmi-text {
font-size: 10px;
line-height: 14px;
color: var(--mc);
white-space: nowrap;
}
&:hover {
border-color: var(--mc);
}
&.active {
background: rgba(8, 34, 30, 0.92);
border-color: var(--mc);
box-shadow: inset 0 0 12px -4px var(--mc), 0 0 10px -5px var(--mc);
}
}
}
</style>
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 27</title>
<g id="默认页" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="默认页-侧弹" transform="translate(-1498.000000, -134.000000)" fill="#4E4E4E" stroke="#4E4E4E">
<g id="编组-4" transform="translate(1276.000000, 80.000000)">
<g id="编组-13备份-2" transform="translate(216.000000, 48.000000)">
<g id="编组-27" transform="translate(6.000000, 6.000000)">
<rect id="矩形" stroke-width="1.2" opacity="0" x="0.6" y="0.6" width="22.8" height="22.8"></rect>
<g id="编组-11" transform="translate(2.400000, 0.645684)" stroke-width="1.6">
<g id="编组-10">
<rect id="矩形" x="0.8" y="2.55431626" width="6.87058824" height="6.87058824" rx="1"></rect>
<rect id="矩形" transform="translate(14.964706, 5.989610) scale(-1, 1) rotate(-45.000000) translate(-14.964706, -5.989610) " x="11.5294118" y="2.55431626" width="6.87058824" height="6.87058824" rx="1"></rect>
</g>
<g id="编组-10" transform="translate(9.600000, 16.719022) scale(1, -1) translate(-9.600000, -16.719022) translate(0.000000, 12.483728)">
<rect id="矩形" x="0.8" y="0.8" width="6.87058824" height="6.87058824" rx="1"></rect>
<rect id="矩形" transform="translate(14.964706, 4.235294) scale(-1, 1) translate(-14.964706, -4.235294) " x="11.5294118" y="0.8" width="6.87058824" height="6.87058824" rx="1"></rect>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>合作网点</title>
<g id="默认页" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g transform="translate(-1726.000000, -140.000000)" fill="#4E4E4E" fill-rule="nonzero" id="编组-4">
<g transform="translate(1656.000000, 80.000000)">
<g id="编组-25" transform="translate(52.000000, 48.000000)">
<g id="编组-18" transform="translate(12.000000, 6.000000)">
<g id="合作网点" transform="translate(6.000000, 6.000000)">
<rect id="矩形" opacity="0" x="0" y="0" width="24" height="24"></rect>
<path d="M4.8087864,11.5184774 C5.41485596,11.5184774 5.8984221,11.8560711 6.16492077,12.4562378 C6.65063609,12.2749375 7.1256055,12.310364 7.53180105,12.5625174 C8.0024721,12.856349 8.24532976,13.3981662 8.25392649,14.1733815 L8.25392649,14.2213115 C8.42156275,14.2546541 8.60209411,14.3171714 8.78692383,14.4171992 C9.33281628,14.7151987 9.62295596,15.2382606 9.60791168,15.8967769 C9.91524482,15.9676299 10.2397714,16.1176716 10.5363587,16.3906641 C10.9726428,16.7886913 11.0844003,17.4326202 10.8716312,18.2995276 C10.869482,18.3099472 10.8673328,18.3182829 10.8651836,18.3287024 C10.7319343,18.8642679 10.517016,19.3185607 10.5084193,19.3373159 C10.469734,19.4165046 10.4181536,19.4852737 10.3558273,19.5415393 C10.2763075,19.5915532 10.1967878,19.6394832 10.117268,19.6832453 C9.8056365,19.8645457 9.48325907,20 9.16088165,20 C8.39147419,20 7.78110626,19.6978327 7.34697133,19.0997499 C6.86770356,19.0518199 6.47655228,18.9121978 6.15632404,18.6725479 C5.86618435,18.4558211 5.66631035,18.1828286 5.51156919,17.9285913 C4.47566306,17.8577383 4.15543481,17.484718 3.82231147,16.9720756 C3.7556868,16.8699639 3.68691295,16.7636844 3.59879646,16.653237 L3.5439525,16.6236763 L3.40751918,16.5552931 C3.16895989,16.4385941 2.8422841,16.2802167 2.56289033,16.0176438 C2.1910817,15.6675465 2.00195361,15.2340928 2.00195361,14.7256182 L2.00195361,14.5297305 C2.00195361,14.2358989 2.08577174,13.948319 2.19967843,13.685746 C2.27275065,13.5148652 2.35871796,13.3564879 2.44253609,13.2106141 L2.42749181,13.1939428 C2.67034947,12.9021951 3.00562199,12.5312587 3.37743063,12.214504 C3.8309082,11.8268964 4.34026454,11.5184774 4.8087864,11.5184774 Z M6.14557812,5 C6.44216536,5 6.73015586,5.05834954 7.00095289,5.17504862 C7.20942363,5.26465685 7.36846316,5.33550986 7.51030923,5.39594332 C7.89501295,5.56682412 8.08843941,5.65226452 8.65797286,5.83148097 C8.8041173,5.87732704 8.93951582,5.91483745 9.0663176,5.94401223 C8.94596336,6.0252848 8.80841566,6.1107252 8.67731551,6.16907474 C8.55696127,6.22325646 8.40866765,6.27118644 8.25177731,6.32328425 C7.95519007,6.42122812 7.59412736,6.54001111 7.27174993,6.75673798 C7.02674309,6.92136705 6.80107889,7.14226174 6.64203936,7.45276466 C6.47225391,7.77993887 6.40348006,8.18630175 6.44646372,8.59683245 C6.49374574,9.04487358 6.66782955,9.46790775 6.95367087,9.82217283 C7.22661709,10.1618505 7.73812261,10.601556 8.63003349,10.7807724 C9.30272772,10.9162267 10.0807319,10.884968 11.0091789,10.6849125 C12.6318119,10.3348152 13.3174013,10.4494304 13.4850375,10.4911086 L18.7204469,14.4359544 C18.815011,14.5068074 18.9160226,14.565157 19.0213325,14.6089191 C19.1954163,14.6818561 19.3802461,14.7172826 19.5650758,14.7172826 C19.8788565,14.7172826 20.1926372,14.613087 20.4440916,14.4088636 C20.4161522,15.1278133 20.0421944,15.7821617 19.332964,16.3573215 C18.7698781,16.8157822 18.0821396,17.1617116 17.4760701,17.4680467 C17.1945271,17.6097527 16.9280284,17.745207 16.7195577,17.8681578 C16.1865604,18.1869964 13.1863011,19.7916088 11.7699896,19.7916088 L11.5679664,19.7916088 C11.3960318,19.7916088 11.2369923,19.7749375 11.0908478,19.7520144 C11.2262464,19.4248402 11.4368663,18.8892748 11.5357287,18.4974993 C11.5400271,18.4849958 11.5421762,18.4704084 11.5443254,18.457905 C11.6388895,18.0723812 11.6775748,17.7139483 11.6625305,17.3951098 C11.6582321,17.2846624 11.645337,17.1825507 11.6281435,17.0846068 C11.5851599,16.8282856 11.5056401,16.6136427 11.4110761,16.4344262 C11.2907218,16.2072798 11.1445774,16.0384829 11.0134773,15.9155321 C10.7856639,15.7071409 10.5342095,15.5404279 10.2612633,15.419561 C10.1430582,14.7402056 9.74760856,14.1817171 9.12649472,13.8441234 C9.05772087,13.8066129 8.98679784,13.7711864 8.91802399,13.7420117 C8.79981893,12.7667408 8.31840197,12.2645179 7.90790805,12.0081967 C7.48236985,11.7435399 7.00095289,11.6414282 6.50879002,11.6976938 C6.45291127,11.6247569 6.39273415,11.5559878 6.33040785,11.4893026 C5.93280902,11.0829397 5.39336413,10.8578772 4.81523395,10.8578772 C4.13609217,10.8578772 3.45909957,11.1121145 2.84873165,11.5955821 C2.83583655,11.6060017 2.82079227,11.6185051 2.80789717,11.6289247 C2.52635422,11.858155 2.09866684,12.2832731 1.86010754,12.5291748 L1.53558093,12.1499028 C0.834947325,11.385107 0.819903045,10.2285357 1.50119401,9.44706863 L4.51864671,5.73353709 L4.52724344,5.72311753 C4.933439,5.26465685 5.5223151,5 6.14557812,5 Z M13.1476158,5.12503473 C13.901979,5.12503473 14.6241044,5.64601278 15.3204397,6.15240345 C15.5933859,6.3503751 15.8921223,6.56501806 16.1263832,6.69422062 L16.6701265,6.31703251 L16.6894691,6.30452904 C17.0182941,6.10864129 17.3944011,6.00444568 17.7769557,6.00444568 C18.4303072,6.00444568 19.0600178,6.2982773 19.5006003,6.8109197 C19.7692481,7.12350653 20.2205765,7.5277855 20.695546,7.95707141 C21.518683,8.69894415 22.3697594,9.46582384 22.7523139,10.149347 C23.1907472,10.9308141 23.0360061,11.9102528 22.3762069,12.5291748 C22.0409344,12.8438455 21.5272797,13.3002223 21.0415644,13.6815782 C20.3860636,14.1921367 19.4597658,14.1983884 18.8042651,13.6982495 L13.8332051,9.89510975 C13.8289068,9.89302584 13.8267576,9.89094193 13.8246084,9.8867741 C13.7450886,9.84717977 13.0380075,9.54918033 10.8587361,10.0180606 C10.0398974,10.1951931 9.33711464,10.2264518 8.76758119,10.1118366 C8.08199186,9.97429842 7.69728813,9.6471242 7.49526495,9.39705474 C7.05683165,8.85315365 7.04393655,8.15087524 7.25670565,7.73826063 C7.44368456,7.37774382 7.78325545,7.19227563 8.13572143,7.05890525 C8.24747894,7.01722701 8.36138563,6.97971659 8.47314314,6.94220617 C8.63863022,6.88802445 8.81056484,6.83175882 8.96315683,6.76507363 C9.24899814,6.63795499 9.7304151,6.21700472 10.0248531,5.94609614 C10.1817435,5.89608225 10.3300371,5.81897749 10.5127177,5.72103362 L10.5256128,5.71478188 C11.0199248,5.45220895 11.6367403,5.12503473 12.7865531,5.12503473 L13.1476158,5.12503473 Z" id="形状结合"></path>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
......@@ -325,7 +325,7 @@ export default {
.taskListBox {
min-height: 200px;
width: 350px;
background: #222222;
background: #0b1816;
border-radius: 12px;
transition: 0.3s;
display: flex;
......@@ -336,7 +336,7 @@ export default {
display: flex;
justify-content: space-between;
height: 32px;
background: #3c3c3c;
background: #0b1816;
border-radius: 12px 12px 0px 0px;
.title {
display: flex;
......
......@@ -235,7 +235,7 @@ export default {
.taskListBox {
min-height: 254px;
width:350px;
background: #222222;
background: #0b1816;
border-radius: 12px;
transition: 0.3s;
display: flex;
......@@ -246,7 +246,7 @@ export default {
display: flex;
justify-content: space-between;
height: 32px;
background: #3c3c3c;
background: #0b1816;
border-radius: 12px 12px 0px 0px;
.title {
display: flex;
......
......@@ -554,7 +554,7 @@ export default {
top: 190px;
width: 423px;
height: 318px;
background: #222222;
background: #0f1d1a;
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
border-radius: 10px;
display: flex;
......
......@@ -25,6 +25,7 @@
<img :class="{ active: showViewLib }" src="./assets/images/files.svg" />
<span class="">{{ $t('common.视图库') }}</span>
</div>
<Resource v-if="showResourceButton"></Resource>
<ViewLib v-if="showViewLib"></ViewLib>
</div>
<ControlList @clearId="$emit('clearId')" @closeIconShow="iconShow = false" @exit="showControlList = false"
......@@ -49,6 +50,7 @@ import Mount from "./components/mount";
import MMCGimbalP1 from "./components/PagerP1";
import ViewLib from "./components/viewLib";
import AlarmLamp from "./components/alarmLamp";
import Resource from "../../../../../resource";
export default {
name: "ControlRight",
......@@ -60,6 +62,7 @@ export default {
MMCGimbalP1,
ViewLib,
AlarmLamp,
Resource,
},
props: {
// 是否机库页面使用
......@@ -78,9 +81,15 @@ export default {
showViewLib: false, //展开视图库面板
};
},
inject: ["rootNode"],
computed: {
...mapState("MMCFlightControlCenter", ["showAirwayEdit"]),
...mapState("MMCFlightControlCenter/uav", ["uav", "airlineData", 'uavRealTimeData']),
// 资源按钮在「日常巡检」显示(资源点位在此场景加载);用户允许在其它 name 也展示,故「违法取证」一并放行
showResourceButton() {
const menu = this.rootNode && this.rootNode.menuName;
return menu === "日常巡检" || menu === "违法取证"|| menu === "生物多样性";
},
},
watch: {
// 打开航线编辑时关闭所有窗口
......
......@@ -471,7 +471,7 @@ export default {
left: 50%;
transform: translate(-50%, 0);
height: 58px;
background: #222222;
background: #111b19 !important;
border-radius: 0px 0px 2px 2px;
backdrop-filter: blur(1px);
display: flex;
......
<template>
<div>
<MMCDataTransferPanel class="data-panel" :device="uav" :uav-data="uavRealTimeData"></MMCDataTransferPanel>
<!-- 一键任务 返航 安全降落 手动 -->
<ControlBottom></ControlBottom>
<!-- 健康管理-挂载-警灯-无人机 -->
<ControlRight></ControlRight>
<!-- 任务 智能识别 -->
<ControlLeft></ControlLeft>
<!-- 顶部信息 -->
<ControlTop></ControlTop>
<MMCDataTransferPanel class="data-panel" :class="{ 'm10-panel': isM10 }" :device="uav" :uav-data="uavRealTimeData" :is-m10="isM10"></MMCDataTransferPanel>
<!-- M10 无控制功能:仅展示视频窗口与底部遥测面板 -->
<template v-if="!isM10">
<!-- 一键任务 返航 安全降落 手动 -->
<ControlBottom></ControlBottom>
<!-- 健康管理-挂载-警灯-无人机 -->
<ControlRight></ControlRight>
<!-- 任务 智能识别 -->
<ControlLeft></ControlLeft>
<!-- 顶部信息 -->
<ControlTop></ControlTop>
</template>
</div>
</template>
......@@ -43,6 +46,10 @@ export default {
},
computed: {
...mapState("MMCFlightControlCenter/uav", ["uavRealTimeData", "uav"]),
// M10 设备:modelId === 19,无控制功能
isM10() {
return !!(this.uav && this.uav.modelId === 19);
},
},
};
</script>
......@@ -54,5 +61,9 @@ export default {
left: 50%;
transform: translate(-50%, 0);
// z-index: 100;
// M10 模式:遥测面板整体右移 4%(left 由 50% → 54%,transform 仍居中)
&.m10-panel {
left: 54%;
}
}
</style>
\ No newline at end of file
......@@ -1101,7 +1101,7 @@ export default {
opacity: 0.3;
}
.cpt_video {
border: 1px solid #fff;
border: 1px solid #debc51;
width: 100%;
height: 100%;
background: #333;
......@@ -1202,8 +1202,8 @@ export default {
bottom: 0;
width: 100%;
height: 46px;
background: #000000;
opacity: 0.7;
background: #0f1d1a;
// opacity: 0.7;
display: flex;
align-items: center;
justify-content: space-between;
......
......@@ -96,6 +96,12 @@
<!-- <img src="./assets/images/I.svg" />
<img src="./assets/images/I.svg" />-->
{{ device.modelName }}
<span
v-if="device.remark"
class="device-remark"
:title="device.remark"
>{{ device.remark }}</span
>
</div>
</template>
</div>
......@@ -771,6 +777,33 @@ export default {
font-size: 8px;
}
.uav_versioncp {
display: flex;
align-items: center;
color: #fff;
font-size: 12px;
// remark 以「标签」形态展示:胶囊外框 + 半透青色底 + 青色文字
.device-remark {
margin-left: 6px;
display: inline-block;
box-sizing: border-box;
max-width: 96px;
padding: 0 6px;
height: 16px;
line-height: 15px;
border: 1px solid rgba(233, 185, 73, 0.55);
border-radius: 8px;
background: rgba(233, 185, 73, 0.18);
color: #ffd76b;
font-size: 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;
}
}
.symbol-icon-box {
display: flex;
align-items: center;
......
......@@ -970,7 +970,7 @@
]
},
{
"name": "江西天目将试用",
"name": "加载中",
"online": 0,
"offline": 0,
"childs": [],
......
......@@ -445,7 +445,7 @@ export default {
// height: 86vh;
z-index: 99;
transition: 0.3s;
background: #222222;
background: #0c1f1b;
// border: 1px solid #70daf9;
.uav-list_btn {
position: absolute;
......
......@@ -18,6 +18,17 @@ export default {
},
watch: {
mqttDataSet(newVal) {
if (!newVal) return;
// M10 私有协议:走独立解析分支
if (this.uav?.modelId === 19) {
if (newVal.M10) {
this.$store.dispatch(
"MMCFlightControlCenter/uav/updateByMQTTM10",
newVal.M10
);
}
return;
}
if (this.uav?.network === 2) {
if (newVal) {
this.$store.dispatch(
......
......@@ -5,6 +5,8 @@
<!-- 地图切换组件 -->
<MapImageSwitch></MapImageSwitch>
<MapSearch class="map-search"></MapSearch>
<!-- FKZX 菜单图标副本(可拖动,位于 control-right 左侧,点击切换菜单) -->
<MenuIcons></MenuIcons>
<!-- 无人机应用 -->
<UavApplications v-if="scene == 1"></UavApplications>
<!-- 机库 -->
......@@ -21,6 +23,7 @@ import Hangar from "./components/hangar";
import Vue from "vue";
import SymbolIcon from "../symbol-icon";
import MapSearch from "./components/mapSearch";
import MenuIcons from "./components/menuIcons";
import { Control_API } from "./api/index";
export default {
......@@ -31,6 +34,7 @@ export default {
UavApplications,
Hangar,
MapSearch,
MenuIcons,
},
props: {
url: {
......
......@@ -529,12 +529,88 @@ const actions = {
}
}
},
// M10 私有协议:解析 UDP/TRANSFER 推送的扁平 JSON(无 type 字段)
updateByMQTTM10({ commit, state }, d) {
if (!d) return;
const prev = state.uavRealTimeData || {};
const num = (v, def = 0) => {
const n = Number(v);
return isFinite(n) ? n : def;
};
// remainpower: "0%" -> 0(数值)
let remainpower = 0;
if (typeof d.remainpower === "string") {
remainpower = parseFloat(d.remainpower.replace("%", "")) || 0;
} else {
remainpower = num(d.remainpower);
}
commit("setState", {
key: "uavRealTimeData",
value: {
...prev,
isFlying: !!d.state && d.state !== "OnGround",
attitude: {
roll: num(d.roll),
pitch: num(d.pitch),
yaw: num(d.yaw),
},
locationCoordinate3D: {
altitude: num(d.relativeAlt),
latitude: num(d.latitude),
longitude: num(d.longitude),
},
gps: {
...(prev.gps || {}),
absoluteAlt: num(d.elevation), // 绝对高度
relativeAlt: num(d.relativeAlt),
},
flyDistance: num(d.flyDistance) / 1000, // M10 飞行距离接口给的是 m,换算成 km 展示
flyTime: num(d.flyTime),
groundSpeed: num(d.Airspeed),
velocityX: num(d.SpeedX),
velocityY: num(d.SpeedY),
velocityZ: num(d.SpeedZ),
chargeRemaining: remainpower,
// M10 原始字段,供 nest_controlBox 重新设计的面板展示
m10: {
uavCode: d.uavCode,
state: d.state,
flyTime: d.flyTime,
flyDistance: num(d.flyDistance), // 接口给的是 km,直接展示 km
remainpower: d.remainpower,
latitude: d.latitude,
longitude: d.longitude,
elevation: d.elevation,
relativeAlt: d.relativeAlt,
pitch: d.pitch,
roll: d.roll,
yaw: d.yaw,
SpeedX: d.SpeedX,
SpeedY: d.SpeedY,
SpeedZ: d.SpeedZ,
Airspeed: d.Airspeed,
Time: d.Time,
},
},
});
},
/**
* 订阅无人机数据
* @param {*} param0
* @param {object} data
*/
subscribe({ state, dispatch }) {
// M10 私有协议:订阅 UDP/TRANSFER/{deviceId}(与 PX4 同样用 deviceId 作 dataSet 键)
if (state.uav && state.uav.modelId === 19) {
const topic = `UDP/TRANSFER/${state.uav.deviceId}`;
window.$mmc_stl.$store.dispatch("MMCMQTT/subscribe", {
topic,
callback(ok) {
ok && console.log("mqtt订阅主题(M10)", topic);
},
});
return;
}
if (state.uav.network === 2) {
window.$mmc_stl.$store.dispatch("MMCMQTT/subscribe", {
topic: "PX4/RECEIVE/" + state.uav.deviceId,
......@@ -581,6 +657,18 @@ const actions = {
* @param {} param0
*/
unsubscribe({ state, dispatch }) {
// M10 私有协议:取消订阅 UDP/TRANSFER/{deviceId}
if (state.uav && state.uav.modelId === 19) {
const topic = `UDP/TRANSFER/${state.uav.deviceId}`;
window.$mmc_stl.$store.dispatch("MMCMQTT/unsubscribe", {
topic,
callback(ok) {
ok && console.log("mqtt取消订阅主题(M10)", topic);
},
});
dispatch("destroy");
return;
}
if (state.uav.network === 2) {
window.$mmc_stl.$store.dispatch("MMCMQTT/unsubscribe", {
topic: "PX4/RECEIVE/" + state.uav.deviceId,
......
......@@ -723,7 +723,7 @@ export default {
left: 60px;
top: 82px;
min-height: 254px;
background: rgba(9, 32, 87, 0.7);
background: #0d224f;
border-radius: 10px 10px 0 0;
// border: 1px solid #70daf9;
transition: 0.3s;
......
......@@ -607,7 +607,7 @@ export default {
<style lang="scss" scoped>
.cpt_video {
cursor: default !important;
border: 1px solid #fff;
border: 1px solid #debc51;
width: 730px;
height: 450px;
background: #333;
......
......@@ -513,7 +513,7 @@ export default {
left: 80px;
top: 85px;
min-height: 254px;
background: rgba(9, 32, 87, 0.7);
background: #0b1816;
// border: 1px solid #70daf9;
border-radius: 10px ;
transition: 0.3s;
......
......@@ -76,6 +76,23 @@ export default {
let data = uint8array2json(payload);
let deviceHardId = packet.topic.split("/")[2];
// M10 私有协议:UDP/TRANSFER/{deviceId} 推送扁平 JSON(无 type 字段)
if (topic.indexOf("UDP/TRANSFER/") === 0) {
if (!state.dataSet[deviceHardId]) {
state.dataSet[deviceHardId] = {};
}
// 用新对象包裹,确保 linkFusion 的 mqttDataSet watcher 能触发
const now = Date.now();
state.dataSet[deviceHardId] = {
...state.dataSet[deviceHardId],
M10: data,
$time: now,
$timeStr: dayjs(now).format('YYYY-MM-DD hh:mm:ss'),
};
commit("setDataSet", state.dataSet);
return;
}
if (!state.dataSet[deviceHardId]) {
state.dataSet[deviceHardId] = {};
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论