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. 232
      ruoyi-ui/src/views/cesiumMap/index.vue
  2. 9
      ruoyi-ui/src/views/childRoom/index.vue

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

@ -3,12 +3,12 @@
<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-text" v-if="!isToolbarCollapsed">收起</span>
</div>
</div> -->
<!-- 工具栏内容 -->
<div class="toolbar-content" v-show="!isToolbarCollapsed">
@ -171,14 +171,38 @@
</div>
</div>
</div>
</template>
</template>
<script>
// import * as Cesium from 'cesium'
// import 'cesium/Build/Cesium/Widgets/widgets.css'
export default {
<script>
// import * as Cesium from 'cesium'
// import 'cesium/Build/Cesium/Widgets/widgets.css'
export default {
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() {
return {
viewer: null,
@ -213,6 +237,7 @@
},
mounted() {
console.log(this.drawDomClick,999999)
// this.initMap()
this.checkCesiumLoaded()
},
@ -1216,49 +1241,49 @@
}
}
}
}
</script>
}
</script>
<style scoped>
.cesium-container {
<style scoped>
.cesium-container {
width: 100vw;
height: 100vh;
position: relative;
}
}
#cesiumViewer {
#cesiumViewer {
width: 100%;
height: 100%;
}
}
/* 主工具栏 - 修改后 */
.main-toolbar {
/* 主工具栏 - 修改后 */
.main-toolbar {
position: absolute;
top: 100px;
right: 20px;
top: 365px; /* 增大这个数值即可整体下移,比如从100px改成150px */
left: 62px;
z-index: 1000;
display: flex;
background: rgba(255, 255, 255, 0.95);
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
transition: all 0.3s ease;
}
}
.main-toolbar.collapsed {
.main-toolbar.collapsed {
background: rgba(255, 255, 255, 0.9);
}
}
/* 工具栏内容 */
.toolbar-content {
/* 工具栏内容 - 无需修改 */
.toolbar-content {
display: flex;
flex-direction: column;
gap: 15px;
padding: 15px;
min-width: 180px;
}
}
/* 收起按钮 */
.collapse-btn {
/* 收起按钮 */
.collapse-btn {
display: flex;
align-items: center;
padding: 10px;
@ -1269,48 +1294,48 @@
border-right: 1px solid #e9ecef;
transition: all 0.3s ease;
user-select: none;
}
}
.collapse-btn:hover {
.collapse-btn:hover {
background: #e9ecef;
}
}
.collapse-icon {
.collapse-icon {
font-size: 14px;
font-weight: bold;
color: #495057;
margin-right: 5px;
}
}
.collapse-text {
.collapse-text {
font-size: 12px;
color: #6c757d;
white-space: nowrap;
}
}
/* 工具栏组 */
.toolbar-group {
/* 工具栏组 */
.toolbar-group {
display: flex;
flex-direction: column;
gap: 8px;
padding-bottom: 10px;
border-bottom: 1px solid #e9ecef;
}
}
.toolbar-group:last-child {
.toolbar-group:last-child {
border-bottom: none;
padding-bottom: 0;
}
}
/* 收起时的最小化工具栏 */
.toolbar-minimized {
/* 收起时的最小化工具栏 */
.toolbar-minimized {
display: flex;
flex-direction: column;
padding: 10px 8px;
gap: 8px;
}
}
.min-tool-btn {
.min-tool-btn {
width: 36px;
height: 36px;
border: 2px solid #e9ecef;
@ -1323,53 +1348,53 @@
font-size: 16px;
color: #495057;
transition: all 0.3s ease;
}
}
.min-tool-btn:hover {
.min-tool-btn:hover {
background: #f8f9fa;
border-color: #4dabf7;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
}
.min-tool-btn.active {
.min-tool-btn.active {
background: #4dabf7;
color: white;
border-color: #4dabf7;
}
}
.min-tool-btn:disabled {
.min-tool-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: none !important;
}
}
.min-tool-btn.danger {
.min-tool-btn.danger {
color: #dc3545;
}
}
.min-tool-btn.danger:hover {
.min-tool-btn.danger:hover {
background: #f8d7da;
border-color: #dc3545;
}
}
.min-tool-btn.success {
.min-tool-btn.success {
color: #28a745;
}
}
.min-tool-btn.success:hover {
.min-tool-btn.success:hover {
background: #d4edda;
border-color: #28a745;
}
}
.min-tool-separator {
.min-tool-separator {
height: 1px;
background: #e9ecef;
margin: 5px 0;
}
}
/* 原来的工具按钮样式保持不变,但添加展开/收起状态的调整 */
.tool-btn {
/* 原来的工具按钮样式保持不变,但添加展开/收起状态的调整 */
.tool-btn {
padding: 10px 15px;
background: white;
border: 2px solid #e9ecef;
@ -1383,59 +1408,59 @@
color: #495057;
transition: all 0.3s ease;
min-width: 120px;
}
}
.tool-btn:hover {
.tool-btn:hover {
background: #f8f9fa;
border-color: #4dabf7;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
}
.tool-btn.active {
.tool-btn.active {
background: #4dabf7;
color: white;
border-color: #4dabf7;
}
}
.tool-btn:disabled {
.tool-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: none !important;
}
}
.tool-btn.danger {
.tool-btn.danger {
color: #dc3545;
}
}
.tool-btn.danger:hover {
.tool-btn.danger:hover {
background: #f8d7da;
border-color: #dc3545;
}
}
.tool-btn.success {
.tool-btn.success {
color: #28a745;
}
}
.tool-btn.success:hover {
.tool-btn.success:hover {
background: #d4edda;
border-color: #28a745;
}
}
.tool-btn .icon {
.tool-btn .icon {
font-size: 16px;
width: 20px;
text-align: center;
}
}
.tool-btn .text {
.tool-btn .text {
white-space: nowrap;
}
}
/* 其他样式保持不变... */
/* 其他样式保持不变... */
/* 属性面板 */
.property-panel {
/* 属性面板 */
.property-panel {
position: absolute;
top: 20px;
left: 20px;
@ -1446,10 +1471,10 @@
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
min-width: 250px;
max-width: 300px;
}
}
/* 测量结果面板 */
.measurement-panel {
/* 测量结果面板 */
.measurement-panel {
position: absolute;
bottom: 80px;
left: 20px;
@ -1459,29 +1484,29 @@
padding: 15px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
min-width: 200px;
}
}
/* 自定义比例尺样式 */
:deep(.scale-bar-container) {
/* 自定义比例尺样式 */
:deep(.scale-bar-container) {
user-select: none;
pointer-events: none;
}
}
/* 隐藏Cesium的默认控件 */
:deep(.cesium-viewer-bottom) {
/* 隐藏Cesium的默认控件 */
:deep(.cesium-viewer-bottom) {
display: none !important;
}
}
:deep(.cesium-credit-logoContainer) {
:deep(.cesium-credit-logoContainer) {
display: none !important;
}
}
:deep(.cesium-credit-textContainer) {
:deep(.cesium-credit-textContainer) {
display: none !important;
}
}
/* 响应式调整 */
@media (max-width: 768px) {
/* 响应式调整 */
@media (max-width: 768px) {
.main-toolbar {
right: 10px;
top: 80px;
@ -1495,6 +1520,5 @@
min-width: 100px;
padding: 8px 12px;
}
}
</style>
}
</style>

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

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

Loading…
Cancel
Save