Commit 83855742 authored by 赵啸非's avatar 赵啸非

地图详细显示

parent c7b90700
......@@ -14,7 +14,7 @@ import ImagePreview from '@/components/ImagePreview';
import FileUpload from '@/components/FileUpload';
import Editor from '@/components/Editor';
import Map from '@/components/Map';
import AMap from '@/components/AMap';
import MapDetail from '@/components/MapDetail';
const Prototype = function() {};
......@@ -34,7 +34,7 @@ Prototype.install = (Vue, options) => {
Vue.component('FileUpload', FileUpload) // 文件上传
Vue.component('Editor', Editor) // 富文本
Vue.component('Map', Map) // 地图
Vue.component('AMap', AMap) // 地图
Vue.component('MapDetail', MapDetail) // 地图
}
export default Prototype;
......@@ -114,6 +114,7 @@ import { AMapManager, lazyAMapApiLoaderInstance } from "vue-amap";
let amapManager = new AMapManager();
export default {
name: "MapList",
props: {
value: {
type: Boolean,
......@@ -148,6 +149,12 @@ export default {
//获取设备列表
console.log("device siteId",this.info.siteId)
this.$emit("choose", this.info, (val) => {
//data = val;
console.log("callback:" + val);
});
},
refresh(data) {
console.log("刷新数据", data);
......@@ -167,9 +174,6 @@ export default {
setMarker(item) {
if (!item.lng && !item.lat) return;
//console.log("data",formatterDate(item.createTime))
let markerLabel = {
label: { content: item.siteName, offset: [30, 70] },
position: [item.lng, item.lat],
......@@ -368,7 +372,7 @@ export default {
};
</script>
<style lang="less">
<style lang="less">
.tuli{
width: 300px;
top: 20px;
......
......@@ -25,7 +25,7 @@ VueAMap.initAMapApiLoader({
key: 'f45cca59553214543a5a77e50a7e04df',
plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PlaceSearch', 'AMap.Geolocation', 'AMap.Geocoder'],
v: '1.4.4',
uiVersion: '1.0'
uiVersion: '1.0',
})
Vue.prototype.Global = Global;
new Vue({
......
......@@ -39,7 +39,9 @@ const router = new Router({
...restBuilder('sitestat', 'sitestat'),//站点设备管理
builder('sitestat/maplist', 'sitestat/maplist'),//站点
builder('sitestat/maplist', 'sitestat/maplist'),//地图站点
builder('sitestat/mapDetail', 'sitestat/mapDetail'),//地图设备
...restBuilder('platform', 'platform'),//平台
......
......@@ -9,7 +9,7 @@
>
站点编码:{{ siteCode }} )</span
>
<el-link style="margin-left: 10px" type="primary" :underline="false"
<el-link style="margin-left: 10px" type="primary" @click="switchMap" :underline="false"
>地图模式</el-link
>
<el-button
......@@ -181,6 +181,10 @@ export default {
console.log(this.$route);
this.siteId = this.$route.query.siteId;
this.info=this.$route.query
this.query={siteId:this.siteId}
this.$get("/sitestat/siteInfo", {
siteId: this.siteId,
})
......@@ -193,8 +197,16 @@ export default {
.catch((error) => {
this.$message.error(error.message);
});
this.$router.push({ query: { } });
},
methods: {
switchMap(){
this.$router.push({
path: "/sitestat/mapDetail",
query: this.info,
});
},
/** 导入 */
handleImport() {
this.upload.title = "设备导入";
......@@ -385,6 +397,7 @@ export default {
// 上传的地址
url: "/m/device/importData",
},
info:{},
// 站点树
tree: {
// 是否显示弹出层(设备导入)
......
......@@ -119,12 +119,12 @@ export default {
},
/** 重写查看方法 */
toView(row) {
console.log(row)
//进入设备列表页面
this.$router.push({
path: "/device/list",
query: {
siteId: row.siteId,
},
query: row,
});
},
......
<template>
<div>
<Map ref="map" :markersData="originData" @choose="getDetailData" > <el-row :gutter="20" slot="leftTop">
<Map ref="map" :markersData="originData" @choose="getDetailData">
<el-row :gutter="20" slot="leftTop">
<el-card>
<div slot="header">
<span><b class="cardTitle">站点分布</b></span>
<span><b class="cardTitle">站点分布</b></span>
<el-button
style="float: right;"
@click="switchStat"
type="text"
<el-button style="float: right" @click="switchStat" type="text"
>切换为列表模式</el-button
>
</div>
......@@ -34,9 +28,8 @@
>
</el-tree>
</el-scrollbar>
</el-card>
</el-row></Map>
</el-card> </el-row
></Map>
<dialog-show ref="dialogform" @ok="getData" />
</div>
......@@ -47,10 +40,9 @@
import dialogShow from "./dialogshow";
import table from "@/assets/mixins/table";
import tree from "@/assets/mixins/tree";
import Map from "@/components/Map";
export default {
name: "Sitestat",
components: { dialogShow, Map },
components: { dialogShow },
mixins: [table, tree],
mounted() {
console.log(this.pageInfo);
......@@ -62,7 +54,7 @@ export default {
created() {
this.pageInfo.list = "/sitestat/list";
this.$get("/sitestat/maplist", {}).then(({ data }) => {
this.originData=data
this.originData = data;
// this.originData = data.data.map((i) => {
// let obj = {};
// obj.lng = i.longitude;
......@@ -71,6 +63,7 @@ export default {
// obj.siteId = i.id;
// return obj;
// });
//console.log(data)
this.$refs.map.refresh(this.originData);
});
......@@ -106,20 +99,25 @@ export default {
this.isExport = false;
this.$message.error(error.message);
});
},
},
getDetailData(info, callback) {
console.log("info:", info);
getDetailData(siteId, callback) {
console.log("siteId:", siteId);
this.$router.push({
path: "/sitestat/mapDetail",
query: info,
// query: {id:info.id},
});
this.$get("/sitestat/siteInfo", { siteId, siteId }).then((res) => {
// this.$get("/sitestat/siteInfo", { siteId, siteId }).then((res) => {
console.log("res",res)
// console.log("res",res)
// if (res.code == 1 && res.data.data.length > 0) {
// callback(res.data.data[0]);
// }
});
// // if (res.code == 1 && res.data.data.length > 0) {
// // callback(res.data.data[0]);
// // }
// });
//关闭弹窗
// this.$refs.popoverRef.doClose()
......@@ -239,7 +237,7 @@ export default {
font-size: 16px;
color: rgb(20, 134, 248);
list-style-type: none;
border-bottom: 3px solid rgb(20, 134, 248);
border-bottom: 3px solid rgb(20, 134, 248);
padding-bottom: 2px;
}
.mytree ::v-deep {
......
......@@ -51,5 +51,10 @@ public class DeviceVo extends BaseEntityLong {
/** 主键ID,主键,自增长列表 */
private List <Long> idList;
/**
* 产品列表
*/
private List <Long> productIdList;
}
\ No newline at end of file
......@@ -87,6 +87,11 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
this.addDict(model, "enabled", paramService.getParamBySecondOrganize("Device", "enabled"));
this.addDict(model, "source", DeviceSourceEnum.getEnumMap());
//返回产品列表及其样式
//productService.find(new ProductEntity()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getProductName())).
super.init(model, context);
}
......
......@@ -138,7 +138,7 @@ public class SitestatController extends BaseCRUDJsonBodyMappingController<Sitest
}
return null;
}).filter(f -> f != null).collect(Collectors.toList());
return Rest.ok("获取成功", collect);
return Rest.ok("获取成功",collect);
} catch (Exception e) {
log.error("获取异常", e);
return Rest.fail("获取异常!");
......
......@@ -9,7 +9,7 @@
<setting name="useGeneratedKeys" value="false" />
<setting name="defaultExecutorType" value="REUSE" />
<!-- 是否开始sql日志控制台打印 -->
<!-- <setting name="logImpl" value="STDOUT_LOGGING" />-->
<!-- <setting name="logImpl" value="STDOUT_LOGGING" />-->
</settings>
<plugins>
<plugin interceptor="com.mortals.framework.thirty.mybatis.MortalsPagePlugin">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment