Commit d5f69714 authored by 纪泽龙's avatar 纪泽龙

用户修改完毕

parent 2c4baccf
......@@ -50,6 +50,7 @@
"quill": "1.3.7",
"screenfull": "5.0.2",
"sortablejs": "1.10.2",
"velocity-animate": "^1.5.2",
"vue": "2.6.12",
"vue-count-to": "1.0.13",
"vue-cropper": "0.5.5",
......
import request from '@/utils/request'
/*
* @Author: your name
* @Date: 2022-02-26 16:01:37
* @LastEditTime: 2022-02-26 21:11:12
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafety-progress/gassafetyprogress-web/src/api/detector/detectorInfo.js
*/
import request from "@/utils/request";
// 查询探测器列表
export function listDetectorInfo(query) {
return request({
url: '/detector/detectorInfo/list',
method: 'get',
params: query
})
url: "/detector/detectorInfo/list",
method: "get",
params: {
pageNum: 1,
pageSize: 20,
...query,
},
});
}
// 探测器列表
export function detectorInfoList(query) {
return request({
url: '/detector/detectorInfo/detectorInfoList',
method: 'get',
params: query
})
url: "/detector/detectorInfo/detectorInfoList",
method: "get",
params: query,
});
}
// 新增探测器
export function addDetectorInfo(data) {
return request({
url: '/detector/detectorInfo',
method: 'post',
data: data
})
url: "/detector/detectorInfo",
method: "post",
data: data,
});
}
// 修改探测器
export function updateDetectorInfo(data) {
return request({
url: '/detector/detectorInfo',
method: 'put',
data: data
})
url: "/detector/detectorInfo",
method: "put",
data: data,
});
}
// 删除探测器
export function delDetectorInfo(detectorId) {
return request({
url: '/detector/detectorInfo/' + detectorId,
method: 'delete'
})
url: "/detector/detectorInfo/" + detectorId,
method: "delete",
});
}
// 导出探测器
export function exportDetectorInfo(query) {
return request({
url: '/detector/detectorInfo/export',
method: 'get',
params: query
})
url: "/detector/detectorInfo/export",
method: "get",
params: query,
});
}
// 右上角的综合列表
export function alarmData(query) {
return request({
url: '/detector/detectorInfo/getAlarmData',
method: 'get',
params: query
})
url: "/detector/detectorInfo/getAlarmData",
method: "get",
params: query,
});
}
......@@ -114,7 +114,7 @@ export default {
this.pageCurrent = val;
},
close() {
this.$parent.centerShow(false);
this.$parent.myCenterShow(false);
},
},
};
......
<!--
* @Author: your name
* @Date: 2022-01-27 14:25:45
* @LastEditTime: 2022-02-26 14:16:16
* @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-02-26 21:27:45
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /hello-world/src/views/components/User.vue
* @FilePath: /test/hello-world/src/views/components/deviceA.vue
-->
<template>
<div class="user-wrapper">
<div class="title">{{ deviceData.usrName }}</div>
<div class="devicea-wrapper">
<div class="title">
{{ deviceData.nickName }}
</div>
<div class="close" @click="close">
<img src="@/assets/mapImages/closeBtn.png" alt="" />
</div>
<div class="group flex first">
<div class="left">用户姓名:</div>
<div :title="deviceData.usrName" class="right zzz">
{{ deviceData.usrName }}
<div class="top flex">
<div class="group">
<div class="left">联系人:</div>
<div class="right zzz">{{ deviceData.nickName }}</div>
</div>
<div class="group">
<div class="left">联系电话:</div>
<div class="right zzz">
{{ deviceData.phone }}
</div>
</div>
<div class="group">
<div class="left">联系地址:</div>
<div :title="deviceData.address" class="right last zzz">
{{ deviceData.address || "-" }}
</div>
</div>
</div>
<div class="group flex">
<div class="left">联系方式:</div>
<div v-unValue class="right">{{ deviceData.phone }}</div>
<div class="foot">
<div class="thead flex">
<div class="first">设备类型</div>
<div>设备数量</div>
<div>在线设备</div>
<div>离线设备</div>
<div>历史报警</div>
<div>已处理报警</div>
<div class="last">报警中</div>
</div>
<div class="tbody flex">
<div class="first zzz">{{ 123 }}</div>
<div class="">{{ deviceData.detectorCount }}</div>
<div v-unValue class="">
{{ deviceData.onLineNum }}
</div>
<div v-unValue class="">
{{ deviceData.offLineNum }}
</div>
<div v-unValue class="">
{{ deviceData.historyAlarmNum }}
</div>
<div v-unValue class="">
{{ deviceData.cancelAlarmNum }}
</div>
<div v-unValue class="last zzz">
{{ deviceData.processingAlarmNum }}
</div>
</div>
</div>
<div class="group flex">
<div class="left">用户地址:</div>
<div :title="deviceData.address" class="right zzz">
{{ deviceData.address }}
</div>
<div class="btn">
<div @click="btnClick">感知设备</div>
</div>
<!-- <div class="group flex">
<div class="left">所属公司:</div>
<div class="right">{{ companyType[deviceData.companyType] }}</div>
</div> -->
</div>
</template>
<script>
import { companyType } from "@/utils/mapClass/config.js";
import { companyType, deviceType } from "@/utils/mapClass/config.js";
export default {
data() {
return {
companyType,
deviceType,
};
},
computed: {
......@@ -64,22 +98,29 @@ export default {
this.companyType[item.conpanyId] = item.companyName;
});
}
console.log(this.deviceData);
},
methods: {
close() {
this.mapClass.infowindowClose();
},
btnClick() {
// this.vueRoot.centerDataFunc(this.deviceData.pressureFlows);
this.vueRoot.getDetectorInfoList({ userId: this.deviceData.userId },this.deviceData.nickName);
},
},
};
</script>
<style lang="scss" scoped>
.user-wrapper {
.devicea-wrapper {
background-color: rgba(9, 18, 32, 0.6);
padding: 10px;
position: relative;
width: 300px;
width: 700px;
.title {
// padding-top: 10px;
// padding-left: 10px;
font-size: 14px;
line-height: 14px;
color: #ffffff;
......@@ -90,29 +131,95 @@ export default {
top: 5px;
cursor: pointer;
}
.group {
.top {
margin-top: 10px;
margin-bottom: 10px;
border: 1px solid #cccccc;
border-top: none;
height: 28px;
box-sizing: border-box;
.group {
height: 30px;
flex: 1;
display: flex;
justify-content: space-between;
box-sizing: border-box;
div {
flex: 1;
box-sizing: border-box;
border-right: 1px solid #cccccc;
text-align: center;
font-size: 14px;
color: #ffffff;
line-height: 30px;
padding: 0 5px;
&.last {
border-right: none;
}
}
.left {
text-align: right;
background-color: rgba(255, 255, 255, 0.1);
}
}
}
.middle {
width: 100%;
padding: 5px;
border: 1px solid #ffffff;
box-sizing: border-box;
font-size: 14px;
color: #ffffff;
text-indent: 2em;
margin-bottom: 10px;
}
.foot {
font-size: 14px;
line-height: 28px;
color: #ffffff;
&.first {
border-top: 1px solid #cccccc;
margin-top: 10px;
.thead,
.tbody {
border: 1px solid #cccccc;
div {
flex: 1;
text-align: left;
border-right: 1px solid #cccccc;
box-sizing: border-box;
padding: 0 5px;
}
.first {
flex: 2;
}
.last {
border-right: none;
}
}
div {
flex: 1;
.tbody {
border-top: none;
}
.left {
border-right: 1px solid #cccccc;
background-color: rgba(255, 255, 255, 0.1);
text-align: right;
.thead {
div {
background-color: rgba(255, 255, 255, 0.1);
}
}
.right {
}
.btn {
position: relative;
margin-top: 10px;
text-align: right;
div {
font-size: 14px;
color: #ffffff;
padding: 2px 4px;
box-sizing: border-box;
text-align: left;
padding: 0 1em;
display: inline-block;
cursor: pointer;
border: 1px solid #cccccc;
background-color: #1890ff;
&:hover {
// background: rgba(9, 18, 32, 0.6);
background-color: #18baff;
}
}
}
.flex {
......
<template>
<transition
v-on:before-enter="beforeEnter"
v-on:enter="enter"
v-on:before-leave="beforeLeave"
v-on:leave="leave"
v-bind:css="false"
>
<div v-show="show" class="wrapper center">
<div v-show="show" class="wrapper myCenter">
<div class="left">
<div class="title-wrapper">
<div class="title">{{title}}报警器列表</div>
<div class="title">{{ title }}报警器列表</div>
<div class="close" @click="close">
<img src="@/assets/images/closeBtn.png" alt="" />
<img src="@/assets/mapImages/closeBtn.png" alt="" />
</div>
</div>detectorInfo.
</div>
<div class="bottom right-bottom-data-left">
<el-table
size="mini"
......@@ -26,21 +21,21 @@
<!-- :height="tableHeight" -->
<el-table-column prop="detectorCode" label="设备编号" width="180">
<template slot-scope="scope">
<div :title="scope.row.detectorCode" class="ddd" v-un-content>
<div :title="scope.row.detectorCode" class="ddd" v-unValue>
{{ scope.row.detectorCode }}
</div>
</template>
</el-table-column>
<el-table-column prop="detectorName" label="设备名称" width="100">
<template slot-scope="scope">
<div :title="scope.row.detectorName" class="ddd" v-un-content>
<div :title="scope.row.detectorName" class="ddd" v-unValue>
{{ scope.row.detectorName }}
</div>
</template>
</el-table-column>
<el-table-column prop="medium" label="监测介质" width="">
<template slot-scope="scope">
<div v-un-content>{{ scope.row.medium }}</div>
<div v-unValue>{{ scope.row.medium }}</div>
</template>
</el-table-column>
<el-table-column prop="linkman" label="联系人" width="100">
......@@ -51,16 +46,7 @@
</el-table-column>
<el-table-column prop="alarmTime" label="报警时间" width="200">
<template slot-scope="scope">
<div v-un-content>{{ scope.row.alarmTime }}</div>
</template>
</el-table-column>
<el-table-column prop="alarmValue" label="定位" width="50">
<template slot-scope="scope">
<div
@click="createDetector(scope)"
class="iconfont icon-bjqdw"
></div>
<!-- {{ scope.row.userId }} -->
<div v-unValue>{{ scope.row.alarmTime }}</div>
</template>
</el-table-column>
</el-table>
......@@ -71,7 +57,7 @@
layout="prev, pager, next, jumper"
:total="total"
:hide-on-single-page="total <= pageSize"
:key="total+''+pageSize"
:key="total + '' + pageSize"
>
</el-pagination>
</div>
......@@ -82,13 +68,14 @@
</template>
<script>
import Velocity from "velocity-animate";
import { listDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
// import Velocity from "velocity-animate";
// import { listDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
export default {
props: {
detcetorList: {
type: Array,
default:()=>[],
},
show: {
type: Boolean,
......@@ -109,9 +96,7 @@ export default {
data() {
return {
// 动画效果的切换
animateChange: 0,
fade: "fade",
tableHeight: 600,
// tableHeight: 600,
tableData: [
// {
// deviceCode: "2016-05-05",
......@@ -121,8 +106,7 @@ export default {
// address: "上海市普陀区金沙江路",
// },
],
moveX: 0,
moveY: 0,
};
},
created() {
......@@ -136,6 +120,7 @@ export default {
// if (bol) {
console.log(newData);
this.tableData = [...newData];
// }
},
},
......@@ -145,115 +130,18 @@ export default {
console.log(val);
},
handleCurrentChangvale(val) {
this.$parent.getDetectorInfoList({
userId: this.userId,
pageNum: val,
pageSize: this.pageSize,
},this.title);
this.$parent.getDetectorInfoList(
{
userId: this.userId,
pageNum: val,
pageSize: this.pageSize,
},
this.title
);
},
close() {
this.fade = "fade";
// this.fade = "fade";
this.$parent.centerShow = false;
this.$parent.circleShow = false;
},
// 点击创建点并且定位过去
createDetector(data) {
// 如果有经纬度才能走通,没有套弹框提示
if (data.row.latitude && data.row.longitude) {
this.fade = "scale";
this.$parent.centerShow = false;
this.$parent.circleShow = true;
this.$parent.gaoMap.addMarker("detector_only", data.row);
} else {
this.msgError("数据不完善,无法定位");
}
},
beforeEnter: function (el) {
// 如果点的是关闭
if (this.fade == "fade") {
// 如果点的是定位
el.style.opacity = 0;
console.log(el);
} else {
el.style.transfrom = `translate(${this.moveX},${this.moveY})`;
el.style.transfrom = "scale(0,0)";
}
},
enter: function (el, done) {
if (this.fade == "fade") {
Velocity(
el,
{
opacity: 1,
translateX: "0px",
translateY: "0px",
scaleX: 1,
scaleY: 1,
// scaleX:1,
// scaleY:1
},
{ duration: 0, complete: done }
);
} else {
Velocity(
el,
{
translateX: "0px",
translateY: "0px",
scaleX: 1,
scaleY: 1,
},
{ duration: 300, complete: done }
);
}
},
beforeLeave(el) {
if (this.fade == "fade") {
el.style.opacity = 1;
} else {
el.style.transfrom = "translate(0px,0px)";
el.style.transfrom = "scale(1,1)";
}
},
leave: function (el, done) {
if (this.fade == "fade") {
Velocity(
el,
{
opacity: 0,
},
{ duration: 0, complete: done }
);
} else {
// 列表的位置参数
const { top, left, height, width } = el.getBoundingClientRect();
// 当列表缩下去的右下角的位置参数
const {
top: topC,
left: leftC,
height: heightC,
width: widthC,
} = this.$parent.$refs.circle.getBoundingClientRect();
const moveX = Math.abs(leftC - left) - width / 2 + heightC / 2 + "px";
const moveY = Math.abs(topC - top) - height / 2 + heightC / 2 + "px";
this.moveX = moveX;
this.moveY = moveY;
Velocity(
el,
{
translateX: moveX,
translateY: moveY,
scaleX: 0,
scaleY: 0,
},
{ duration: 300, complete: done }
);
}
},
},
};
......
......@@ -878,6 +878,6 @@
overflow-y: hidden !important;
}
.left{
margin-left: 10px;
/* margin-left: 10px; */
}
</style>
/*
* @Author: your name
* @Date: 2022-02-25 17:07:40
* @LastEditTime: 2022-02-25 17:15:54
* @LastEditTime: 2022-02-26 20:59:40
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/directive/permission/hasValue.js
......@@ -13,7 +13,6 @@
export default {
inserted(el, binding, vnode) {
console.log("el",el)
el.innerHTML = el.innerHTML.replace(/\s+/g, "") ? el.innerHTML : "-";
}
};
/*
* @Author: your name
* @Date: 2022-01-07 11:29:13
* @LastEditTime: 2022-02-18 17:29:27
* @LastEditTime: 2022-02-26 20:59:19
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafety-progress/gassafetyprogress-web/src/main.js
......@@ -85,7 +85,7 @@ Element.Dialog.props.closeOnPressEscape = false;
Vue.use(Element, {
size: Cookies.get("size") || "medium", // set element-ui default size
});
console.log(Element);
Vue.config.productionTip = false;
......
<!--
* @Author: your name
* @Date: 2022-01-11 13:44:17
* @LastEditTime: 2022-02-26 10:08:49
* @LastEditTime: 2022-02-26 21:14:21
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/views/Home.vue
......@@ -11,6 +11,15 @@
<div class="goSystem" @click="$router.push('/index')">进入管理系统</div>
<div id="map"></div>
<Center :show="show" :centerData="centerData" />
<UserCenter
:title="centerTitle"
:show="centerShow"
ref="userCenter"
:detcetorList="detcetorList"
:userId="centerUserId"
:total="centerTotal"
:pageSize="20"
/>
<PipeColor />
<!-- 底部按钮 -->
<div class="home-div">
......@@ -36,12 +45,17 @@
</div>
<!-- 设备按钮 -->
<div class="typelist-div">
<div class="list" v-for="(item,index) in arr" :key="index" :class="item.ischeck==true?'active':''" @click="sel1(index,item)">
{{item.name}}
</div>
<div class="typelist-div">
<div
class="list"
v-for="(item, index) in arr"
:key="index"
:class="item.ischeck == true ? 'active' : ''"
@click="sel1(index, item)"
>
{{ item.name }}
</div>
</div>
<!-- 弹框 -->
<div
......@@ -104,10 +118,10 @@
z-index: 999;
width: 200px;
height: 50px;
color: #339CC9;
color: #339cc9;
"
>
<div style="height: 20px; width: 100%; float: right; font-size: 14px;">
<div style="height: 20px; width: 100%; float: right; font-size: 14px">
{{ nowDate }}&nbsp;{{ nowtime }}&nbsp;{{ nowweek }}
</div>
</div>
......@@ -117,6 +131,8 @@
<script>
// @ is an alias to /src
import { EditorMap } from "@/utils/mapClass/map";
import { listDetectorInfo } from "@/api/detector/detectorInfo";
import { detectorUserList } from "@/api/detector/detectorUser";
import { mapGetters, mapActions } from "vuex";
import {
pipeData,
......@@ -139,6 +155,7 @@ import VideoView from "@/components/bigWindow/VideoView.vue";
import DeviceA from "@/components/bigWindow/DeviceA.vue";
import User from "@/components/bigWindow/User.vue";
import Center from "@/components/bigWindow/Center.vue";
import UserCenter from "@/components/bigWindow/UserCenter.vue";
import PipeColor from "@/components/bigWindow/PipeColor.vue";
// import markerInfoWindow from './components/markerInfoWindow.vue'
......@@ -150,6 +167,7 @@ export default {
leftBar,
rightBar,
Center,
UserCenter,
PipeColor,
},
data() {
......@@ -179,36 +197,43 @@ export default {
name: "中燃韵科",
},
],
arr:[
arr: [
{
val:1,
ischeck:false,
name: "调压箱"
val: 1,
ischeck: false,
name: "调压箱",
},
{
val:2,
ischeck:false,
name: "阀门井"
val: 2,
ischeck: false,
name: "阀门井",
},
{
val:3,
ischeck:false,
name: "场站"
val: 3,
ischeck: false,
name: "场站",
},
{
val:4,
ischeck:false,
name: "用户"
val: 4,
ischeck: false,
name: "用户",
},
{
val:5,
ischeck:false,
name: "监控"
}
val: 5,
ischeck: false,
name: "监控",
},
],
selarr1:[],
};
},
selarr1: [],
// 用户的center数据
detcetorList: [],
centerUserId: null,
centerTotal: null,
centerShow: false,
centerTitle: "",
};
},
computed: {
...mapGetters(["company", "systemSetting"]),
......@@ -260,12 +285,12 @@ export default {
}));
this.selarr = this.company.map((item) => item.conpanyId);
// getPipe() getTyx() getFm() getCz() getVideo() getUser()
this.goMap(getPipe, this.addPipeLine, Line);
this.goMap(getTyx, this.addDevice, DeviceA);
// this.goMap(getPipe, this.addPipeLine, Line);
// this.goMap(getTyx, this.addDevice, DeviceA);
this.goMap(getFm, this.addDevice, DeviceA);
this.goMap(getCz, this.addDevice, DeviceA);
this.goMap(getVideo, this.addDevice, VideoView);
this.goMap(getUser, this.addDevice, User);
// this.goMap(getCz, this.addDevice, DeviceA);
// this.goMap(getVideo, this.addDevice, VideoView);
this.goMap(detectorUserList, this.addDevice, User);
// getVideo().then((res) => {
// console.log("getVideo", res);
// });
......@@ -298,6 +323,12 @@ export default {
goMap(httpFunc, addFunc, component) {
httpFunc().then((res) => {
console.log("resresres", res);
if(!res.data[0].iconType){
res.data.forEach(item=>{
item.iconType =6;
})
}
// 根据数据格式不同,赋值不同,如果是个数组,就用res,如果不是就用res.data
let config = {};
if (Array.isArray(res)) {
......@@ -308,8 +339,8 @@ export default {
addFunc(config, component);
});
},
centerShow(boolean) {
// 其他的设备的center
myCenterShow(boolean) {
this.show = boolean;
},
centerDataFunc(centerData) {
......@@ -317,7 +348,25 @@ export default {
console.log(centerData);
this.show = true;
},
//用户的设备center
getDetectorInfoList(queryParams, title) {
console.log(queryParams);
return listDetectorInfo(queryParams).then((res) => {
console.log("queryParams", res);
if (res.code == 200) {
this.detcetorList = res.rows;
this.centerUserId = queryParams.userId;
// 总数据
this.centerTotal = res.total;
// this.$refs.userCenter.fade = "fade";
this.centerShow = true;
this.centerTitle = title;
// 传递回去
return res.code;
}
});
},
allCompany() {
if (this.selarr.length == this.companyLength) {
this.selarr = [];
......@@ -350,22 +399,20 @@ export default {
this.map.companyFilter(this.selarr);
},
sel1(index,item){
let arr=[...this.arr];
let selarr1=[...this.selarr1];
if(arr[index].ischeck==false){
arr[index].ischeck=true;
selarr1.push(item)
}else{
arr[index].ischeck=false;
var index11=selarr1.indexOf(index)
selarr1.splice(index11,1)
sel1(index, item) {
let arr = [...this.arr];
let selarr1 = [...this.selarr1];
if (arr[index].ischeck == false) {
arr[index].ischeck = true;
selarr1.push(item);
} else {
arr[index].ischeck = false;
var index11 = selarr1.indexOf(index);
selarr1.splice(index11, 1);
}
this.arr=arr;
this.selarr1=selarr1;
this.arr = arr;
this.selarr1 = selarr1;
},
currentTime() {
......@@ -421,11 +468,11 @@ export default {
color: #18baff;
cursor: pointer;
padding: 3px 5px;
border: 1px solid #339CC9;
color: #339CC9;
border: 1px solid #339cc9;
color: #339cc9;
&:hover {
background-color: #053B6A ;
color: #2CD5DB;
background-color: #053b6a;
color: #2cd5db;
}
}
#map {
......@@ -542,7 +589,7 @@ export default {
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.typelist-div{
.typelist-div {
width: 450px;
height: 50px;
z-index: 9999;
......@@ -550,7 +597,7 @@ export default {
bottom: 20%;
left: 40%;
}
.list{
.list {
z-index: 9999;
float: left;
margin-left: 10px;
......@@ -560,12 +607,12 @@ export default {
line-height: 30px;
text-align: center;
background: linear-gradient(86deg, #112238 0%, #086187 62%, #112238 100%);
box-shadow: inset 0px 1px 2px 1px #125C9B;
box-shadow: inset 0px 1px 2px 1px #125c9b;
}
.list.active{
background: linear-gradient(86deg, #112238 0%, #32A3D3 62%, #112238 100%);
box-shadow: inset 0px 1px 2px 1px #125C9B;
.list.active {
background: linear-gradient(86deg, #112238 0%, #32a3d3 62%, #112238 100%);
box-shadow: inset 0px 1px 2px 1px #125c9b;
color: #2ee7e7;
}
</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