gaoshp
2024-06-03 6f1ac1da6b6cba5c74f2fb6be82f7e472c4116ee
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
<template>
    <el-container>
        <el-header>
            <div class="left-panel">
                <el-button type="primary" icon="el-icon-plus"></el-button>
                <el-button type="danger" plain icon="el-icon-delete"></el-button>
            </div>
            <div class="right-panel">
                <el-alert title="请在右下角第二个按钮体验自定义列" type="warning" :closable="false"/>
            </div>
        </el-header>
        <el-main class="nopadding">
            <scTable ref="table" tableName="listCustomColumn" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe>
                <el-table-column type="selection" width="50"></el-table-column>
                <template #progress="scope">
                    <el-progress :percentage="scope.row.progress" />
                </template>
            </scTable>
        </el-main>
    </el-container>
</template>
 
<script>
    export default {
        name: 'tableCustomColumn',
        data() {
            return {
                list: {
                    apiObj: this.$API.demo.list,
                    column: [
                        {
                            label: "姓名",
                            prop: "name",
                            width: "150"
                        },
                        {
                            label: "性别",
                            prop: "sex",
                            width: "150",
                            filters: [{text: '男', value: '男'}, {text: '女', value: '女'}]
                        },
                        {
                            label: "邮箱",
                            prop: "email",
                            width: "250",
                            hide: true
                        },
                        {
                            label: "评分",
                            prop: "num",
                            width: "150",
                            sortable: true
                        },
                        {
                            label: "进度",
                            prop: "progress",
                            width: "250",
                            sortable: true
                        },
                        {
                            label: "注册时间",
                            prop: "datetime",
                            width: "150",
                            sortable: true
                        }
                    ]
                }
            }
        }
    }
</script>
 
<style>
</style>