mod(custom): 优化部分细节

This commit is contained in:
2023-12-17 00:21:12 +08:00
parent b4689e6e34
commit 20786c4a09
4 changed files with 70 additions and 14 deletions

View File

@@ -16,4 +16,6 @@ export default {
addUserPulse: (data) => request.post('/gift/pulse', data),
// 获取赠送记录
getgiftJllist: (data) => request.post('/user/gift/pluse', data),
// 用户状态修改
updateUserStatus: (data) => request.post('/user/status/edit', data),
}

View File

@@ -238,7 +238,7 @@
<script setup>
import { h } from 'vue'
import api from './api'
import { NDropdown, NButton } from 'naive-ui'
import { NDropdown, NButton, NSwitch } from 'naive-ui'
import TheIcon from '@/components/icon/TheIcon.vue'
const loading = ref(false)
@@ -374,6 +374,29 @@ const columns = ref([
sorter: true,
sortOrder: false,
},
{
title: '用户状态',
align: 'center',
slot: 'status',
render: (row) => {
return h(
NSwitch,
{
value: row.status,
checkedValue: 1,
uncheckedValue: 2,
onUpdateValue: async (value) => {
await api.updateUserStatus({
uid: row.uid,
status: value,
})
await getList()
},
},
{}
)
},
},
{
title: '操作',
align: 'center',