From 2d398b4fa805ba43a89311d955fbb6e47c540e6c Mon Sep 17 00:00:00 2001
From: YANGDL <114714267@qq.com>
Date: 星期五, 12 三月 2021 20:57:16 +0800
Subject: [PATCH] 修改了界面自适应
---
src/components/panel/ToolBoxPanel.vue | 98 ++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 81 insertions(+), 17 deletions(-)
diff --git a/src/components/panel/ToolBoxPanel.vue b/src/components/panel/ToolBoxPanel.vue
index 5747cc7..7e6489e 100644
--- a/src/components/panel/ToolBoxPanel.vue
+++ b/src/components/panel/ToolBoxPanel.vue
@@ -3,11 +3,6 @@
<div class="init-choose" @click="changeSelect()">
<img src="@/assets/images/map-pages/icon/toolbox/circle.png" alt="">
</div>
- <!-- <transition name="fade">-->
- <!-- <ul v-show='selectGroup'>-->
- <!-- <li v-for="(item,i) in imgList" :key="i" @click="toggleActive(i)" :value="total"><img :src="item"/></li>-->
- <!-- </ul>-->
- <!-- </transition>-->
<div class="el-select-dropdown" v-show='selectGroup'>
<el-dropdown @command="handleCommand" trigger="click" v-for="(item,i) in imgLists" :key="i" :value="total">
<transition name="fade">
@@ -15,11 +10,13 @@
</transition>
<el-dropdown-menu>
<el-dropdown-item v-for="(ite,index) in item.items" :key="index" :command='ite.headings'>
- <span @click='toggleActive(ite)'>{{ ite.headings }}</span>
+ <span>{{ ite.headings }}</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
+ <!-- // 寮规-->
+ <TextBounced v-show="this.bouncedText" @changeBounced="gitBounced"></TextBounced>
</div>
</template>
@@ -31,10 +28,19 @@
import polygon from '@/assets/images/map-pages/icon/toolbox/polygon.png'
import square from '@/assets/images/map-pages/icon/toolbox/square.png'
+// 娴嬮噺鐨勬柟娉�
+import '@/components/plugin/leaflet-measure-path/leaflet-measure-path.css'
+import Measure from '@/components/plugin/MeaSure'
+
+// 鏍囨敞鐨勬柟娉�
+import MakeTation from '@components/plugin/MakeTation'
+
+// 灏佽鐨勯�夋嫨寮规
+import TextBounced from '@components/panel/bounced/TextBounced'
+
export default {
name: 'ToolBoxPanel',
- components: {},
- props: ['map'],
+ components: { TextBounced },
data () {
return {
isPanelVisible: false,
@@ -103,10 +109,17 @@
enterprise: ''
},
selectGroup: false,
- selectGroupOne: false
+ drawLayer: null,
+ map: null,
+ L: window.L,
+ // 鎺у埗宸ュ叿鏍� 鏂囧瓧鏍囨敞 鐨勫脊妗嗘槸鍚︽樉绀�
+ bouncedText: false
}
},
methods: {
+ gitBounced (params) {
+ this.bouncedText = params
+ },
changeSelect () {
this.selectGroup = !this.selectGroup
},
@@ -118,13 +131,64 @@
},
handleCommand (command) {
console.log(command)
- if (command === '鍏ㄥ睆') {
- this.map.toggleFullscreen()
- }
- },
- toggleActive (k) {
- if (k === 'fullscreen') {
- this.map.toggleFullscreen()
+ switch (command) {
+ case '鍏ㄥ睆':
+ // this.map.toggleFullscreen()
+ var printer = this.L.easyPrint({
+ sizeModes: ['Current', 'A4Landscape', 'A4Portrait'],
+ filename: 'map_image',
+ exportOnly: true,
+ hideControlContainer: true
+ }).addTo(this.map)
+ printer.printMap('CurrentSize', 'MyManualPrint')
+ break
+ case 'A4妯悜':
+ var printerX = this.L.easyPrint({
+ sizeModes: ['Current', 'A4Landscape', 'A4Portrait'],
+ filename: 'map_image',
+ exportOnly: true,
+ hideControlContainer: true
+ }).addTo(this.map)
+ printerX.printMap('A4Landscape page', 'MyManualPrint')
+ break
+ case 'A4绾靛悜':
+ var printerY = this.L.easyPrint({
+ sizeModes: ['Current', 'A4Landscape', 'A4Portrait'],
+ filename: 'map_image',
+ exportOnly: true,
+ hideControlContainer: true
+ }).addTo(this.map)
+ printerY.printMap('A4Portrait page', 'MyManualPrint')
+ break
+ case '绾挎爣缁�':
+ this.drawLayer = this.map.editTools.startPolyline()
+ this.drawLayer.on('dblclick').on('dblclick', this.drawLayer.toggleEdit)
+ break
+ case '闈㈡爣缁�':
+ this.drawLayer = this.map.editTools.startPolygon()
+ this.drawLayer.on('dblclick').on('dblclick', this.drawLayer.toggleEdit)
+ break
+ case '绠ご鏍囩粯':
+ this.drawLayer = this.map.editTools.startPolylineArrow()
+ this.drawLayer.on('dblclick').on('dblclick', this.drawLayer.toggleEdit)
+ break
+ case '鐐规爣娉�':
+ MakeTation.StartCircleAnnotation(this.map, this.L)
+ break
+ case '鍥炬爣鏍囨敞':
+ this.drawLayer = this.map.editTools.startIcon()
+ this.drawLayer.on('dblclick').on('dblclick', this.drawLayer.toggleEdit)
+ break
+ case '鏂囧瓧鏍囨敞':
+ this.bouncedText = true
+ MakeTation.startMakeText(this.map, this.L)
+ break
+ case '璺濈娴嬮噺':
+ Measure.startMeasureLen(this.map, this.L)
+ break
+ case '闈㈢Н娴嬮噺':
+ Measure.startMeasureArea(this.map, this.L)
+ break
}
},
loadData () {
@@ -153,7 +217,7 @@
background: #305B62;
//margin-top: 15px;
width: 35px;
- height: 35px;
+ height: 38px;
border-radius: 50%;
border: 2px skyblue solid;
display: flex;
--
Gitblit v1.8.0