Commit ae570df8 authored by 王晓倩's avatar 王晓倩

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	gassafety-web/src/views/device/deviceInfo/index.vue
parents 565013a7 2e3171ca
...@@ -8,17 +8,17 @@ ...@@ -8,17 +8,17 @@
<el-form ref="form" :model="form" :rules="rules" label-width="135px"> <el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="所属管道" prop="pipeCode"> <el-form-item label="所属管道" prop="pipeId">
<el-select <el-select
v-model="form.pipeCode" v-model="form.pipeId"
placeholder="请选择所属管道" placeholder="请选择所属管道"
style="width: 100%" style="width: 100%"
> >
<el-option <el-option
v-for="item in pipeList" v-for="item in pipeList"
:key="item.pipeCode" :key="item.pipeId"
:label="item.pipeName" :label="item.pipeName"
:value="item.pipeCode" :value="item.pipeId"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -163,7 +163,7 @@ export default { ...@@ -163,7 +163,7 @@ export default {
pipeList: [], pipeList: [],
rules: { rules: {
pipeCode: [ pipeId: [
{ required: true, message: "请选择所属管道", trigger: "blur" }, { required: true, message: "请选择所属管道", trigger: "blur" },
// { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }, // { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
], ],
...@@ -211,6 +211,8 @@ export default { ...@@ -211,6 +211,8 @@ export default {
}, },
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
// console.log("this.form流量计",this.form)
// return;
if (valid) { if (valid) {
if (this.form.deviceId != null) { if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then((response) => { updateDeviceInfo(this.form).then((response) => {
......
...@@ -8,17 +8,17 @@ ...@@ -8,17 +8,17 @@
<el-form ref="form" :model="form" :rules="rules" label-width="135px"> <el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="所属管道" prop="pipeCode"> <el-form-item label="所属管道" prop="pipeId">
<el-select <el-select
v-model="form.pipeCode" v-model="form.pipeId"
placeholder="请选择所属管道" placeholder="请选择所属管道"
style="width: 100%" style="width: 100%"
> >
<el-option <el-option
v-for="item in pipeList" v-for="item in pipeList"
:key="item.pipeCode" :key="item.pipeId"
:label="item.pipeName" :label="item.pipeName"
:value="item.pipeCode" :value="item.pipeId"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -156,7 +156,7 @@ export default { ...@@ -156,7 +156,7 @@ export default {
fileList: [], fileList: [],
// 表单校验 // 表单校验
rules: { rules: {
pipeCode: [ pipeId: [
{ required: true, message: "请选择所属管道", trigger: "blur" }, { required: true, message: "请选择所属管道", trigger: "blur" },
// { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }, // { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
], ],
...@@ -209,6 +209,8 @@ export default { ...@@ -209,6 +209,8 @@ export default {
}, },
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
// console.log("this.form)",this.form)
if (valid) { if (valid) {
if (this.form.deviceId != null) { if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then((response) => { updateDeviceInfo(this.form).then((response) => {
......
...@@ -8,17 +8,17 @@ ...@@ -8,17 +8,17 @@
<el-form ref="form" :model="form" :rules="rules" label-width="135px"> <el-form ref="form" :model="form" :rules="rules" label-width="135px">
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="所属管道" prop="pipeCode"> <el-form-item label="所属管道" prop="pipeId">
<el-select <el-select
v-model="form.pipeCode" v-model="form.pipeId"
placeholder="请选择所属管道" placeholder="请选择所属管道"
style="width: 100%" style="width: 100%"
> >
<el-option <el-option
v-for="item in pipeList" v-for="item in pipeList"
:key="item.pipeCode" :key="item.pipeId"
:label="item.pipeName" :label="item.pipeName"
:value="item.pipeCode" :value="item.pipeId"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -160,7 +160,7 @@ export default { ...@@ -160,7 +160,7 @@ export default {
fileArr: [], fileArr: [],
pipeList: [], pipeList: [],
rules: { rules: {
pipeCode: [ pipeId: [
{ required: true, message: "请选择所属管道", trigger: "blur" }, { required: true, message: "请选择所属管道", trigger: "blur" },
// { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }, // { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
], ],
...@@ -209,6 +209,7 @@ export default { ...@@ -209,6 +209,7 @@ export default {
}, },
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
// console.log("this.form",this.form)
if (valid) { if (valid) {
if (this.form.deviceId != null) { if (this.form.deviceId != null) {
updateDeviceInfo(this.form).then((response) => { updateDeviceInfo(this.form).then((response) => {
......
...@@ -132,9 +132,10 @@ export default { ...@@ -132,9 +132,10 @@ export default {
deviceMore() { deviceMore() {
console.log(this.obj.polyline.getExtData().lineData) console.log(this.obj.polyline.getExtData().lineData)
this.obj.polyline.getExtData().class.view.$router.push({ this.obj.polyline.getExtData().class.view.$router.push({
path: "/realtimeData/realtimedetail", path: "/dataMonitoring/realtimedetail",
query: { query: {
deviceId: this.obj.polyline.getExtData().lineData.pipeId, deviceId: this.obj.polyline.getExtData().lineData.pipeId,
deviceType:"0"
}, },
}); });
}, },
......
...@@ -23,10 +23,11 @@ ...@@ -23,10 +23,11 @@
<el-button size="small" @click="$emit('dialogcancelFun')">取消</el-button <el-button size="small" @click="$emit('dialogcancelFun')">取消</el-button
> >
</el-row> </el-row>
<div style="width: 47vw; height: 57vh" id="container"></div> <div style="width: 47vw; height: 65vh" id="container"></div>
<el-col :span="8" class="button"> <el-col :span="8" class="button">
<el-input id="ss" placeholder="输入地址" v-model="keyWorld" ></el-input><el-button size="small" type="primary" icon="el-icon-search" @click="search" style="position: fixed;margin-left: 3px;">搜索</el-button> <el-input id="ss" placeholder="输入地址" v-model="keyWorld" ></el-input>
<el-button size="small" type="primary" icon="el-icon-search" @click="search" style="position: fixed;margin-left: 3px;">搜索</el-button>
</el-col> </el-col>
</el-dialog> </el-dialog>
...@@ -47,51 +48,59 @@ ...@@ -47,51 +48,59 @@
keyWorld: "" keyWorld: ""
} }
}, },
mounted(){ watch:{
let that = this; dialogTableVisible:{
that.$nextTick(() => { handler(value) {
//初始化地图 if(value){
let map = new AMap.Map("container", { let that = this;
center: [114.72995, 38.37417], that.$nextTick(() => {
// resizeEnable: true, //初始化地图
disableSocket: true, let map = new AMap.Map("container", {
viewMode: "3D", center: [114.72995, 38.37417],
showLabel: true, // resizeEnable: true,
pitch: 8, disableSocket: true,
zoom: 10 viewMode: "3D",
}); showLabel: true,
map.setFitView(); pitch: 8,
zoom: 12
});
var overlays = [];
//坐标回显
if (typeof that.slng == "number" && that.slng != 0) {
that.lnglat.lng = that.slng;
that.lnglat.lat = that.slat;
let marker = new AMap.Marker({
position: [that.slng,that.slat]
});
marker.setMap(map);
map.setCenter([that.slng,that.slat]);
overlays.push(marker);
}
//坐标回显 //点击获取坐标点
if (typeof that.slng == "number" && that.slng != 0) { var mouseTool = new AMap.MouseTool(map);
that.lnglat.lng = that.slng; //监听draw事件可获取画好的覆盖物
that.lnglat.lat = that.slat; mouseTool.on('draw',function(e){
let marker = new AMap.Marker({ map.remove(overlays);
position: [that.slng,that.slat] overlays.push(e.obj);
}); that.lnglat.lat = e.obj._position.lat;
marker.setMap(map); that.lnglat.lng = e.obj._position.lng;
map.setCenter([that.slng,that.slat]); })
} that.draw(mouseTool);
//点击获取坐标点 //搜索功能
var mouseTool = new AMap.MouseTool(map); AMap.plugin(["AMap.AutoComplete","AMap.PlaceSearch"], function() {
//监听draw事件可获取画好的覆盖物 that.placeSearch = new AMap.PlaceSearch({
var overlays = []; map: map
mouseTool.on('draw',function(e){ });
map.remove(overlays); });
overlays.push(e.obj); })
that.lnglat.lat = e.obj._position.lat; }
that.lnglat.lng = e.obj._position.lng; },
}) // 代表在wacth里声明了firstName这个方法之后立即先去执行handler方法
that.draw(mouseTool); immediate: true
//搜索功能 }
AMap.plugin(["AMap.AutoComplete","AMap.PlaceSearch"], function() {
that.placeSearch = new AMap.PlaceSearch({
map: map
});
});
})
}, },
methods:{ methods:{
confirmFun(){ confirmFun(){
...@@ -123,7 +132,7 @@ ...@@ -123,7 +132,7 @@
.button{ .button{
position: relative; position: relative;
top: -393px; top: -453px;
left: 14px; left: 14px;
} }
......
<template>
<el-dialog
title="拾取坐标"
:visible.sync="dialogTableVisible"
:show-close="false"
:close-on-click-modal="false"
>
<div style="postion:relative">
<el-row :span="8" class="button">
<el-input id="ss" placeholder="输入地址" v-model="keyWorld" ></el-input>
<el-button size="small" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
</el-row>
</div>
<div style="" id="container" ref="elD"></div>
<el-row class="lt">
<el-button type="primary" size="small" @click="confirmFun">确定</el-button>
<el-button size="small" @click="$emit('dialogcancelFun')">取消</el-button>
</el-row>
</el-dialog>
</template>
<script>
import gaodeMap from "./js/gaodeMapDialog.js";
import { getString } from "@/utils/gassafety.js";
export default {
props: {
dialogTableVisible: {
type:Boolean,
},
slat: 0,
slng: 0,
str:{
type:String,
}
},
data(){
return{
lnglat: {
lat: "",
lng: ""
},
keyWorld: "",
map:{},
div:null,
}
},
watch:{
dialogTableVisible:{
handler(value) {
if(value){
window.addEventListener("click", this.barClose);
this.$nextTick(() => {
this.map = new gaodeMap("石家庄");
this.map.addMouseTool();
if(this.str){
this.map.addPolyline([{coordinates:this.str}]);
}
this.map.lineType = 1;
if (this.map.newLineObj == null) {
this.map.createNewLine();
}
})
}else{
console.log("清除事件")
window.removeEventListener("click", this.barClose);
}
},
// 代表在wacth里声明了firstName这个方法之后立即先去执行handler方法
immediate: true
}
},
methods:{
confirmFun(){
console.log("path",this.map.newLineObj.getPath())
const pathArr = this.map.newLineObj.getPath().map(item=>{
return [
item.lng,item.lat
]
})
const str = getString(pathArr)
this.$emit('confirmFun',str);
this.$emit('dialogcancelFun');
},
search(){
this.placeSearch.search(this.keyWorld); //关键字查询查询
},
barClose() {
console.log("window");
this.deviceType = false;
// 关闭当前线条的infowindow
this.map.closeInfoWindow();
this.map.lineFlag = false;
},
},
beforeDestroy() {
},
}
</script>
<style scoped lang="scss">
.dialog{
position:relative;
}
#container{
width: 100%;
height: 500px;
}
.lt{
margin-top: 15px;
text-align: right;
}
.lt .el-input {
width: 120px;
margin-right: 15px;
display: inline-block;
}
.button{
position: absolute;
top: 90px;
left: 30px;
z-index: 999;
}
.button .el-input{
width: 180px;
margin-right: 10px;
display: inline-block;
}
</style>
This diff is collapsed.
...@@ -54,8 +54,11 @@ router.afterEach((to, from) => { ...@@ -54,8 +54,11 @@ router.afterEach((to, from) => {
// console.log('全局后置钩子',to, from) // console.log('全局后置钩子',to, from)
if (to.path == "/enterprise/mapView") { if (to.path == "/enterprise/mapView") {
store.dispatch("app/toggleDevice", "mobile"); store.dispatch("app/toggleDevice", "mobile");
store.dispatch("app/closeSideBar", { withoutAnimation: true });
} else { } else {
store.dispatch("app/toggleDevice", "desktop"); store.dispatch("app/toggleDevice", "desktop");
store.dispatch("app/closeSideBar", { withoutAnimation: false });
} }
NProgress.done(); NProgress.done();
}); });
This diff is collapsed.
...@@ -351,7 +351,8 @@ export default { ...@@ -351,7 +351,8 @@ export default {
this.$router.push({ this.$router.push({
path: '/dataMonitoring/alarmdetail', path: '/dataMonitoring/alarmdetail',
query: { query: {
alarmId: row.alarmId alarmId: row.alarmId,
deviceType:row.deviceType
} }
}) //带参跳转 }) //带参跳转
}, },
......
...@@ -177,7 +177,8 @@ export default { ...@@ -177,7 +177,8 @@ export default {
this.$router.push({ this.$router.push({
path: '/dataMonitoring/realtimedetail', path: '/dataMonitoring/realtimedetail',
query:{ query:{
deviceId : row.deviceId deviceId : row.deviceId,
deviceType: row.deviceType
} }
}) //带参跳转 }) //带参跳转
}, },
......
<template> <template>
<div class="app-container detail" style="background-color: rgb(238, 241, 245);"> <div class="app-container detail" style="background-color: rgb(238, 241, 245);">
<div style="padding-top: 10px;background: #fff;height: 100%;"> <div style="padding-top: 10px;background: #fff;height: 100%;">
<div>
<div style="width: 5%;height: 45px;margin-left: 20px;" @click="$router.go(-1)"> <el-row>
<el-button size="medium" type="text" style="font-size: 18px; color: rgb(7, 63, 112);float: left;">返回 <el-col :span="24" style="padding-left: 15px;">
</el-button> <div style="height: 45px;" @click="$router.go(-1)">
<div style="float: left;margin-top: 8px;margin-left: 5px;"><img src="../../../assets/logo/fanhui.png" <el-button size="medium" type="text" style="font-size: 18px; color: rgb(7, 63, 112);float: left;">返回
style="width: 25px;" alt=""></div> </el-button>
</div> <div style="float: left;margin-top: 8px;margin-left: 5px;"><img src="../../../assets/logo/fanhui.png" style="width: 25px;" alt=""></div>
</div> </div>
</el-col>
<div style="width: 100%;height: 350px;padding: 10px;height: 300px;"> </el-row>
<div style="width: 66.6%;float: left;height: 100%;">
<el-table :data="dataListdetail1" style="width: 100%"> <el-row>
<el-table-column label="设备名称" align="center" prop="deviceName" /> <el-col :span="16" style="padding: 10px;">
<el-table-column label="设备编号" align="center" prop="deviceCode" /> <div style="height: 100%;">
<el-table-column label="设备类型" align="center" prop="deviceType"> <el-table :data="dataListdetail1" style="width: 100%">
<template slot-scope="scope"> <el-table-column label="设备名称" align="center" prop="deviceName" />
<span v-if="scope.row.deviceType == '3'">流量计</span> <el-table-column label="设备编号" align="center" prop="deviceCode" />
<span v-if="scope.row.deviceType == '4'">压力表</span> <el-table-column label="设备类型" align="center" prop="deviceType">
</template> <template slot-scope="scope">
</el-table-column> <span v-if="scope.row.deviceType == '3'">流量计</span>
<el-table-column label="标况累计量" align="center" prop="standardConditionAccumulation" /> <span v-if="scope.row.deviceType == '4'">压力表</span>
</el-table> </template>
</el-table-column>
<el-table :data="dataListdetail2" style="width: 100%;margin-top: 20px;"> <el-table-column label="标况累计量" align="center" prop="standardConditionAccumulation" />
<el-table-column label="工况累计量" align="center" prop="workingConditionAccumulation" /> </el-table>
<el-table-column label="剩余量" align="center" prop="residualQuantity" />
<el-table-column label="标况流量" align="center" prop="standardConditionFlow" /> <el-table :data="dataListdetail2" style="width: 100%;margin-top: 20px;">
<el-table-column label="工况流量" align="center" prop="workingConditionFlow" /> <el-table-column label="工况累计量" align="center" prop="workingConditionAccumulation" />
</el-table> <el-table-column label="剩余量" align="center" prop="residualQuantity" />
<el-table-column label="标况流量" align="center" prop="standardConditionFlow" />
<el-table-column label="工况流量" align="center" prop="workingConditionFlow" />
<el-table :data="dataListdetail3" style="width: 100%;margin-top: 20px;"> </el-table>
<el-table-column label="温度" align="center" prop="temperature" />
<el-table-column label="压力" align="center" prop="pressure" />
<el-table-column label="上报时间" align="center" prop="reportTime" /> <el-table :data="dataListdetail3" style="width: 100%;margin-top: 20px;">
<el-table-column label="设备状态" align="center" prop="deviceStatus"> <el-table-column label="温度" align="center" prop="temperature" />
</el-table-column> <el-table-column label="压力" align="center" prop="pressure" />
</el-table> <el-table-column label="上报时间" align="center" prop="reportTime" />
<el-table-column label="设备状态" align="center" prop="deviceStatus">
</el-table-column>
</el-table>
</div>
<div id="marbox" style="width: 33%;height: 350px; border: 1px solid rgb(218, 213, 213);float: right;margin-top: -45px;">
<div style="width: 100%;height: 100%" id="container"></div>
</div>
</div>
<div v-if="form.deviceType != '4'" style="height: 320px;width: 100%;margin-top: 15px;padding: 10px;">
<div id="main1" style="float: left;width: 49.8%;height:300px;background-color: rgb(247 247 247);padding: 5px;">
<div v-if = "form.deviceReportDataList == null" class="div-null">
<p>暂无数据</p>
</div>
</div> </div>
<div id="main2" style="float: right;width: 49.8%;height:300px;background-color: rgb(247 247 247);padding: 5px;"> </el-col>
<div v-if = "form.deviceReportDataList == null" class="div-null"> <el-col :span="8" style="padding: 10px;padding-left: 0px;">
<p>暂无数据</p> <div id="marbox" style="height: 350px; border: 1px solid rgb(218, 213, 213);margin-top: -45px;">
<div style="width: 100%;height: 100%" id="container"></div>
</div> </div>
</div> </el-col>
</div> </el-row>
<div style="height: 320px;width: 100%;padding: 10px;margin-top: 10px;">
<div v-if="form.deviceType != '4'" id="main3" style="float: left;width: 49.8%;height:300px;background-color: rgb(247 247 247);padding: 5px;"> <template v-if="$route.query.deviceType !='0'">
<div v-if = "form.deviceReportDataList == null" class="div-null"> <el-row v-if="form.deviceType != '4'">
<p>暂无数据</p> <el-col :span="12" style="padding: 10px;">
</div> <div id="main1" style="height:300px;background-color: rgb(247 247 247);padding: 5px;">
</div> <div v-if = "form.deviceReportDataList == null" class="div-null">
<div id="main4" style="float: left;width: 49.8%;margin-left: 5px;height:300px;background-color: rgb(247 247 247);padding: 5px;"> <p>暂无数据</p>
<div v-if = "form.deviceReportDataList == null" class="div-null"> </div>
<p>暂无数据</p> </div>
</div> </el-col>
</div> <el-col :span="12" style="padding: 10px;">
</div> <div id="main2" style="height:300px;background-color: rgb(247 247 247);padding: 5px;">
<div v-if = "form.deviceReportDataList == null" class="div-null">
<p>暂无数据</p>
</div>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="12" style="padding: 10px;" v-if="form.deviceType != '4'">
<div id="main3" style="height:300px;background-color: rgb(247 247 247);padding: 5px;">
<div v-if = "form.deviceReportDataList == null" class="div-null">
<p>暂无数据</p>
</div>
</div>
</el-col>
<el-col :span="12" style="padding: 10px;">
<div id="main4" style="margin-left: 5px;height:300px;background-color: rgb(247 247 247);padding: 5px;">
<div v-if = "form.deviceReportDataList == null" class="div-null">
<p>暂无数据</p>
</div>
</div>
</el-col>
</el-row>
<!-- <div v-if="form.deviceType != '4'" style="height: 320px;width: 100%;margin-top: 15px;padding: 10px;"> -->
<!-- </div> -->
<!-- <div style="height: 320px;width: 100%;padding: 10px;margin-top: 10px;"> -->
<!-- </div> -->
</template>
</div> </div>
......
...@@ -342,6 +342,7 @@ export default { ...@@ -342,6 +342,7 @@ export default {
created() { created() {
// 让左边的框隐藏 // 让左边的框隐藏
this.$store.dispatch("app/toggleDevice", "mobile"); this.$store.dispatch("app/toggleDevice", "mobile");
console.log("sasdasdas")
}, },
mounted() { mounted() {
...@@ -396,7 +397,6 @@ export default { ...@@ -396,7 +397,6 @@ export default {
} }
}); });
}, },
getDeviceInfo(queryParams) { getDeviceInfo(queryParams) {
this.loading = true; this.loading = true;
return getAllDeviceInfo(queryParams).then((response) => { return getAllDeviceInfo(queryParams).then((response) => {
......
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
code: [{ required: true, trigger: "change", message: "验证码不能为空" }] code: [{ required: true, trigger: "change", message: "验证码不能为空" }]
}, },
loading: false, loading: false,
redirect: "/index" redirect: ""
}; };
}, },
watch: { watch: {
...@@ -134,7 +134,9 @@ export default { ...@@ -134,7 +134,9 @@ export default {
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 }); Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
this.$store.dispatch("Login", this.loginForm).then(() => { this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{}); // this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
// console.log(this.redirect)
this.$router.push({ path: "/enterprise/mapView" || "/" }).catch(()=>{});
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.getCode(); this.getCode();
......
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