gaoshp
2024-11-19 f29900986f01cf5d39b5755cec674825cef27961
src/views/console/system/collection.vue
@@ -1,18 +1,76 @@
<!--
 * @Date: 2024-10-02 20:34:08
 * @LastEditors: gaoshp
 * @LastEditTime: 2024-10-02 20:34:22
 * @LastEditTime: 2024-10-05 10:07:12
 * @FilePath: /cps-web/src/views/console/system/collection.vue
-->
<template>
    <div>
        caijidian
    </div>
    <el-main>
        <el-card>
            <el-container>
                <el-header style="justify-content: flex-end;">
                    <el-button type="primary">新增模版</el-button>
                    <el-button type="primary">新增模版</el-button>
                </el-header>
                <el-main>
                    <scTable highlight-current-row @dataChange="dataChange" @row-click="rowClick" ref="table"
                        :params="params" :apiObj="apiObj" @selection-change="selectionChange" stripe>
                        <el-table-column prop="" label="模版名称" width="100px" />
                        <el-table-column prop="" label="类型" />
                        <el-table-column prop="" label="默认轮询" />
                        <el-table-column prop="" label="描述" />
                        <el-table-column prop="" label="备注" />
                        <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 width="220" cancel-button-text="停用" confirm-button-text="删除"
                                        title="删除数据会影响已关联的业务 ,若您想在已关联的业务中依然显示这些数据, 您可以选择 停用 操作。停用后此数据将不能再被新业务使用。"
                                        @confirm="table_del([scope.row], '0')" @cancel="table_del([scope.row], '1')">
                                        <template #reference>
                                            <el-button type="danger" text size="small">删除</el-button>
                                        </template>
                                    </el-popconfirm>
                                </el-button-group>
                            </template>
                        </el-table-column>
                    </scTable>
                </el-main>
            </el-container>
        </el-card>
    </el-main>
</template>
<script>
export default {
    data() {
        return {
            params: {},
            apiObj: {
                get: async (data) => {
                    let params = {
                    }
                    return await this.$HTTP.get(`/api/smart-collect/tpl/page`, {}, { params }).then(res => {
                        res.data.records = res?.data?.records.map(v => {
                            return {
                                ...v,
                                statusName: v.status ? '启用' : '禁用'
                            }
                        })
                        return res
                    })
                }
            }
        }
    },
    methods: {
        dataChange() {
        }
    }
}
</script>