Commit 9dbc49a4 authored by 郭铭瑶's avatar 郭铭瑶 🤘

移除不需要的js文件

parent 3b55a61e
......@@ -5,11 +5,13 @@ import Vue from 'vue'
import App from './App'
import router from './router'
import common from './util/common'
import api from './util/api'
import {Icon, Button, Collapse, Panel, Modal, Table} from 'view-design'
import 'view-design/dist/styles/iview.css'
Vue.config.productionTip = false
Vue.prototype.$com = common
Vue.prototype.$api = api
Vue.component('Button', Button)
Vue.component('Icon', Icon)
Vue.component('Collapse', Collapse)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
let BASE_URL = ''
switch (process.env.NODE_ENV) {
case 'production':
BASE_URL = 'http://211.136.105.193/elev/static/'
break
default:
BASE_URL = 'http://localhost:8081/static/'
};
export default {
BASE_URL,
}
<template>
<div id="container">
<template v-if="curStreetData.name && curStreet">
<Collapse v-model="curStreet" @on-change="handleSelect" class="menu" accordion>
<Collapse :value="[curStreet]" @on-change="handleSelect" class="menu" accordion>
<Panel v-for="street in streetList" :key="street" :name="street">
{{curStreetData.name}}小区列表
<div slot="content" class="community-list">
......@@ -249,6 +249,10 @@ export default {
zhuqiao: '祝桥',
},
curStreetData: {},
buildingData: {
community: [],
building: [],
},
}
},
mounted() {
......@@ -277,7 +281,8 @@ export default {
this.streetList = [result]
this.$nextTick(() => { // 为了展开默认街镇小区列表
this.curStreet = result
this.handleSelect([this.curStreet])
// this.handleSelect([this.curStreet])
this.initStreetAndBuilding()
})
} else {
this.streetList = streets
......@@ -290,6 +295,7 @@ export default {
},
handleDetail({name}) {
if (!this.buildingData) return
this.detailData = this.buildingData.building.filter(item => {
const buildingName = item.name && (item.name + '').replace('(补)', '').replace('(补)', '')
return buildingName.indexOf(name) >= 0 || (item.buildingNo + '').indexOf(name) >= 0
......@@ -297,18 +303,28 @@ export default {
this.detailModal = true
},
handleSelect(key) {
if (!key || key.length <= 0) return
const streetData = require(`@/mock/${key[0]}.js`).default
// if (!key || key.length <= 0) return
// const streetData = require(`@/mock/${key[0]}.js`).default
// this.curStreetData = streetData
// this.map.setZoomAndCenter(15, streetData.location)
// if (this.curStreetPolygon) {
// // this.map.remove(this.curStreetPolygon) // 移除之前的街镇区域底色
// this.map.clearMap()
// }
// this.initLayers(key)
// this.highlightArea(streetData)
},
initStreetAndBuilding() {
const streetData = require(`@/mock/${this.curStreet}.js`).default
this.curStreetData = streetData
this.map.setZoomAndCenter(15, streetData.location)
if (this.curStreetPolygon) {
// this.map.remove(this.curStreetPolygon) // 移除之前的街镇区域底色
this.map.clearMap()
}
this.initLayers(key)
this.highlightArea(streetData)
// this.initLayers(key)
},
initLayers(street = null) { // 添加基础图层和建筑物图层
initLayers() { // 添加基础图层和建筑物图层
// const keys = Object.keys(this.areaList)
// if (keys.length <= 0) return
// const communityList = []
......@@ -360,6 +376,10 @@ export default {
buildingLayer
])
// this.buildingData.community.forEach(item => {
// this.addPrism(item.path)
// })
// 框起的建筑物区域底板颜色(不写则无底色,不影响建筑颜色)
// new AMap.Polygon({
// bubble:false,
......@@ -380,6 +400,17 @@ export default {
// map:this.map
// })
},
addPrism(paths, height = 300, color = 'rgba(100,150,230,0.7)') {
const object3d = new AMap.Object3DLayer()
this.map.add(object3d)
const prism = new AMap.Object3D.Prism({
path: paths.map(path => new AMap.LngLat(path[0], path[1])),
height,
color,
})
prism.transparent = true
object3d.add(prism)
},
addController() { // 添加地图控制器
this.map.addControl(new AMap.ControlBar({
showZoomBar:false,
......@@ -641,9 +672,20 @@ export default {
tableHeight() {
return screen.height / 2
},
buildingData() {
const data = require(`@/mock/${this.curStreet}-building.js`)
return (data && data.default) || null
// buildingData() {
// const data = require(`@/mock/${this.curStreet}-building.js`)
// return (data && data.default) || null
// }
},
watch: {
async curStreet(cur) {
if (!cur) return
const {data} = await axios.get(`${this.$api.BASE_URL}/mock/${cur}-building.json`)
this.buildingData = data || {
community: [],
building: [],
}
this.initLayers()
}
}
}
......
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