Commit c6ebbd51 authored by 耿迪迪's avatar 耿迪迪

首页及所属区域修改

parent e932e987
......@@ -136,11 +136,12 @@ public class TTaskController extends BaseController
* @return
*/
@GetMapping("/selectCurrentTaskByType")
public AjaxResult selectCurrentTaskByType(@RequestParam(value="type") Integer type,@RequestParam(value="checkType",required = false) Integer checkType,@RequestParam(value="taskType",required = false) Integer taskType){
public AjaxResult selectCurrentTaskByType(@RequestParam(value="type") Integer type,@RequestParam(value="checkType",required = false) Integer checkType,@RequestParam(value="taskType",required = false) Integer taskType,@RequestParam(value="userId") Long userId){
Map<String,Object> param = new HashMap<>();
param.put("type",type);
param.put("checkType",checkType);
param.put("taskType",taskType);
param.put("userId",userId);
return AjaxResult.success(tTaskService.selectCurrentTaskByType(param));
}
......
......@@ -280,7 +280,7 @@
</el-row>
<el-row>
<el-form-item label="所属区域" prop="city">
<el-col :span="5">
<!--<el-col :span="5">
<el-select v-model="form.city" placeholder="所属市" @change="(id) =>getAreaList(id,2)">
<el-option
v-for="dict in oneAreaList"
......@@ -300,7 +300,7 @@
:value="dict.id"
/>
</el-select>
</el-col>
</el-col>-->
<el-col :span="6" style="margin-left: 8px" >
<el-select v-model="form.street" placeholder="所属乡镇" @change="(id) =>getAreaList(id,4)">
......@@ -757,7 +757,8 @@
this.form = {
id: null,
usernum: null,
county: null,
city: 1,
county: 8,
street: null,
village: null,
address: null,
......@@ -800,6 +801,7 @@
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getAreaListtwo(this.form.county,3);
this.open = true;
this.title = "添加居民用户";
},
......
......@@ -309,7 +309,7 @@
<el-row>
<el-form-item label="所属区域" prop="community">
<el-col :span="6">
<!-- <el-col :span="6">
<el-select v-model="form.city" placeholder="请选择市" @change="proviceChange">
<el-option
v-for="item in proviceData"
......@@ -329,7 +329,7 @@
:value="item.id"
/>
</el-select>
</el-col>
</el-col>-->
<el-col :span="6" style="padding-left: 8px" >
<el-select v-model="form.street" placeholder="所属乡镇" @change="steetChange">
......@@ -343,7 +343,7 @@
</el-col>
<el-col :span="6" style="padding-left: 8px">
<el-select v-model="form.community" multiple @change="$forceUpdate()" placeholder="所属小区(村)">
<el-select v-model="form.community" multiple placeholder="所属小区(村)">
<el-option
v-for="item in communityData"
:key="item.id"
......@@ -364,8 +364,8 @@
<!--</el-form-item>-->
<el-row>
<el-col :span="24">
<el-form-item label="负责" prop="responsiblePerson">
<el-select v-model="form.responsiblePerson" multiple @change="$forceUpdate()" placeholder="请选择负责">
<el-form-item label="负责" prop="responsiblePerson">
<el-select v-model="form.responsiblePerson" multiple @change="$forceUpdate()" placeholder="请选择负责">
<el-option
v-for="group in groupList"
:key="group.groupId"
......@@ -489,7 +489,7 @@ export default {
{ required: true, message: "请选择所属小区(村)", trigger: "blur" },
],
responsiblePerson: [
{ required: true, message: "请选择负责", trigger: "blur" },
{ required: true, message: "请选择负责", trigger: "blur" },
]
},
inspectUserTypeOptions: [],
......@@ -540,7 +540,11 @@ export default {
remarks: null,
community: [],
responsiblePerson: [],
relationInfoList: []
relationInfoList: [],
city: 1,
county: 8,
street:null,
community: []
};
this.resetForm("form");
},
......@@ -564,7 +568,8 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getProvinceInfo();
//this.getProvinceInfo();
this.getStreet();
this.getGroupInfo();
this.open = true;
this.title = "添加入户安检任务";
......@@ -575,10 +580,11 @@ export default {
const id = row.id || this.ids;
getTask(id).then((response) => {
this.form = response.data;
this.getRelationInfo();
// 获取省市
this.getProvinceInfo();
//this.getProvinceInfo();
// 获取县区信息
this.getCounty();
//this.getCounty();
// 获取街道信息
this.getStreet();
// 获取村镇信息
......@@ -741,6 +747,7 @@ export default {
//街道镇选择
steetChange(){
this.community = null;
this.form.community = [];
this.communityData = [];
this.getCommunityInfo();
},
......@@ -773,7 +780,7 @@ export default {
communityList({street: this.form.street}).then(res =>{
if(res.code == 200){
this.communityData = res.data;
this.getRelationInfo();
if (!this.form.street) this.getRelationInfo();
}
})
},
......
......@@ -11,15 +11,15 @@
<div class="top"></div>
<div class="bottom"></div>
<Left @clickShow="clickShow"/>
<!-- <Left @clickShow="clickShow"/>
<Right :show="show"/>
<div class="mapChange">
<div :class="{ active: mapStyle }" @click="mapChange(2)">全景地图</div>
<div :class="{ active: !mapStyle }" @click="mapChange(1)">三维地图</div>
</div>
</div>-->
<!-- 3d地图 -->
<Map3d :show="show" v-if="!mapStyle" />
<!--<Map3d :show="show" v-if="!mapStyle" />-->
<!-- 高德地图 -->
<GaodeMap :show="show" v-if="mapStyle" />
<!-- 临检设备 -->
......
<template>
<div class="gaode-wrapper">
<div class="typelist-div flex">
<!--<div class="typelist-div flex">
<div class="flex">
<div
class="list flex bb"
......@@ -12,7 +12,7 @@
<img :src="item.imgurl" />
{{ item.name }}
</div>
<!-- 管线 -->
&lt;!&ndash; 管线 &ndash;&gt;
<div
class="list flex bb"
key="line"
......@@ -23,7 +23,7 @@
管线
</div>
</div>
</div>
</div>-->
<div id="gao-map-index" class="gao-map"></div>
<LineTips :show="show" v-show="lineTipsShow"/>
</div>
......@@ -106,7 +106,7 @@ export default {
this.gaoMap = new EditorMap(
"gao-map-index",
{
center: [118.09,39.48],
center: [118.168016,39.831679],
// mapStyle: "amap://styles/806fa63f07c70b043867bd1f9a600981",
mapStyle: "amap://styles/f71d3a3d73e14f5b2bf5508bf1411758",
zoom: 10.5,
......@@ -115,7 +115,7 @@ export default {
},
this
);
this.initMapDeviceInfo();
//this.initMapDeviceInfo();
},
//设备上图
initMapDeviceInfo() {
......
<template>
<div class="gaode-wrapper">
<div class="typelist-div flex">
<div class="flex">
<div
class="list flex bb"
v-for="(item, index) in arr"
:key="index"
:class="selarr.indexOf(item.val) >= 0 ? 'active' : ''"
@click="sel1(index, item)"
>
<img :src="item.imgurl" />
{{ item.name }}
</div>
<!-- 管线 -->
<div
class="list flex bb"
key="line"
:class="lineShow ? 'active' : ''"
@click="showLine"
>
<img src="~@/assets/indexImg/line.png" />
管线
</div>
</div>
</div>
<div id="gao-map-index" class="gao-map"></div>
<LineTips :show="show" v-show="lineTipsShow"/>
</div>
</template>
<script>
import { EditorMap } from "@/utils/mapClass/newMap";
import {
deviceType,
deviceIcon,
pipeColor,
} from "@/utils/mapClass/deviceIconTypeConfig";
import { mapGetters } from "vuex";
import { deviceInfoList } from "@/api/baseinfo/deviceInfo";
import DeviceInfo from "./components/DeviceInfo";
import { stationInfoList } from "@/api/baseinfo/stationInfo.js";
import StationInfo from "./components/StationInfo";
import { pipeInfoList } from "@/api/baseinfo/pipeInfo";
import PipeInfo from "./components/PipeInfo";
import axios from "axios";
import gcoord from "gcoord";
import LineTips from "./components/LineTips";
import { getAlarmInfoList } from "@/api/gasdata/alarm";
import MonitorDeviceAlarmInfo from "./components/MonitorDeviceAlarmInfo";
export default {
name: "gao-map-index",
props: {
show: {
type: Boolean,
},
},
components:{
LineTips
},
mounted() {
this.initMap();
},
data() {
return {
gaoMap: null,
arr: [
{
val: deviceType.regulatorBox,
ischeck: false,
imgurl: require("@/assets/indexImg/tyx.png"),
name: "调压箱",
},
{
val: deviceType.valve,
ischeck: false,
imgurl: require("@/assets/indexImg/fmj.png"),
name: "阀门井",
},
{
val: deviceType.station,
ischeck: false,
imgurl: require("@/assets/indexImg/cz.png"),
name: "场 站",
},
],
selarr: [],
lineStyle: {
medium: "#FF0000",
height1: "#00FF00",
height2: "#FFFF00",
newLine: "#00FFFF",
},
pipeLines: [],
lineShow: false,
lineTipsShow: false,
alarmInfoData: [],
timer: null
};
},
methods: {
initMap() {
const path = eval(this.systemSetting.map_center);
this.gaoMap = new EditorMap(
"gao-map-index",
{
center: [118.09,39.48],
// mapStyle: "amap://styles/806fa63f07c70b043867bd1f9a600981",
mapStyle: "amap://styles/f71d3a3d73e14f5b2bf5508bf1411758",
zoom: 10.5,
devicePicData: deviceIcon,
pipeColor: pipeColor,
},
this
);
this.initMapDeviceInfo();
},
//设备上图
initMapDeviceInfo() {
//调压箱
this.getDeviceInfo();
//场站
this.getStationInfo();
//管道
//this.getPipeInfo();
//this.getPipeByGeoJson();
this.getPipeByWgsArr();
//监测报警设备
this.getMonitorDevice();
},
//调压箱
getDeviceInfo() {
deviceInfoList().then((res) => {
if (res.code && res.data) {
res.data.forEach((item) => {
item.iconType = item.deviceType;
this.gaoMap.addDevice(item, DeviceInfo, false);
});
}
});
},
//场站
getStationInfo() {
stationInfoList().then((res) => {
if (res.code && res.data) {
res.data.forEach((item) => {
item.iconType = deviceType.station;
this.gaoMap.addDevice(item, StationInfo, false);
});
}
});
},
sel1(index, item) {
console.log(index, "=====fdsfdsf=====", item);
const ind = this.selarr.indexOf(item.val);
if (ind >= 0) {
this.selarr.splice(ind, 1);
this.hideMarker(item.val);
} else {
this.selarr.push(item.val);
this.showMarker(item.val);
}
},
showMarker(val) {
let markerList = this.gaoMap.allDevice[val];
if (markerList) {
markerList.forEach((marker) => {
marker.show();
});
}
},
hideMarker(val) {
let markerList = this.gaoMap.allDevice[val];
if (markerList) {
markerList.forEach((marker) => {
marker.hide();
});
}
},
//管道
getPipeInfo() {
pipeInfoList().then((res) => {
if (res.code == 200 && res.data) {
res.data.forEach((item) => {
item.path = eval(item.coordinates);
item.pipePressure = 2;
item.strokeWeight = 4;
this.gaoMap.addPipeLine(item, PipeInfo);
});
}
});
},
getPipeByGeoJson() {
axios.get("../geo_json/huanggezhuang.json").then((res) => {
this.gaoMap.map.plugin(["AMap.GeoJSON"], () => {
const geojson = new AMap.GeoJSON({
geoJSON: res.data,
getPolyline: function (geojson, lnglats) {
return new AMap.Polyline({
path: lnglats,
borderWeight: 4, // 线条宽度
strokeColor: "blue", // 线条颜色
});
},
});
this.gaoMap.map.add(geojson);
});
});
},
getPipeByWgsArr() {
this.getMediumLineInfo();
this.getNewLineInfo();
this.getHeight2Info();
this.getHeight2Info2();
this.getHeightGao();
},
//中压
getMediumLineInfo() {
axios.get("../geo_json/mediumLine.json").then((res) => {
res.data.forEach((line) => {
const linePath = [];
line.forEach((ponit) => {
let gaoPoint = gcoord.transform(
ponit, // 经纬度坐标
gcoord.WGS84, // 当前坐标系
gcoord.AMap // 目标坐标系
// gcoord.GCJ02,
// gcoord.WGS84
);
linePath.push(gaoPoint);
});
this.pipeOnMap("medium", linePath);
});
});
},
//新管线
getNewLineInfo() {
axios.get("../geo_json/newLine.json").then((res) => {
res.data.forEach((line) => {
const linePath = [];
line.forEach((ponit) => {
let gaoPoint = gcoord.transform(
ponit, // 经纬度坐标
gcoord.WGS84, // 当前坐标系
gcoord.AMap // 目标坐标系
// gcoord.GCJ02,
// gcoord.WGS84
);
linePath.push(gaoPoint);
});
this.pipeOnMap("height2", linePath);
});
});
},
//高压管线
getHeight2Info() {
axios.get("../geo_json/height2.json").then((res) => {
res.data.forEach((line) => {
const linePath = [];
line.forEach((ponit) => {
let gaoPoint = gcoord.transform(
ponit, // 经纬度坐标
gcoord.WGS84, // 当前坐标系
gcoord.AMap // 目标坐标系
// gcoord.GCJ02,
// gcoord.WGS84
);
linePath.push(gaoPoint);
});
this.pipeOnMap("height2", linePath);
});
});
},
getHeight2Info2() {
axios.get("../geo_json/height3.json").then((res) => {
res.data.forEach((line) => {
const linePath = [];
line.forEach((ponit) => {
let gaoPoint = gcoord.transform(
ponit, // 经纬度坐标
gcoord.AMap, // 当前坐标系
gcoord.AMap // 目标坐标系
// gcoord.GCJ02,
// gcoord.WGS84
);
linePath.push(gaoPoint);
});
this.pipeOnMap("height1", linePath);
});
});
},
getHeightGao(){
axios.get("../geo_json/heightGao.json").then((res) => {
res.data.forEach((line) => {
this.pipeOnMap("height2", line);
});
});
},
pipeOnMap(type, linePath) {
//线上图
const polyLine = new AMap.Polyline({
path: linePath,
strokeWeight: 4, // 线条宽度
strokeColor: this.lineStyle[type], // 线条颜色
});
polyLine.hide();
this.pipeLines.push(polyLine);
this.gaoMap.map.add(polyLine);
},
showLine() {
this.lineShow = this.lineShow ? false : true;
this.pipeLines.forEach((pipe) => {
if (this.lineShow) {
pipe.show();
this.lineTipsShow = true;
} else {
pipe.hide();
this.lineTipsShow = false;
}
});
},
getMonitorDevice(){
this.getAlarmInfo();
this.timer = setInterval(this.getAlarmInfo, 2000);
},
//获取报警信息
getAlarmInfo(){
getAlarmInfoList({reason: "0"}).then((res) => {
const length = this.gaoMap.allDevice[4] ? this.gaoMap.allDevice[4].length : 0;
if (res.code && res.data) {
res.data.forEach((item) => {
item.iconType = 4;
this.gaoMap.addDevice(item, MonitorDeviceAlarmInfo, true);
});
// return
//setTimeout(() =>{
for(let i = 0; i<length; i++){
this.gaoMap.map.remove(this.gaoMap.allDevice[4][i]);
}
this.gaoMap.allDevice[4].splice(0,length);
//},200)
//console.log(length,">>>>>end>>>>>>>",this.gaoMap.allDevice[4]);
}
});
},
},
beforeDestroy() {
clearInterval(this.timer);
},
computed: {
...mapGetters(["systemSetting"]),
},
};
</script>
<style scoped lang="scss">
.gaode-wrapper {
width: 100%;
height: 100%;
}
.gao-map {
width: 100%;
// height: calc(100vh - 84px);
height: 100%;
}
.typelist-div {
// width: 500px;
width: 100%;
height: 50px;
z-index: 9999;
position: absolute;
bottom: 20px;
justify-content: center;
// margin-left: calc((100% - 755px) / 2);
}
.list {
width: 90px;
height: 40px;
margin-right: 15px;
align-items: center;
color: #fff;
line-height: auto;
text-align: center;
font-size: 14px;
padding: 1px 10px;
cursor: pointer;
border-radius: 3px;
// background: rgba(0, 218, 240, 0.3);
// border: 1px solid;
border-image: linear-gradient(180deg, rgba(10, 243, 255, 0) 0%, #0af3ff 100%);
box-shadow: inset 0px 0px 10px 0px rgba(10, 243, 255, 0.7);
img {
margin-right: 5px;
margin-left: 2px;
}
}
.list.active {
background: rgba(0, 218, 240, 0.3);
// border: 1px solid;
border-image: linear-gradient(180deg, rgba(10, 243, 255, 0) 0%, #0af3ff 100%);
box-shadow: inset 0px 0px 10px 0px rgba(10, 243, 255, 0.7);
}
.list img {
width: 20px;
}
</style>
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