|
|
@@ -32,79 +32,34 @@
|
|
|
<el-form
|
|
|
:model="state.formQuery"
|
|
|
ref="queryRef"
|
|
|
- size="default" label-width="0px" class="mt5">
|
|
|
+ size="default" label-width="0px" class="mt5 mb5">
|
|
|
<el-input
|
|
|
- v-model="state.formQuery.avatar"
|
|
|
- placeholder="头像"
|
|
|
- clearable
|
|
|
- @blur="loadData(true)"
|
|
|
- class="w150 mr10">
|
|
|
- </el-input>
|
|
|
- <el-input
|
|
|
- v-model="state.formQuery.companyId"
|
|
|
- placeholder="公司id"
|
|
|
- clearable
|
|
|
- @blur="loadData(true)"
|
|
|
- class="w150 mr10">
|
|
|
- </el-input>
|
|
|
- <el-input
|
|
|
- v-model="state.formQuery.lastLoginTime"
|
|
|
- placeholder="最后登录时间"
|
|
|
+ v-model="state.formQuery.username"
|
|
|
+ placeholder="用户名"
|
|
|
clearable
|
|
|
@blur="loadData(true)"
|
|
|
- class="w150 mr10">
|
|
|
+ class="wd150 mr10">
|
|
|
</el-input>
|
|
|
<el-input
|
|
|
v-model="state.formQuery.mobilePhone"
|
|
|
placeholder="手机号"
|
|
|
clearable
|
|
|
@blur="loadData(true)"
|
|
|
- class="w150 mr10">
|
|
|
- </el-input>
|
|
|
- <el-input
|
|
|
- v-model="state.formQuery.nickname"
|
|
|
- placeholder="昵称"
|
|
|
- clearable
|
|
|
- @blur="loadData(true)"
|
|
|
- class="w150 mr10">
|
|
|
+ class="wd150 mr10">
|
|
|
</el-input>
|
|
|
- <el-input
|
|
|
- v-model="state.formQuery.password"
|
|
|
- placeholder="密码"
|
|
|
- clearable
|
|
|
- @blur="loadData(true)"
|
|
|
- class="w150 mr10">
|
|
|
- </el-input>
|
|
|
- <el-input
|
|
|
+ <ext-d-select
|
|
|
v-model="state.formQuery.status"
|
|
|
- placeholder="0:禁用 1:启用"
|
|
|
- clearable
|
|
|
- @blur="loadData(true)"
|
|
|
- class="w150 mr10">
|
|
|
- </el-input>
|
|
|
- <el-input
|
|
|
- v-model="state.formQuery.updateTime"
|
|
|
- placeholder=""
|
|
|
- clearable
|
|
|
- @blur="loadData(true)"
|
|
|
- class="w150 mr10">
|
|
|
- </el-input>
|
|
|
- <el-input
|
|
|
- v-model="state.formQuery.username"
|
|
|
- placeholder="用户名"
|
|
|
+ placeholder="状态"
|
|
|
+ type="User.status"
|
|
|
clearable
|
|
|
- @blur="loadData(true)"
|
|
|
- class="w150 mr10">
|
|
|
- </el-input>
|
|
|
+ @on-change="loadData(true)"
|
|
|
+ class="wd150 mr10"/>
|
|
|
+
|
|
|
+ <el-button class="ml10" plain size="default" type="success" @click="loadData(true)">
|
|
|
+ <SvgIcon name="ele-Search"/>
|
|
|
+ 查询
|
|
|
+ </el-button>
|
|
|
|
|
|
- <el-row class="flex-warp mt5">
|
|
|
- <div>
|
|
|
- <el-button plain size="default" type="success" @click="loadData(true)">
|
|
|
- <SvgIcon name="ele-Search"/>
|
|
|
- 查询
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- </el-row>
|
|
|
</el-form>
|
|
|
|
|
|
<el-table
|
|
|
@@ -121,7 +76,6 @@
|
|
|
<template #empty>
|
|
|
<el-empty></el-empty>
|
|
|
</template>
|
|
|
- <el-table-column type="selection" align="center" width="55" fixed="left"/>
|
|
|
<el-table-column
|
|
|
v-for="field in state.tableData.columns"
|
|
|
:key="field.prop"
|
|
|
@@ -134,11 +88,14 @@
|
|
|
:show-overflow-tooltip="!field.fixed&&field.width>150"
|
|
|
>
|
|
|
<template #default="{row}">
|
|
|
- <template v-if="field.prop==='expand'">
|
|
|
- <p style="padding-left: 2em;" v-html="row[field.prop]"></p>
|
|
|
+ <template v-if="['rechargeAmount','totalMoney'].includes(field.prop)">
|
|
|
+ {{ u.fmt.fmtMoney(row[field.prop]) }}
|
|
|
+ </template>
|
|
|
+ <template v-else-if="'status'===field.prop">
|
|
|
+ <ext-d-label type="User.status" v-model="row[field.prop]"/>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <div>row[field.prop]</div>
|
|
|
+ <div>{{ row[field.prop] }}</div>
|
|
|
</template>
|
|
|
|
|
|
</template>
|
|
|
@@ -153,13 +110,16 @@
|
|
|
|
|
|
<script setup lang="ts" name="AdminUserList">
|
|
|
import {defineAsyncComponent, reactive, onMounted, onBeforeMount, ref, getCurrentInstance, nextTick, onBeforeUnmount} from 'vue';
|
|
|
-import {$body,$get} from "/@/utils/request";
|
|
|
+import {$body, $get} from "/@/utils/request";
|
|
|
import {Msg} from "/@/utils/message";
|
|
|
+import u from "/@/utils/u"
|
|
|
|
|
|
|
|
|
import ExtPage from '/@/components/form/ExtPage.vue'
|
|
|
|
|
|
import mittBus from '/@/utils/mitt';
|
|
|
+import ExtDLabel from "/@/components/form/ExtDLabel.vue";
|
|
|
+import ExtDSelect from "/@/components/form/ExtDSelect.vue";
|
|
|
|
|
|
const AdminUserDialog = defineAsyncComponent(() => import("/@/views/admin/account/detail.vue"));
|
|
|
|
|
|
@@ -171,25 +131,24 @@ const adminUserDialogRef = ref();
|
|
|
const state = reactive({
|
|
|
formQuery: {},
|
|
|
pageQuery: {
|
|
|
- pageNumber: 1,
|
|
|
+ pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
total: 0
|
|
|
},
|
|
|
tableData: {
|
|
|
height: 500,
|
|
|
- data: [] as Array < any >,
|
|
|
+ data: [] as Array<any>,
|
|
|
loading: false,
|
|
|
columns: [
|
|
|
- {type: 'selection', width: 60, align: 'center', fixed: 'left'},
|
|
|
- {label: '头像', prop: 'avatar', resizable: true},
|
|
|
- {label: '', prop: 'createTime', sortable: 'custom', resizable: true},
|
|
|
- {label: '最后登录时间', prop: 'lastLoginTime', sortable: 'custom', resizable: true},
|
|
|
- {label: '手机号', prop: 'mobilePhone', resizable: true},
|
|
|
- {label: '昵称', prop: 'nickname', resizable: true},
|
|
|
- {label: '密码', prop: 'password', resizable: true},
|
|
|
- {label: '0:禁用 1:启用', prop: 'status', sortable: 'custom', align: 'center'},
|
|
|
- {label: '', prop: 'updateTime', sortable: 'custom', resizable: true},
|
|
|
- {label: '用户名', prop: 'username', resizable: true},
|
|
|
+ {label: '用户名', prop: 'userName', resizable: true, fixed: 'left'},
|
|
|
+ {label: '手机号', width: 150, prop: 'mobilePhone', resizable: true, fixed: 'left'},
|
|
|
+ {label: '状态', width: 120, prop: 'status', align: 'center'},
|
|
|
+ {label: '注册时间', width: 180, prop: 'registerTime', resizable: true},
|
|
|
+ {label: '充值次数', width: 150, prop: 'rechargeTimes', resizable: true},
|
|
|
+ {label: '充值金额', width: 150, prop: 'rechargeAmount', resizable: true},
|
|
|
+ {label: '充电次数', width: 150, prop: 'chargeTimes', resizable: true},
|
|
|
+ {label: '总电量', width: 150, prop: 'totalPower', resizable: true},
|
|
|
+ {label: '总金额', width: 150, prop: 'totalMoney', resizable: true},
|
|
|
{
|
|
|
label: '操作', prop: 'action', width: 180, align: 'center', fixed: 'right',
|
|
|
}
|
|
|
@@ -233,13 +192,14 @@ onBeforeUnmount(() => {
|
|
|
// 初始化表格数据
|
|
|
const loadData = (refresh: boolean = false) => {
|
|
|
if (refresh) {
|
|
|
- state.pageQuery.pageNumber = 1;
|
|
|
+ state.pageQuery.pageNum = 1;
|
|
|
}
|
|
|
state.tableData.loading = true;
|
|
|
- $body(`/adminUser/list`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
|
|
|
- let {list, count} = res;
|
|
|
+ $get(`/custom/listUser`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
|
|
|
+ console.log(res)
|
|
|
+ let {list, total} = res;
|
|
|
state.tableData.data = list;
|
|
|
- state.pageQuery.total = count;
|
|
|
+ state.pageQuery.total = total;
|
|
|
state.tableData.loading = false;
|
|
|
}).catch(e => {
|
|
|
console.error(e)
|