master
fanluyan 2 years ago
parent fec03dec8f
commit 9a7a874fba

@ -63,9 +63,9 @@
>
<el-table-column type="selection" :reserve-selection="true" width="50">
</el-table-column>
<el-table-column type="index" width="50" label="序号"> </el-table-column>
<!-- <el-table-column type="index" width="50" label="序号"> </el-table-column>
<el-table-column prop="id" label="ID" width="60" sortable>
</el-table-column>
</el-table-column> -->
<el-table-column prop="oid" label="出厂ID" width="150" sortable>
<template slot-scope="scope">
{{
@ -142,7 +142,7 @@
{{ protocolMap[scope.row.protocol] }}
</template>
</el-table-column>
<el-table-column label="电池状态" min-width="120" v-if="dccheck">
<el-table-column label="电池状态" width="118" v-if="dccheck">
<template slot-scope="scope">
{{
scope.row.raw_report.hasOwnProperty("msgs")
@ -153,7 +153,7 @@
</el-table-column>
<el-table-column label="心跳信息" v-if="xtcheck">
<el-table-column label="次数" min-width="48">
<el-table-column label="次数" min-width="48" v-if="xtcs">
<template slot-scope="scope">
{{
scope.row.raw_report.hasOwnProperty("msgs")
@ -162,7 +162,7 @@
}}
</template>
</el-table-column>
<el-table-column label="周期" min-width="48">
<el-table-column label="周期" min-width="48" v-if="xtzq">
<template slot-scope="scope">
{{
scope.row.raw_report.hasOwnProperty("msgs")
@ -331,6 +331,8 @@
<el-checkbox v-model="gycheck"></el-checkbox>
<el-checkbox v-model="dccheck"></el-checkbox>
<el-checkbox v-model="xtcheck"></el-checkbox>
<el-checkbox v-model="xtcs"></el-checkbox>
<el-checkbox v-model="xtzq"></el-checkbox>
<el-checkbox v-model="pzcheck"></el-checkbox>
<el-checkbox v-model="wlcheck"></el-checkbox>
<el-checkbox v-model="cqcheck"></el-checkbox>
@ -574,6 +576,8 @@ export default {
gycheck: false,
dccheck: true,
xtcheck: true,
xtcs: false,
xtzq: false,
pzcheck: true,
wlcheck: true,
cqcheck: true,

@ -7,111 +7,134 @@
:model="formdata"
class="demo-form-inline"
>
<div class="topSearch">
<el-form-item label="线路" class="xlbox">
<el-select v-model="formdata.lineId" @change="getSearchgt" filterable>
<el-option
v-for="item in xlOptions"
:key="item.id"
:label="item.name"
:value="item.id"
<div class="topSearch">
<el-form-item label="线路" class="xlbox">
<el-select
v-model="formdata.lineId"
@change="getSearchgt"
filterable
>
{{ item.vname + item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="杆塔" class="gtbox">
<el-select v-model="formdata.towerId" filterable>
<el-option
v-for="item in gtOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否在线" class="isonLineClass">
<el-select v-model="formdata.isonline">
<el-option
v-for="item in onlineOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</div>
<div class="bottomSearch">
<el-form-item label="出厂ID" class="oidbox">
<el-input
v-model="formdata.oidInput"
placeholder="请输入出厂ID"
clearable
></el-input>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="反选" placement="top">
<el-checkbox
v-model="formdata.oidCheck"
:checked="formdata.oidCheck == 1 ? true : false"
true-label="1"
false-label="0"
></el-checkbox
>
</el-tooltip>
</el-form-item>
<el-form-item label="装置编号" class="cmdibox">
<el-input
v-model="formdata.cmdidInput"
placeholder="请输入装置编号"
clearable
></el-input>
<el-tooltip class="item" effect="dark" content="反选" placement="top">
<el-checkbox
v-model="formdata.cmdidCheck"
:checked="formdata.cmdidCheck == 1 ? true : false"
true-label="1"
false-label="0"
></el-checkbox>
</el-tooltip>
</el-form-item>
<el-form-item label="CMA服务器" class="cmabox">
<el-input
v-model="formdata.cmaInput"
placeholder="请输入CMA服务器"
clearable
></el-input>
<el-tooltip class="item" effect="dark" content="反选" placement="top">
<el-checkbox
v-model="formdata.cmaCheck"
:checked="formdata.cmaCheck == 1 ? true : false"
true-label="1"
false-label="0"
></el-checkbox>
</el-tooltip>
</el-form-item>
<el-form-item label="版本" class="versionbox">
<el-input
v-model="formdata.versionInput"
placeholder="请输入版本"
clearable
></el-input>
<el-tooltip class="item" effect="dark" content="反选" placement="top">
<el-checkbox
v-model="formdata.versionCheck"
:checked="formdata.versionCheck == 1 ? true : false"
true-label="1"
false-label="0"
></el-checkbox>
</el-tooltip>
</el-form-item>
<el-form-item class="btngrop">
<el-button type="primary" @click="onSubmit"></el-button>
<el-button type="primary" @click="onReset"></el-button>
</el-form-item>
</div>
<el-option
v-for="item in xlOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
{{ item.vname + item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="杆塔" class="gtbox">
<el-select v-model="formdata.towerId" filterable>
<el-option
v-for="item in gtOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否在线" class="isonLineClass">
<el-select v-model="formdata.isonline">
<el-option
v-for="item in onlineOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</div>
<div class="bottomSearch">
<el-form-item label="出厂ID" class="oidbox">
<el-input
v-model="formdata.oidInput"
placeholder="请输入出厂ID"
clearable
></el-input>
<el-tooltip
class="item"
effect="dark"
content="反选"
placement="top"
>
<el-checkbox
v-model="formdata.oidCheck"
:checked="formdata.oidCheck == 1 ? true : false"
true-label="1"
false-label="0"
></el-checkbox>
</el-tooltip>
</el-form-item>
<el-form-item label="装置编号" class="cmdibox">
<el-input
v-model="formdata.cmdidInput"
placeholder="请输入装置编号"
clearable
></el-input>
<el-tooltip
class="item"
effect="dark"
content="反选"
placement="top"
>
<el-checkbox
v-model="formdata.cmdidCheck"
:checked="formdata.cmdidCheck == 1 ? true : false"
true-label="1"
false-label="0"
></el-checkbox>
</el-tooltip>
</el-form-item>
<el-form-item label="CMA服务器" class="cmabox">
<el-input
v-model="formdata.cmaInput"
placeholder="请输入CMA服务器"
clearable
></el-input>
<el-tooltip
class="item"
effect="dark"
content="反选"
placement="top"
>
<el-checkbox
v-model="formdata.cmaCheck"
:checked="formdata.cmaCheck == 1 ? true : false"
true-label="1"
false-label="0"
></el-checkbox>
</el-tooltip>
</el-form-item>
<el-form-item label="版本" class="versionbox">
<el-input
v-model="formdata.versionInput"
placeholder="请输入版本"
clearable
></el-input>
<el-tooltip
class="item"
effect="dark"
content="反选"
placement="top"
>
<el-checkbox
v-model="formdata.versionCheck"
:checked="formdata.versionCheck == 1 ? true : false"
true-label="1"
false-label="0"
></el-checkbox>
</el-tooltip>
</el-form-item>
<el-form-item class="btngrop">
<el-button type="primary" @click="onSubmit"></el-button>
<el-button type="primary" @click="onReset"></el-button>
</el-form-item>
</div>
</el-form>
<el-tooltip
class="item"
@ -132,7 +155,13 @@
class="tableBox"
:style="{ height: showDiv ? 'calc(100% - 102px)' : 'calc(100% - 2px)' }"
>
<tableMain :tableData="dataList" :onlineNum="onlineNum" :offlineNum="offlineNum" :noPicNum="noPicNum" v-loading="tableLoaidng"></tableMain>
<tableMain
:tableData="dataList"
:onlineNum="onlineNum"
:offlineNum="offlineNum"
:noPicNum="noPicNum"
v-loading="tableLoaidng"
></tableMain>
</div>
</div>
</template>
@ -172,7 +201,7 @@ export default {
tableLoaidng: false,
onlineNum: "", //线
offlineNum: "", //线
noPicNum:'',//
noPicNum: "", //
};
},
created() {
@ -234,39 +263,38 @@ export default {
frev4: this.formdata.versionCheck,
})
.then((res) => {
res.data = res.data.map(item => {
if (!item.raw_report.pic) {
item.raw_report.pic = 0;
}
return item;
});
res.data = res.data.map((item) => {
if (!item.raw_report.pic) {
item.raw_report.pic = 0;
}
return item;
});
if (this.formdata.isonline == "-1") {
//
this.dataList = res.data;
this.dataList = res.data;
// console.log(this.dataList)
} else if (this.formdata.isonline == "1") {
//线
this.dataList = res.data.filter(
(item) => this.nowTime - item.last_heartbeat_ts <= 720
);
} else if (this.formdata.isonline == "0") {
//线
this.dataList = res.data.filter(
(item) => this.nowTime - item.last_heartbeat_ts > 720
);
}
this.onlineNum =this.dataList.filter(
(item) => this.nowTime - item.last_heartbeat_ts <= 720
).length;
this.offlineNum = this.dataList.length - this.onlineNum
this.noPicNum = this.dataList.filter(
(item) => item.raw_report.pic==undefined||item.raw_report.pic==0||item.raw_report.pic==-1
).length
this.onlineNum = this.dataList.filter(
(item) => this.nowTime - item.last_heartbeat_ts <= 720
).length;
this.offlineNum = this.dataList.length - this.onlineNum;
this.noPicNum = this.dataList.filter(
(item) =>
item.raw_report.pic == undefined ||
item.raw_report.pic == 0 ||
item.raw_report.pic == -1
).length;
this.tableLoaidng = false;
})
.catch((err) => {});
@ -292,13 +320,12 @@ export default {
})
.then((res) => {
console.log(res);
res.data = res.data.map(item => {
if (!item.raw_report.pic) {
item.raw_report.pic = 0;
}
return item;
});
res.data = res.data.map((item) => {
if (!item.raw_report.pic) {
item.raw_report.pic = 0;
}
return item;
});
if (this.formdata.isonline == "-1") {
//
this.dataList = res.data;
@ -314,13 +341,16 @@ export default {
(item) => this.nowTime - item.last_heartbeat_ts > 720
);
}
this.onlineNum =this.dataList.filter(
(item) => this.nowTime - item.last_heartbeat_ts <= 720
).length;
this.offlineNum = this.dataList.length - this.onlineNum
this.noPicNum = this.dataList.filter(
(item) => item.raw_report.pic==undefined||item.raw_report.pic==0||item.raw_report.pic==-1
).length
this.onlineNum = this.dataList.filter(
(item) => this.nowTime - item.last_heartbeat_ts <= 720
).length;
this.offlineNum = this.dataList.length - this.onlineNum;
this.noPicNum = this.dataList.filter(
(item) =>
item.raw_report.pic == undefined ||
item.raw_report.pic == 0 ||
item.raw_report.pic == -1
).length;
})
.catch((err) => {});
},
@ -360,20 +390,20 @@ export default {
// align-items: center;
// flex-wrap: wrap;
flex-direction: column;
.topSearch{
display:flex;
.topSearch {
display: flex;
}
.bottomSearch{
display:flex;
align-items:center;
.el-form-item--small .el-form-item__label{
.bottomSearch {
display: flex;
align-items: center;
.el-form-item--small .el-form-item__label {
white-space: nowrap;
}
.btngrop{
.el-form-item__content{
display:flex;
flex-wrap:nowrap;
.btngrop {
.el-form-item__content {
display: flex;
flex-wrap: nowrap;
}
}
}
@ -420,22 +450,20 @@ export default {
//height: calc(100% - 102px);
}
}
.el-pagination{
color: #606262;
font-weight: normal;
.el-pager li.active{
font-weight:800;
}
.el-pagination {
color: #606262;
font-weight: normal;
.el-pager li.active {
font-weight: 800;
}
}
.el-dialog__headerbtn{
top:18px;
.el-dialog__close{
font-size:26px;
&:hover{
background:#e2e2e2;
.el-dialog__headerbtn {
top: 18px;
.el-dialog__close {
font-size: 26px;
&:hover {
background: #e2e2e2;
}
}
}
}
</style>

@ -2,15 +2,30 @@
<div class="reportBox">
<div class="commandBox">
<div class="commandRunLeft commandClass">
<h3>待下发终端</h3>
<div class="headTitle">
<span class="title">待下发终端</span>
<el-select
v-model="operateL"
placeholder="筛选运操维作"
@change="selectLeftChanged"
>
<el-option
v-for="item in operateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<span class="time">更新时间{{ updateTime }}</span>
</div>
<div
class="commandList"
v-loading="leftComLoading"
v-if="runCommand.length != 0"
v-if="leftCommand.length != 0"
>
<p
class="comLi"
v-for="(item, index) in runCommand"
v-for="(item, index) in leftCommand"
:key="index"
@dblclick="handleShowCommand(item)"
>
@ -22,14 +37,29 @@
>
</p>
</div>
<div class="commandList">
<div class="commandList" v-else>
<p>暂无下发命令</p>
</div>
</div>
<div class="commandRunRight commandClass">
<h3>已下发终端</h3>
<div class="commandList">
<p class="comLi" v-for="(item, index) in endCommand" :key="index">
<div class="headTitle">
<span class="title">已下发终端</span>
<el-select
v-model="operateR"
placeholder="筛选运操维作"
@change="selectRightChanged"
>
<el-option
v-for="item in operateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<span class="time">更新时间{{ updateTime }}</span>
</div>
<div class="commandList" v-if="rightCommand.length != 0">
<p class="comLi" v-for="(item, index) in rightCommand" :key="index">
<el-tooltip
class="item"
effect="dark"
@ -52,6 +82,9 @@
>
</p>
</div>
<div class="commandList" v-else>
<p>暂无已下发命令</p>
</div>
</div>
</div>
<el-dialog
@ -84,6 +117,8 @@ export default {
leftComLoading: false, //loading
runCommand: [],
endCommand: [],
leftCommand: [],
rightCommand: [],
commandShow: false,
deveceMsg: "",
cmdCn: {
@ -100,6 +135,23 @@ export default {
},
cmdtimer: null,
endtimer: null,
updateTime: null,
//
operateOptions: [
{ id: 0, name: "全部" },
{ id: 1, name: "重启" },
{ id: 2, name: "重启装置" },
{ id: 3, name: "设置I1服务器" },
{ id: 4, name: "设置运维服务器" },
{ id: 5, name: "设置心跳周期" },
{ id: 6, name: "上传日志" },
{ id: 7, name: "升级" },
{ id: 8, name: "开启frpc" },
{ id: 9, name: "停止frpc" },
{ id: 10, name: "停止老化测试" },
],
operateL: 0,
operateR: 0,
};
},
computed: {},
@ -120,6 +172,8 @@ export default {
console.log(res);
this.runCommand = res.data;
this.leftComLoading = false;
this.selectLeftChanged(this.operateL);
this.updateTime = new Date();
})
.catch((err) => {});
},
@ -167,10 +221,134 @@ export default {
.then((res) => {
console.log(res);
this.endCommand = res.data;
this.selectRightChanged(this.operateR);
// this.leftComLoading = false;
this.updateTime = new Date().toLocaleString();
})
.catch((err) => {});
},
//
selectLeftChanged(val) {
console.log(val);
switch (val) {
case 0:
this.leftCommand = this.runCommand;
return;
case 1:
this.leftCommand = this.runCommand.filter(
(item) => item.cmdName == "yw_cmd_android_reboot"
);
return;
case 2:
this.leftCommand = this.runCommand.filter(
(item) => item.cmdName == "yw_cmd_mcu_reboot"
);
return;
case 3:
this.leftCommand = this.runCommand.filter(
(item) => item.cmdName == "i1_cmd_set_i1_server_ip_port"
);
return;
case 4:
this.leftCommand = this.runCommand.filter(
(item) => item.cmdName == "i1_cmd_set_xy_yw_ip_port"
);
return;
case 5:
this.leftCommand = this.runCommand.filter(
(item) => item.cmdName == "i1_cmd_set_i1_heart_beat_time"
);
return;
case 6:
this.leftCommand = this.runCommand.filter(
(item) =>
item.cmdName == "yw_cmd_myw_cmd_upload_i1_zip_logcu_reboot"
);
return;
case 7:
this.leftCommand = this.runCommand.filter(
(item) => item.cmdName == "upgrade"
);
return;
case 8:
this.leftCommand = this.runCommand.filter(
(item) => item.cmdName == "yw_cmd_start_frpc"
);
return;
case 9:
this.leftCommand = this.runCommand.filter(
(item) => item.cmdName == "yw_cmd_stop_frpc"
);
return;
case 10:
this.leftCommand = this.runCommand.filter(
(item) => item.cmdName == "i1_cmd_stop_aging_test"
);
return;
}
},
//
selectRightChanged(val) {
console.log(val);
switch (val) {
case 0:
this.rightCommand = this.endCommand;
console.log(this.rightCommand);
return;
case 1:
this.rightCommand = this.endCommand.filter(
(item) => item.cmdName == "yw_cmd_android_reboot"
);
console.log(this.rightCommand);
return;
case 2:
this.rightCommand = this.endCommand.filter(
(item) => item.cmdName == "yw_cmd_mcu_reboot"
);
return;
case 3:
this.rightCommand = this.endCommand.filter(
(item) => item.cmdName == "i1_cmd_set_i1_server_ip_port"
);
return;
case 4:
this.rightCommand = this.endCommand.filter(
(item) => item.cmdName == "i1_cmd_set_xy_yw_ip_port"
);
return;
case 5:
this.rightCommand = this.endCommand.filter(
(item) => item.cmdName == "i1_cmd_set_i1_heart_beat_time"
);
return;
case 6:
this.rightCommand = this.endCommand.filter(
(item) =>
item.cmdName == "yw_cmd_myw_cmd_upload_i1_zip_logcu_reboot"
);
return;
case 7:
this.rightCommand = this.endCommand.filter(
(item) => item.cmdName == "upgrade"
);
return;
case 8:
this.rightCommand = this.endCommand.filter(
(item) => item.cmdName == "yw_cmd_start_frpc"
);
return;
case 9:
this.rightCommand = this.endCommand.filter(
(item) => item.cmdName == "yw_cmd_stop_frpc"
);
return;
case 10:
this.rightCommand = this.endCommand.filter(
(item) => item.cmdName == "i1_cmd_stop_aging_test"
);
return;
}
},
},
beforeDestroy() {
//
@ -196,11 +374,22 @@ export default {
border: 1px solid #dcdfe6;
margin-right: 12px;
border-radius: 4px;
h3 {
font-size: 16px;
font-weight: normal;
height: 32px;
line-height: 32px;
.headTitle {
height: 40px;
line-height: 40px;
display: flex;
align-items: center;
.title {
font-size: 16px;
font-weight: normal;
}
.el-select {
margin: 0px 12px;
}
.time {
font-size: 12px;
margin-left: 8px;
}
}
.commandList {
width: 100%;

Loading…
Cancel
Save