gps,装置信息

hn2.0
fanluyan 2 years ago
parent a1154885c8
commit 46dfe4b127

@ -62,6 +62,17 @@ export function getDeviceList(data) {
},
});
}
//获取最新装置信息aaa
export function getinfoStatus(data) {
return request({
url: "/api/getLastTermInfo",
method: "post",
data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//获取最新装置信息
export function getNewDeviceList(data) {
return request({
@ -459,6 +470,17 @@ export function getTermGPSPosition(data) {
}
// 获取GPS位置
export function getTermLastGPSPosition(data) {
return request({
url: "/api/getTermLastGPSPosition",
method: "post",
data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
// 获取GPS位置
export function getTermGPSJoggle(data) {
return request({
url: "/api/getTermGPS",

@ -49,7 +49,7 @@
<el-form-item label="SIM卡" prop="sim">
<el-input v-model="formInfo.sim" auto-complete="on"></el-input>
</el-form-item>
<el-form-item label="网络类型:" prop="networkId">
<!-- <el-form-item label="网络类型:" prop="networkId">
<el-select v-model="formInfo.networkId" placeholder="请选择">
<el-option v-for="item in networkOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
@ -70,7 +70,7 @@
</el-form-item>
<el-form-item label="投运日期:" prop="putdate">
<el-date-picker v-model="formInfo.putdate" type="date" placeholder="选择日期" value-format="timestamp"></el-date-picker>
</el-form-item>
</el-form-item> -->
<el-divider></el-divider>
<h4>添加通道</h4>
<div class="addchannel" ref="channelBoxref">
@ -175,30 +175,30 @@ export default {
networkOptions: [
{
id: 1,
name:'移动'
name: "移动",
},
{
id: 2,
name:'联通'
name: "联通",
},
{
id: 3,
name:'电信'
}
name: "电信",
},
], //
statusOptions: [
{
id: 1,
name:'在运'
name: "在运",
},
{
id: 2,
name:'停运'
name: "停运",
},
{
id: 3,
name:'调试'
}
name: "调试",
},
], //
rules: {
cmdId: [

@ -7,7 +7,7 @@
width="662px"
@close="handleclose"
>
<div class="gpsbox" v-loading="loading">
<!-- <div class="gpsbox" v-loading="loading">
<p>
<span>经度</span><span>{{ infornr.longitude }}</span>
</p>
@ -17,6 +17,26 @@
<p>
<span>半径</span><span>{{ infornr.radius }}</span>
</p>
</div> -->
<div class="gpsbox" v-loading="loading">
<el-descriptions :column="1" border>
<el-descriptions-item>
<template slot="label"> 采集时间 </template
>{{ $moment(infornr.updatetime).format("YYYY-MM-DD HH:mm:ss") }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 经度 </template>{{ infornr.longitude }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 纬度 </template>{{ infornr.latitude }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 半径 </template>{{ infornr.radius }}
</el-descriptions-item>
</el-descriptions>
<el-button type="text" class="newBtn" @click="getgpsData()"
>获取最新GPS位置</el-button
>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="isShow = false"> </el-button>
@ -24,37 +44,59 @@
</el-dialog>
</template>
<script>
import { getTermGPSJoggle, getTermGPSPosition } from "@/utils/api/index";
import {
getTermLastGPSPosition,
getTermGPSJoggle,
getTermGPSPosition,
} from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
loading: true,
loading: false,
isShow: false,
timer: null,
infornr: {},
i: 0,
queryTime: "", //ID
cmdid: "",
zzcmdid: "",
zztermid: "",
};
},
mounted() {},
methods: {
//
getgpssql() {
getTermLastGPSPosition({
termId: this.zztermid,
})
.then((res) => {
this.infornr = res.data;
// this.$message({
// duration: 1500,
// showClose: true,
// message: "gps",
// type: "success",
// });
})
.catch((err) => {});
},
//
getgpsData(val) {
console.log(val);
getgpsData() {
console.log(this.zzcmdid);
console.log(this.zztermid);
this.loading = true;
//this.cmdid = cmdid;
getTermGPSPosition({
cmdId: val.cmdid,
cmdId: this.zzcmdid,
})
.then((res) => {
this.queryTime = res.data;
this.getNewgpsData(val);
console.log(this.zztermid);
this.getNewgpsData(this.zztermid);
this.timer = window.setInterval(() => {
this.getNewgpsData(val);
this.getNewgpsData(this.zztermid);
this.i++;
}, 5000);
})
@ -64,7 +106,7 @@ export default {
getNewgpsData(val) {
getTermGPSJoggle({
queryTime: this.queryTime,
termid: val.id,
termid: val,
})
.then((res) => {
this.loading = true;
@ -97,8 +139,11 @@ export default {
})
.catch((err) => {});
},
display() {
display(data) {
console.log(data);
this.isShow = true;
this.zzcmdid = data.cmdId;
this.zztermid = data.id;
},
hide() {
this.isShow = false;
@ -107,6 +152,7 @@ export default {
this.i = 0;
clearInterval(this.timer);
this.timer = null;
this.loading = false;
},
},
};
@ -119,6 +165,9 @@ export default {
height: 32px;
font-size: 16px;
}
.newBtn {
margin-top: 14px;
}
}
}
</style>

@ -233,38 +233,10 @@
<el-table-column
fixed="right"
label="操作"
width="340"
width="580"
v-if="roleUser != 2"
>
<template slot-scope="scope">
<el-dropdown
class="dropgps"
trigger="click"
@command="
(command) => {
handleSearchCommand(command, scope.row);
}
"
>
<span class="el-dropdown-link">
数据查询<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="info">基本信息</el-dropdown-item>
<el-dropdown-item command="workStatus"
>工作状态</el-dropdown-item
>
<el-dropdown-item command="runStatus"
>运行状态</el-dropdown-item
>
<el-dropdown-item command="GPS">GPS位置</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button
@click.native.stop="handleParameterSet(scope.row)"
type="text"
>参数配置</el-button
>
<el-button
@click.native.stop="handleRevisePhoto(scope.row)"
type="text"
@ -275,7 +247,7 @@
@click.native.stop="handlepicture(scope.row)"
>图片标记</el-button
>
<!-- <el-button
<el-button
type="text"
@click.native.stop="handleDeviceReset(scope.row)"
>装置复位</el-button
@ -294,7 +266,7 @@
type="text"
@click.native.stop="handleShowGPS(scope.row)"
>获取GPS位置</el-button
> -->
>
<!-- <el-select
class="dropgps"
v-model="gpsvalue"
@ -310,7 +282,7 @@
>
</el-option>
</el-select> -->
<!-- <el-dropdown
<el-dropdown
class="dropgps"
trigger="click"
@command="
@ -326,7 +298,7 @@
<el-dropdown-item command="open">开启GPS</el-dropdown-item>
<el-dropdown-item command="close">关闭GPS</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown> -->
</el-dropdown>
<el-button
type="text"
class="deleteText"
@ -335,7 +307,7 @@
>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="180" v-else>
<el-table-column fixed="right" label="操作" width="380" v-else>
<template slot-scope="scope">
<el-button
@click.native.stop="handleRevisePhoto(scope.row)"
@ -348,7 +320,7 @@
>图片标记</el-button
>
<!-- <el-button
<el-button
type="text"
@click.native.stop="handleShowGPS(scope.row)"
>获取GPS位置</el-button
@ -370,7 +342,7 @@
<el-dropdown-item command="open">开启GPS</el-dropdown-item>
<el-dropdown-item command="close">关闭GPS</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown> -->
</el-dropdown>
<el-button
type="text"
class="deleteText"
@ -527,7 +499,6 @@ export default {
this.getSearchdy();
this.page = 1;
this.pageSize = 20;
this.terminalList();
},
////
@ -575,6 +546,105 @@ export default {
this.$refs.addPhotoDialogref.getdataform(data);
console.log(data);
},
//
handleDeviceReset(data) {
this.$confirm("此操作将复位装置, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
resetTerminalApi({ cmId: data.cmdId })
.then((res) => {
if (res.code == 200) {
this.$message({
duration: 1500,
showClose: true,
message: "装置已复位",
type: "success",
});
} else {
this.$message({
duration: 1500,
showClose: true,
message: res.msg,
type: "error",
});
}
})
.catch((err) => {});
})
.catch(() => {
// this.$message({
// duration: 1500,
// showClose: true,
// type: "info",
// message: "",
// });
});
},
//GPS
handleShowGPS(data) {
// this.$refs.gpsdialog_ref.display();
// this.$refs.gpsdialog_ref.getgpsData(data);
this.$refs.gpsdialog_ref.display(data);
this.$refs.gpsdialog_ref.getgpssql();
console.log(data);
},
//gps
changeGPS(val, row) {
console.log(val, row);
setTermGPSJoggle({ gpsstatus: val, cmdId: row.cmdId })
.then((res) => {
console.log(res);
if (val == 0) {
this.$message({
duration: 1500,
message: "关闭GPS",
type: "success",
showClose: true,
});
} else {
this.$message({
duration: 1500,
message: "成功开启GPS",
type: "success",
showClose: true,
});
}
})
.catch((err) => {
console.log(err); //
});
},
handleCommand(command, row) {
console.log(command, row);
switch (command) {
case "open": //
this.changeGPS(1, row);
break;
case "close": //
this.changeGPS(0, row);
break;
}
},
//
// gpsChange(val) {
// console.log(val);
// },
//
handleImageCapture(data) {
this.$refs.imageCaptureref.display();
this.$refs.imageCaptureref.getSingleAccess(data);
this.$refs.imageCaptureref.getRatio();
},
//
handleVideoCapture(data) {
this.$refs.videoCaptureref.display();
this.$refs.videoCaptureref.getSingleAccess(data);
this.$refs.videoCaptureref.getRatio();
},
//线
handlepicture(data) {
@ -709,7 +779,7 @@ export default {
}
.dropgps {
color: @color-primary;
// margin-left: 16px;
margin-left: 16px;
// margin-right: 16px;
cursor: pointer;
font-size: 12px;

@ -7,7 +7,7 @@
width="662px"
@close="handleclose"
>
<div class="gpsbox" v-loading="loading">
<!-- <div class="gpsbox" v-loading="loading">
<p>
<span>经度</span><span>{{ infornr.longitude }}</span>
</p>
@ -17,6 +17,26 @@
<p>
<span>半径</span><span>{{ infornr.radius }}</span>
</p>
</div> -->
<div class="gpsbox" v-loading="loading">
<el-descriptions :column="1" border>
<el-descriptions-item>
<template slot="label"> 采集时间 </template
>{{ $moment(infornr.updatetime).format("YYYY-MM-DD HH:mm:ss") }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 经度 </template>{{ infornr.longitude }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 纬度 </template>{{ infornr.latitude }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 半径 </template>{{ infornr.radius }}
</el-descriptions-item>
</el-descriptions>
<el-button type="text" class="newBtn" @click="getgpsData()"
>获取最新GPS位置</el-button
>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="isShow = false"> </el-button>
@ -24,14 +44,18 @@
</el-dialog>
</template>
<script>
import { getTermGPSJoggle, getTermGPSPosition } from "@/utils/api/index";
import {
getTermLastGPSPosition,
getTermGPSJoggle,
getTermGPSPosition,
} from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
loading: true,
loading: false,
isShow: false,
timer: null,
infornr: {},
@ -43,15 +67,29 @@ export default {
},
mounted() {},
methods: {
//
getgpssql() {
getTermLastGPSPosition({
termId: this.zztermid,
})
.then((res) => {
this.infornr = res.data;
// this.$message({
// duration: 1500,
// showClose: true,
// message: "gps",
// type: "success",
// });
})
.catch((err) => {});
},
//
getgpsData(zzcmdidval, zztermidval) {
this.zzcmdid = zzcmdidval;
this.zztermid = zztermidval;
getgpsData() {
console.log(this.zzcmdid);
console.log(this.zztermid);
this.loading = true;
getTermGPSPosition({
cmdId: zzcmdidval,
cmdId: this.zzcmdid,
})
.then((res) => {
this.queryTime = res.data;
@ -101,8 +139,10 @@ export default {
})
.catch((err) => {});
},
display() {
display(cmdid, newTermId) {
this.isShow = true;
this.zzcmdid = cmdid;
this.zztermid = newTermId;
},
hide() {
this.isShow = false;
@ -123,6 +163,9 @@ export default {
height: 32px;
font-size: 16px;
}
.newBtn {
margin-top: 14px;
}
}
}
</style>

@ -8,7 +8,7 @@
@close="handleclose"
>
<div class="infoTable" v-loading="loading">
<el-descriptions class="margin-top" :column="1" border>
<el-descriptions :column="1" border>
<el-descriptions-item>
<template slot="label"> 装置编号 </template>{{ cmdid }}
</el-descriptions-item>
@ -46,6 +46,9 @@
}}
</el-descriptions-item>
</el-descriptions>
<el-button type="text" class="newBtn" @click="getListData()"
>获取最新装置信息</el-button
>
</div>
<div slot="footer" class="dialog-footer">
<!-- <el-button @click="isShow = false"> </el-button> -->
@ -54,36 +57,50 @@
</el-dialog>
</template>
<script>
import { getDeviceList, getNewDeviceList } from "@/utils/api/index";
import {
getDeviceList,
getNewDeviceList,
getinfoStatus,
} from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
loading: true,
loading: false,
isShow: false,
infornr: {}, //
timer: null,
i: 0,
queryTime: "", //ID
cmdid: "",
zztermid: "",
};
},
mounted() {},
methods: {
//
getinfo() {
getinfoStatus({
termId: this.zztermid,
})
.then((res) => {
this.infornr = res.data;
})
.catch((err) => {});
},
//
getListData(val, cmdid) {
getListData() {
this.loading = true;
this.cmdid = cmdid;
getDeviceList({
termId: val,
termId: this.zztermid,
})
.then((res) => {
this.queryTime = res.data.queryTime;
this.getNewListData(val);
this.getNewListData(this.zztermid);
this.timer = window.setInterval(() => {
this.getNewListData(val);
this.getNewListData(this.zztermid);
this.i++;
}, 10000);
})
@ -96,17 +113,19 @@ export default {
termId: val,
})
.then((res) => {
this.loading = false;
if (res.code == 200) {
this.infornr = res.data;
if (res.data.isNew == true) {
this.i = 0;
this.$message.success("装置信息已更新");
clearInterval(this.timer);
this.loading = false;
} else if (this.i > 9) {
this.i = 0;
this.$message.warning("暂无响应,请稍后再试!");
clearInterval(this.timer);
this.loading = false;
}
} else {
this.$message.error(res.code.msg);
@ -114,8 +133,15 @@ export default {
})
.catch((err) => {});
},
display() {
// display() {
// this.isShow = true;
// },
display(newTermId, cmdid) {
console.log(newTermId, cmdid);
this.isShow = true;
this.zztermid = newTermId;
this.cmdid = cmdid;
},
hide() {
this.isShow = false;
@ -130,5 +156,8 @@ export default {
</script>
<style lang="less">
.infoDialog {
.newBtn {
margin-top: 14px;
}
}
</style>

@ -740,8 +740,9 @@ export default {
getTermStatus({ termId: this.newTermId }).then((res) => {
console.log(res);
if (res.data.isonline) {
this.$refs.infodialog_ref.display();
this.$refs.infodialog_ref.getListData(this.channelId, this.cmdid);
this.$refs.infodialog_ref.display(this.channelId, this.cmdid);
this.$refs.infodialog_ref.getinfo();
//this.$refs.infodialog_ref.getListData(this.channelId, this.cmdid);
} else {
this.$message({
duration: 1500,
@ -755,9 +756,8 @@ export default {
//GPS
handleShowGPS() {
this.$refs.gpsdialog_ref.display();
this.$refs.gpsdialog_ref.getgpsData(this.cmdid, this.newTermId);
console.log(this.cmdid, this.newTermId);
this.$refs.gpsdialog_ref.display(this.cmdid, this.newTermId);
this.$refs.gpsdialog_ref.getgpssql();
},
//gps

Loading…
Cancel
Save