Files
emsfront/src/views/ems/dzjk/sbjk/dtdc/Table.vue

128 lines
3.3 KiB
Vue
Raw Normal View History

2025-08-13 17:49:25 +08:00
<template>
<div>
<el-table
2025-12-05 09:46:31 +08:00
class="common-table"
:data="tableData"
stripe
style="width: 100%; margin-top: 25px"
2025-08-13 17:49:25 +08:00
>
2025-12-05 09:46:31 +08:00
<el-table-column prop="deviceId" label="单体编号"></el-table-column>
<el-table-column prop="clusterDeviceId" label="簇号"></el-table-column>
<el-table-column prop="voltage" label="电压 (V)">
2025-08-13 17:49:25 +08:00
<template slot-scope="scope">
<el-button
2025-12-05 09:46:31 +08:00
@click="chartDetail(scope.row, '电压 (V)')"
type="text"
size="small"
2025-08-13 17:49:25 +08:00
>
{{ scope.row.voltage }}
</el-button>
</template>
</el-table-column>
<el-table-column prop="temperature" label="温度 (℃)">
2025-08-13 17:49:25 +08:00
<template slot-scope="scope">
<el-button
2025-12-05 09:46:31 +08:00
@click="chartDetail(scope.row, '温度 (℃)')"
type="text"
size="small"
2025-08-13 17:49:25 +08:00
>
{{ scope.row.temperature }}
</el-button>
</template>
</el-table-column>
<el-table-column prop="soc" label="SOC (%)">
2025-08-13 17:49:25 +08:00
<template slot-scope="scope">
<el-button
2025-12-05 09:46:31 +08:00
@click="chartDetail(scope.row, 'SOC (%)')"
type="text"
size="small"
2025-08-13 17:49:25 +08:00
>
{{ scope.row.soc }}
</el-button>
</template>
</el-table-column>
<el-table-column prop="soh" label="SOH (%)">
2025-08-13 17:49:25 +08:00
<template slot-scope="scope">
<el-button
2025-12-05 09:46:31 +08:00
@click="chartDetail(scope.row, 'SOH (%)')"
type="text"
size="small"
2025-08-13 17:49:25 +08:00
>
{{ scope.row.soh }}
</el-button>
</template>
</el-table-column>
2025-12-05 09:46:31 +08:00
<el-table-column label="操作" width="160">
2025-08-13 17:49:25 +08:00
<template slot-scope="scope">
2025-11-26 17:50:06 +08:00
<el-button @click="$emit('pointDetail',scope.row,'point')" type="text" size="small">
2025-11-25 17:56:12 +08:00
详细
2025-08-13 17:49:25 +08:00
</el-button>
2025-11-26 17:50:06 +08:00
<el-button @click="$emit('pointDetail',scope.row,'alarmPoint')" type="text" size="small">
报警点位详细
</el-button>
2025-08-13 17:49:25 +08:00
</template>
2025-11-25 17:56:12 +08:00
</el-table-column>
2025-08-13 17:49:25 +08:00
</el-table>
2025-08-14 17:59:58 +08:00
<!-- <el-pagination
2025-08-13 17:49:25 +08:00
v-show="tableData.length > 0"
background
2025-08-14 17:59:58 +08:00
@size-change="(val) => $emit('handleSizeChange', val)"
@current-change="(val) => $emit('handleCurrentChange', val)"
2025-08-13 17:49:25 +08:00
:current-page="pageNum"
:page-size="pageSize"
:page-sizes="[10, 20, 30, 40]"
layout="total, sizes, prev, pager, next, jumper"
:total="totalSize"
style="margin-top: 15px; text-align: center"
>
2025-08-14 17:59:58 +08:00
</el-pagination> -->
2025-08-13 17:49:25 +08:00
</div>
</template>
<script>
export default {
props: {
tableData: {
require: true,
type: Array,
default: () => {
return [];
},
},
2025-08-14 18:09:47 +08:00
pointIdList: {
require: true,
type: Object,
default: () => {
return {};
},
},
totalSize: {
require: true,
type: Number,
default: 0,
},
2025-08-14 17:59:58 +08:00
// pageNum: {
// require: true,
// type: Number,
// default: 1,
// },
// pageSize: {
// require: true,
// type: Number,
// default: 10,
// },
2025-08-13 17:49:25 +08:00
},
data() {
return {};
},
methods: {
//查看表格行图表
chartDetail(row, dataType = "") {
2025-12-05 09:46:31 +08:00
this.$emit("chart", {...row, dataType});
2025-08-13 17:49:25 +08:00
},
},
};
</script>
<style></style>