适配多商户
This commit is contained in:
106
src/api/booking/userInvoice/index.ts
Normal file
106
src/api/booking/userInvoice/index.ts
Normal 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));
|
||||||
|
}
|
||||||
53
src/api/booking/userInvoice/model/index.ts
Normal file
53
src/api/booking/userInvoice/model/index.ts
Normal 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;
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import type { PageParam } from '@/api';
|
|||||||
*/
|
*/
|
||||||
export interface Users {
|
export interface Users {
|
||||||
//
|
//
|
||||||
userId?: number;
|
uid?: number;
|
||||||
// 用户唯一小程序id
|
// 用户唯一小程序id
|
||||||
openid?: string;
|
openid?: string;
|
||||||
// 小程序用户秘钥
|
// 小程序用户秘钥
|
||||||
@@ -46,6 +46,9 @@ export interface Users {
|
|||||||
realName?: string;
|
realName?: string;
|
||||||
// 是否管理员:1是;2否
|
// 是否管理员:1是;2否
|
||||||
isAdmin?: string;
|
isAdmin?: string;
|
||||||
|
truename?: string;
|
||||||
|
idcard?: string;
|
||||||
|
gender?: string;
|
||||||
// 客户端ID
|
// 客户端ID
|
||||||
clientId?: string;
|
clientId?: string;
|
||||||
// 注册来源客户端 (APP、H5、小程序等)
|
// 注册来源客户端 (APP、H5、小程序等)
|
||||||
@@ -68,6 +71,6 @@ export interface Users {
|
|||||||
* 用户搜索条件
|
* 用户搜索条件
|
||||||
*/
|
*/
|
||||||
export interface UsersParam extends PageParam {
|
export interface UsersParam extends PageParam {
|
||||||
userId?: number;
|
uid?: number;
|
||||||
keywords?: string;
|
keywords?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ export async function loginBySms(data: LoginParam) {
|
|||||||
localStorage.setItem('Phone', String(user.phone));
|
localStorage.setItem('Phone', String(user.phone));
|
||||||
localStorage.setItem('UserId', String(user.userId));
|
localStorage.setItem('UserId', String(user.userId));
|
||||||
localStorage.setItem('MerchantId', String(user.merchantId));
|
localStorage.setItem('MerchantId', String(user.merchantId));
|
||||||
|
localStorage.setItem('MerchantName', String(user.merchantName));
|
||||||
}
|
}
|
||||||
|
|
||||||
return res.data.message;
|
return res.data.message;
|
||||||
|
|||||||
@@ -65,7 +65,9 @@ export interface Merchant {
|
|||||||
roleId?: number;
|
roleId?: number;
|
||||||
roleName?: string;
|
roleName?: string;
|
||||||
label?: string;
|
label?: string;
|
||||||
value?: string;
|
value?: number;
|
||||||
|
key?: number;
|
||||||
|
title?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ export interface User {
|
|||||||
// 角色列表
|
// 角色列表
|
||||||
roles?: Role[];
|
roles?: Role[];
|
||||||
roleCode?: string;
|
roleCode?: string;
|
||||||
|
roleId?: number;
|
||||||
|
roleName?: string;
|
||||||
// 权限列表
|
// 权限列表
|
||||||
authorities?: Menu[];
|
authorities?: Menu[];
|
||||||
payTime?: string;
|
payTime?: string;
|
||||||
@@ -83,6 +85,7 @@ export interface User {
|
|||||||
setting?: string;
|
setting?: string;
|
||||||
realName?: string;
|
realName?: string;
|
||||||
companyName?: string;
|
companyName?: string;
|
||||||
|
merchantName?: string;
|
||||||
gradeName?: string;
|
gradeName?: string;
|
||||||
idCard?: string;
|
idCard?: string;
|
||||||
comments?: string;
|
comments?: string;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
@update:value="updateValue"
|
@update:value="updateValue"
|
||||||
:style="`width: 200px`"
|
:style="`width: 200px`"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
|
@change="onChange"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'update:value', value: string, item: any): void;
|
(e: 'update:value', value: string, item: any): void;
|
||||||
|
(e: 'done', item: Merchant): void;
|
||||||
(e: 'blur'): void;
|
(e: 'blur'): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
@@ -48,11 +50,16 @@
|
|||||||
emit('blur');
|
emit('blur');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onChange = (item: Merchant) => {
|
||||||
|
emit('done', item);
|
||||||
|
};
|
||||||
|
|
||||||
const reload = () => {
|
const reload = () => {
|
||||||
listMerchant({}).then((list) => {
|
listMerchant({}).then((list) => {
|
||||||
options.value = list.map((d) => {
|
options.value = list.map((d) => {
|
||||||
d.label = d.merchantName;
|
d.label = d.merchantName;
|
||||||
d.value = d.merchantCode;
|
d.value = d.merchantId;
|
||||||
|
d.key = d.merchantCode;
|
||||||
return d;
|
return d;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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>
|
|
||||||
@@ -1,11 +1,6 @@
|
|||||||
<!-- 顶栏右侧区域 -->
|
<!-- 顶栏右侧区域 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="ele-admin-header-tool">
|
<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">
|
<div class="ele-admin-header-tool-item">
|
||||||
<a-tree-select
|
<a-tree-select
|
||||||
show-search
|
show-search
|
||||||
@@ -13,15 +8,24 @@
|
|||||||
treeDefaultExpandAll
|
treeDefaultExpandAll
|
||||||
:bordered="bordered"
|
:bordered="bordered"
|
||||||
:tree-data="menuTree"
|
:tree-data="menuTree"
|
||||||
:placeholder="`搜索...`"
|
:placeholder="`请输入搜索关键词`"
|
||||||
:value="parentId || undefined"
|
:value="parentId || undefined"
|
||||||
style="width: 180px"
|
style="width: 180px"
|
||||||
|
v-if="menuTree.length"
|
||||||
:dropdown-style="{ maxHeight: '560px', overflow: 'auto' }"
|
:dropdown-style="{ maxHeight: '560px', overflow: 'auto' }"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
>
|
>
|
||||||
<template #suffixIcon><SearchOutlined /></template>
|
<template #suffixIcon><SearchOutlined /></template>
|
||||||
</a-tree-select>
|
</a-tree-select>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 商户名称 -->
|
||||||
|
<template v-if="getMerchantName()">
|
||||||
|
<div class="ele-admin-header-tool-item">
|
||||||
|
<a-button @click="openUrl(`/booking/school`)">{{
|
||||||
|
getMerchantName()
|
||||||
|
}}</a-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<!-- <div-->
|
<!-- <div-->
|
||||||
<!-- class="ele-admin-header-tool-item"-->
|
<!-- class="ele-admin-header-tool-item"-->
|
||||||
<!-- @click="openUrl('https://b.gxwebsoft.com')"-->
|
<!-- @click="openUrl('https://b.gxwebsoft.com')"-->
|
||||||
@@ -168,7 +172,7 @@
|
|||||||
SearchOutlined
|
SearchOutlined
|
||||||
} from '@ant-design/icons-vue';
|
} from '@ant-design/icons-vue';
|
||||||
import { storeToRefs } from 'pinia';
|
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 { useThemeStore } from '@/store/modules/theme';
|
||||||
import HeaderNotice from './header-notice.vue';
|
import HeaderNotice from './header-notice.vue';
|
||||||
import PasswordModal from './password-modal.vue';
|
import PasswordModal from './password-modal.vue';
|
||||||
@@ -178,7 +182,7 @@
|
|||||||
import type { Menu } from '@/api/system/menu/model';
|
import type { Menu } from '@/api/system/menu/model';
|
||||||
import { listMenus } from '@/api/system/menu';
|
import { listMenus } from '@/api/system/menu';
|
||||||
import { isExternalLink, toTreeData } from 'ele-admin-pro';
|
import { isExternalLink, toTreeData } from 'ele-admin-pro';
|
||||||
import { getMerchantName } from '../../utils/merchant';
|
import { getMerchantName } from '@/utils/merchant';
|
||||||
|
|
||||||
// 是否开启响应式布局
|
// 是否开启响应式布局
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ const DEFAULT_STATE: ThemeState = Object.freeze({
|
|||||||
// 是否开启页签栏
|
// 是否开启页签栏
|
||||||
showTabs: true,
|
showTabs: true,
|
||||||
// 是否开启页脚
|
// 是否开启页脚
|
||||||
showFooter: false,
|
showFooter: true,
|
||||||
// 顶栏风格: light(亮色), dark(暗色), primary(主色)
|
// 顶栏风格: light(亮色), dark(暗色), primary(主色)
|
||||||
headStyle: 'dark',
|
headStyle: 'dark',
|
||||||
// 侧栏风格: light(亮色), dark(暗色)
|
// 侧栏风格: light(亮色), dark(暗色)
|
||||||
|
|||||||
@@ -1,4 +1,17 @@
|
|||||||
|
// 获取商户ID
|
||||||
|
export const getMerchantId = () => {
|
||||||
|
const MerchantId = localStorage.getItem('MerchantId');
|
||||||
|
if (MerchantId != 'null') {
|
||||||
|
return MerchantId;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
// 获取商户名称
|
// 获取商户名称
|
||||||
export const getMerchantName = () => {
|
export const getMerchantName = () => {
|
||||||
return localStorage.getItem('MerchantName');
|
const MerchantName = localStorage.getItem('MerchantName');
|
||||||
|
if (MerchantName != 'null') {
|
||||||
|
return MerchantName;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,16 +26,25 @@
|
|||||||
@done="chooseMerchantId"
|
@done="chooseMerchantId"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="选择角色" name="roleId">
|
<a-form-item label="选择角色" name="roles">
|
||||||
<SelectRole
|
<role-select v-model:value="form.roles" />
|
||||||
:placeholder="`选择角色`"
|
<!-- <SelectRole-->
|
||||||
class="input-item"
|
<!-- :placeholder="`选择角色`"-->
|
||||||
:type="`merchant`"
|
<!-- class="input-item"-->
|
||||||
v-model:value="form.roleName"
|
<!-- :type="`merchant`"-->
|
||||||
@done="chooseRoleId"
|
<!-- 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>
|
||||||
<a-form-item label="账号" name="phone">
|
<a-form-item label="手机号码" name="phone">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入手机号码"
|
placeholder="请输入手机号码"
|
||||||
@@ -59,14 +68,6 @@
|
|||||||
v-model:value="form.realName"
|
v-model:value="form.realName"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</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>
|
</a-form>
|
||||||
</ele-modal>
|
</ele-modal>
|
||||||
</template>
|
</template>
|
||||||
@@ -74,20 +75,15 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import { Form, message } from 'ant-design-vue';
|
import { Form, message } from 'ant-design-vue';
|
||||||
import { assignObject, uuid } from 'ele-admin-pro';
|
import { assignObject } from 'ele-admin-pro';
|
||||||
import {
|
import { addUser, updateUser } from '@/api/system/user';
|
||||||
addMerchantAccount,
|
import { User } from '@/api/system/user/model';
|
||||||
updateMerchantAccount
|
|
||||||
} from '@/api/shop/merchantAccount';
|
|
||||||
import { MerchantAccount } from '@/api/shop/merchantAccount/model';
|
|
||||||
import { useThemeStore } from '@/store/modules/theme';
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
import { FormInstance } from 'ant-design-vue/es/form';
|
import { FormInstance, RuleObject } 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 { Role } from '@/api/system/role/model';
|
import { Role } from '@/api/system/role/model';
|
||||||
|
import RoleSelect from './role-select.vue';
|
||||||
|
|
||||||
// 是否是修改
|
// 是否是修改
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
@@ -100,7 +96,7 @@
|
|||||||
// 弹窗是否打开
|
// 弹窗是否打开
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
// 修改回显的数据
|
// 修改回显的数据
|
||||||
data?: MerchantAccount | null;
|
data?: User | null;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@@ -117,20 +113,31 @@
|
|||||||
const images = ref<ItemType[]>([]);
|
const images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
// 用户信息
|
// 用户信息
|
||||||
const form = reactive<MerchantAccount>({
|
const form = reactive<User>({
|
||||||
id: undefined,
|
type: undefined,
|
||||||
phone: undefined,
|
|
||||||
realName: undefined,
|
|
||||||
merchantId: undefined,
|
|
||||||
merchantName: '',
|
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
|
username: '',
|
||||||
|
nickname: '',
|
||||||
|
realName: '',
|
||||||
|
companyName: '',
|
||||||
|
merchantId: undefined,
|
||||||
|
merchantName: undefined,
|
||||||
|
sex: undefined,
|
||||||
|
roles: [],
|
||||||
roleId: undefined,
|
roleId: undefined,
|
||||||
roleName: '',
|
roleName: undefined,
|
||||||
comments: undefined,
|
email: '',
|
||||||
status: undefined,
|
phone: '',
|
||||||
sortNumber: undefined,
|
mobile: '',
|
||||||
tenantId: undefined,
|
password: '',
|
||||||
createTime: undefined
|
introduction: '',
|
||||||
|
organizationId: undefined,
|
||||||
|
birthday: '',
|
||||||
|
idCard: '',
|
||||||
|
comments: '',
|
||||||
|
gradeName: '',
|
||||||
|
isAdmin: true,
|
||||||
|
gradeId: undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
/* 更新visible */
|
/* 更新visible */
|
||||||
@@ -156,11 +163,25 @@
|
|||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
roleId: [
|
roles: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
type: 'number',
|
type: 'string',
|
||||||
message: '请选择角色',
|
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'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -191,9 +212,9 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
/* 搜索 */
|
/* 搜索 */
|
||||||
const chooseMerchantId = (item: Merchant) => {
|
const chooseMerchantId = (item) => {
|
||||||
form.merchantName = item.merchantName;
|
|
||||||
form.merchantId = item.merchantId;
|
form.merchantId = item.merchantId;
|
||||||
|
form.merchantName = item.merchantName;
|
||||||
};
|
};
|
||||||
|
|
||||||
const chooseRoleId = (item: Role) => {
|
const chooseRoleId = (item: Role) => {
|
||||||
@@ -215,9 +236,7 @@
|
|||||||
const formData = {
|
const formData = {
|
||||||
...form
|
...form
|
||||||
};
|
};
|
||||||
const saveOrUpdate = isUpdate.value
|
const saveOrUpdate = isUpdate.value ? updateUser : addUser;
|
||||||
? updateMerchantAccount
|
|
||||||
: addMerchantAccount;
|
|
||||||
saveOrUpdate(formData)
|
saveOrUpdate(formData)
|
||||||
.then((msg) => {
|
.then((msg) => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
@@ -238,6 +257,8 @@
|
|||||||
(visible) => {
|
(visible) => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
images.value = [];
|
images.value = [];
|
||||||
|
console.log(props.data);
|
||||||
|
console.log(form);
|
||||||
if (props.data) {
|
if (props.data) {
|
||||||
assignObject(form, props.data);
|
assignObject(form, props.data);
|
||||||
isUpdate.value = true;
|
isUpdate.value = true;
|
||||||
73
src/views/booking/account/components/role-select.vue
Normal file
73
src/views/booking/account/components/role-select.vue
Normal 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>
|
||||||
@@ -24,6 +24,15 @@
|
|||||||
<template v-if="column.key === 'image'">
|
<template v-if="column.key === 'image'">
|
||||||
<a-image :src="record.image" :width="50" />
|
<a-image :src="record.image" :width="50" />
|
||||||
</template>
|
</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'">
|
<template v-if="column.key === 'status'">
|
||||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
@@ -45,7 +54,7 @@
|
|||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<MerchantAccountEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
<Edit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -55,23 +64,23 @@
|
|||||||
import { message, Modal } from 'ant-design-vue';
|
import { message, Modal } from 'ant-design-vue';
|
||||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
import type { EleProTable } from 'ele-admin-pro';
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
import { toDateString } from 'ele-admin-pro';
|
|
||||||
import type {
|
import type {
|
||||||
DatasourceFunction,
|
DatasourceFunction,
|
||||||
ColumnItem
|
ColumnItem
|
||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
import MerchantAccountEdit from './components/merchantAccountEdit.vue';
|
import Edit from './components/edit.vue';
|
||||||
import { pageMerchantAccount, removeMerchantAccount, removeBatchMerchantAccount } from '@/api/shop/merchantAccount';
|
import { pageUsers, removeUser, removeUsers } from '@/api/system/user';
|
||||||
import type { MerchantAccount, MerchantAccountParam } from '@/api/shop/merchantAccount/model';
|
import type { User, UserParam } from '@/api/system/user/model';
|
||||||
|
import { getMerchantId } from "@/utils/common";
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
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);
|
const showEdit = ref(false);
|
||||||
// 是否显示批量移动弹窗
|
// 是否显示批量移动弹窗
|
||||||
@@ -90,46 +99,62 @@
|
|||||||
if (filters) {
|
if (filters) {
|
||||||
where.status = filters.status;
|
where.status = filters.status;
|
||||||
}
|
}
|
||||||
return pageMerchantAccount({
|
where.isAdmin = true;
|
||||||
|
where.merchantId = getMerchantId();
|
||||||
|
return pageUsers({
|
||||||
...where,
|
...where,
|
||||||
...orders,
|
...orders,
|
||||||
page,
|
page,
|
||||||
limit
|
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[]>([
|
const columns = ref<ColumnItem[]>([
|
||||||
{
|
{
|
||||||
title: 'ID',
|
title: '用户ID',
|
||||||
dataIndex: 'id',
|
dataIndex: 'userId',
|
||||||
key: 'id',
|
key: 'userId',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 90,
|
width: 90
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '场馆名称',
|
||||||
|
dataIndex: 'merchantName',
|
||||||
|
key: 'merchantName',
|
||||||
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '账号',
|
title: '账号',
|
||||||
|
dataIndex: 'username',
|
||||||
|
key: 'username',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '手机号码',
|
||||||
dataIndex: 'phone',
|
dataIndex: 'phone',
|
||||||
key: 'phone',
|
key: 'phone',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '真实姓名',
|
title: '真实姓名',
|
||||||
dataIndex: 'realName',
|
dataIndex: 'realName',
|
||||||
key: 'realName',
|
key: 'realName',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '角色',
|
title: '角色',
|
||||||
dataIndex: 'roleName',
|
dataIndex: 'roles',
|
||||||
key: 'roleName',
|
key: 'roles',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '备注',
|
|
||||||
dataIndex: 'comments',
|
|
||||||
key: 'comments',
|
|
||||||
align: 'center',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
@@ -142,13 +167,13 @@
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
/* 搜索 */
|
/* 搜索 */
|
||||||
const reload = (where?: MerchantAccountParam) => {
|
const reload = (where?: UserParam) => {
|
||||||
selection.value = [];
|
selection.value = [];
|
||||||
tableRef?.value?.reload({ where: where });
|
tableRef?.value?.reload({ where: where });
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 打开编辑弹窗 */
|
/* 打开编辑弹窗 */
|
||||||
const openEdit = (row?: MerchantAccount) => {
|
const openEdit = (row?: User) => {
|
||||||
current.value = row ?? null;
|
current.value = row ?? null;
|
||||||
showEdit.value = true;
|
showEdit.value = true;
|
||||||
};
|
};
|
||||||
@@ -159,9 +184,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* 删除单个 */
|
/* 删除单个 */
|
||||||
const remove = (row: MerchantAccount) => {
|
const remove = (row: User) => {
|
||||||
const hide = message.loading('请求中..', 0);
|
const hide = message.loading('请求中..', 0);
|
||||||
removeMerchantAccount(row.id)
|
removeUser(row.userId)
|
||||||
.then((msg) => {
|
.then((msg) => {
|
||||||
hide();
|
hide();
|
||||||
message.success(msg);
|
message.success(msg);
|
||||||
@@ -186,7 +211,7 @@
|
|||||||
maskClosable: true,
|
maskClosable: true,
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
const hide = message.loading('请求中..', 0);
|
const hide = message.loading('请求中..', 0);
|
||||||
removeBatchMerchantAccount(selection.value.map((d) => d.id))
|
removeUsers(selection.value.map((d) => d.userId))
|
||||||
.then((msg) => {
|
.then((msg) => {
|
||||||
hide();
|
hide();
|
||||||
message.success(msg);
|
message.success(msg);
|
||||||
@@ -206,7 +231,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* 自定义行属性 */
|
/* 自定义行属性 */
|
||||||
const customRow = (record: MerchantAccount) => {
|
const customRow = (record: User) => {
|
||||||
return {
|
return {
|
||||||
// 行点击事件
|
// 行点击事件
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@@ -223,7 +248,7 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export default {
|
export default {
|
||||||
name: 'MerchantAccount'
|
name: 'User'
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
<div class="ele-body">
|
<div class="ele-body">
|
||||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
<ele-split-layout
|
<ele-split-layout
|
||||||
width="266px"
|
:width="!getMerchantName() ? '266px' : ''"
|
||||||
allow-collapse
|
:allow-collapse="!getMerchantName()"
|
||||||
:right-style="{ overflow: 'hidden' }"
|
:right-style="{ overflow: 'hidden' }"
|
||||||
:style="{ minHeight: 'calc(100vh - 152px)' }"
|
:style="{ minHeight: 'calc(100vh - 252px)' }"
|
||||||
>
|
>
|
||||||
<div>
|
<div v-if="!getMerchantName()">
|
||||||
<ele-toolbar theme="default">
|
<ele-toolbar theme="default">
|
||||||
<span class="ele-text-heading">场馆列表</span>
|
<span class="ele-text-heading">场馆列表</span>
|
||||||
</ele-toolbar>
|
</ele-toolbar>
|
||||||
@@ -70,6 +70,8 @@
|
|||||||
import { removeMerchant } from '@/api/shop/merchant';
|
import { removeMerchant } from '@/api/shop/merchant';
|
||||||
import { Merchant } from '@/api/shop/merchant/model';
|
import { Merchant } from '@/api/shop/merchant/model';
|
||||||
import { listMerchant } from '@/api/shop/merchant';
|
import { listMerchant } from '@/api/shop/merchant';
|
||||||
|
import { getMerchantId } from '@/utils/common';
|
||||||
|
import { getMerchantName } from "@/utils/merchant";
|
||||||
|
|
||||||
// 加载状态
|
// 加载状态
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
@@ -95,7 +97,9 @@
|
|||||||
/* 查询 */
|
/* 查询 */
|
||||||
const query = () => {
|
const query = () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
listMerchant()
|
listMerchant({
|
||||||
|
merchantId: getMerchantId()
|
||||||
|
})
|
||||||
.then((list) => {
|
.then((list) => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
const eks: number[] = [];
|
const eks: number[] = [];
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
:datasource="datasource"
|
:datasource="datasource"
|
||||||
v-model:selection="selection"
|
v-model:selection="selection"
|
||||||
:customRow="customRow"
|
:customRow="customRow"
|
||||||
height="calc(100vh - 290px)"
|
height="calc(100vh - 390px)"
|
||||||
tool-class="ele-toolbar-form"
|
tool-class="ele-toolbar-form"
|
||||||
:scroll="{ x: 800 }"
|
:scroll="{ x: 800 }"
|
||||||
>
|
>
|
||||||
@@ -95,6 +95,7 @@
|
|||||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
import { Merchant } from '@/api/shop/merchant/model';
|
import { Merchant } from '@/api/shop/merchant/model';
|
||||||
import PeriodEdit from './period/index.vue';
|
import PeriodEdit from './period/index.vue';
|
||||||
|
import { getMerchantId } from "@/utils/common";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
// 场馆场地 id
|
// 场馆场地 id
|
||||||
@@ -223,6 +224,7 @@
|
|||||||
where.sortNumber = filters.sortNumber;
|
where.sortNumber = filters.sortNumber;
|
||||||
where.status = filters.status;
|
where.status = filters.status;
|
||||||
}
|
}
|
||||||
|
where.merchantId = getMerchantId();
|
||||||
return pageField({
|
return pageField({
|
||||||
...where,
|
...where,
|
||||||
...orders,
|
...orders,
|
||||||
|
|||||||
@@ -30,8 +30,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a @click="openNew(record.adminUrl)">场馆管理端</a>
|
<!-- <a @click="openNew(record.adminUrl)">场馆管理端</a>-->
|
||||||
<a-divider type="vertical" />
|
<!-- <a-divider type="vertical" />-->
|
||||||
<a @click="openEdit(record)">修改</a>
|
<a @click="openEdit(record)">修改</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
removeBatchMerchant
|
removeBatchMerchant
|
||||||
} from '@/api/shop/merchant';
|
} from '@/api/shop/merchant';
|
||||||
import type { Merchant, MerchantParam } from '@/api/shop/merchant/model';
|
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';
|
import { useRouter } from 'vue-router';
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
|
|
||||||
@@ -99,6 +99,7 @@
|
|||||||
if (filters) {
|
if (filters) {
|
||||||
where.status = filters.status;
|
where.status = filters.status;
|
||||||
}
|
}
|
||||||
|
where.merchantId = getMerchantId();
|
||||||
return pageMerchant({
|
return pageMerchant({
|
||||||
...where,
|
...where,
|
||||||
...orders,
|
...orders,
|
||||||
@@ -119,7 +120,7 @@
|
|||||||
title: '场馆图片',
|
title: '场馆图片',
|
||||||
dataIndex: 'image',
|
dataIndex: 'image',
|
||||||
key: 'image',
|
key: 'image',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '场馆名称',
|
title: '场馆名称',
|
||||||
|
|||||||
53
src/views/booking/users.bak/components/search.vue
Normal file
53
src/views/booking/users.bak/components/search.vue
Normal 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>
|
||||||
347
src/views/booking/users.bak/components/userEdit.vue
Normal file
347
src/views/booking/users.bak/components/userEdit.vue
Normal 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>
|
||||||
309
src/views/booking/users.bak/index.vue
Normal file
309
src/views/booking/users.bak/index.vue
Normal 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>
|
||||||
@@ -19,17 +19,19 @@
|
|||||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
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
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入用户唯一小程序id"
|
placeholder="请输入用户唯一小程序id"
|
||||||
v-model:value="form.openId"
|
:disabled="true"
|
||||||
|
v-model:value="form.openid"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="小程序用户秘钥" name="sessionKey">
|
<a-form-item label="用户秘钥" name="sessionKey">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入小程序用户秘钥"
|
placeholder="请输入小程序用户秘钥"
|
||||||
|
:disabled="true"
|
||||||
v-model:value="form.sessionKey"
|
v-model:value="form.sessionKey"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -37,6 +39,7 @@
|
|||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入用户名"
|
placeholder="请输入用户名"
|
||||||
|
:disabled="true"
|
||||||
v-model:value="form.username"
|
v-model:value="form.username"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -44,6 +47,7 @@
|
|||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入头像地址"
|
placeholder="请输入头像地址"
|
||||||
|
:disabled="true"
|
||||||
v-model:value="form.avatarUrl"
|
v-model:value="form.avatarUrl"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -51,13 +55,15 @@
|
|||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入1男,2女"
|
placeholder="请输入1男,2女"
|
||||||
v-model:value="form.gender"
|
:disabled="true"
|
||||||
|
v-model:value="form.sex"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="国家" name="country">
|
<a-form-item label="国家" name="country">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入国家"
|
placeholder="请输入国家"
|
||||||
|
:disabled="true"
|
||||||
v-model:value="form.country"
|
v-model:value="form.country"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -65,6 +71,7 @@
|
|||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入省份"
|
placeholder="请输入省份"
|
||||||
|
:disabled="true"
|
||||||
v-model:value="form.province"
|
v-model:value="form.province"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -72,12 +79,14 @@
|
|||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入城市"
|
placeholder="请输入城市"
|
||||||
|
:disabled="true"
|
||||||
v-model:value="form.city"
|
v-model:value="form.city"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="所在辖区" name="region">
|
<a-form-item label="所在辖区" name="region">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
|
:disabled="true"
|
||||||
placeholder="请输入所在辖区"
|
placeholder="请输入所在辖区"
|
||||||
v-model:value="form.region"
|
v-model:value="form.region"
|
||||||
/>
|
/>
|
||||||
@@ -86,6 +95,7 @@
|
|||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入手机号码"
|
placeholder="请输入手机号码"
|
||||||
|
:disabled="true"
|
||||||
v-model:value="form.phone"
|
v-model:value="form.phone"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -93,19 +103,14 @@
|
|||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入邮箱"
|
placeholder="请输入邮箱"
|
||||||
|
:disabled="true"
|
||||||
v-model:value="form.email"
|
v-model:value="form.email"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</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-form-item label="积分" name="points">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
|
:disabled="true"
|
||||||
placeholder="请输入积分"
|
placeholder="请输入积分"
|
||||||
v-model:value="form.points"
|
v-model:value="form.points"
|
||||||
/>
|
/>
|
||||||
@@ -113,6 +118,7 @@
|
|||||||
<a-form-item label="余额" name="balance">
|
<a-form-item label="余额" name="balance">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
|
:disabled="true"
|
||||||
placeholder="请输入余额"
|
placeholder="请输入余额"
|
||||||
v-model:value="form.balance"
|
v-model:value="form.balance"
|
||||||
/>
|
/>
|
||||||
@@ -121,37 +127,26 @@
|
|||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入注册时间"
|
placeholder="请输入注册时间"
|
||||||
|
:disabled="true"
|
||||||
v-model:value="form.addTime"
|
v-model:value="form.addTime"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="" name="idcard">
|
<a-form-item label="身份证号码" name="idcard">
|
||||||
<a-input allow-clear placeholder="请输入" v-model:value="form.idcard" />
|
<a-input allow-clear placeholder="请输入" :disabled="true" v-model:value="form.idCard" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="" name="truename">
|
<a-form-item label="真实姓名" name="realName">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
v-model:value="form.truename"
|
:disabled="true"
|
||||||
|
v-model:value="form.realName"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="是否管理员:1是;2否" name="isAdmin">
|
<a-form-item label="注册来源" name="platform">
|
||||||
<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
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入注册来源客户端 (APP、H5、小程序等)"
|
placeholder="请输入注册来源客户端 (APP、H5、小程序等)"
|
||||||
|
:disabled="true"
|
||||||
v-model:value="form.platform"
|
v-model:value="form.platform"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -161,6 +156,7 @@
|
|||||||
:max="9999"
|
:max="9999"
|
||||||
class="ele-fluid"
|
class="ele-fluid"
|
||||||
placeholder="请输入排序号"
|
placeholder="请输入排序号"
|
||||||
|
:disabled="true"
|
||||||
v-model:value="form.sortNumber"
|
v-model:value="form.sortNumber"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -172,19 +168,6 @@
|
|||||||
v-model:value="form.comments"
|
v-model:value="form.comments"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</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>
|
</a-form>
|
||||||
</ele-modal>
|
</ele-modal>
|
||||||
</template>
|
</template>
|
||||||
@@ -192,14 +175,15 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import { Form, message } from 'ant-design-vue';
|
import { Form, message } from 'ant-design-vue';
|
||||||
import { assignObject, uuid } from 'ele-admin-pro';
|
import { assignObject, toDateString, uuid } from 'ele-admin-pro';
|
||||||
import { addUsers, updateUsers } from '@/api/booking/users';
|
import { addUsers, updateUsers } from '@/api/shop/users';
|
||||||
import { Users } from '@/api/booking/users/model';
|
import { Users } from '@/api/shop/users/model';
|
||||||
import { useThemeStore } from '@/store/modules/theme';
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
import { FormInstance } from 'ant-design-vue/es/form';
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
import { FileRecord } from '@/api/system/file/model';
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
// 是否是修改
|
// 是否是修改
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
<ele-pro-table
|
<ele-pro-table
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
row-key="userId"
|
row-key="uid"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:datasource="datasource"
|
:datasource="datasource"
|
||||||
:customRow="customRow"
|
:customRow="customRow"
|
||||||
@@ -74,12 +74,8 @@
|
|||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
import UserEdit from './components/userEdit.vue';
|
import UserEdit from './components/userEdit.vue';
|
||||||
import {
|
import { pageUsers, removeBatchUsers, removeUsers } from '@/api/shop/users';
|
||||||
pageUsers,
|
import type { Users, UsersParam } from '@/api/shop/users/model';
|
||||||
removeBatchUsers,
|
|
||||||
removeUsers
|
|
||||||
} from '@/api/booking/users';
|
|
||||||
import type { Users, UsersParam } from '@/api/booking/users/model';
|
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -118,8 +114,8 @@
|
|||||||
const columns = ref<ColumnItem[]>([
|
const columns = ref<ColumnItem[]>([
|
||||||
{
|
{
|
||||||
title: 'ID',
|
title: 'ID',
|
||||||
dataIndex: 'userId',
|
dataIndex: 'uid',
|
||||||
key: 'userId',
|
key: 'uid',
|
||||||
width: 90
|
width: 90
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -183,12 +179,14 @@
|
|||||||
title: '积分',
|
title: '积分',
|
||||||
dataIndex: 'points',
|
dataIndex: 'points',
|
||||||
key: 'points',
|
key: 'points',
|
||||||
|
sorter: true,
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '余额',
|
title: '余额',
|
||||||
dataIndex: 'balance',
|
dataIndex: 'balance',
|
||||||
key: 'balance',
|
key: 'balance',
|
||||||
|
sorter: true,
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -236,7 +234,7 @@
|
|||||||
/* 删除单个 */
|
/* 删除单个 */
|
||||||
const remove = (row: Users) => {
|
const remove = (row: Users) => {
|
||||||
const hide = message.loading('请求中..', 0);
|
const hide = message.loading('请求中..', 0);
|
||||||
removeUsers(row.userId)
|
removeUsers(row.uid)
|
||||||
.then((msg) => {
|
.then((msg) => {
|
||||||
hide();
|
hide();
|
||||||
message.success(msg);
|
message.success(msg);
|
||||||
@@ -261,7 +259,7 @@
|
|||||||
maskClosable: true,
|
maskClosable: true,
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
const hide = message.loading('请求中..', 0);
|
const hide = message.loading('请求中..', 0);
|
||||||
removeBatchUsers(selection.value.map((d) => d.userId))
|
removeBatchUsers(selection.value.map((d) => d.uid))
|
||||||
.then((msg) => {
|
.then((msg) => {
|
||||||
hide();
|
hide();
|
||||||
message.success(msg);
|
message.success(msg);
|
||||||
|
|||||||
@@ -128,6 +128,7 @@
|
|||||||
size="large"
|
size="large"
|
||||||
:maxlength="6"
|
:maxlength="6"
|
||||||
allow-clear
|
allow-clear
|
||||||
|
@pressEnter="onLoginBySms"
|
||||||
/>
|
/>
|
||||||
<a-button
|
<a-button
|
||||||
class="login-captcha"
|
class="login-captcha"
|
||||||
|
|||||||
Reference in New Issue
Block a user