|
|
|
@ -105,9 +105,26 @@
|
|
|
|
|
@click.native.stop="handleDeviceReset(scope.row)"
|
|
|
|
|
>装置复位</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button type="text">远程升级</el-button>
|
|
|
|
|
<el-button type="text">获取GPS位置</el-button>
|
|
|
|
|
<el-button type="text">GPS开关</el-button>
|
|
|
|
|
<!-- <el-button type="text">远程升级</el-button> -->
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
@click.native.stop="handleShowGPS(scope.row)"
|
|
|
|
|
>获取GPS位置</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-dropdown
|
|
|
|
|
class="dropgps"
|
|
|
|
|
trigger="click"
|
|
|
|
|
@command="handleCommand"
|
|
|
|
|
>
|
|
|
|
|
<span class="el-dropdown-link">
|
|
|
|
|
GPS开关<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
|
|
</span>
|
|
|
|
|
<el-dropdown-menu slot="dropdown" class="gpsdropStyle">
|
|
|
|
|
<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">GPS开关</el-button> -->
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
@click.native.stop="handleImageCapture(scope.row)"
|
|
|
|
@ -147,6 +164,8 @@ import {
|
|
|
|
|
getTerminalJoggle,
|
|
|
|
|
deleteTerminalJoggle,
|
|
|
|
|
resetTerminalApi,
|
|
|
|
|
getTermGPSJoggle,
|
|
|
|
|
setTermGPSJoggle,
|
|
|
|
|
} from "@/utils/api/index";
|
|
|
|
|
import moment from "moment";
|
|
|
|
|
import addPhotoDialog from "./components/addPhotoDialog.vue";
|
|
|
|
@ -228,6 +247,60 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {});
|
|
|
|
|
},
|
|
|
|
|
//获取GPS位置
|
|
|
|
|
handleShowGPS(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 })
|
|
|
|
|
.then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
if (val == 0) {
|
|
|
|
|
this.$message("关闭GPS");
|
|
|
|
|
} else {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: "成功开启GPS",
|
|
|
|
|
type: "success",
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err); //代码错误、请求失败捕获
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleCommand(command) {
|
|
|
|
|
switch (command) {
|
|
|
|
|
case "open": //开启
|
|
|
|
|
this.changeGPS(1);
|
|
|
|
|
break;
|
|
|
|
|
case "close": //关闭
|
|
|
|
|
this.changeGPS(0);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//图像采集参数
|
|
|
|
|
handleImageCapture(data) {
|
|
|
|
|
this.$refs.imageCaptureref.display();
|
|
|
|
@ -309,5 +382,11 @@ export default {
|
|
|
|
|
margin-top: 16px;
|
|
|
|
|
height: calc(100% - 48px);
|
|
|
|
|
}
|
|
|
|
|
.dropgps {
|
|
|
|
|
color: #409eff;
|
|
|
|
|
margin-left: 16px;
|
|
|
|
|
margin-right: 16px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|