Browse Source

Merge branch 'master' of http://124.70.32.114:3100/woka/cesium-map-object into ctw

# Conflicts:
#	ruoyi-ui/src/views/cesiumMap/index.vue
master
ctw 3 months ago
parent
commit
f1c5ef330f
  1. 40
      ruoyi-ui/src/views/cesiumMap/index.vue
  2. 9
      ruoyi-ui/src/views/childRoom/index.vue

40
ruoyi-ui/src/views/cesiumMap/index.vue

@ -3,12 +3,12 @@
<div id="cesiumViewer" ref="cesiumViewer"></div> <div id="cesiumViewer" ref="cesiumViewer"></div>
<!-- 主工具栏 --> <!-- 主工具栏 -->
<div class="main-toolbar" :class="{ collapsed: isToolbarCollapsed }"> <div class="main-toolbar" v-if="drawDomClick" :class="{ collapsed: isToolbarCollapsed }">
<!-- 展开/收起按钮 --> <!-- 展开/收起按钮 -->
<div class="collapse-btn" @click="toggleToolbar"> <!-- <div class="collapse-btn" @click="toggleToolbar">
<span class="collapse-icon">{{ isToolbarCollapsed ? '▶' : '◀' }}</span> <span class="collapse-icon">{{ isToolbarCollapsed ? '▶' : '◀' }}</span>
<span class="collapse-text" v-if="!isToolbarCollapsed">收起</span> <span class="collapse-text" v-if="!isToolbarCollapsed">收起</span>
</div> </div> -->
<!-- 工具栏内容 --> <!-- 工具栏内容 -->
<div class="toolbar-content" v-show="!isToolbarCollapsed"> <div class="toolbar-content" v-show="!isToolbarCollapsed">
@ -178,7 +178,31 @@
// import 'cesium/Build/Cesium/Widgets/widgets.css' // import 'cesium/Build/Cesium/Widgets/widgets.css'
export default { export default {
name: 'CesiumMap', name: 'CesiumMap',
props: {
drawDomClick: {
type: Boolean,
default: false,
// props 便
validator(val) {
const isBoolean = typeof val === 'boolean'
if (!isBoolean) {
console.error('drawDomClick 必须是布尔值,当前值:', val, '类型:', typeof val)
}
return isBoolean
}
},
},
watch: {
drawDomClick: {
immediate: true, //
handler(newVal, oldVal) {
//
if (newVal) {
// this.initMap()
}
}
}
},
data() { data() {
return { return {
viewer: null, viewer: null,
@ -213,6 +237,7 @@
}, },
mounted() { mounted() {
console.log(this.drawDomClick,999999)
// this.initMap() // this.initMap()
this.checkCesiumLoaded() this.checkCesiumLoaded()
}, },
@ -1234,8 +1259,8 @@
/* 主工具栏 - 修改后 */ /* 主工具栏 - 修改后 */
.main-toolbar { .main-toolbar {
position: absolute; position: absolute;
top: 100px; top: 365px; /* 增大这个数值即可整体下移,比如从100px改成150px */
right: 20px; left: 62px;
z-index: 1000; z-index: 1000;
display: flex; display: flex;
background: rgba(255, 255, 255, 0.95); background: rgba(255, 255, 255, 0.95);
@ -1248,7 +1273,7 @@
background: rgba(255, 255, 255, 0.9); background: rgba(255, 255, 255, 0.9);
} }
/* 工具栏内容 */ /* 工具栏内容 - 无需修改 */
.toolbar-content { .toolbar-content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -1497,4 +1522,3 @@
} }
} }
</style> </style>

9
ruoyi-ui/src/views/childRoom/index.vue

@ -4,7 +4,7 @@
<!-- 地图背景 --> <!-- 地图背景 -->
<div id="gis-map-background" class="map-background"> <div id="gis-map-background" class="map-background">
<!-- cesiummap组件 --> <!-- cesiummap组件 -->
<cesiumMap/> <cesiumMap :drawDomClick="drawDom"/>
<div class="map-overlay-text"> <div class="map-overlay-text">
<i class="el-icon-location-outline text-3xl mb-2 block"></i> <i class="el-icon-location-outline text-3xl mb-2 block"></i>
<p>二维GIS地图区域</p> <p>二维GIS地图区域</p>
@ -430,6 +430,7 @@ export default {
}, },
data() { data() {
return { return {
drawDom:false,
// //
activeTopNav: 'file', activeTopNav: 'file',
topNavItems: [ topNavItems: [
@ -605,7 +606,10 @@ export default {
selectMenu(item) { selectMenu(item) {
this.activeMenu = item.id; this.activeMenu = item.id;
if(item.id === 'modify'){
this.drawDom = !this.drawDom
console.log(this.drawDom,999999)
}
if (item.id === 'deduction') { if (item.id === 'deduction') {
// /K // /K
this.showKTimePopup = !this.showKTimePopup; this.showKTimePopup = !this.showKTimePopup;
@ -617,6 +621,7 @@ export default {
} else { } else {
// //
this.$message.info(`选择菜单: ${item.name}`); this.$message.info(`选择菜单: ${item.name}`);
} }
}, },

Loading…
Cancel
Save