Merge branch 'fly' into xy-ly

master
fanluyan 2 years ago
commit 6fe46039ba

@ -407,7 +407,16 @@ export function setVideoParamApi(data) {
//查询图像分辨率 getImageParams
//获取GPS位置触发
export function getTermGPSPosition(data) {
return request({
url: "/api/getTermGPSPosition",
method: "post",
data,
});
}
// 获取GPS位置
export function getTermGPSJoggle(data) {
return request({
url: "/api/getTermGPS",

@ -0,0 +1,122 @@
<template>
<el-dialog
class="gpsPoisitiondialog"
title="GPS位置"
:visible.sync="isShow"
:close-on-click-modal="false"
width="662px"
@close="handleclose"
>
<div class="gpsbox" v-loading="loading">
<p>
<span>经度</span><span>{{ infornr.longitude }}</span>
</p>
<p>
<span>纬度</span><span>{{ infornr.latitude }}</span>
</p>
<p>
<span>半径</span><span>{{ infornr.radius }}</span>
</p>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="isShow = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getTermGPSJoggle, getTermGPSPosition } from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
loading: true,
isShow: false,
timer: null,
infornr: {},
i: 0,
queryTime: "", //ID
cmdid: "",
};
},
mounted() {},
methods: {
//
getgpsData(val) {
console.log(val);
this.loading = true;
//this.cmdid = cmdid;
getTermGPSPosition({
cmdId: val.cmdid,
})
.then((res) => {
this.queryTime = res.data;
this.getNewgpsData(val);
this.timer = window.setInterval(() => {
this.getNewgpsData(val);
this.i++;
}, 5000);
})
.catch((err) => {});
},
//
getNewgpsData(val) {
getTermGPSJoggle({
queryTime: this.queryTime,
termid: val.id,
})
.then((res) => {
this.loading = true;
if (res.code == 200) {
this.infornr = res.data;
if (res.data.hasNew == true) {
this.loading = false;
this.i = 0;
this.$message({
showClose: true,
message: "gps信息已更新",
type: "success",
});
clearInterval(this.timer);
} else if (this.i > 9) {
this.loading = false;
this.i = 0;
this.$message({
showClose: true,
message: "暂未获取到GPS信息请稍后再试",
type: "warning",
});
clearInterval(this.timer);
}
} else {
this.$message.error(res.code.msg);
}
})
.catch((err) => {});
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
handleclose() {
this.i = 0;
clearInterval(this.timer);
this.timer = null;
},
},
};
</script>
<style lang="less">
.gpsPoisitiondialog {
.gpsbox {
p {
line-height: 32px;
height: 32px;
font-size: 16px;
}
}
}
</style>

@ -147,7 +147,7 @@ export default {
preset: [{ required: true, message: "请输入预置位", trigger: "blur" }],
videoFormat: [
{ required: true, message: "请选择视频分辨率", trigger: "blur" },
]
],
},
timer: null,
i: 0,
@ -211,7 +211,7 @@ export default {
getVideoParamnrApi({
// channelId: this.selaccess,
// termId: this.seltermid,
requestId: this.requestId
requestId: this.requestId,
})
.then((res) => {
this.loading = false;
@ -220,13 +220,23 @@ export default {
if (res.data.isNew == true) {
this.searchloading = false;
this.i = 0;
this.$message.success("查询已更新");
this.$message({
showClose: true,
message: "查询已更新",
type: "success",
});
clearInterval(this.timer);
this.timer = null;
} else if (this.i > 9) {
this.searchloading = false;
this.i = 0;
this.$message.warning("暂无响应,请稍后再试!");
this.$message({
showClose: true,
message: "暂无响应,请稍后再试!",
type: "warning",
});
clearInterval(this.timer);
this.timer = null;

@ -165,7 +165,7 @@
>
</el-table-column> -->
<el-table-column fixed="right" label="操作" width="360">
<el-table-column fixed="right" label="操作" width="580">
<template slot-scope="scope">
<el-button
@click.native.stop="handleRevisePhoto(scope.row)"
@ -182,16 +182,44 @@
@click.native.stop="handleDeviceReset(scope.row)"
>装置复位</el-button
>
<!-- <el-button type="text">远程升级</el-button> -->
<!-- <el-button
<el-button
type="text"
@click.native.stop="handleImageCapture(scope.row)"
>图像参数</el-button
>
<el-button
type="text"
@click.native.stop="handleVideoCapture(scope.row)"
>视频参数</el-button
>
<el-button
type="text"
@click.native.stop="handleShowGPS(scope.row)"
>获取GPS位置</el-button
>
<!-- <el-select
class="dropgps"
v-model="gpsvalue"
placeholder="请选择"
popper-class="gpsdropbox"
@change="gpsChange(scope.row)"
>
<el-option
v-for="item in gpsOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select> -->
<el-dropdown
class="dropgps"
trigger="click"
@command="handleCommand"
@command="
(command) => {
handleCommand(command, scope.row);
}
"
>
<span class="el-dropdown-link">
GPS开关<i class="el-icon-arrow-down el-icon--right"></i>
@ -200,18 +228,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-button
type="text"
@click.native.stop="handleImageCapture(scope.row)"
>图像参数</el-button
>
<el-button
type="text"
@click.native.stop="handleVideoCapture(scope.row)"
>视频参数</el-button
>
</el-dropdown>
<el-button
type="text"
class="deleteText"
@ -242,6 +259,7 @@
<imageCapture ref="imageCaptureref"></imageCapture>
<videoCapture ref="videoCaptureref"></videoCapture>
<pictureTags ref="picturetagsref"></pictureTags>
<gps-position ref="gpsdialog_ref"></gps-position>
</div>
</template>
<script>
@ -249,7 +267,6 @@ import {
getTerminalJoggle,
deleteTerminalJoggle,
resetTerminalApi,
getTermGPSJoggle,
setTermGPSJoggle,
} from "@/utils/api/index";
import moment from "moment";
@ -257,12 +274,14 @@ import addPhotoDialog from "./components/addPhotoDialog.vue";
import imageCapture from "./components/imageCapture.vue";
import videoCapture from "./components/videoCapture.vue";
import pictureTags from "./components/pictureTags.vue";
import gpsPosition from "./components/gpsPosition.vue";
export default {
components: {
addPhotoDialog,
imageCapture,
videoCapture,
pictureTags,
gpsPosition,
},
data() {
return {
@ -276,6 +295,18 @@ export default {
pageSize: 20, //
total: 0, //
loading: true,
gpsOptions: [
{
value: "1",
label: "GPS关闭",
},
{
value: "2",
label: "GPS开启",
},
],
gpsvalue: "1",
};
},
methods: {
@ -360,37 +391,23 @@ export default {
},
//GPS
handleShowGPS(data) {
this.$refs.gpsdialog_ref.display();
this.$refs.gpsdialog_ref.getgpsData(data);
console.log(data);
getTermGPSJoggle({ termid: data.id, cmId: data.cmdid })
.then((res) => {
console.log(res);
this.$alert(
"<p><label>经度:</label><span>" +
`${res.data.longitude}` +
"</span></p><p><label>纬度:</label><span>" +
`${res.data.latitude}` +
"</span></p><p><label>半径:</label><span>" +
`${res.data.radius}` +
"</span></p>",
"GPS位置",
{
dangerouslyUseHTMLString: true,
customClass: "messageGps",
}
);
})
.catch((err) => {
console.log(err); //
});
},
//gps
changeGPS(val) {
console.log(val);
setTermGPSJoggle({ gpsstatus: val, termid: this.channelId })
changeGPS(val, row) {
console.log(val, row);
setTermGPSJoggle({ gpsstatus: val, cmdId: row.cmdid })
.then((res) => {
console.log(res);
if (val == 0) {
this.$message("关闭GPS");
this.$message({
message: "关闭GPS",
type: "success",
showClose: true,
});
} else {
this.$message({
message: "成功开启GPS",
@ -403,16 +420,21 @@ export default {
console.log(err); //
});
},
handleCommand(command) {
handleCommand(command, row) {
console.log(command, row);
switch (command) {
case "open": //
this.changeGPS(1);
this.changeGPS(1, row);
break;
case "close": //
this.changeGPS(0);
this.changeGPS(0, row);
break;
}
},
//
// gpsChange(val) {
// console.log(val);
// },
//
handleImageCapture(data) {
this.$refs.imageCaptureref.display();
@ -518,6 +540,23 @@ export default {
margin-left: 16px;
margin-right: 16px;
cursor: pointer;
font-size: 12px;
width: 80px;
.el-input__inner {
padding: 0px;
border: none;
color: @color-primary;
font-size: 12px;
background-color: transparent;
}
}
}
.gpsdropbox {
.el-select-dropdown__item {
line-height: 27px;
padding: 0 15px;
font-size: 12px;
height: 27px;
}
}
</style>

@ -378,7 +378,7 @@ export default {
} else if (this.timernum > 9) {
this.searchloading = false;
this.timernum = 0;
this.$message.warning("暂无时间表!");
this.$message.warning("暂无拍照时间表!");
clearInterval(this.timer);
this.timer = null;
}

Loading…
Cancel
Save