Commit 9f2cc5eb authored by aoobao's avatar aoobao

fix 合并页面

parent bd9f1393
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>amap-line-edit</title> <title>amap-line-edit</title>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.13&key=c81eeaf774b25626ffb1b32e13acbd99&plugin=AMap.CustomLayer"></script> <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.13&key=c81eeaf774b25626ffb1b32e13acbd99&plugin=AMap.CustomLayer,AMap.MouseTool"></script>
</head> </head>
<body> <body>
<noscript> <noscript>
......
<script>
// 线段编辑
export default {
render () { return null },
props: {
draw: {
type: Boolean,
default: false
}
},
mounted () {
if (this.draw) {
this.initDraw()
}
},
beforeDestroy () {
if (this.draw) this.destory()
},
methods: {
initDraw () {
},
destory () {
}
},
watch: {
draw (val, oldval) {
if (val != oldval) {
if (val) {
this.initDraw()
} else {
this.destory()
}
}
}
}
}
</script>
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.select-container { .select-container {
width: 50%; width: 50%;
height: 200px; min-height: 200px;
background-color: aqua; background-color: aqua;
text-align: left; text-align: left;
float: left; float: left;
......
...@@ -3,15 +3,16 @@ ...@@ -3,15 +3,16 @@
<div class="map-container" @mousemove="mapMouseMove" @mouseout="mapMouseOut"> <div class="map-container" @mousemove="mapMouseMove" @mouseout="mapMouseOut">
<div class="map" ref="map"></div> <div class="map" ref="map"></div>
<LineManagerView v-if="map" :map="map" :data="lineList" ref="lineManager" :status="status" :x="x" :y="y" :clearWidth="clearNumber" /> <LineManagerView v-if="map" :map="map" :data="lineList" ref="lineManager" :status="status" :x="x" :y="y" :clearWidth="clearNumber" />
<DrawLine :draw="isDrawLine" @createLine="createLine" />
</div> </div>
<div class="control"> <div class="control">
<div class="button-control"> <div class="button-control">
<label>{{statusName}}</label> <label>{{statusName}}</label>
<el-button style="margin-left:5px;" type="primary" @click="showAdd">新增</el-button> <el-button v-if="!exportVisible && !isDrawLine && statusName === '查看'" style="margin-left:5px;" type="primary" @click="showAdd">新增</el-button>
<el-button style="margin-left:5px;" type="warning" @click="clearModel">{{statusName == '擦除' ? '取消擦除' : '擦除'}}</el-button> <el-button v-if="!exportVisible && !isDrawLine" style="margin-left:5px;" type="warning" @click="clearModel">{{statusName == '擦除' ? '取消擦除' : '擦除'}}</el-button>
<el-button style="margin-left:5px;" type="success" @click="merge">合并</el-button> <el-button v-if="!exportVisible && !isDrawLine && statusName === '查看'" style="margin-left:5px;" type="success" @click="merge">合并</el-button>
<el-button style="margin-left:5px;" @click="exportAll">{{exportVisible ? '关闭导出' : '批量导出'}}</el-button> <el-button style="margin-left:5px;" @click="exportAll">{{exportVisible ? '关闭导出' : '导出'}}</el-button>
</div> </div>
<div class="line-control"> <div class="line-control">
<template v-if="statusName == '查看'"> <template v-if="statusName == '查看'">
...@@ -37,6 +38,7 @@ ...@@ -37,6 +38,7 @@
let __id = 0 let __id = 0
// import HANG_ZHOU from '../assets/HANGZHOU' // import HANG_ZHOU from '../assets/HANGZHOU'
// import SHAO_XING from '../assets/SHAOXING' // import SHAO_XING from '../assets/SHAOXING'
import DrawLine from '@/components/DrawLine'
import AddDialog from '@/components/AddDialog' import AddDialog from '@/components/AddDialog'
import RemarkDialog from '@/components/RemarkDialog' import RemarkDialog from '@/components/RemarkDialog'
import TransferDialog from '@/components/TransferDialog' import TransferDialog from '@/components/TransferDialog'
...@@ -54,7 +56,8 @@ export default { ...@@ -54,7 +56,8 @@ export default {
LineManagerView, LineManagerView,
TransferDialog, TransferDialog,
RemarkDialog, RemarkDialog,
ExportDialog ExportDialog,
DrawLine
}, },
data () { data () {
return { return {
...@@ -68,7 +71,8 @@ export default { ...@@ -68,7 +71,8 @@ export default {
mergeList: [], mergeList: [],
remark: null, remark: null,
imgBase64: null, imgBase64: null,
exportVisible: false exportVisible: false,
isDrawLine: false
} }
}, },
computed: { computed: {
...@@ -117,6 +121,9 @@ export default { ...@@ -117,6 +121,9 @@ export default {
}, },
methods: { methods: {
createLine (line) {
console.log(line)
},
copyLine (lineObj) { copyLine (lineObj) {
let line = lineObj.line let line = lineObj.line
let st = LineToString(line) let st = LineToString(line)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment