|
|
|
@ -3,27 +3,53 @@
|
|
|
|
|
<div class="commandBox">
|
|
|
|
|
<div class="commandRunLeft commandClass">
|
|
|
|
|
<h3>待下发终端</h3>
|
|
|
|
|
<div class="commandList" v-loading="leftComLoading">
|
|
|
|
|
<div
|
|
|
|
|
class="commandList"
|
|
|
|
|
v-loading="leftComLoading"
|
|
|
|
|
v-if="runCommand.length != 0"
|
|
|
|
|
>
|
|
|
|
|
<p
|
|
|
|
|
class="comLi"
|
|
|
|
|
v-for="(item, index) in runCommand"
|
|
|
|
|
:key="index"
|
|
|
|
|
@click="handleShowCommand(item)"
|
|
|
|
|
@dblclick="handleShowCommand(item)"
|
|
|
|
|
>
|
|
|
|
|
<span class="indexClass">{{ index + 1 }}</span>
|
|
|
|
|
<span class="comMsg"
|
|
|
|
|
><b>时间:{{ item.createTime }}</b>
|
|
|
|
|
<b>设备ID:{{ item.cmdid }}</b>
|
|
|
|
|
<b>命令:{{ item.cmdName }}</b></span
|
|
|
|
|
<b>命令:{{ cmdCn[item.cmdName] }}</b></span
|
|
|
|
|
>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="commandList">
|
|
|
|
|
<p>暂无下发命令</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="commandRunRight commandClass">
|
|
|
|
|
<h3>已下发终端</h3>
|
|
|
|
|
<div class="commandList">
|
|
|
|
|
<p class="comLi" v-for="(item, index) in endCommand" :key="index">
|
|
|
|
|
{{ item }}
|
|
|
|
|
<el-tooltip
|
|
|
|
|
class="item"
|
|
|
|
|
effect="dark"
|
|
|
|
|
:open-delay="600"
|
|
|
|
|
:content="item.status == '1' ? '已下发' : '已取消'"
|
|
|
|
|
placement="top"
|
|
|
|
|
>
|
|
|
|
|
<span
|
|
|
|
|
class="indexClass"
|
|
|
|
|
:class="item.status == '1' ? 'normalClass' : 'cancelClass'"
|
|
|
|
|
>{{ index + 1 }}</span
|
|
|
|
|
>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
|
|
|
|
<span class="comMsg"
|
|
|
|
|
><b>下发时间:{{ item.publishTime }}</b>
|
|
|
|
|
<b>设备ID:{{ item.cmdid }}</b>
|
|
|
|
|
<b>命令:{{ cmdCn[item.cmdName] }}</b>
|
|
|
|
|
<b>cmd:{{ item.cmd }}</b></span
|
|
|
|
|
>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -40,6 +66,7 @@
|
|
|
|
|
<p>设备ID:{{ deveceMsg.cmdid }}</p>
|
|
|
|
|
<p>操作时间:{{ deveceMsg.createTime }}</p>
|
|
|
|
|
<p>待执行操作:{{ deveceMsg.cmdName }}</p>
|
|
|
|
|
<p>cmd:{{ deveceMsg.cmd }}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="handleCancel(deveceMsg.id)">取消操作</el-button>
|
|
|
|
@ -56,36 +83,38 @@ export default {
|
|
|
|
|
return {
|
|
|
|
|
leftComLoading: false, //左侧loading
|
|
|
|
|
runCommand: [],
|
|
|
|
|
endCommand: [
|
|
|
|
|
{
|
|
|
|
|
name: "我是已完成的列表",
|
|
|
|
|
id: 1,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "我是已完成的列表",
|
|
|
|
|
id: 2,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "我是已完成的列表",
|
|
|
|
|
id: 3,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "我是已完成的列表",
|
|
|
|
|
id: 4,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
endCommand: [],
|
|
|
|
|
commandShow: false,
|
|
|
|
|
deveceMsg: "",
|
|
|
|
|
cmdCn: {
|
|
|
|
|
yw_cmd_android_reboot: "重启",
|
|
|
|
|
yw_cmd_mcu_reboot: "重启装置",
|
|
|
|
|
i1_cmd_set_i1_server_ip_port: "设置I1服务器",
|
|
|
|
|
i1_cmd_set_xy_yw_ip_port: "设置运维服务器",
|
|
|
|
|
i1_cmd_set_i1_heart_beat_time: "设置心跳周期",
|
|
|
|
|
yw_cmd_upload_i1_zip_log: "上传日志",
|
|
|
|
|
upgrade: "升级",
|
|
|
|
|
yw_cmd_start_frpc: "开启frpc",
|
|
|
|
|
yw_cmd_stop_frpc: "停止frpc",
|
|
|
|
|
i1_cmd_stop_aging_test: "停止老化测试",
|
|
|
|
|
},
|
|
|
|
|
cmdtimer: null,
|
|
|
|
|
endtimer: null,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {},
|
|
|
|
|
created() {
|
|
|
|
|
this.cmdtimer = setInterval(this.getCmdList, 60000); // 每10秒刷新数据
|
|
|
|
|
this.endtimer = setInterval(this.getEndList, 60000); // 每10秒刷新数据
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
// setInterval(this.getCmdList(), 1000); // 每10秒刷新数据
|
|
|
|
|
this.getCmdList();
|
|
|
|
|
this.getEndList();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
getCmdList() {
|
|
|
|
|
this.leftComLoading = true;
|
|
|
|
|
//this.leftComLoading = true;
|
|
|
|
|
getqueryCmdsApi({ p: 1, ps: 200 })
|
|
|
|
|
.then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
@ -103,18 +132,53 @@ export default {
|
|
|
|
|
//取消操作
|
|
|
|
|
handleCancel(val) {
|
|
|
|
|
getdoActionApi({
|
|
|
|
|
action: "cancel",
|
|
|
|
|
act: "cancel",
|
|
|
|
|
id: val,
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
this.commandShow = false;
|
|
|
|
|
this.getCmdList();
|
|
|
|
|
|
|
|
|
|
this.$confirm("确定取消该命令?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
this.$message({
|
|
|
|
|
duration: 1500,
|
|
|
|
|
showClose: true,
|
|
|
|
|
message: "命令已取消",
|
|
|
|
|
type: "success",
|
|
|
|
|
});
|
|
|
|
|
this.commandShow = false;
|
|
|
|
|
this.getCmdList();
|
|
|
|
|
this.getEndList();
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.commandShow = false;
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//获取已取走列表
|
|
|
|
|
getEndList() {
|
|
|
|
|
getqueryCmdsApi({ qt: "his", p: 1, ps: 200 })
|
|
|
|
|
.then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
this.endCommand = res.data;
|
|
|
|
|
// this.leftComLoading = false;
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {},
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
//清除定时器
|
|
|
|
|
clearInterval(this.cmdtimer);
|
|
|
|
|
clearInterval(this.endtimer);
|
|
|
|
|
this.cmdtimer = null;
|
|
|
|
|
this.endtimer = null;
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less">
|
|
|
|
@ -126,7 +190,7 @@ export default {
|
|
|
|
|
display: flex;
|
|
|
|
|
height: 100%;
|
|
|
|
|
.commandClass {
|
|
|
|
|
width: 40%;
|
|
|
|
|
width: 50%;
|
|
|
|
|
padding: 12px;
|
|
|
|
|
height: calc(100% - 24px);
|
|
|
|
|
border: 1px solid #dcdfe6;
|
|
|
|
@ -165,6 +229,12 @@ export default {
|
|
|
|
|
text-align: center;
|
|
|
|
|
margin-right: 8px;
|
|
|
|
|
}
|
|
|
|
|
.normalClass {
|
|
|
|
|
background: #d3d3d3;
|
|
|
|
|
}
|
|
|
|
|
.cancelClass {
|
|
|
|
|
background: #fde2e2;
|
|
|
|
|
}
|
|
|
|
|
.comMsg {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
@ -181,9 +251,10 @@ export default {
|
|
|
|
|
.commandRunRight {
|
|
|
|
|
.commandList {
|
|
|
|
|
p {
|
|
|
|
|
background: rgb(225, 243, 216);
|
|
|
|
|
cursor: default;
|
|
|
|
|
background: #e1f3d8;
|
|
|
|
|
&:hover {
|
|
|
|
|
background: rgb(225, 243, 216);
|
|
|
|
|
background: #e1f3d8;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|