coding
This commit is contained in:
parent
1903cb0124
commit
840f27a93b
|
@ -167,7 +167,7 @@ export default class MyCesium {
|
|||
*/
|
||||
setClientByCenter(position) {
|
||||
this.viewer.camera.flyTo({
|
||||
destination: Cesium.Cartesian3.fromDegrees(position.longitude, position.latitude, 500000), // 目标点坐标
|
||||
destination: Cesium.Cartesian3.fromDegrees(position.longitude, position.latitude, 100000), // 目标点坐标
|
||||
orientation: {
|
||||
heading: 0, // 航向角(弧度),0表示正北
|
||||
pitch: Cesium.Math.toRadians(-90), // 俯仰角(弧度),-90度表示垂直向下看
|
||||
|
@ -210,7 +210,7 @@ export default class MyCesium {
|
|||
image: base64,
|
||||
width: 50,
|
||||
height: 50,
|
||||
scaleByDistance: new Cesium.NearFarScalar(1000000.0, 1.0, 10000000.0, 0.2), // 重点:设置随距离缩放
|
||||
scaleByDistance: new Cesium.NearFarScalar(1000.0, 0.8, 10000000.0, 0.2), // 重点:设置随距离缩放
|
||||
},
|
||||
properties: {
|
||||
type: MyCesium.ENTITY_TYPES.IMAGE,
|
||||
|
@ -258,7 +258,7 @@ export default class MyCesium {
|
|||
image: base64,
|
||||
width: 50,
|
||||
height: 50,
|
||||
scaleByDistance: new Cesium.NearFarScalar(1000000.0, 1.0, 10000000.0, 0.2), // 重点:设置随距离缩放
|
||||
scaleByDistance: new Cesium.NearFarScalar(1000.0, 0.8, 10000000.0, 0.2), // 重点:设置随距离缩放
|
||||
},
|
||||
properties: {
|
||||
type: MyCesium.ENTITY_TYPES.IMAGE,
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<script>
|
||||
export default {
|
||||
props: {
|
||||
value: { type: Number, required: true },
|
||||
value: { validator: () => true, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<script>
|
||||
export default {
|
||||
props: {
|
||||
value: { type: Number, required: true },
|
||||
value: { validator: () => true, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -133,13 +133,13 @@
|
|||
<span class="label">结束时间</span>
|
||||
<div class="content-wrapper flex-1">{{ detail.data.scenario.endTime }}</div>
|
||||
</Flex>
|
||||
<Flex class="detail-module-item">
|
||||
<!-- <Flex class="detail-module-item">
|
||||
<span class="label">想定地点</span>
|
||||
<div class="content-wrapper flex-1">{{ detail.data.scenario.location }}</div>
|
||||
</Flex>
|
||||
</Flex> -->
|
||||
<Flex class="detail-module-item">
|
||||
<span class="label">想定描述</span>
|
||||
<div class="content-wrapper flex-1" style="height: 96px">{{ detail.data.scenario.desc }}</div>
|
||||
<div class="content-wrapper flex-1" style="height: 96px">{{ detail.data.scenario.mark }}</div>
|
||||
</Flex>
|
||||
<Flex fd="co" class="detail-module-item flex-1">
|
||||
<span class="label">消息日志</span>
|
||||
|
|
|
@ -39,6 +39,7 @@ export default {
|
|||
scenarioId: '',
|
||||
scenarioName: '',
|
||||
cesium: null,
|
||||
scenarioDetail: null,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -49,6 +50,7 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
this.cesium = new window.MyCesium('display-cesium-container')
|
||||
this.getScenarioDetail()
|
||||
this.initWebsocket()
|
||||
window.addEventListener('beforeunload', (e) => {
|
||||
this.closeWebsocket()
|
||||
|
@ -56,6 +58,29 @@ export default {
|
|||
})
|
||||
},
|
||||
methods: {
|
||||
async getScenarioDetail() {
|
||||
try {
|
||||
const res = await getAction(`/baseData/scenario/${this.scenarioId}`)
|
||||
const {
|
||||
leftUpLng,
|
||||
leftUpLat,
|
||||
rightUpLng,
|
||||
rightUpLat,
|
||||
rightBottomLng,
|
||||
rightBottomLat,
|
||||
leftBottomLng,
|
||||
leftBottomLat,
|
||||
} = res.data
|
||||
this.cesium.setClientByAllCorner(
|
||||
[+leftUpLng, +leftUpLat],
|
||||
[+rightUpLng, +rightUpLat],
|
||||
[+rightBottomLng, +rightBottomLat],
|
||||
[+leftBottomLng, +leftBottomLat]
|
||||
)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
initWebsocket() {
|
||||
this.ws = new window.MyWebsocket(`/ws/${this.scenarioId}/${this.roomId}`, (error, response) => {
|
||||
if (error) return this.$message.error(error.message)
|
||||
|
|
|
@ -131,6 +131,7 @@ export default {
|
|||
scenarioId: '',
|
||||
scenarioName: '',
|
||||
cesium: null,
|
||||
scenarioDetail: null,
|
||||
zzbzll: {
|
||||
selectedKeys: [],
|
||||
},
|
||||
|
@ -230,6 +231,7 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
this.cesium = new window.MyCesium('model-cesium-container')
|
||||
this.getScenarioDetail()
|
||||
this.initWebsocket()
|
||||
window.addEventListener('beforeunload', (e) => {
|
||||
this.closeWebsocket()
|
||||
|
@ -249,6 +251,29 @@ export default {
|
|||
})
|
||||
},
|
||||
|
||||
async getScenarioDetail() {
|
||||
try {
|
||||
const res = await getAction(`/baseData/scenario/${this.scenarioId}`)
|
||||
const {
|
||||
leftUpLng,
|
||||
leftUpLat,
|
||||
rightUpLng,
|
||||
rightUpLat,
|
||||
rightBottomLng,
|
||||
rightBottomLat,
|
||||
leftBottomLng,
|
||||
leftBottomLat,
|
||||
} = res.data
|
||||
this.cesium.setClientByAllCorner(
|
||||
[+leftUpLng, +leftUpLat],
|
||||
[+rightUpLng, +rightUpLat],
|
||||
[+rightBottomLng, +rightBottomLat],
|
||||
[+leftBottomLng, +leftBottomLat]
|
||||
)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
initWebsocket() {
|
||||
this.ws = new window.MyWebsocket(`/ws/${this.scenarioId}/${this.roomId}`, (error, response) => {
|
||||
if (error) return this.$message.error(error.message)
|
||||
|
|
|
@ -5,23 +5,23 @@
|
|||
<Flex ai="c" jc="c" class="name">{{ resourceName }}</Flex>
|
||||
<Flex ai="c">
|
||||
<span style="min-width: 100px">推演方:</span>
|
||||
<span>{{ modelData.team.type | forceFormat }}</span>
|
||||
<span>{{ modelData.team?.type | forceFormat }}</span>
|
||||
<span
|
||||
:style="{
|
||||
height: '20px',
|
||||
width: '28px',
|
||||
marginLeft: '10px',
|
||||
backgroundColor: ['red', 'blue'][modelData.team.type],
|
||||
backgroundColor: ['red', 'blue'][modelData.team?.type],
|
||||
}"
|
||||
></span>
|
||||
</Flex>
|
||||
<Flex ai="c">
|
||||
<span style="min-width: 100px">经度:</span>
|
||||
<span class="flex-1">{{ modelData.team.lng | lonFormat }}</span>
|
||||
<span class="flex-1">{{ modelData.team?.lng | lonFormat }}</span>
|
||||
</Flex>
|
||||
<Flex ai="c">
|
||||
<span style="min-width: 100px">纬度:</span>
|
||||
<span class="flex-1">{{ modelData.team.lat | latFormat }}</span>
|
||||
<span class="flex-1">{{ modelData.team?.lat | latFormat }}</span>
|
||||
</Flex>
|
||||
</div>
|
||||
<a-collapse-panel v-if="resourceType === 6" key="1" header="可保障的作战分队" class="simulation-collapse-item">
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<a-radio :checked="checkedAction && checkedAction.id === item.id" style="margin-right: 0"></a-radio>
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<div class="action-title">【{{ actionTypeMapText[item.type] }}】{{ item.name || '- -' }}</div>
|
||||
<div class="action-title">【{{ actionTypeMapText[item.taskType] }}】{{ item.name || '- -' }}</div>
|
||||
<div class="action-destination">目的地:{{ item.toLng }}, {{ item.toLat }}</div>
|
||||
<div class="action-time">{{ item.startTime }} ~ {{ item.endTime }}</div>
|
||||
</div>
|
||||
|
@ -70,7 +70,7 @@ export default {
|
|||
},
|
||||
allFormItems: [
|
||||
{ label: '分队id', prop: 'resourceId' },
|
||||
{ label: '任务类型', prop: 'type' },
|
||||
{ label: '任务类型', prop: 'taskType' },
|
||||
{ label: '任务内容', prop: 'name' },
|
||||
{
|
||||
label: '开始时间',
|
||||
|
@ -95,9 +95,9 @@ export default {
|
|||
{ label: '目的地纬度', prop: 'toLat', component: 'LatitudeInput' },
|
||||
],
|
||||
actionTypeMapFormItemProps: {
|
||||
1: ['resourceId', 'type', 'name', 'startTime', 'endTime', 'toLng', 'toLat'],
|
||||
2: ['resourceId', 'type', 'name', 'startTime', 'duringTime', 'toLng', 'toLat'],
|
||||
3: ['resourceId', 'type', 'name', 'startTime', 'duringTime', 'toLng', 'toLat'],
|
||||
1: ['name', 'startTime', 'endTime', 'toLng', 'toLat'],
|
||||
2: ['name', 'startTime', 'duringTime', 'toLng', 'toLat'],
|
||||
3: ['name', 'startTime', 'duringTime', 'toLng', 'toLat'],
|
||||
},
|
||||
AEModal: {
|
||||
title: '',
|
||||
|
|
|
@ -120,7 +120,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction } from '@/api/manage'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
import AddRoom from './components/AddRoom.vue'
|
||||
|
||||
export default {
|
||||
|
@ -172,7 +172,7 @@ export default {
|
|||
{ label: '想定区域(西)', prop: 'left', required: true, component: 'LongitudeInput' },
|
||||
{ label: '想定区域(南)', prop: 'down', required: true, component: 'LatitudeInput' },
|
||||
{ label: '想定区域(北)', prop: 'up', required: true, component: 'LatitudeInput' },
|
||||
{ label: '想定描述', prop: 'desc', required: true, component: 'a-textarea', options: { rows: 4 } },
|
||||
{ label: '想定描述', prop: 'mark', required: true, component: 'a-textarea', options: { rows: 4 } },
|
||||
],
|
||||
formRules: {},
|
||||
formData: {},
|
||||
|
@ -246,6 +246,7 @@ export default {
|
|||
leftBottomLat: formData.down,
|
||||
rightBottomLng: formData.right,
|
||||
rightBottomLat: formData.down,
|
||||
mark: formData.mark,
|
||||
}
|
||||
return postAction('/baseData/scenario/save', params)
|
||||
},
|
||||
|
|
|
@ -116,6 +116,7 @@ export default {
|
|||
scenarioId: '',
|
||||
scenarioName: '',
|
||||
cesium: null,
|
||||
scenarioDetail: null,
|
||||
zzbzll: {
|
||||
selectedKeys: [],
|
||||
},
|
||||
|
@ -194,6 +195,7 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
this.cesium = new window.MyCesium('scene-cesium-container')
|
||||
this.getScenarioDetail()
|
||||
this.initWebsocket()
|
||||
window.addEventListener('beforeunload', (e) => {
|
||||
this.closeWebsocket()
|
||||
|
@ -213,6 +215,29 @@ export default {
|
|||
})
|
||||
},
|
||||
|
||||
async getScenarioDetail() {
|
||||
try {
|
||||
const res = await getAction(`/baseData/scenario/${this.scenarioId}`)
|
||||
const {
|
||||
leftUpLng,
|
||||
leftUpLat,
|
||||
rightUpLng,
|
||||
rightUpLat,
|
||||
rightBottomLng,
|
||||
rightBottomLat,
|
||||
leftBottomLng,
|
||||
leftBottomLat,
|
||||
} = res.data
|
||||
this.cesium.setClientByAllCorner(
|
||||
[+leftUpLng, +leftUpLat],
|
||||
[+rightUpLng, +rightUpLat],
|
||||
[+rightBottomLng, +rightBottomLat],
|
||||
[+leftBottomLng, +leftBottomLat]
|
||||
)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
initWebsocket() {
|
||||
this.ws = new window.MyWebsocket(`/ws/${this.scenarioId}/${this.roomId}`, (error, response) => {
|
||||
if (error) return this.$message.error(error.message)
|
||||
|
|
|
@ -178,6 +178,7 @@ export default {
|
|||
scenarioId: '',
|
||||
scenarioName: '',
|
||||
cesium: null,
|
||||
scenarioDetail: null,
|
||||
zzbzll: {
|
||||
loading: false,
|
||||
treeData: [],
|
||||
|
@ -253,6 +254,7 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
this.cesium = new window.MyCesium('scene-presetting-cesium-container')
|
||||
this.getScenarioDetail()
|
||||
this.getZzbzllTreeData(true)
|
||||
this.getFdListData()
|
||||
},
|
||||
|
@ -268,6 +270,29 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
async getScenarioDetail() {
|
||||
try {
|
||||
const res = await getAction(`/baseData/scenario/${this.scenarioId}`)
|
||||
const {
|
||||
leftUpLng,
|
||||
leftUpLat,
|
||||
rightUpLng,
|
||||
rightUpLat,
|
||||
rightBottomLng,
|
||||
rightBottomLat,
|
||||
leftBottomLng,
|
||||
leftBottomLat,
|
||||
} = res.data
|
||||
this.cesium.setClientByAllCorner(
|
||||
[+leftUpLng, +leftUpLat],
|
||||
[+rightUpLng, +rightUpLat],
|
||||
[+rightBottomLng, +rightBottomLat],
|
||||
[+leftBottomLng, +leftBottomLat]
|
||||
)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
async getZzbzllTreeData(initPlot = false) {
|
||||
try {
|
||||
this.zzbzll.loading = true
|
||||
|
|
Loading…
Reference in New Issue
Block a user