liupopo 2 years ago
parent
commit
01c72298d1
  1. 4
      .env.development
  2. 5
      .env.production
  3. 1
      package.json
  4. BIN
      public/datatemplate.xlsx
  5. BIN
      public/image/icon_local_blue.png
  6. BIN
      public/image/icon_local_red.png
  7. 50
      src/api/gd36524/gd36524.js
  8. 12
      src/api/gd36524/store.js
  9. 405
      src/views/map/index.vue
  10. 14
      vue.config.js

4
.env.development

@ -4,6 +4,4 @@ ENV = 'development'
# base api
VUE_APP_BASE_API = '/api'
## 配置测试和本地开发时的 接口地址
VUE_APP_URL = "http://127.0.0.1:7109"
##VUE_APP_URL = "http://8.130.39.13:8112"
VUE_APP_PUBLIC_PATH = "/"

5
.env.production

@ -2,7 +2,6 @@
ENV = 'production'
# base api
VUE_APP_BASE_API = '/api'
VUE_APP_BASE_API = '/gd36524api'
## 配置 正式接口地址
VUE_APP_URL = "http://120.46.131.15:8111"
VUE_APP_PUBLIC_PATH = "/map365/"

1
package.json

@ -18,6 +18,7 @@
"axios": "^0.24.0",
"bpmn-js": "^9.2.2",
"core-js": "3.25.3",
"echarts": "^5.4.3",
"ejs": "^2.7.4",
"element-ui": "2.15.4",
"js-cookie": "3.0.1",

BIN
public/datatemplate.xlsx

Binary file not shown.

BIN
public/image/icon_local_blue.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
public/image/icon_local_red.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

50
src/api/gd36524/gd36524.js

@ -1,50 +0,0 @@
import request from '@/utils/request'
export default {
addInfo: function(data) {
return request({
baseURL: "/api/crm",
url: '/v1/loanbankinformation/save',
method: 'post',
data: data
});
},
fetchBySid: function(sid) {
return request({
baseURL: '/api/crm',
url: '/v1/loanbankinformation/getBankInfBySid/' + sid
})
},
updateData: function(data) {
return request({
baseURL: "/api/crm",
url: '/v1/loanbankinformation/update',
method: 'post',
data: data
});
},
delBySids: function(sid) {
return request({
baseURL: '/api/crm',
url: 'v1/loanbankinformation/delete/' + sid,
method: 'delete'
})
},
// 查询分页列表
listPage: function(params) {
return request({
baseURL: '/api/crm',
url: '/v1/loanbankinformation/listPage',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
}

12
src/api/gd36524/store.js

@ -0,0 +1,12 @@
import request from '@/utils/request'
export default {
list: function(data) {
return request({
url: '/store/list',
method: 'post',
data: data
});
}
}

405
src/views/map/index.vue

@ -1,7 +1,6 @@
<template>
<div class="app-container">
<el-amap ref="map" :center="center" :zoom="zoom" @init="initMap" @click="clickMap">
<el-amap ref="map" :center="center" :zoom="zoom">
<el-amap-control-map-type :visible="controlVisible" />
<el-amap-marker
v-for="(marker, index) in markers"
@ -14,138 +13,311 @@
/>
</el-amap>
<div class="toolbar">
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span>当前门店信息</span>
</div>
<div>
{{ stinfo }}
</div>
</el-card>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span>门店列表</span>
<el-button style="float: right; padding: 3px 0" type="text">更新门店数据</el-button>
</div>
<el-collapse v-model="activeNames">
<el-collapse-item name="info">
<template slot="title">
<i class="el-icon-s-shop" /> 当前选中门店信息
</template>
<el-descriptions :column="1" size="mini" border>
<el-descriptions-item :label-style="{'width': '70px'}" label="序号">{{ currentStore.serNumber }}</el-descriptions-item>
<el-descriptions-item label="门店名称">{{ currentStore.name }}</el-descriptions-item>
<el-descriptions-item label="门店地址">{{ currentStore.address }}</el-descriptions-item>
<el-descriptions-item label="门店面积">{{ currentStore.area }}</el-descriptions-item>
<el-descriptions-item label="是否尽调">{{ currentStore.dueDiligence }}</el-descriptions-item>
</el-descriptions>
</el-collapse-item>
<el-collapse-item title="" name="list">
<template slot="title">
<i class="el-icon-s-grid" /> 门店列表<el-button style="margin-left: 20px;padding: 3px 0" type="text" @click.stop="showUploadXlsx">更新门店数据</el-button>
</template>
<el-form ref="form" :model="queryParams" label-width="70px" size="mini">
<el-form-item label="门店名称">
<el-input v-model="queryParams.name" clearable @clear="dosearch">
<el-button slot="append" icon="el-icon-search" @click="dosearch" />
</el-input>
</el-form-item>
<el-form-item label="是否尽调">
<el-radio-group v-model="queryParams.jindiao" @input="dosearch">
<el-radio label="全部" />
<el-radio label="是" />
<el-radio label="否" />
</el-radio-group>
</el-form-item>
<el-form-item label="营业面积">
<el-input v-model="queryParams.areaStar" clearable @clear="dosearch">
<template slot="prepend">大于等于</template>
</el-input>
<el-input v-model="queryParams.areaEnd" clearable @clear="dosearch">
<template slot="prepend">小于等于</template>
<el-button slot="append" icon="el-icon-search" @click="dosearch" />
</el-input>
</el-form-item>
</el-form>
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%;margin-top: 10px;" max-height="400">
<el-table-column prop="name" label="门店名称" align="center" />
<el-table-column prop="dueDiligence" label="是否尽调" align="center" width="90" />
</el-table>
</el-collapse-item>
</el-collapse>
</div>
<div class="chartsa">
<el-collapse v-model="activeNamesChart">
<el-collapse-item name="pie">
<template slot="title">
<i class="el-icon-pie-chart" /> 尽调比例
</template>
<div ref="charta" style="height:240px;width: 100%;" />
</el-collapse-item>
</el-collapse>
</div>
<el-dialog title="上传《门店信息.xlsx》" :visible.sync="uploadDialogVisible" width="40%" :before-close="dialogClose">
<el-card class="box-card">
<div>
{{ stinfo }}
<el-upload
ref="upload"
class="upload-demo"
:action="updateAction"
:on-progress="handleProgress"
:on-success="handleSuccess"
:file-list="fileList"
:auto-upload="false"
:multiple="false"
:limit="1"
>
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
<div slot="tip" class="el-upload__tip">上传 门店信息.xlsx文件文件中数据格式需要按照 <el-button type="text" @click="downtemplate">模板Excel文件</el-button> 中填写可以点击<el-button
size="mini"
type="warning"
>下载模板Excel文件</el-button> </div>
</el-upload>
</div>
<el-card class="box-card" shadow="never">
<el-descriptions title="文件上传结果" :column="1">
<el-descriptions-item label="上传文件名">{{ uploadVo.fileName }}</el-descriptions-item>
<el-descriptions-item label="上传开始时间">{{ uploadVo.starTime }}</el-descriptions-item>
<el-descriptions-item label="上传用时">{{ uploadVo.useTime }}</el-descriptions-item>
<el-descriptions-item label="总记录数">{{ uploadVo.numberAll }}</el-descriptions-item>
<el-descriptions-item label="已尽调数">{{ uploadVo.numberTure }}</el-descriptions-item>
<el-descriptions-item label="未尽调数">{{ uploadVo.numberFalse }}</el-descriptions-item>
<el-descriptions-item label="未知状态数">{{ uploadVo.numberOther }}</el-descriptions-item>
<el-descriptions-item v-show="uploadVo.errInfo" label="异常信息">{{ uploadVo.errInfo }}</el-descriptions-item>
</el-descriptions>
</el-card>
</el-card>
</div>
<div slot="footer">
<el-button type="primary" plain style="margin-right: 50px;" @click="dialogClose">关闭</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import * as echarts from 'echarts'
import req from '@/api/gd36524/store'
export default {
name: 'MapVueAMap',
data() {
return {
controlVisible: true,
stinfo: '',
zoom: 13,
center: [114.490788, 38.033577],
markers: [{
position: ['114.319127', '38.12222'],
id: 1,
icon: 'https://supervise.yxtsoft.com/img/base/ic_ar.png',
content: 'abc',
title: '测xxx',
label: {
content: 'aaa',
offset: [1, 1]
}
}, {
position: [114.618504, 38.063857],
id: 2,
content: 'abc',
title: '测试caaa',
icon: 'https://a.amap.com/jsapi_demos/static/demo-center/icons/dir-via-marker.png',
label: {
content: 'bbb',
offset: [1, 1]
}
}, {
position: [114.515507, 37.976225],
id: 3,
content: 'abc',
title: '测试content',
label: {
direction: 'bottom',
offset: [0, 5], //
content: "<div class='info'>我是 marker 的 label 标签</div>" //
}
}],
charta: null,
notChartData: true,
activeNames: ['info', 'list'],
activeNamesChart: ['pie'],
mapicon: {
red: process.env.VUE_APP_PUBLIC_PATH + 'image/icon_local_red.png',
blue: process.env.VUE_APP_PUBLIC_PATH + 'image/icon_local_blue.png'
},
tplpath: process.env.VUE_APP_PUBLIC_PATH + 'datatemplate.xlsx',
uploadDialogVisible: false,
uploadVo: {
fileName: '',
starTime: '',
useTime: '',
numberAll: '',
numberTure: '',
numberFalse: '',
numberOther: '',
errInfo: ''
},
updateAction: process.env.VUE_APP_BASE_API + '/store/uploadData',
fullscreenloading: null,
fileList: [],
table: false,
dialog: false,
loading: false,
gridData: [{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}],
form: {
queryParams: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
areaStar: '',
areaEnd: '',
jindiao: '全部'
},
formLabelWidth: '80px',
timer: null
dataList: [],
tableLoading: false,
controlVisible: false,
zoom: 13,
center: [114.490788, 38.033577],
markers: [],
currentStore: {
serNumber: '',
name: '',
address: '',
area: '',
dueDiligence: ''
}
}
},
created() {
this.loadList()
},
mounted() {
// this.$nextTick(() => {
// this.initCharta()
// })
},
beforeDestroy() {
if (this.charta) {
this.charta.dispose()
this.charta = null
}
},
methods: {
getMap() {
console.log(this.$refs.map.$$getInstance())
initCharta(listdata) {
this.notChartData = false
var x = 0
var y = 0
for (var i in listdata) {
if (listdata[i].dueDiligence === '是') { x++ } else { y++ }
}
const _dataX = []
_dataX.push({
value: x,
name: '已尽调'
})
_dataX.push({
value: y,
name: '未尽调'
})
this.charta = echarts.init(this.$refs.charta)
this.charta.setOption({
tooltip: {
trigger: 'item'
},
legend: {
orient: 'vertical',
left: 'left'
},
series: [{
name: '门店数量',
type: 'pie',
radius: '50%',
data: _dataX
}]
})
},
clickMap(e) {
console.log('click map :', e)
loadList() {
req.list(this.queryParams).then(res => {
this.dataList = res.data
this.resetMarkers()
if (this.notChartData) {
this.initCharta(res.data)
}
}).catch(e => {
console.log('GdinventoryLog-loadList-ee:', e)
})
},
initMap(e) {
console.log('init map: ', e)
dosearch() {
this.loadList()
},
clickArrayMarker(marker) {
this.stinfo = marker.title
resetQuery() {
this.queryParams = {
name: '',
areaStar: '',
areaEnd: '',
jindiao: '全部'
}
this.loadList()
},
handleClose(done) {
if (this.loading) {
return
resetMarkers() {
this.markers = []
for (var i in this.dataList) {
const d = this.dataList[i]
let nicon = this.mapicon.blue
if (d.dueDiligence === '是') {
nicon = this.mapicon.red
}
const newMarker = {
id: d.sid,
position: [d.lng, d.lat],
title: d.name,
icon: nicon,
label: {
direction: 'bottom',
offset: [0, 5], //
content: "<div class='info'>" + d.name + '</div>' //
}
}
this.markers.push(newMarker)
}
},
showUploadXlsx() {
this.uploadDialogVisible = true
},
downtemplate() {
window.open(this.tplpath, '_blank')
},
submitUpload() {
this.$refs.upload.submit()
},
handleProgress(event, file, fileList) {
const _this = this
this.fullscreenloading = this.$loading({
lock: true,
text: '文件正在上传',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
console.log('111', event.percent)
if (event.percent >= 100) {
_this.fullscreenloading.text = '上传完成,正在导入数据库'
}
this.$confirm('确定要提交表单吗?')
.then(_ => {
this.loading = true
this.timer = setTimeout(() => {
done()
//
setTimeout(() => {
this.loading = false
}, 400)
}, 2000)
})
.catch(_ => {})
},
cancelForm() {
this.loading = false
this.dialog = false
clearTimeout(this.timer)
handleSuccess(resp, file, fileList) {
console.log('222', resp)
const _this = this
if (this.fullscreenloading) this.fullscreenloading.close()
this.fullscreenloading = null
_this.uploadVo = resp.data
_this.notChartData = true
_this.loadList()
setTimeout(function() {
_this.dialogClose()
}, 3000)
},
dialogClose() {
this.uploadVo = {
fileName: '',
starTime: '',
useTime: '',
numberAll: '',
numberTure: '',
numberFalse: '',
numberOther: '',
errInfo: ''
}
if (this.fullscreenloading) this.fullscreenloading.close()
this.fullscreenloading = null
this.fileList = []
this.uploadDialogVisible = false
},
clickArrayMarker(marker) {
for (var i in this.dataList) {
if (marker.id === this.dataList[i].sid) {
this.currentStore = this.dataList[i]
break
}
}
}
}
}
@ -176,8 +348,19 @@
min-width: 0;
}
.storelabel {
width: 80px
}
.amap-icon img {
width: 25px;
height: 34px;
}
.chartsa {
position: absolute;
top: 20px;
right: 15px;
width: 300px;
}
</style>

14
vue.config.js

@ -24,7 +24,7 @@ module.exports = {
*在大多数情况下请使用/
*详细信息https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/', //process.env.NODE_ENV === 'production' ? '/gd36524-ui/' : '/',
publicPath: process.env.NODE_ENV === 'production' ? '/map365/' : '/',
outputDir: 'gd36524-ui',
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development',
@ -40,20 +40,12 @@ module.exports = {
},
proxy: {
'/api': { // 匹配所有以 '/api'开头的请求路径
// target: 'http://192.168.1.109:8111',
target: process.env.VUE_APP_URL, // 代理目标的基础路径
target: 'http://127.0.0.1:7104',
// target: process.env.VUE_APP_URL, // 代理目标的基础路径
changeOrigin: true, // 支持跨域
pathRewrite: { // 重写路径: 去掉路径中开头的'/api'
'^/api': ''
}
},
'/upload': { // 匹配所有以 '/api'开头的请求路径
// target: 'http://120.46.131.15:8111',
target: process.env.VUE_APP_URL, // 代理目标的基础路径
changeOrigin: true, // 支持跨域
pathRewrite: { // 重写路径: 去掉路径中开头的'/api'
'^/upload': ''
}
}
},
disableHostCheck: true

Loading…
Cancel
Save