Commit 00d942eb by xinla

扩展百度地图组件,替换会话存档高德地图

1 parent 1a102063
...@@ -14,7 +14,7 @@ export default { ...@@ -14,7 +14,7 @@ export default {
default: () => ({}), default: () => ({}),
}, },
}, },
components: { Voice }, components: { Voice, BaiduMap: defineAsyncComponent(() => import('@/components/common/BaiduMap')) },
data() { data() {
return {} return {}
}, },
...@@ -108,17 +108,13 @@ export default { ...@@ -108,17 +108,13 @@ export default {
</video> </video>
</template> </template>
<div v-else-if="message.msgType === 'location'" class="msgtypecard"> <div v-else-if="message.msgType === 'location'" class="msgtypecard">
<div class="card-content" style="height: 100%; width: 100%"> <div class="card-content">
<el-amap <BaiduMap
ref="map" isDetail
vid="amapDemo" isOnlyShowMap
:center="[JSON.parse(message.contact).longitude, JSON.parse(message.contact).latitude]" mapWidth="300px"
:zoom="14" mapHeight="120px"
class="amap-demo" :initData="JSON.parse(message.contact)"></BaiduMap>
style="height: 120px; width: 250px; pointer-events: none">
<el-amap-marker
:position="[JSON.parse(message.contact).longitude, JSON.parse(message.contact).latitude]"></el-amap-marker>
</el-amap>
</div> </div>
<div class="card-foot">{{ content }}</div> <div class="card-foot">{{ content }}</div>
</div> </div>
...@@ -234,6 +230,7 @@ export default { ...@@ -234,6 +230,7 @@ export default {
line-height: 1.5; line-height: 1.5;
// text-indent: 10px; // text-indent: 10px;
color: #333; color: #333;
z-index: -1;
.card--link-title { .card--link-title {
font-size: 15px; font-size: 15px;
font-weight: 500; font-weight: 500;
......
<template> <template>
<div> <div>
<el-form-item label="详细地址" prop="address"> <el-form-item label="详细地址" prop="address" v-if="!isOnlyShowMap">
<el-autocomplete <el-autocomplete
:disabled="isDetail" :disabled="isDetail"
@change="setChange" @change="setChange"
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
</template> </template>
</el-autocomplete> </el-autocomplete>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="" :label-width="isOnlyShowMap ? 0 : ''" :style="isOnlyShowMap && 'margin-bottom: 0'">
<div id="map-container" style="width: 500px; height: 300px" /> <div id="map-container" :style="{ width: mapWidth, height: mapHeight }" />
</el-form-item> </el-form-item>
</div> </div>
</template> </template>
...@@ -52,12 +52,30 @@ export default { ...@@ -52,12 +52,30 @@ export default {
props: { props: {
initData: { initData: {
type: Object, type: Object,
default: () => {}, default: () => ({
// area: '', // 省市区
// address: '', // 详细地址
// longitude: '', // 经度
// latitude: '', // 纬度
}),
},
mapWidth: {
type: String,
default: '500px',
},
mapHeight: {
type: String,
default: '300px',
}, },
isDetail: { isDetail: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
// 是否只显示地图
isOnlyShowMap: {
type: Boolean,
default: false,
},
}, },
watch: { watch: {
initData: { initData: {
......
...@@ -209,7 +209,7 @@ export default { ...@@ -209,7 +209,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.list { .list {
height: calc(100vh - 420px); height: calc(100vh - 370px);
margin-top: 10px; margin-top: 10px;
background: white; background: white;
overflow-y: scroll; overflow-y: scroll;
......
<template> <template>
<div class="content"> <div class="content" style="margin-top: -13px">
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane label="员工检索" name="1"> <el-tab-pane label="员工检索" name="1">
<employee></employee> <employee></employee>
...@@ -14,21 +14,21 @@ ...@@ -14,21 +14,21 @@
</div> </div>
</template> </template>
<script> <script>
import employee from './employee.vue' import employee from './employee.vue'
import user from './customer.vue' import user from './customer.vue'
import global from './global.vue' import global from './global.vue'
export default { export default {
components: { employee, user, global }, components: { employee, user, global },
data() { data() {
return { return {
activeName: '1' activeName: '1',
} }
}, },
methods: {} methods: {},
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep.pd15 { ::v-deep.pd15 {
padding: 15px; padding: 15px;
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!