This commit is contained in:
汪汇 2024-01-17 17:28:01 +08:00
parent 9c5188e864
commit 32203d8aae
1 changed files with 30 additions and 37 deletions

View File

@ -41,7 +41,7 @@
shape="round" shape="round"
background="#4fc08d00" background="#4fc08d00"
placeholder="" placeholder=""
@change="getlist(dropdown.serch)" @change="getlist()"
/> />
<van-dropdown-menu> <van-dropdown-menu>
<van-dropdown-item <van-dropdown-item
@ -86,7 +86,7 @@
</div> </div>
</div> </div>
<van-divider <van-divider
v-if="dropdown.rmyy.length < count" v-if="dropdown.rmyy.length < count && dropdown.rmyy.length !== 0"
@click="getlists()" @click="getlists()"
:style="{ :style="{
color: '#1989fa', color: '#1989fa',
@ -120,7 +120,7 @@
<img <img
style="width: 100%; height: 100%; border-radius: 5px" style="width: 100%; height: 100%; border-radius: 5px"
:src=" :src="
showdata.tp || showdata.img ||
'https://ts4.cn.mm.bing.net/th?id=OIP-C.loXEDwoMcxdPH4Ka75v3qgHaFU&w=294&h=211&c=8&rs=1&qlt=90&o=6&pid=3.1&rm=2' 'https://ts4.cn.mm.bing.net/th?id=OIP-C.loXEDwoMcxdPH4Ka75v3qgHaFU&w=294&h=211&c=8&rs=1&qlt=90&o=6&pid=3.1&rm=2'
" "
alt="" alt=""
@ -177,7 +177,7 @@ import img16 from "@/assets/home/yxfwxz.png";
import img17 from "@/assets/home/yy.png"; import img17 from "@/assets/home/yy.png";
import img18 from "@/assets/home/wdwz.png"; import img18 from "@/assets/home/wdwz.png";
import img19 from "@/assets/home/xzwz.png"; import img19 from "@/assets/home/xzwz.png";
const count = ref("0"); const count = ref(0);
var map = null; var map = null;
var control = null; var control = null;
var T = window.T; var T = window.T;
@ -263,8 +263,11 @@ const init = () => {
// //
map.addControl(control); map.addControl(control);
control.setPosition(T_ANCHOR_TOP_RIGHT); control.setPosition(T_ANCHOR_TOP_RIGHT);
var lo = new T.Geolocation();
lo.getCurrentPosition(fn);
}; };
const fn = function (e) { const fn = function (e) {
console.log(e);
var icon = new T.Icon({ var icon = new T.Icon({
iconUrl: img18, iconUrl: img18,
iconSize: new T.Point(28, 28), iconSize: new T.Point(28, 28),
@ -303,7 +306,7 @@ const searchResult = function (result) {
const yxfwxz = (e) => { const yxfwxz = (e) => {
list.index = e.id; list.index = e.id;
dropdown.serch = e; dropdown.serch = e;
getlist(dropdown.serch); getlist();
list.page = 1; list.page = 1;
}; };
const touchmove = (event) => { const touchmove = (event) => {
@ -327,7 +330,6 @@ const yxf = () => {
var LngLats = new T.Marker(new T.LngLat(ss[0], ss[1]), { var LngLats = new T.Marker(new T.LngLat(ss[0], ss[1]), {
icon: icons, icon: icons,
}); });
// LngLats.addEventListener("click", getinfo(item));
map.addOverLay(LngLats); map.addOverLay(LngLats);
addClickHandler(item, LngLats); addClickHandler(item, LngLats);
}); });
@ -348,7 +350,6 @@ function addClickHandler(content, LngLats) {
var LngLats = new T.Marker(new T.LngLat(ss[0], ss[1]), { var LngLats = new T.Marker(new T.LngLat(ss[0], ss[1]), {
icon: icons, icon: icons,
}); });
// LngLats.addEventListener("click", getinfo(item));
map.addOverLay(LngLats); map.addOverLay(LngLats);
addClickHandler(item, LngLats); addClickHandler(item, LngLats);
} else { } else {
@ -361,7 +362,6 @@ function addClickHandler(content, LngLats) {
var LngLats = new T.Marker(new T.LngLat(ss[0], ss[1]), { var LngLats = new T.Marker(new T.LngLat(ss[0], ss[1]), {
icon: icons, icon: icons,
}); });
// LngLats.addEventListener("click", getinfo(item));
map.addOverLay(LngLats); map.addOverLay(LngLats);
addClickHandler(item, LngLats); addClickHandler(item, LngLats);
} }
@ -386,7 +386,6 @@ const addClickHandls = (e) => {
var LngLats = new T.Marker(new T.LngLat(ss[0], ss[1]), { var LngLats = new T.Marker(new T.LngLat(ss[0], ss[1]), {
icon: icons, icon: icons,
}); });
// LngLats.addEventListener("click", getinfo(item));
map.addOverLay(LngLats); map.addOverLay(LngLats);
addClickHandler(item, LngLats); addClickHandler(item, LngLats);
} else { } else {
@ -399,7 +398,6 @@ const addClickHandls = (e) => {
var LngLats = new T.Marker(new T.LngLat(ss[0], ss[1]), { var LngLats = new T.Marker(new T.LngLat(ss[0], ss[1]), {
icon: icons, icon: icons,
}); });
// LngLats.addEventListener("click", getinfo(item));
map.addOverLay(LngLats); map.addOverLay(LngLats);
addClickHandler(item, LngLats); addClickHandler(item, LngLats);
} }
@ -420,9 +418,8 @@ const columnList = (e) => {
}); });
}; };
const getlist = (e) => { const getlist = () => {
dropdown.rmyy = []; dropdown.rmyy = [];
list.page = 1; list.page = 1;
let paly = { let paly = {
column_id: "", column_id: "",
@ -431,13 +428,8 @@ const getlist = (e) => {
data_sorts: [], data_sorts: [],
}; };
let patle = ""; let patle = "";
if (!e) { patle = list.yxfw[list.index].columnName;
patle = list.yxfw[0].columnName; paly.column_id = list.yxfw[list.index].ids;
paly.column_id = list.yxfw[0].ids;
} else {
patle = e.columnName;
paly.column_id = e.ids;
}
shows.value = true; shows.value = true;
http http
.post( .post(
@ -447,18 +439,22 @@ const getlist = (e) => {
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
dropdown.rmyy = res.data; dropdown.rmyy = res.data;
let lest = dropdown.rmyy[0].xiang_xi_di_zhi_jing_wei_du.split(","); if (dropdown.rmyy.length !== 0) {
map.centerAndZoom(new T.LngLat(lest[0], lest[1]), 12); let lest = dropdown.rmyy[0].xiang_xi_di_zhi_jing_wei_du.split(",");
count.value = res.count; map.centerAndZoom(new T.LngLat(lest[0], lest[1]), 12);
console.log(dropdown.rmyy.length); count.value = res.count;
console.log(count.value); map.clearOverLays();
map.clearOverLays(); yxf();
yxf(); shows.value = false;
shows.value = false; } else {
count.value = 0;
map.clearOverLays();
shows.value = false;
}
} }
}); });
}; };
const getlists = (e) => { const getlists = () => {
list.page = list.page + 1; list.page = list.page + 1;
let paly = { let paly = {
column_id: "", column_id: "",
@ -467,15 +463,9 @@ const getlists = (e) => {
data_sorts: [], data_sorts: [],
}; };
let patle = ""; let patle = "";
if (!e) { patle = list.yxfw[list.index].columnName;
patle = list.yxfw[0].columnName; paly.column_id = list.yxfw[list.index].ids;
paly.column_id = list.yxfw[0].ids;
} else {
patle = e.columnName;
paly.column_id = e.ids;
}
shows.value = true; shows.value = true;
console.log(list.yxfw[0]);
http http
.post( .post(
`/srv/platform/map/list/${patle}?page=${list.page}&size=${list.size}`, `/srv/platform/map/list/${patle}?page=${list.page}&size=${list.size}`,
@ -595,8 +585,10 @@ const getlists = (e) => {
height: calc(100% - 132px); height: calc(100% - 132px);
overflow: auto; overflow: auto;
padding-bottom: 80px; padding-bottom: 80px;
.card ::-webkit-scrollbar { .card ::-webkit-scrollbar {
display: none; /* Chrome Safari */ display: none;
/* Chrome Safari */
} }
.cardlist { .cardlist {
@ -700,6 +692,7 @@ const getlists = (e) => {
:deep(.van-search) { :deep(.van-search) {
padding: 0px 12px 10px; padding: 0px 12px 10px;
} }
.wrapper { .wrapper {
position: absolute; position: absolute;
top: 45%; top: 45%;