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

@ -9,7 +9,11 @@
> >
<div class="topSearch"> <div class="topSearch">
<el-form-item label="线路" class="xlbox"> <el-form-item label="线路" class="xlbox">
<el-select v-model="formdata.lineId" @change="getSearchgt" filterable> <el-select
v-model="formdata.lineId"
@change="getSearchgt"
filterable
>
<el-option <el-option
v-for="item in xlOptions" v-for="item in xlOptions"
:key="item.id" :key="item.id"
@ -48,15 +52,19 @@
placeholder="请输入出厂ID" placeholder="请输入出厂ID"
clearable clearable
></el-input> ></el-input>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="反选" placement="top"> <el-tooltip
class="item"
effect="dark"
content="反选"
placement="top"
>
<el-checkbox <el-checkbox
v-model="formdata.oidCheck" v-model="formdata.oidCheck"
:checked="formdata.oidCheck == 1 ? true : false" :checked="formdata.oidCheck == 1 ? true : false"
true-label="1" true-label="1"
false-label="0" false-label="0"
></el-checkbox ></el-checkbox>
>
</el-tooltip> </el-tooltip>
</el-form-item> </el-form-item>
@ -66,7 +74,12 @@
placeholder="请输入装置编号" placeholder="请输入装置编号"
clearable clearable
></el-input> ></el-input>
<el-tooltip class="item" effect="dark" content="反选" placement="top"> <el-tooltip
class="item"
effect="dark"
content="反选"
placement="top"
>
<el-checkbox <el-checkbox
v-model="formdata.cmdidCheck" v-model="formdata.cmdidCheck"
:checked="formdata.cmdidCheck == 1 ? true : false" :checked="formdata.cmdidCheck == 1 ? true : false"
@ -82,7 +95,12 @@
placeholder="请输入CMA服务器" placeholder="请输入CMA服务器"
clearable clearable
></el-input> ></el-input>
<el-tooltip class="item" effect="dark" content="反选" placement="top"> <el-tooltip
class="item"
effect="dark"
content="反选"
placement="top"
>
<el-checkbox <el-checkbox
v-model="formdata.cmaCheck" v-model="formdata.cmaCheck"
:checked="formdata.cmaCheck == 1 ? true : false" :checked="formdata.cmaCheck == 1 ? true : false"
@ -98,7 +116,12 @@
placeholder="请输入版本" placeholder="请输入版本"
clearable clearable
></el-input> ></el-input>
<el-tooltip class="item" effect="dark" content="反选" placement="top"> <el-tooltip
class="item"
effect="dark"
content="反选"
placement="top"
>
<el-checkbox <el-checkbox
v-model="formdata.versionCheck" v-model="formdata.versionCheck"
:checked="formdata.versionCheck == 1 ? true : false" :checked="formdata.versionCheck == 1 ? true : false"
@ -132,7 +155,13 @@
class="tableBox" class="tableBox"
:style="{ height: showDiv ? 'calc(100% - 102px)' : 'calc(100% - 2px)' }" :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>
</div> </div>
</template> </template>
@ -172,7 +201,7 @@ export default {
tableLoaidng: false, tableLoaidng: false,
onlineNum: "", //线 onlineNum: "", //线
offlineNum: "", //线 offlineNum: "", //线
noPicNum:'',// noPicNum: "", //
}; };
}, },
created() { created() {
@ -234,9 +263,7 @@ export default {
frev4: this.formdata.versionCheck, frev4: this.formdata.versionCheck,
}) })
.then((res) => { .then((res) => {
res.data = res.data.map((item) => {
res.data = res.data.map(item => {
if (!item.raw_report.pic) { if (!item.raw_report.pic) {
item.raw_report.pic = 0; item.raw_report.pic = 0;
} }
@ -252,21 +279,22 @@ export default {
this.dataList = res.data.filter( this.dataList = res.data.filter(
(item) => this.nowTime - item.last_heartbeat_ts <= 720 (item) => this.nowTime - item.last_heartbeat_ts <= 720
); );
} else if (this.formdata.isonline == "0") { } else if (this.formdata.isonline == "0") {
//线 //线
this.dataList = res.data.filter( this.dataList = res.data.filter(
(item) => this.nowTime - item.last_heartbeat_ts > 720 (item) => this.nowTime - item.last_heartbeat_ts > 720
); );
} }
this.onlineNum =this.dataList.filter( this.onlineNum = this.dataList.filter(
(item) => this.nowTime - item.last_heartbeat_ts <= 720 (item) => this.nowTime - item.last_heartbeat_ts <= 720
).length; ).length;
this.offlineNum = this.dataList.length - this.onlineNum this.offlineNum = this.dataList.length - this.onlineNum;
this.noPicNum = this.dataList.filter( this.noPicNum = this.dataList.filter(
(item) => item.raw_report.pic==undefined||item.raw_report.pic==0||item.raw_report.pic==-1 (item) =>
).length item.raw_report.pic == undefined ||
item.raw_report.pic == 0 ||
item.raw_report.pic == -1
).length;
this.tableLoaidng = false; this.tableLoaidng = false;
}) })
.catch((err) => {}); .catch((err) => {});
@ -292,8 +320,7 @@ export default {
}) })
.then((res) => { .then((res) => {
console.log(res); console.log(res);
res.data = res.data.map(item => { res.data = res.data.map((item) => {
if (!item.raw_report.pic) { if (!item.raw_report.pic) {
item.raw_report.pic = 0; item.raw_report.pic = 0;
} }
@ -314,13 +341,16 @@ export default {
(item) => this.nowTime - item.last_heartbeat_ts > 720 (item) => this.nowTime - item.last_heartbeat_ts > 720
); );
} }
this.onlineNum =this.dataList.filter( this.onlineNum = this.dataList.filter(
(item) => this.nowTime - item.last_heartbeat_ts <= 720 (item) => this.nowTime - item.last_heartbeat_ts <= 720
).length; ).length;
this.offlineNum = this.dataList.length - this.onlineNum this.offlineNum = this.dataList.length - this.onlineNum;
this.noPicNum = this.dataList.filter( this.noPicNum = this.dataList.filter(
(item) => item.raw_report.pic==undefined||item.raw_report.pic==0||item.raw_report.pic==-1 (item) =>
).length item.raw_report.pic == undefined ||
item.raw_report.pic == 0 ||
item.raw_report.pic == -1
).length;
}) })
.catch((err) => {}); .catch((err) => {});
}, },
@ -360,20 +390,20 @@ export default {
// align-items: center; // align-items: center;
// flex-wrap: wrap; // flex-wrap: wrap;
flex-direction: column; flex-direction: column;
.topSearch{ .topSearch {
display:flex; display: flex;
} }
.bottomSearch{ .bottomSearch {
display:flex; display: flex;
align-items:center; align-items: center;
.el-form-item--small .el-form-item__label{ .el-form-item--small .el-form-item__label {
white-space: nowrap; white-space: nowrap;
} }
.btngrop{ .btngrop {
.el-form-item__content{ .el-form-item__content {
display:flex; display: flex;
flex-wrap:nowrap; flex-wrap: nowrap;
} }
} }
} }
@ -420,22 +450,20 @@ export default {
//height: calc(100% - 102px); //height: calc(100% - 102px);
} }
} }
.el-pagination{ .el-pagination {
color: #606262; color: #606262;
font-weight: normal; font-weight: normal;
.el-pager li.active{ .el-pager li.active {
font-weight:800; font-weight: 800;
} }
} }
.el-dialog__headerbtn{ .el-dialog__headerbtn {
top:18px; top: 18px;
.el-dialog__close{ .el-dialog__close {
font-size:26px; font-size: 26px;
&:hover{ &:hover {
background:#e2e2e2; background: #e2e2e2;
} }
} }
} }
</style> </style>

@ -2,15 +2,30 @@
<div class="reportBox"> <div class="reportBox">
<div class="commandBox"> <div class="commandBox">
<div class="commandRunLeft commandClass"> <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 <div
class="commandList" class="commandList"
v-loading="leftComLoading" v-loading="leftComLoading"
v-if="runCommand.length != 0" v-if="leftCommand.length != 0"
> >
<p <p
class="comLi" class="comLi"
v-for="(item, index) in runCommand" v-for="(item, index) in leftCommand"
:key="index" :key="index"
@dblclick="handleShowCommand(item)" @dblclick="handleShowCommand(item)"
> >
@ -22,14 +37,29 @@
> >
</p> </p>
</div> </div>
<div class="commandList"> <div class="commandList" v-else>
<p>暂无下发命令</p> <p>暂无下发命令</p>
</div> </div>
</div> </div>
<div class="commandRunRight commandClass"> <div class="commandRunRight commandClass">
<h3>已下发终端</h3> <div class="headTitle">
<div class="commandList"> <span class="title">已下发终端</span>
<p class="comLi" v-for="(item, index) in endCommand" :key="index"> <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 <el-tooltip
class="item" class="item"
effect="dark" effect="dark"
@ -52,6 +82,9 @@
> >
</p> </p>
</div> </div>
<div class="commandList" v-else>
<p>暂无已下发命令</p>
</div>
</div> </div>
</div> </div>
<el-dialog <el-dialog
@ -84,6 +117,8 @@ export default {
leftComLoading: false, //loading leftComLoading: false, //loading
runCommand: [], runCommand: [],
endCommand: [], endCommand: [],
leftCommand: [],
rightCommand: [],
commandShow: false, commandShow: false,
deveceMsg: "", deveceMsg: "",
cmdCn: { cmdCn: {
@ -100,6 +135,23 @@ export default {
}, },
cmdtimer: null, cmdtimer: null,
endtimer: 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: {}, computed: {},
@ -120,6 +172,8 @@ export default {
console.log(res); console.log(res);
this.runCommand = res.data; this.runCommand = res.data;
this.leftComLoading = false; this.leftComLoading = false;
this.selectLeftChanged(this.operateL);
this.updateTime = new Date();
}) })
.catch((err) => {}); .catch((err) => {});
}, },
@ -167,10 +221,134 @@ export default {
.then((res) => { .then((res) => {
console.log(res); console.log(res);
this.endCommand = res.data; this.endCommand = res.data;
this.selectRightChanged(this.operateR);
// this.leftComLoading = false; // this.leftComLoading = false;
this.updateTime = new Date().toLocaleString();
}) })
.catch((err) => {}); .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() { beforeDestroy() {
// //
@ -196,11 +374,22 @@ export default {
border: 1px solid #dcdfe6; border: 1px solid #dcdfe6;
margin-right: 12px; margin-right: 12px;
border-radius: 4px; border-radius: 4px;
h3 { .headTitle {
height: 40px;
line-height: 40px;
display: flex;
align-items: center;
.title {
font-size: 16px; font-size: 16px;
font-weight: normal; font-weight: normal;
height: 32px; }
line-height: 32px; .el-select {
margin: 0px 12px;
}
.time {
font-size: 12px;
margin-left: 8px;
}
} }
.commandList { .commandList {
width: 100%; width: 100%;

Loading…
Cancel
Save