Merge branch 'main' of http://47.109.71.130:3000/attiya/ebike-ui
This commit is contained in:
commit
4d6f8bbb30
@ -1,45 +1,44 @@
|
|||||||
<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" :label-width="100">
|
<uni-forms ref="formRef" :model="formData" :label-width="100">
|
||||||
<uni-forms-item label="站点名称" required>
|
<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>
|
||||||
<uni-forms-item label="站点类型:" required>
|
<uni-forms-item label="站点类型:" name="zdlx" required :rules="[{'required': true,errorMessage: '请选择站点类型'}]">
|
||||||
<uni-data-select v-model="formData.zdlx" :localdata="arrZDLX" />
|
<uni-data-select v-model="formData.zdlx" :localdata="arrZDLX" />
|
||||||
|
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="站点级别:" required>
|
<uni-forms-item label="站点级别:" name="zdjb" required :rules="[{'required': true,errorMessage: '请选择站点级别'}]">
|
||||||
<div class="divRow">
|
<div class="divRow">
|
||||||
<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="调度投放:" required>
|
<!-- <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>
|
||||||
|
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="用户端显示:" required>
|
<uni-forms-item label="用户端显示:" name="zdxs" required :rules="[{'required': true,errorMessage: '请选择用户端显示'}]">
|
||||||
<div class="divRow">
|
<div class="divRow">
|
||||||
<uni-data-checkbox v-model="formData.zdxs" :localdata="arrZDXS" />
|
<uni-data-checkbox v-model="formData.zdxs" :localdata="arrZDXS" />
|
||||||
<label style="margin-left: 10px;" @click="showTip('开启后在用户端小程序地图上不会显示站点,但不影响用户在该站点范围内还车')">
|
<label style="margin-left: 10px;" @click="showTip('开启后在用户端小程序地图上不会显示站点,但不影响用户在该站点范围内还车')">
|
||||||
<uni-icons type="info" size="20" color="#5892E3" /></label>
|
<uni-icons type="info" size="20" color="#5892E3" /></label>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="divRow" style="font-size: 12px;">用户端站点隐藏显示</div> -->
|
</uni-forms-item>-->
|
||||||
</uni-forms-item>
|
<uni-forms-item label="可停车辆:" name="ktcl" required :rules="[{'required': true,errorMessage: '请填写可停车辆'}]">
|
||||||
<uni-forms-item label="可停车辆:" required>
|
|
||||||
<div class="divRow">
|
<div class="divRow">
|
||||||
<uni-easyinput v-model="formData.ktcl" />
|
<uni-easyinput v-model="formData.ktcl" />
|
||||||
<label>辆</label>
|
<label>辆</label>
|
||||||
</div>
|
</div>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="最大可停:" required>
|
<uni-forms-item label="最大可停:" name="zdkt" required :rules="[{'required': true,errorMessage: '请填写最大可停'}]">
|
||||||
<div class="divRow">
|
<div class="divRow">
|
||||||
<uni-easyinput v-model="formData.zdkt" />
|
<uni-easyinput v-model="formData.zdkt" />
|
||||||
<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>
|
||||||
@ -52,7 +51,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="站点描述:">
|
<uni-forms-item label="站点描述:">
|
||||||
<uni-easyinput opentype="textarea" v-model="formData.zdms" />
|
<uni-easyinput type="textarea" v-model="formData.zdms" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="站点标签:">
|
<uni-forms-item label="站点标签:">
|
||||||
<uni-data-checkbox mode="button" multiple v-model="formData.zdbq" :localdata="arrZDBQ" />
|
<uni-data-checkbox mode="button" multiple v-model="formData.zdbq" :localdata="arrZDBQ" />
|
||||||
@ -158,7 +157,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}]';
|
||||||
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,9 +166,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function SaveData() {
|
function SaveData() {
|
||||||
debugger;
|
|
||||||
formRef.value.validate().then(res=>{
|
formRef.value.validate().then(res=>{
|
||||||
console.log("66666666666666666666666666666",res);
|
console.log("66666666666666666666666666666",res);
|
||||||
|
}).catch(res=>{
|
||||||
|
console.log("7777777777777777777777",res);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,9 +231,9 @@
|
|||||||
padding: 10px 10px;
|
padding: 10px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divForm /deep/ .uni-forms-item {
|
/* .divForm /deep/ .uni-forms-item {
|
||||||
margin-bottom: 10px !important;
|
margin-bottom: 10px !important;
|
||||||
}
|
} */
|
||||||
|
|
||||||
.divFontColor {
|
.divFontColor {
|
||||||
color: #606266;
|
color: #606266;
|
||||||
@ -252,7 +253,7 @@
|
|||||||
|
|
||||||
.divBottom {
|
.divBottom {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0px;
|
bottom: 10px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -113,10 +113,10 @@
|
|||||||
const selDraw = ref("1");
|
const selDraw = ref("1");
|
||||||
const drawId = 10000000;
|
const drawId = 10000000;
|
||||||
const drawColor = "#e58b04";
|
const drawColor = "#e58b04";
|
||||||
const drawFillColor = "rgba(229,139,4,0.1)";
|
const drawFillColor = "#e58b041a";
|
||||||
const height = ref("100vh");
|
const height = ref("100vh");
|
||||||
const opentype = ref("add"); //打开类型
|
const opentype = ref("add"); //打开类型
|
||||||
const editId = ""; //编辑ID
|
let editId = ""; //编辑ID
|
||||||
|
|
||||||
//缩放
|
//缩放
|
||||||
function onZoom(type) {
|
function onZoom(type) {
|
||||||
@ -143,7 +143,8 @@
|
|||||||
latitude,
|
latitude,
|
||||||
longitude
|
longitude
|
||||||
} = drawPoint[0];
|
} = drawPoint[0];
|
||||||
circles.value[circles.value.length-1] = map.addCirle(drawColor, drawFillColor, longitude, latitude, radius.value);
|
circles.value[circles.value.length - 1] = map.addCirle(drawColor, drawFillColor, longitude, latitude, radius
|
||||||
|
.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//切换绘制类型
|
//切换绘制类型
|
||||||
@ -213,10 +214,12 @@
|
|||||||
//绘制圆形
|
//绘制圆形
|
||||||
function drawCircle(latitude, longitude) {
|
function drawCircle(latitude, longitude) {
|
||||||
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");
|
||||||
if (drawPoint.length > 0) {
|
if (drawPoint.length > 0) {
|
||||||
circles.value[circles.value.length - 1] = circle;
|
circles.value[circles.value.length - 1] = circle;
|
||||||
|
markers.value[markers.value.length - 1] = markers;
|
||||||
} else {
|
} else {
|
||||||
const marker = map.addMarker(drawId, longitude, latitude, "point.png");
|
|
||||||
markers.value.push(marker);
|
markers.value.push(marker);
|
||||||
circles.value.push(circle);
|
circles.value.push(circle);
|
||||||
}
|
}
|
||||||
@ -297,10 +300,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadOperation(callback) {
|
function loadOperation(callback) {
|
||||||
console.log("666666666666666666666", "行政区划", zoneId)
|
console.log("666666666666666666666", "行政区划", zoneId);
|
||||||
|
|
||||||
map.getOperation(zoneId, (res) => {
|
map.getOperation(zoneId, (res) => {
|
||||||
if (!res) {
|
if (!res) {
|
||||||
callback();
|
if(callback) callback();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const {
|
const {
|
||||||
@ -310,7 +314,7 @@
|
|||||||
arrData
|
arrData
|
||||||
} = res;
|
} = res;
|
||||||
if (arrRegionID.length == 0) {
|
if (arrRegionID.length == 0) {
|
||||||
callback();
|
if(callback) callback();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,6 +325,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
map.getRegionData(arrRegionID, (res) => {
|
map.getRegionData(arrRegionID, (res) => {
|
||||||
|
console.log("11111111111getRegionData",res);
|
||||||
const {
|
const {
|
||||||
arrData,
|
arrData,
|
||||||
arrCircles: arrCircles_region,
|
arrCircles: arrCircles_region,
|
||||||
@ -344,7 +349,7 @@
|
|||||||
arrMarker.push(map.addMarker(len + index, lng, lat, "bikesite.png"));
|
arrMarker.push(map.addMarker(len + index, lng, lat, "bikesite.png"));
|
||||||
});
|
});
|
||||||
|
|
||||||
arrPolygons.map((item, index) => {
|
arrPolygons_region.map((item, index) => {
|
||||||
const {
|
const {
|
||||||
points
|
points
|
||||||
} = item;
|
} = item;
|
||||||
@ -358,7 +363,7 @@
|
|||||||
|
|
||||||
markers.value = arrMarker;
|
markers.value = arrMarker;
|
||||||
showMapSite(showRegion.value);
|
showMapSite(showRegion.value);
|
||||||
callback();
|
if(callback) callback();
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -389,31 +394,41 @@
|
|||||||
arrCirclesData,
|
arrCirclesData,
|
||||||
arrPolygonsData
|
arrPolygonsData
|
||||||
} = regionData;
|
} = regionData;
|
||||||
|
const arrEditC=[];
|
||||||
|
const arrEditP=[];
|
||||||
if (showSite) {
|
if (showSite) {
|
||||||
if (editId) {
|
if (editId) { //编辑
|
||||||
const obj = {
|
const obj = {
|
||||||
regionid: editId
|
regionid: editId
|
||||||
};
|
};
|
||||||
console.log("9999999999999999999999", arrCirclesData, arrPolygonsData);
|
console.log("9999999999999999999999arrCirclesData, arrPolygonsData", arrCirclesData, arrPolygonsData);
|
||||||
let index = findIndex(arrCirclesData, obj);
|
let index = findIndex(arrCirclesData, obj);
|
||||||
|
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
|
const {latitude,longitude}=arrCircles_region[index];
|
||||||
arrCirclesData.splice(index, 1);
|
arrCirclesData.splice(index, 1);
|
||||||
arrCircles_region.splice(index, 1);
|
arrCircles_region.splice(index, 1);
|
||||||
|
arrEditC.push(map.addCirle(drawColor,drawFillColor,longitude,latitude,radius.value));
|
||||||
} else {
|
} else {
|
||||||
index = findIndex(arrPolygonsData, obj);
|
index = findIndex(arrPolygonsData, obj);
|
||||||
arrPolygonsData.splice(index, 1);
|
if(index>-1){
|
||||||
arrPolygons_region.splice(index, 1);
|
const {points:arrPoint}=arrPolygons_region[index];
|
||||||
|
arrPolygonsData.splice(index, 1);
|
||||||
|
arrPolygons_region.splice(index, 1);
|
||||||
|
arrEditP.push(map.addPolygon(drawColor,drawFillColor,arrPoint))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
polygons.value = [...arrPolygons, ...arrPolygons_region];
|
polygons.value = [...arrPolygons, ...arrPolygons_region,...arrEditP];
|
||||||
circles.value = [...arrCircles, ...arrCircles_region];
|
circles.value = [...arrCircles, ...arrCircles_region,...arrEditC];
|
||||||
} else {
|
} else {
|
||||||
polygons.value = arrPolygons;
|
polygons.value = arrPolygons;
|
||||||
circles.value = arrCircles;
|
circles.value = arrCircles;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function defualtZoom() {
|
function defualtZoom() {
|
||||||
if (polygons.value.length == 0) return;
|
if (polygons.value.length == 0) return;
|
||||||
const arrPoint = polygons.value[0].points;
|
const arrPoint = polygons.value[0].points;
|
||||||
@ -426,17 +441,7 @@
|
|||||||
|
|
||||||
//加载数据
|
//加载数据
|
||||||
function loadData() {
|
function loadData() {
|
||||||
|
|
||||||
showRegion.value = false;
|
|
||||||
|
|
||||||
loadOperation(() => {
|
loadOperation(() => {
|
||||||
switch (opentype.value) {
|
|
||||||
case "add":
|
|
||||||
case "edit":
|
|
||||||
showRegion.value = true;
|
|
||||||
showDraw.value = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
showMapSite(showRegion.value);
|
showMapSite(showRegion.value);
|
||||||
if (isload) {
|
if (isload) {
|
||||||
defualtZoom();
|
defualtZoom();
|
||||||
@ -454,6 +459,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
onLoad(options => {
|
onLoad(options => {
|
||||||
|
console.log("33333333333333333","options",options)
|
||||||
let title = "站点地图";
|
let title = "站点地图";
|
||||||
const {
|
const {
|
||||||
type,
|
type,
|
||||||
@ -472,9 +478,13 @@
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case "add":
|
case "add":
|
||||||
title = "新建站点";
|
title = "新建站点";
|
||||||
|
showRegion.value = true;
|
||||||
|
showDraw.value = true;
|
||||||
break;
|
break;
|
||||||
case "edit":
|
case "edit":
|
||||||
title = "编辑站点";
|
title = "编辑站点";
|
||||||
|
showRegion.value = true;
|
||||||
|
showDraw.value = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
getScreenHeightNoTabBar(res => {
|
getScreenHeightNoTabBar(res => {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: "iconfont"; /* Project id 4868066 */
|
font-family: "iconfont"; /* Project id 4868066 */
|
||||||
src: url('iconfont.ttf?t=1745225351472') format('truetype');
|
src: url('iconfont.ttf?t=1745572982146') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
@ -11,6 +11,22 @@
|
|||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-ebikebianji:before {
|
||||||
|
content: "\e649";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-ebikeshanchu:before {
|
||||||
|
content: "\e6d3";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-ebikesanjiaoxing:before {
|
||||||
|
content: "\e617";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-ebikesanjiaoxing-copy:before {
|
||||||
|
content: "\eb34";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-ebikecheliangguanli:before {
|
.icon-ebikecheliangguanli:before {
|
||||||
content: "\e622";
|
content: "\e622";
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user