diff --git a/src/utils/api/index.js b/src/utils/api/index.js index 51a558c..c893de2 100644 --- a/src/utils/api/index.js +++ b/src/utils/api/index.js @@ -658,3 +658,12 @@ export function getTermListByChannelJoggle(data) { data, }); } +//调节焦距 + +export function updateTermCamera(data) { + return request({ + url: "/api/updateTermCamera", + method: "get", + params: data, + }); +} diff --git a/src/views/realTimeMonitor/components/parameterArea.vue b/src/views/realTimeMonitor/components/parameterArea.vue index ee4aa97..904b6a1 100644 --- a/src/views/realTimeMonitor/components/parameterArea.vue +++ b/src/views/realTimeMonitor/components/parameterArea.vue @@ -82,6 +82,42 @@ 主动拍照 --> +
+

焦距调节

+
+ 选择通道 + + + {{ + item.alias !== null && item.alias !== "" + ? item.alias + : item.channelname + }} + + +
+
+ 放大 + 缩小 +
+
@@ -94,7 +130,11 @@ import alarmButton from "./alarmButton.vue"; import cableButton from "./cableButton.vue"; import gpsButton from "./gpsButton.vue"; import parameterSetDialog from "../../photographicDevice/components/parameterSetDialog.vue"; -import { getChannelByTermidJoggle } from "@/utils/api/index"; +import { + getChannelByTermidJoggle, + updateTermCamera, + getTermStatus, +} from "@/utils/api/index"; export default { components: { takePicButton, @@ -110,6 +150,8 @@ export default { return { selectChannelValue: null, //选中的通道 channelListOption: [], //通道数组 + channelarrValue: null, + channelfocalOpyion: [], //焦距通道 dateValue: "", //选择日期 pickerOptions: { disabledDate(date) { @@ -165,7 +207,8 @@ export default { ]; this.channelListOption = this.channelListOption.concat(res.data.list); console.log(this.channelListOption); - + this.channelfocalOpyion = res.data.list; //焦距通道 + this.channelarrValue = this.channelfocalOpyion[0].channelid; this.selectChannelValue = this.channelListOption[0].channelid; //默认选中所有通道; this.$store.commit("channelId", this.selectChannelValue); //通道保存在vuex中 this.$store.commit("channelIdList", res.data.list); //将通道保存在vuex中 @@ -216,6 +259,53 @@ export default { console.log(this.areaData); this.$refs.parameterSetref.display(this.areaData); }, + //焦距放大缩小 + amplify() { + getTermStatus({ termId: this.areaData.id }).then((res) => { + console.log(res); + if (res.data.isonline) { + updateTermCamera({ + termId: this.areaData.id, + channelId: this.channelarrValue, + type: 6, + }) + .then((res) => {}) + .catch(); + //this.$refs.infodialog_ref.getListData(this.channelId, this.cmdid); + } else { + this.$message({ + duration: 1500, + showClose: true, + message: "装置下线,发送指令失败", + type: "error", + }); + } + }); + console.log(this.channelarrValue, this.areaData.id); + }, + //焦距缩小 + reduce() { + getTermStatus({ termId: this.areaData.id }).then((res) => { + console.log(res); + if (res.data.isonline) { + updateTermCamera({ + termId: this.areaData.id, + channelId: this.channelarrValue, + type: 7, + }) + .then((res) => {}) + .catch(); + //this.$refs.infodialog_ref.getListData(this.channelId, this.cmdid); + } else { + this.$message({ + duration: 1500, + showClose: true, + message: "装置下线,发送指令失败", + type: "error", + }); + } + }); + }, }, }; @@ -269,5 +359,38 @@ export default { } } } + .setfocalLength { + margin-bottom: 16px; + position: relative; + h3 { + font-size: 14px; + font-weight: normal; + color: #303133; + margin-bottom: 8px; + } + .selectChannel { + display: flex; + align-items: center; + margin-bottom: 12px; + .labelname { + font-size: 14px; + margin-right: 4px; + width: 80px; + color: #666; + } + } + .buttonGroup { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + .el-button { + margin-bottom: 8px; + width: 104px; + } + .el-button + .el-button { + margin-left: 0px; + } + } + } }