添加通道查询

wp1.0
fanluyan 1 year ago
parent dd7fc8b9e4
commit c30be6e10c

@ -9,7 +9,7 @@
> >
<div class="zzinfo">装置编号{{ areaData.cmdid }}</div> <div class="zzinfo">装置编号{{ areaData.cmdid }}</div>
<div class="channelsetBox"> <div class="channelsetBox">
<el-form ref="form" :model="channelForm" label-width="80px"> <el-form ref="form" :model="channelForm" label-width="100px">
<!-- <el-form-item label="装置编号"> <!-- <el-form-item label="装置编号">
<el-input v-model="channelForm.zzbh" disabled></el-input> <el-input v-model="channelForm.zzbh" disabled></el-input>
</el-form-item> --> </el-form-item> -->
@ -33,41 +33,29 @@
<!-- <el-radio :label="6">备选项</el-radio> <!-- <el-radio :label="6">备选项</el-radio>
<el-radio :label="9">备选项</el-radio> --> <el-radio :label="9">备选项</el-radio> -->
</el-radio-group> </el-radio-group>
<!-- <el-select
v-model="channelForm.selectChannel"
placeholder="请选择"
@change="changeChannel"
>
<el-option
v-for="item in channelList"
:key="item.channelid"
:label="
item.alias !== null && item.alias !== ''
? item.alias
: item.channelname
"
:value="item.channelid"
>
{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channelname
}}
</el-option>
</el-select> -->
</el-form-item> </el-form-item>
<el-form-item label="照片大小" class="photoSize"> <el-form-item label="照片大小" class="photoSize">
<el-input v-model="channelForm.resolutionCX"></el-input> <el-input v-model="channelForm.resolutionCX"></el-input>
<el-input v-model="channelForm.resolutionCY"></el-input> <el-input v-model="channelForm.resolutionCY"></el-input>
<!-- <el-select v-model="channelForm.picSize" placeholder="请选择"> </el-form-item>
<el-form-item label="视频分辨率" class="videoclass">
<el-select
v-model="channelForm.videoSize"
placeholder="请选择"
@change="changevideoChannel"
>
<el-option <el-option
v-for="item in pictureSize" v-for="item in videoOptionSize"
:key="item.value" :key="item.value"
:label="item.label" :label="item.name + '(' + item.label + ')'"
:value="item.value" :value="item.value"
> >
</el-option> </el-option>
</el-select> --> </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>
<el-form-item label="压缩率"> <el-form-item label="压缩率">
<el-input v-model="channelForm.ysl"></el-input> <el-input v-model="channelForm.ysl"></el-input>
@ -172,6 +160,10 @@ export default {
selectChannel: "", selectChannel: "",
resolutionCX: "", resolutionCX: "",
resolutionCY: "", resolutionCY: "",
videoSize: "",
videoCX: "",
videoCY: "",
videoDuration: 15,
ysl: 80, ysl: 80,
usbchecked: "", usbchecked: "",
zzdjchecked: "", zzdjchecked: "",
@ -238,6 +230,33 @@ export default {
label: "2048X1536", 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",
},
],
requestid: "", requestid: "",
}; };
}, },
@ -249,6 +268,7 @@ export default {
mounted() { mounted() {
this.channelForm.zzbh = this.areaData.cmdid; this.channelForm.zzbh = this.areaData.cmdid;
this.channelForm.roteval = this.roteOptions[0].value; this.channelForm.roteval = this.roteOptions[0].value;
this.channelForm.videoSize = this.videoOptionSize[0].value;
this.channelForm.aival = this.aiOptions[0].value; this.channelForm.aival = this.aiOptions[0].value;
}, },
methods: { methods: {
@ -268,10 +288,34 @@ export default {
console.log(val, "是否选中"); console.log(val, "是否选中");
if (val) { if (val) {
this.bgflag = true; this.bgflag = true;
this.channelForm.bgsj = "";
this.channelForm.iso = "";
} else { } else {
this.bgflag = false; 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() { changeChannel() {
console.log(this.channelForm.selectChannel); console.log(this.channelForm.selectChannel);
@ -291,93 +335,13 @@ export default {
this.channelForm.resolutionCX = 2048; this.channelForm.resolutionCX = 2048;
this.channelForm.resolutionCY = 1536; this.channelForm.resolutionCY = 1536;
} }
this.searchBtn();
}, },
handleConfim() { handleConfim() {
console.log("点击了确定"); console.log("点击了确定");
console.log(this.channelForm); console.log(this.channelForm);
this.channelLoading = true; this.channelLoading = true;
// let params = [
// {
// name: "resolutionCX",
// type: 0,
// value: "",
// },
// {
// name: "resolutionCY",
// type: 0,
// value: "",
// },
// {
// name: "quality",
// type: 0,
// value: "",
// },
// {
// name: "usbCamera",
// type: 0,
// value: "",
// },
// {
// name: "autoFocus",
// type: 0,
// value: "",
// },
// {
// name: "autoExposure",
// type: 0,
// value: "",
// },
// {
// name: "exposureTime",
// type: 0,
// value: "",
// },
// {
// name: "sensibility",
// type: 0,
// value: "",
// },
// {
// name: "hdrMode",
// type: 0,
// value: "",
// },
// {
// name: "nightMode",
// type: 0,
// value: "",
// },
// {
// name: "orientation",
// type: 0,
// value: "",
// },
// {
// name: "recognization",
// type: 0,
// value: "",
// },
// {
// name: "osd.leftTop",
// type: 1,
// value: "",
// },
// {
// name: "osd.rightTop",
// type: 1,
// value: "",
// },
// {
// name: "osd.rightBottom",
// type: 1,
// value: "",
// },
// {
// name: "osd.leftBottom",
// type: 1,
// value: "",
// },
// ];
//--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 //--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) => { getTermStatus({ termId: this.areaData.id }).then((res) => {
console.log(res); console.log(res);
@ -393,7 +357,7 @@ export default {
}, },
{ {
name: "reboot", name: "reboot",
value: 1, value: 0,
}, },
{ {
name: "pathType", name: "pathType",
@ -401,7 +365,7 @@ export default {
}, },
{ {
name: "updateType", name: "updateType",
value: 0, value: 1,
}, },
{ {
name: "path", name: "path",
@ -410,7 +374,7 @@ export default {
}, },
{ {
name: "configs", name: "configs",
value: 16, value: 19,
}, },
// { // {
// name: "resolutionCX", // name: "resolutionCX",
@ -540,6 +504,19 @@ export default {
{ name: "name16", value: "osd.rightBottom" }, { name: "name16", value: "osd.rightBottom" },
{ name: "value16", value: this.channelForm.rbosd }, { name: "value16", value: this.channelForm.rbosd },
{ name: "type16", value: 1 }, { name: "type16", value: 1 },
//
{ name: "name17", value: "videoCX" },
{ name: "value17", value: this.channelForm.videoCX },
{ name: "type17", value: 0 },
{ name: "name18", value: "videoCY" },
{ name: "value18", value: this.channelForm.videoCY },
{ name: "type18", value: 0 },
//
{ name: "name19", value: "videoDuration" },
{ name: "value19", value: this.channelForm.videoDuration },
{ name: "type19", value: 0 },
]; ];
console.log(params); console.log(params);
this.setTermFn(params); this.setTermFn(params);
@ -591,10 +568,146 @@ export default {
}) })
.catch((err) => {}); .catch((err) => {});
}, },
searchBtn() {
//--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();
})
.catch((err) => {});
},
getsearchchannelStatus() {
getTermCameraRequest({ requestid: this.requestid })
.then((res) => {
console.log(res);
if (res.data.success == 1) {
// this.isShow = false;
// this.channelLoading = false;
console.log(res.data);
console.log(JSON.parse(res.data.data));
const resultData = JSON.parse(res.data.data);
const resultContent = JSON.parse(
decodeURIComponent(escape(window.atob(resultData.content)))
);
console.log(resultContent);
this.channelForm.ysl = resultContent.quality;
this.channelForm.usbchecked = resultContent.usbCamera;
this.channelForm.zzdjchecked = resultContent.autoFocus;
this.channelForm.zdbgchecked = resultContent.autoExposure;
this.channelForm.bgsj = resultContent.exposureTime;
this.channelForm.iso = resultContent.sensibility;
this.channelForm.hdrchecked = resultContent.hdrMode;
this.channelForm.ywchecked = resultContent.nightMode;
this.channelForm.aival = resultContent.recognization;
this.channelForm.roteval = resultContent.orientation;
this.channelForm.rtosd = resultContent.osd.rightTop;
this.channelForm.ltosd = resultContent.osd.leftTop;
this.channelForm.lbosd = resultContent.osd.leftBottom;
this.channelForm.rbosd = resultContent.osd.rightBottom;
// this.channelForm.videoSize = resultContent.;
this.channelForm.videoCX = resultContent.videoCX;
this.channelForm.videoCY = resultContent.videoCY;
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.$message({
duration: 1500,
showClose: true,
message: "通道查询成功",
type: "success",
});
} else {
// this.isShow = false;
// this.channelLoading = false;
this.$message({
duration: 1500,
showClose: true,
message: "通道查询失败",
type: "error",
});
}
})
.catch((err) => {});
},
display() { display() {
this.isShow = true; this.isShow = true;
this.channelForm.zzbh = this.areaData.cmdid; this.channelForm.zzbh = this.areaData.cmdid;
this.getChannelSelect(); this.getChannelSelect();
this.changevideoChannel();
console.log(this.areaData); console.log(this.areaData);
}, },
handleclose() { handleclose() {
@ -614,6 +727,10 @@ export default {
this.channelForm.ltosd = ""; this.channelForm.ltosd = "";
this.channelForm.lbosd = ""; this.channelForm.lbosd = "";
this.channelForm.rbosd = ""; this.channelForm.rbosd = "";
this.channelForm.videoSize = "";
this.channelForm.videoCX = "";
this.channelForm.videoCY = "";
this.channelForm.videoDuration = 15;
}, },
}, },
}; };
@ -647,11 +764,21 @@ export default {
display: flex; display: flex;
//justify-content: space-between; //justify-content: space-between;
.el-input { .el-input {
width: 144px; width: 90px;
margin-right: 12px; margin-right: 12px;
} }
} }
} }
.videoclass {
// .el-form-item__content {
// display: flex;
// //justify-content: space-between;
// .el-select {
// width: 164px;
// margin-right: 12px;
// }
// }
}
} }
.dialog-footer { .dialog-footer {
.el-button--default, .el-button--default,

Loading…
Cancel
Save