Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ujia
/
uj-store
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 09cbacbc
authored
Oct 13, 2026
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v1.0.0' of
http://192.168.3.233:8090/ujia/uj-store
into v1.0.0
2 parents
a904059e
b8e6dc2a
Pipeline
#344
for
09cbacbc
failed
in 0 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
23 deletions
src/access/ui/PermButton.tsx
src/components/DataTable/index.tsx
src/pages/AccountManage/index.tsx
src/pages/RoleManage/index.tsx
src/access/ui/PermButton.tsx
View file @
09cbacb
...
...
@@ -22,7 +22,14 @@ export const PermButton = forwardRef<HTMLButtonElement, PermButtonProps>(
if (!ok && fallback === 'hide') return null;
const btn = <UButton ref={ref} {...rest} disabled={!ok || rest.disabled} />;
const btn = (
<UButton
ref={ref}
{...rest}
disabled={!ok || rest.disabled}
style={rest.type === 'text' ? { ...rest.style, paddingInline: 0 } : rest.style}
/>
);
if (!ok && fallback === 'disabled' && unauthorizedTip) {
return <UTooltip title={unauthorizedTip}>{btn}</UTooltip>;
...
...
src/components/DataTable/index.tsx
View file @
09cbacb
...
...
@@ -126,12 +126,21 @@ export function DataTable<T extends object>({
onClick: () => void,
key: string,
isRowAction = false,
style?: CSSProperties,
) => {
const type = action.type ?? (isRowAction ? ('text' as const) : undefined);
const buttonProps = {
danger: action.danger,
disabled: action.disabled,
onClick,
type: action.type ?? (isRowAction ? ('link' as const) : undefined),
type,
style:
isRowAction && type === 'text'
? {
color: action.danger ? 'var(--ant-color-error)' : 'var(--ant-color-primary)',
...style,
}
: style,
};
return action.permission ? (
...
...
@@ -150,21 +159,27 @@ export function DataTable<T extends object>({
key: '__actions',
width: actionColumnWidth,
fixed: actionColumnFixed,
render: (_: unknown, record: T) =>
rowActions
.filter((action) => action.visible?.(record) ?? true)
.map((action, index) => {
const label =
typeof action.label === 'function' ? action.label(record) : action.label;
const danger =
typeof action.danger === 'function' ? action.danger(record) : action.danger;
return renderActionButton(
{ ...action, danger, label },
() => action.onClick(record),
`row-action-${index}`,
true,
);
}),
render: (_: unknown, record: T) => {
const visibleActions = rowActions.filter((action) => action.visible?.(record) ?? true);
const lastPermissionActionIndex = visibleActions.reduce(
(lastIndex, action, index) => (action.permission ? index : lastIndex),
-1,
);
return visibleActions.map((action, index) => {
const label = typeof action.label === 'function' ? action.label(record) : action.label;
const danger =
typeof action.danger === 'function' ? action.danger(record) : action.danger;
return renderActionButton(
{ ...action, danger, label },
() => action.onClick(record),
`row-action-${index}`,
true,
action.permission && index < lastPermissionActionIndex
? { marginRight: 8 }
: undefined,
);
});
},
}
: undefined;
const sourceColumns: DataTableColumnsType<T> = showIndex
...
...
@@ -211,6 +226,10 @@ export function DataTable<T extends object>({
columns={tableColumns}
tableLayout={hasLineLimit ? 'fixed' : undefined}
rowSelection={resolvedSelection}
styles={{
header: { cell: { paddingLeft: 20 } },
body: { cell: { paddingLeft: 20 } },
}}
pagination={
resolvedPagination === false
? false
...
...
src/pages/AccountManage/index.tsx
View file @
09cbacb
...
...
@@ -129,13 +129,13 @@ export default function AccountManage() {
<UText style={{ color: '#315ce8', fontFamily: 'monospace' }}>{value}</UText>
),
},
{ title: '姓名', dataIndex: 'name', width: 1
1
0, line: 1 },
{ title: '姓名', dataIndex: 'name', width: 1
3
0, line: 1 },
{ title: '手机号', dataIndex: 'mobile', width: 120 },
{ title: '所属组织', dataIndex: 'orgPath', width: 230, line: 1 },
{
title: '角色',
dataIndex: 'roleNames',
width: 2
8
0,
width: 2
9
0,
render: (names: string[]) =>
names.length
? names.map((name, index) => (
...
...
@@ -149,7 +149,7 @@ export default function AccountManage() {
))
: '—',
},
{ title: '数据域', dataIndex: 'dataScopeLabel'
, width: 140
},
{ title: '数据域', dataIndex: 'dataScopeLabel' },
{
title: '状态',
width: 90,
...
...
src/pages/RoleManage/index.tsx
View file @
09cbacb
...
...
@@ -114,13 +114,13 @@ export default function RoleManage() {
{
title: '角色编码',
dataIndex: 'code',
width:
15
0,
width:
20
0,
line: 1,
render: (v) => <UText style={{ color: '#315ce8', fontFamily: 'monospace' }}>{v}</UText>,
},
{ title: '默认数据域', dataIndex: 'scope'
, width: 130
},
{ title: '默认数据域', dataIndex: 'scope' },
{ title: '账号数', dataIndex: 'userCount', width: 90 },
{ title: '角色描述', dataIndex: 'description', width:
38
0, line: 1 },
{ title: '角色描述', dataIndex: 'description', width:
40
0, line: 1 },
{
title: '类型',
dataIndex: 'type',
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment