<template>
    <Page :loading="false">
        <div >
            <el-form :inline="true" class="demo-form-inline">
                <el-form-item style="float: right;">
                    <el-button type="primary" @click="refreshReferralCode">刷新推荐码</el-button>
                </el-form-item>
            </el-form>
            <el-table
                stripe :cell-style="{ textAlign: 'center' }"
                :header-cell-style="{ textAlign: 'center' }"
                :data="tableData"
                height="calc(100vh - 185px)"
                border
                header-cell-class-name="table_header"
                algin="center"
                style="width: 100%;">
                <el-table-column
                    prop="roleName"
                    label="角色名称"
                >
                </el-table-column>
                <el-table-column
                    prop="roleReferralCode"
                    label="推荐码"
                >
                </el-table-column>
            </el-table>
        </div>
    </page>
</template>

<script>
import {findReferralCode, refreshReferralCode} from '@/api/app/setting'

export default {
    name: 'GovernManageReferral',
    data() {
        return {
            tableData: []
        }
    },
    created() {
        findReferralCode().then(res => {
            console.log(res)
            this.tableData = res.data
        })
    },
    methods: {
        refreshReferralCode() {
            refreshReferralCode().then(res => {
                console.log(res)
                this.tableData = res.data
            })
        }
    }
}
</script>