master
271556543@qq.com 3 years ago
parent b20e63eab7
commit e2b4f7c579

@ -6,9 +6,9 @@
<div slot="content"></div> <div slot="content"></div>
<slot> <slot>
<Input placeholder="关键字搜索" v-model="selector.keyword" style="width: 200px; margin-right: 10px" /> <!-- <Input placeholder="关键字搜索" v-model="selector.keyword" style="width: 200px; margin-right: 10px" />-->
<Button style="margin-left: 10px" type="primary" @click="selector.page = 1,getCustomers()">查询</Button> <!-- <Button style="margin-left: 10px" type="primary" @click="selector.page = 1,getCustomers()">查询</Button>-->
</slot> </slot>
</lx-header> </lx-header>
</div> </div>
@ -114,7 +114,9 @@ export default {
async mounted() { async mounted() {
await this.getCustomers() await this.getCustomers()
lazyAMapApiLoaderInstance.load().then(() => { lazyAMapApiLoaderInstance.load().then(() => {
this.map = new AMap.Map('amapContainer') this.map = new AMap.Map('amapContainer',{
center:[Number(this.customers[0]?.lng || 119.58),Number(this.customers[0]?.lat || 31.47)]
})
this.markers() this.markers()
}) })
}, },

@ -17,7 +17,7 @@
style="width: 234px; margin-right: 10px" style="width: 234px; margin-right: 10px"
type="daterange" type="daterange"
@change="e => { if(e){selected.start_date = e[0];selected.end_date = e[1]}else{selected.start_date = '';selected.end_date = ''} }"></el-date-picker> @change="e => { if(e){selected.start_date = e[0];selected.end_date = e[1]}else{selected.start_date = '';selected.end_date = ''} }"></el-date-picker>
<Button style="margin-right: 10px" type="primary" @click="getList"></Button> <Button style="margin-right: 10px" type="primary" @click="search"></Button>
</div> </div>
<slot> <slot>
</slot> </slot>
@ -95,6 +95,10 @@ export default {
} }
}, },
methods: { methods: {
async search(){
await this.getList()
this.markers()
},
async getList(){ async getList(){
let res = await scheduleIndex(this.selected) let res = await scheduleIndex(this.selected)
@ -106,8 +110,6 @@ export default {
} }
}) })
console.log(this.lists) console.log(this.lists)
this.map.remove(this.marker)
this.markers()
}, },
reset(){ reset(){
@ -128,6 +130,7 @@ export default {
this.height = tableHeight ?? 600 this.height = tableHeight ?? 600
}, },
markers(){ markers(){
this.map.remove(this.marker)
this.marker = [] this.marker = []
let map = new Map([ let map = new Map([
[0,require('../../assets/status0.png')], [0,require('../../assets/status0.png')],
@ -179,10 +182,14 @@ export default {
this.initLoad() this.initLoad()
}, },
async mounted() { async mounted() {
await this.getList()
lazyAMapApiLoaderInstance.load().then(() => { lazyAMapApiLoaderInstance.load().then(() => {
this.map = new AMap.Map('amapContainer') this.map = new AMap.Map('amapContainer',{
center:[Number(this.lists[0]?.address?.lng || 119.58),Number(this.lists[0]?.address?.lat || 31.47)]
}) })
await this.getList() this.markers()
})
} }
} }
</script> </script>

Loading…
Cancel
Save