Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nocobase
Commits
8af19d24
Commit
8af19d24
authored
3 years ago
by
chenos
Browse files
Options
Download
Email Patches
Plain Diff
fix: cleanup
parent
f7ce3f64
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
packages/client/src/acl/Configuration/ScopeSelect.tsx
+0
-2
packages/client/src/acl/Configuration/ScopeSelect.tsx
packages/client/src/acl/Configuration/schemas/scopes.ts
+0
-1
packages/client/src/acl/Configuration/schemas/scopes.ts
packages/client/src/collection-manager/Configuration/AddFieldAction.tsx
+0
-1
...t/src/collection-manager/Configuration/AddFieldAction.tsx
packages/client/src/schema-component/antd/calendar/Calendar.tsx
+0
-2
...es/client/src/schema-component/antd/calendar/Calendar.tsx
packages/client/src/schema-component/antd/checkbox/Checkbox.tsx
+2
-6
...es/client/src/schema-component/antd/checkbox/Checkbox.tsx
packages/client/src/schema-component/antd/radio/Radio.tsx
+0
-1
packages/client/src/schema-component/antd/radio/Radio.tsx
packages/client/src/schema-component/antd/table/Table.Array.tsx
+0
-1
...es/client/src/schema-component/antd/table/Table.Array.tsx
packages/client/src/schema-component/antd/table/Table.Void.tsx
+0
-2
...ges/client/src/schema-component/antd/table/Table.Void.tsx
packages/client/src/schema-component/antd/tabs/Tabs.tsx
+0
-1
packages/client/src/schema-component/antd/tabs/Tabs.tsx
packages/client/src/schema-component/antd/upload/ReadPretty.tsx
+0
-1
...es/client/src/schema-component/antd/upload/ReadPretty.tsx
packages/client/src/schema-component/antd/upload/Upload.tsx
+2
-2
packages/client/src/schema-component/antd/upload/Upload.tsx
packages/client/src/schema-component/antd/upload/shared.ts
+1
-2
packages/client/src/schema-component/antd/upload/shared.ts
packages/client/src/system-settings/SystemSettingsShortcut.tsx
+8
-3
...ges/client/src/system-settings/SystemSettingsShortcut.tsx
packages/client/src/user/SigninPage.tsx
+1
-0
packages/client/src/user/SigninPage.tsx
packages/client/src/user/SignupPage.tsx
+1
-0
packages/client/src/user/SignupPage.tsx
with
15 additions
and
25 deletions
+15
-25
packages/client/src/acl/Configuration/ScopeSelect.tsx
+
0
-
2
View file @
8af19d24
...
...
@@ -28,7 +28,6 @@ export const ScopeSelect = (props) => {
}),
[],
);
console
.
log
(
'
props.value
'
,
props
.
value
,
form
.
values
);
return
(
<
FormProvider
form
=
{
form
}
>
<
SchemaComponent
...
...
@@ -36,7 +35,6 @@ export const ScopeSelect = (props) => {
scope
=
{
{
onChange
(
value
)
{
props
?.
onChange
?.(
value
);
console
.
log
(
'
onChange
'
,
value
);
},
}
}
schema
=
{
scopesSchema
}
...
...
This diff is collapsed.
Click to expand it.
packages/client/src/acl/Configuration/schemas/scopes.ts
+
0
-
1
View file @
8af19d24
...
...
@@ -136,7 +136,6 @@ export const scopesSchema: ISchema = {
// },
useDataSource
(
options
)
{
const
record
=
useRecord
();
console
.
log
(
'
useRecord
'
,
record
);
return
useRequest
(
{
resource
:
'
rolesResourcesScopes
'
,
...
...
This diff is collapsed.
Click to expand it.
packages/client/src/collection-manager/Configuration/AddFieldAction.tsx
+
0
-
1
View file @
8af19d24
...
...
@@ -25,7 +25,6 @@ const getSchema = (schema: IField): ISchema => {
name
:
`f_
${
uid
()}
`
,
};
initialValue
.
uiSchema
.
title
=
schema
.
title
;
console
.
log
(
'
initialValue
'
,
initialValue
);
return
{
type
:
'
object
'
,
properties
:
{
...
...
This diff is collapsed.
Click to expand it.
packages/client/src/schema-component/antd/calendar/Calendar.tsx
+
0
-
2
View file @
8af19d24
...
...
@@ -102,7 +102,6 @@ export const Calendar: any = observer((props: any) => {
refreshDeps
:
[
props
.
dataSource
],
onSuccess
(
data
)
{
const
events
=
toEvents
(
data
?.
data
,
fieldNames
);
console
.
log
(
'
events
'
,
events
,
data
);
setDataSource
(
events
);
},
},
...
...
@@ -114,7 +113,6 @@ export const Calendar: any = observer((props: any) => {
}
return
buf
;
},
null
);
console
.
log
(
'
field
'
,
field
);
return
(
<
AsyncDataProvider
value
=
{
result
}
>
<
CalendarContext
.
Provider
value
=
{
{
field
,
props
,
record
}
}
>
...
...
This diff is collapsed.
Click to expand it.
packages/client/src/schema-component/antd/checkbox/Checkbox.tsx
+
2
-
6
View file @
8af19d24
import
{
CheckOutlined
,
CloseOutlined
}
from
'
@ant-design/icons
'
;
import
{
CheckOutlined
}
from
'
@ant-design/icons
'
;
import
{
connect
,
mapProps
,
mapReadPretty
,
useField
}
from
'
@formily/react
'
;
import
{
isValid
}
from
'
@formily/shared
'
;
import
{
Checkbox
as
AntdCheckbox
,
Tag
}
from
'
antd
'
;
...
...
@@ -29,11 +29,7 @@ export const Checkbox: ComposedCheckbox = connect(
if
(
!
isValid
(
props
.
value
))
{
return
<
div
></
div
>;
}
return
props
.
value
?
(
<
CheckOutlined
style
=
{
{
color
:
'
#52c41a
'
}
}
/>
)
:
(
<
CloseOutlined
style
=
{
{
color
:
'
#f5222d
'
}
}
/>
);
return
props
.
value
?
<
CheckOutlined
style
=
{
{
color
:
'
#52c41a
'
}
}
/>
:
null
;
}),
);
...
...
This diff is collapsed.
Click to expand it.
packages/client/src/schema-component/antd/radio/Radio.tsx
+
0
-
1
View file @
8af19d24
...
...
@@ -30,7 +30,6 @@ Radio.Group = connect(
const
{
options
=
[],
value
}
=
props
;
const
field
=
useField
<
any
>
();
const
dataSource
=
field
.
dataSource
||
[];
console
.
log
({
dataSource
});
return
(
<
div
>
{
dataSource
...
...
This diff is collapsed.
Click to expand it.
packages/client/src/schema-component/antd/table/Table.Array.tsx
+
0
-
1
View file @
8af19d24
...
...
@@ -40,7 +40,6 @@ const useTableColumns = () => {
},
}
as
TableColumnProps
<
any
>
;
});
console
.
log
(
columns
);
if
(
!
exists
)
{
return
columns
;
}
...
...
This diff is collapsed.
Click to expand it.
packages/client/src/schema-component/antd/table/Table.Void.tsx
+
0
-
2
View file @
8af19d24
...
...
@@ -18,7 +18,6 @@ type TableVoidProps = TableProps<any> & {
};
const
usePaginationProps
=
(
props
:
TableProps
<
any
>
&
{
request
?:
any
},
service
):
TablePaginationConfig
|
false
=>
{
console
.
log
(
'
f.componentProps.pagination
'
,
props
);
if
(
props
.
pagination
===
false
)
{
return
false
;
}
...
...
@@ -97,7 +96,6 @@ export const TableVoid: React.FC<TableVoidProps> = observer((props) => {
}
field
.
componentProps
.
pagination
.
current
=
data
?.
meta
?.
page
||
1
;
field
.
componentProps
.
pagination
.
pageSize
=
data
?.
meta
?.
pageSize
||
10
;
console
.
log
(
'
f.componentProps.pagination
'
,
field
.
componentProps
.
pagination
);
},
},
props
,
...
...
This diff is collapsed.
Click to expand it.
packages/client/src/schema-component/antd/tabs/Tabs.tsx
+
0
-
1
View file @
8af19d24
...
...
@@ -80,7 +80,6 @@ const designerCss = css`
Tabs
.
TabPane
=
observer
((
props
:
TabPaneProps
)
=>
{
const
Designer
=
useDesigner
();
const
field
=
useField
();
console
.
log
(
'
Designer
'
,
Designer
);
return
(
<
SortableItem
className
=
{
classNames
(
'
nb-action-link
'
,
designerCss
,
props
.
className
)
}
>
{
props
.
tab
||
field
.
title
}
...
...
This diff is collapsed.
Click to expand it.
packages/client/src/schema-component/antd/upload/ReadPretty.tsx
+
0
-
1
View file @
8af19d24
...
...
@@ -22,7 +22,6 @@ ReadPretty.Attachment = (props: UploadProps) => {
const
[
photoIndex
,
setPhotoIndex
]
=
useState
(
0
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
{
size
}
=
props
;
console
.
log
(
'
field.value
'
,
field
.
value
,
images
);
return
(
<
div
>
<
div
className
=
{
cls
(
'
ant-upload-picture-card-wrapper nb-upload
'
,
size
?
`nb-upload-
${
size
}
`
:
null
)
}
>
...
...
This diff is collapsed.
Click to expand it.
packages/client/src/schema-component/antd/upload/Upload.tsx
+
2
-
2
View file @
8af19d24
...
...
@@ -38,6 +38,7 @@ Upload.Attachment = connect((props: UploadProps) => {
setFileList
(
toFileList
(
value
));
}
},
[
value
,
sync
]);
const
uploadProps
=
useUploadProps
({
...
props
});
return
(
<
div
>
<
div
className
=
{
cls
(
'
ant-upload-picture-card-wrapper nb-upload
'
)
}
>
...
...
@@ -126,7 +127,7 @@ Upload.Attachment = connect((props: UploadProps) => {
{
!
disabled
&&
(
multiple
||
toArr
(
value
).
length
<
1
)
&&
(
<
div
className
=
{
'
ant-upload-list-picture-card-container
'
}
>
<
AntdUpload
{
...
u
seU
ploadProps
({
...
props
})
}
{
...
uploadProps
}
disabled
=
{
disabled
}
multiple
=
{
multiple
}
listType
=
{
'
picture-card
'
}
...
...
@@ -140,7 +141,6 @@ Upload.Attachment = connect((props: UploadProps) => {
setFileList
(
info
.
fileList
.
map
(
toItem
));
}
else
{
if
(
info
.
file
.
status
===
'
done
'
)
{
console
.
log
(
'
field.value
'
,
info
.
file
?.
response
?.
data
);
// TODO(BUG): object 的联动有问题,不响应,折中的办法先置空再赋值
onChange
(
null
);
onChange
(
info
.
file
?.
response
?.
data
);
...
...
This diff is collapsed.
Click to expand it.
packages/client/src/schema-component/antd/upload/shared.ts
+
1
-
2
View file @
8af19d24
...
...
@@ -2,10 +2,10 @@ import { Field } from '@formily/core';
import
{
useField
}
from
'
@formily/react
'
;
import
{
reaction
}
from
'
@formily/reactive
'
;
import
{
isArr
,
isValid
,
toArr
as
toArray
}
from
'
@formily/shared
'
;
import
{
useAPIClient
}
from
'
../../../api-client
'
;
import
{
UploadChangeParam
}
from
'
antd/lib/upload
'
;
import
{
UploadFile
}
from
'
antd/lib/upload/interface
'
;
import
{
useEffect
}
from
'
react
'
;
import
{
useAPIClient
}
from
'
../../../api-client
'
;
import
{
UPLOAD_PLACEHOLDER
}
from
'
./placeholder
'
;
import
type
{
IUploadProps
,
UploadProps
}
from
'
./type
'
;
...
...
@@ -28,7 +28,6 @@ export const toMap = (fileList: any) => {
}
list
=
[
fileList
];
}
console
.
log
({
list
,
fileList
});
return
list
.
map
((
item
)
=>
{
return
[
item
.
id
||
item
.
uid
,
toItem
(
item
)];
});
...
...
This diff is collapsed.
Click to expand it.
packages/client/src/system-settings/SystemSettingsShortcut.tsx
+
8
-
3
View file @
8af19d24
...
...
@@ -9,7 +9,6 @@ import { ActionContext, SchemaComponent, useActionContext } from '../schema-comp
const
useCloseAction
=
()
=>
{
const
{
setVisible
}
=
useActionContext
();
// const form = useForm();
return
{
async
run
()
{
setVisible
(
false
);
...
...
@@ -18,23 +17,28 @@ const useCloseAction = () => {
};
const
useSystemSettingsValues
=
(
options
)
=>
{
const
{
visible
}
=
useActionContext
();
const
result
=
useSystemSettings
();
return
useRequest
(()
=>
Promise
.
resolve
(
result
.
data
),
{
...
options
,
refreshDeps
:
[
visible
],
});
};
const
useSaveSystemSettingsValues
=
()
=>
{
const
{
setVisible
}
=
useActionContext
();
const
form
=
useForm
();
const
{
mutate
}
=
useSystemSettings
();
const
{
mutate
,
data
}
=
useSystemSettings
();
const
api
=
useAPIClient
();
return
{
async
run
()
{
await
form
.
submit
();
setVisible
(
false
);
mutate
({
data
:
form
.
values
,
data
:
{
...
data
?.
data
,
...
form
.
values
,
},
});
await
api
.
request
({
url
:
'
systemSettings:update/1
'
,
...
...
@@ -108,6 +112,7 @@ const schema: ISchema = {
'
x-component
'
:
'
Action
'
,
'
x-component-props
'
:
{
type
:
'
primary
'
,
htmlType
:
'
submit
'
,
useAction
:
'
{{ useSaveSystemSettingsValues }}
'
,
},
},
...
...
This diff is collapsed.
Click to expand it.
packages/client/src/user/SigninPage.tsx
+
1
-
0
View file @
8af19d24
...
...
@@ -33,6 +33,7 @@ const schema: ISchema = {
type
:
'
void
'
,
'
x-component
'
:
'
Action
'
,
'
x-component-props
'
:
{
htmlType
:
'
submit
'
,
block
:
true
,
type
:
'
primary
'
,
useAction
:
'
{{ useSignin }}
'
,
...
...
This diff is collapsed.
Click to expand it.
packages/client/src/user/SignupPage.tsx
+
1
-
0
View file @
8af19d24
...
...
@@ -63,6 +63,7 @@ const schema: ISchema = {
'
x-component-props
'
:
{
block
:
true
,
type
:
'
primary
'
,
htmlType
:
'
submit
'
,
useAction
:
'
{{ useSignup }}
'
,
style
:
{
width
:
'
100%
'
},
},
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment
Menu
Projects
Groups
Snippets
Help