feat:【antd】【member 会员】完成 index 和 form 的重构
This commit is contained in:
@@ -16,21 +16,21 @@ import { getSimpleTagList } from '#/api/member/tag';
|
|||||||
import { getAreaTree } from '#/api/system/area';
|
import { getAreaTree } from '#/api/system/area';
|
||||||
import { getRangePickerDefaultProps } from '#/utils';
|
import { getRangePickerDefaultProps } from '#/utils';
|
||||||
|
|
||||||
/** 修改的表单 */
|
/** 新增/修改的表单 */
|
||||||
export function useFormSchema(): VbenFormSchema[] {
|
export function useFormSchema(): VbenFormSchema[] {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'id',
|
fieldName: 'id',
|
||||||
|
component: 'Input',
|
||||||
dependencies: {
|
dependencies: {
|
||||||
triggerFields: [''],
|
triggerFields: [''],
|
||||||
show: () => false,
|
show: () => false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'mobile',
|
fieldName: 'mobile',
|
||||||
label: '手机号',
|
label: '手机号',
|
||||||
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -45,19 +45,25 @@ export function useFormSchema(): VbenFormSchema[] {
|
|||||||
rules: z.number().default(CommonStatusEnum.ENABLE).optional(),
|
rules: z.number().default(CommonStatusEnum.ENABLE).optional(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'nickname',
|
fieldName: 'nickname',
|
||||||
label: '用户昵称',
|
label: '用户昵称',
|
||||||
|
component: 'Input',
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入用户昵称',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'ImageUpload',
|
|
||||||
fieldName: 'avatar',
|
fieldName: 'avatar',
|
||||||
label: '头像',
|
label: '头像',
|
||||||
|
component: 'ImageUpload',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'name',
|
fieldName: 'name',
|
||||||
label: '真实名字',
|
label: '真实名字',
|
||||||
|
component: 'Input',
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入真实名字',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'sex',
|
fieldName: 'sex',
|
||||||
@@ -70,45 +76,53 @@ export function useFormSchema(): VbenFormSchema[] {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'DatePicker',
|
|
||||||
fieldName: 'birthday',
|
fieldName: 'birthday',
|
||||||
label: '出生日期',
|
label: '出生日期',
|
||||||
|
component: 'DatePicker',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
format: 'YYYY-MM-DD',
|
format: 'YYYY-MM-DD',
|
||||||
|
valueFormat: 'x',
|
||||||
|
placeholder: '请选择出生日期',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'ApiTreeSelect',
|
|
||||||
fieldName: 'areaId',
|
fieldName: 'areaId',
|
||||||
label: '所在地',
|
label: '所在地',
|
||||||
|
component: 'ApiTreeSelect',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
api: () => getAreaTree(),
|
api: () => getAreaTree(),
|
||||||
fieldNames: { label: 'name', value: 'id', children: 'children' },
|
fieldNames: { label: 'name', value: 'id', children: 'children' },
|
||||||
|
placeholder: '请选择所在地',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'ApiSelect',
|
|
||||||
fieldName: 'tagIds',
|
fieldName: 'tagIds',
|
||||||
label: '用户标签',
|
label: '用户标签',
|
||||||
|
component: 'ApiSelect',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
api: () => getSimpleTagList(),
|
api: () => getSimpleTagList(),
|
||||||
fieldNames: { label: 'name', value: 'id' },
|
fieldNames: { label: 'name', value: 'id' },
|
||||||
mode: 'multiple',
|
mode: 'multiple',
|
||||||
|
placeholder: '请选择用户标签',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'ApiSelect',
|
|
||||||
fieldName: 'groupId',
|
fieldName: 'groupId',
|
||||||
label: '用户分组',
|
label: '用户分组',
|
||||||
|
component: 'ApiSelect',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
api: () => getSimpleGroupList(),
|
api: () => getSimpleGroupList(),
|
||||||
fieldNames: { label: 'name', value: 'id' },
|
fieldNames: { label: 'name', value: 'id' },
|
||||||
|
placeholder: '请选择用户分组',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Textarea',
|
|
||||||
fieldName: 'mark',
|
fieldName: 'mark',
|
||||||
label: '会员备注',
|
label: '会员备注',
|
||||||
|
component: 'Textarea',
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入会员备注',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -120,11 +134,19 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
|||||||
fieldName: 'nickname',
|
fieldName: 'nickname',
|
||||||
label: '用户昵称',
|
label: '用户昵称',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入用户昵称',
|
||||||
|
allowClear: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'mobile',
|
fieldName: 'mobile',
|
||||||
label: '手机号',
|
label: '手机号',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入手机号',
|
||||||
|
allowClear: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'loginDate',
|
fieldName: 'loginDate',
|
||||||
@@ -132,6 +154,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
|||||||
component: 'RangePicker',
|
component: 'RangePicker',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
...getRangePickerDefaultProps(),
|
...getRangePickerDefaultProps(),
|
||||||
|
allowClear: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -140,6 +163,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
|||||||
component: 'RangePicker',
|
component: 'RangePicker',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
...getRangePickerDefaultProps(),
|
...getRangePickerDefaultProps(),
|
||||||
|
allowClear: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -150,6 +174,8 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
|||||||
api: () => getSimpleTagList(),
|
api: () => getSimpleTagList(),
|
||||||
fieldNames: { label: 'name', value: 'id' },
|
fieldNames: { label: 'name', value: 'id' },
|
||||||
mode: 'multiple',
|
mode: 'multiple',
|
||||||
|
placeholder: '请选择用户标签',
|
||||||
|
allowClear: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -159,6 +185,8 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
|||||||
componentProps: {
|
componentProps: {
|
||||||
api: () => getSimpleLevelList(),
|
api: () => getSimpleLevelList(),
|
||||||
fieldNames: { label: 'name', value: 'id' },
|
fieldNames: { label: 'name', value: 'id' },
|
||||||
|
placeholder: '请选择用户等级',
|
||||||
|
allowClear: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -168,6 +196,8 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
|||||||
componentProps: {
|
componentProps: {
|
||||||
api: () => getSimpleGroupList(),
|
api: () => getSimpleGroupList(),
|
||||||
fieldNames: { label: 'name', value: 'id' },
|
fieldNames: { label: 'name', value: 'id' },
|
||||||
|
placeholder: '请选择用户分组',
|
||||||
|
allowClear: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -183,38 +213,40 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '用户编号',
|
title: '用户编号',
|
||||||
|
minWidth: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'avatar',
|
field: 'avatar',
|
||||||
title: '头像',
|
title: '头像',
|
||||||
slots: {
|
minWidth: 80,
|
||||||
default: ({ row }) => {
|
cellRender: {
|
||||||
return h('img', {
|
name: 'CellImage',
|
||||||
src: row.avatar,
|
|
||||||
style: { width: '40px' },
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'mobile',
|
field: 'mobile',
|
||||||
title: '手机号',
|
title: '手机号',
|
||||||
|
minWidth: 120,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'nickname',
|
field: 'nickname',
|
||||||
title: '昵称',
|
title: '昵称',
|
||||||
|
minWidth: 120,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'levelName',
|
field: 'levelName',
|
||||||
title: '等级',
|
title: '等级',
|
||||||
|
minWidth: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'groupName',
|
field: 'groupName',
|
||||||
title: '分组',
|
title: '分组',
|
||||||
|
minWidth: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'tagNames',
|
field: 'tagNames',
|
||||||
title: '用户标签',
|
title: '用户标签',
|
||||||
|
minWidth: 150,
|
||||||
slots: {
|
slots: {
|
||||||
default: ({ row }) => {
|
default: ({ row }) => {
|
||||||
return row.tagNames?.map((tagName: string, index: number) => {
|
return row.tagNames?.map((tagName: string, index: number) => {
|
||||||
@@ -234,10 +266,12 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||||||
{
|
{
|
||||||
field: 'point',
|
field: 'point',
|
||||||
title: '积分',
|
title: '积分',
|
||||||
|
minWidth: 80,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'status',
|
field: 'status',
|
||||||
title: '状态',
|
title: '状态',
|
||||||
|
minWidth: 80,
|
||||||
cellRender: {
|
cellRender: {
|
||||||
name: 'CellDict',
|
name: 'CellDict',
|
||||||
props: { type: DICT_TYPE.COMMON_STATUS },
|
props: { type: DICT_TYPE.COMMON_STATUS },
|
||||||
@@ -246,11 +280,13 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||||||
{
|
{
|
||||||
field: 'loginDate',
|
field: 'loginDate',
|
||||||
title: '登录时间',
|
title: '登录时间',
|
||||||
|
minWidth: 160,
|
||||||
formatter: 'formatDateTime',
|
formatter: 'formatDateTime',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'createTime',
|
field: 'createTime',
|
||||||
title: '注册时间',
|
title: '注册时间',
|
||||||
|
minWidth: 160,
|
||||||
formatter: 'formatDateTime',
|
formatter: 'formatDateTime',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -266,17 +302,17 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||||||
export function useLevelFormSchema(): VbenFormSchema[] {
|
export function useLevelFormSchema(): VbenFormSchema[] {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'id',
|
fieldName: 'id',
|
||||||
label: '用户编号',
|
label: '用户编号',
|
||||||
|
component: 'Input',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'nickname',
|
fieldName: 'nickname',
|
||||||
label: '用户昵称',
|
label: '用户昵称',
|
||||||
|
component: 'Input',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
},
|
||||||
@@ -288,12 +324,17 @@ export function useLevelFormSchema(): VbenFormSchema[] {
|
|||||||
componentProps: {
|
componentProps: {
|
||||||
api: () => getSimpleLevelList(),
|
api: () => getSimpleLevelList(),
|
||||||
fieldNames: { label: 'name', value: 'id' },
|
fieldNames: { label: 'name', value: 'id' },
|
||||||
|
placeholder: '请选择用户等级',
|
||||||
},
|
},
|
||||||
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Textarea',
|
|
||||||
fieldName: 'reason',
|
fieldName: 'reason',
|
||||||
label: '修改原因',
|
label: '修改原因',
|
||||||
|
component: 'Textarea',
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入修改原因',
|
||||||
|
},
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -303,33 +344,33 @@ export function useLevelFormSchema(): VbenFormSchema[] {
|
|||||||
export function useBalanceFormSchema(): VbenFormSchema[] {
|
export function useBalanceFormSchema(): VbenFormSchema[] {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'id',
|
fieldName: 'id',
|
||||||
label: '用户编号',
|
label: '用户编号',
|
||||||
|
component: 'Input',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'nickname',
|
fieldName: 'nickname',
|
||||||
label: '用户昵称',
|
label: '用户昵称',
|
||||||
|
component: 'Input',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'balance',
|
fieldName: 'balance',
|
||||||
label: '变动前余额(元)',
|
label: '变动前余额(元)',
|
||||||
|
component: 'Input',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'RadioGroup',
|
|
||||||
fieldName: 'changeType',
|
fieldName: 'changeType',
|
||||||
label: '变动类型',
|
label: '变动类型',
|
||||||
|
component: 'RadioGroup',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
options: [
|
options: [
|
||||||
{ label: '增加', value: 1 },
|
{ label: '增加', value: 1 },
|
||||||
@@ -341,21 +382,22 @@ export function useBalanceFormSchema(): VbenFormSchema[] {
|
|||||||
defaultValue: 1,
|
defaultValue: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'InputNumber',
|
|
||||||
fieldName: 'changeBalance',
|
fieldName: 'changeBalance',
|
||||||
label: '变动余额(元)',
|
label: '变动余额(元)',
|
||||||
|
component: 'InputNumber',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
min: 0,
|
min: 0,
|
||||||
precision: 2,
|
precision: 2,
|
||||||
step: 0.1,
|
step: 0.1,
|
||||||
|
placeholder: '请输入变动余额',
|
||||||
},
|
},
|
||||||
defaultValue: 0,
|
defaultValue: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'balanceResult',
|
fieldName: 'balanceResult',
|
||||||
label: '变动后余额(元)',
|
label: '变动后余额(元)',
|
||||||
|
component: 'Input',
|
||||||
dependencies: {
|
dependencies: {
|
||||||
triggerFields: ['changeBalance', 'changeType'],
|
triggerFields: ['changeBalance', 'changeType'],
|
||||||
disabled: true,
|
disabled: true,
|
||||||
@@ -377,33 +419,33 @@ export function useBalanceFormSchema(): VbenFormSchema[] {
|
|||||||
export function usePointFormSchema(): VbenFormSchema[] {
|
export function usePointFormSchema(): VbenFormSchema[] {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'id',
|
fieldName: 'id',
|
||||||
label: '用户编号',
|
label: '用户编号',
|
||||||
|
component: 'Input',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'nickname',
|
fieldName: 'nickname',
|
||||||
label: '用户昵称',
|
label: '用户昵称',
|
||||||
|
component: 'Input',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'point',
|
fieldName: 'point',
|
||||||
label: '变动前积分',
|
label: '变动前积分',
|
||||||
|
component: 'Input',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'RadioGroup',
|
|
||||||
fieldName: 'changeType',
|
fieldName: 'changeType',
|
||||||
label: '变动类型',
|
label: '变动类型',
|
||||||
|
component: 'RadioGroup',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
options: [
|
options: [
|
||||||
{ label: '增加', value: 1 },
|
{ label: '增加', value: 1 },
|
||||||
@@ -415,20 +457,21 @@ export function usePointFormSchema(): VbenFormSchema[] {
|
|||||||
defaultValue: 1,
|
defaultValue: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'InputNumber',
|
|
||||||
fieldName: 'changePoint',
|
fieldName: 'changePoint',
|
||||||
label: '变动积分',
|
label: '变动积分',
|
||||||
|
component: 'InputNumber',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
min: 0,
|
min: 0,
|
||||||
precision: 0,
|
precision: 0,
|
||||||
|
placeholder: '请输入变动积分',
|
||||||
},
|
},
|
||||||
defaultValue: 0,
|
defaultValue: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'pointResult',
|
fieldName: 'pointResult',
|
||||||
label: '变动后积分',
|
label: '变动后积分',
|
||||||
|
component: 'Input',
|
||||||
dependencies: {
|
dependencies: {
|
||||||
triggerFields: ['changePoint', 'changeType'],
|
triggerFields: ['changePoint', 'changeType'],
|
||||||
disabled: true,
|
disabled: true,
|
||||||
|
|||||||
@@ -39,23 +39,11 @@ const [LevelFormModal, levelFormModalApi] = useVbenModal({
|
|||||||
destroyOnClose: true,
|
destroyOnClose: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 刷新表格数据 */
|
/** 刷新表格 */
|
||||||
function onRefresh() {
|
function handleRefresh() {
|
||||||
gridApi.query();
|
gridApi.query();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置选中 ID */
|
|
||||||
const checkedIds = ref<number[]>([]);
|
|
||||||
function setCheckedIds({ records }: { records: MemberUserApi.User[] }) {
|
|
||||||
checkedIds.value = records.map((item) => item.id!);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 发送优惠券 */
|
|
||||||
// TODO @xingyu:这个功能没开发对,是发送优惠劵哈;
|
|
||||||
function handleSendCoupon() {
|
|
||||||
formModalApi.setData(null).open();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 编辑会员 */
|
/** 编辑会员 */
|
||||||
function handleEdit(row: MemberUserApi.User) {
|
function handleEdit(row: MemberUserApi.User) {
|
||||||
formModalApi.setData(row).open();
|
formModalApi.setData(row).open();
|
||||||
@@ -76,6 +64,21 @@ function handleUpdateBalance(row: MemberUserApi.User) {
|
|||||||
balanceFormModalApi.setData(row).open();
|
balanceFormModalApi.setData(row).open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 发送优惠券 */
|
||||||
|
// TODO @xingyu:这个功能没开发对,是发送优惠劵哈;
|
||||||
|
function handleSendCoupon() {
|
||||||
|
formModalApi.setData(null).open();
|
||||||
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: MemberUserApi.User[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id!);
|
||||||
|
}
|
||||||
|
|
||||||
/** 查看会员详情 */
|
/** 查看会员详情 */
|
||||||
function handleViewDetail(row: MemberUserApi.User) {
|
function handleViewDetail(row: MemberUserApi.User) {
|
||||||
router.push({
|
router.push({
|
||||||
@@ -86,17 +89,12 @@ function handleViewDetail(row: MemberUserApi.User) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表格实例
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
formOptions: {
|
formOptions: {
|
||||||
schema: useGridFormSchema(),
|
schema: useGridFormSchema(),
|
||||||
},
|
},
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useGridColumns(),
|
columns: useGridColumns(),
|
||||||
checkboxConfig: {
|
|
||||||
highlight: true,
|
|
||||||
labelField: 'checkbox',
|
|
||||||
},
|
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
keepSource: true,
|
keepSource: true,
|
||||||
proxyConfig: {
|
proxyConfig: {
|
||||||
@@ -112,6 +110,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: true,
|
refresh: true,
|
||||||
@@ -119,8 +118,8 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
},
|
},
|
||||||
} as VxeTableGridOptions<MemberUserApi.User>,
|
} as VxeTableGridOptions<MemberUserApi.User>,
|
||||||
gridEvents: {
|
gridEvents: {
|
||||||
checkboxAll: setCheckedIds,
|
checkboxAll: handleRowCheckboxChange,
|
||||||
checkboxChange: setCheckedIds,
|
checkboxChange: handleRowCheckboxChange,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -134,10 +133,10 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<FormModal @success="onRefresh" />
|
<FormModal @success="handleRefresh" />
|
||||||
<PointFormModal @success="onRefresh" />
|
<PointFormModal @success="handleRefresh" />
|
||||||
<BalanceFormModal @success="onRefresh" />
|
<BalanceFormModal @success="handleRefresh" />
|
||||||
<LevelFormModal @success="onRefresh" />
|
<LevelFormModal @success="handleRefresh" />
|
||||||
<Grid table-title="会员列表">
|
<Grid table-title="会员列表">
|
||||||
<template #toolbar-tools>
|
<template #toolbar-tools>
|
||||||
<TableAction
|
<TableAction
|
||||||
|
|||||||
Reference in New Issue
Block a user