gaoshp
2024-04-09 1eda841829c3e5ffdab59efa21c938c4d7653ab4
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
<!--
 * @Date: 2024-04-09 22:18:47
 * @LastEditors: Sneed
 * @LastEditTime: 2024-04-09 22:52:11
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/system/component-classification.vue
 * 分类维护
-->
<template>
    <el-container>
        <el-header style="justify-content: flex-start;">
            <el-button type="primary">新增</el-button>
            <el-button type="danger">删除</el-button>
        </el-header>
        <el-main>
            <el-table ref="multipleTableRef" :data="tableData" border style="width: 100%" class="multipleTableRef" @selection-change="handleSelectionChange" row-key="id" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
                <el-table-column type="selection" width="55" />
                <el-table-column prop="name" label="分类名称" />
                <el-table-column prop="icon" label="分类图标">
                </el-table-column>
                <el-table-column prop="type" label="分类编号" />
                <el-table-column prop="orderNum" label="排列顺序" />
                <el-table-column prop="status" label="状态">
                    <template #default="scope">
                        <span>{{scope.row.status === 1 ? '启用' : '停用'}}</span>
                    </template>
                </el-table-column>
                <el-table-column label="操作" fixed="right" align="left" width="160">
                    <template #default="scope">
                        <el-button-group>
                            <el-button text type="primary" size="small"
                                @click="table_edit(scope.row, scope.$index)">编辑</el-button>
                            <el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index, '0')">
                                <template #reference>
                                    <el-button text type="primary" size="small">删除</el-button>
                                </template>
                            </el-popconfirm>
                        </el-button-group>
                    </template>
                </el-table-column>
            </el-table>
        </el-main>
    </el-container>
</template>
 
<script>
export default {
    data() {
        return {
            tableData: []
        }
    },
    created () {
        this.queryList()
    },
    methods: {
        queryList () {
            this.$API.setting.getList.get().then(res => {
                console.log(res)
                this.tableData = res.data
            })
        },
        table_edit() {
 
        },
        table_del() {
 
        },
        handleSelectionChange () {
            
        }
    },
}
</script>
 
<style lang="scss" scoped></style>