Commit ec2de535 by liyuhang19990520

字段修改以及大屏接口修改

parent 68ba3d3b
File added
...@@ -8,11 +8,17 @@ ...@@ -8,11 +8,17 @@
> >
<template v-slot:content> <template v-slot:content>
<div class="warning-content"> <div class="warning-content">
<el-table :data="tableData" :row-style="tableCellStyle"> <el-table
:data="tableData"
:row-style="tableCellStyle"
max-height="285"
ref="itsmDataTable"
>
<el-table-column prop="xm" label="姓名"> </el-table-column> <el-table-column prop="xm" label="姓名"> </el-table-column>
<el-table-column prop="bs" label="病史" min-width="81"> <el-table-column prop="timeBegin" label="预警时间" min-width="81">
</el-table-column>
<el-table-column prop="location" label="预警地点">
</el-table-column> </el-table-column>
<el-table-column prop="xzz" label="现住址"> </el-table-column>
</el-table> </el-table>
</div> </div>
</template> </template>
...@@ -62,6 +68,7 @@ export default { ...@@ -62,6 +68,7 @@ export default {
type: "离线", type: "离线",
}, },
], ],
timer: "",
}; };
}, },
//方法集合 //方法集合
...@@ -87,18 +94,37 @@ export default { ...@@ -87,18 +94,37 @@ export default {
} }
}, },
getTableData() { getTableData() {
get( postForm(defaultSettings.BaseURL2 + "/zdryapi/getWarnByImei").then(
defaultSettings.BaseURLZDRY + `/fence/fenceTaskPeopleList/0/100000` (res) => {
).then((res) => { if (res.status == 200) {
if (res.status == 200) { this.tableData = res.data;
this.tableData = res.data.filter((i) => i.warn == 1); }
}
);
},
//表格滚动
tableScroll() {
// 拿到表格挂载后的真实DOM
const table = this.$refs.itsmDataTable;
// 拿到表格中承载数据的div元素
const divData = table.bodyWrapper;
console.log(divData);
// 拿到元素后,对元素进行定时增加距离顶部距离,实现滚动效果(此配置为每100毫秒移动1像素)
this.timer = setInterval(() => {
// 元素自增距离顶部1像素
divData.scrollTop += 1;
// 判断元素是否滚动到底部(可视高度+距离顶部=整个高度)
if (divData.clientHeight + divData.scrollTop == divData.scrollHeight) {
// 重置table距离顶部距离
divData.scrollTop = 0;
} }
}); }, 100);
}, },
}, },
//生命周期 - 挂载完成(可以访问DOM元素) //生命周期 - 挂载完成(可以访问DOM元素)
mounted() { mounted() {
this.getTableData(); this.getTableData();
this.tableScroll();
}, },
}; };
</script> </script>
...@@ -109,6 +135,14 @@ export default { ...@@ -109,6 +135,14 @@ export default {
.el-table__expanded-cell { .el-table__expanded-cell {
background-color: transparent; background-color: transparent;
} }
.el-table__body-wrapper {
&::-webkit-scrollbar {
display: none;
}
&::-webkit-scrollbar-thumb {
display: none;
}
}
/* 表格内背景颜色 */ /* 表格内背景颜色 */
.el-table th, .el-table th,
.el-table tr, .el-table tr,
...@@ -139,7 +173,6 @@ export default { ...@@ -139,7 +173,6 @@ export default {
width: 95%; width: 95%;
margin: auto; margin: auto;
overflow: hidden; overflow: hidden;
@include coverTable; @include coverTable;
} }
} }
......
...@@ -50,31 +50,28 @@ export default { ...@@ -50,31 +50,28 @@ export default {
//配置表格列标题及对应变量 //配置表格列标题及对应变量
tableLabel: [ tableLabel: [
{ {
label: "信息主键编号", label: "任务名称",
prop: "id", prop: "rwmc",
}, },
{ {
label: "设备imei", label: "设备imei",
prop: "imei", prop: "imei",
}, },
{ {
label: "开始时间", label: "预警时间",
prop: "timeBegin", prop: "timeBegin",
}, },
{ {
label: "时间段", label: "布控时间段",
prop: "time", prop: "time",
}, },
{
label: "任务名称",
prop: "rwmc",
},
{ {
label: "任务类型", label: "任务类型",
prop: "rwlx", prop: "rwlx",
}, },
{ {
label: "最新位置", label: "预警位置",
prop: "location", prop: "location",
}, },
], ],
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment