feat: ai 联调
This commit is contained in:
@@ -8,6 +8,8 @@ import styles from './BlacklistAddModal.module.less';
|
||||
interface BlacklistAddModalProps {
|
||||
visible: boolean;
|
||||
submitting: boolean;
|
||||
/** 预设用户信息(从列表行「再次拉黑」带入时使用) */
|
||||
presetUser?: { userId: string; phone?: string; nickname?: string };
|
||||
onClose: () => void;
|
||||
onSubmit: (params: AiBlacklistAddParams) => void;
|
||||
}
|
||||
@@ -27,12 +29,13 @@ export default defineComponent({
|
||||
props: {
|
||||
visible: { type: Boolean, default: false },
|
||||
submitting: { type: Boolean, default: false },
|
||||
presetUser: { type: Object, default: undefined },
|
||||
onClose: { type: Function, default: null },
|
||||
onSubmit: { type: Function, default: null },
|
||||
},
|
||||
setup(props: BlacklistAddModalProps) {
|
||||
const form = reactive({
|
||||
userId: undefined as number | undefined,
|
||||
userId: undefined as string | undefined,
|
||||
reason: '',
|
||||
expireDate: null as Dayjs | null,
|
||||
});
|
||||
@@ -40,21 +43,33 @@ export default defineComponent({
|
||||
// 用户搜索
|
||||
const userSearch = useUserSearch();
|
||||
|
||||
// 弹窗打开时重置表单
|
||||
// 弹窗打开时重置表单 / 回填预设用户
|
||||
// immediate: true 配合 destroyOnClose,组件重建后 visible 已为 true 时也能立即回填
|
||||
watch(
|
||||
() => props.visible,
|
||||
(val) => {
|
||||
if (val) {
|
||||
form.userId = undefined;
|
||||
form.reason = '';
|
||||
form.expireDate = null;
|
||||
userSearch.reset();
|
||||
if (props.presetUser) {
|
||||
// 从列表行「再次拉黑」带入:回填 userId 并锁定
|
||||
form.userId = props.presetUser.userId;
|
||||
userSearch.setPresetUser({
|
||||
userId: props.presetUser.userId,
|
||||
phone: props.presetUser.phone,
|
||||
nickname: props.presetUser.nickname,
|
||||
});
|
||||
} else {
|
||||
form.userId = undefined;
|
||||
}
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
const handleSubmit = () => {
|
||||
if (!form.userId || form.userId <= 0) {
|
||||
if (!form.userId) {
|
||||
message.warning('请搜索并选择用户');
|
||||
return;
|
||||
}
|
||||
@@ -99,14 +114,15 @@ export default defineComponent({
|
||||
<Select
|
||||
showSearch
|
||||
value={form.userId ? String(form.userId) : undefined}
|
||||
placeholder="输入手机号搜索用户"
|
||||
placeholder="输入手机号或用户ID搜索"
|
||||
filterOption={false}
|
||||
loading={userSearch.searching.value}
|
||||
options={userSearch.options.value as any}
|
||||
disabled={!!props.presetUser}
|
||||
style={{ width: '100%' }}
|
||||
onSearch={userSearch.onSearch}
|
||||
onChange={(val: any) => {
|
||||
form.userId = val ? Number(val) : undefined;
|
||||
form.userId = val ? String(val) : undefined;
|
||||
}}
|
||||
allowClear
|
||||
notFoundContent={
|
||||
@@ -114,10 +130,12 @@ export default defineComponent({
|
||||
? '搜索中...'
|
||||
: userSearch.keyword.value
|
||||
? '无匹配用户'
|
||||
: '请输入手机号搜索'
|
||||
: '请输入手机号或用户ID搜索'
|
||||
}
|
||||
/>
|
||||
<div class={styles.tip}>搜索手机号选择需要拉黑的用户,展示手机号,传用户ID给后端</div>
|
||||
<div class={styles.tip}>
|
||||
搜索手机号或用户ID选择需要拉黑的用户,展示手机号,传用户ID给后端
|
||||
</div>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="拉黑原因" required>
|
||||
|
||||
@@ -26,10 +26,12 @@ export default defineComponent({
|
||||
pagination,
|
||||
addModalVisible,
|
||||
submitting,
|
||||
presetUser,
|
||||
handleSearch,
|
||||
handleReset,
|
||||
handlePageChange,
|
||||
openAddModal,
|
||||
openAddModalWithRecord,
|
||||
closeAddModal,
|
||||
handleSubmitAdd,
|
||||
handleRemove,
|
||||
@@ -49,14 +51,18 @@ export default defineComponent({
|
||||
|
||||
/** 渲染操作列 */
|
||||
const renderAction = (record: AiBlacklistVO) => {
|
||||
if (record.status === 1) {
|
||||
if (record.status == 1) {
|
||||
return (
|
||||
<Button type="link" size="small" danger onClick={() => handleRemove(record)}>
|
||||
解除拉黑
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
return <span style={{ color: '#999' }}>-</span>;
|
||||
return (
|
||||
<Button type="link" size="small" danger onClick={() => openAddModalWithRecord(record)}>
|
||||
再次拉黑
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
||||
/** 完整表格列 */
|
||||
@@ -65,7 +71,7 @@ export default defineComponent({
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 100,
|
||||
width: 120,
|
||||
fixed: 'right' as const,
|
||||
align: 'center' as const,
|
||||
},
|
||||
@@ -78,7 +84,7 @@ export default defineComponent({
|
||||
<Select
|
||||
showSearch
|
||||
value={filterForm.userId ? String(filterForm.userId) : undefined}
|
||||
placeholder="手机号搜索用户"
|
||||
placeholder="手机号或用户ID搜索用户"
|
||||
filterOption={false}
|
||||
loading={userSearch.searching.value}
|
||||
options={userSearch.options.value as any}
|
||||
@@ -93,7 +99,7 @@ export default defineComponent({
|
||||
? '搜索中...'
|
||||
: userSearch.keyword.value
|
||||
? '无匹配用户'
|
||||
: '输入手机号搜索'
|
||||
: '输入手机号或用户ID搜索'
|
||||
}
|
||||
/>
|
||||
<Select
|
||||
@@ -152,6 +158,7 @@ export default defineComponent({
|
||||
<BlacklistAddModal
|
||||
visible={addModalVisible.value}
|
||||
submitting={submitting.value}
|
||||
presetUser={presetUser.value}
|
||||
onClose={closeAddModal}
|
||||
onSubmit={handleSubmitAdd}
|
||||
/>
|
||||
|
||||
@@ -10,7 +10,7 @@ interface PointsAdjustModalProps {
|
||||
visible: boolean;
|
||||
submitting: boolean;
|
||||
/** 预设用户信息(从账户行点击调点时带入) */
|
||||
presetUser?: { userId: number; phone?: string; nickname?: string };
|
||||
presetUser?: { userId: string; phone?: string; nickname?: string };
|
||||
onClose: () => void;
|
||||
onSubmit: (params: AiPointsAdjustParams) => void;
|
||||
}
|
||||
@@ -37,7 +37,7 @@ export default defineComponent({
|
||||
},
|
||||
setup(props: PointsAdjustModalProps) {
|
||||
const form = reactive({
|
||||
userId: undefined as number | undefined,
|
||||
userId: undefined as string | undefined,
|
||||
points: undefined as number | undefined,
|
||||
type: 1 as number,
|
||||
descr: '',
|
||||
@@ -60,7 +60,7 @@ export default defineComponent({
|
||||
}, [() => props.visible]);
|
||||
|
||||
const handleSubmit = () => {
|
||||
if (!form.userId || form.userId <= 0) {
|
||||
if (!form.userId) {
|
||||
message.warning('请搜索并选择用户');
|
||||
return;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ export default defineComponent({
|
||||
<Select
|
||||
showSearch
|
||||
value={form.userId ? String(form.userId) : undefined}
|
||||
placeholder="输入手机号搜索用户"
|
||||
placeholder="输入手机号或用户ID搜索"
|
||||
filterOption={false}
|
||||
loading={userSearch.searching.value}
|
||||
options={userSearch.options.value as any}
|
||||
@@ -105,7 +105,7 @@ export default defineComponent({
|
||||
style={{ width: '100%' }}
|
||||
onSearch={userSearch.onSearch}
|
||||
onChange={(val: any) => {
|
||||
form.userId = val ? Number(val) : undefined;
|
||||
form.userId = val ? String(val) : undefined;
|
||||
}}
|
||||
allowClear
|
||||
notFoundContent={
|
||||
@@ -113,11 +113,11 @@ export default defineComponent({
|
||||
? '搜索中...'
|
||||
: userSearch.keyword.value
|
||||
? '无匹配用户'
|
||||
: '请输入手机号搜索'
|
||||
: '请输入手机号或用户ID搜索'
|
||||
}
|
||||
/>
|
||||
<div class={styles.tip}>
|
||||
搜索手机号选择用户,展示手机号,传用户ID给后端;目标用户无账户时系统自动建户
|
||||
搜索手机号或用户ID选择用户,展示手机号,传用户ID给后端;目标用户无账户时系统自动建户
|
||||
</div>
|
||||
</Form.Item>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import PointsAdjustModal from './PointsAdjustModal';
|
||||
|
||||
/** 用户搜索 Select 的 notFoundContent 公共渲染 */
|
||||
const renderNotFound = (searching: boolean, keyword: string) =>
|
||||
searching ? '搜索中...' : keyword ? '无匹配用户' : '输入手机号搜索';
|
||||
searching ? '搜索中...' : keyword ? '无匹配用户' : '输入手机号或用户ID搜索';
|
||||
|
||||
/** 分页组件公共配置 */
|
||||
const paginationProps = {
|
||||
@@ -169,7 +169,7 @@ export default defineComponent({
|
||||
<Select
|
||||
showSearch
|
||||
value={accountFilter.userId ? String(accountFilter.userId) : undefined}
|
||||
placeholder="手机号搜索用户"
|
||||
placeholder="手机号或用户ID搜索用户"
|
||||
filterOption={false}
|
||||
loading={accountSearch.searching.value}
|
||||
options={accountSearch.options.value as any}
|
||||
@@ -194,7 +194,7 @@ export default defineComponent({
|
||||
<Select
|
||||
showSearch
|
||||
value={txnFilter.userId ? String(txnFilter.userId) : undefined}
|
||||
placeholder="手机号搜索用户"
|
||||
placeholder="手机号或用户ID搜索用户"
|
||||
filterOption={false}
|
||||
loading={txnSearch.searching.value}
|
||||
options={txnSearch.options.value as any}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ref } from 'vue';
|
||||
import { getUserList, type EventUserVO } from '@/pages/events/users/model/services';
|
||||
import { getUserInfo, type UserInfoVO } from '../model/services';
|
||||
|
||||
export interface UserSearchOption {
|
||||
/** userId 作为 value(传给后端) */
|
||||
@@ -7,17 +7,40 @@ export interface UserSearchOption {
|
||||
/** 展示文案:手机号(昵称) */
|
||||
label: string;
|
||||
/** 原始用户数据 */
|
||||
raw: EventUserVO;
|
||||
raw: UserInfoVO;
|
||||
}
|
||||
|
||||
export interface PresetUserInfo {
|
||||
userId: number | string;
|
||||
userId: string;
|
||||
phone?: string;
|
||||
nickname?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断输入是否为手机号:
|
||||
* 中国大陆手机号 — 以 1 开头的 11 位数字
|
||||
*/
|
||||
const PHONE_REGEX = /^1[3-9]\d{9}$/;
|
||||
|
||||
/**
|
||||
* 判断输入是否为雪花 ID:
|
||||
* 雪花算法 ID 通常为 18~19 位纯数字
|
||||
*/
|
||||
const SNOWFLAKE_ID_REGEX = /^\d{17,20}$/;
|
||||
|
||||
/** 判断输入类型:手机号 / 雪花ID / 无效 */
|
||||
export type SearchInputType = 'phone' | 'id' | 'unknown';
|
||||
|
||||
export function detectInputType(input: string): SearchInputType {
|
||||
const trimmed = input.trim();
|
||||
if (!trimmed) return 'unknown';
|
||||
if (PHONE_REGEX.test(trimmed)) return 'phone';
|
||||
if (SNOWFLAKE_ID_REGEX.test(trimmed)) return 'id';
|
||||
return 'unknown';
|
||||
}
|
||||
|
||||
export function useUserSearch(delay = 300) {
|
||||
/** 搜索关键字(内部管理,调用方无需关心) */
|
||||
/** 搜索关键字 */
|
||||
const keyword = ref('');
|
||||
/** Select 选项列表 */
|
||||
const options = ref<UserSearchOption[]>([]);
|
||||
@@ -32,19 +55,27 @@ export function useUserSearch(delay = 300) {
|
||||
options.value = [];
|
||||
return;
|
||||
}
|
||||
|
||||
const inputType = detectInputType(trimmed);
|
||||
if (inputType === 'unknown') {
|
||||
options.value = [];
|
||||
return;
|
||||
}
|
||||
|
||||
searching.value = true;
|
||||
try {
|
||||
const res = await getUserList({
|
||||
page: '1',
|
||||
limit: '20',
|
||||
phone: trimmed,
|
||||
});
|
||||
if (res.code == 200 && res.data?.list) {
|
||||
options.value = res.data.list.map((user) => ({
|
||||
value: user.id,
|
||||
label: `${user.phone}${user.nickname ? `(${user.nickname})` : ''}`,
|
||||
raw: user,
|
||||
}));
|
||||
const params = inputType === 'phone' ? { phone: trimmed } : { id: trimmed };
|
||||
|
||||
const res = await getUserInfo(params);
|
||||
if (res.code == 200 && res.data) {
|
||||
const user = res.data;
|
||||
options.value = [
|
||||
{
|
||||
value: user.id,
|
||||
label: `${user.phone}${user.nickname ? `(${user.nickname})` : ''}`,
|
||||
raw: user,
|
||||
},
|
||||
];
|
||||
} else {
|
||||
options.value = [];
|
||||
}
|
||||
@@ -66,9 +97,9 @@ export function useUserSearch(delay = 300) {
|
||||
timer = setTimeout(() => doSearch(val), delay);
|
||||
};
|
||||
|
||||
/** Select onChange 回调:返回 userId(数字),清空时返回 undefined */
|
||||
const onChange = (val: any): number | undefined => {
|
||||
return val ? Number(val) : undefined;
|
||||
/** Select onChange 回调:返回 userId(字符串),清空时返回 undefined */
|
||||
const onChange = (val: any): string | undefined => {
|
||||
return val ? String(val) : undefined;
|
||||
};
|
||||
|
||||
/** 注入预设用户选项(从表格行点击带入时使用) */
|
||||
@@ -82,15 +113,9 @@ export function useUserSearch(delay = 300) {
|
||||
label,
|
||||
raw: {
|
||||
id: String(user.userId),
|
||||
nickname: user.nickname || '',
|
||||
phone: user.phone || '',
|
||||
realName: '',
|
||||
idCard: '',
|
||||
idCardImg: '',
|
||||
idCardImgList: [],
|
||||
gender: '',
|
||||
nickname: user.nickname || '',
|
||||
status: '',
|
||||
createTime: '',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@@ -56,7 +56,7 @@ export interface AiModelDictResetParams {
|
||||
/** AI 积分账户 VO */
|
||||
export interface AiPointsAccountVO {
|
||||
/** 用户 ID */
|
||||
userId: number;
|
||||
userId: string;
|
||||
/** 昵称 */
|
||||
nickname?: string;
|
||||
/** 手机号 */
|
||||
@@ -72,7 +72,7 @@ export interface AiPointsAccountVO {
|
||||
/** AI 积分流水 VO */
|
||||
export interface AiPointsTxnVO {
|
||||
/** 用户 ID */
|
||||
userId: number;
|
||||
userId: string;
|
||||
/** 昵称 */
|
||||
nickname?: string;
|
||||
/** 手机号 */
|
||||
@@ -104,7 +104,7 @@ export interface AiPointsAccountQueryParams {
|
||||
page: number;
|
||||
size: number;
|
||||
/** 可选:用户 ID 筛选 */
|
||||
userId?: number;
|
||||
userId?: string;
|
||||
}
|
||||
|
||||
/** 积分流水分页查询参数 */
|
||||
@@ -112,7 +112,7 @@ export interface AiPointsTxnQueryParams {
|
||||
page: number;
|
||||
size: number;
|
||||
/** 可选:用户 ID 筛选 */
|
||||
userId?: number;
|
||||
userId?: string;
|
||||
/** 可选:业务场景筛选 */
|
||||
bizType?: string;
|
||||
/** 可选:流水类型 1充值/2调账/3消费/4欠款 */
|
||||
@@ -124,7 +124,7 @@ export interface AiPointsTxnQueryParams {
|
||||
/** 手工调点参数 */
|
||||
export interface AiPointsAdjustParams {
|
||||
/** 必填:用户 ID */
|
||||
userId: number;
|
||||
userId: string;
|
||||
/** 必填:积分数(非0;正=充/赠,负=扣) */
|
||||
points: number;
|
||||
/** 可选 1=充值/赠送 2=调账;缺省按正负推导 */
|
||||
@@ -135,9 +135,9 @@ export interface AiPointsAdjustParams {
|
||||
|
||||
/** AI 黑名单 VO */
|
||||
export interface AiBlacklistVO {
|
||||
id: number;
|
||||
id: string;
|
||||
/** 用户 ID */
|
||||
userId: number;
|
||||
userId: string;
|
||||
/** 昵称 */
|
||||
nickname?: string;
|
||||
/** 手机号 */
|
||||
@@ -149,7 +149,7 @@ export interface AiBlacklistVO {
|
||||
/** 到期时间(null=永久;yyyy-MM-dd HH:mm:ss) */
|
||||
expireDate: string | null;
|
||||
/** 操作人 ID */
|
||||
operatorId: number;
|
||||
operatorId: string;
|
||||
/** 创建时间 */
|
||||
createDate: string;
|
||||
/** 更新时间 */
|
||||
@@ -161,7 +161,7 @@ export interface AiBlacklistQueryParams {
|
||||
page: number;
|
||||
size: number;
|
||||
/** 可选:用户 ID 筛选 */
|
||||
userId?: number;
|
||||
userId?: string;
|
||||
/** 可选:状态筛选 1=拉黑中 0=已解除 */
|
||||
status?: number;
|
||||
}
|
||||
@@ -169,7 +169,7 @@ export interface AiBlacklistQueryParams {
|
||||
/** 拉黑参数 */
|
||||
export interface AiBlacklistAddParams {
|
||||
/** 必填:用户 ID */
|
||||
userId: number;
|
||||
userId: string;
|
||||
/** 必填:拉黑原因 */
|
||||
reason: string;
|
||||
/** 可选:到期时间(yyyy-MM-dd[ HH:mm:ss];空=永久) */
|
||||
@@ -178,7 +178,7 @@ export interface AiBlacklistAddParams {
|
||||
|
||||
/** 解除拉黑参数 */
|
||||
export interface AiBlacklistRemoveParams {
|
||||
userId: number;
|
||||
userId: string;
|
||||
}
|
||||
|
||||
/** 分页数据 */
|
||||
@@ -311,6 +311,7 @@ const DICT_DATA_SAVE = '/admin/manager/dict/data/save';
|
||||
const DICT_DATA_DELETE = '/admin/manager/dict/data/delete';
|
||||
const AI_BILLING_REPORT = '/admin/manager/ai/billing/report';
|
||||
const AI_FREEFORM_REPORT = '/admin/manager/ai/freeform/report';
|
||||
const USER_INFO = '/admin/manager/user/info';
|
||||
|
||||
/** 单价字典类型标识 */
|
||||
export const AI_BILLING_PRICE_DICT_TYPE = 'ai_billing_price';
|
||||
@@ -414,3 +415,25 @@ export function getAiFreeformReport(
|
||||
): Promise<ApiResult<AiFreeformReportVO[]>> {
|
||||
return get(AI_FREEFORM_REPORT, params as Record<string, unknown>);
|
||||
}
|
||||
|
||||
/** 用户信息查询参数(GET /admin/manager/user/info) */
|
||||
export interface UserInfoQueryParams {
|
||||
/** 雪花 ID */
|
||||
id?: string;
|
||||
/** 手机号 */
|
||||
phone?: string;
|
||||
}
|
||||
|
||||
/** 用户信息返回 */
|
||||
export interface UserInfoVO {
|
||||
id: string;
|
||||
phone: string;
|
||||
nickname: string;
|
||||
status: string;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
/** 按 id 或手机号查询单个用户信息 */
|
||||
export function getUserInfo(params: UserInfoQueryParams): Promise<ApiResult<UserInfoVO>> {
|
||||
return get(USER_INFO, params as Record<string, unknown>);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
*/
|
||||
export function useBlacklistModel() {
|
||||
const filterForm = reactive({
|
||||
userId: '' as string | number,
|
||||
userId: '' as string,
|
||||
status: '' as '' | number,
|
||||
});
|
||||
|
||||
@@ -39,8 +39,8 @@ export function useBlacklistModel() {
|
||||
size: (pagination as any).pageSize.value,
|
||||
};
|
||||
const uid = filterForm.userId;
|
||||
if (uid !== '' && uid != null && !Number.isNaN(Number(uid))) {
|
||||
params.userId = Number(uid);
|
||||
if (uid) {
|
||||
params.userId = String(uid);
|
||||
}
|
||||
if (filterForm.status !== '') {
|
||||
params.status = Number(filterForm.status);
|
||||
@@ -68,6 +68,10 @@ export function useBlacklistModel() {
|
||||
|
||||
const addModalVisible = ref(false);
|
||||
const submitting = ref(false);
|
||||
/** 预设用户信息(从列表「再次拉黑」带入) */
|
||||
const presetUser = ref<{ userId: string; phone?: string; nickname?: string } | undefined>(
|
||||
undefined,
|
||||
);
|
||||
|
||||
/** 搜索 */
|
||||
const handleSearch = () => {
|
||||
@@ -94,12 +98,24 @@ export function useBlacklistModel() {
|
||||
|
||||
/** 打开拉黑弹窗 */
|
||||
const openAddModal = () => {
|
||||
presetUser.value = undefined;
|
||||
addModalVisible.value = true;
|
||||
};
|
||||
|
||||
/** 打开拉黑弹窗(带预设用户信息,用于「再次拉黑」) */
|
||||
const openAddModalWithRecord = (record: AiBlacklistVO) => {
|
||||
presetUser.value = {
|
||||
userId: record.userId,
|
||||
phone: record.phone,
|
||||
nickname: record.nickname,
|
||||
};
|
||||
addModalVisible.value = true;
|
||||
};
|
||||
|
||||
/** 关闭拉黑弹窗 */
|
||||
const closeAddModal = () => {
|
||||
addModalVisible.value = false;
|
||||
presetUser.value = undefined;
|
||||
};
|
||||
|
||||
/** 提交拉黑 */
|
||||
@@ -132,7 +148,7 @@ export function useBlacklistModel() {
|
||||
try {
|
||||
const res = await removeAiBlacklist({ userId: record.userId });
|
||||
if (res.code == 200) {
|
||||
message.success(res.msg || '已解除拉黑');
|
||||
message.success('已解除拉黑');
|
||||
fetchList();
|
||||
} else {
|
||||
message.error(res.msg || '解除失败');
|
||||
@@ -151,10 +167,12 @@ export function useBlacklistModel() {
|
||||
pagination,
|
||||
addModalVisible,
|
||||
submitting,
|
||||
presetUser,
|
||||
handleSearch,
|
||||
handleReset,
|
||||
handlePageChange,
|
||||
openAddModal,
|
||||
openAddModalWithRecord,
|
||||
closeAddModal,
|
||||
handleSubmitAdd,
|
||||
handleRemove,
|
||||
|
||||
@@ -31,11 +31,11 @@ export function usePointsModel() {
|
||||
const subView = ref<'account' | 'txn'>('account');
|
||||
|
||||
const accountFilter = reactive({
|
||||
userId: '' as string | number,
|
||||
userId: '' as string,
|
||||
});
|
||||
|
||||
const txnFilter = reactive({
|
||||
userId: '' as string | number,
|
||||
userId: '' as string,
|
||||
bizType: '' as string,
|
||||
type: '' as '' | number,
|
||||
date: '' as string,
|
||||
@@ -50,8 +50,8 @@ export function usePointsModel() {
|
||||
size: (accountPagination as any).pageSize.value,
|
||||
};
|
||||
const uid = accountFilter.userId;
|
||||
if (uid !== '' && uid != null && !Number.isNaN(Number(uid))) {
|
||||
params.userId = Number(uid);
|
||||
if (uid) {
|
||||
params.userId = String(uid);
|
||||
}
|
||||
return params;
|
||||
};
|
||||
@@ -62,8 +62,8 @@ export function usePointsModel() {
|
||||
size: (txnPagination as any).pageSize.value,
|
||||
};
|
||||
const uid = txnFilter.userId;
|
||||
if (uid !== '' && uid != null && !Number.isNaN(Number(uid))) {
|
||||
params.userId = Number(uid);
|
||||
if (uid) {
|
||||
params.userId = String(uid);
|
||||
}
|
||||
if (txnFilter.bizType) {
|
||||
params.bizType = txnFilter.bizType;
|
||||
@@ -116,7 +116,7 @@ export function usePointsModel() {
|
||||
const adjustModalVisible = ref(false);
|
||||
const adjusting = ref(false);
|
||||
/** 调点弹窗预设用户信息(从账户行点击「调点」时带入) */
|
||||
const presetUser = ref<{ userId: number; phone?: string; nickname?: string } | undefined>(
|
||||
const presetUser = ref<{ userId: string; phone?: string; nickname?: string } | undefined>(
|
||||
undefined,
|
||||
);
|
||||
|
||||
@@ -179,7 +179,7 @@ export function usePointsModel() {
|
||||
};
|
||||
|
||||
/** 打开调点弹窗(可预设用户信息) */
|
||||
const openAdjustModal = (user?: { userId: number; phone?: string; nickname?: string }) => {
|
||||
const openAdjustModal = (user?: { userId: string; phone?: string; nickname?: string }) => {
|
||||
presetUser.value = user;
|
||||
adjustModalVisible.value = true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user