角色推荐码

This commit is contained in:
仲么了
2024-01-18 09:18:30 +08:00
parent 14e0904e87
commit 1f5782c0d4
3 changed files with 55 additions and 1 deletions

View File

@@ -0,0 +1,46 @@
<template>
<div class='default-main'>
<TableHeader>
<template v-slot:operation>
<el-button :icon='Refresh' type='primary' @click='refresh'>刷新推荐码</el-button>
</template>
</TableHeader>
<Table ref='tableRef' />
<popupForm ref='popupRef'></popupForm>
</div>
</template>
<script setup lang='ts'>
import { Refresh } from '@element-plus/icons-vue'
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { refreshReferralCode } from '@/api/user-boot/referralCode'
defineOptions({
name: 'auth/menu'
})
const tableRef = ref()
const tableStore = new TableStore({
showPage: false,
method: 'POST',
url: '/user-boot/referralCode/findReferralCode',
column: [
{ title: '序号', type: 'seq', width: 60 },
{ title: '角色名称', field: 'roleName' },
{ title: '推荐码', field: 'roleReferralCode' }
]
})
provide('tableStore', tableStore)
onMounted(() => {
tableStore.table.ref = tableRef.value
tableStore.index()
tableStore.table.loading = false
})
const refresh = () => {
refreshReferralCode().then(res => {
tableStore.table.data = res.data
})
}
</script>