Merge pull request '要素资源危化品车辆点位' (#142) from lukeyan into master

Reviewed-on: #142
hezhengao
lukeyan 11 months ago
commit acb6a2d578

Before

Width:  |  Height:  |  Size: 894 B

After

Width:  |  Height:  |  Size: 894 B

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

@ -30,4 +30,12 @@ export function statistic(params) {
method: 'get', method: 'get',
params params
}) })
}
// 车辆点位数据
export function car_point(params) {
return request({
url:'/SafeCompanyVehicleTrack/list',
method:'get',
params
})
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -6,7 +6,7 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
const request = axios.create({ const request = axios.create({
//baseURL: 'http://172.18.113.50:8080/zhapi', //baseURL: 'http://172.18.113.50:8080/zhapi',
//baseURL: 'http://172.18.113.13:8080/zhapi', // 孙强 //baseURL: 'http://172.18.113.13:8080/zhapi', // 孙强
//baseURL: 'http://172.18.113.8:8080/zhapi', // 刘建 //baseURL: 'http://172.18.100.57:8080/zhapi', // 刘建
//baseURL: 'http://192.168.0.188:8888/zhapi', //baseURL: 'http://192.168.0.188:8888/zhapi',
//baseURL: 'http://121.41.91.94:12002/zhapi', //baseURL: 'http://121.41.91.94:12002/zhapi',
baseURL: `http://${window.location.host}/zhapi`, baseURL: `http://${window.location.host}/zhapi`,
@ -53,7 +53,7 @@ request.interceptors.response.use(
case 401: case 401:
if (vm.$route.name !== 'login') { if (vm.$route.name !== 'login') {
vm.$Message.warning({ vm.$message.warning({
content: '身份认证信息已失效,请重新登录。', content: '身份认证信息已失效,请重新登录。',
duration: 2, duration: 2,
onClose: () => { onClose: () => {
@ -65,14 +65,14 @@ request.interceptors.response.use(
} }
break break
case 403: case 403:
vm.$Message.warning({ vm.$message.warning({
content: response.data.msg, content: response.data.msg,
duration: 3 duration: 3
}) })
break break
case 500: case 500:
// 如果是返回的文件 // 如果是返回的文件
vm.$Message.warning({ vm.$message.warning({
content: response.data.msg, content: response.data.msg,
duration: 3 duration: 3
}) })

@ -9,18 +9,25 @@ import MapPoint from "../../../../public/zhenhaiPoint.json";
export default { export default {
name: "FactorMap", name: "FactorMap",
props: { props: {
//
company_list: { company_list: {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
//
video_list: { video_list: {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
//
car_list: {
type: Array,
default: () => [],
},
}, },
data() { data() {
return { return {
center_point: [121.604192, 29.977299], center_point: [121.619992, 30.025703],
}; };
}, },
mounted() { mounted() {
@ -52,14 +59,14 @@ export default {
); );
var marker = new BMap.Marker(point, { icon: myIcon }); // var marker = new BMap.Marker(point, { icon: myIcon }); //
map.addOverlay(marker); map.addOverlay(marker);
marker.addEventListener("click",function() { marker.addEventListener("click", function () {
that.$emit('get_company_text',item) that.$emit("get_company_text", item);
}) });
}); });
// //
that.video_list.forEach((item) => { that.video_list.forEach((item) => {
var video_ponit = new BMap.Point(item.longitude, item.latitude); var video_ponit = new BMap.Point(item.longitude, item.latitude);
// ; // ;
var video_icon = {}; var video_icon = {};
video_icon = new BMap.Icon( video_icon = new BMap.Icon(
require("@/assets/factor/factor01.png"), require("@/assets/factor/factor01.png"),
@ -70,19 +77,45 @@ export default {
); );
var video_marker = new BMap.Marker(video_ponit, { icon: video_icon }); // var video_marker = new BMap.Marker(video_ponit, { icon: video_icon }); //
map.addOverlay(video_marker); map.addOverlay(video_marker);
video_marker.addEventListener("click", function () {
//
that.$emit("get_video_text", item);
}); });
});
//
that.car_list.forEach((item) => {
var car_point = new BMap.Point(item.longitude, item.latitude);
// ;
var car_icon = {};
car_icon = new BMap.Icon(
require("@/assets/factor/factor03.png"),
new BMap.Size(20, 40),
{
imageOffset: new BMap.Size(0, 0, 5), //
}
);
var car_marker = new BMap.Marker(car_point, { icon: car_icon }); //
map.addOverlay(car_marker);
car_marker.addEventListener("click",function() {
//
//
that.$emit('get_car_text',item)
})
});
}, 500); }, 500);
map.centerAndZoom( map.centerAndZoom(
new BMap.Point(this.center_point[0], this.center_point[1]), new BMap.Point(this.center_point[0], this.center_point[1]),
13 14
); // ); //
map.setMinZoom(12); // map.setMinZoom(12); //
map.setMaxZoom(19); map.setMaxZoom(19);
map.enableScrollWheelZoom(true); map.enableScrollWheelZoom(true);
showPoint(); showPoint(); //
for (var i = 0, n = MapLine.features.length; i < n; i++) { // for (var i = 0, n = MapLine.features.length; i < n; i++) {
showBoundaryEx(MapLine.features[i]); // showBoundaryEx(MapLine.features[i]);
} // }
//
showBoundaryEx(MapLine.features[5]); //
//////////////// -- ///////////////// //////////////// -- /////////////////
function showBoundaryEx(city) { function showBoundaryEx(city) {
var paths = []; var paths = [];
@ -164,6 +197,39 @@ export default {
} }
} }
}, },
//
cause_car_line_map(item) {
let BMap = window.BMap;
let map = new BMap.Map("container", {
style: {
styleJson,
},
});
//let that = this; //
//let label = new BMap.Label();
setTimeout(() => {
var point = new BMap.Point(item.longitude, item.latitude)
// ;
var myIcon = {};
myIcon = new BMap.Icon(
require("@/assets/factor/factor03.png"),
new BMap.Size(20, 40),
{
imageOffset: new BMap.Size(0, 0, 5), //
}
);
var marker = new BMap.Marker(point, { icon: myIcon }); //
map.addOverlay(marker);
},500)
map.centerAndZoom(
new BMap.Point(item.longitude, item.latitude),
16
); //
map.setMinZoom(12); //
map.setMaxZoom(19);
map.enableScrollWheelZoom(true);
},
}, },
}; };
</script> </script>

@ -9,7 +9,10 @@
ref="factorMap" ref="factorMap"
:company_list="company_list" :company_list="company_list"
:video_list="video_list" :video_list="video_list"
:car_list="car_list"
@get_company_text="get_company_text" @get_company_text="get_company_text"
@get_video_text="get_video_text"
@get_car_text="get_car_text"
></FactorMap> ></FactorMap>
<!-- 右上方查询部分 --> <!-- 右上方查询部分 -->
<div class="right_search"> <div class="right_search">
@ -45,17 +48,20 @@
<div class="left_check"> <div class="left_check">
<div class="check_title">图层</div> <div class="check_title">图层</div>
<div class="check_body"> <div class="check_body">
<el-button size="small" @click="get_all()"></el-button> <!-- <el-button size="small" @click="get_all()"></el-button> -->
<el-button size="small" @click="get_video()">{{ <el-button size="small" @click="get_video()">{{
this.btn_video this.btn_video
}}</el-button> }}</el-button>
<el-button size="small" @click="get_item()">{{ <el-button size="small" @click="get_item()">{{
this.btn_item this.btn_item
}}</el-button> }}</el-button>
<el-button size="small" @click="get_car()">{{
this.btn_car
}}</el-button>
</div> </div>
</div> </div>
<!-- 公司信息文本展示 --> <!-- 公司信息文本展示 -->
<div v-if="company_flag" class="company_text"> <div v-if="company_flag == '1'" class="company_text">
<!-- 伪弹窗头部 --> <!-- 伪弹窗头部 -->
<div class="text_head"> <div class="text_head">
<div class="title" :title="text_company">{{ text_company }}</div> <div class="title" :title="text_company">{{ text_company }}</div>
@ -110,6 +116,36 @@
{{ footer_text }} {{ footer_text }}
</div> </div>
</div> </div>
<!-- 监控文本展示 -->
<div v-else-if="company_flag == '2'" class="video_text">
<!-- 伪弹窗头部 -->
<div class="text_head">
<div class="title" :title="video.video_name">
{{ video.video_name }}
</div>
<div class="text_icon" @click="close_video">
<i class="el-icon-close"></i>
</div>
</div>
<div class="text_content">
<div class="text_content_item">
<div class="item_text">隶属企业:</div>
<div class="item_value">{{ video.company_name }}</div>
</div>
<div class="text_content_item">
<div class="item_text">监控:</div>
<div class="item_value">{{ video.video_name }}</div>
</div>
<div class="text_content_item">
<div class="item_text">监控状态:</div>
<div class="item_value">{{ video.video_status }}</div>
</div>
</div>
<!-- 跳转 -->
<div class="text_footer" @click="turn_video()">
{{ video_footer_text }}
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -117,7 +153,12 @@
</template> </template>
<script> <script>
import FactorMap from "./components/factorMap"; import FactorMap from "./components/factorMap";
import { statistic, queryCompany, queryVideo } from "@/api/factorResources"; import {
statistic,
queryCompany,
queryVideo,
car_point,
} from "@/api/factorResources";
export default { export default {
name: "factor", name: "factor",
components: { components: {
@ -127,6 +168,7 @@ export default {
return { return {
company_list: [], // company_list: [], //
video_list: [], // video_list: [], //
car_list:[], //
search: { search: {
word: "", word: "",
select: "企业", select: "企业",
@ -137,7 +179,8 @@ export default {
], ],
btn_video: "", // btn_video: "", //
btn_item: "", // btn_item: "", //
company_flag: false, // btn_car:'', //
company_flag: "0", //
/////////// ///////////
text_company: "", text_company: "",
company_address: "", company_address: "",
@ -149,20 +192,30 @@ export default {
safe_person: "", safe_person: "",
company_scope: "", company_scope: "",
footer_text: "查看企业档案>>", footer_text: "查看企业档案>>",
video_footer_text: "查看实时监控>>",
id: "", id: "",
/////////// ///////////
//////////
video: {
video_name: "", //
company_name: "", //
video_status: "", //
},
}; };
}, },
created() { created() {
this.get_list(); this.get_list();
//
this.get_video();
this.get_car_point();
}, },
methods: { methods: {
// //
get_list() { get_list() {
statistic().then((res) => { statistic().then((res) => {
this.company_list = res.data.companyInfoList; // this.company_list = res.data.companyInfoList;
this.btn_item = `园区企业(${res.data.companyInfoList.length})`; this.btn_item = `园区企业(${res.data.companyInfoList.length})`;
this.video_list = res.data.deviceVideoInfoList; // this.video_list = res.data.deviceVideoInfoList;
this.btn_video = `视频监控(${res.data.deviceVideoInfoList.length})`; this.btn_video = `视频监控(${res.data.deviceVideoInfoList.length})`;
}); });
}, },
@ -177,28 +230,48 @@ export default {
}, },
// //
get_item() { get_item() {
this.company_flag = "0";
let param = { let param = {
name: "", name: "",
}; };
queryCompany(param).then((res) => { queryCompany(param).then((res) => {
this.company_list = res.data; this.company_list = res.data;
this.video_list = []; this.video_list = [];
this.car_list = [];
// //
this.$refs.factorMap.init_map(); this.$refs.factorMap.init_map();
}); });
}, },
// //
get_video() { get_video() {
this.company_flag = "0";
let param = { let param = {
name: "", name: "",
}; };
queryVideo(param).then((res) => { queryVideo(param).then((res) => {
this.video_list = res.data; this.video_list = res.data;
this.company_list = []; this.company_list = [];
this.car_list = []
// //
this.$refs.factorMap.init_map(); this.$refs.factorMap.init_map();
}); });
}, },
//
async get_car() {
this.company_flag = '0'
let res = await car_point();
console.log("resss", res);
if(res.code == 200) {
this.car_list = res.data
this.company_list = [];
this.video_list = []
//
this.$refs.factorMap.init_map();
// this.btn_car = `(${res.data.length})`;
} else if (res.code == 500) {
this.$message.warning(res.msg)
}
},
// //
search_map() { search_map() {
let param = { let param = {
@ -223,7 +296,7 @@ export default {
}, },
// //
get_company_text(item) { get_company_text(item) {
this.company_flag = true; this.company_flag = 1;
console.log("item111", item); console.log("item111", item);
this.text_company = item.companyName; this.text_company = item.companyName;
this.company_address = item.companyAddress; this.company_address = item.companyAddress;
@ -237,6 +310,35 @@ export default {
this.company_scope = item.businessScope; this.company_scope = item.businessScope;
this.id = item.id; this.id = item.id;
}, },
//
get_video_text(item) {
this.company_flag = 2;
console.log("item222", item);
this.video.video_name = item.deviceName;
this.video.company_name = item.companyName;
if (item.isOnline == "1") {
this.video.video_status = "在线";
} else if (item.isOnline == "2") {
this.video.video_status = "离线";
}
},
//
get_car_text(item) {
//
console.log('item',item);
this.$refs.factorMap.cause_car_line_map(item)
},
async get_car_point() {
let res = await car_point();
console.log("resss", res);
if(res.code == 200) {
// this.car_list = res.data
this.btn_car = `危化品车辆(${res.data.length})`;
} else if (res.code == 500) {
this.$message.warning(res.msg)
}
},
// //
turn() { turn() {
sessionStorage.setItem("companyID", this.id); sessionStorage.setItem("companyID", this.id);
@ -245,15 +347,19 @@ export default {
name: "archives", name: "archives",
}); });
}, },
turn_video() {},
// //
close_company() { close_company() {
this.company_flag = false; this.company_flag = 0;
},
close_video() {
this.company_flag = 0;
}, },
// //
reset_map() { reset_map() {
this.search.select = "企业"; this.search.select = "企业";
this.search.word = ""; this.search.word = "";
this.get_all(); this.get_video();
}, },
}, },
}; };
@ -314,7 +420,7 @@ export default {
} }
.el-form-item__content { .el-form-item__content {
.el-input__inner { .el-input__inner {
background: #1c2528; background: #212f30;
border: 0.1px solid #28847e; border: 0.1px solid #28847e;
color: #fff; color: #fff;
} }
@ -337,7 +443,7 @@ export default {
.el-button { .el-button {
border: 0.1px solid #28847e; border: 0.1px solid #28847e;
color: #fff; color: #fff;
background: #1c2528; background: #212f30;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
&:before { &:before {
@ -368,7 +474,7 @@ export default {
width: 13vw; width: 13vw;
height: 18vh; height: 18vh;
border: 0.1px solid #28847e; border: 0.1px solid #28847e;
background: #1c2528; background: #212f30;
border-radius: 4px; border-radius: 4px;
position: absolute; position: absolute;
z-index: 20; z-index: 20;
@ -389,14 +495,14 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.el-button { .el-button {
width: 7vw; width: 11vw;
margin-left: 20px; margin-left: 0px;
margin-bottom: 5px; margin-bottom: 5px;
color: #fff; color: #fff;
background: rgba(0, 0, 0, 0); background: rgba(0, 0, 0, 0);
border: 0.1px solid rgba(0, 0, 0, 0); border: 0.1px solid rgba(0, 0, 0, 0);
border-radius: 4px; border-radius: 4px;
text-align: left; text-align: center;
} }
.el-button:focus, .el-button:focus,
.el-button:hover { .el-button:hover {
@ -489,6 +595,79 @@ export default {
cursor: pointer; cursor: pointer;
} }
} }
.video_text {
width: 18vw;
height: 30vh;
position: absolute;
top: 90px;
right: 20px;
border: 0.1px solid #28847e;
border-radius: 4px;
background: #283436;
.text_head {
width: 18vw;
height: 4vh;
display: flex;
justify-content: space-around;
.title {
margin-left: 8px;
width: 15vw;
height: 4vh;
line-height: 4vh;
text-align: left;
color: aliceblue;
text-shadow: 0 0 9px #86d49d;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
letter-spacing: 2px;
cursor: pointer;
}
.text_icon {
width: 2vw;
height: 4vh;
text-align: center;
line-height: 4vh;
color: #e55b5b;
cursor: pointer;
}
.text_icon:hover {
text-shadow: 0 0 9px #86d49d;
}
}
.text_content {
margin-left: 1vw;
width: 16vw;
height: 20vh;
margin-top: 1vh;
.text_content_types {
margin-bottom: 5px;
.types_text {
color: antiquewhite;
}
}
.text_content_item {
margin-bottom: 5px;
display: flex;
.item_text {
width: 5vw;
color: antiquewhite;
}
.item_value {
width: 11vw;
color: #fff;
}
}
}
.text_footer {
width: 18vw;
height: 4vh;
line-height: 4vh;
text-align: center;
color: #34e1b3;
cursor: pointer;
}
}
} }
} }
} }

@ -388,7 +388,7 @@ export default {
right: 14px; right: 14px;
width: 18px; width: 18px;
height: 18px; height: 18px;
background: url('../../../public/pbImg/关闭.png') no-repeat; background: url('../../../public/pbImg/close.png') no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
cursor: pointer; cursor: pointer;
} }
@ -581,7 +581,7 @@ export default {
right: 14px; right: 14px;
width: 18px; width: 18px;
height: 18px; height: 18px;
background: url('../../../public/pbImg/关闭.png') no-repeat; background: url('../../../public/pbImg/close.png') no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
cursor: pointer; cursor: pointer;
} }

@ -137,7 +137,7 @@ export default {
point_text.setStyle({ point_text.setStyle({
width: "340px", width: "340px",
height: "238px", height: "238px",
background: "url(pbImg/气泡弹窗1.png) no-repeat", background: "url(pbImg/dialogback.png) no-repeat",
backgroundSize: "100% 100%", backgroundSize: "100% 100%",
border: "0", border: "0",
color: "#fff", color: "#fff",
@ -146,7 +146,7 @@ export default {
point_text.setContent(` point_text.setContent(`
<div style='width:100%;display:flex;justify-content: space-between;align-items: center;'> <div style='width:100%;display:flex;justify-content: space-between;align-items: center;'>
<h4 style='margin:12px;font-size: 14px;color: #FFE6D9;overflow: hidden;text-overflow: ellipsis;white-space: nowrap; cursor: pointer;'>${item.companyName}</h4> <h4 style='margin:12px;font-size: 14px;color: #FFE6D9;overflow: hidden;text-overflow: ellipsis;white-space: nowrap; cursor: pointer;'>${item.companyName}</h4>
<div class='closeBtn' style='background: url(pbImg/关闭.png) no-repeat;width:20px;height:20px;background-size: 100% 100%;margin-right:10px; cursor: pointer;"'></div></div> <div class='closeBtn' style='background: url(pbImg/close.png) no-repeat;width:20px;height:20px;background-size: 100% 100%;margin-right:10px; cursor: pointer;"'></div></div>
<div style='margin:0 auto;font-size: 14px;width:316px;height:108px;padding:0 12px;background: rgba(108,128,151,0.20);border: 1px solid rgba(73,84,97,1);'> <div style='margin:0 auto;font-size: 14px;width:316px;height:108px;padding:0 12px;background: rgba(108,128,151,0.20);border: 1px solid rgba(73,84,97,1);'>
<h4 style='height:33%;opacity: 0.8;margin:0;line-height:38px;font-weight:300;'><span style="color:#D0DEEE;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">一级指标</span>${item.levelIndexOne}</h4> <h4 style='height:33%;opacity: 0.8;margin:0;line-height:38px;font-weight:300;'><span style="color:#D0DEEE;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">一级指标</span>${item.levelIndexOne}</h4>
<div title="${item.levelIndexThree}" style='height:33%;opacity: 0.8;margin:0;line-height:38px;font-weight:300;overflow:hidden; text-overflow: ellipsis;white-space: nowrap'><span style="color:#D0DEEE;">预警指标</span>"${item.levelIndexThree}"异常</div> <div title="${item.levelIndexThree}" style='height:33%;opacity: 0.8;margin:0;line-height:38px;font-weight:300;overflow:hidden; text-overflow: ellipsis;white-space: nowrap'><span style="color:#D0DEEE;">预警指标</span>"${item.levelIndexThree}"异常</div>

Loading…
Cancel
Save