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

地图详细显示

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