jcbranch
fanluyan 1 year ago
parent c7fe72bf3b
commit 2146867f82

@ -1029,8 +1029,8 @@ export default {
yw_cmd_stop_frpc: "停止frpc", yw_cmd_stop_frpc: "停止frpc",
i1_cmd_stop_aging_test: "停止老化测试", i1_cmd_stop_aging_test: "停止老化测试",
del_file: "删除文件", del_file: "删除文件",
upload_file: "上传文件", pull_files: "拉取文件",
download_file: "下发文件", push_file: "推送文件",
}, },
taskdrawer: false, taskdrawer: false,
drawer: false, drawer: false,
@ -1938,7 +1938,7 @@ export default {
this.$refs.pullFileFormref.validate((valid) => { this.$refs.pullFileFormref.validate((valid) => {
if (valid) { if (valid) {
var params = { var params = {
action: "upload_file", action: "pull_files",
path: this.pullFileForm.pullFile, path: this.pullFileForm.pullFile,
termIds: this.idArray, termIds: this.idArray,
}; };
@ -1981,7 +1981,7 @@ export default {
this.$refs.pushFileFormref.validate((valid) => { this.$refs.pushFileFormref.validate((valid) => {
if (valid) { if (valid) {
var params = { var params = {
action: "download_file", action: "push_file",
path: this.pushFileForm.name, path: this.pushFileForm.name,
content: base64Data, content: base64Data,
termIds: this.idArray, termIds: this.idArray,

@ -285,26 +285,40 @@ export default {
: -1; : -1;
//this.fetchData(); // //this.fetchData(); //
//setInterval(this.fetchData, 60000); // 10 //setInterval(this.fetchData, 60000); // 10
this.formdata = let jsonSearch = JSON.parse(localStorage.getItem("searchParams"));
JSON.parse(localStorage.getItem("searchParams")) !== null if (jsonSearch !== null) {
? JSON.parse(localStorage.getItem("searchParams")) if (!jsonSearch.hasOwnProperty("isonline")) {
: { jsonSearch.isonline = -1;
dyId: -1, }
lineId: -1, if (!jsonSearch.hasOwnProperty("mntn")) {
towerId: -1, jsonSearch.mntn = -1;
isonline: -1, }
protocol: -1,
mntn: 1, this.formdata = jsonSearch;
activityId: -1, console.log(this.formdata);
oid: "", } else {
oidExclude: 0, this.formdata = jsonSearch;
cmdid: "", }
cmdidExclude: 0, // this.formdata =
cma: "", // JSON.parse(localStorage.getItem("searchParams")) !== null
cmaExclude: 0, // ? JSON.parse(localStorage.getItem("searchParams"))
version: "", // : {
versionExclude: 0, // dyId: -1,
}; // lineId: -1,
// towerId: -1,
// isonline: -1,
// protocol: -1,
// mntn: 1,
// activityId: -1,
// oid: "",
// oidExclude: 0,
// cmdid: "",
// cmdidExclude: 0,
// cma: "",
// cmaExclude: 0,
// version: "",
// versionExclude: 0,
// };
}, },
mounted() { mounted() {
this.getSearchdy(); this.getSearchdy();
@ -434,6 +448,7 @@ export default {
name: item.title, name: item.title,
})); }));
this.activityOptions = this.activityOptions.concat(activeArr); this.activityOptions = this.activityOptions.concat(activeArr);
//this.formdata.activityId = this.activityOptions[0].id; //this.formdata.activityId = this.activityOptions[0].id;
this.formdata.activityId = this.formdata.activityId =
JSON.parse(localStorage.getItem("activeId")) !== null JSON.parse(localStorage.getItem("activeId")) !== null
@ -444,6 +459,7 @@ export default {
.catch((err) => {}); .catch((err) => {});
}, },
changeActive(val) { changeActive(val) {
console.log(this.activityOptions);
console.log(val); console.log(val);
localStorage.setItem("activeId", JSON.stringify(val)); localStorage.setItem("activeId", JSON.stringify(val));
}, },

@ -37,44 +37,42 @@
></el-button> ></el-button>
</div> </div>
<div class="mlbpox" v-loading="leftComLoading"> <div class="mlbpox" v-loading="leftComLoading">
<div <div class="commandList" v-if="leftCommand.length != 0">
class="commandList" <p
class="comLi"
v-if="leftCommand.length != 0" v-for="(item, index) in leftCommand"
:key="index"
> @dblclick="handleShowCommand(item)"
<p >
class="comLi" <span class="indexClass">{{ index + 1 }}</span>
v-for="(item, index) in leftCommand" <span class="comMsg"
:key="index" ><b>时间{{ item.createTime }}</b>
@dblclick="handleShowCommand(item)" <b v-if="item.terminal && item.terminal.cmdid"
> >设备ID{{ item.terminal.cmdid }}</b
<span class="indexClass">{{ index + 1 }}</span> >
<span class="comMsg" <b v-if="item.cmdMap && item.cmdMap.fileName"
><b>时间{{ item.createTime }}</b> >apk版本{{ item.cmdMap.fileName }}</b
<b v-if="item.terminal && item.terminal.cmdid">ID{{ item.terminal.cmdid }}</b> >
<b v-if="item.cmdMap &&item.cmdMap.fileName">apk{{ item.cmdMap.fileName }}</b> <b>命令{{ cmdCn[item.name] }}</b>
<b>命令{{ cmdCn[item.name] }}</b
>
<b v-if="item.estimatedPublishTime * 1000 - newupdatatime > 0"
>命令预计拿走时间
{{ <b v-if="item.estimatedPublishTime * 1000 - newupdatatime > 0"
$moment(item.estimatedPublishTime * 1000).format( >命令预计拿走时间
"MM-DD HH:mm:ss"
) {{
}} $moment(item.estimatedPublishTime * 1000).format(
{{ remainingTime(item) }} "MM-DD HH:mm:ss"
</b> )
</span> }}
</p> {{ remainingTime(item) }}
</div> </b>
<div class="commandList" v-else> </span>
<p>暂无下发命令</p> </p>
</div>
<div class="commandList" v-else>
<p>暂无下发命令</p>
</div>
</div> </div>
</div> </div>
</div>
<div class="commandRunRight commandClass"> <div class="commandRunRight commandClass">
<div class="headTitle"> <div class="headTitle">
<span class="title">已下发终端</span> <span class="title">已下发终端</span>
@ -111,34 +109,38 @@
></el-button> ></el-button>
</div> </div>
<div class="mlbpox" v-loading="rightComLoading"> <div class="mlbpox" v-loading="rightComLoading">
<div class="commandList" v-if="rightCommand.length != 0" > <div class="commandList" v-if="rightCommand.length != 0">
<p class="comLi" v-for="(item, index) in rightCommand" :key="index"> <p class="comLi" v-for="(item, index) in rightCommand" :key="index">
<el-tooltip <el-tooltip
class="item" class="item"
effect="dark" effect="dark"
:open-delay="600" :open-delay="600"
:content="item.status == '1' ? '已下发' : '已取消'" :content="item.status == '1' ? '已下发' : '已取消'"
placement="top" placement="top"
>
<span
class="indexClass"
:class="item.status == '1' ? 'normalClass' : 'cancelClass'"
>{{ index + 1 }}</span
> >
</el-tooltip> <span
<span class="comMsg" class="indexClass"
><b>下发时间{{ item.publishTime }}</b> :class="item.status == '1' ? 'normalClass' : 'cancelClass'"
<b v-if="item.terminal && item.terminal.cmdid">ID{{ item.terminal.cmdid }}</b> >{{ index + 1 }}</span
<b>命令{{ cmdCn[item.name] }}</b> >
<b v-if="item.cmdMap &&item.cmdMap.fileName">apk{{ item.cmdMap.fileName }}</b> </el-tooltip>
<b v-else>cmd{{ item.cmdMap }}</b> <span class="comMsg"
</span> ><b>下发时间{{ item.publishTime }}</b>
</p> <b v-if="item.terminal && item.terminal.cmdid"
>设备ID{{ item.terminal.cmdid }}</b
>
<b>命令{{ cmdCn[item.name] }}</b>
<b v-if="item.cmdMap && item.cmdMap.fileName"
>apk版本{{ item.cmdMap.fileName }}</b
>
<b v-else>cmd{{ item.cmdMap }}</b>
</span>
</p>
</div>
<div class="commandList" v-else>
<p>暂无已下发命令</p>
</div>
</div> </div>
<div class="commandList" v-else>
<p>暂无已下发命令</p>
</div>
</div>
</div> </div>
</div> </div>
<el-dialog <el-dialog
@ -152,7 +154,7 @@
<!-- {{ deveceMsg }} --> <!-- {{ deveceMsg }} -->
<p>设备ID:{{ devCmdid }}</p> <p>设备ID:{{ devCmdid }}</p>
<p>操作时间{{ deveceMsg.createTime }}</p> <p>操作时间{{ deveceMsg.createTime }}</p>
<p>待执行操作{{cmdCn[deveceMsg.name]}} {{ deveceMsg.name }}</p> <p>待执行操作{{ cmdCn[deveceMsg.name] }} {{ deveceMsg.name }}</p>
<p>cmd{{ deveceMsg.cmd }}</p> <p>cmd{{ deveceMsg.cmd }}</p>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -162,21 +164,26 @@
</div> </div>
</template> </template>
<script> <script>
import { cmdSendApi,getCmdActionApi,cmdActlistApi,cmdActHislistApi } from "@/utils/api/index"; import {
cmdSendApi,
getCmdActionApi,
cmdActlistApi,
cmdActHislistApi,
} from "@/utils/api/index";
export default { export default {
name: "report", name: "report",
components: {}, components: {},
data() { data() {
return { return {
leftComLoading: false, //loading leftComLoading: false, //loading
rightComLoading:false,//loiading rightComLoading: false, //loiading
// runCommand: [], // runCommand: [],
// endCommand: [], // endCommand: [],
leftCommand: [], leftCommand: [],
rightCommand: [], rightCommand: [],
commandShow: false, commandShow: false,
deveceMsg: {}, deveceMsg: {},
devCmdid:'', devCmdid: "",
cmdCn: { cmdCn: {
yw_cmd_android_reboot: "重启设备", yw_cmd_android_reboot: "重启设备",
yw_cmd_mcu_reboot: "MCU单片机重启", yw_cmd_mcu_reboot: "MCU单片机重启",
@ -190,19 +197,17 @@ export default {
yw_cmd_stop_frpc: "停止frpc", yw_cmd_stop_frpc: "停止frpc",
i1_cmd_stop_aging_test: "停止老化测试", i1_cmd_stop_aging_test: "停止老化测试",
del_file: "删除文件", del_file: "删除文件",
upload_file: "上传文件", pull_files: "拉取文件",
download_file: "下发文件", push_file: "推送文件",
}, },
cmdtimer: null, cmdtimer: null,
endtimer: null, endtimer: null,
updateTime: null, updateTime: null,
newupdatatime: null, newupdatatime: null,
// //
operateOptions: [ operateOptions: [{ id: 0, key: "all", desc: "全部" }],
{id: 0, key: "all", desc: "全部"} operateL: "all",
], operateR: "all",
operateL: 'all',
operateR: 'all',
leftcmdVal: "", leftcmdVal: "",
rightcmdVal: "", rightcmdVal: "",
intervalId: null, // setIntervalID intervalId: null, // setIntervalID
@ -216,19 +221,19 @@ export default {
mounted() { mounted() {
this.getCmdList(); this.getCmdList();
this.getEndList(); this.getEndList();
this.getCmdOptionsFun() this.getCmdOptionsFun();
this.startCountdown(); // this.startCountdown(); //
}, },
methods: { methods: {
getCmdOptionsFun(){ getCmdOptionsFun() {
getCmdActionApi() getCmdActionApi()
.then((res) => { .then((res) => {
console.log(res); console.log(res);
this.operateOptions = this.operateOptions.concat(res.data); this.operateOptions = this.operateOptions.concat(res.data);
// this.operateL = this.operateOptions[0].desc; // this.operateL = this.operateOptions[0].desc;
}) })
.catch((err) => {}); .catch((err) => {});
}, },
startCountdown() { startCountdown() {
this.newupdatatime = new Date().getTime(); // this.newupdatatime = new Date().getTime(); //
@ -264,12 +269,12 @@ export default {
getCmdList() { getCmdList() {
this.leftComLoading = true; this.leftComLoading = true;
let params = { let params = {
pageNum:1, pageNum: 1,
pageSize:300, pageSize: 300,
}; };
console.log(this.operateL) console.log(this.operateL);
// //
if (this.operateL!=='all') { if (this.operateL !== "all") {
params.action = this.operateL; params.action = this.operateL;
} }
if (this.leftcmdVal !== "") { if (this.leftcmdVal !== "") {
@ -278,10 +283,10 @@ export default {
cmdActlistApi(params) cmdActlistApi(params)
.then((res) => { .then((res) => {
console.log(res); console.log(res);
//this.runCommand = res.data.list; //this.runCommand = res.data.list;
this.leftCommand = res.data.list; this.leftCommand = res.data.list;
this.leftComLoading = false; this.leftComLoading = false;
this.updateTime = new Date(); this.updateTime = new Date();
}) })
.catch((err) => {}); .catch((err) => {});
@ -291,30 +296,30 @@ export default {
this.commandShow = true; this.commandShow = true;
console.log(this.commandShow); console.log(this.commandShow);
this.deveceMsg = val; this.deveceMsg = val;
this.devCmdid = val.terminal.cmdid this.devCmdid = val.terminal.cmdid;
}, },
// //
getEndList() { getEndList() {
this.rightComLoading = true; this.rightComLoading = true;
let params = { let params = {
pageNum:1, pageNum: 1,
pageSize:300, pageSize: 300,
}; };
// //
if (this.operateR!== 'all') { if (this.operateR !== "all") {
params.action = this.operateR; params.action = this.operateR;
} }
if (this.rightcmdVal!== "") { if (this.rightcmdVal !== "") {
params.cmdid = this.rightcmdVal; params.cmdid = this.rightcmdVal;
} }
cmdActHislistApi(params) cmdActHislistApi(params)
.then((res) => { .then((res) => {
console.log(res); console.log(res);
//this.endCommand = res.data; //this.endCommand = res.data;
//this.endCommand = res.data.list //this.endCommand = res.data.list
this.rightCommand = res.data.list; this.rightCommand = res.data.list;
this.rightComLoading = false; this.rightComLoading = false;
this.updateTime = new Date(); this.updateTime = new Date();
}) })
@ -322,23 +327,23 @@ export default {
}, },
// //
selectLeftChanged() { selectLeftChanged() {
this.getCmdList() this.getCmdList();
}, },
leftInputChange() { leftInputChange() {
console.log(this.leftcmdVal); console.log(this.leftcmdVal);
this.getCmdList() this.getCmdList();
}, },
// //
selectRightChanged() { selectRightChanged() {
this.getEndList() this.getEndList();
}, },
rightInputChange() { rightInputChange() {
this.getEndList() this.getEndList();
}, },
// //
handleCancel(val) { handleCancel(val) {
console.log(val) console.log(val);
cmdSendApi({ cmdSendApi({
action: "cancel", action: "cancel",
id: val, id: val,
@ -482,7 +487,7 @@ export default {
padding: 4px; padding: 4px;
} }
} }
.mlbpox{ .mlbpox {
height: calc(100% - 40px); height: calc(100% - 40px);
} }
.commandList { .commandList {

Loading…
Cancel
Save