添加通道设置,app设置

wp1.0
fanluyan 1 year ago
parent c30be6e10c
commit 2dc62f2d57

@ -134,6 +134,10 @@ export default {
index: "/userManagement",
title: "用户管理",
},
{
index: "/roleManagement",
title: "角色管理",
},
{
index: "/globalTools",
title: "全局设置",

@ -71,6 +71,12 @@ const routes = [
name: "userManagement",
meta: { title: "用户管理", icon: "el-icon-monitor", keepAlive: true },
},
{
path: "/roleManagement",
component: () => import("../views/system/roleManagement/index.vue"),
name: "roleManagement",
meta: { title: "角色管理", icon: "el-icon-monitor", keepAlive: true },
},
{
path: "/globalTools",
component: () => import("../views/system/globalTools/index.vue"),

@ -21,7 +21,7 @@
</span>
</div>
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
<!-- <el-tab-pane label="装置时间" name="1">
<el-tab-pane label="装置时间" name="1">
<div class="deviceTime">
<el-form
:model="deviceTimeForm"
@ -29,21 +29,50 @@
label-width="84px"
>
<el-form-item label="装置时间">
<el-input
<el-date-picker
v-model="deviceTimeForm.zztime"
type="datetime"
placeholder="查询日期时间"
value-format="timestamp"
disabled
>
</el-date-picker>
<!-- <el-input
v-model="deviceTimeForm.zztime"
disabled="disabled"
></el-input>
></el-input> -->
</el-form-item>
<el-form-item label="新装置时间">
<el-input v-model="deviceTimeForm.newzztime"></el-input>
<!-- <el-input v-model="deviceTimeForm.newzztime"></el-input> -->
<el-date-picker
v-model="deviceTimeForm.newzztime"
type="datetime"
placeholder="选择日期时间"
value-format="timestamp"
@focus="handleFocus"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="searchTime"></el-button>
<el-button type="primary" @click="setTime"></el-button>
<el-button
type="primary"
@click="searchTime"
:loading="timeLoading"
>查询</el-button
>
<el-button
type="primary"
@click="setTime"
:loading="timesetLoading"
>设置</el-button
>
<p class="looktime" v-if="lookTime && showLookTime">
{{ $moment(lookTime).format("YYYY-MM-DD HH:mm:ss") }}
</p>
</el-form-item>
</el-form>
</div>
</el-tab-pane> -->
</el-tab-pane>
<el-tab-pane label="采样参数" name="2">
<div class="tabsBox">
<el-tabs
@ -729,7 +758,9 @@ export default {
showLookTime: false,
lookTime: "", //
isShow: false,
activeName: "2",
activeName: "1",
timeLoading: false,
timesetLoading: false,
deviceTimeForm: {
zztime: "", //
newzztime: "", //
@ -824,7 +855,7 @@ export default {
requestid: "",
timer: null,
i: 0,
tabName: "",
tabName: "装置时间",
roleUser: "",
};
},
@ -868,10 +899,78 @@ export default {
})
.catch((err) => {});
},
handleFocus() {
if (this.deviceTimeForm.newzztime == "") {
this.deviceTimeForm.newzztime = new Date();
console.log(this.deviceTimeForm.newzztime);
}
},
//
searchTime() {},
searchTime() {
if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
this.timeLoading = true;
// --act=time --cmdid=XY-SIMULATOR-0015 --flag=1 --time=20230101122322
let params = [
{
name: "act",
value: "time",
},
{
name: "flag",
value: 0,
},
];
this.setTermFn(params);
} else {
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
},
//
setTime() {},
// .\bin\xympadmn.exe --server=127.0.0.1 --port=6891 --act=time --cmdid=XY-SIMULATOR-0015 --flag=1 --time=20230101122322
setTime() {
if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
console.log(this.deviceTimeForm.newzztime);
if (this.deviceTimeForm.newzztime !== "") {
this.timesetLoading = true;
let params = [
{
name: "act",
value: "time",
},
{
name: "flag",
value: 1,
},
{
name: "time",
value: this.deviceTimeForm.newzztime,
},
];
this.setTermFn(params);
} else {
console.log("error submit!!");
this.$message({
duration: 1500,
showClose: true,
message: "请填写新装置时间",
type: "error",
});
return false;
}
} else {
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
},
//
samphandleClick() {
this.samplingForm = {};
@ -1103,33 +1202,64 @@ export default {
idSearch() {
if (this.rowData.isonline || this.rowData.onlinestatus === 1) {
this.idLoading = true;
let params = [
{
name: "act",
value: "termid",
},
{
name: "flag",
value: 0,
},
{
name: "rf",
value: 255,
},
{
name: "newcmdid",
value: "",
},
{
name: "compid",
value: "",
},
{
name: "orgid",
value: "",
},
];
this.setTermFn(params);
console.log(this.rowData);
if (this.rowData.protocol == 65284) {
let params = [
{
name: "act",
value: "termid",
},
{
name: "flag",
value: 0,
},
{
name: "rf",
value: 2,
},
{
name: "newcmdid",
value: "",
},
{
name: "compid",
value: "",
},
{
name: "orgid",
value: "",
},
];
this.setTermFn(params);
} else {
let params = [
{
name: "act",
value: "termid",
},
{
name: "flag",
value: 0,
},
{
name: "rf",
value: 255,
},
{
name: "newcmdid",
value: "",
},
{
name: "compid",
value: "",
},
{
name: "orgid",
value: "",
},
];
this.setTermFn(params);
}
} else {
this.$message({
duration: 1500,
@ -1418,6 +1548,8 @@ export default {
window.clearInterval(this.timer);
this.timer = null;
this.i = 0;
this.timeLoading = false;
this.timesetLoading = false;
this.sampLoading = false;
this.sampSetLoading = false;
this.upperLoading = false;
@ -1432,6 +1564,16 @@ export default {
console.log("终止轮询");
// && res.data.result == 255
console.log(JSON.parse(res.data.data));
//
console.log(this.tabName);
this.deviceTimeForm = JSON.parse(res.data.data);
if (this.tabName == "装置时间") {
this.showLookTime = true;
this.deviceTimeForm.zztime = this.deviceTimeForm.timestamp * 1000;
console.log(this.deviceTimeForm.zztime);
return;
}
//
this.samplingForm = JSON.parse(res.data.data);
//ip
this.upperComputer = JSON.parse(res.data.data);
@ -1443,7 +1585,7 @@ export default {
console.log("我是空");
this.osdParams.textContent = "";
}
console.log(this.tabName);
if (this.tabName == "上位机信息") {
let hexArray = this.upperComputer.ip
.toString(16)
@ -1477,6 +1619,8 @@ export default {
message: "暂未获取到信息,请稍后再试!!",
type: "warning",
});
this.timeLoading = false;
this.timesetLoading = false;
this.sampLoading = false;
this.sampSetLoading = false;
this.upperLoading = false;
@ -1562,8 +1706,9 @@ export default {
this.lookTime = "";
this.showLookTime = false;
this.isShow = false;
this.activeName = "2";
this.activeName = "1";
this.tabsActive = "first";
this.deviceTimeForm = {};
this.samplingForm = {};
this.upperComputer = {};
this.idParameter = {};

@ -93,6 +93,7 @@
<takeTimePicButton v-if="roleUser == 0"></takeTimePicButton>
<setChannelButton v-if="roleUser == 0"></setChannelButton>
<setAppButton v-if="roleUser == 0"></setAppButton>
<!-- <el-button type="primary" @click="handleTakePic" :loading="picLoading"
>主动拍照
</el-button> -->
@ -158,6 +159,7 @@ import cableButton from "./cableButton.vue";
import gpsButton from "./gpsButton.vue";
import uploadpic from "./uploadpic.vue";
import parameterSetDialog from "../../photographicDevice/components/parameterSetDialog.vue";
import setAppButton from "./setAppButton.vue";
import {
getChannelByTermidJoggle,
updateTermCamera,
@ -177,6 +179,7 @@ export default {
parameterSetDialog,
uploadpic,
setChannelButton,
setAppButton,
},
data() {
return {

@ -0,0 +1,34 @@
<template>
<div class="buttonBox">
<el-button type="primary" @click="handleSetChannel">APP </el-button>
<setAppDialog ref="setChannelDialog_ref"></setAppDialog>
</div>
</template>
<script>
import {} from "@/utils/api/index";
import setAppDialog from "./setAppDialog.vue";
export default {
components: { setAppDialog },
data() {
return {};
},
watch: {},
mounted() {},
computed: {
termId() {
return this.$store.state.termId;
},
channelIdList() {
return this.$store.state.channelIdList;
},
},
methods: {
handleSetChannel() {
this.$refs.setChannelDialog_ref.display();
},
},
destroyed() {},
beforeRouteLeave(to, from, next) {},
};
</script>

@ -0,0 +1,619 @@
<template>
<el-dialog
class="setAppDialog"
title="App设置"
:visible.sync="isShow"
:close-on-click-modal="false"
width="880px"
@close="handleclose"
>
<div class="zzinfo">
装置编号{{ areaData.cmdid }}
<el-button type="text" icon="el-icon-refresh" @click="searchBtn"
>刷新</el-button
>
</div>
<div class="channelsetBox" v-loading="appsetLoading">
<el-form ref="form" :model="appForm" label-width="160px">
<el-form-item label="装置编号">
<el-input v-model="appForm.CMDID"></el-input>
</el-form-item>
<el-form-item label="装置通道数">
<el-input v-model="appForm.channels"></el-input>
</el-form-item>
<el-form-item label="装置型号 ">
<el-input v-model="appForm.model"></el-input>
</el-form-item>
<el-form-item label="装置名称">
<el-input v-model="appForm.equipName"></el-input>
</el-form-item>
<el-form-item label="生产厂家">
<el-input v-model="appForm.bsManufacturer"></el-input>
</el-form-item>
<el-form-item label="生产日期">
<el-date-picker
v-model="appForm.productionDate"
value-format="timestamp"
type="date"
placeholder="选择日期"
@focus="handleFocus"
>
</el-date-picker>
</el-form-item>
<el-form-item label="图像质量">
<el-input v-model="appForm.imgQuality"></el-input>
<!-- <span class="infoSpan">(0-100的整数)</span> -->
</el-form-item>
<el-form-item label="心跳周期" class="heartClass">
<el-input v-model="appForm.heartbeat"></el-input>
<span class="infoSpan">()</span>
</el-form-item>
<!-- <el-form-item label="参数设置">
<el-checkbox
label="报文子包起始号"
v-model="appForm.usbchecked"
></el-checkbox>
</el-form-item> -->
<el-form-item label="报文子包起始号">
<el-select v-model="appForm.upgradePacketBase" placeholder="请选择">
<el-option
v-for="item in PacketBaseOptions"
:key="item.id"
:label="item.value"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="规约">
<el-select v-model="appForm.protocol" placeholder="请选择">
<el-option
v-for="item in protocolOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="网络协议">
<el-radio-group
v-model="appForm.networkProtocol"
@input="changenetwork"
>
<el-radio
v-for="item in netWorkList"
:key="item.value"
:label="item.value"
:value="item.value"
>
{{ item.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="CMA服务器ip">
<el-input v-model="appForm.server"></el-input>
</el-form-item>
<el-form-item label="CMA服务器端口" class="cmaClass">
<el-input v-model="appForm.port"></el-input>
<span class="infoSpan">(1025-65535)</span>
</el-form-item>
<el-form-item label="图像数据分包大小" class="packetClass">
<el-input v-model="appForm.packetSize"></el-input>
</el-form-item>
<el-form-item label="日志保留时间" class="packetClass">
<el-input v-model="appForm.timeForKeepingLogs"></el-input>
<span class="infoSpan">()</span>
</el-form-item>
<el-form-item label="未上传图像的保留时间" class="packetClass">
<el-input v-model="appForm.timeForKeepingPhotos"></el-input>
<span class="infoSpan">()</span>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleclose" :disabled="appsetLoading"
> </el-button
>
<el-button
type="primary"
:disabled="appsetLoading"
@click="handleConfim"
:loading="appLoading"
> </el-button
>
</div>
</el-dialog>
</template>
<script>
import {
getChannelListJoggle,
getTermStatus,
setTermCamera,
getTermCameraRequest,
} from "@/utils/api/index";
export default {
props: {},
data() {
return {
appsetLoading: true,
isShow: false,
appLoading: false,
netWorkList: [
{
value: 0,
label: "tcp",
},
{
value: 1,
label: "udp",
},
], //
appForm: {
channels: 4, //,4
packetSize: 2048, //
timeForKeepingLogs: 15, //1*86400-45*86400 15*86400
timeForKeepingPhotos: 15, //1*86400-45*86400 15*86400
imgQuality: "", //
heartbeat: 10, //
upgradePacketBase: 0, // 01
protocol: "", // ...
networkProtocol: 1, // 0: tcp 1 udp
//network: "", // 使
CMDID: "", //
server: "", // CMA ip
port: "", // CMA 1025-65535
model: "", //
equipName: "", //
bsManufacturer: "", //
productionDate: "", //
},
protocolOptions: [
{
id: 65280,
name: "国网I1",
},
{
id: 65296,
name: "陕西",
},
{
id: 65281,
name: "安徽",
},
{
id: 65282,
name: "江苏",
},
{
id: 65283,
name: "湖南",
},
{
id: 65284,
name: "浙江",
},
{
id: 65285,
name: "河南",
},
{
id: 65286,
name: "河南郑州",
},
],
PacketBaseOptions: [
{
id: 0,
value: 0,
},
{
id: 1,
value: 1,
},
],
requestid: "",
searchNum: 0,
searchTimer: null,
setNum: 0,
setTimer: null,
};
},
computed: {
areaData() {
return this.$store.state.currentData;
},
},
mounted() {
// this.appForm.zzbh = this.areaData.cmdid;
this.appForm.timeForKeepingPhotos =
this.appForm.timeForKeepingPhotos * 86400;
this.appForm.timeForKeepingLogs = this.appForm.timeForKeepingLogs * 86400;
// this.appForm.aival = this.aiOptions[0].value;
},
methods: {
handleFocus() {
if (this.appForm.productionDate == "") {
this.appForm.productionDate = new Date();
}
},
changenetwork() {
console.log(this.appForm.networkProtocol);
},
handleConfim() {
console.log("点击了确定");
console.log(this.appForm);
this.appLoading = 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: 1,
},
{
name: "pathType",
value: 1,
},
{
name: "updateType",
value: 1,
},
{
name: "path",
value: "data/App.json",
},
{
name: "configs",
value: 16,
},
//
{ name: "name1", value: "channels" },
{ name: "value1", value: this.appForm.channels },
{ name: "type1", value: 0 },
//
{ name: "name2", value: "packetSize" },
{ name: "value2", value: this.appForm.packetSize },
{ name: "type2", value: 0 },
// 15
{ name: "name3", value: "timeForKeepingLogs" },
{ name: "value3", value: this.appForm.timeForKeepingLogs * 86400 },
{ name: "type3", value: 0 },
//
{ name: "name4", value: "timeForKeepingPhotos" },
{
name: "value4",
value: this.appForm.timeForKeepingPhotos * 86400,
},
{ name: "type4", value: 0 },
//
{ name: "name5", value: "imgQuality" },
{ name: "value5", value: this.appForm.imgQuality },
{ name: "type5", value: 0 },
// ...
{ name: "name6", value: "protocol" },
{ name: "value6", value: this.appForm.protocol },
{ name: "type6", value: 0 },
// 0: tcp 1 udp
{ name: "name7", value: "networkProtocol" },
{ name: "value7", value: this.appForm.networkProtocol },
{ name: "type7", value: 0 },
//
{ name: "name8", value: "CMDID" },
{ name: "value8", value: this.appForm.CMDID },
{ name: "type8", value: 1 },
//CMA ip
{ name: "name9", value: "server" },
{ name: "value9", value: this.appForm.server },
{ name: "type9", value: 1 },
//CMA 1025-65535
{ name: "name10", value: "port" },
{ name: "value10", value: this.appForm.port },
{ name: "type10", value: 0 },
//
{ name: "name11", value: "model" },
{ name: "value11", value: this.appForm.model },
{ name: "type11", value: 1 },
//EquipName
{ name: "name12", value: "equipName" },
{ name: "value12", value: this.appForm.equipName },
{ name: "type12", value: 1 },
//BsManufacturer
{ name: "name13", value: "bsManufacturer" },
{ name: "value13", value: this.appForm.bsManufacturer },
{ name: "type13", value: 1 },
//productionDate
{ name: "name14", value: "productionDate" },
{ name: "value14", value: this.appForm.productionDate },
{ name: "type14", value: 0 },
//
{ name: "name15", value: "heartbeat" },
{ name: "value15", value: this.appForm.heartbeat },
{ name: "type15", value: 0 },
//
{ name: "name16", value: "upgradePacketBase" },
{ name: "value16", value: this.appForm.upgradePacketBase },
{ name: "type16", value: 0 },
];
this.setTermFn(params);
} else {
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
});
},
setTermFn(val) {
setTermCamera({
termId: this.areaData.id,
list: val,
})
.then((res) => {
console.log(res);
this.requestid = res.data.requestId;
this.getTakechannelStatus();
clearInterval(this.setTimer);
this.setTimer = window.setInterval(() => {
this.getTakechannelStatus();
this.setNum++;
}, 1000);
})
.catch((err) => {});
},
getTakechannelStatus() {
getTermCameraRequest({ requestid: this.requestid })
.then((res) => {
console.log(res);
if (res.data.success == 1) {
window.clearInterval(this.setTimer);
this.setTimer = null;
this.setNum = 0;
this.isShow = false;
this.appLoading = false;
this.$message({
duration: 1500,
showClose: true,
message: "设置成功",
type: "success",
});
} else if (this.setNum > 3) {
// this.isShow = false;
window.clearInterval(this.setTimer);
this.setTimer = null;
this.setNum = 0;
this.appLoading = false;
this.$message({
duration: 1500,
showClose: true,
message: "设置失败",
type: "error",
});
}
})
.catch((err) => {});
},
searchBtn() {
this.appsetLoading = 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/App.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.appsetLoading = 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.appForm.channels = resultContent.channels; //,4
this.appForm.packetSize = resultContent.packetSize; //
this.appForm.timeForKeepingLogs =
resultContent.timeForKeepingLogs / 86400; //1*86400-45*86400 15*86400
this.appForm.timeForKeepingPhotos =
resultContent.timeForKeepingPhotos / 86400; //1*86400-45*86400 15*86400
this.appForm.imgQuality = resultContent.imgQuality; //
this.appForm.heartbeat = resultContent.heartbeat; //
this.appForm.upgradePacketBase = resultContent.upgradePacketBase; // 01
this.appForm.protocol = resultContent.protocol; // ...
this.appForm.networkProtocol = resultContent.networkProtocol; // 0: tcp 1 udp
// this.appForm.network = resultContent.network; // 使
this.appForm.CMDID = resultContent.CMDID; //
this.appForm.server = resultContent.server; // CMA ip
this.appForm.port = resultContent.port; // CMA 1025-65535
this.appForm.model = resultContent.model; //
this.appForm.equipName = resultContent.equipName; //
this.appForm.bsManufacturer = resultContent.bsManufacturer; //
this.appForm.productionDate = resultContent.productionDate; //
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.appsetLoading = false;
this.$message({
duration: 1500,
showClose: true,
message: "查询失败",
type: "error",
});
}
})
.catch((err) => {});
},
display() {
this.isShow = true;
this.appForm.CMDID = this.areaData.cmdid;
this.searchBtn();
console.log(this.areaData);
},
handleclose() {
this.isShow = false;
this.bgflag = false;
this.appLoading = false;
this.appForm.channels = 4; //,4
this.appForm.packetSize = 2048; //
this.appForm.timeForKeepingLogs = 15; //1*86400-45*86400 15*86400
this.appForm.timeForKeepingPhotos = 15; //1*86400-45*86400 15*86400
this.appForm.imgQuality = ""; //
this.appForm.heartbeat = 10; //
this.appForm.upgradePacketBase = 0; // 01
this.appForm.protocol = this.areaData.protocol; // ...
this.appForm.networkProtocol = 0; // 0: tcp 1 udp
// this.appForm.network = resultContent.network; // 使
this.appForm.CMDID = this.areaData.cmdid; //
this.appForm.server = ""; // CMA ip
this.appForm.port = ""; // CMA 1025-65535
this.appForm.model = ""; //
this.appForm.equipName = ""; //
this.appForm.bsManufacturer = ""; //
this.appForm.productionDate = ""; //
window.clearInterval(this.searchTimer);
this.searchTimer = null;
this.searchNum = 0;
},
},
};
</script>
<style lang="less">
.setAppDialog {
.zzinfo {
position: absolute;
top: 22px;
left: 120px;
}
.el-form {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.el-dialog__body {
padding-bottom: 0px;
.el-form-item--small.el-form-item {
margin-bottom: 12px;
}
.channelsetBox {
width: 100%;
.el-input {
width: 250px;
}
}
.infoSpan {
margin-left: 8px;
}
.heartClass {
.el-input {
width: 190px;
}
}
.cmaClass {
.el-input {
width: 180px;
}
}
.packetClass {
.el-input {
width: 200px;
}
}
}
.dialog-footer {
.el-button--default,
.el-button--primary {
width: 80px !important;
margin-bottom: 0px !important;
}
.el-button + .el-button {
margin-left: 10px !important;
}
}
}
</style>

@ -7,8 +7,13 @@
width="640px"
@close="handleclose"
>
<div class="zzinfo">装置编号{{ areaData.cmdid }}</div>
<div class="channelsetBox">
<div class="zzinfo">
装置编号{{ areaData.cmdid
}}<el-button type="text" icon="el-icon-refresh" @click="searchBtn"
>刷新</el-button
>
</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>
@ -38,25 +43,27 @@
<el-input v-model="channelForm.resolutionCX"></el-input>
<el-input v-model="channelForm.resolutionCY"></el-input>
</el-form-item>
<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"
<div class="videoDiv">
<el-form-item label="视频分辨率" class="videoclass">
<el-select
v-model="channelForm.videoSize"
placeholder="请选择"
@change="changevideoChannel"
>
</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-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>
</div>
<el-form-item label="压缩率">
<el-input v-model="channelForm.ysl"></el-input>
<span class="infoSpan">(0-100的整数)</span>
@ -76,13 +83,15 @@
@change="bgchange"
></el-checkbox>
</el-form-item>
<el-form-item label="曝光时间">
<el-input v-model="channelForm.bgsj" :disabled="bgflag"></el-input>
<span class="infoSpan">(毫秒)</span>
</el-form-item>
<el-form-item label="ISO">
<el-input v-model="channelForm.iso" :disabled="bgflag"></el-input>
</el-form-item>
<div class="isoDiv">
<el-form-item label="曝光时间">
<el-input v-model="channelForm.bgsj" :disabled="bgflag"></el-input>
<span class="infoSpan">(毫秒)</span>
</el-form-item>
<el-form-item label="ISO">
<el-input v-model="channelForm.iso" :disabled="bgflag"></el-input>
</el-form-item>
</div>
<el-form-item label="模式选择">
<el-checkbox
label="HDR模式"
@ -134,8 +143,14 @@
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleclose"> </el-button>
<el-button type="primary" @click="handleConfim" :loading="channelLoading"
<el-button @click="handleclose" :disabled="channelsetLoading"
> </el-button
>
<el-button
type="primary"
:disabled="channelsetLoading"
@click="handleConfim"
:loading="channelLoading"
> </el-button
>
</div>
@ -152,6 +167,7 @@ export default {
props: {},
data() {
return {
channelsetLoading: true,
isShow: false,
channelLoading: false,
channelList: [], //
@ -258,6 +274,10 @@ export default {
},
],
requestid: "",
searchNum: 0,
searchTimer: null,
setNum: 0,
setTimer: null,
};
},
computed: {
@ -538,7 +558,13 @@ export default {
.then((res) => {
console.log(res);
this.requestid = res.data.requestId;
this.getTakechannelStatus();
clearInterval(this.setTimer);
this.setTimer = window.setInterval(() => {
this.getTakechannelStatus();
this.setNum++;
}, 1000);
})
.catch((err) => {});
},
@ -547,6 +573,9 @@ export default {
.then((res) => {
console.log(res);
if (res.data.success == 1) {
window.clearInterval(this.setTimer);
this.setTimer = null;
this.setNum = 0;
this.isShow = false;
this.channelLoading = false;
this.$message({
@ -555,8 +584,11 @@ export default {
message: "通道设置成功",
type: "success",
});
} else {
this.isShow = false;
} else if (this.setNum > 3) {
// this.isShow = false;
window.clearInterval(this.setTimer);
this.setTimer = null;
this.setNum = 0;
this.channelLoading = false;
this.$message({
duration: 1500,
@ -569,6 +601,7 @@ export default {
.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);
@ -618,6 +651,11 @@ export default {
console.log(res);
this.requestid = res.data.requestId;
this.getsearchchannelStatus();
clearInterval(this.searchTimer);
this.searchTimer = window.setInterval(() => {
this.getsearchchannelStatus();
this.searchNum++;
}, 1000);
})
.catch((err) => {});
},
@ -626,6 +664,10 @@ export default {
.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);
@ -637,13 +679,20 @@ export default {
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.usbchecked =
resultContent.usbCamera == 1 ? true : false;
this.channelForm.zzdjchecked =
resultContent.autoFocus == 1 ? true : false;
this.channelForm.zdbgchecked =
resultContent.autoExposure == 1 ? true : false;
this.channelForm.bgsj =
resultContent.exposureTime == 0 ? "" : resultContent.exposureTime;
this.channelForm.iso =
resultContent.sensibility == 0 ? "" : resultContent.sensibility;
this.channelForm.hdrchecked =
resultContent.hdrMode == 1 ? true : false;
this.channelForm.ywchecked =
resultContent.nightMode == 1 ? true : false;
this.channelForm.aival = resultContent.recognization;
this.channelForm.roteval = resultContent.orientation;
this.channelForm.rtosd = resultContent.osd.rightTop;
@ -653,6 +702,13 @@ export default {
// 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 = "";
} else {
this.bgflag = false;
}
if (
this.channelForm.videoCX == 720 &&
this.channelForm.videoCY == 480
@ -684,15 +740,20 @@ export default {
this.channelForm.videoSize = 4;
}
this.channelForm.videoDuration = resultContent.videoDuration;
this.$message({
duration: 1500,
showClose: true,
message: "通道查询成功",
type: "success",
});
} else {
} 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,
@ -731,6 +792,9 @@ export default {
this.channelForm.videoCX = "";
this.channelForm.videoCY = "";
this.channelForm.videoDuration = 15;
window.clearInterval(this.searchTimer);
this.searchTimer = null;
this.searchNum = 0;
},
},
};
@ -769,6 +833,24 @@ export default {
}
}
}
.videoDiv {
display: flex;
.el-select {
.el-input {
width: 160px;
}
}
.el-input {
width: 100px;
}
}
.isoDiv {
display: flex;
.el-input {
width: 140px;
}
}
.videoclass {
// .el-form-item__content {
// display: flex;

@ -0,0 +1,129 @@
<template>
<el-dialog
class="addUserDialog"
:title="title"
:visible.sync="isShow"
:close-on-click-modal="false"
width="470px"
@close="handleclose"
>
<el-form
label-position="left"
ref="formInfo"
label-width="100px"
:rules="title == '新增' ? rules : xgrules"
:model="formdata"
>
<el-form-item label="角色名称:" prop="roleName">
<el-input
placeholder="请输入角色名称"
v-model="formdata.roleName"
autocomplete="off"
></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { addUserApi, updateUserApi } from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
roleUser: "",
isShow: false,
formdata: {},
rules: {
roleName: [
{ required: true, message: "请输入用户名", trigger: "blur" },
],
},
xgrules: {
roleName: [
{ required: true, message: "请输入用户名", trigger: "blur" },
],
},
};
},
methods: {
//
getdataform(val) {
console.log(val);
if (val == null) {
return (this.formdata = {
role: 2,
});
}
//this.formdata = val;
this.formdata = JSON.parse(JSON.stringify(val));
},
//
submitForm() {
this.$refs.formInfo.validate((valid) => {
if (valid) {
if (this.title == "新增") {
addUserApi(this.formdata)
.then((res) => {
if (res.code == 200) {
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
});
this.isShow = false;
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {});
} else {
updateUserApi(this.formdata)
.then((res) => {
if (res.code == 200) {
this.$message.success("修改成功");
this.isShow = false;
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {});
}
} else {
console.log("error submit!!");
return false;
}
});
},
display() {
this.isShow = true;
this.roleUser = localStorage.getItem("role");
},
hide() {
this.isShow = false;
},
handleclose() {
this.$parent.deviceList();
},
},
mounted() {},
};
</script>
<style lang="less">
.addUserDialog {
.el-form-item {
.el-input,
.el-select,
.el-input-number {
width: 100%;
}
}
}
</style>

@ -0,0 +1,193 @@
<template>
<div class="rolemanagement">
<div class="deviceBox">
<div class="deviceBtnGroup">
<h4>角色管理</h4>
<el-button type="primary" icon="el-icon-plus" @click="handleAdddevice()"
>新增</el-button
>
</div>
<div class="deviceTable">
<el-table
ref="multipleTable"
:data="deviceTableData"
stripe
tooltip-effect="dark"
style="width: 100%"
height="calc(100% - 40px)"
@row-click="handleRowClick"
>
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column
label="角色"
show-overflow-tooltip
prop="userName"
></el-table-column>
<el-table-column
label="创建时间"
show-overflow-tooltip
prop="createTime"
>
<template slot-scope="scope">{{
$moment(scope.row.createTime).format("yy-MM-DD HH:mm:ss")
}}</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="200">
<template slot-scope="scope">
<el-button
@click.native.stop="handleResive(scope.row)"
type="text"
>修改</el-button
>
<el-button
type="text"
class="deleteText"
@click.native.stop="handleDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
</div>
</div>
<!-- 新增 -->
<addRole :title="title" ref="adduserref"></addRole>
</div>
</template>
<script>
import addRole from "./components/addRole.vue";
import { getUserList, delUserApi } from "@/utils/api/index";
export default {
name: "roleManagement",
components: {
addRole,
},
data() {
return {
title: "", //
deviceTableData: [],
//multipleSelection: [], //
page: 1, //
pageSize: 20, //
total: 0, //
};
},
created() {
this.deviceList();
},
methods: {
//线
deviceList() {
getUserList({
pageindex: this.page,
pagesize: this.pageSize,
})
.then((res) => {
this.deviceTableData = res.data.list;
this.total = res.data.total;
})
.catch((err) => {});
},
//
handleRowClick(row, column, event) {
this.$refs.multipleTable.toggleRowSelection(row);
},
//
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
handleAdddevice() {
this.title = "新增";
this.$refs.adduserref.display();
this.$refs.adduserref.getdataform(null);
},
//
handleResive(data) {
this.title = "修改";
this.$refs.adduserref.display();
this.$refs.adduserref.getdataform(data);
},
//
handleDelete(data) {
this.$confirm("确定要删除记录吗,同时删除关联关系?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delUserApi({ uid: data.userId }).then((res) => {
if (res.code == 200) {
this.$message.success("删除成功");
this.deviceList(); //
} else {
this.$message.error(res.msg);
}
});
})
.catch(() => {
this.$message({
duration: 1500,
showClose: true,
type: "info",
message: "已取消删除",
});
});
},
//
handleCurrentChange(val) {
this.page = val;
this.deviceList();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.deviceList();
},
},
};
</script>
<style lang="less">
.rolemanagement {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.deviceBox {
border: 1px solid #dddddd;
height: calc(100% - 24px);
padding: 12px;
border-radius: 4px;
}
.deviceBtnGroup {
display: flex;
justify-content: space-between;
align-items: center;
}
.deviceTable {
margin-top: 16px;
height: calc(100% - 48px);
//background: #fcc;
}
}
</style>
Loading…
Cancel
Save