longyvfengyun
2023-11-20 a3b4356b688544bf578ae4754bd66f58ffaec764
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<script setup>
import {ref, onMounted} from "vue";
 
const tableData = ref([]);
 
const carName = ref(null);
 
import {
    driveInfModule
} from "@/views/moudle/driveInf/driveInf";
 
const {
    page,
    pageSize,
    total,
    driveList,
    getDriveList
} = driveInfModule();
 
const searchDriveList = async ()=>{
    let res = await getDriveList();
    console.log(res);
    driveList.value = res.result;
}
 
onMounted(()=>{
    searchDriveList();
});
</script>
 
<template>
    <div class="page-container">
        <div class="page-content">
            <div class="page-header">
                <div class="input-list">
                    <div class="input-item">
                        <el-button type="success" icon="Plus">添加</el-button>
                        <el-button type="primary" icon="Search">查询</el-button>
                    </div>
                </div>
            </div>
            <div class="page-content">
                <el-table :data="driveList" height="100%">
                    <el-table-column prop="name" label="车辆名称" />
                    <el-table-column prop="boxSn" label="车辆编码"></el-table-column>
                    <el-table-column prop="online" label="车辆编码">
                        <template #default="{row}">
                            <el-tag v-if="row.online">在线</el-tag>
                            <el-tag v-else type="danger">离线</el-tag>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
            <div class="page-footer">
                <div class="el-pagination-container">
                    <el-pagination background layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination>
                </div>
            </div>
        </div>
    </div>
</template>
 
<style scoped lang="less">
.page-container {
    height: 100%;
    padding: 12px;
    .page-content {
        display: flex;
        height: 100%;
        border-radius: 4px;
        box-shadow: 0 0 12px rgba(0, 0, 0, .16);
        flex-direction: column;
        .page-header {
            padding: 8px;
        }
        .page-content {
            flex: 1;
            overflow-y: auto;
        }
        .page-footer {
            padding: 8px 0;
            text-align: center;
            .el-pagination-container {
                display: inline-block;
            }
        }
    }
}
 
.input-list {
    .input-item {
        display: inline-block;
        margin-left: 8px;
    }
}
.input-wrapper {
    display: flex;
    .input-content {
        width: 160px;
    }
    .input-label {
        font-size: 14px;
        line-height: 40px;
        vertical-align: bottom;
        margin-right: 8px;
    }
}
</style>