添加预估时间

master
fanluyan 1 year ago
parent f05a8d7f49
commit a2750e71a4

@ -33,10 +33,10 @@ export default {
path: "/activity",
name: "活动列表",
},
{
path: "/userlist",
name: "用户列表",
},
// {
// path: "/userlist",
// name: "",
// },
],
};
},

@ -392,11 +392,14 @@
</el-table-column>
<el-table-column label="I1版本" v-if="i1check" min-width="160" key="I1">
<template slot-scope="scope">
{{
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
scope.row.raw_report.i1Version
}}</span>
<span v-else>{{
scope.row.raw_report.msgs.hasOwnProperty("i1Version")
? scope.row.raw_report.msgs.i1Version
: ""
}}
}}</span>
</template>
</el-table-column>
<el-table-column
@ -406,11 +409,16 @@
key="ywbb"
>
<template slot-scope="scope">
{{
scope.row.raw_report.msgs.hasOwnProperty("maintainVersion")
? scope.row.raw_report.msgs.maintainVersion
: ""
}}
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
scope.row.raw_report.maintainVersion
}}</span>
<span v-else>
{{
scope.row.raw_report.msgs.hasOwnProperty("maintainVersion")
? scope.row.raw_report.msgs.maintainVersion
: ""
}}</span
>
</template>
</el-table-column>
<el-table-column

@ -65,7 +65,11 @@
</el-select>
</el-form-item>
<el-form-item label="活动" class="activitybox">
<el-select v-model="formdata.activityId" filterable>
<el-select
v-model="formdata.activityId"
filterable
@change="changeActive"
>
<el-option
v-for="item in activityOptions"
:key="item.id"
@ -248,6 +252,7 @@ export default {
offlineNum: 0, //线
noPicNum: 0, //
intervalId: null, // ID
activityIdLoc: "",
};
},
created() {
@ -258,13 +263,17 @@ export default {
that.onSubmit(); //
}
};
this.activityIdLoc =
JSON.parse(localStorage.getItem("activeId")) !== null
? JSON.parse(localStorage.getItem("activeId"))
: -1;
//this.fetchData(); //
//setInterval(this.fetchData, 60000); // 10
},
mounted() {
this.getActivityList();
this.getLineList();
this.getprotocolList();
this.getActivityList();
},
watch: {},
methods: {
@ -314,11 +323,19 @@ export default {
name: item.title,
}));
this.activityOptions = this.activityOptions.concat(activeArr);
this.formdata.activityId = this.activityOptions[0].id;
//this.formdata.activityId = this.activityOptions[0].id;
this.formdata.activityId =
JSON.parse(localStorage.getItem("activeId")) !== null
? JSON.parse(localStorage.getItem("activeId"))
: this.activityOptions[0].id;
this.onSubmit();
})
.catch((err) => {});
},
changeActive(val) {
console.log(val);
localStorage.setItem("activeId", JSON.stringify(val));
},
onSubmit() {
this.tableLoaidng = true;
this.dataList = [];

@ -52,8 +52,19 @@
><b>时间{{ item.createTime }}</b>
<b>设备ID{{ item.cmdid }}</b>
<b v-if="item.cmd.fileName">apk{{ item.cmd.fileName }}</b>
<b>命令{{ cmdCn[item.cmdName] }}</b></span
>
<b v-if="item.cmdDesc == ''">{{ cmdCn[item.cmdName] }}</b
><b v-else>{{ item.cmdDesc }}</b>
<b v-if="item.estimatedPublishTime * 1000 - newupdatatime > 0"
>命令预计拿走时间
{{
$moment(item.estimatedPublishTime * 1000).format(
"MM-DD HH:mm:ss"
)
}}
{{ remainingTime(item) }}
</b>
</span>
</p>
</div>
<div class="commandList" v-else>
@ -174,6 +185,7 @@ export default {
cmdtimer: null,
endtimer: null,
updateTime: null,
newupdatatime: null,
//
operateOptions: [
{ id: 0, name: "全部" },
@ -192,19 +204,52 @@ export default {
operateR: 0,
leftcmdVal: "",
rightcmdVal: "",
intervalId: null, // setIntervalID
};
},
computed: {},
created() {
this.cmdtimer = setInterval(this.getCmdList, 60000); // 10
this.endtimer = setInterval(this.getEndList, 60000); // 10
this.cmdtimer = setInterval(this.getCmdList, 60000); // 60
this.endtimer = setInterval(this.getEndList, 60000); // 60
},
mounted() {
this.getCmdList();
this.getEndList();
this.startCountdown(); //
},
methods: {
startCountdown() {
//
if (this.intervalId) {
clearInterval(this.intervalId);
}
// remainingTime
this.intervalId = setInterval(() => {
this.newupdatatime = new Date().getTime(); //
this.leftCommand.forEach((item) => {
this.remainingTime(item); //
});
}, 1000); //
},
remainingTime(item) {
if (!this.newupdatatime) {
//
return "计算中...";
}
const estimatedPublishTime = item.estimatedPublishTime * 1000;
const difference = estimatedPublishTime - this.newupdatatime;
const minutes = Math.floor(difference / 60000);
const seconds = Math.floor((difference % 60000) / 1000);
if (minutes == 0 && seconds == 0) {
this.getCmdList();
this.getEndList();
return `命令已下发`;
} else {
return ` 预估剩余:${minutes} 分钟 ${seconds}`;
}
},
getCmdList() {
//this.leftComLoading = true;
getqueryCmdsApi({ p: 1, ps: 10000 })
@ -461,6 +506,9 @@ export default {
clearInterval(this.endtimer);
this.cmdtimer = null;
this.endtimer = null;
if (this.intervalId) {
clearInterval(this.intervalId);
}
},
};
</script>

Loading…
Cancel
Save