add
Some checks failed
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled

This commit is contained in:
Mrx
2026-02-02 13:17:40 +08:00
parent db85f77ea8
commit 5a36e27370
3 changed files with 27 additions and 12 deletions

View File

@@ -9,6 +9,7 @@ export namespace PlatformUserApi {
nickname: string;
info: string;
inside: number;
disable: number; // 0可用 1禁用
create_time: string;
update_time: string;
}
@@ -19,10 +20,11 @@ export namespace PlatformUserApi {
}
export interface UpdatePlatformUserRequest {
mobile: string;
nickname: string;
info: string;
inside: number;
mobile?: string;
nickname?: string;
info?: string;
inside?: number;
disable?: number; // 0可用 1禁用
}
}

View File

@@ -36,6 +36,18 @@ export function useFormSchema(): VbenFormSchema[] {
},
defaultValue: 0,
},
{
component: 'Switch',
fieldName: 'disable',
label: '是否封禁',
componentProps: {
checkedChildren: '封禁',
unCheckedChildren: '可用',
checkedValue: 1,
unCheckedValue: 0,
},
defaultValue: 0,
},
];
}
@@ -104,6 +116,12 @@ export function useColumns<T = PlatformUserApi.PlatformUserItem>(
width: 100,
formatter: ({ cellValue }) => (cellValue === 1 ? '是' : '否'),
},
{
field: 'disable',
title: '是否封禁',
width: 100,
formatter: ({ cellValue }) => (cellValue === 1 ? '是' : '否'),
},
{
field: 'create_time',
title: '创建时间',
@@ -125,9 +143,7 @@ export function useColumns<T = PlatformUserApi.PlatformUserItem>(
onClick: onActionClick,
},
name: 'CellOperation',
options: [
'edit', // 默认的编辑按钮
],
options: ['edit'],
},
field: 'operation',
fixed: 'right',

View File

@@ -91,11 +91,8 @@ const [Grid, gridApi] = useVbenVxeGrid({
function onActionClick(
e: OnActionClickParams<PlatformUserApi.PlatformUserItem>,
) {
switch (e.code) {
case 'edit': {
if (e.code === 'edit') {
onEdit(e.row);
break;
}
}
}