Commit a489be49 by 胡悦

ditu

1 parent 1a4e4121
<template>
<div class="detail">
<gl-breadcrumb class="detail-bread" style="" separator='/'>
<gl-breadcrumb
class="detail-bread"
style=""
separator='/'
>
<gl-breadcrumb-item><a
href='#'
@click='back'
......@@ -18,54 +22,77 @@
label='基本信息'
name='first'
>
<gl-col v-loading="basicLoading" :span="24" class="detail-basic">
<gl-col
class="detail-row"
:span="i.isMap? 24 : 8"
v-for="(i, index) in List"
:key="index+''"
v-loading="basicLoading"
:span="24"
class="detail-basic"
>
<span>{{i.label}}:
<div
v-if="i.isMap"
class='amap-page-container'
>
<span v-show="hasLocation" class="error mapTips">{{i.value}}</span>
<el-amap
vid='amapDemo'
:center='center'
:amap-manager='amapManager'
:zoom='zoom'
class='amap-demo'
<gl-col
class="detail-row"
:span="i.isMap? 24 : 8"
v-for="(i, index) in List"
:key="index+''"
>
<span>{{i.label}}:
<div
v-if="i.isMap"
class='amap-page-container'
>
<span
v-show="hasLocation"
class="error mapTips"
>{{i.value}}</span>
<el-amap
vid='amapDemo'
:center='center'
:amap-manager='amapManager'
:zoom='zoom'
:events='events'
class='amap-demo'
>
</el-amap>
</div>
<img
v-else-if="i.isImg"
class="detail-logo"
:src="i.value"
alt=""
>
</el-amap>
</div>
<img
v-else-if="i.isImg"
class="detail-logo"
:src="i.value"
alt=""
>
<span v-else>{{i.value}}</span>
</span>
<span v-else>{{i.value}}</span>
</span>
</gl-col>
</gl-col>
</gl-col>
</gl-tab-pane>
<gl-tab-pane
label='员工信息'
name='second'
>
<gl-table v-loading="staffLoading" :table="staffTableData"></gl-table>
<gl-table
v-loading="staffLoading"
:table="staffTableData"
></gl-table>
</gl-tab-pane>
<gl-tab-pane
label='分组信息'
name='third'
>
<gl-table v-loading="groupLoading" :table="groupTableData">
<gl-table-column align="center" v-for="(i, index) in groupTableData.column" :key="index" :label='i.label' :prop='i.prop' >
<gl-table
v-loading="groupLoading"
:table="groupTableData"
>
<gl-table-column
align="center"
v-for="(i, index) in groupTableData.column"
:key="index"
:label='i.label'
:prop='i.prop'
>
<template slot-scope="scope">
<template v-if='i.prop === "groupName"'>
<a href="#" @click="goGroupDetail(scope.scope.row)">{{groupTableData.data[scope.scope.$index][i.prop]}}</a>
<a
href="#"
@click="goGroupDetail(scope.scope.row)"
>{{groupTableData.data[scope.scope.$index][i.prop]}}</a>
</template>
<template v-else>
{{groupTableData.data[scope.scope.$index][i.prop]}}
......@@ -82,29 +109,47 @@
>
<span>父商户信息:</span>
<gl-table :table="parentLevelTableData">
<gl-table-column align="center" v-for="(i, index) in parentLevelTableData.column" :key="index" :label='i.label' :prop='i.prop' >
<template slot-scope="scope">
<template v-if='i.prop === "merchantName"'>
<a href="#" @click="goBusinessDetail(scope.scope.row)">{{parentLevelTableData.data[scope.scope.$index][i.prop]}}</a>
</template>
<template v-else>
{{parentLevelTableData.data[scope.scope.$index][i.prop]}}
</template>
<gl-table-column
align="center"
v-for="(i, index) in parentLevelTableData.column"
:key="index"
:label='i.label'
:prop='i.prop'
>
<template slot-scope="scope">
<template v-if='i.prop === "merchantName"'>
<a
href="#"
@click="goBusinessDetail(scope.scope.row)"
>{{parentLevelTableData.data[scope.scope.$index][i.prop]}}</a>
</template>
</gl-table-column>
<template v-else>
{{parentLevelTableData.data[scope.scope.$index][i.prop]}}
</template>
</template>
</gl-table-column>
</gl-table>
<span>子商户信息:</span>
<gl-table :table="childLevelTableData">
<gl-table-column align="center" v-for="(i, index) in childLevelTableData.column" :key="index" :label='i.label' :prop='i.prop' >
<template slot-scope="scope">
<template v-if='i.prop === "merchantName"'>
<a href="#" @click="goBusinessDetail(scope.scope.row)">{{childLevelTableData.data[scope.scope.$index][i.prop]}}</a>
</template>
<template v-else>
{{childLevelTableData.data[scope.scope.$index][i.prop]}}
</template>
<gl-table-column
align="center"
v-for="(i, index) in childLevelTableData.column"
:key="index"
:label='i.label'
:prop='i.prop'
>
<template slot-scope="scope">
<template v-if='i.prop === "merchantName"'>
<a
href="#"
@click="goBusinessDetail(scope.scope.row)"
>{{childLevelTableData.data[scope.scope.$index][i.prop]}}</a>
</template>
</gl-table-column>
<template v-else>
{{childLevelTableData.data[scope.scope.$index][i.prop]}}
</template>
</template>
</gl-table-column>
</gl-table>
<span slot="footer">
<el-button
......@@ -117,13 +162,16 @@
</template>
<script>
var marker = []
import VueAMap from 'vue-amap'
import Vue from 'vue'
import { bizMethods, request } from '@/api'
import notice from '@/common/notice'
const amapManager = new VueAMap.AMapManager()
VueAMap.initAMapApiLoader({
key: '44cc16e43ad7ed3358df507bd0618181',
plugin: ['AMap.Geocoder'],
uiVersion: '1.0'
})
Vue.use(VueAMap)
......@@ -190,10 +238,32 @@ export default {
isMap: true
}
],
amapManager,
zoom: 12,
// 地图中心点(初始化得有值);也是标记点
center: [121.59996, 31.197646],
amapManager,
center: [113.939723, 22.525351],
events: {
'click': (e) => {
amapManager._map.remove(marker)
marker = []
this.center = [+e.lnglat.lng, +e.lnglat.lat]
var geocoder = new AMap.Geocoder({
radius: 1000,
extensions: 'all'
})
geocoder.getAddress(this.center, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
console.dir(result)
const mar = new AMap.Marker({
position: this.center,
title: result.regeocode.formattedAddress
})
marker.push(mar)
amapManager._map.add(marker)
}
})
}
},
// 员工状态:0可用,1不可用
status: {
0: '启用',
......@@ -433,7 +503,7 @@ export default {
top: -28px;
left: 85px;
}
.amap-demo {
.amap-demo {
height: 300px;
border: 1px solid #ebeef5;
}
......@@ -452,9 +522,9 @@ export default {
background: #fafafa;
padding: 10px 20px;
}
.detail a{
.detail a {
/* color: #0000FF; */
text-decoration:underline
text-decoration: underline;
}
.detail-row {
line-height: 36px;
......@@ -465,7 +535,7 @@ export default {
height: 40px;
vertical-align: text-top;
}
.el-tabs__header{
.el-tabs__header {
background-color: #fafafa;
}
</style>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!