You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xy-frontend/src/views/realTimeMonitor/components/setChannelDialog.vue

1407 lines
43 KiB
Vue

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<el-dialog
class="setChannelDialog"
title="通道设置"
:visible.sync="isShow"
:close-on-click-modal="false"
width="850px"
@close="handleclose"
>
<div class="zzinfo">
装置编号{{ areaData.name
}}<el-button type="text" icon="el-icon-refresh" @click="searchBtn"
>刷新</el-button
>
<el-popover placement="right" width="200" trigger="hover">
<pre>{{ resultJson }}</pre>
<el-button type="text" slot="reference">展示JSON</el-button>
</el-popover>
</div>
<div class="channelsetBox" v-loading="channelsetLoading">
<el-form ref="form" :model="channelForm" label-width="100px">
<!-- <el-form-item label="装置编号">
<el-input v-model="channelForm.zzbh" disabled></el-input>
</el-form-item> -->
<el-form-item label="拍照通道">
<el-radio-group
v-model="channelForm.selectChannel"
@input="changeChannel"
>
<el-radio
v-for="item in channelList"
:key="item.channelid"
:label="item.channelid"
:value="item.channelid"
>
{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channelname
}}</el-radio
>
</el-radio-group>
<el-checkbox
class="usbClass"
label="USB接口"
v-model="channelForm.usbchecked"
></el-checkbox>
</el-form-item>
<div class="photoinfo">
<el-form-item label="照片大小" class="photoSize">
<el-input v-model="channelForm.resolutionCX"></el-input>
<el-input v-model="channelForm.resolutionCY"></el-input>
</el-form-item>
<el-form-item label="压缩率">
<el-input v-model="channelForm.ysl"></el-input>
<span class="infoSpan">(0-100的整数)</span>
</el-form-item>
</div>
<div class="picZoomClass">
<el-form-item label="图片放大">
<el-radio-group v-model="channelForm.isImageZoomEnabled">
<el-radio :label="1">开</el-radio>
<el-radio :label="0">关</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="放大倍数" class="zoomBox">
<el-slider
v-model="channelForm.zoomVal"
:min="1"
:max="4"
:step="0.1"
></el-slider>
<el-tag type="info">{{ channelForm.zoomVal }}</el-tag>
</el-form-item>
<el-form-item label="模板" class="modelclass">
<el-select v-model="channelForm.templateVal" placeholder="请选择">
<el-option
v-for="item in templateOptions"
:key="item.value"
:label="item.name"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</div>
<div class="videoDiv">
<el-form-item label="视频分辨率" class="videoclass">
<el-select
v-model="channelForm.videoSize"
placeholder="请选择"
@change="changevideoChannel"
>
<el-option
v-for="item in videoOptionSize"
:key="item.value"
:label="item.name + '(' + item.label + ')'"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="视频时长">
<el-input v-model="channelForm.videoDuration"></el-input>
<span class="infoSpan">(秒)</span>
</el-form-item>
<el-form-item label="曝光补偿" class="comclass">
<el-select
v-model="channelForm.compensationVal"
placeholder="请选择"
>
<el-option
v-for="item in compensationOptions"
:key="item.value"
:label="item.name"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</div>
<div class="isoDiv">
<el-form-item label="曝光模式">
<el-checkbox
label="自动曝光"
v-model="channelForm.zdbgchecked"
@change="bgchange"
></el-checkbox>
</el-form-item>
<el-form-item label="曝光时间">
<el-input v-model="channelForm.bgsj" :disabled="bgflag"></el-input>
<span class="infoSpan">(ms)</span>
<el-input
v-model="channelForm.expsTimeUs"
:disabled="bgflag"
></el-input>
<span class="infoSpan">(μs)</span>
<span
class="infoSpan"
v-if="
this.channelForm.bgsj !== '' ||
this.channelForm.expsTimeUs !== ''
"
>({{
this.channelForm.bgsj * 1000000 +
this.channelForm.expsTimeUs * 1000
}}ns)</span
>
</el-form-item>
<!-- <el-form-item label="曝光时间"> </el-form-item> -->
<el-form-item label="ISO">
<el-input v-model="channelForm.iso" :disabled="bgflag"></el-input>
</el-form-item>
</div>
<div class="awbBox">
<el-form-item label="对焦模式">
<el-checkbox
label="自动对焦"
v-model="channelForm.zzdjchecked"
></el-checkbox>
</el-form-item>
<el-form-item label="白平衡模式">
<el-select v-model="channelForm.awbMode" placeholder="请选择">
<el-option
v-for="item in awbModeOption"
:key="item.value"
:label="item.name"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</div>
<div class="modelBox">
<el-form-item label="场景选择">
<el-select v-model="channelForm.modelVal" placeholder="请选择">
<el-option
v-for="item in modelOptions"
:key="item.id"
:label="item.chName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-checkbox
class="gmclass"
label="光敏控制"
v-model="channelForm.gmkzchecked"
></el-checkbox>
<div class="wait3Lock">
<el-checkbox
label="等待AE锁定"
v-model="channelForm.aechecked"
></el-checkbox>
<el-checkbox
label="等待AWB锁定"
v-model="channelForm.awbchecked"
></el-checkbox>
<el-checkbox
label="等待AF锁定"
v-model="channelForm.afchecked"
></el-checkbox>
</div>
</div>
<div class="roteAiBox">
<el-form-item label="旋转角度">
<el-select v-model="channelForm.roteval" placeholder="请选择">
<el-option
v-for="item in roteOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="AI识别">
<el-select v-model="channelForm.aival" placeholder="请选择">
<el-option
v-for="item in aiOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</div>
<div class="textAreabox">
<el-form-item label="左上OSD">
<el-input
type="textarea"
rows="3"
v-model="channelForm.ltosd"
></el-input>
<!-- <span class="infoSpan">(多行使用\n换行)</span> -->
</el-form-item>
<el-form-item label="右上OSD">
<el-input
type="textarea"
rows="3"
v-model="channelForm.rtosd"
></el-input>
<!-- <span class="infoSpan">(多行使用\n换行)</span> -->
</el-form-item>
<el-form-item label="左下OSD">
<el-input
type="textarea"
rows="3"
v-model="channelForm.lbosd"
></el-input>
<!-- <span class="infoSpan">(多行使用\n换行)</span> -->
</el-form-item>
<el-form-item label="右下OSD">
<el-input
type="textarea"
rows="3"
v-model="channelForm.rbosd"
></el-input>
<!-- <span class="infoSpan">(多行使用\n换行)</span> -->
</el-form-item>
</div>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleclose" :disabled="channelsetLoading"
>取 消</el-button
>
<el-button
type="primary"
:disabled="channelsetLoading"
@click="handleConfim(false)"
>确 定</el-button
>
<el-button
type="primary"
:disabled="channelsetLoading"
@click="handleConfim(true)"
>保存并关闭</el-button
>
<!-- :loading="channelLoading" -->
</div>
</el-dialog>
</template>
<script>
import {
getChannelListJoggle,
getTermStatus,
setTermCamera,
getTermCameraRequest,
} from "@/utils/api/index";
export default {
props: {},
data() {
return {
channelsetLoading: true,
isShow: false,
channelLoading: false,
channelList: [], //通道选项
channelForm: {
zzbh: "",
selectChannel: "",
resolutionCX: "",
resolutionCY: "",
isImageZoomEnabled: 0,
zoomVal: 1,
videoSize: "",
videoCX: "",
videoCY: "",
videoDuration: 15,
ysl: 80,
usbchecked: "",
zzdjchecked: 1,
zdbgchecked: 1,
gmkzchecked: 0,
aechecked: false,
awbchecked: false,
afchecked: false,
bgsj: "",
expsTimeUs: "",
iso: "",
modelVal: "",
hdrchecked: "",
ywchecked: "",
roteval: "",
aival: "",
ltosd: "",
rtosd: "",
lbosd: "",
rbosd: "",
templateVal: 2,
compensationVal: 0,
awbMode: 1,
},
wait3ALocked: "",
bgflag: false,
modelOptions: [
{
name: "DISABLED",
id: 0,
chName: "0-无场景",
},
{
name: "FACE_PRIORITY",
id: 1,
chName: "1-面部优先",
},
{
name: "ACTION",
id: 2,
chName: "2-动作",
},
{
name: "PORTRAIT",
id: 3,
chName: "3-肖像",
},
{
name: "LANDSCAPE",
id: 4,
chName: "4-风景",
},
{
name: "NIGHT",
id: 5,
chName: "5-夜晚",
},
{
name: "NIGHT_PORTRAIT",
id: 6,
chName: "6-夜间肖像",
},
{
name: "THEATRE",
id: 7,
chName: "7-剧院",
},
{
name: "BEACH",
id: 8,
chName: "8-海滩",
},
{
name: "SNOW",
id: 9,
chName: "9-雪景",
},
{
name: "SUNSET",
id: 10,
chName: "10-日落",
},
{
name: "STEADYPHOTO",
id: 11,
chName: "11-稳定照片",
},
{
name: "FIREWORKS",
id: 12,
chName: "12-烟花",
},
{
name: "SPORTS",
id: 13,
chName: "13-运动",
},
{
name: "PARTY",
id: 14,
chName: "14-聚会",
},
{
name: "CANDLELIGHT",
id: 15,
chName: "15-烛光",
},
{
name: "BARCODE",
id: 16,
chName: "16-条形码",
},
{
name: "18-HDR",
id: 18,
chName: "HDR",
},
],
roteOptions: [
{
value: 0,
label: "0-无旋转",
},
{
value: 1,
label: "1-0°",
},
{
value: 2,
label: "2-90°",
},
{
value: 3,
label: "3-180°",
},
{
value: 4,
label: "4-270°",
},
],
aiOptions: [
{
value: 0,
label: "0-关闭当前通道AI识别",
},
{
value: 1,
label: "1-启用但不绘制区域",
},
{
value: 2,
label: "2-启用并绘制区域",
},
],
pictureSize: [
{
value: 0,
label: "5376X3024",
},
{
value: 1,
label: "1920X1080",
},
{
value: 2,
label: "2048X1536",
},
],
videoOptionSize: [
{
value: 0,
name: "默认",
label: "720X480",
},
{
value: 1,
name: "QVGA",
label: "320X240",
},
{
value: 2,
name: "VGA",
label: "640X480",
},
{
value: 3,
name: "720p",
label: "1280X720",
},
{
value: 4,
name: "1080p",
label: "1920X1080",
},
],
compensationOptions: [
{ name: -4, value: -4 },
{ name: -3, value: -3 },
{ name: -2, value: -2 },
{ name: -1, value: -1 },
{ name: 0, value: 0 },
{ name: 1, value: 1 },
{ name: 2, value: 2 },
{ name: 3, value: 3 },
{ name: 4, value: 4 },
],
templateOptions: [
{ name: "1-预览", value: 1 },
{ name: "2-静态抓拍", value: 2 },
{ name: "3-录像", value: 3 },
{ name: "4-快照", value: 4 },
],
awbModeOption: [
{ name: "0 - 禁用", value: 0 },
{ name: "1 - 启用自动白平衡", value: 1 },
{ name: "2 - 室内白炽灯", value: 2 },
{ name: "3 - 荧光灯照明", value: 3 },
{ name: "4 - 暖色荧光灯照明", value: 4 },
{ name: "5 - 日光", value: 5 },
{ name: "6 - 多云日光", value: 6 },
{ name: "7 - 日落日出", value: 7 },
{ name: "8 - 非阳光直射区域", value: 8 },
],
requestid: "",
searchNum: 0,
searchTimer: null,
setNum: 0,
setTimer: null,
resultJson: [],
};
},
computed: {
areaData() {
return this.$store.state.currentData;
},
waite3alockVal() {
let val = 0;
if (this.channelForm.aechecked) val |= 1;
if (this.channelForm.awbchecked) val |= 2;
if (this.channelForm.afchecked) val |= 4;
return val;
},
},
mounted() {
this.channelForm.zzbh = this.areaData.cmdid;
this.channelForm.roteval = this.roteOptions[0].value;
this.channelForm.videoSize = this.videoOptionSize[0].value;
this.channelForm.aival = this.aiOptions[0].value;
this.channelForm.modelVal = this.modelOptions[0].value;
},
methods: {
//获取通道
getChannelSelect() {
getChannelListJoggle({ termid: this.areaData.id })
.then((res) => {
this.channelList = res.data.list;
if (
Number(localStorage.getItem("channelId")) == 1 ||
Number(localStorage.getItem("channelId")) == -1 ||
Number(localStorage.getItem("channelId")) == 0
) {
this.channelForm.selectChannel = this.channelList[0].channelid;
} else {
this.channelForm.selectChannel = Number(
localStorage.getItem("channelId")
);
}
//this.channelForm.selectChannel = this.channelList[0].channelid;
console.log(this.channelList);
this.changeChannel();
})
.catch((err) => {});
},
//是否选中曝光
bgchange(val) {
console.log(val, "是否选中");
if (val) {
this.bgflag = true;
// this.channelForm.bgsj = "";
// this.channelForm.iso = "";
} else {
this.bgflag = false;
}
},
changevideoChannel() {
console.log(this.channelForm.videoSize);
if (this.channelForm.videoSize == 0) {
// this.channelForm.picSize = this.pictureSize[0].value;
this.channelForm.videoCX = 720;
this.channelForm.videoCY = 480;
} else if (this.channelForm.videoSize == 1) {
//this.channelForm.picSize = this.pictureSize[1].value;
this.channelForm.videoCX = 320;
this.channelForm.videoCY = 240;
} else if (this.channelForm.videoSize == 2) {
this.channelForm.videoCX = 640;
this.channelForm.videoCY = 480;
} else if (this.channelForm.videoSize == 3) {
this.channelForm.videoCX = 1280;
this.channelForm.videoCY = 720;
} else if (this.channelForm.videoSize == 4) {
//this.channelForm.picSize = this.pictureSize[2].value;
this.channelForm.videoCX = 1920;
this.channelForm.videoCY = 1080;
}
},
//修改通道
changeChannel() {
console.log(this.channelForm.selectChannel);
if (this.channelForm.selectChannel == 1) {
// this.channelForm.picSize = this.pictureSize[0].value;
this.channelForm.resolutionCX = 5376;
this.channelForm.resolutionCY = 3024;
} else if (
this.channelForm.selectChannel == 2 ||
this.channelForm.selectChannel == 3
) {
//this.channelForm.picSize = this.pictureSize[1].value;
this.channelForm.resolutionCX = 1920;
this.channelForm.resolutionCY = 1080;
} else if (this.channelForm.selectChannel == 4) {
//this.channelForm.picSize = this.pictureSize[2].value;
this.channelForm.resolutionCX = 2048;
this.channelForm.resolutionCY = 1536;
}
this.searchBtn();
},
handleConfim(flag) {
console.log("点击了确定");
console.log(this.channelForm);
this.channelLoading = true;
//--act=cfg --udp=1 --cmdid=XY-ANDROIDSIM-002 --pathType=1 --updateType=0 --path=data/channels/1.json --configs=3 --name1=osd.leftTop --type1=1 --value1="OSD for LeftTop %%CH%%" --name2=osd.rightTop --type2=255 --value2="OSD for rIGHTTop %%CH%%" --name3=usbCamera --type3=0 --value3=1 --clientid=5 --reqid=TS
getTermStatus({ termId: this.areaData.id }).then((res) => {
console.log(res);
if (res.data.isonline) {
let params = [
{
name: "act",
value: "cfg",
},
{
name: "udp",
value: 1,
},
{
name: "reboot",
value: 0,
},
{
name: "pathType",
value: 1,
},
{
name: "updateType",
value: 1,
},
{
name: "path",
value:
"data/channels/" + this.channelForm.selectChannel + ".json",
},
{
name: "configs",
value: 26,
},
// {
// name: "resolutionCX",
// type: 0,
// value: this.channelForm.resolutionCX,
// },
{ name: "name1", value: "resolutionCX" },
{ name: "value1", value: this.channelForm.resolutionCX },
{ name: "type1", value: 0 },
// {
// name: "resolutionCY",
// type: 0,
// value: this.channelForm.resolutionCY,
// },
{ name: "name2", value: "resolutionCY" },
{ name: "value2", value: this.channelForm.resolutionCY },
{ name: "type2", value: 0 },
// {
// name: "quality",
// type: 0,
// value: this.channelForm.ysl,
// },
{ name: "name3", value: "quality" },
{ name: "value3", value: this.channelForm.ysl },
{ name: "type3", value: 0 },
// {
// name: "usbCamera",
// type: 0,
// value: this.channelForm.usbchecked ? 1 : 0,
// },
{ name: "name4", value: "usbCamera" },
{ name: "value4", value: this.channelForm.usbchecked ? 1 : 0 },
{ name: "type4", value: 0 },
// {
// name: "autoFocus",
// type: 0,
// value: this.channelForm.zzdjchecked ? 1 : 0,
// },
{ name: "name5", value: "autoFocus" },
{ name: "value5", value: this.channelForm.zzdjchecked ? 1 : 0 },
{ name: "type5", value: 0 },
// {
// name: "autoExposure",
// type: 0,
// value: this.channelForm.zdbgchecked ? 1 : 0,
// },
{ name: "name6", value: "autoExposure" },
{ name: "value6", value: this.channelForm.zdbgchecked ? 1 : 0 },
{ name: "type6", value: 0 },
// {
// name: "exposureTime",
// type: 0,
// value: this.channelForm.bgsj,
// },
{ name: "name7", value: "exposureTime" },
{ name: "value7", value: this.channelForm.bgsj },
{ name: "type7", value: 0 },
// {
// name: "sensitivity",
// type: 0,
// value: this.channelForm.iso,
// },
{ name: "name8", value: "sensitivity" },
{ name: "value8", value: this.channelForm.iso },
{ name: "type8", value: 0 },
// {
// name: "hdrMode",
// type: 0,
// value: this.channelForm.hdrchecked ? 1 : 0,
// },
{ name: "name9", value: "sceneMode" },
{ name: "value9", value: this.channelForm.modelVal },
{ name: "type9", value: 0 },
// {
// name: "nightMode",
// type: 0,
// value: this.channelForm.ywchecked ? 1 : 0,
// },
// { name: "name10", value: "nightMode" },
// { name: "value10", value: this.channelForm.ywchecked ? 1 : 0 },
// { name: "type10", value: 0 },
// {
// name: "orientation",
// type: 0,
// value: this.channelForm.roteval,
// },
{ name: "name10", value: "orientation" },
{ name: "value10", value: this.channelForm.roteval },
{ name: "type10", value: 0 },
// {
// name: "recognization",
// type: 0,
// value: this.channelForm.aival,
// },
{ name: "name11", value: "recognization" },
{ name: "value11", value: this.channelForm.aival },
{ name: "type11", value: 0 },
// {
// name: "osd.leftTop",
// type: 1,
// value: this.channelForm.ltosd,
// },
{ name: "name12", value: "osd.leftTop" },
{
name: "value12",
value:
this.channelForm.ltosd == null ? "" : this.channelForm.ltosd,
},
{ name: "type12", value: 1 },
// {
// name: "osd.rightTop",
// type: 1,
// value: this.channelForm.rtosd,
// },
{ name: "name13", value: "osd.rightTop" },
{
name: "value13",
value:
this.channelForm.rtosd == null ? "" : this.channelForm.rtosd,
},
{ name: "type13", value: 1 },
// {
// name: "osd.rightBottom",
// type: 1,
// value: this.channelForm.lbosd,
// },
{ name: "name14", value: "osd.leftBottom" },
{
name: "value14",
value:
this.channelForm.lbosd == null ? "" : this.channelForm.lbosd,
},
{ name: "type14", value: 1 },
// {
// name: "osd.leftBottom",
// type: 1,
// value: this.channelForm.rbosd,
// },
{ name: "name15", value: "osd.rightBottom" },
{
name: "value15",
value:
this.channelForm.rbosd == null ? "" : this.channelForm.rbosd,
},
{ name: "type15", value: 1 },
//视频分辨率
{ name: "name16", value: "videoCX" },
{ name: "value16", value: this.channelForm.videoCX },
{ name: "type16", value: 0 },
{ name: "name17", value: "videoCY" },
{ name: "value17", value: this.channelForm.videoCY },
{ name: "type17", value: 0 },
//视频时长
{ name: "name18", value: "videoDuration" },
{ name: "value18", value: this.channelForm.videoDuration },
{ name: "type18", value: 0 },
//图片放大
{ name: "name19", value: "zoom" },
{ name: "value19", value: this.channelForm.isImageZoomEnabled },
{ name: "type19", value: 0 },
//放大倍数
{ name: "name20", value: "zoomRatio" },
{ name: "value20", value: this.channelForm.zoomVal },
{ name: "type20", value: 0 },
//compensation
{ name: "name21", value: "compensation" },
{ name: "value21", value: this.channelForm.compensationVal },
{ name: "type21", value: 0 },
//光敏控制
{ name: "name22", value: "ldrEnabled" },
{ name: "value22", value: this.channelForm.gmkzchecked ? 1 : 0 },
{ name: "type22", value: 0 },
//模板template
{ name: "name23", value: "requestTemplate" },
{ name: "value23", value: this.channelForm.templateVal },
{ name: "type23", value: 0 },
//曝光时间
{ name: "name24", value: "expsTimeUs" },
{ name: "value24", value: this.channelForm.expsTimeUs },
{ name: "type24", value: 0 },
//wait3Lock
{ name: "name25", value: "wait3ALocked" },
{ name: "value25", value: this.waite3alockVal },
{ name: "type25", value: 0 },
//awbMode
{ name: "name26", value: "awbMode" },
{ name: "value26", value: this.channelForm.awbMode },
{ name: "type26", value: 0 },
];
console.log(params);
this.setTermFn(params, flag);
} else {
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
});
},
setTermFn(val, flag) {
setTermCamera({
termId: this.areaData.id,
list: val,
})
.then((res) => {
console.log(res);
this.requestid = res.data.requestId;
this.getTakechannelStatus(flag);
clearInterval(this.setTimer);
this.setTimer = window.setInterval(() => {
this.getTakechannelStatus(flag);
this.setNum++;
}, 1000);
})
.catch((err) => {});
},
getTakechannelStatus(flag) {
console.log("aaaaaaaaaaaaaaaaaaaaaa", flag);
getTermCameraRequest({ requestid: this.requestid })
.then((res) => {
console.log(res);
if (res.data.success == 1) {
window.clearInterval(this.setTimer);
this.setTimer = null;
this.setNum = 0;
if (flag) {
this.isShow = false;
}
//this.isShow = false;
this.channelLoading = false;
this.$message({
duration: 1500,
showClose: true,
message: "通道设置成功",
type: "success",
});
} else if (this.setNum > 3) {
// this.isShow = false;
if (flag) {
this.isShow = false;
}
window.clearInterval(this.setTimer);
this.setTimer = null;
this.setNum = 0;
this.channelLoading = false;
this.$message({
duration: 1500,
showClose: true,
message: "通道设置失败",
type: "error",
});
}
})
.catch((err) => {});
},
searchBtn() {
this.channelsetLoading = true;
//--act=cfg --udp=1 --cmdid=XY-ANDROIDSIM-002 --pathType=1 --updateType=0 --path=data/channels/1.json --configs=3 --name1=osd.leftTop --type1=1 --value1="OSD for LeftTop %%CH%%" --name2=osd.rightTop --type2=255 --value2="OSD for rIGHTTop %%CH%%" --name3=usbCamera --type3=0 --value3=1 --clientid=5 --reqid=TS
getTermStatus({ termId: this.areaData.id }).then((res) => {
console.log(res);
if (res.data.isonline) {
let params = [
{
name: "act",
value: "cfg",
},
{
name: "udp",
value: 1,
},
{
name: "pathType",
value: 1,
},
{
name: "updateType",
value: 0,
},
{
name: "path",
value:
"data/channels/" + this.channelForm.selectChannel + ".json",
},
];
console.log(params);
this.searchTermFn(params);
} else {
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
});
},
searchTermFn(val) {
setTermCamera({
termId: this.areaData.id,
list: val,
})
.then((res) => {
console.log(res);
this.requestid = res.data.requestId;
this.getsearchchannelStatus();
clearInterval(this.searchTimer);
this.searchTimer = window.setInterval(() => {
this.getsearchchannelStatus();
this.searchNum++;
}, 1000);
})
.catch((err) => {});
},
getsearchchannelStatus() {
getTermCameraRequest({ requestid: this.requestid })
.then((res) => {
console.log(res);
if (res.data.success == 1) {
window.clearInterval(this.searchTimer);
this.searchTimer = null;
this.searchNum = 0;
this.channelsetLoading = false;
// this.isShow = false;
// this.channelLoading = false;
console.log(res.data);
console.log(JSON.parse(res.data.data));
const resultData = JSON.parse(res.data.data);
if (resultData.hasOwnProperty("content")) {
const resultContent = JSON.parse(
decodeURIComponent(escape(window.atob(resultData.content)))
);
this.resultJson = resultContent;
console.log(resultContent);
this.channelForm.resolutionCX = resultContent.resolutionCX;
this.channelForm.resolutionCY = resultContent.resolutionCY;
this.channelForm.ysl = resultContent.quality;
this.channelForm.usbchecked =
resultContent.usbCamera == 1 ? true : false;
this.channelForm.zzdjchecked =
resultContent.autoFocus == 1 ? true : false;
this.channelForm.zdbgchecked =
resultContent.autoExposure == 1 ? true : false;
this.channelForm.gmkzchecked =
resultContent.ldrEnabled == 1 ? true : false;
this.channelForm.bgsj =
resultContent.exposureTime == 0
? ""
: resultContent.exposureTime;
this.channelForm.expsTimeUs =
resultContent.expsTimeUs == 0 ? "" : resultContent.expsTimeUs;
this.channelForm.iso =
resultContent.sensitivity == 0 ? "" : resultContent.sensitivity;
this.channelForm.modelVal = resultContent.sceneMode;
// this.channelForm.hdrchecked =
// resultContent.hdrMode == 1 ? true : false;
// this.channelForm.ywchecked =
// resultContent.nightMode == 1 ? true : false;
this.channelForm.awbMode = resultContent.awbMode;
this.wait3ALocked = resultContent.wait3ALocked;
console.log("三个选中", this.wait3ALocked);
this.channelForm.aechecked = (this.wait3ALocked & 1) === 1;
this.channelForm.awbchecked = (this.wait3ALocked & 2) === 2;
this.channelForm.afchecked = (this.wait3ALocked & 4) === 4;
this.channelForm.compensationVal = resultContent.compensation;
this.channelForm.aival = resultContent.recognization;
this.channelForm.roteval = resultContent.orientation;
this.channelForm.rtosd =
resultContent.osd.rightTop != "null"
? resultContent.osd.rightTop
: "";
this.channelForm.ltosd =
resultContent.osd.leftTop != "null"
? resultContent.osd.leftTop
: "";
this.channelForm.lbosd =
resultContent.osd.leftBottom != "null"
? resultContent.osd.leftBottom
: "";
this.channelForm.rbosd =
resultContent.osd.rightBottom != "null"
? resultContent.osd.rightBottom
: "";
// this.channelForm.videoSize = resultContent.;
this.channelForm.videoCX = resultContent.videoCX;
this.channelForm.videoCY = resultContent.videoCY;
if (this.channelForm.zdbgchecked) {
this.bgflag = true;
// this.channelForm.bgsj = "";
// this.channelForm.iso = "";
// this.channelForm.expsTimeUs = "";
} else {
this.bgflag = false;
}
if (
this.channelForm.videoCX == 720 &&
this.channelForm.videoCY == 480
) {
// this.channelForm.picSize = this.pictureSize[0].value;
this.channelForm.videoSize = 0;
} else if (
this.channelForm.videoCX == 320 &&
this.channelForm.videoCY == 240
) {
//this.channelForm.picSize = this.pictureSize[1].value;
this.channelForm.videoSize = 1;
} else if (
this.channelForm.videoCX == 640 &&
this.channelForm.videoCY == 480
) {
this.channelForm.videoSize = 2;
} else if (
this.channelForm.videoCX == 1280 &&
this.channelForm.videoCY == 720
) {
this.channelForm.videoSize = 3;
} else if (
this.channelForm.videoCX == 1920 &&
this.channelForm.videoCY == 1080
) {
//this.channelForm.picSize = this.pictureSize[2].value;
this.channelForm.videoSize = 4;
}
this.channelForm.videoDuration = resultContent.videoDuration;
this.channelForm.templateVal = resultContent.requestTemplate;
} else {
this.channelForm.zzbh = "";
this.channelForm.ysl = 80;
this.channelForm.usbchecked = "";
this.channelForm.zzdjchecked = 1;
this.channelForm.zdbgchecked = 1;
this.channelForm.gmkzchecked = 0;
this.channelForm.bgsj = "";
this.channelForm.expsTimeUs = "";
this.channelForm.iso = "";
this.channelForm.modelVal = "";
this.channelForm.compensationVal = 0;
// this.channelForm.hdrchecked = "";
// this.channelForm.ywchecked = "";
this.channelForm.awbMode = 1;
this.channelForm.aechecked = false;
this.channelForm.awbchecked = false;
this.channelForm.afchecked = false;
this.channelForm.rtosd = "";
this.channelForm.ltosd = "";
this.channelForm.lbosd = "";
this.channelForm.rbosd = "";
this.channelForm.videoSize = "";
this.channelForm.videoCX = "";
this.channelForm.videoCY = "";
this.channelForm.videoDuration = 15;
this.channelForm.templateVal = 2;
}
this.$message({
duration: 1500,
showClose: true,
message: "通道查询成功",
type: "success",
});
} else if (this.searchNum > 3) {
// this.isShow = false;
// this.channelLoading = false;
window.clearInterval(this.searchTimer);
this.searchTimer = null;
this.searchNum = 0;
this.channelsetLoading = false;
this.$message({
duration: 1500,
showClose: true,
message: "通道查询失败",
type: "error",
});
}
})
.catch((err) => {});
},
display() {
this.isShow = true;
this.channelForm.zzbh = this.areaData.cmdid;
this.getChannelSelect();
this.changevideoChannel();
console.log(this.areaData);
},
handleclose() {
this.isShow = false;
this.bgflag = false;
this.channelLoading = false;
this.channelForm.zzbh = "";
this.channelForm.ysl = 80;
this.channelForm.usbchecked = "";
this.channelForm.zzdjchecked = 1;
this.channelForm.zdbgchecked = 1;
this.channelForm.gmkzchecked = 0;
this.channelForm.bgsj = "";
this.channelForm.expsTimeUs = "";
this.channelForm.iso = "";
this.channelForm.modelVal = "";
this.channelForm.compensationVal = 0;
// this.channelForm.hdrchecked = "";
// this.channelForm.ywchecked = "";
this.channelForm.awbMode = 1;
this.channelForm.aechecked = false;
this.channelForm.awbchecked = false;
this.channelForm.afchecked = false;
this.channelForm.rtosd = "";
this.channelForm.ltosd = "";
this.channelForm.lbosd = "";
this.channelForm.rbosd = "";
this.channelForm.videoSize = "";
this.channelForm.videoCX = "";
this.channelForm.videoCY = "";
this.channelForm.videoDuration = 15;
this.channelForm.templateVal = 2;
window.clearInterval(this.searchTimer);
this.searchTimer = null;
this.searchNum = 0;
},
},
};
</script>
<style lang="less">
.setChannelDialog {
.zzinfo {
position: absolute;
top: 22px;
left: 120px;
}
.el-dialog__body {
padding-bottom: 0px;
.el-form-item--small.el-form-item {
margin-bottom: 12px;
}
.channelsetBox {
width: 100%;
// height: 400px;
//background: #fcc;
.el-input {
width: 300px;
}
.usbClass {
margin-left: 32px;
}
}
.infoSpan {
margin-left: 8px;
}
.photoSize {
.el-form-item__content {
display: flex;
//justify-content: space-between;
.el-input {
width: 90px;
margin-right: 12px;
}
}
}
.photoinfo {
display: flex;
.el-input {
width: 80px;
}
}
.awbBox {
display: flex;
.el-input {
width: 160px;
}
}
.roteAiBox {
display: flex;
.el-input {
width: 150px;
}
}
.modelBox {
display: flex;
align-items: center;
.gmclass {
margin: 0px 12px 12px 12px;
}
.wait3Lock {
margin-bottom: 12px;
}
.el-input {
width: 150px;
}
}
.picZoomClass {
display: flex;
.zoomBox {
.el-form-item__content {
display: flex;
align-items: center;
}
}
.el-slider {
width: 200px;
margin-right: 12px;
margin-left: 10px;
.el-slider__runway {
height: 8px;
margin: 12px 0;
}
.el-slider__button-wrapper {
height: 24px;
width: 24px;
position: absolute;
z-index: 1001;
top: -9px;
}
.el-input {
width: 100px;
}
}
.modelclass {
.el-form-item__label {
width: 80px !important;
}
.el-form-item__content {
margin-left: 80px !important;
}
.el-select {
width: 144px;
margin-right: 12px;
.el-input {
width: 144px;
}
.el-input__inner {
}
}
}
}
.videoDiv {
display: flex;
.el-select {
.el-input {
width: 160px;
}
}
.el-input {
width: 100px;
}
}
.isoDiv {
display: flex;
flex-wrap: wrap;
.el-input {
width: 70px;
}
.el-form-item {
// &:nth-child(2) {
// .el-form-item__label {
// width: 80px !important;
// }
// .el-form-item__content {
// margin-left: 80px !important;
// }
// }
// &:nth-child(3) {
// .el-form-item__label {
// width: 80px !important;
// }
// .el-form-item__content {
// margin-left: 80px !important;
// }
// }
&:last-child {
.el-form-item__label {
width: 60px !important;
}
.el-form-item__content {
margin-left: 60px !important;
}
}
}
}
.textAreabox {
display: flex;
flex-wrap: wrap;
.el-textarea {
width: 298px;
}
}
.videoclass {
// .el-form-item__content {
// display: flex;
// //justify-content: space-between;
// .el-select {
// width: 164px;
// margin-right: 12px;
// }
// }
}
.comclass {
margin-left: 8px;
}
}
.dialog-footer {
.el-button--default,
.el-button--primary {
width: 80px !important;
margin-bottom: 0px !important;
}
.el-button + .el-button {
margin-left: 10px !important;
}
}
}
pre {
white-space: break-spaces;
}
</style>