优化表格

master
fanluyan 1 year ago
parent c28765f488
commit 5c3ca9d13e

47
package-lock.json generated

@ -7949,6 +7949,11 @@
"websocket-driver": "^0.7.4"
}
},
"sortablejs": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.10.2.tgz",
"integrity": "sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A=="
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz",
@ -8400,6 +8405,35 @@
"mime-types": "~2.1.24"
}
},
"umy-table": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/umy-table/-/umy-table-1.1.8.tgz",
"integrity": "sha512-yqPMFwZ6MUNqI73KamsNKBTbHRA7VuVZDEWobaySghtf4n/s7INuTNQoADB/ROVK57WOXr99Xpnol0aMqGlASA==",
"requires": {
"async-validator": "~1.8.1",
"deepmerge": "^1.2.0",
"normalize-wheel": "^1.0.1",
"resize-observer-polyfill": "^1.5.0",
"throttle-debounce": "^1.0.1",
"vuedraggable": "^2.23.2",
"xe-utils": "^3.0.0-beta.12"
}
},
"umy-ui": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/umy-ui/-/umy-ui-1.1.6.tgz",
"integrity": "sha512-wX0S29B5sFn8q0MvU9PEl8DGZeQmZXOJlLrwaCJ2UHiIQZCANWgXMBjjQgpaequ1gRZ8BekEu7Sn7hJccm9YMQ==",
"requires": {
"async-validator": "~1.8.1",
"deepmerge": "^1.2.0",
"normalize-wheel": "^1.0.1",
"resize-observer-polyfill": "^1.5.0",
"throttle-debounce": "^1.0.1",
"umy-table": "1.1.8",
"vuedraggable": "^2.23.2",
"xe-utils": "^3.0.0-beta.12"
}
},
"undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-5.26.5.tgz",
@ -8726,6 +8760,14 @@
"integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==",
"dev": true
},
"vuedraggable": {
"version": "2.24.3",
"resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-2.24.3.tgz",
"integrity": "sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g==",
"requires": {
"sortablejs": "1.10.2"
}
},
"vuex": {
"version": "3.6.2",
"resolved": "https://registry.npmmirror.com/vuex/-/vuex-3.6.2.tgz",
@ -9123,6 +9165,11 @@
"integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==",
"dev": true
},
"xe-utils": {
"version": "3.5.24",
"resolved": "https://registry.npmjs.org/xe-utils/-/xe-utils-3.5.24.tgz",
"integrity": "sha512-22TRz/qaRNcPTQi2SHNU19FqHogctQvVkFu09/smPdbkwOXNS9tUZ4EwA2bJ7HFkdWtnELrxFpCt58LS2HCojA=="
},
"xlsx": {
"version": "0.17.5",
"resolved": "https://registry.npmmirror.com/xlsx/-/xlsx-0.17.5.tgz",

@ -17,6 +17,7 @@
"postcss-px2rem": "^0.3.0",
"px2rem-loader": "^0.1.9",
"three": "^0.158.0",
"umy-ui": "^1.1.6",
"vue": "^2.6.14",
"vue-router": "^3.5.1",
"vuex": "^3.6.2",

@ -3,6 +3,7 @@ import App from "./App.vue";
import router from "./router";
import store from "./store";
import ElementUI from "element-ui";
import "umy-ui/lib/theme-chalk/index.css"; // 引入样式
// import "element-ui/lib/theme-chalk/index.css";
import "../src/assets/css/theme/index.css"; //cac主题
@ -26,6 +27,11 @@ import { message } from "@/utils/resetMessage";
Vue.prototype.$message = message;
Vue.config.productionTip = false;
//虚拟列表
import { UTable, UTableColumn } from "umy-ui";
Vue.component(UTable.name, UTable);
Vue.component(UTableColumn.name, UTableColumn);
//使用钩子函数对路由进行权限跳转
router.beforeEach((to, from, next) => {

@ -59,33 +59,34 @@
</el-tooltip>
</div>
</div>
<el-table
<u-table
v-loading="tableLoaidng"
class="ywTableBox"
id="ywTable"
ref="ywMultipleTable"
:data="tableData"
border
stripe
:row-style="isRed"
:row-key="getRowKey"
style="width: 100%"
@selection-change="handleSelectionChange"
height="calc(100% - 40px)"
:default-sort="{ order: 'descending' }"
:row-class-name="tableRowSetting"
use-virtual
:height="tableHeight"
:row-height="32"
>
<el-table-column
<u-table-column
type="selection"
:reserve-selection="true"
width="50"
fixed
>
</el-table-column>
<el-table-column type="index" width="50" label="序号" fixed>
</el-table-column>
<!-- <el-table-column prop="id" label="ID" width="60" sortable>
</el-table-column> -->
<el-table-column prop="oid" label="出厂ID" width="180" sortable fixed>
</u-table-column>
<u-table-column type="index" width="50" label="序号" fixed>
</u-table-column>
<!-- <u-table-column prop="id" label="ID" width="60" sortable>
</u-table-column> -->
<u-table-column prop="oid" label="出厂ID" width="180" sortable fixed>
<template slot-scope="scope">
<span
class="redMlxf"
@ -116,10 +117,10 @@
}}
</span>
</template>
</el-table-column>
<el-table-column prop="cmdid" label="装置编号" width="150" sortable fixed>
</el-table-column>
<el-table-column label="状态" width="72" fixed>
</u-table-column>
<u-table-column prop="cmdid" label="装置编号" width="150" sortable fixed>
</u-table-column>
<u-table-column label="状态" width="72" fixed>
<template slot-scope="scope">
<el-tag
type="success"
@ -128,8 +129,8 @@
>
<el-tag type="danger" v-else>线</el-tag>
</template>
</el-table-column>
<el-table-column
</u-table-column>
<u-table-column
label="运维"
prop="in_maintain"
width="100"
@ -162,14 +163,8 @@
@change="(val) => UpdateMaintainMode(val, scope.row)"
></el-checkbox>
</template>
</el-table-column>
<el-table-column
label="快心跳"
prop="quick_hb"
width="108"
sortable
fixed
>
</u-table-column>
<u-table-column label="快心跳" prop="quick_hb" width="108" sortable fixed>
<template slot="header" slot-scope="scope">
<p :class="kxtNumber != 0 ? 'redClass' : 'noClass'">
{{ kxtNumber }}<span> / {{ tableData.length }}</span>
@ -196,8 +191,8 @@
@change="(val) => UpdateQuickHbMode(val, scope.row)"
></el-checkbox>
</template>
</el-table-column>
<el-table-column
</u-table-column>
<u-table-column
prop="last_heartbeat"
label="最后心跳"
width="142"
@ -209,8 +204,8 @@
scope.row.last_heartbeat
}}</span>
</template>
</el-table-column>
<el-table-column
</u-table-column>
<u-table-column
label="传图"
prop="raw_report.pic"
width="80"
@ -220,12 +215,12 @@
<template slot-scope="scope">
{{ scope.row.raw_report.pic }}
</template>
</el-table-column>
</u-table-column>
<el-table-column
<u-table-column
prop="protocol"
label="规约"
width="80"
width="120"
v-if="gycheck"
sortable
key="gy"
@ -233,8 +228,8 @@
<template slot-scope="scope">
{{ protocolMap[scope.row.protocol] }}
</template>
</el-table-column>
<el-table-column label="电池状态" width="118" key="dc" v-if="dccheck">
</u-table-column>
<u-table-column label="电池状态" width="138" key="dc" v-if="dccheck">
<template slot-scope="scope">
{{
scope.row.raw_report.hasOwnProperty("msgs")
@ -242,10 +237,10 @@
: ""
}}
</template>
</el-table-column>
</u-table-column>
<el-table-column label="心跳信息" v-if="xtcheck" key="xt">
<el-table-column
<u-table-column label="心跳信息" v-if="xtcheck" key="xt">
<u-table-column
label="次数"
min-width="68"
sortable
@ -258,8 +253,8 @@
: ""
}}
</template>
</el-table-column>
<el-table-column label="周期" min-width="48">
</u-table-column>
<u-table-column label="周期" min-width="48">
<template slot-scope="scope">
{{
scope.row.raw_report.hasOwnProperty("msgs")
@ -267,8 +262,8 @@
: ""
}}
</template>
</el-table-column>
<el-table-column label="CMA消息" min-width="60">
</u-table-column>
<u-table-column label="CMA消息" min-width="60">
<template slot-scope="scope">
{{
scope.row.raw_report.hasOwnProperty("msgs")
@ -276,11 +271,11 @@
: ""
}}
</template>
</el-table-column>
</el-table-column>
</u-table-column>
</u-table-column>
<el-table-column label="拍照" v-if="pzcheck" key="pz">
<el-table-column label="计划/实际" min-width="60">
<u-table-column label="拍照" v-if="pzcheck" key="pz">
<u-table-column label="计划/实际" min-width="60">
<template slot-scope="scope">
{{
scope.row.raw_report.hasOwnProperty("msgs")
@ -288,8 +283,8 @@
: ""
}}
</template>
</el-table-column>
<el-table-column
</u-table-column>
<u-table-column
label="成功"
min-width="70"
sortable
@ -302,8 +297,8 @@
: ""
}}
</template>
</el-table-column>
<el-table-column
</u-table-column>
<u-table-column
label="失败"
min-width="70"
sortable
@ -316,11 +311,11 @@
: ""
}}
</template>
</el-table-column>
</el-table-column>
</u-table-column>
</u-table-column>
<el-table-column label="网络信号" v-if="wlcheck" key="wl">
<el-table-column label="卡1" min-width="60" prop="signature1">
<u-table-column label="网络信号" v-if="wlcheck" key="wl">
<u-table-column label="卡1" min-width="60" prop="signature1">
<template slot-scope="scope">
<el-tooltip
class="item"
@ -335,8 +330,8 @@
}}</span>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="卡2" min-width="60" prop="signature2">
</u-table-column>
<u-table-column label="卡2" min-width="60" prop="signature2">
<template slot-scope="scope">
<el-tooltip
class="item"
@ -356,10 +351,10 @@
: ""
}} -->
</template>
</el-table-column>
<el-table-column
</u-table-column>
<u-table-column
label="错误"
min-width="48"
min-width="58"
prop="networkError"
sortable
:sort-method="sortNumbersErr"
@ -371,13 +366,13 @@
: ""
}}
</template>
</el-table-column>
</el-table-column>
</u-table-column>
</u-table-column>
<el-table-column label="重启次数" v-if="cqcheck" key="cq">
<el-table-column
<u-table-column label="重启次数" v-if="cqcheck" key="cq">
<u-table-column
label="系统"
min-width="48"
min-width="58"
prop="rebootTimes"
sortable
:sort-method="sortNumbers"
@ -389,8 +384,8 @@
: ""
}}
</template>
</el-table-column>
<el-table-column
</u-table-column>
<u-table-column
label="I1"
min-width="48"
prop="i1RebootTimes"
@ -404,10 +399,10 @@
: ""
}}
</template>
</el-table-column>
</el-table-column>
<el-table-column label="SIM卡" v-if="simcheck" min-width="160" key="sim">
<el-table-column label="卡1" width="148" prop="simcard1">
</u-table-column>
</u-table-column>
<u-table-column label="SIM卡" v-if="simcheck" min-width="160" key="sim">
<u-table-column label="卡1" width="158" prop="simcard1">
<template slot-scope="scope">
{{
scope.row.raw_report.msgs.hasOwnProperty("simcard1")
@ -415,8 +410,8 @@
: ""
}}
</template>
</el-table-column>
<el-table-column label="卡2" width="148" prop="simcard2">
</u-table-column>
<u-table-column label="卡2" width="158" prop="simcard2">
<template slot-scope="scope">
{{
scope.row.raw_report.msgs.hasOwnProperty("simcard2")
@ -424,12 +419,12 @@
: ""
}}
</template>
</el-table-column>
</el-table-column>
<el-table-column
</u-table-column>
</u-table-column>
<u-table-column
label="磁盘剩余空间"
v-if="freecheck"
min-width="100"
min-width="120"
key="free"
sortable
:sort-method="sortfreeNumbers"
@ -441,8 +436,8 @@
: ""
}}</span>
</template>
</el-table-column>
<el-table-column label="CMA服务器" v-if="cmacheck" width="160" key="cma">
</u-table-column>
<u-table-column label="CMA服务器" v-if="cmacheck" width="160" key="cma">
<template slot-scope="scope">
{{
scope.row.raw_report.hasOwnProperty("msgs")
@ -450,8 +445,8 @@
: ""
}}
</template>
</el-table-column>
<el-table-column label="I1版本" v-if="i1check" min-width="160" key="I1">
</u-table-column>
<u-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
@ -462,11 +457,11 @@
: ""
}}</span>
</template>
</el-table-column>
<el-table-column
</u-table-column>
<u-table-column
label="运维版本"
v-if="ywbbcheck"
min-width="160"
min-width="260"
key="ywbb"
>
<template slot-scope="scope">
@ -481,8 +476,8 @@
}}</span
>
</template>
</el-table-column>
<el-table-column
</u-table-column>
<u-table-column
label="Camera版本"
v-if="Cameracheck"
width="100"
@ -495,8 +490,8 @@
: ""
}}
</template>
</el-table-column>
<el-table-column label="AI版本" v-if="AIcheck" width="80" key="AI">
</u-table-column>
<u-table-column label="AI版本" v-if="AIcheck" width="80" key="AI">
<template slot-scope="scope">
{{
scope.row.raw_report.msgs.hasOwnProperty("aiVersion")
@ -504,13 +499,8 @@
: ""
}}
</template>
</el-table-column>
<el-table-column
label="MCU版本"
v-if="MCUcheck"
min-width="180"
key="MCU"
>
</u-table-column>
<u-table-column label="MCU版本" v-if="MCUcheck" min-width="180" key="MCU">
<template slot-scope="scope">
{{
scope.row.raw_report.msgs.hasOwnProperty("mcu")
@ -518,8 +508,8 @@
: ""
}}
</template>
</el-table-column>
</el-table>
</u-table-column>
</u-table>
<el-drawer
class="drawerBox"
:visible.sync="drawer"
@ -802,6 +792,9 @@ export default {
}
};
return {
tableHeight: 0,
screenHeight: 0,
showFlag: true,
newupdatatime: null,
cmdCn: {
yw_cmd_android_reboot: "重启设备",
@ -1004,13 +997,14 @@ export default {
},
mounted() {
this.loadLocalStorage();
this.calculateHeight(this.showFlag);
window.addEventListener("resize", this.calculateHeight(this.showFlag));
},
watch: {
tableData: {
handler(newVal) {
//
console.log("数据已更新:", newVal);
this.getNumber();
this.startCountdown();
},
@ -1019,11 +1013,24 @@ export default {
},
created() {},
methods: {
calculateHeight(val) {
console.log(val);
this.showFlag = val;
this.screenHeight = window.innerHeight; //
if (val) {
this.tableHeight = this.screenHeight - 240; // 270px
} else {
this.tableHeight = this.screenHeight - 160; // 190px
}
//
console.log(this.tableHeight);
},
tableRowSetting({ row }) {
console.log(row);
if (row.raw_report.msgs.hasOwnProperty("freeROM")) {
console.log(row.raw_report.msgs.freeROM);
console.log(parseInt(row.raw_report.msgs.freeROM));
// console.log(row.raw_report.msgs.freeROM);
// console.log(parseInt(row.raw_report.msgs.freeROM));
if (parseInt(row.raw_report.msgs.freeROM) < 40) {
return "has-color";
}
@ -1135,7 +1142,15 @@ export default {
this.idArray.push(this.multipleSelection[i].id);
}
this.idArray = [...new Set(this.idArray)];
console.log(this.idArray);
console.log("1", this.idArray);
},
isRed({ row }) {
const checkIdList = this.multipleSelection.map((item) => item.id);
if (checkIdList.includes(row.id)) {
return {
background: "#d0ece8!important",
};
}
},
//
handleMsgClick(val) {
@ -1610,6 +1625,9 @@ export default {
}
},
},
beforeDestroy() {
window.removeEventListener("resize", this.calculateHeight);
},
};
</script>
<style lang="less">
@ -1649,6 +1667,44 @@ export default {
}
}
}
.plTableBox {
.el-table {
thead {
color: #333;
th {
background: #d3d3d3;
}
}
td {
text-align: center;
}
th {
padding: 0px;
}
th > .cell {
text-align: center;
}
.cell {
padding-left: 4px;
padding-right: 4px;
}
}
.hbClass {
.cell {
cursor: pointer;
&:hover {
color: #169e8c;
text-decoration: underline;
}
}
}
.has-color {
background: #f5dab1;
}
.has-color td.el-table__cell {
background: #f5dab1 !important;
}
}
.ywTableBox {
color: #333;
@ -1673,21 +1729,6 @@ export default {
}
}
}
.hbClass {
.cell {
cursor: pointer;
&:hover {
color: #169e8c;
text-decoration: underline;
}
}
}
.has-color {
background: #f5dab1;
}
.has-color td.el-table__cell {
background: #f5dab1 !important;
}
.el-table--scrollable-y .el-table__body-wrapper {
height: calc(100% - 40px) !important;

@ -40,6 +40,9 @@
<span
>未上传图片<el-tag type="danger">{{ noPicNum }}</el-tag></span
>
<span
>磁盘异常数量<el-tag type="danger">{{ freeNum }}</el-tag></span
>
<span
>装置总数<el-tag type="info">{{ tableData.length }}</el-tag></span
>
@ -69,24 +72,54 @@
@selection-change="handleSelectionChange"
height="calc(100% - 40px)"
:default-sort="{ order: 'descending' }"
:row-class-name="tableRowSetting"
>
<el-table-column type="selection" :reserve-selection="true" width="50">
<el-table-column
type="selection"
:reserve-selection="true"
width="50"
fixed
>
</el-table-column>
<el-table-column type="index" width="50" label="序号" fixed>
</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 prop="oid" label="出厂ID" width="150" sortable>
<el-table-column prop="oid" label="出厂ID" width="180" sortable fixed>
<template slot-scope="scope">
<span
class="redMlxf"
v-if="
scope.row.list &&
scope.row.list[0].estimatedPublishTime * 1000 - newupdatatime > 0
"
>
<b v-if="scope.row.list[0].cmdDesc == ''">{{
cmdCn[scope.row.list[0].cmdName]
}}</b
><b v-else>{{ scope.row.list[0].cmdDesc }}</b>
<b
v-if="
scope.row.list[0].estimatedPublishTime * 1000 - newupdatatime >
0
"
>
{{ remainingTime(scope.row.list[0]) }}
</b>
</span>
<span v-else>
{{
scope.row.raw_report.hasOwnProperty("oid")
? scope.row.raw_report.oid
: ""
}}
</span>
</template>
</el-table-column>
<el-table-column prop="cmdid" label="装置编号" width="150" sortable>
<el-table-column prop="cmdid" label="装置编号" width="150" sortable fixed>
</el-table-column>
<el-table-column label="状态" width="72">
<el-table-column label="状态" width="72" fixed>
<template slot-scope="scope">
<el-tag
type="success"
@ -96,7 +129,13 @@
<el-tag type="danger" v-else>线</el-tag>
</template>
</el-table-column>
<el-table-column label="运维" prop="in_maintain" width="100" sortable>
<el-table-column
label="运维"
prop="in_maintain"
width="100"
sortable
fixed
>
<template slot="header" slot-scope="scope">
<p :class="ywNumber != 0 ? 'redClass' : 'noClass'">
{{ ywNumber }}<span> / {{ tableData.length }}</span>
@ -124,7 +163,13 @@
></el-checkbox>
</template>
</el-table-column>
<el-table-column label="快心跳" prop="quick_hb" width="108" sortable>
<el-table-column
label="快心跳"
prop="quick_hb"
width="108"
sortable
fixed
>
<template slot="header" slot-scope="scope">
<p :class="kxtNumber != 0 ? 'redClass' : 'noClass'">
{{ kxtNumber }}<span> / {{ tableData.length }}</span>
@ -362,7 +407,7 @@
</el-table-column>
</el-table-column>
<el-table-column label="SIM卡" v-if="simcheck" min-width="160" key="sim">
<el-table-column label="卡1" width="148" prop="simcard1">
<el-table-column label="卡1" width="158" prop="simcard1">
<template slot-scope="scope">
{{
scope.row.raw_report.msgs.hasOwnProperty("simcard1")
@ -371,7 +416,7 @@
}}
</template>
</el-table-column>
<el-table-column label="卡2" width="148" prop="simcard2">
<el-table-column label="卡2" width="158" prop="simcard2">
<template slot-scope="scope">
{{
scope.row.raw_report.msgs.hasOwnProperty("simcard2")
@ -381,6 +426,22 @@
</template>
</el-table-column>
</el-table-column>
<el-table-column
label="磁盘剩余空间"
v-if="freecheck"
min-width="100"
key="free"
sortable
:sort-method="sortfreeNumbers"
>
<template slot-scope="scope">
<span>{{
scope.row.raw_report.msgs.hasOwnProperty("freeROM")
? scope.row.raw_report.msgs.freeROM
: ""
}}</span>
</template>
</el-table-column>
<el-table-column label="CMA服务器" v-if="cmacheck" width="160" key="cma">
<template slot-scope="scope">
{{
@ -496,6 +557,9 @@
<el-checkbox v-model="simcheck" @change="saveLocalStorage"
>SIM卡</el-checkbox
>
<el-checkbox v-model="freecheck" @change="saveLocalStorage"
>磁盘剩余空间</el-checkbox
>
<el-checkbox v-model="cmacheck" @change="saveLocalStorage"
>CMA服务器</el-checkbox
>
@ -701,58 +765,11 @@
</el-dialog>
<!-- 装置详细信息 -->
<rowMsgDialog ref="rowMsgDialogref"></rowMsgDialog>
<div class="taskMask">
<el-tooltip class="item" effect="dark" content="任务列表" placement="top">
<el-button
icon="el-icon-set-up"
type="primary"
round
@click="showTaskDraw"
>
</el-button>
</el-tooltip>
</div>
<el-drawer
class="taskDrawDialog"
title="待下发终端列表"
:visible.sync="taskdrawer"
direction="rtl"
>
<div class="commandList" v-if="leftCommand.length != 0">
<p class="comLi" v-for="(item, index) in leftCommand" :key="index">
<span class="indexClass">{{ index + 1 }}</span>
<span class="comMsg"
><b>时间{{ item.createTime }}</b>
<b>设备ID{{ item.cmdid }}</b>
<b v-if="item.cmd.fileName">apk{{ item.cmd.fileName }}</b>
<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>
<p>暂无下发命令</p>
</div>
</el-drawer>
</div>
</template>
<script>
import {
getdoActionApi,
getqueryUpgradesApi,
getqueryCmdsApi,
} from "@/utils/api/index";
import { getdoActionApi, getqueryUpgradesApi } from "@/utils/api/index";
import rowMsgDialog from "./rowMsgDialog.vue";
import htmlToExcel from "@/utils/htmlToExcel";
import { saveAs } from "file-saver";
@ -785,7 +802,6 @@ export default {
}
};
return {
updateTime: null,
newupdatatime: null,
cmdCn: {
yw_cmd_android_reboot: "重启设备",
@ -819,6 +835,7 @@ export default {
ywNumber: 0,
kxtNumber: 0,
freeNum: 0,
nowTime: new Date().getTime() / 1000,
gycheck: true,
@ -837,6 +854,7 @@ export default {
Cameracheck: false,
AIcheck: false,
MCUcheck: false,
freecheck: false,
//
operateOptions: [
{ id: 1, name: "重启设备" },
@ -981,31 +999,40 @@ export default {
},
],
},
runCommand: [],
leftCommand: [],
newupdatatime: null,
};
},
mounted() {
this.loadLocalStorage();
this.startCountdown(); //
//this.getNumber();
// this.$nextTick(() => {
// this.getNumber();
// });
},
watch: {
tableData: {
handler(newVal) {
//
console.log("数据已更新:", newVal);
this.getNumber();
this.startCountdown();
},
deep: true,
},
},
created() {},
methods: {
tableRowSetting({ row }) {
if (row.raw_report.msgs.hasOwnProperty("freeROM")) {
// console.log(row.raw_report.msgs.freeROM);
// console.log(parseInt(row.raw_report.msgs.freeROM));
if (parseInt(row.raw_report.msgs.freeROM) < 40) {
return "has-color";
}
}
// if
// if (row.rank === 1) {
// return "has-color";
// }
// return "";
},
sortNumbers(a, b) {
return (
Number(a.raw_report.msgs.rebootTimes) -
@ -1040,6 +1067,12 @@ export default {
Number(b.raw_report.msgs.numberOfHb)
);
},
sortfreeNumbers(a, b) {
return (
parseInt(a.raw_report.msgs.freeROM) -
parseInt(b.raw_report.msgs.freeROM)
);
},
// sortSignature1(a, b) {
// return (
// Number(a.raw_report.msgs.signature1.split("/")[0]) -
@ -1079,6 +1112,11 @@ export default {
} else {
this.checkAllKXT = false;
}
this.freeNum =
this.$refs.ywMultipleTable.$el.getElementsByClassName(
"has-color"
).length;
},
//
handleExport() {
@ -1237,6 +1275,7 @@ export default {
});
return;
}
this.$parent.fetchData();
switch (this.formIssue.operate) {
case 1:
console.log("重启");
@ -1446,6 +1485,7 @@ export default {
localStorage.setItem("Cameracheck", this.Cameracheck);
localStorage.setItem("AIcheck", this.AIcheck);
localStorage.setItem("MCUcheck", this.MCUcheck);
localStorage.setItem("freecheck", this.freecheck);
this.adjustTableHeight();
},
@ -1502,6 +1542,9 @@ export default {
this.MCUcheck = localStorage.getItem("MCUcheck")
? JSON.parse(localStorage.getItem("MCUcheck"))
: false;
this.freecheck = localStorage.getItem("freecheck")
? JSON.parse(localStorage.getItem("freecheck"))
: false;
console.log(
"规约:" + this.gycheck,
@ -1524,21 +1567,6 @@ export default {
this.$refs.ywMultipleTable.doLayout(); // el-table doLayout
});
},
showTaskDraw() {
this.taskdrawer = true;
this.getCmdList();
},
getCmdList() {
//this.leftComLoading = true;
getqueryCmdsApi({ p: 1, ps: 10000 })
.then((res) => {
console.log(res);
this.runCommand = res.data;
this.leftCommand = this.runCommand;
this.updateTime = new Date();
})
.catch((err) => {});
},
startCountdown() {
this.newupdatatime = new Date().getTime(); //
//
@ -1548,8 +1576,13 @@ export default {
// remainingTime
this.intervalId = setInterval(() => {
this.newupdatatime = new Date().getTime(); //
this.leftCommand.forEach((item) => {
this.remainingTime(item); //
this.tableData.forEach((item) => {
//console.log(item);
if (item.list) {
this.remainingTime(item.list[0]);
}
// let params = item.list[0];
// this.remainingTime(params); //
});
}, 1000); //
},
@ -1563,10 +1596,16 @@ export default {
const minutes = Math.floor(difference / 60000);
const seconds = Math.floor((difference % 60000) / 1000);
if (minutes == 0 && seconds == 0) {
this.getCmdList();
this.$parent.fetchData();
return `命令已下发`;
} else {
return ` 预估剩余:${minutes} 分钟 ${seconds}`;
if (minutes < 10 && seconds < 10) {
return ` 0${minutes} : 0${seconds} `;
} else if (minutes < 10) {
return ` 0${minutes} : ${seconds} `;
} else {
return ` ${minutes} : ${seconds} `;
}
}
},
},
@ -1642,6 +1681,13 @@ export default {
}
}
}
.has-color {
background: #f5dab1;
}
.has-color td.el-table__cell {
background: #f5dab1 !important;
}
.el-table--scrollable-y .el-table__body-wrapper {
height: calc(100% - 40px) !important;
}
@ -1827,6 +1873,13 @@ export default {
}
}
}
.redMlxf {
color: #f00;
b {
font-size: 12px;
font-weight: normal;
}
}
}
.contenBoxMsg {
p {

@ -190,6 +190,7 @@
:style="{ height: showDiv ? 'calc(100% - 82px)' : 'calc(100% - 2px)' }"
>
<tableMain
ref="tableRef"
:tableData="dataListNew"
:onlineNum="onlineNum"
:offlineNum="offlineNum"
@ -633,6 +634,7 @@ export default {
//
toggleDiv() {
this.showDiv = !this.showDiv; // showDiv
this.$refs.tableRef.calculateHeight(this.showDiv);
},
},
};

Loading…
Cancel
Save