Browse Source

更新

dev-warehouse
zhangsiyu 2 years ago
parent
commit
62c8668fc8
  1. 2
      src/views/distribution/delivery/distributionDelivery.vue
  2. 211
      src/views/distribution/reservation/atlas.vue
  3. 17
      vite.config.js

2
src/views/distribution/delivery/distributionDelivery.vue

@ -144,7 +144,7 @@
</template> </template>
<script> <script>
import { addDelivery, getDetailDelivery, addDelivery, updateDelivery, removeDelivery } from "@/api/distribution/distributionDelivery"; import { addDelivery, getDetailDelivery, updateDelivery, removeDelivery } from "@/api/distribution/distributionDelivery";
import option from "@/option/distribution/distributionDelivery"; import option from "@/option/distribution/distributionDelivery";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";

211
src/views/distribution/reservation/atlas.vue

@ -1,134 +1,101 @@
<template> <template>
<div class="bmap" id="container" style="float: left"></div>
<div
style="
border: 1px solid pink;
margin-left: 5px;
height: 600px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
"
>
<!-- @change="handleCheckedCitiesChange"-->
<el-checkbox-group v-model="reservationIds">
<el-col v-for="(item, index) in reservationData">
<el-checkbox :label="item.id" :key="item.id"
>{{ item.consignee }}&emsp;{{ item.deliveryAddress }}&emsp;{{
item.deliveryPhone
}}</el-checkbox
>
</el-col>
</el-checkbox-group>
</div>
<div class="bmap" id="container" style="float: left"> <div style="margin-left: 40%; margin-top: 5%; float: bottom">
<el-button type="primary" icon="el-icon-circle-close" @click="aaa">确认(转配送页面)</el-button>
</div> <el-button icon="el-icon-circle-close" @click="this.$router.go(-1)"> </el-button>
<div style="border:1px solid pink ;margin-left: 5px;height: 600px;box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)" > </div>
<!-- @change="handleCheckedCitiesChange"-->
<el-checkbox-group v-model="reservationIds" >
<el-col v-for="(item,index) in reservationData">
<el-checkbox :label="item.id" :key="item.id">{{item.consignee}}&emsp;{{item.deliveryAddress}}&emsp;{{item.deliveryPhone}}</el-checkbox>
</el-col>
</el-checkbox-group>
</div>
<div style="margin-left: 40%;margin-top: 5%;float: bottom">
<el-button type="primary" icon="el-icon-circle-close" @click="aaa">确认(转配送页面)</el-button>
<el-button icon="el-icon-circle-close" @click="this.$router.go(-1)"> </el-button>
</div>
</template> </template>
<script> <script setup>
import { useStore } from 'vuex' import { useStore } from 'vuex';
import { getReservationAddr } from '@/api/distribution/distributionReservation'; import { getReservationAddr } from '@/api/distribution/distributionReservation';
import { getDictionaryBiz } from '@/api/system/dict'; import { getDictionaryBiz } from '@/api/system/dict';
// import { ref } from 'vue' import { onMounted, reactive, toRefs } from 'vue';
export default { import { useRouter } from 'vue-router';
data () { let router = useRouter();
return { let details = reactive({
name: 'BmapDemo', name: 'BmapDemo',
loading: true, loading: true,
ids: null, ids: null,
error: null, error: null,
addressList:[], addressList: [],
reservationData:[], reservationData: [],
reservationIds:[], reservationIds: [],
setup() { });
// const store = useStore() onMounted(() => {});
// let latitude = ref('') function init() {
// let longitude = ref('') let map = new BMapGL.Map('container'); //
// console.log(store.state.record.latitude) let point = new BMapGL.Point(116.404, 39.915); //
// latitude.value = store.state.record.latitude map.centerAndZoom(point, 15);
// longitude.value = store.state.record.longitude map.enableScrollWheelZoom(true);
// return { let myGeo = new BMapGL.Geocoder();
// latitude, myGeo.getPoint('四川成都', function (point) {
// longitude if (point) {
// } map.centerAndZoom(point, 16);
console.log(point);
} else {
// alert('');
console.log(point);
console.log('您选择的地址没有解析到结果!');
} }
});
}
function initMap(ids) {
if (ids.length > 1) {
ids.split(',');
} }
}, this.loading = true;
created() { getReservationAddr(ids).then(res => {
this.$watch( res.data.data.forEach(item => {
() => this.$route.params, this.ids.split(',').forEach(id => {
() => { if (item.id == id) {
this.fetchData(); this.reservationIds.push(item.id);
}, }
// });
// data observed
{ immediate: true }
)
//
this.initMap(this.ids);
},
methods:{
fetchData() {
this.error = this.post = null
this.loading = true
if (this.$route.query.id){
this.ids= this.$route.query.id;
}
},
initMap(ids){
if (ids.length>1){
ids.split(",")
}
this.loading = true;
getReservationAddr(ids).then(res=>{
res.data.data.forEach(item=>{
this.ids.split(",").forEach(id=>{
if (item.id==id){
this.reservationIds.push(item.id)
}
})
})
console.log(this.reservationIds);
this.reservationData = res.data.data;
this.addressList=res.data.data;
})
this.loading = false;
},
aaa(){
console.log(">>>>>>>>>>>",this.reservationIds);
let ids = this.reservationIds.join(",")
this.$router.push({
path: '/distribution/deliveryInfo/deliveryInfo',
query: {
id: ids
}
}); });
}, console.log(this.reservationIds);
this.reservationData = res.data.data;
},
mounted() {
let map = new BMapGL.Map("container"); // this.addressList = res.data.data;
let point = new BMapGL.Point(116.404, 39.915); // });
map.centerAndZoom(point, 15); this.loading = false;
let content = "label"; }
let label = new BMapGL.Label(content, { // function aaa() {
position: point, // console.log('>>>>>>>>>>>', this.reservationIds);
offset: new BMapGL.Size(10, 20) // let ids = this.reservationIds.join(',');
}) this.$router.push({
map.addOverlay(label); path: '/distribution/deliveryInfo/deliveryInfo',
map.addOverlay(label); // query: {
label.setStyle({ // label id: ids,
color: '#000', },
fontSize: '30px', });
border: '2px solid #1E90FF' }
})
},
}
</script> </script>
<style scoped> <style scoped>
.bmap { .bmap {
width: 800px; width: 800px;
height: 600px; height: 600px;
border: 1px solid pink; border: 1px solid pink;
} }
</style> </style>

17
vite.config.js

@ -29,5 +29,22 @@ export default ({ mode, command }) => {
}, },
}, },
plugins: createVitePlugins(env, command === 'build'), plugins: createVitePlugins(env, command === 'build'),
build: {
chunkSizeWarningLimit: 1000,
rollupOptions: {
output: {
// 分包
manualChunks(id) {
if (id.includes("node_modules")) {
return id
.toString()
.split("node_modules/")[1]
.split("/")[0]
.toString();
}
},
},
},
}
}); });
}; };

Loading…
Cancel
Save