适配多商户

This commit is contained in:
gxwebsoft
2024-05-24 14:53:29 +08:00
parent 757822f3ba
commit dea6ae1c23
23 changed files with 1167 additions and 315 deletions

View File

@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { UserInvoice, UserInvoiceParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询发票
*/
export async function pageUserInvoice(params: UserInvoiceParam) {
const res = await request.get<ApiResult<PageResult<UserInvoice>>>(
MODULES_API_URL + '/booking/user-invoice/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询发票列表
*/
export async function listUserInvoice(params?: UserInvoiceParam) {
const res = await request.get<ApiResult<UserInvoice[]>>(
MODULES_API_URL + '/booking/user-invoice',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加发票
*/
export async function addUserInvoice(data: UserInvoice) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-invoice',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改发票
*/
export async function updateUserInvoice(data: UserInvoice) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-invoice',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除发票
*/
export async function removeUserInvoice(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-invoice/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除发票
*/
export async function removeBatchUserInvoice(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-invoice/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询发票
*/
export async function getUserInvoice(id: number) {
const res = await request.get<ApiResult<UserInvoice>>(
MODULES_API_URL + '/booking/user-invoice/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -0,0 +1,53 @@
import type { PageParam } from '@/api';
/**
* 发票
*/
export interface UserInvoice {
// id
id?: number;
// 发票类型(0纸质 1电子)
type?: number;
// 发票名称
name?: string;
// 开票类型(0铺票 1专票)
invoiceType?: string;
// 税号
invoiceCode?: string;
// 公司地址
address?: string;
// 公司电话
tel?: string;
// 开户行
bankName?: string;
// 开户账号
bankAccount?: string;
// 手机号码
phone?: string;
// 电子邮箱
email?: string;
// 备注
comments?: string;
// 排序(数字越小越靠前)
sortNumber?: number;
// 状态, 0待使用, 1已使用, 2已失效
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 用户ID
userId?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 发票搜索条件
*/
export interface UserInvoiceParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -5,7 +5,7 @@ import type { PageParam } from '@/api';
*/
export interface Users {
//
userId?: number;
uid?: number;
// 用户唯一小程序id
openid?: string;
// 小程序用户秘钥
@@ -46,6 +46,9 @@ export interface Users {
realName?: string;
// 是否管理员1是2否
isAdmin?: string;
truename?: string;
idcard?: string;
gender?: string;
// 客户端ID
clientId?: string;
// 注册来源客户端 (APP、H5、小程序等)
@@ -68,6 +71,6 @@ export interface Users {
* 用户搜索条件
*/
export interface UsersParam extends PageParam {
userId?: number;
uid?: number;
keywords?: string;
}

View File

@@ -57,6 +57,7 @@ export async function loginBySms(data: LoginParam) {
localStorage.setItem('Phone', String(user.phone));
localStorage.setItem('UserId', String(user.userId));
localStorage.setItem('MerchantId', String(user.merchantId));
localStorage.setItem('MerchantName', String(user.merchantName));
}
return res.data.message;

View File

@@ -65,7 +65,9 @@ export interface Merchant {
roleId?: number;
roleName?: string;
label?: string;
value?: string;
value?: number;
key?: number;
title?: string;
}
/**

View File

@@ -57,6 +57,8 @@ export interface User {
// 角色列表
roles?: Role[];
roleCode?: string;
roleId?: number;
roleName?: string;
// 权限列表
authorities?: Menu[];
payTime?: string;
@@ -83,6 +85,7 @@ export interface User {
setting?: string;
realName?: string;
companyName?: string;
merchantName?: string;
gradeName?: string;
idCard?: string;
comments?: string;

View File

@@ -10,6 +10,7 @@
@update:value="updateValue"
:style="`width: 200px`"
@blur="onBlur"
@change="onChange"
/>
</template>
@@ -20,6 +21,7 @@
const emit = defineEmits<{
(e: 'update:value', value: string, item: any): void;
(e: 'done', item: Merchant): void;
(e: 'blur'): void;
}>();
@@ -48,11 +50,16 @@
emit('blur');
};
const onChange = (item: Merchant) => {
emit('done', item);
};
const reload = () => {
listMerchant({}).then((list) => {
options.value = list.map((d) => {
d.label = d.merchantName;
d.value = d.merchantCode;
d.value = d.merchantId;
d.key = d.merchantCode;
return d;
});
});

View File

@@ -1,158 +0,0 @@
<!-- 顶栏右侧区域 -->
<template>
<div class="ele-admin-header-tool">
<!-- 全屏切换 -->
<div
:class="[
'ele-admin-header-tool-item',
{ 'hidden-sm-and-down': styleResponsive }
]"
@click="toggleFullscreen"
>
<fullscreen-exit-outlined v-if="fullscreen" />
<fullscreen-outlined v-else />
</div>
<!-- 语言切换 -->
<!-- <div class="ele-admin-header-tool-item">-->
<!-- <i18n-icon />-->
<!-- </div>-->
<!-- 消息通知 -->
<div class="ele-admin-header-tool-item">
<header-notice />
</div>
<!-- 用户信息 -->
<div class="ele-admin-header-tool-item">
<a-dropdown placement="bottom" :overlay-style="{ minWidth: '120px' }">
<div class="ele-admin-header-avatar">
<a-avatar :src="loginUser.avatar">
<template v-if="!loginUser.avatar" #icon>
<user-outlined />
</template>
</a-avatar>
<span :class="{ 'hidden-sm-and-down': styleResponsive }">
{{ loginUser.nickname }}
</span>
<down-outlined style="margin-left: 6px" />
</div>
<template #overlay>
<a-menu :selectable="false" @click="onUserDropClick">
<a-menu-item key="profile">
<div class="ele-cell">
<user-outlined />
<div class="ele-cell-content">
{{ t('layout.header.profile') }}
</div>
</div>
</a-menu-item>
<a-menu-item key="password">
<div class="ele-cell">
<key-outlined />
<div class="ele-cell-content">
{{ t('layout.header.password') }}
</div>
</div>
</a-menu-item>
<a-menu-divider />
<a-menu-item key="logout">
<div class="ele-cell">
<logout-outlined />
<div class="ele-cell-content">
{{ t('layout.header.logout') }}
</div>
</div>
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</div>
<!-- 主题设置 -->
<div class="ele-admin-header-tool-item" @click="openSetting">
<more-outlined />
</div>
</div>
<!-- 修改密码弹窗 -->
<password-modal v-model:visible="passwordVisible" />
<!-- 主题设置抽屉 -->
<setting-drawer v-model:visible="settingVisible" />
</template>
<script lang="ts" setup>
import { computed, createVNode, ref } from 'vue';
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { Modal } from 'ant-design-vue/es';
import {
DownOutlined,
MoreOutlined,
UserOutlined,
KeyOutlined,
LogoutOutlined,
ExclamationCircleOutlined,
FullscreenOutlined,
FullscreenExitOutlined
} from '@ant-design/icons-vue';
import { storeToRefs } from 'pinia';
import { useThemeStore } from '@/store/modules/theme';
import HeaderNotice from './header-notice.vue';
import PasswordModal from './password-modal.vue';
import SettingDrawer from './setting-drawer.vue';
// import I18nIcon from './i18n-icon.vue';
import { useUserStore } from '@/store/modules/user';
import { logout } from '@/utils/page-tab-util';
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const emit = defineEmits<{
(e: 'fullscreen'): void;
}>();
defineProps<{
// 是否是全屏
fullscreen: boolean;
}>();
const { push } = useRouter();
const { t } = useI18n();
const userStore = useUserStore();
// 是否显示修改密码弹窗
const passwordVisible = ref(false);
// 是否显示主题设置抽屉
const settingVisible = ref(false);
// 当前用户信息
const loginUser = computed(() => userStore.info ?? {});
/* 用户信息下拉点击 */
const onUserDropClick = ({ key }) => {
if (key === 'password') {
passwordVisible.value = true;
} else if (key === 'profile') {
push('/user/profile');
} else if (key === 'logout') {
// 退出登录
Modal.confirm({
title: t('layout.logout.title'),
content: t('layout.logout.message'),
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
logout();
}
});
}
};
/* 切换全屏 */
const toggleFullscreen = () => {
emit('fullscreen');
};
/* 打开主题设置抽屉 */
const openSetting = () => {
settingVisible.value = true;
};
</script>

View File

@@ -1,11 +1,6 @@
<!-- 顶栏右侧区域 -->
<template>
<div class="ele-admin-header-tool">
<div class="ele-admin-header-tool-item">
<a-button @click="openUrl(`/merchant/account`)">{{
getMerchantName()
}}</a-button>
</div>
<div class="ele-admin-header-tool-item">
<a-tree-select
show-search
@@ -13,15 +8,24 @@
treeDefaultExpandAll
:bordered="bordered"
:tree-data="menuTree"
:placeholder="`搜索...`"
:placeholder="`请输入搜索关键词`"
:value="parentId || undefined"
style="width: 180px"
v-if="menuTree.length"
:dropdown-style="{ maxHeight: '560px', overflow: 'auto' }"
@change="onChange"
>
<template #suffixIcon><SearchOutlined /></template>
</a-tree-select>
</div>
<!-- 商户名称 -->
<template v-if="getMerchantName()">
<div class="ele-admin-header-tool-item">
<a-button @click="openUrl(`/booking/school`)">{{
getMerchantName()
}}</a-button>
</div>
</template>
<!-- <div-->
<!-- class="ele-admin-header-tool-item"-->
<!-- @click="openUrl('https://b.gxwebsoft.com')"-->
@@ -168,7 +172,7 @@
SearchOutlined
} from '@ant-design/icons-vue';
import { storeToRefs } from 'pinia';
import { copyText, getUserId, openNew, openUrl } from '@/utils/common';
import { copyText, openNew, openUrl } from '@/utils/common';
import { useThemeStore } from '@/store/modules/theme';
import HeaderNotice from './header-notice.vue';
import PasswordModal from './password-modal.vue';
@@ -178,7 +182,7 @@
import type { Menu } from '@/api/system/menu/model';
import { listMenus } from '@/api/system/menu';
import { isExternalLink, toTreeData } from 'ele-admin-pro';
import { getMerchantName } from '../../utils/merchant';
import { getMerchantName } from '@/utils/merchant';
// 是否开启响应式布局
const themeStore = useThemeStore();

View File

@@ -43,7 +43,7 @@ const DEFAULT_STATE: ThemeState = Object.freeze({
// 是否开启页签栏
showTabs: true,
// 是否开启页脚
showFooter: false,
showFooter: true,
// 顶栏风格: light(亮色), dark(暗色), primary(主色)
headStyle: 'dark',
// 侧栏风格: light(亮色), dark(暗色)

View File

@@ -1,4 +1,17 @@
// 获取商户ID
export const getMerchantId = () => {
const MerchantId = localStorage.getItem('MerchantId');
if (MerchantId != 'null') {
return MerchantId;
}
return null;
};
// 获取商户名称
export const getMerchantName = () => {
return localStorage.getItem('MerchantName');
const MerchantName = localStorage.getItem('MerchantName');
if (MerchantName != 'null') {
return MerchantName;
}
return null;
};

View File

@@ -26,16 +26,25 @@
@done="chooseMerchantId"
/>
</a-form-item>
<a-form-item label="选择角色" name="roleId">
<SelectRole
:placeholder="`选择角色`"
class="input-item"
:type="`merchant`"
v-model:value="form.roleName"
@done="chooseRoleId"
<a-form-item label="选择角色" name="roles">
<role-select v-model:value="form.roles" />
<!-- <SelectRole-->
<!-- :placeholder="`选择角色`"-->
<!-- class="input-item"-->
<!-- :type="`merchant`"-->
<!-- v-model:value="form.roleName"-->
<!-- @done="chooseRoleId"-->
<!-- />-->
</a-form-item>
<a-form-item label="账号" name="username">
<a-input
allow-clear
placeholder="请输入登录账号"
:disabled="isUpdate"
v-model:value="form.username"
/>
</a-form-item>
<a-form-item label="账号" name="phone">
<a-form-item label="手机号码" name="phone">
<a-input
allow-clear
placeholder="请输入手机号码"
@@ -59,14 +68,6 @@
v-model:value="form.realName"
/>
</a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
</a-form>
</ele-modal>
</template>
@@ -74,20 +75,15 @@
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import {
addMerchantAccount,
updateMerchantAccount
} from '@/api/shop/merchantAccount';
import { MerchantAccount } from '@/api/shop/merchantAccount/model';
import { assignObject } from 'ele-admin-pro';
import { addUser, updateUser } from '@/api/system/user';
import { User } from '@/api/system/user/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
import { DictData } from '@/api/system/dict-data/model';
import { Merchant } from '@/api/shop/merchant/model';
import { FormInstance, RuleObject } from 'ant-design-vue/es/form';
import { Role } from '@/api/system/role/model';
import RoleSelect from './role-select.vue';
//
const isUpdate = ref(false);
@@ -100,7 +96,7 @@
//
visible: boolean;
//
data?: MerchantAccount | null;
data?: User | null;
}>();
const emit = defineEmits<{
@@ -117,20 +113,31 @@
const images = ref<ItemType[]>([]);
//
const form = reactive<MerchantAccount>({
id: undefined,
phone: undefined,
realName: undefined,
merchantId: undefined,
merchantName: '',
const form = reactive<User>({
type: undefined,
userId: undefined,
username: '',
nickname: '',
realName: '',
companyName: '',
merchantId: undefined,
merchantName: undefined,
sex: undefined,
roles: [],
roleId: undefined,
roleName: '',
comments: undefined,
status: undefined,
sortNumber: undefined,
tenantId: undefined,
createTime: undefined
roleName: undefined,
email: '',
phone: '',
mobile: '',
password: '',
introduction: '',
organizationId: undefined,
birthday: '',
idCard: '',
comments: '',
gradeName: '',
isAdmin: true,
gradeId: undefined
});
/* 更新visible */
@@ -156,11 +163,25 @@
trigger: 'blur'
}
],
roleId: [
roles: [
{
required: true,
type: 'number',
type: 'string',
message: '请选择角色',
trigger: 'blur',
validator: async (_rule: RuleObject) => {
if (form.roles?.length == 0) {
return Promise.reject('请选择角色');
}
return Promise.resolve();
}
}
],
username: [
{
required: true,
type: 'string',
message: '请填写登录账号',
trigger: 'blur'
}
],
@@ -191,9 +212,9 @@
});
/* 搜索 */
const chooseMerchantId = (item: Merchant) => {
form.merchantName = item.merchantName;
const chooseMerchantId = (item) => {
form.merchantId = item.merchantId;
form.merchantName = item.merchantName;
};
const chooseRoleId = (item: Role) => {
@@ -215,9 +236,7 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value
? updateMerchantAccount
: addMerchantAccount;
const saveOrUpdate = isUpdate.value ? updateUser : addUser;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -238,6 +257,8 @@
(visible) => {
if (visible) {
images.value = [];
console.log(props.data);
console.log(form);
if (props.data) {
assignObject(form, props.data);
isUpdate.value = true;

View File

@@ -0,0 +1,73 @@
<!-- 角色选择下拉框 -->
<template>
<a-select
allow-clear
mode="multiple"
:value="roleIds"
:placeholder="placeholder"
@update:value="updateValue"
@blur="onBlur"
>
<a-select-option
v-for="item in data"
:key="item.roleId"
:value="item.roleId"
>
{{ item.roleName }}
</a-select-option>
</a-select>
</template>
<script lang="ts" setup>
import { ref, computed } from 'vue';
import { message } from 'ant-design-vue/es';
import { listRoles } from '@/api/system/role';
import type { Role } from '@/api/system/role/model';
const emit = defineEmits<{
(e: 'update:value', value: Role[]): void;
(e: 'blur'): void;
}>();
const props = withDefaults(
defineProps<{
// 选中的角色
value?: Role[];
//
placeholder?: string;
}>(),
{
placeholder: '请选择角色'
}
);
// 选中的角色id
const roleIds = computed(() => props.value?.map((d) => d.roleId as number));
// 角色数据
const data = ref<Role[]>([]);
/* 更新选中数据 */
const updateValue = (value: number[]) => {
emit(
'update:value',
value.map((v) => ({ roleId: v }))
);
};
/* 获取角色数据 */
listRoles()
.then((list) => {
data.value = list.filter(
(d) => d.roleCode == 'merchant' || d.roleCode == 'merchantClerk'
);
})
.catch((e) => {
message.error(e.message);
});
/* 失去焦点 */
const onBlur = () => {
emit('blur');
};
</script>

View File

@@ -24,6 +24,15 @@
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-else-if="column.key === 'roles'">
<a-tag
v-for="item in record.roles"
:key="item.roleId"
color="blue"
>
{{ item.roleName }}
</a-tag>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
@@ -45,7 +54,7 @@
</a-card>
<!-- 编辑弹窗 -->
<MerchantAccountEdit v-model:visible="showEdit" :data="current" @done="reload" />
<Edit v-model:visible="showEdit" :data="current" @done="reload" />
</div>
</div>
</template>
@@ -55,23 +64,23 @@
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import { toDateString } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import MerchantAccountEdit from './components/merchantAccountEdit.vue';
import { pageMerchantAccount, removeMerchantAccount, removeBatchMerchantAccount } from '@/api/shop/merchantAccount';
import type { MerchantAccount, MerchantAccountParam } from '@/api/shop/merchantAccount/model';
import Edit from './components/edit.vue';
import { pageUsers, removeUser, removeUsers } from '@/api/system/user';
import type { User, UserParam } from '@/api/system/user/model';
import { getMerchantId } from "@/utils/common";
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<MerchantAccount[]>([]);
const selection = ref<User[]>([]);
// 当前编辑数据
const current = ref<MerchantAccount | null>(null);
const current = ref<User | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
@@ -90,46 +99,62 @@
if (filters) {
where.status = filters.status;
}
return pageMerchantAccount({
where.isAdmin = true;
where.merchantId = getMerchantId();
return pageUsers({
...where,
...orders,
page,
limit
}).then((res) => {
res?.list.map((d) => {
d.roles = d.roles?.filter(
(m) => m.roleCode == 'merchant' || m.roleCode == 'merchantClerk'
);
return d;
});
return res;
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: 'ID',
dataIndex: 'id',
key: 'id',
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
width: 90,
width: 90
},
{
title: '场馆名称',
dataIndex: 'merchantName',
key: 'merchantName',
align: 'center'
},
{
title: '账号',
dataIndex: 'username',
key: 'username',
align: 'center'
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center',
align: 'center'
},
{
title: '真实姓名',
dataIndex: 'realName',
key: 'realName',
align: 'center',
align: 'center'
},
{
title: '角色',
dataIndex: 'roleName',
key: 'roleName',
align: 'center',
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
align: 'center',
dataIndex: 'roles',
key: 'roles',
align: 'center'
},
{
title: '操作',
@@ -142,13 +167,13 @@
]);
/* 搜索 */
const reload = (where?: MerchantAccountParam) => {
const reload = (where?: UserParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: MerchantAccount) => {
const openEdit = (row?: User) => {
current.value = row ?? null;
showEdit.value = true;
};
@@ -159,9 +184,9 @@
};
/* 删除单个 */
const remove = (row: MerchantAccount) => {
const remove = (row: User) => {
const hide = message.loading('请求中..', 0);
removeMerchantAccount(row.id)
removeUser(row.userId)
.then((msg) => {
hide();
message.success(msg);
@@ -186,7 +211,7 @@
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchMerchantAccount(selection.value.map((d) => d.id))
removeUsers(selection.value.map((d) => d.userId))
.then((msg) => {
hide();
message.success(msg);
@@ -206,7 +231,7 @@
};
/* 自定义行属性 */
const customRow = (record: MerchantAccount) => {
const customRow = (record: User) => {
return {
// 行点击事件
onClick: () => {
@@ -223,7 +248,7 @@
<script lang="ts">
export default {
name: 'MerchantAccount'
name: 'User'
};
</script>

View File

@@ -2,12 +2,12 @@
<div class="ele-body">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-split-layout
width="266px"
allow-collapse
:width="!getMerchantName() ? '266px' : ''"
:allow-collapse="!getMerchantName()"
:right-style="{ overflow: 'hidden' }"
:style="{ minHeight: 'calc(100vh - 152px)' }"
:style="{ minHeight: 'calc(100vh - 252px)' }"
>
<div>
<div v-if="!getMerchantName()">
<ele-toolbar theme="default">
<span class="ele-text-heading">场馆列表</span>
</ele-toolbar>
@@ -70,6 +70,8 @@
import { removeMerchant } from '@/api/shop/merchant';
import { Merchant } from '@/api/shop/merchant/model';
import { listMerchant } from '@/api/shop/merchant';
import { getMerchantId } from '@/utils/common';
import { getMerchantName } from "@/utils/merchant";
// 加载状态
const loading = ref(true);
@@ -95,7 +97,9 @@
/* 查询 */
const query = () => {
loading.value = true;
listMerchant()
listMerchant({
merchantId: getMerchantId()
})
.then((list) => {
loading.value = false;
const eks: number[] = [];

View File

@@ -7,7 +7,7 @@
:datasource="datasource"
v-model:selection="selection"
:customRow="customRow"
height="calc(100vh - 290px)"
height="calc(100vh - 390px)"
tool-class="ele-toolbar-form"
:scroll="{ x: 800 }"
>
@@ -95,6 +95,7 @@
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { Merchant } from '@/api/shop/merchant/model';
import PeriodEdit from './period/index.vue';
import { getMerchantId } from "@/utils/common";
const props = defineProps<{
// 场馆场地 id
@@ -223,6 +224,7 @@
where.sortNumber = filters.sortNumber;
where.status = filters.status;
}
where.merchantId = getMerchantId();
return pageField({
...where,
...orders,

View File

@@ -30,8 +30,8 @@
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openNew(record.adminUrl)">场馆管理端</a>
<a-divider type="vertical" />
<!-- <a @click="openNew(record.adminUrl)">场馆管理端</a>-->
<!-- <a-divider type="vertical" />-->
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
@@ -70,7 +70,7 @@
removeBatchMerchant
} from '@/api/shop/merchant';
import type { Merchant, MerchantParam } from '@/api/shop/merchant/model';
import { openNew } from '@/utils/common';
import { getMerchantId, openNew } from '@/utils/common';
import { useRouter } from 'vue-router';
const { currentRoute } = useRouter();
@@ -99,6 +99,7 @@
if (filters) {
where.status = filters.status;
}
where.merchantId = getMerchantId();
return pageMerchant({
...where,
...orders,
@@ -119,7 +120,7 @@
title: '场馆图片',
dataIndex: 'image',
key: 'image',
align: 'center',
align: 'center'
},
{
title: '场馆名称',

View File

@@ -0,0 +1,53 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-input-search
allow-clear
v-model:value="where.keywords"
placeholder="请输入关键词"
@search="search"
@pressEnter="search"
/>
</a-space>
</template>
<script lang="ts" setup>
import { watch } from 'vue';
import useSearch from '@/utils/use-search';
import { UsersParam } from '@/api/booking/users/model';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: UsersParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const { where } = useSearch<UsersParam>({
keywords: ''
});
/* 搜索 */
const search = () => {
emit('search', where);
};
// 新增
const add = () => {
emit('add');
};
watch(
() => props.selection,
() => {}
);
</script>

View File

@@ -0,0 +1,347 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑用户' : '添加用户'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="用户唯一小程序id" name="openid">
<a-input
allow-clear
placeholder="请输入用户唯一小程序id"
v-model:value="form.openid"
/>
</a-form-item>
<a-form-item label="小程序用户秘钥" name="sessionKey">
<a-input
allow-clear
placeholder="请输入小程序用户秘钥"
v-model:value="form.sessionKey"
/>
</a-form-item>
<a-form-item label="用户名" name="username">
<a-input
allow-clear
placeholder="请输入用户名"
v-model:value="form.username"
/>
</a-form-item>
<a-form-item label="头像地址" name="avatarUrl">
<a-input
allow-clear
placeholder="请输入头像地址"
v-model:value="form.avatarUrl"
/>
</a-form-item>
<a-form-item label="1男2女" name="gender">
<a-input
allow-clear
placeholder="请输入1男2女"
v-model:value="form.gender"
/>
</a-form-item>
<a-form-item label="国家" name="country">
<a-input
allow-clear
placeholder="请输入国家"
v-model:value="form.country"
/>
</a-form-item>
<a-form-item label="省份" name="province">
<a-input
allow-clear
placeholder="请输入省份"
v-model:value="form.province"
/>
</a-form-item>
<a-form-item label="城市" name="city">
<a-input
allow-clear
placeholder="请输入城市"
v-model:value="form.city"
/>
</a-form-item>
<a-form-item label="所在辖区" name="region">
<a-input
allow-clear
placeholder="请输入所在辖区"
v-model:value="form.region"
/>
</a-form-item>
<a-form-item label="手机号码" name="phone">
<a-input
allow-clear
placeholder="请输入手机号码"
v-model:value="form.phone"
/>
</a-form-item>
<a-form-item label="邮箱" name="email">
<a-input
allow-clear
placeholder="请输入邮箱"
v-model:value="form.email"
/>
</a-form-item>
<a-form-item label="邮箱是否验证, 0否, 1是" name="emailVerified">
<a-input
allow-clear
placeholder="请输入邮箱是否验证, 0否, 1是"
v-model:value="form.emailVerified"
/>
</a-form-item>
<a-form-item label="积分" name="points">
<a-input
allow-clear
placeholder="请输入积分"
v-model:value="form.points"
/>
</a-form-item>
<a-form-item label="余额" name="balance">
<a-input
allow-clear
placeholder="请输入余额"
v-model:value="form.balance"
/>
</a-form-item>
<a-form-item label="注册时间" name="addTime">
<a-input
allow-clear
placeholder="请输入注册时间"
v-model:value="form.addTime"
/>
</a-form-item>
<a-form-item label="" name="idcard">
<a-input allow-clear placeholder="请输入" v-model:value="form.idcard" />
</a-form-item>
<a-form-item label="" name="truename">
<a-input
allow-clear
placeholder="请输入"
v-model:value="form.truename"
/>
</a-form-item>
<a-form-item label="是否管理员1是2否" name="isAdmin">
<a-input
allow-clear
placeholder="请输入是否管理员1是2否"
v-model:value="form.isAdmin"
/>
</a-form-item>
<a-form-item label="客户端ID" name="clientId">
<a-input
allow-clear
placeholder="请输入客户端ID"
v-model:value="form.clientId"
/>
</a-form-item>
<a-form-item label="注册来源客户端 (APP、H5、小程序等)" name="platform">
<a-input
allow-clear
placeholder="请输入注册来源客户端 (APP、H5、小程序等)"
v-model:value="form.platform"
/>
</a-form-item>
<a-form-item label="排序" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
/>
</a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
<a-form-item label="状态" name="status">
<a-radio-group v-model:value="form.status">
<a-radio :value="0">显示</a-radio>
<a-radio :value="1">隐藏</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="是否删除, 0否, 1是" name="deleted">
<a-input
allow-clear
placeholder="请输入是否删除, 0否, 1是"
v-model:value="form.deleted"
/>
</a-form-item>
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addUsers, updateUsers } from '@/api/booking/users';
import { Users } from '@/api/booking/users/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: Users | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
// 用户信息
const form = reactive<Users>({
uid: undefined,
openid: undefined,
sessionKey: undefined,
username: undefined,
avatarUrl: undefined,
sex: undefined,
country: undefined,
province: undefined,
city: undefined,
region: undefined,
phone: undefined,
email: undefined,
emailVerified: undefined,
points: undefined,
balance: undefined,
addTime: undefined,
idCard: undefined,
realName: undefined,
isAdmin: undefined,
clientId: undefined,
platform: undefined,
sortNumber: undefined,
comments: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
userName: [
{
required: true,
type: 'string',
message: '请填写用户名称',
trigger: 'blur'
}
]
});
const chooseImage = (data: FileRecord) => {
images.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.avatarUrl = data.path;
};
const onDeleteItem = (index: number) => {
images.value.splice(index, 1);
form.avatarUrl = '';
};
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateUsers : addUsers;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
if (props.data.avatarUrl) {
images.value.push({
uid: uuid(),
url: props.data.avatarUrl,
status: 'done'
});
}
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -0,0 +1,309 @@
<template>
<div class="page">
<div class="ele-body">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="uid"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'avatarUrl'">
<a-avatar
:size="36"
:src="`${record.avatarUrl}`"
style="margin-right: 4px"
>
<template #icon>
<UserOutlined />
</template>
</a-avatar>
</template>
<template v-if="column.key === 'uid'">
{{ record }}
</template>
<template v-if="column.key === 'status'">
{{ record }}
<a-tag v-if="record.status === 1" color="green">启用</a-tag>
<a-tag v-if="record.status === 2" color="red">禁用</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a>积分充值</a>
<a-divider type="vertical" />
<a>分配特殊卡</a>
<!-- <a-popconfirm-->
<!-- title="确定要删除此记录吗?"-->
<!-- @confirm="remove(record)"-->
<!-- >-->
<!-- <a class="ele-text-danger">删除</a>-->
<!-- </a-popconfirm>-->
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<UserEdit v-model:visible="showEdit" :data="current" @done="reload" />
</div>
</div>
</template>
<script lang="ts" setup>
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import {
ExclamationCircleOutlined,
UserOutlined
} from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import { toDateString } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import UserEdit from './components/userEdit.vue';
import {
pageUsers,
removeBatchUsers,
removeUsers
} from '@/api/booking/users';
import type { Users, UsersParam } from '@/api/booking/users/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<Users[]>([]);
// 当前编辑数据
const current = ref<Users | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageUsers({
...where,
...orders,
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: 'ID',
dataIndex: 'uid',
key: 'uid',
width: 90
},
{
title: '头像',
dataIndex: 'avatarUrl',
key: 'avatarUrl',
align: 'center'
},
{
title: '用户名',
dataIndex: 'username',
key: 'username',
align: 'center'
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center'
},
{
title: '性别',
dataIndex: 'sexName',
key: 'sexName',
align: 'center'
},
{
title: '国家',
dataIndex: 'country',
key: 'country',
align: 'center',
hideInTable: true
},
{
title: '省份',
dataIndex: 'province',
key: 'province',
align: 'center'
},
{
title: '城市',
dataIndex: 'city',
key: 'city',
align: 'center'
},
{
title: '所在辖区',
dataIndex: 'region',
key: 'region',
align: 'center',
hideInTable: true
},
{
title: '邮箱是否验证, 0否, 1是',
dataIndex: 'emailVerified',
key: 'emailVerified',
align: 'center',
hideInTable: true
},
{
title: '积分',
dataIndex: 'points',
key: 'points',
align: 'center'
},
{
title: '余额',
dataIndex: 'balance',
key: 'balance',
align: 'center'
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center'
},
{
title: '注册时间',
dataIndex: 'addTime',
key: 'addTime',
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: UsersParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: Users) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: Users) => {
const hide = message.loading('请求中..', 0);
removeUsers(row.uid)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchUsers(selection.value.map((d) => d.uid))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: Users) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'Users'
};
</script>
<style lang="less" scoped></style>

View File

@@ -19,17 +19,19 @@
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="用户唯一小程序id" name="openId">
<a-form-item label="openid" name="openid">
<a-input
allow-clear
placeholder="请输入用户唯一小程序id"
v-model:value="form.openId"
:disabled="true"
v-model:value="form.openid"
/>
</a-form-item>
<a-form-item label="小程序用户秘钥" name="sessionKey">
<a-form-item label="用户秘钥" name="sessionKey">
<a-input
allow-clear
placeholder="请输入小程序用户秘钥"
:disabled="true"
v-model:value="form.sessionKey"
/>
</a-form-item>
@@ -37,6 +39,7 @@
<a-input
allow-clear
placeholder="请输入用户名"
:disabled="true"
v-model:value="form.username"
/>
</a-form-item>
@@ -44,6 +47,7 @@
<a-input
allow-clear
placeholder="请输入头像地址"
:disabled="true"
v-model:value="form.avatarUrl"
/>
</a-form-item>
@@ -51,13 +55,15 @@
<a-input
allow-clear
placeholder="请输入1男2女"
v-model:value="form.gender"
:disabled="true"
v-model:value="form.sex"
/>
</a-form-item>
<a-form-item label="国家" name="country">
<a-input
allow-clear
placeholder="请输入国家"
:disabled="true"
v-model:value="form.country"
/>
</a-form-item>
@@ -65,6 +71,7 @@
<a-input
allow-clear
placeholder="请输入省份"
:disabled="true"
v-model:value="form.province"
/>
</a-form-item>
@@ -72,12 +79,14 @@
<a-input
allow-clear
placeholder="请输入城市"
:disabled="true"
v-model:value="form.city"
/>
</a-form-item>
<a-form-item label="所在辖区" name="region">
<a-input
allow-clear
:disabled="true"
placeholder="请输入所在辖区"
v-model:value="form.region"
/>
@@ -86,6 +95,7 @@
<a-input
allow-clear
placeholder="请输入手机号码"
:disabled="true"
v-model:value="form.phone"
/>
</a-form-item>
@@ -93,19 +103,14 @@
<a-input
allow-clear
placeholder="请输入邮箱"
:disabled="true"
v-model:value="form.email"
/>
</a-form-item>
<a-form-item label="邮箱是否验证, 0否, 1是" name="emailVerified">
<a-input
allow-clear
placeholder="请输入邮箱是否验证, 0否, 1是"
v-model:value="form.emailVerified"
/>
</a-form-item>
<a-form-item label="积分" name="points">
<a-input
allow-clear
:disabled="true"
placeholder="请输入积分"
v-model:value="form.points"
/>
@@ -113,6 +118,7 @@
<a-form-item label="余额" name="balance">
<a-input
allow-clear
:disabled="true"
placeholder="请输入余额"
v-model:value="form.balance"
/>
@@ -121,37 +127,26 @@
<a-input
allow-clear
placeholder="请输入注册时间"
:disabled="true"
v-model:value="form.addTime"
/>
</a-form-item>
<a-form-item label="" name="idcard">
<a-input allow-clear placeholder="请输入" v-model:value="form.idcard" />
<a-form-item label="身份证号码" name="idcard">
<a-input allow-clear placeholder="请输入" :disabled="true" v-model:value="form.idCard" />
</a-form-item>
<a-form-item label="" name="truename">
<a-form-item label="真实姓名" name="realName">
<a-input
allow-clear
placeholder="请输入"
v-model:value="form.truename"
:disabled="true"
v-model:value="form.realName"
/>
</a-form-item>
<a-form-item label="是否管理员1是2否" name="isAdmin">
<a-input
allow-clear
placeholder="请输入是否管理员1是2否"
v-model:value="form.isAdmin"
/>
</a-form-item>
<a-form-item label="客户端ID" name="clientId">
<a-input
allow-clear
placeholder="请输入客户端ID"
v-model:value="form.clientId"
/>
</a-form-item>
<a-form-item label="注册来源客户端 (APP、H5、小程序等)" name="platform">
<a-form-item label="注册来源" name="platform">
<a-input
allow-clear
placeholder="请输入注册来源客户端 (APP、H5、小程序等)"
:disabled="true"
v-model:value="form.platform"
/>
</a-form-item>
@@ -161,6 +156,7 @@
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
:disabled="true"
v-model:value="form.sortNumber"
/>
</a-form-item>
@@ -172,19 +168,6 @@
v-model:value="form.comments"
/>
</a-form-item>
<a-form-item label="状态" name="status">
<a-radio-group v-model:value="form.status">
<a-radio :value="0">显示</a-radio>
<a-radio :value="1">隐藏</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="是否删除, 0否, 1是" name="deleted">
<a-input
allow-clear
placeholder="请输入是否删除, 0否, 1是"
v-model:value="form.deleted"
/>
</a-form-item>
</a-form>
</ele-modal>
</template>
@@ -192,14 +175,15 @@
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addUsers, updateUsers } from '@/api/booking/users';
import { Users } from '@/api/booking/users/model';
import { assignObject, toDateString, uuid } from 'ele-admin-pro';
import { addUsers, updateUsers } from '@/api/shop/users';
import { Users } from '@/api/shop/users/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
import dayjs from 'dayjs';
// 是否是修改
const isUpdate = ref(false);

View File

@@ -4,7 +4,7 @@
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="userId"
row-key="uid"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
@@ -74,12 +74,8 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import UserEdit from './components/userEdit.vue';
import {
pageUsers,
removeBatchUsers,
removeUsers
} from '@/api/booking/users';
import type { Users, UsersParam } from '@/api/booking/users/model';
import { pageUsers, removeBatchUsers, removeUsers } from '@/api/shop/users';
import type { Users, UsersParam } from '@/api/shop/users/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -118,8 +114,8 @@
const columns = ref<ColumnItem[]>([
{
title: 'ID',
dataIndex: 'userId',
key: 'userId',
dataIndex: 'uid',
key: 'uid',
width: 90
},
{
@@ -183,12 +179,14 @@
title: '积分',
dataIndex: 'points',
key: 'points',
sorter: true,
align: 'center'
},
{
title: '余额',
dataIndex: 'balance',
key: 'balance',
sorter: true,
align: 'center'
},
{
@@ -236,7 +234,7 @@
/* 删除单个 */
const remove = (row: Users) => {
const hide = message.loading('请求中..', 0);
removeUsers(row.userId)
removeUsers(row.uid)
.then((msg) => {
hide();
message.success(msg);
@@ -261,7 +259,7 @@
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchUsers(selection.value.map((d) => d.userId))
removeBatchUsers(selection.value.map((d) => d.uid))
.then((msg) => {
hide();
message.success(msg);

View File

@@ -128,6 +128,7 @@
size="large"
:maxlength="6"
allow-clear
@pressEnter="onLoginBySms"
/>
<a-button
class="login-captcha"