优化小程序端配置功能

This commit is contained in:
gxwebsoft
2024-05-05 16:29:16 +08:00
parent d764188399
commit bf652139aa
53 changed files with 7186 additions and 73 deletions

View File

@@ -120,6 +120,14 @@
v-model:value="form.introduction"
/>
</a-form-item>
<a-form-item label="管理员">
<a-switch
checked-children="是"
un-checked-children="否"
:checked="form.isAdmin == 1"
@update:checked="updateIsAdmin"
/>
</a-form-item>
</a-col>
</a-row>
</a-form>
@@ -191,6 +199,7 @@
idCard: '',
comments: '',
gradeName: '',
isAdmin: undefined,
gradeId: undefined
});
@@ -286,6 +295,10 @@
form.gradeId = data.gradeId;
};
const updateIsAdmin = (value: boolean) => {
form.isAdmin = value ? 1 : 0;
};
/* 保存编辑 */
const save = () => {
if (!formRef.value) {

View File

@@ -66,22 +66,19 @@
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'avatar'">
<a-avatar
:size="30"
:src="`${record.avatar}`"
style="margin-right: 4px"
>
<template #icon>
<UserOutlined />
</template>
</a-avatar>
</template>
<template v-if="column.key === 'nickname'">
<div class="user-box">
<a-avatar
:size="30"
:src="`${record.avatar}`"
style="margin-right: 4px"
>
<template #icon>
<UserOutlined />
</template>
</a-avatar>
<div class="user-info" @click="openEdit(record)">
<span>{{ record.nickname }}</span>
<!-- <span class="ele-text-placeholder">{{ record.nickname }}</span>-->
</div>
</div>
<span>{{ record.nickname }}</span>
</template>
<template v-if="column.key === 'mobile'">
<span v-if="hasRole('superAdmin')">{{ record.phone }}</span>
@@ -102,10 +99,10 @@
{{ formatNumber(record.expendMoney) }}
</span>
</template>
<template v-else-if="column.key === 'status'">
<template v-else-if="column.key === 'isAdmin'">
<a-switch
:checked="record.status === 0"
@change="(checked: boolean) => editStatus(checked, record)"
:checked="record.isAdmin == 1"
@change="updateIsAdmin(record)"
/>
</template>
<template v-else-if="column.key === 'action'">
@@ -166,8 +163,8 @@
removeUser,
removeUsers,
updateUserStatus,
updateUserPassword
} from '@/api/system/user';
updateUserPassword, updateUser
} from "@/api/system/user";
import type { User, UserParam } from '@/api/system/user/model';
import { toTreeData, uuid } from 'ele-admin-pro';
import { listRoles } from '@/api/system/role';
@@ -250,26 +247,33 @@
{
title: 'ID',
dataIndex: 'userId',
width: 80,
width: 90,
showSorterTooltip: false
},
{
title: '头像',
key: 'avatar',
dataIndex: 'avatar',
align: 'center',
width: 90
},
{
title: '用户名',
dataIndex: 'username',
showSorterTooltip: false
},
{
title: '昵称',
key: 'nickname',
dataIndex: 'nickname',
width: 240,
title: '手机号码',
dataIndex: 'mobile',
align: 'center',
key: 'mobile',
showSorterTooltip: false
},
{
title: '手机号码',
dataIndex: 'mobile',
key: 'mobile',
showSorterTooltip: false
title: '昵称',
key: 'nickname',
align: 'center',
dataIndex: 'nickname'
},
// {
// title: '',
@@ -291,13 +295,6 @@
hideInTable: true,
showSorterTooltip: false
},
{
title: '可用余额',
dataIndex: 'balance',
key: 'balance',
sorter: true,
showSorterTooltip: false
},
{
title: '实际消费金额',
dataIndex: 'expendMoney',
@@ -316,7 +313,7 @@
title: '注册来源',
key: 'platform',
dataIndex: 'platform',
hideInTable: true,
width: 120,
customRender: ({ text }) => ['未知', '网站', '小程序', 'APP'][text]
},
{
@@ -350,13 +347,6 @@
hideInTable: true,
showSorterTooltip: false
},
{
title: '个人简介',
dataIndex: 'introduction',
key: 'introduction',
hideInTable: true,
showSorterTooltip: false
},
{
title: '邮箱认证',
dataIndex: 'emailVerified',
@@ -380,9 +370,9 @@
filters: roles.value
},
{
title: '状态',
key: 'status',
dataIndex: 'status',
title: '管理员',
key: 'isAdmin',
dataIndex: 'isAdmin',
sorter: true,
showSorterTooltip: false,
align: 'center'
@@ -421,6 +411,7 @@
where = {};
where.roleId = filters.roles;
where.keywords = searchText.value;
where.isAdmin = 1;
return pageUsers({ page, limit, ...where, ...orders });
};
@@ -518,11 +509,10 @@
};
/* 修改用户状态 */
const editStatus = (checked: boolean, row: User) => {
const status = checked ? 0 : 1;
updateUserStatus(row.userId, status)
const updateIsAdmin = (row: User) => {
row.isAdmin = row.isAdmin ? 0 : 1;
updateUser(row)
.then((msg) => {
row.status = status;
message.success(msg);
})
.catch((e) => {

View File

@@ -107,8 +107,8 @@
import { useThemeStore } from '@/store/modules/theme';
import useFormData from '@/utils/use-form-data';
import OrgSelect from './org-select.vue';
import RoleSelect from '../../user/components/role-select.vue';
import SexSelect from '../../user/components/sex-select.vue';
import RoleSelect from './role-select.vue';
import SexSelect from './sex-select.vue';
import { addUser, updateUser, checkExistence } from '@/api/system/user';
import type { User } from '@/api/system/user/model';
import type { Organization } from '@/api/system/organization/model';