Commit 7b5403d1 authored by yaqizhang's avatar yaqizhang

隐患危险源修改按钮

parent 8fdf29f9
......@@ -17,11 +17,12 @@
</el-form>
</el-col>
</el-row>
<el-table :data="tableData.pageData" stripe show-summary :summary-method="getTotal" border style="width:100%;" :loading="loading">
<el-table :data="tableData.pageData" stripe show-summary border style="width:100%;" :loading="loading">
<el-table-column prop="unitName" label="企业名称"></el-table-column>
<el-table-column prop="dangerNum" label="危险源数量"></el-table-column>
<el-table-column prop="cameraNum" label="设备监控数量"></el-table-column>
<el-table-column prop="troubleNum" label="隐患数量"></el-table-column>
<el-table-column prop="unitName" label="危险源"></el-table-column>
<el-table-column prop="legalPerson" label="设备监控"></el-table-column>
<el-table-column prop="orgCode" label="职业危害场所"></el-table-column>
<el-table-column prop="legalPersonEmail" label="隐患数量""></el-table-column>
</el-table>
<el-pagination
background
......@@ -68,7 +69,7 @@
that.loading = true;
METHOD.axiosPost(
that,
`/dataStatistics/getDataStatistics`,
`/enterpriseInfo/queryEnterpriseInfo`,
param,
function(res: any) {
that.loading = false;
......@@ -78,52 +79,6 @@
}
);
}
getTotal(param: any) {
const { columns, data } = param;
const sums: any[] = [];
columns.forEach((column: any, index: any) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map((item: { [x: string]: any; }) => Number(item[column.property]));
if (column.property === 'dangerNum') {
sums[index] = values.reduce((prev: any, curr: any) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index];
} else if (column.property === 'troubleNum') {
sums[index] = values.reduce((prev: any, curr: any) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index];
} else if (column.property === 'cameraNum') {
sums[index] = values.reduce((prev: any, curr: any) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index];
} else {
sums[index] = '--';
}
});
return sums;
}
searchFun() {
this.PAGE = { page: 1, size: 10 };
this.getTableData();
......
<template>
<div class="gis">
<div id="mapbox" @click="mapbox">
<div class="gis">
<div id="mapbox">
<div style="position:absolute;left:500px;top:10px">
<button @click="Mutil.tianSlA()" class="map-botton">卫星地图</button>
<button @click="Mutil.tianSlB()" class="map-botton">全景地图</button>
</div>
<div v-show="isShowVideo" v-drag style="display: none;position:absolute;left:1000px;top:10px;z-index: 30;padding: 5px; background-color: rgba(2, 40, 90, 0.8);width: 400px;height: 255px;border-radius: 5px;border: 1px solid #000;">
<div v-show="isShowVideo" v-drag
style="display: none;position:absolute;left:1000px;top:10px;z-index: 30;padding: 5px; background-color: rgba(2, 40, 90, 0.8);width: 400px;height: 255px;border-radius: 5px;border: 1px solid #000;">
<div style="width: 100%;height: 30px;">
<span style="float: left;color: #fff;font-size: 1rem;">{{deviceVideo.deviceName}}</span>
<span @click="closeVideo" style="float: right;margin-right: 10px;font-size: 1.5rem;color: #fff;"class="el-icon-close"></span>
<span @click="closeVideo" style="float: right;margin-right: 10px;font-size: 1.5rem;color: #fff;"
class="el-icon-close"></span>
</div>
<div id="div_video"></div>
</div>
......@@ -18,7 +20,8 @@
</div>
<div style="">
<div style="width: 500px;height: 100%;z-index: 11;background-color: rgba(2, 40, 90, 0.7);position: absolute;top: 0;left: 10px;float: left;">
<div
style="width: 500px;height: 100%;z-index: 11;background-color: rgba(2, 40, 90, 0.7);position: absolute;top: 0;left: 10px;float: left;">
<QyMapone></QyMapone>
</div>
<div class="markBox">
......@@ -26,7 +29,8 @@
<el-tooltip content="企业注册" placement="left" effect="light">
<div class="markbox-click" ref="qyimg" @click="mapqiye" style="position: relative;">
<img width="15px" style="margin-top: 10px;" src="@/assets/mark/markqy.png" />
<img src="@/assets/mark/selected.png" alt="" style="position: absolute;width: 16px; top: 0;right: 0">
<img src="@/assets/mark/selected.png" alt=""
style="position: absolute;width: 16px; top: 0;right: 0">
</div>
</el-tooltip>
......@@ -38,7 +42,8 @@
<el-tooltip content="危险源" placement="left" effect="light">
<div @click="mapwxy" ref="wxyimg" style="position: relative;">
<img width="20px" style="margin-top: 10px;" src="@/assets/mark/weixianyuan.png" />
<img src="@/assets/mark/selected.png" alt="" style="position: absolute;width: 16px; top: 0;right: 0">
<img src="@/assets/mark/selected.png" alt=""
style="position: absolute;width: 16px; top: 0;right: 0">
</div>
</el-tooltip>
......@@ -50,7 +55,8 @@
<el-tooltip content="监控监测点" placement="left" effect="light">
<div @click="mapshipin" ref="shipinimg" style="position: relative;">
<img width="20px" style="margin-top: 10px;" src="@/assets/mark/jiankong.png" />
<img src="@/assets/mark/selected.png" alt="" style="position: absolute;width: 16px; top: 0;right: 0">
<img src="@/assets/mark/selected.png" alt=""
style="position: absolute;width: 16px; top: 0;right: 0">
</div>
</el-tooltip>
......@@ -74,7 +80,8 @@
<el-tooltip content="隐患" placement="left" effect="light">
<div @click="yinhuan" ref="yhimg" style="position: relative;">
<img width="20px" style="margin-top: 10px;" src="@/assets/mark/yinhuan.png" />
<img src="@/assets/mark/selected.png" alt="" style="position: absolute;width: 16px; top: 0;right: 0">
<img src="@/assets/mark/selected.png" alt=""
style="position: absolute;width: 16px; top: 0;right: 0">
</div>
</el-tooltip>
......@@ -84,45 +91,89 @@
</div>
</div>
</div>
</div>
<el-dialog title="危险源" :visible.sync="dialogVisible1">
<el-form ref="goods" :model="goods" label-width="100px" class="demo-ruleForm">
<el-form-item label="名称:" prop="goodsName">
<input type="text"></input>
</el-form-item>
<el-form-item label="物品类型:" prop="category">
<input type="text"></input>
</el-form-item>
<el-form-item label="联系人:" prop="contacts">
<input type="text"></input>
</el-form-item>
<el-form-item label="联系电话:" prop="phone">
<input type="text"></input>
</el-form-item>
<el-form-item label="危险等级:" prop="dangerGrade">
<input type="text"></input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible1 = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible1 = false">确 定</el-button>
</div>
</el-dialog>
<el-dialog title="隐患" :visible.sync="dialogVisible2">
<el-form ref="trouble" :model="trouble" label-width="100px" class="demo-ruleForm">
<el-form-item label="隐患名称:" prop="troubleName">
<input type="text"></input>
</el-form-item>
<el-form-item label="隐患类型:" prop="troubleType">
<input type="text"></input>
</el-form-item>
<el-form-item label="隐患等级:" prop="troubleLevel"">
<input type="text"></input>
</el-form-item>
<el-form-item label="地址:" prop="address">
<input type="text"></input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible2 = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible2 = false">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script lang="ts">
import {
import {
Component,
Vue,
Provide
} from "vue-property-decorator";
import METHOD from "@/utils/methods";
import "@/utils/directive.js";
import {
} from "vue-property-decorator";
import METHOD from "@/utils/methods";
import "@/utils/directive.js";
import {
Icon
} from "element-ui";
import "@/utils/VamapLoad.ts";
import DrawTool from "@/components/drawTool.vue";
import Search from "@/components/search.vue";
import Mutil from "@/utils/mapUtil.js";
import METHOD from "@/utils/methods";
import QyMaptwo from './qyMaptwo.vue';
import QyMapone from './qyMapone.vue';
import vueDrag from 'vue-dragging'
Vue.use(vueDrag)
@Component({
} from "element-ui";
import "@/utils/VamapLoad.ts";
import DrawTool from "@/components/drawTool.vue";
import Search from "@/components/search.vue";
import Mutil from "@/utils/mapUtil.js";
import METHOD from "@/utils/methods";
import QyMaptwo from './qyMaptwo.vue';
import QyMapone from './qyMapone.vue';
import vueDrag from 'vue-dragging'
import { Component, Vue, Provide, Prop, Watch } from "vue-property-decorator";
Vue.use(vueDrag)
@Component({
components: {
DrawTool,
Search,
QyMapone,
QyMaptwo
},
})
export default class GIS extends Vue {
})
export default class GIS extends Vue {
@Provide() Mutil: any;
@Provide() mapLoadDone = false;
@Provide() MAP: any;
@Provide() isShowVideo:boolean=false;
@Provide() player:any;
@Provide() isShowVideo: boolean = false;
@Provide() player: any;
@Provide() mapOption = {
plugin: [{
pName: "MapType",
......@@ -154,8 +205,14 @@ export default class GIS extends Vue {
// city: "石家庄",
// citylimit: true,
// };
@Provide() lastVideoPlayId:any="";
@Prop(Object) goods!: {
};
@Prop(Object) trouble!: {
};
@Provide() lastVideoPlayId: any = "";
@Provide() markersB: any = [];
@Provide() dialogVisible1: Boolean = false;
@Provide() dialogVisible2: Boolean = false;
@Provide() toolobj: any;
@Provide() mouseTool: any; //测量工具
@Provide() toolVisble: boolean = false;
......@@ -245,14 +302,9 @@ export default class GIS extends Vue {
}
getWxyWindowInfo(goodsId: string) {
let that = this;
// (window as any).checkDetail = function (param: string) {
// that.$router.push({
// path: "/EnDetail",
// query: {
// enterpriseId: param
// }
// });
// };
(window as any).dialogVisible1Change = function () {
that.dialogVisible1Change()
};
METHOD.axiosGet(
that,
`/enterpriseGoods/getMapEnterpriseGoodsById/${goodsId}`,
......@@ -267,7 +319,7 @@ export default class GIS extends Vue {
`<p><span>联系电话:</span>${goods.phone}</p>` +
`<p><span>危险等级:</span>${goods.dangerGrade}</p>` +
`</div>` +
`<p class="gengxin"><button>更新</button></p>`;
`<p class="gengxin"><el-button onClick="dialogVisible1Change()" size="small">修改</el-button></p>`;
that.Mutil.addPopup(html, goods.id, goods.longitude, goods.latitude)
}
......@@ -286,15 +338,18 @@ export default class GIS extends Vue {
that.treecheckedObj = res.data;
that.deviceVideo = res.data;
let device = res.data;
that.isShowVideo=true;
that.player.play('http://27.128.189.137:18000/flv/hls/' + that.treecheckedObj.deviceNumber + '.flv' , 1);
that.lastVideoPlayId=that.treecheckedObj.deviceNumber;//记录上次播放的视频ID
that.isShowVideo = true;
that.player.play('http://27.128.189.137:18000/flv/hls/' + that.treecheckedObj.deviceNumber + '.flv', 1);
that.lastVideoPlayId = that.treecheckedObj.deviceNumber;//记录上次播放的视频ID
}
}
);
}
getyinhuanWindowInfo(troubleId: string) {
let that = this;
(window as any).dialogVisible2Change = function () {
that.dialogVisible2Change()
};
this.closeVideo();
METHOD.axiosGet(
that,
......@@ -309,7 +364,7 @@ export default class GIS extends Vue {
`<p><span>隐患等级:</span>${trouble.troubleLevel}</p >` +
`<p><span>地址:</span>${trouble.address}</p >` +
`</div>` +
`<p class="gengxin"><button>更新</button></p>`;
`<p class="gengxin"><el-button onClick="dialogVisible2Change()" size="small">修改</el-button></p>`;
that.Mutil.addPopup(html, trouble.id, trouble.longitude, trouble.latitude)
}
......@@ -317,11 +372,11 @@ export default class GIS extends Vue {
);
}
//关闭视频方法
closeVideo(){
if(this.lastVideoPlayId!=""){
this.player.stop('http://27.128.189.137:18000/flv/hls/'+this.lastVideoPlayId+'.flv' , 1);
closeVideo() {
if (this.lastVideoPlayId != "") {
this.player.stop('http://27.128.189.137:18000/flv/hls/' + this.lastVideoPlayId + '.flv', 1);
}
this.isShowVideo=false;
this.isShowVideo = false;
}
addMark(obj: any, index: any) {
let icon,
......@@ -533,6 +588,12 @@ export default class GIS extends Vue {
created() {
this.getMapData();
}
dialogVisible1Change() {
this.dialogVisible1 = true;
}
dialogVisible2Change() {
this.dialogVisible2 = true;
}
mounted() {
let that = this;
......@@ -543,19 +604,19 @@ export default class GIS extends Vue {
that.MAP = that.Mutil.MAP;
that.Mutil.mapSelectBind((evt: any) => {
//这是地图marker点击回调监听
if(evt.selected[0].get('type')==='qiye'){
if (evt.selected[0].get('type') === 'qiye') {
that.Mutil.closeAllOverlays();
let id = evt.selected[0].get('did');
if (id) that.getPopcon(id);
}else if(evt.selected[0].get('type')==='wxy'){//其他类的气泡
} else if (evt.selected[0].get('type') === 'wxy') {//其他类的气泡
that.Mutil.closeAllOverlays();
let id = evt.selected[0].get('did');
if (id) that.getWxyPopcon(id);
}else if(evt.selected[0].get('type')==='shipin'){//其他类的气泡
} else if (evt.selected[0].get('type') === 'shipin') {//其他类的气泡
that.Mutil.closeAllOverlays();
let id = evt.selected[0].get('did');
if (id) that.getshipinPopcon(id);
}else if(evt.selected[0].get('type')==='yh'){//其他类的气泡
} else if (evt.selected[0].get('type') === 'yh') {//其他类的气泡
that.Mutil.closeAllOverlays();
let id = evt.selected[0].get('did');
if (id) that.getyinhuanPopcon(id);
......@@ -567,56 +628,62 @@ export default class GIS extends Vue {
this.Mutil.getBoundaries("新乐");
}
mapqiye(){
if(this.qiyeVisble){
this.Mutil.visibleMarks(false,"qiye");
this.qiyeVisble=false;
mapqiye() {
if (this.qiyeVisble) {
this.Mutil.visibleMarks(false, "qiye");
this.qiyeVisble = false;
this.$refs.qyimg.lastChild.style.display = "none";
}else{
this.Mutil.visibleMarks(true,"qiye");
this.qiyeVisble=true;
} else {
this.Mutil.visibleMarks(true, "qiye");
this.qiyeVisble = true;
this.$refs.qyimg.lastChild.style.display = "block";
}
}
mapbox(){
let that = this;
that.Mutil.closeAllOverlays();
}
mapwxy(){
if(this.wxyVisble){
this.Mutil.visibleMarks(false,"wxy");
this.wxyVisble=false;
// mapbox(){
// let that = this;
// that.Mutil.closeAllOverlays();
// }
mapwxy() {
if (this.wxyVisble) {
this.Mutil.visibleMarks(false, "wxy");
this.wxyVisble = false;
this.$refs.wxyimg.lastChild.style.display = "none";
}else{
this.Mutil.visibleMarks(true,"wxy");
this.wxyVisble=true;
} else {
this.Mutil.visibleMarks(true, "wxy");
this.wxyVisble = true;
this.$refs.wxyimg.lastChild.style.display = "block";
}
}
mapshipin(){
if(this.shipinVisble){
this.Mutil.visibleMarks(false,"shipin");
this.shipinVisble=false;
mapshipin() {
if (this.shipinVisble) {
this.Mutil.visibleMarks(false, "shipin");
this.shipinVisble = false;
this.$refs.shipinimg.lastChild.style.display = "none";
}else{
this.Mutil.visibleMarks(true,"shipin");
this.shipinVisble=true;
} else {
this.Mutil.visibleMarks(true, "shipin");
this.shipinVisble = true;
this.$refs.shipinimg.lastChild.style.display = "block";
}
}
yinhuan(){
if(this.yinhuanVisble){
this.Mutil.visibleMarks(false,"yh");
this.yinhuanVisble=false;
yinhuan() {
if (this.yinhuanVisble) {
this.Mutil.visibleMarks(false, "yh");
this.yinhuanVisble = false;
this.$refs.yhimg.lastChild.style.display = "none";
}else{
this.Mutil.visibleMarks(true,"yh");
this.yinhuanVisble=true;
} else {
this.Mutil.visibleMarks(true, "yh");
this.yinhuanVisble = true;
this.$refs.yhimg.lastChild.style.display = "block";
}
}
// editFun(row: any) {
// this.dialogTit = "编辑";
// this.formData = Object.assign({}, row);
// this.zjKey++;
// this.dialogVisible = true;
// }
getStatiData() {
let that = this;
METHOD.axiosPost(
......@@ -626,7 +693,7 @@ export default class GIS extends Vue {
function (res: any) {
if (res.code == 0) {
that.tjNumberObj = res.data;
console.log("that.tjNumberObj",that.tjNumberObj)
console.log("that.tjNumberObj", that.tjNumberObj)
let obj = res.data,
arr: any = [];
arr.push({
......@@ -698,67 +765,76 @@ export default class GIS extends Vue {
}
);
}
}
}
</script>
<style lang="scss">
@import "@/utils/public.scss";
.map-botton{
@import "@/utils/public.scss";
.map-botton {
width: 100px;
height: 50px;
outline: none;
z-index: 10;
position:absolute;
}
.gengxin{
position: absolute;
}
.gengxin {
text-align: center;
}
.map-botton:nth-child(1){
left:50px;
}
.map-botton:nth-child(2){
left:160px;
}
.map-botton:nth-child(3){
left:270px;
}
#mapbox {
color: #fff;
}
.map-botton:nth-child(1) {
left: 50px;
}
.map-botton:nth-child(2) {
left: 160px;
}
.map-botton:nth-child(3) {
left: 270px;
}
#mapbox {
width: 100%;
height: 100%;
position: relative;
}
}
.gis {
.gis {
position: relative;
overflow: hidden;
}
/* .div-isShowVideo{
}
/* .div-isShowVideo{
width: 200px;
height: 350px;
} */
/* .div-isShowVideo .divspan{
/* .div-isShowVideo .divspan{
width: 100%;
height: 20px;
} */
.markBox {
.markBox {
z-index: 30;
width:120px;
height:250px;
width: 120px;
height: 250px;
background-color: rgba(2, 40, 90, 0.5);
position: fixed;
bottom: 10px;
right: 20px;
}
.markBox .markbox-div{
}
.markBox .markbox-div {
float: left;
width: 50%;
height: 50px;
text-align: center;
/* background: url(selected.png) right top no-repeat !important;
background-size: 16px !important; */
}
.markBox .markbox-span{
}
.markBox .markbox-span {
float: right;
width: 50%;
height: 50px;
......@@ -767,26 +843,29 @@ export default class GIS extends Vue {
font-size: 2rem;
font-family: 'UnidreamLED';
color: #fff;
}
.markBox div img{
}
.markBox div img {
width: 25px;
/* margin-top: 10px; */
}
.show-box {
}
.show-box {
position: absolute !important;
z-index: 9;
/* background: rgba(204, 204, 204, 0.7); */
top: 4px;
right: 10px;
}
.search-box {
}
.search-box {
position: absolute !important;
top: 14px;
left: 80px;
}
.ol-zoom {
}
.ol-zoom {
top: .5em;
left: 500px !important;
}
}
</style>
\ No newline at end of file
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