116 lines
3.7 KiB
Vue
116 lines
3.7 KiB
Vue
<script setup lang="ts">
|
||
import { onMounted } from "vue";
|
||
import { useData } from "./hook";
|
||
import SearchForm from "@/components/SearchForm/index.vue";
|
||
import { PureTableBar } from "@/components/RePureTableBar";
|
||
import { deviceDetection } from "@pureadmin/utils";
|
||
const {
|
||
searchLabel,
|
||
searchForm,
|
||
onSearch,
|
||
isShow,
|
||
tableList,
|
||
pagination,
|
||
tableLabel,
|
||
handleSizeChange,
|
||
handleCurrentChange,
|
||
loading,
|
||
openDialog,
|
||
handleDelete,
|
||
viewDetail,
|
||
handleBanData,
|
||
setOfficialUser,
|
||
changePassword,
|
||
setUserFund,
|
||
onSeniorSearch,
|
||
resetFieldsSearch,
|
||
exportExcel,
|
||
changeSearchValue,
|
||
FindData,
|
||
totalPrice
|
||
} = useData();
|
||
defineOptions({
|
||
name: "newuserList"
|
||
});
|
||
onMounted(() => {
|
||
onSearch(searchForm.value);
|
||
});
|
||
</script>
|
||
|
||
<style scoped>
|
||
.el-dropdown-link {
|
||
cursor: pointer;
|
||
color: #409EFF;
|
||
}
|
||
|
||
.el-icon-arrow-down {
|
||
font-size: 12px;
|
||
}
|
||
</style>
|
||
<template>
|
||
<div class="main">
|
||
<SearchForm class="pb-2" :LabelList="searchLabel" :formData="searchForm" @handleSearch="onSearch"
|
||
@openSearch="onSeniorSearch" @changeValue="changeSearchValue" @resetFields="resetFieldsSearch" :isSenior="true" />
|
||
<div ref="contentRef" :class="['flex', deviceDetection() ? 'flex-wrap' : '']">
|
||
<PureTableBar title="会员列表" :class="[isShow && !deviceDetection() ? '!w-[60vw]' : 'w-full']" :columns="tableLabel"
|
||
@refresh="onSearch">
|
||
<template #buttons>
|
||
<div style="display: inline-flex;align-items: center;" class="mr-10">当前平台用户总计:<span
|
||
style="color: red;margin-right: 5px;">{{
|
||
totalPrice.total_coin }}</span> 金币,<span style="color: red;margin-right: 5px;">{{
|
||
totalPrice.total_earnings }}</span> 钻石。</div>
|
||
<el-button type="primary" @click="exportExcel">
|
||
导出
|
||
</el-button>
|
||
</template>
|
||
<template v-slot="{ size, dynamicColumns }">
|
||
<pure-table ref="tableRef" align-whole="center" showOverflowTooltip table-layout="auto" :loading="loading"
|
||
:size="size" adaptive :adaptiveConfig="{ offsetBottom: 108 }" :data="tableList" :columns="dynamicColumns"
|
||
:pagination="{ ...pagination, size }" :header-cell-style="{
|
||
background: 'var(--el-fill-color-light)',
|
||
color: 'var(--el-text-color-primary)'
|
||
}" @page-size-change="handleSizeChange" @page-current-change="handleCurrentChange">
|
||
<template #operation="{ row }">
|
||
<el-button @click="openDialog('编辑', row)" link type="primary" :size="size">
|
||
编辑
|
||
</el-button>
|
||
<el-button link type="primary" @click="viewDetail(row)">
|
||
查看
|
||
</el-button>
|
||
<el-popconfirm :title="`是否找回账号`" @confirm="FindData(row)">
|
||
<template #reference>
|
||
<el-button v-if="row.status == 0" link type="primary">
|
||
找回
|
||
</el-button>
|
||
</template>
|
||
</el-popconfirm>
|
||
<el-button link type="primary" @click="handleBanData(row)">
|
||
{{ row.status == 2 ? '解封' : '禁用' }}
|
||
</el-button>
|
||
<el-popconfirm :title="`是否删除${row.nickname}的会员`" @confirm="handleDelete(row)">
|
||
<template #reference>
|
||
<el-button link type="primary" :size="size">
|
||
删除
|
||
</el-button>
|
||
</template>
|
||
</el-popconfirm>
|
||
<el-popconfirm :title="`是否设置${row.nickname}的会员为官方账号`" @confirm="setOfficialUser(row)">
|
||
<template #reference>
|
||
<el-button link type="primary">
|
||
设置官方账号
|
||
</el-button>
|
||
</template>
|
||
</el-popconfirm>
|
||
<el-button link type="primary" @click="changePassword(row)">
|
||
修改密码
|
||
</el-button>
|
||
<el-button link type="primary" @click="setUserFund(row)">
|
||
资金
|
||
</el-button>
|
||
</template>
|
||
</pure-table>
|
||
</template>
|
||
</PureTableBar>
|
||
</div>
|
||
</div>
|
||
</template> |