From 825c319d33eb525e096d34bc1c32598282207785 Mon Sep 17 00:00:00 2001 From: wxs <211789910@qq.com> Date: Fri, 6 Mar 2026 10:44:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86cesium=E4=B8=8A=E5=B7=B2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9A=84entity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/Skyeye-sys-ui/src/lang/en.js | 2 -- frontend/Skyeye-sys-ui/src/lang/index.js | 35 +++++++++++++++++++ frontend/Skyeye-sys-ui/src/lang/zh.js | 1 - .../src/layout/components/header-nav/index.js | 15 ++++++++ .../home/components/twin-situation/index.js | 8 +++-- .../components/twin-situation/uavTarget.js | 5 +-- 6 files changed, 59 insertions(+), 7 deletions(-) diff --git a/frontend/Skyeye-sys-ui/src/lang/en.js b/frontend/Skyeye-sys-ui/src/lang/en.js index 2cffd3f..ee3f91f 100644 --- a/frontend/Skyeye-sys-ui/src/lang/en.js +++ b/frontend/Skyeye-sys-ui/src/lang/en.js @@ -1,5 +1,3 @@ -import { h } from "vue"; - // English translations export default { app: { diff --git a/frontend/Skyeye-sys-ui/src/lang/index.js b/frontend/Skyeye-sys-ui/src/lang/index.js index 99aa884..2a41c39 100644 --- a/frontend/Skyeye-sys-ui/src/lang/index.js +++ b/frontend/Skyeye-sys-ui/src/lang/index.js @@ -2,6 +2,41 @@ import Vue from 'vue' import VueI18n from 'vue-i18n' import zh from './zh'; import en from './en'; + +export const gisLabels = { + planArea: { + zh_CN: '规划区域', + en_US: 'Plan Area' + }, + planAirline: { + zh_CN: '规划航线', + en_US: 'Plan Airline' + }, + startPoint: { + zh_CN: '起点', + en_US: 'Start Point' + }, + endPoint: { + zh_CN: '终点', + en_US: 'end Point' + }, + task: { + zh_CN: '任务', + en_US: 'Task' + }, + point: { + zh_CN: '点', + en_US: 'Point' + }, + line: { + zh_CN: '线', + en_US: 'Line' + }, + PowerOnPoint: { + zh_CN: '开机点', + en_US: 'Power-on point' + } +} Vue.use(VueI18n) // load locale messages diff --git a/frontend/Skyeye-sys-ui/src/lang/zh.js b/frontend/Skyeye-sys-ui/src/lang/zh.js index 476496a..3c22390 100644 --- a/frontend/Skyeye-sys-ui/src/lang/zh.js +++ b/frontend/Skyeye-sys-ui/src/lang/zh.js @@ -1,4 +1,3 @@ -// Chinese translations export default { app: { title: '空域快视系统', diff --git a/frontend/Skyeye-sys-ui/src/layout/components/header-nav/index.js b/frontend/Skyeye-sys-ui/src/layout/components/header-nav/index.js index 5ce0101..b36dde4 100644 --- a/frontend/Skyeye-sys-ui/src/layout/components/header-nav/index.js +++ b/frontend/Skyeye-sys-ui/src/layout/components/header-nav/index.js @@ -4,6 +4,7 @@ import { constantRoutes } from '@/router' import { mapMutations, mapGetters, mapActions } from 'vuex' import ChangePassword from '@/layout/components/change-password/index.vue' import { getTreeAllItems, judgeArrayRepeat } from '@/utils' +import { gisLabels } from '../../../lang' export default { name: 'Header', components: { ChangePassword }, @@ -178,6 +179,20 @@ export default { changeLocale(lang) { this.$i18n.locale = lang localStorage.setItem('locale', lang) + // 处理gis上已添加的entity + viewer.entities.values.forEach(el => { + if (el.id.includes('area')) { + let obj = el.label.text._value.split('-') + obj[1] = gisLabels.planArea[lang] + el.label.text = obj.join('-') + } + if (el.id.includes('planLine')) { + let obj = el.label.text._value.split('-') + obj[0] = gisLabels.planAirline[lang] + obj[2] = gisLabels.startPoint[lang] + el.label.text = obj.join('-') + } + }); }, goHome() { this.SET_MENUS_CHOSE('1') diff --git a/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.js b/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.js index 4c3278e..d202725 100644 --- a/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.js +++ b/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.js @@ -33,6 +33,7 @@ import PicturesUpload from '../pictures-upload/index.vue' import RightSlide from '@/components/RightSlide.vue' import LeftSlide from '@/components/LeftSlide.vue' import { debounce } from '@/utils' +import { gisLabels } from '@/lang/index' let handler = undefined let broadcastChannel = null let broadcastChannelInterval = null @@ -57,6 +58,7 @@ let radarSceneEntity = {} let sceneEntity = {} let taskListResource = [] let orthoManager = null +const lang = window.localStorage.getItem('locale') || 'zh_CN' export default { name: 'TwinSituation', props: { @@ -1164,8 +1166,9 @@ export default { allPositions = allPositions.concat(positions) let entity = viewer.entities.add({ position: positions[0], + id: `${taskId}-area`, label: { - text: `${taskName}任务-规划区域${index + 1}`, + text: `${taskName}-${gisLabels.planArea[lang]}-${index + 1}`, disableDepthTestDistance: 10000, font: '14px sans-serif', fillColor: DT.Cesium.Color.RED, @@ -1193,8 +1196,9 @@ export default { allPositions.push(position) let entity = viewer.entities.add({ position, + id: `${taskId}-area`, label: { - text: `${taskName}任务-规划区域${index + 1}`, + text: `${taskName}-${gisLabels.planArea[lang]}-${index + 1}`, disableDepthTestDistance: 10000, font: '14px sans-serif', fillColor: DT.Cesium.Color.RED, diff --git a/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/uavTarget.js b/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/uavTarget.js index b048b3d..d76b670 100644 --- a/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/uavTarget.js +++ b/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/uavTarget.js @@ -1,5 +1,6 @@ import * as DT from 'dt-sdk' import { viewer } from '@/components/dt-scene' +import { gisLabels } from '@/lang/index' export default class UavTarget { planLines = new DT.Cesium.AssociativeArray() uavEntity = null @@ -14,7 +15,7 @@ export default class UavTarget { this.uavId = options.uavId this.jobName = options.jobName this.startAltitude = options.startAltitude - + this.lang = window.localStorage.getItem('locale') || 'zh_CN' this.addPlanLine(options.airlineList) console.log(options, '飞机数据'); if (options.startLon) { @@ -336,7 +337,7 @@ export default class UavTarget { id, position: positions[0], label: { - text: `规划航线${index + 1}起点`, + text: `${gisLabels.planAirline[this.lang]}-${index + 1}-${gisLabels.startPoint[this.lang]}`, disableDepthTestDistance: 10000, font: '14px sans-serif', fillColor: DT.Cesium.Color.RED,