添加规约

ds1.0
fanluyan 2 years ago
parent aecda13102
commit 630b10c9ac

@ -49,7 +49,7 @@
<el-option <el-option
v-for="item in ratiolist" v-for="item in ratiolist"
:key="item.id" :key="item.id"
:label="item.name" :label="item.id + ' / ' + item.name"
:value="item.id" :value="item.id"
></el-option> ></el-option>
</el-select> </el-select>
@ -82,9 +82,16 @@
class="searchImage" class="searchImage"
:loading="searchloading" :loading="searchloading"
type="primary" type="primary"
@click="inquirebtn()" @click="imageSearch()"
>查询</el-button >查询</el-button
> >
<!-- <el-button
class="searchImage"
:loading="searchloading"
type="primary"
@click="inquirebtn()"
>查询</el-button
> -->
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="设置参数" name="2"> <el-tab-pane label="设置参数" name="2">
@ -143,7 +150,7 @@
<el-option <el-option
v-for="item in ratiolist" v-for="item in ratiolist"
:key="item.id" :key="item.id"
:label="item.name" :label="item.id + ' / ' + item.name"
:value="item.id" :value="item.id"
></el-option> ></el-option>
</el-select> </el-select>
@ -171,7 +178,10 @@
></el-input-number> ></el-input-number>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="submitbtn('setForm')" <!-- <el-button type="primary" @click="submitbtn('setForm')"
>确认</el-button
> -->
<el-button type="primary" @click="imageSet('setForm')"
>确认</el-button >确认</el-button
> >
</el-form-item> </el-form-item>
@ -187,12 +197,13 @@ import {
setPhotoParamApi, setPhotoParamApi,
getPhotoParamnrApi, getPhotoParamnrApi,
getResolutionRatio, getResolutionRatio,
setTermCamera,
getTermCameraRequest,
} from "@/utils/api/index"; } from "@/utils/api/index";
export default { export default {
data() { data() {
return { return {
loading: false, loading: false,
isShow: false,
searchloading: false, searchloading: false,
activeName: "1", // activeName: "1", //
accesslist: [], // accesslist: [], //
@ -206,7 +217,250 @@ export default {
id: 0, id: 0,
}, },
], // ], //
ratiolist: [], // ratiolist: [],
hnratiolist: [
{
id: 1,
name: "320X240",
},
{
id: 2,
name: "640X480",
},
{
id: 3,
name: "704X576",
},
{
id: 5,
name: "1024X768",
},
{
id: 6,
name: "1280X1024",
},
{
id: 7,
name: "1280X720",
},
{
id: 8,
name: "1920X1080",
},
{
id: 9,
name: "2560X1440",
},
{
id: 10,
name: "3840X2160",
},
{
id: 11,
name: "2560X1920",
},
{
id: 12,
name: "3200X2400",
},
{
id: 13,
name: "4000X3000",
},
{
id: 14,
name: "4160X3120",
},
{
id: 15,
name: "4608X3456",
},
], //
zzratiolist: [
{
id: 1,
name: " 320X240",
},
{
id: 2,
name: " 640X480",
},
{
id: 3,
name: " 704X576",
},
{
id: 4,
name: " 800X600",
},
{
id: 5,
name: " 1024X768",
},
{
id: 6,
name: " 1280X1024",
},
{
id: 7,
name: " 1280X720",
},
{
id: 8,
name: " 1920X1080",
},
{
id: 9,
name: " 2560X1440",
},
{
id: 10,
name: " 3840X2160",
},
], //
jsratiolist: [
{
id: 1,
name: " 320X240",
},
{
id: 2,
name: " 640X480",
},
{
id: 3,
name: " 704X576",
},
{
id: 4,
name: " 720X480 ",
},
{
id: 5,
name: " 1280X720",
},
{
id: 6,
name: " 1920X1080 ",
},
{
id: 7,
name: " 2048X1536",
},
{
id: 8,
name: " 2592X1520",
},
{
id: 9,
name: " 2592X1944",
},
{
id: 10,
name: " 3072X2048",
},
{
id: 11,
name: " 3840X2160 ",
},
{
id: 12,
name: " 4000X3000",
},
{
id: 13,
name: " 4608X3456",
},
], //
ahratiolist: [
{
id: 1,
name: " 320X240",
},
{
id: 2,
name: " 640X480",
},
{
id: 3,
name: " 704X576",
},
{
id: 4,
name: " 720 X 480",
},
{
id: 5,
name: " 1280X720",
},
{
id: 6,
name: " 1920X1080",
},
], //
zhejiangratiolist: [
{
id: 1,
name: " 320X240",
},
{
id: 2,
name: " 640X480",
},
{
id: 3,
name: " 704X576",
},
{
id: 4,
name: " 800X600 ",
},
{
id: 5,
name: " 1024X768",
},
{
id: 6,
name: " 1280X960 ",
},
{
id: 7,
name: " 1600X1200",
},
{
id: 8,
name: " 1920X1080",
},
{
id: 9,
name: " 2048X1536",
},
{
id: 10,
name: " 2592X1944",
},
{
id: 11,
name: " 2816X2112 ",
},
{
id: 12,
name: " 3072X2304",
},
{
id: 13,
name: " 3264X2448",
},
{
id: 14,
name: " 3456X2592",
},
{
id: 15,
name: " 3672X2754",
},
], //
selaccess: "", // selaccess: "", //
capturenr: {}, // capturenr: {}, //
setForm: {}, // setForm: {}, //
@ -229,12 +483,17 @@ export default {
seltermid: "", //id seltermid: "", //id
selcmdId: "", //cmdId selcmdId: "", //cmdId
requestId: "", requestId: "",
requestid: "",
timer: null,
i: 0,
}; };
}, },
mounted() {}, mounted() {},
methods: { methods: {
handleClick(tab, event) { handleClick(tab, event) {
console.log(tab, event); console.log(tab, event);
this.capturenr = {};
}, },
// //
getSingleAccess(val) { getSingleAccess(val) {
@ -251,15 +510,44 @@ export default {
.catch((err) => {}); .catch((err) => {});
}, },
// //
getRatio() { getRatio(val) {
this.$set(this.setForm, "color", this.colorlist[0].id); this.$set(this.setForm, "color", this.colorlist[0].id);
getResolutionRatio({ type: 0 }) console.log(val);
.then((res) => { switch (val.protocol) {
this.ratiolist = res.data.list; //
this.$set(this.setForm, "resolution", res.data.list[0].id); case 65283:
}) this.ratiolist = this.hnratiolist;
.catch((err) => {}); break;
//
// case 65285:
// days = "";
// break;
//
case 65286:
this.ratiolist = this.zzratiolist;
break;
//
case 65282:
this.ratiolist = this.jsratiolist;
break;
//
case 65281:
this.ratiolist = this.ahratiolist;
break;
//
case 65284:
this.ratiolist = this.zhejiangratiolist;
break;
}
this.$set(this.setForm, "resolution", this.ratiolist[0].id);
// getResolutionRatio({ type: 0 })
// .then((res) => {
// this.ratiolist = this.hnratiolist;
// this.$set(this.setForm, "resolution", res.data.list[0].id);
// })
// .catch((err) => {});
}, },
// //
inquirebtn() { inquirebtn() {
this.loading = true; this.loading = true;
@ -323,7 +611,6 @@ export default {
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message.success("设置成功"); this.$message.success("设置成功");
this.isShow = false;
} else { } else {
this.$message.error(res.code.msg); this.$message.error(res.code.msg);
} }
@ -336,17 +623,140 @@ export default {
} }
}); });
}, },
display() { //imageSearch
this.isShow = true; //--act=imgparams [0xC9] --flag=[Request Set Flag, default is set=1, 0: request] --rf=[Request Flag] --channel=[Channel No] --color=[Color Select: 0, 1] --resolution=[Resolution: 1-15 255] --luminance=[Luminance: 1-100] --contrast=[Contrast: 1-100] --saturation=[Saturation: 1-100]
imageSearch() {
let params = [
{
name: "act",
value: "imgparams",
},
{
name: "flag",
value: 0,
},
{
name: "channel",
value: this.selaccess,
},
{
name: "color",
value: "",
},
{
name: "resolution",
value: "",
},
{
name: "luminance",
value: "",
},
{
name: "contrast",
value: "",
},
{
name: "saturation",
value: "",
},
];
this.setTermFn(params);
},
imageSet(setForm) {
console.log(this.setForm);
let params = [
{
name: "act",
value: "imgparams",
},
{
name: "flag",
value: 1,
},
{
name: "channel",
value: this.setForm.channelId,
},
{
name: "color",
value: this.setForm.color,
},
{
name: "resolution",
value: this.setForm.resolution,
},
{
name: "luminance",
value: this.setForm.luminance,
},
{
name: "contrast",
value: this.setForm.contrast,
},
{
name: "saturation",
value: this.setForm.saturation,
},
];
this.setTermFn(params);
}, },
hide() { setTermFn(dataParams) {
this.isShow = false; setTermCamera({
termId: this.seltermid,
list: dataParams,
})
.then((res) => {
console.log(res);
this.requestid = res.data.requestId;
//this.getinfo1();
clearInterval(this.timer);
this.timer = window.setInterval(() => {
this.getinfo();
this.i++;
}, 1000);
// this.timer = setInterval(() => {
// this.getinfo();
// this.i++;
// }, 1000);
})
.catch((err) => {});
}, },
handleclose() { getinfo() {
this.searchloading = false; getTermCameraRequest({ requestid: this.requestid })
this.i = 0; .then((res) => {
clearInterval(this.timer); if (res.data.success == 1) {
this.timer = null; window.clearInterval(this.timer);
this.timer = null;
this.i = 0;
console.log("终止轮询");
// && res.data.result == 255
console.log(JSON.parse(res.data.data));
this.capturenr = JSON.parse(res.data.data);
this.$message({
duration: 1500,
showClose: true,
message: "信息已更新",
type: "success",
});
} else if (this.i > 9) {
window.clearInterval(this.timer);
this.timer = null;
this.i = 0;
this.$message({
duration: 1500,
showClose: true,
message: "暂未获取到信息,请稍后再试!!",
type: "warning",
});
}
})
.catch();
},
clearData() {
this.capturenr = {};
this.setForm = {};
}, },
}, },
}; };

@ -415,16 +415,18 @@ export default {
this.timer = null; this.timer = null;
this.i = 0; this.i = 0;
console.log(tab, event); console.log(tab, event);
this.$refs.imageCaptureref.clearData();
this.$refs.videoCaptureref.clearData();
// //
this.tabsActive = "first"; this.tabsActive = "first";
if (tab.label == "图像采集参数") { if (tab.label == "图像采集参数") {
console.log("图像采集参数"); console.log("图像采集参数");
this.$refs.imageCaptureref.getSingleAccess(this.rowData); this.$refs.imageCaptureref.getSingleAccess(this.rowData);
this.$refs.imageCaptureref.getRatio(); this.$refs.imageCaptureref.getRatio(this.rowData);
} else if (tab.label == "视频采集参数") { } else if (tab.label == "视频采集参数") {
console.log("视频采集参数"); console.log("视频采集参数");
this.$refs.videoCaptureref.getSingleAccess(this.rowData); this.$refs.videoCaptureref.getSingleAccess(this.rowData);
this.$refs.videoCaptureref.getRatio(); this.$refs.videoCaptureref.getRatio(this.rowData);
} }
}, },
// //
@ -736,16 +738,7 @@ export default {
}) })
.catch((err) => {}); .catch((err) => {});
}, },
getinfo1() {
console.log("jinlaile");
if (this.i > 10) {
console.log(this.i);
// console.log(this.i);
window.clearInterval(this.timer);
this.timer = null;
this.i = 0;
}
},
getinfo() { getinfo() {
getTermCameraRequest({ requestid: this.requestid }) getTermCameraRequest({ requestid: this.requestid })
.then((res) => { .then((res) => {

@ -38,9 +38,11 @@
<el-option <el-option
v-for="item in ratiolist" v-for="item in ratiolist"
:key="item.id" :key="item.id"
:label="item.name" :label="item.id + ' / ' + item.name"
:value="item.id" :value="item.id"
></el-option> >
{{ item.id + " / " + item.name }}
</el-option>
</el-select> </el-select>
</div> </div>
<div class="flexno bt30"> <div class="flexno bt30">
@ -61,12 +63,19 @@
<template slot="append">s ()</template> <template slot="append">s ()</template>
</el-input> </el-input>
</div> </div>
<el-button <!-- <el-button
class="searchImage" class="searchImage"
:loading="searchloading" :loading="searchloading"
type="primary" type="primary"
@click="inquirebtn()" @click="inquirebtn()"
>查询</el-button >查询</el-button
> -->
<el-button
class="searchImage"
:loading="searchloading"
type="primary"
@click="videoSearch()"
>查询</el-button
> >
</div> </div>
</el-tab-pane> </el-tab-pane>
@ -112,7 +121,7 @@
<el-option <el-option
v-for="item in ratiolist" v-for="item in ratiolist"
:key="item.id" :key="item.id"
:label="item.name" :label="item.id + ' / ' + item.name"
:value="item.id" :value="item.id"
></el-option> ></el-option>
</el-select> </el-select>
@ -133,7 +142,10 @@
></el-input-number> ></el-input-number>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="submitbtn('setForm')" <!-- <el-button type="primary" @click="submitbtn('setForm')"
>确认</el-button
> -->
<el-button type="primary" @click="videoSet('setForm')"
>确认</el-button >确认</el-button
> >
</el-form-item> </el-form-item>
@ -149,6 +161,8 @@ import {
setVideoParamApi, setVideoParamApi,
getVideoParamnrApi, getVideoParamnrApi,
getResolutionRatio, getResolutionRatio,
setTermCamera,
getTermCameraRequest,
} from "@/utils/api/index"; } from "@/utils/api/index";
export default { export default {
data() { data() {
@ -158,7 +172,29 @@ export default {
searchloading: false, searchloading: false,
activeName: "1", // activeName: "1", //
accesslist: [], // accesslist: [], //
ratiolist: [], // ratiolist: [],
hnratiolist: [
{
id: 1,
name: "480P",
},
{
id: 2,
name: "720p",
},
{
id: 3,
name: "1080P",
},
{
id: 4,
name: "QVGA",
},
{
id: 5,
name: "VGA",
},
], //
selaccess: "", // selaccess: "", //
capturenr: {}, // capturenr: {}, //
setForm: { setForm: {
@ -185,6 +221,7 @@ export default {
methods: { methods: {
handleClick(tab, event) { handleClick(tab, event) {
console.log(tab, event); console.log(tab, event);
this.capturenr = {};
}, },
// //
getSingleAccess(val) { getSingleAccess(val) {
@ -206,8 +243,8 @@ export default {
getRatio() { getRatio() {
getResolutionRatio({ type: 1 }) getResolutionRatio({ type: 1 })
.then((res) => { .then((res) => {
this.ratiolist = res.data.list; this.ratiolist = this.hnratiolist;
this.$set(this.setForm, "videoFormat", res.data.list[0].id); this.$set(this.setForm, "videoFormat", this.ratiolist[0].id);
}) })
.catch((err) => {}); .catch((err) => {});
}, },
@ -300,17 +337,123 @@ export default {
} }
}); });
}, },
display() { //videoSearch
this.isShow = true; // --act=videoparams [0xD5] --flag=[Request Set Flag, default is set=1, 0: request] --channel=[Channel No] --preset=[Preset No] format=[Video Format: 1 QVGA 2 VGA 3 480p 4 720P 5 1080P] time=[seconds]
videoSearch() {
let params = [
{
name: "act",
value: "videoparams",
},
{
name: "flag",
value: 0,
},
{
name: "channel",
value: this.selaccess,
},
{
name: "preset",
value: 255,
},
{
name: "format",
value: "",
},
{
name: "time",
value: "",
},
];
this.setTermFn(params);
}, },
hide() { videoSet(setForm) {
this.isShow = false; console.log(this.setForm);
let params = [
{
name: "act",
value: "videoparams",
},
{
name: "flag",
value: 1,
},
{
name: "channel",
value: this.setForm.channelId,
},
{
name: "preset",
value: 255,
},
{
name: "format",
value: this.setForm.videoFormat,
},
{
name: "time",
value: this.setForm.videoTime,
},
];
this.setTermFn(params);
},
setTermFn(dataParams) {
setTermCamera({
termId: this.seltermid,
list: dataParams,
})
.then((res) => {
console.log(res);
this.requestid = res.data.requestId;
//this.getinfo1();
clearInterval(this.timer);
this.timer = window.setInterval(() => {
this.getinfo();
this.i++;
}, 1000);
// this.timer = setInterval(() => {
// this.getinfo();
// this.i++;
// }, 1000);
})
.catch((err) => {});
},
getinfo() {
getTermCameraRequest({ requestid: this.requestid })
.then((res) => {
if (res.data.success == 1) {
window.clearInterval(this.timer);
this.timer = null;
this.i = 0;
console.log("终止轮询");
// && res.data.result == 255
console.log(JSON.parse(res.data.data));
this.capturenr = JSON.parse(res.data.data);
this.$message({
duration: 1500,
showClose: true,
message: "信息已更新",
type: "success",
});
} else if (this.i > 9) {
window.clearInterval(this.timer);
this.timer = null;
this.i = 0;
this.$message({
duration: 1500,
showClose: true,
message: "暂未获取到信息,请稍后再试!!",
type: "warning",
});
}
})
.catch();
}, },
handleclose() { clearData() {
this.searchloading = false; this.capturenr = {};
this.i = 0; this.setForm = {};
clearInterval(this.timer);
this.timer = null;
}, },
}, },
}; };

Loading…
Cancel
Save