站点接口联调
This commit is contained in:
parent
835f637aad
commit
bc5c786c18
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<scroll-view class="divForm" :style="{height}" scroll-y show-scrollbar>
|
<scroll-view class="divForm" :style="{height}" scroll-y show-scrollbar>
|
||||||
<uni-forms ref="formRef" :model="formData" :label-width="100">
|
<uni-forms ref="formRef" :model="formData" :label-width="80">
|
||||||
<uni-forms-item label="站点名称" name="name" required :rules="[{'required': true,errorMessage: '请填写站点名称'}]">
|
<uni-forms-item label="站点名称" name="name" required :rules="[{'required': true,errorMessage: '请填写站点名称'}]">
|
||||||
<uni-easyinput v-model="formData.name" />
|
<uni-easyinput v-model="formData.name" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<uni-data-checkbox v-model="formData.zdjb" :localdata="arrZDJB" />
|
<uni-data-checkbox v-model="formData.zdjb" :localdata="arrZDJB" />
|
||||||
</div>
|
</div>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<!-- <uni-forms-item label="调度投放:" name="ddtf" required :rules="[{'required': true,errorMessage: '请选择调度投放'}]">
|
<!-- <uni-forms-item label="调度投放:" name="ddtf" required :rules="[{'required': true,errorMessage: '请选择调度投放'}]">
|
||||||
<div class="divRow">
|
<div class="divRow">
|
||||||
<uni-data-checkbox v-model="formData.ddtf" :localdata="arrDDTF" />
|
<uni-data-checkbox v-model="formData.ddtf" :localdata="arrDDTF" />
|
||||||
</div>
|
</div>
|
||||||
@ -38,7 +38,7 @@
|
|||||||
<label>辆</label>
|
<label>辆</label>
|
||||||
</div>
|
</div>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="还车半径:" >
|
<uni-forms-item label="还车半径:">
|
||||||
<div class="divRow">
|
<div class="divRow">
|
||||||
<uni-easyinput v-model="formData.hcbj" />
|
<uni-easyinput v-model="formData.hcbj" />
|
||||||
<label>米</label>
|
<label>米</label>
|
||||||
@ -61,8 +61,9 @@
|
|||||||
</scroll-view>
|
</scroll-view>
|
||||||
<div class="divBottom">
|
<div class="divBottom">
|
||||||
<div class="b-btn-white divtBtn" v-if="opentype=='edit'" @click="openMap">重新绘制</div>
|
<div class="b-btn-white divtBtn" v-if="opentype=='edit'" @click="openMap">重新绘制</div>
|
||||||
<div class="b-btn-white divtBtn" v-if="opentype=='add'" @click="openMap">返回绘制</div>
|
<div class="b-btn-white divtBtn" v-if="opentype=='add'" @click="openMap">返回绘制</div>
|
||||||
<div class="b-btn-blue divtBtn" style="margin-left: 10px;" @click="SaveData">确认{{opentype=='add'?"新建":"保存"}}</div>
|
<div class="b-btn-blue divtBtn" style="margin-left: 10px;" @click="SaveData">确认{{opentype=='add'?"新建":"保存"}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -79,6 +80,9 @@
|
|||||||
} from "vue";
|
} from "vue";
|
||||||
import * as map from "@/utils/map.js";
|
import * as map from "@/utils/map.js";
|
||||||
import QQMapWX from "@/utils/qqmap-wx-jssdk.js";
|
import QQMapWX from "@/utils/qqmap-wx-jssdk.js";
|
||||||
|
import {
|
||||||
|
callOperateApi
|
||||||
|
} from "../../../utils/api";
|
||||||
|
|
||||||
var qqmapsdk = new QQMapWX({
|
var qqmapsdk = new QQMapWX({
|
||||||
key: map.sdkKey
|
key: map.sdkKey
|
||||||
@ -136,14 +140,16 @@
|
|||||||
|
|
||||||
let arrPoint = [];
|
let arrPoint = [];
|
||||||
let radius = null;
|
let radius = null;
|
||||||
|
let regionid = null;
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
name: "站点名称",
|
name: "站点名称",
|
||||||
|
address: "",
|
||||||
zdlx: 1,
|
zdlx: 1,
|
||||||
zdjb: 1,
|
zdjb: 1,
|
||||||
ktcl: 10,
|
ktcl: 10,
|
||||||
zdkt: 20,
|
zdkt: 20,
|
||||||
hcbj: 10,
|
hcbj: 10,
|
||||||
zdms: "站点描述",
|
zdms: "",
|
||||||
zdbq: [1],
|
zdbq: [1],
|
||||||
zdtf: 1,
|
zdtf: 1,
|
||||||
zdxs: 1
|
zdxs: 1
|
||||||
@ -158,7 +164,8 @@
|
|||||||
if (type == "edit") {
|
if (type == "edit") {
|
||||||
const id = formData.value.id;
|
const id = formData.value.id;
|
||||||
//const points = JSON.stringify(arrPoint);
|
//const points = JSON.stringify(arrPoint);
|
||||||
const points='[{"latitude":30.571833529690217,"longitude":104.06370857334673},{"latitude":30.571476489584985,"longitude":104.06382896516845},{"latitude":30.571211588676054,"longitude":104.0681363214153},{"latitude":30.571845047283958,"longitude":104.06805606033697},{"latitude":30.571833529690217,"longitude":104.06370857334673}]';
|
const points =
|
||||||
|
'[{"latitude":30.571833529690217,"longitude":104.06370857334673},{"latitude":30.571476489584985,"longitude":104.06382896516845},{"latitude":30.571211588676054,"longitude":104.0681363214153},{"latitude":30.571845047283958,"longitude":104.06805606033697},{"latitude":30.571833529690217,"longitude":104.06370857334673}]';
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/map/map-bikesite?type=edit&id=${id}&points=${points}&k=${Date.now()}`
|
url: `/pages/map/map-bikesite?type=edit&id=${id}&points=${points}&k=${Date.now()}`
|
||||||
})
|
})
|
||||||
@ -166,10 +173,91 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function SaveData() {
|
function SaveData() {
|
||||||
formRef.value.validate().then(res=>{
|
formRef.value.validate().then(res => {
|
||||||
console.log("66666666666666666666666666666",res);
|
console.log("66666666666666666666666666666", res, arrPoint, regionid, opentype.value,formData.value);
|
||||||
}).catch(res=>{
|
const {
|
||||||
console.log("7777777777777777777777",res);
|
name,
|
||||||
|
zdlx,
|
||||||
|
zdjb,
|
||||||
|
ktcl,
|
||||||
|
zdkt,
|
||||||
|
address
|
||||||
|
} = res;
|
||||||
|
let shapeType = 2;
|
||||||
|
let points = null;
|
||||||
|
let siteLng = null;
|
||||||
|
let siteLat = null;
|
||||||
|
let r = null;
|
||||||
|
if (arrPoint.length == 1) {
|
||||||
|
shapeType = 1;
|
||||||
|
siteLng = arrPoint[0].longitude;
|
||||||
|
siteLat = arrPoint[0].latitude;
|
||||||
|
r = radius;
|
||||||
|
} else {
|
||||||
|
points = arrPoint;
|
||||||
|
}
|
||||||
|
const params = {
|
||||||
|
operationRegionId: regionid,
|
||||||
|
siteName: name,
|
||||||
|
siteAdress: address,
|
||||||
|
siteType: zdlx,
|
||||||
|
siteLevel: zdjb,
|
||||||
|
allowedParkingNum: ktcl,
|
||||||
|
allowedParkingMax: zdkt,
|
||||||
|
radius: r,
|
||||||
|
shapeType,
|
||||||
|
points,
|
||||||
|
siteLng,
|
||||||
|
siteLat
|
||||||
|
}
|
||||||
|
callOperateApi("ebikeRegion/saveSite", params, "post").then(res => {
|
||||||
|
console.log("1111111111111111111", "/ebikeRegion/saveSite", params,res);
|
||||||
|
const {
|
||||||
|
code,
|
||||||
|
data,
|
||||||
|
message
|
||||||
|
} = res;
|
||||||
|
if (code != 200) {
|
||||||
|
showModelMessage(message);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
showModelMessage("保存成功!");
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/devops/bikesite/bikesite-list"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// {
|
||||||
|
// "siteRegionId": 0,
|
||||||
|
// "operationRegionId": 0,
|
||||||
|
// "siteName": "string",
|
||||||
|
// "siteAdress": "string",
|
||||||
|
// "siteType": 0,
|
||||||
|
// "siteLevel": 0,
|
||||||
|
// "siteLng": 0,
|
||||||
|
// "siteLat": 0,
|
||||||
|
// "shapeType": 0,
|
||||||
|
// "radius": 0,
|
||||||
|
// "allowedParkingNum": 0,
|
||||||
|
// "allowedParkingMax": 0,
|
||||||
|
// "points": [
|
||||||
|
// {
|
||||||
|
// "longitude": 0,
|
||||||
|
// "latitude": 0
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "longitude": 0,
|
||||||
|
// "latitude": 0
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "longitude": 0,
|
||||||
|
// "latitude": 0
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
|
||||||
|
}).catch(res => {
|
||||||
|
console.log("7777777777777777777777", res);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,10 +269,12 @@
|
|||||||
id,
|
id,
|
||||||
points,
|
points,
|
||||||
radius: r,
|
radius: r,
|
||||||
type
|
type,
|
||||||
|
regionid: rid
|
||||||
} = options;
|
} = options;
|
||||||
console.log("111111111111111111111",options)
|
console.log("111111111111111111111", options)
|
||||||
opentype.value = type;
|
opentype.value = type;
|
||||||
|
regionid = rid;
|
||||||
|
|
||||||
let title = "";
|
let title = "";
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -210,13 +300,18 @@
|
|||||||
} = arrPoint[0];
|
} = arrPoint[0];
|
||||||
if (type == "add") {
|
if (type == "add") {
|
||||||
map.reverseGeocoder(qqmapsdk, longitude, latitude, (res) => {
|
map.reverseGeocoder(qqmapsdk, longitude, latitude, (res) => {
|
||||||
console.log("3333333333333","reverseGeocoder",longitude, latitude,res)
|
console.log("3333333333333", "reverseGeocoder", longitude, latitude, res)
|
||||||
const {
|
const {
|
||||||
|
address,
|
||||||
formatted_addresses: {
|
formatted_addresses: {
|
||||||
recommend
|
recommend
|
||||||
}
|
}
|
||||||
} = res;
|
} = res;
|
||||||
formData.value.name = recommend;
|
formData.value = {
|
||||||
|
...formData.value,
|
||||||
|
name: recommend,
|
||||||
|
address
|
||||||
|
}
|
||||||
}, (res) => {
|
}, (res) => {
|
||||||
console.log("fail", res);
|
console.log("fail", res);
|
||||||
})
|
})
|
||||||
@ -229,7 +324,7 @@
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.divForm {
|
.divForm {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
padding: 10px 10px;
|
padding: 10px 20px 10px 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* .divForm /deep/ .uni-forms-item {
|
/* .divForm /deep/ .uni-forms-item {
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
.divSearch {
|
.divSearch {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 10px 15px 0px 15px;
|
padding: 10px 15px 10px 15px;
|
||||||
|
background: rgb(128 128 128 / 8%);
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divSearchTab {
|
.divSearchTab {
|
||||||
@ -24,6 +26,10 @@
|
|||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.divTool {
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -62,4 +68,10 @@
|
|||||||
.divListItemValue {
|
.divListItemValue {
|
||||||
color: #606266;
|
color: #606266;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divNoData {
|
||||||
|
color: gray;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 40px;
|
||||||
}
|
}
|
||||||
@ -32,14 +32,14 @@
|
|||||||
<div class="divListItemSite">
|
<div class="divListItemSite">
|
||||||
{{item.zdmc}}
|
{{item.zdmc}}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="divTool">
|
||||||
<label style="padding-left: 10px;" @click="editSite(item)">
|
<label style="padding-left: 10px;" @click="editSite(item)">
|
||||||
<uni-icons custom-prefix="iconfont" type="icon-ebikebianji" color="rgb(121 116 116)"
|
<uni-icons custom-prefix="iconfont" type="icon-ebikebianji" color="rgb(121 116 116)"
|
||||||
size="20" />
|
size="20" />
|
||||||
</label>
|
</label>
|
||||||
<label style="padding-left: 10px;" @click="delSite(item)">
|
<label style="padding-left: 10px;" @click="delSite(item)">
|
||||||
<uni-icons custom-prefix="iconfont" type="icon-ebikeshanchu" color="rgb(121 116 116)"
|
<uni-icons custom-prefix="iconfont" type="icon-ebikeshanchu" color="rgb(121 116 116)"
|
||||||
size="20" />
|
size="20" />
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -68,9 +68,12 @@
|
|||||||
<div class="divListItemValue">{{item.cjr}}</div>
|
<div class="divListItemValue">{{item.cjr}}</div>
|
||||||
</div>
|
</div>
|
||||||
</uni-card>
|
</uni-card>
|
||||||
|
<div v-if="arrData.length==0" class="divNoData">
|
||||||
|
暂无数据
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="position:absolute;bottom:30px;right: 15px;" @click="addSite">
|
<div style="position:absolute;bottom:30px;right: 15px;" @click="addSite">
|
||||||
<uni-icons type="plus" color="#7a6d6d" size="40" />
|
<uni-icons type="plus" color="#7a6d6d" size="40" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -78,13 +81,22 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
ref
|
ref,
|
||||||
|
onUnmounted
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import {
|
import {
|
||||||
showModelMessage
|
showModelMessage
|
||||||
} from "@/utils/tools.js";
|
} from "@/utils/tools.js";
|
||||||
import {useSelarea} from "@/stores/selarea.js";
|
import {
|
||||||
import {onShow} from "@dcloudio/uni-app";
|
useSelarea
|
||||||
|
} from "@/stores/selarea.js";
|
||||||
|
import {
|
||||||
|
onShow
|
||||||
|
} from "@dcloudio/uni-app";
|
||||||
|
import {
|
||||||
|
callOperateApi
|
||||||
|
} from '../../../utils/api';
|
||||||
|
import { cloneDeep } from 'lodash';
|
||||||
|
|
||||||
const arrSearch = ["实时车辆", "借车订单量", "还车订单量"]
|
const arrSearch = ["实时车辆", "借车订单量", "还车订单量"]
|
||||||
const iconColor = " #BDBDBD";
|
const iconColor = " #BDBDBD";
|
||||||
@ -92,31 +104,7 @@
|
|||||||
const searchIndex = ref(null);
|
const searchIndex = ref(null);
|
||||||
const searchType = ref("");
|
const searchType = ref("");
|
||||||
//数据
|
//数据
|
||||||
const arrData = ref([{
|
const arrData = ref([]);
|
||||||
id:"1111",
|
|
||||||
zdlx: "停", //站点类型
|
|
||||||
zdmc: "簇锦街道武兴四路武侯区人民政府政务服务中心", //站点名称
|
|
||||||
zdjb: "1级", //站点级别
|
|
||||||
cjsj: "2025-03-12 19:16:03", //创建时间
|
|
||||||
clsl1: 0, //车辆数量
|
|
||||||
clsl2: 10, //限制车辆数量
|
|
||||||
zcsl: 0, //租车数量
|
|
||||||
hcsl: 0, //还车数量
|
|
||||||
cjdd: "四川省成都市武侯区簇锦街道武兴四路武侯区人民政府政务服务中心", //创建地点
|
|
||||||
cjr: "创建人" //创建人
|
|
||||||
}, {
|
|
||||||
id:"22222222222",
|
|
||||||
zdlx: "停", //站点类型
|
|
||||||
zdmc: "簇锦街道武兴四路武侯区人民政府政务服务中心", //站点名称
|
|
||||||
zdjb: "1级", //站点级别
|
|
||||||
cjsj: "2025-03-12 19:16:03", //创建时间
|
|
||||||
clsl1: 0, //车辆数量
|
|
||||||
clsl2: 10, //限制车辆数量
|
|
||||||
zcsl: 0, //租车数量
|
|
||||||
hcsl: 0, //还车数量
|
|
||||||
cjdd: "四川省成都市武侯区簇锦街道武兴四路武侯区人民政府政务服务中心", //创建地点
|
|
||||||
cjr: "创建人" //创建人
|
|
||||||
}]);
|
|
||||||
|
|
||||||
const showBtn = ref(false); //显示按钮
|
const showBtn = ref(false); //显示按钮
|
||||||
const btnContent = [{
|
const btnContent = [{
|
||||||
@ -126,8 +114,14 @@
|
|||||||
text: '删除',
|
text: '删除',
|
||||||
active: false
|
active: false
|
||||||
}];
|
}];
|
||||||
const selAreaStore=useSelarea();
|
const selAreaStore = useSelarea();
|
||||||
console.log("555555555555555555555555","行政区划",selAreaStore.value);
|
let zoneId = null;
|
||||||
|
let pageNum = 1;
|
||||||
|
let pageSize = 10;
|
||||||
|
let selData=null;
|
||||||
|
let loadType="";
|
||||||
|
let siteName = ""; //查询条件
|
||||||
|
|
||||||
function search(e) {
|
function search(e) {
|
||||||
console.log("111111111111111", e);
|
console.log("111111111111111", e);
|
||||||
}
|
}
|
||||||
@ -135,44 +129,130 @@
|
|||||||
//排序
|
//排序
|
||||||
function changerOrder(index) {
|
function changerOrder(index) {
|
||||||
showModelMessage("该功能暂未实现!");
|
showModelMessage("该功能暂未实现!");
|
||||||
if (searchIndex.value == index&&searchType.value=="up") {
|
if (searchIndex.value == index && searchType.value == "up") {
|
||||||
searchType.value = "down";
|
searchType.value = "down";
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
searchType.value = "up";
|
searchType.value = "up";
|
||||||
}
|
}
|
||||||
searchIndex.value=index;
|
searchIndex.value = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
function openMap(){
|
function openMap() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:"/pages/map/map-bikesite?type=view"
|
url: "/pages/map/map-bikesite?type=view"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//添加站点
|
//添加站点
|
||||||
function addSite() {
|
function addSite() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:"/pages/map/map-bikesite?type=add&k="+Date.now()
|
url: "/pages/map/map-bikesite?type=add&k=" + Date.now()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//编辑
|
//编辑
|
||||||
function editSite(data) {
|
function editSite(data) {
|
||||||
const{id,radius}=data;
|
const {
|
||||||
uni.navigateTo({
|
id,
|
||||||
url:`/pages/devops/bikesite/bikesite-info?type=edit&id=${id}&k=${Date.now()}`
|
radius
|
||||||
|
} = data;
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/devops/bikesite/bikesite-info?type=edit&id=${id}&k=${Date.now()}`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function delSite() {
|
function delSite(data) {
|
||||||
showModelMessage("该功能暂未实现!");
|
console.log("0000000000000",data);
|
||||||
|
const{id,pageNum:pn,index}=data;
|
||||||
|
const params={
|
||||||
|
ids:[id]
|
||||||
|
}
|
||||||
|
callOperateApi("ebikeRegion/delSite",params,"post").then(res=>{
|
||||||
|
console.log("11111111111111111111111", "ebikeRegion/delSite", res);
|
||||||
|
const {
|
||||||
|
code,
|
||||||
|
data,
|
||||||
|
message
|
||||||
|
} = res;
|
||||||
|
if (code != 200) {
|
||||||
|
console.log("ebikeRegion/delSite错误", message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
selData=data;
|
||||||
|
loadType="del";
|
||||||
|
loadData(pn);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onShow(()=>{
|
function loadData(pn,callbak) {
|
||||||
|
const params = {
|
||||||
|
zoneId,
|
||||||
|
pageNum:pn,
|
||||||
|
pageSize,
|
||||||
|
siteName
|
||||||
|
}
|
||||||
|
callOperateApi("ebikeRegion/pageSite", params, "get").then(res => {
|
||||||
|
console.log("11111111111111111111111", "ebikeRegion/pageSite", res);
|
||||||
|
const {
|
||||||
|
code,
|
||||||
|
data,
|
||||||
|
message
|
||||||
|
} = res;
|
||||||
|
if (code != 200) {
|
||||||
|
console.log("ebikeRegion/pageSite错误", message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const {
|
||||||
|
records
|
||||||
|
} = data;
|
||||||
|
const arrNewData=_.cloneDeep(arrData.value);
|
||||||
|
if(loadType=="del"){
|
||||||
|
const{index}=selData;
|
||||||
|
if(pageNum>pn){
|
||||||
|
// arrNewData.splice(index,);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
records.map((item,index) => {
|
||||||
|
const {
|
||||||
|
siteRegionId,
|
||||||
|
siteName,
|
||||||
|
createdTime,
|
||||||
|
allowedParkingNum,
|
||||||
|
siteAdress
|
||||||
|
} = item;
|
||||||
|
const sindex=(pn-1)*pageSize+index;
|
||||||
|
const newdata = {
|
||||||
|
id: siteRegionId,
|
||||||
|
zdlx: "停", //站点类型
|
||||||
|
zdmc: siteName, //站点名称
|
||||||
|
zdjb: "1级", //站点级别
|
||||||
|
cjsj: createdTime, //创建时间
|
||||||
|
clsl1: 0, //车辆数量
|
||||||
|
clsl2: allowedParkingNum, //限制车辆数量
|
||||||
|
zcsl: 0, //租车数量
|
||||||
|
hcsl: 0, //还车数量
|
||||||
|
cjdd: siteAdress, //创建地点
|
||||||
|
cjr: "创建人", //创建人
|
||||||
|
pageNum,
|
||||||
|
index:sindex
|
||||||
|
}
|
||||||
|
arrNewData[sindex]=newdata;
|
||||||
|
});
|
||||||
|
arrData.value=arrNewData;
|
||||||
|
if(callbak) callbak();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
zoneId = selAreaStore.value;
|
||||||
|
loadData(pageNum);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
console.log("9999999999999999999999999onUnmounted")
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="divLowerLeft">
|
<div class="divLowerLeft">
|
||||||
<div class="divBtn">
|
<div class="divBtn">
|
||||||
<div class="divBtnTitle" @click="getLocation">
|
<div class="divBtnTitle" @click="getLoalcation">
|
||||||
<uni-icons custom-prefix="iconfont" type="icon-ebikedingwei2" :color="iconcolor" :size="iconsize" />
|
<uni-icons custom-prefix="iconfont" type="icon-ebikedingwei2" :color="iconcolor" :size="iconsize" />
|
||||||
<div>定位</div>
|
<div>定位</div>
|
||||||
</div>
|
</div>
|
||||||
@ -98,7 +98,9 @@
|
|||||||
const radius = ref(20);
|
const radius = ref(20);
|
||||||
let drawPoint = [];
|
let drawPoint = [];
|
||||||
let areaData = {};
|
let areaData = {};
|
||||||
|
let selArea = null; //选中区域
|
||||||
let regionData = {};
|
let regionData = {};
|
||||||
|
|
||||||
let showRegion = ref(false);
|
let showRegion = ref(false);
|
||||||
const iconsize = 16;
|
const iconsize = 16;
|
||||||
const iconcolor = "#6f7777";
|
const iconcolor = "#6f7777";
|
||||||
@ -181,18 +183,62 @@
|
|||||||
longitude
|
longitude
|
||||||
}
|
}
|
||||||
} = e;
|
} = e;
|
||||||
|
let inside = false;
|
||||||
|
if (!selArea) {
|
||||||
|
const {
|
||||||
|
arrCirclesData,
|
||||||
|
arrPolygonsData
|
||||||
|
} = areaData;
|
||||||
|
for(let i=0;i<arrPolygonsData.length;i++){
|
||||||
|
const data=arrPolygonsData[i];
|
||||||
|
const points=data.points;
|
||||||
|
inside=map.checkPointInPolygon(longitude,latitude,points);
|
||||||
|
if(inside){
|
||||||
|
selArea=data;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* if(!inside){
|
||||||
|
for(i=0;i<arrCirclesData.length;i++){
|
||||||
|
const data=arrCirclesData[i];
|
||||||
|
const {latitude:lat,
|
||||||
|
longitude:lng,radius:r}=data;
|
||||||
|
inside=map.checkPointInPolygon(longitude,latitude,{lng,lat},r);
|
||||||
|
if(inside){
|
||||||
|
selArea=data;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} */
|
||||||
|
if(!inside){
|
||||||
|
showModelMessage("请绘制在运营区域内!")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
const{shapeType,points}=selArea;
|
||||||
|
if(shapeType=="2"){
|
||||||
|
inside=map.checkPointInPolygon(longitude,latitude,points);
|
||||||
|
if(!inside){
|
||||||
|
showModelMessage("请绘制在运营区域内!")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
switch (selDraw.value) {
|
switch (selDraw.value) {
|
||||||
case "1":
|
case "1":
|
||||||
drawPolygons(latitude, longitude);
|
drawPolygons(longitude,latitude);
|
||||||
break;
|
break;
|
||||||
case "2":
|
case "2":
|
||||||
drawCircle(latitude, longitude);
|
drawCircle(longitude,latitude);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//绘制多边形
|
//绘制多边形
|
||||||
function drawPolygons(latitude, longitude) {
|
function drawPolygons(longitude,latitude ) {
|
||||||
const len = drawPoint.length;
|
const len = drawPoint.length;
|
||||||
switch (len) {
|
switch (len) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -217,7 +263,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//绘制圆形
|
//绘制圆形
|
||||||
function drawCircle(latitude, longitude) {
|
function drawCircle( longitude,latitude) {
|
||||||
const circle = map.addCirle(drawColor, drawFillColor, longitude, latitude, radius.value);
|
const circle = map.addCirle(drawColor, drawFillColor, longitude, latitude, radius.value);
|
||||||
const marker = map.addMarker(drawId, longitude, latitude, "point.png");
|
const marker = map.addMarker(drawId, longitude, latitude, "point.png");
|
||||||
if (drawPoint.length > 0) {
|
if (drawPoint.length > 0) {
|
||||||
@ -293,9 +339,11 @@
|
|||||||
if (arrPoint.length > 3) {
|
if (arrPoint.length > 3) {
|
||||||
arrPoint.push(arrPoint[0]);
|
arrPoint.push(arrPoint[0]);
|
||||||
}
|
}
|
||||||
|
console.log("88888888888888888888888",arrPoint);
|
||||||
const points = JSON.stringify(arrPoint);
|
const points = JSON.stringify(arrPoint);
|
||||||
|
const {operationRegionId}=selArea;
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/devops/bikesite/bikesite-info?points=${points}&radius=${radius.value}&&type=${opentype.value}`
|
url: `/pages/devops/bikesite/bikesite-info?points=${points}&radius=${radius.value}&&type=${opentype.value}&®ionid=${operationRegionId}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,17 +364,21 @@
|
|||||||
arrRegionID,
|
arrRegionID,
|
||||||
arrCircles,
|
arrCircles,
|
||||||
arrPolygons,
|
arrPolygons,
|
||||||
arrData
|
arrData,
|
||||||
|
arrCirclesData,
|
||||||
|
arrPolygonsData
|
||||||
} = res;
|
} = res;
|
||||||
if (arrRegionID.length == 0) {
|
if (arrRegionID.length == 0) {
|
||||||
if (callback) callback();
|
if (callback) callback();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log("00000000000000000000000areaData",areaData);
|
||||||
areaData = {
|
areaData = {
|
||||||
arrCircles,
|
arrCircles,
|
||||||
arrPolygons,
|
arrPolygons,
|
||||||
arrData
|
arrData,
|
||||||
|
arrCirclesData,
|
||||||
|
arrPolygonsData
|
||||||
};
|
};
|
||||||
|
|
||||||
map.getRegionData(arrRegionID, (res) => {
|
map.getRegionData(arrRegionID, (res) => {
|
||||||
@ -335,14 +387,14 @@
|
|||||||
arrData,
|
arrData,
|
||||||
arrCircles: arrCircles_region,
|
arrCircles: arrCircles_region,
|
||||||
arrPolygons: arrPolygons_region,
|
arrPolygons: arrPolygons_region,
|
||||||
arrCirclesData,
|
arrCirclesData: arrCirclesData_region,
|
||||||
arrPolygonsData
|
arrPolygonsData: arrPolygonsData_region
|
||||||
} = res;
|
} = res;
|
||||||
regionData = {
|
regionData = {
|
||||||
arrCircles,
|
arrCircles:arrCircles_region,
|
||||||
arrPolygons,
|
arrPolygons:arrPolygons_region,
|
||||||
arrCirclesData,
|
arrCirclesData: arrCirclesData_region,
|
||||||
arrPolygonsData
|
arrPolygonsData: arrPolygonsData_region
|
||||||
};
|
};
|
||||||
const arrMarker = [];
|
const arrMarker = [];
|
||||||
arrCircles_region.map((item, index) => {
|
arrCircles_region.map((item, index) => {
|
||||||
@ -374,13 +426,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//定位
|
//定位
|
||||||
function getLocation() {
|
function getLoalcation() {
|
||||||
map.getLoalcation(oMap, (res) => {
|
map.getLoalcation(oMap, (res) => {
|
||||||
const {
|
const {
|
||||||
latitude,
|
latitude,
|
||||||
longitude
|
longitude
|
||||||
} = res;
|
} = res;
|
||||||
mapcenter.value={
|
mapcenter.value = {
|
||||||
latitude,
|
latitude,
|
||||||
longitude
|
longitude
|
||||||
};
|
};
|
||||||
@ -392,13 +444,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showMapSite(showSite) {
|
function showMapSite(showSite) {
|
||||||
|
debugger;
|
||||||
const {
|
const {
|
||||||
arrCircles,
|
arrCircles=[],
|
||||||
arrPolygons
|
arrPolygons=[]
|
||||||
} = areaData;
|
} = areaData;
|
||||||
const {
|
const {
|
||||||
arrCircles: arrCircles_region,
|
arrCircles: arrCircles_region=[],
|
||||||
arrPolygons: arrPolygons_region,
|
arrPolygons: arrPolygons_region=[],
|
||||||
arrCirclesData,
|
arrCirclesData,
|
||||||
arrPolygonsData
|
arrPolygonsData
|
||||||
} = regionData;
|
} = regionData;
|
||||||
@ -458,7 +511,6 @@
|
|||||||
//加载数据
|
//加载数据
|
||||||
function loadData() {
|
function loadData() {
|
||||||
loadOperation(() => {
|
loadOperation(() => {
|
||||||
showMapSite(showRegion.value);
|
|
||||||
if (isload) {
|
if (isload) {
|
||||||
defualtZoom();
|
defualtZoom();
|
||||||
}
|
}
|
||||||
@ -469,14 +521,12 @@
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
oMap = map.getMap("mapRef", getCurrentInstance());
|
oMap = map.getMap("mapRef", getCurrentInstance());
|
||||||
//oMap.moveToLocation();
|
|
||||||
isload = true;
|
isload = true;
|
||||||
getLocation();
|
|
||||||
defualtZoom();
|
defualtZoom();
|
||||||
});
|
});
|
||||||
|
|
||||||
onLoad(options => {
|
onLoad(options => {
|
||||||
console.log("33333333333333333", "options,isload", options,isload)
|
console.log("33333333333333333", "options,isload", options, isload)
|
||||||
let title = "站点地图";
|
let title = "站点地图";
|
||||||
const {
|
const {
|
||||||
type,
|
type,
|
||||||
@ -510,8 +560,8 @@
|
|||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title
|
title
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
loadData();
|
loadData();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user