Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cs_vsofpm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wuhao
cs_vsofpm
Commits
edd6acbb
Commit
edd6acbb
authored
May 08, 2023
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asder
parent
e09e893d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
36 deletions
+50
-36
FormItems.jsx
src/components/InitForm/FormItems.jsx
+33
-31
index.jsx
src/components/InitForm/index.jsx
+1
-1
index.jsx
src/components/TreeRender/index.jsx
+2
-1
useDidUpdateEffect.js
src/hooks/useDidUpdateEffect.js
+11
-0
index.jsx
src/pages/lessons/index.jsx
+3
-3
No files found.
src/components/InitForm/FormItems.jsx
View file @
edd6acbb
import
React
,
{
useState
,
useRef
,
memo
,
createElement
,
useEffect
}
from
"react"
;
import
useDidUpdateEffect
from
"@/hooks/useDidUpdateEffect"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
{
CloseOutlined
,
DownOutlined
,
PlusOutlined
,
RedoOutlined
,
}
from
"@ant-design/icons"
;
import
{
import
{
ProForm
,
ProForm
,
ProFormDependency
,
ProFormCascader
,
ProFormSelect
,
ProFormCheckbox
,
ProFormText
,
ProFormMoney
,
ProFormTextArea
,
ProFormDigit
,
ProFormDigitRange
,
ProFormDatePicker
,
ProFormDatePicker
,
ProFormDateTimePicker
,
ProFormDateRangePicker
,
ProFormDateRangePicker
,
ProFormDateTimePicker
,
ProFormDateTimeRangePicker
,
ProFormDateTimeRangePicker
,
ProFormTimePicker
,
ProFormDependency
,
ProFormTreeSelect
,
ProFormDigit
,
ProFormCheckbox
,
ProFormDigitRange
,
ProFormList
,
ProFormMoney
,
ProFormRadio
,
ProFormRadio
,
ProFormCascader
,
ProFormSwitch
,
ProFormRate
,
ProFormRate
,
ProFormSelect
,
ProFormSlider
,
ProFormSlider
,
ProFormUploadDragger
,
ProFormSwitch
,
ProFormText
,
ProFormTextArea
,
ProFormTimePicker
,
ProFormTreeSelect
,
ProFormUploadButton
,
ProFormUploadButton
,
ProForm
List
,
ProForm
UploadDragger
,
}
from
"@ant-design/pro-components"
;
}
from
"@ant-design/pro-components"
;
import
*
as
Antd
from
"antd"
;
import
ImgCrop
from
"antd-img-crop"
;
import
ImgCrop
from
"antd-img-crop"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
dayjs
from
"dayjs"
;
import
dayjs
from
"dayjs"
;
import
*
as
Antd
from
"antd"
;
import
{
createElement
,
memo
,
useRef
,
useState
}
from
"react"
;
import
{
PlusOutlined
,
DownOutlined
,
CloseOutlined
,
RedoOutlined
,
}
from
"@ant-design/icons"
;
import
EditTable
from
"./EditTable"
;
import
EditorItem
from
"./EditorItem"
;
import
EditorItem
from
"./EditorItem"
;
import
EditTable
from
"./EditTable"
;
const
{
Image
,
Form
,
Upload
,
Col
,
Dropdown
,
Menu
,
Tabs
}
=
Antd
;
const
{
Image
,
Form
,
Upload
,
Col
,
Dropdown
,
Menu
,
Tabs
}
=
Antd
;
...
@@ -455,7 +456,7 @@ function NolinkSelect({ item, colProps }) {
...
@@ -455,7 +456,7 @@ function NolinkSelect({ item, colProps }) {
return
(
return
(
<>
<>
<
ProFormSelect
<
ProFormSelect
fieldProps=
{
{
...
item
.
fieldProps
,
dropdownMatchSelectWidth
:
200
}
}
fieldProps=
{
{
...
item
.
fieldProps
,
dropdownMatchSelectWidth
:
200
}
}
formItemProps=
{
item
.
formItemProps
}
formItemProps=
{
item
.
formItemProps
}
name=
{
item
.
key
??
item
.
dataIndex
}
name=
{
item
.
key
??
item
.
dataIndex
}
colProps=
{
item
.
colProps
??
colProps
}
colProps=
{
item
.
colProps
??
colProps
}
...
@@ -1391,8 +1392,9 @@ function TableSelect({ item, value, onChange, params = {} }) {
...
@@ -1391,8 +1392,9 @@ function TableSelect({ item, value, onChange, params = {} }) {
}
}
/>
/>
);
);
useEffect
(()
=>
{
onChange
([]);
useDidUpdateEffect
(()
=>
{
onChange
(
null
);
actionRef
?.
current
?.
reload
?.();
actionRef
?.
current
?.
reload
?.();
},
[
params
]);
},
[
params
]);
...
@@ -1419,7 +1421,7 @@ function TableSelect({ item, value, onChange, params = {} }) {
...
@@ -1419,7 +1421,7 @@ function TableSelect({ item, value, onChange, params = {} }) {
...
item
.
rowSelection
,
...
item
.
rowSelection
,
columnWidth
:
44
,
columnWidth
:
44
,
preserveSelectedRowKeys
:
true
,
preserveSelectedRowKeys
:
true
,
selectedRowKeys
:
value
&&
value
?.
map
((
it
)
=>
it
[
rowKey
])
,
selectedRowKeys
:
value
?
value
?.
map
((
it
)
=>
it
[
rowKey
])
:
[]
,
onChange
:
(
selectedKeys
,
selectedRows
)
=>
{
onChange
:
(
selectedKeys
,
selectedRows
)
=>
{
const
rowkeylist
=
value
?
value
?.
map
((
it
)
=>
it
[
rowKey
])
:
[];
const
rowkeylist
=
value
?
value
?.
map
((
it
)
=>
it
[
rowKey
])
:
[];
const
newValue
=
selectedRows
?.
map
((
its
)
=>
{
const
newValue
=
selectedRows
?.
map
((
its
)
=>
{
...
@@ -1467,7 +1469,7 @@ function TableSelect({ item, value, onChange, params = {} }) {
...
@@ -1467,7 +1469,7 @@ function TableSelect({ item, value, onChange, params = {} }) {
...
item
.
rowSelection
,
...
item
.
rowSelection
,
columnWidth
:
44
,
columnWidth
:
44
,
preserveSelectedRowKeys
:
true
,
preserveSelectedRowKeys
:
true
,
selectedRowKeys
:
value
&&
value
?.
map
((
it
)
=>
it
[
rowKey
])
,
selectedRowKeys
:
value
?
value
?.
map
((
it
)
=>
it
[
rowKey
])
:
[]
,
onChange
:
(
selectedKeys
,
selectedRows
)
=>
{
onChange
:
(
selectedKeys
,
selectedRows
)
=>
{
const
rowkeylist
=
value
?
value
?.
map
((
it
)
=>
it
[
rowKey
])
:
[];
const
rowkeylist
=
value
?
value
?.
map
((
it
)
=>
it
[
rowKey
])
:
[];
const
newValue
=
selectedRows
?.
map
((
its
)
=>
{
const
newValue
=
selectedRows
?.
map
((
its
)
=>
{
...
@@ -1500,7 +1502,7 @@ function TableSelect({ item, value, onChange, params = {} }) {
...
@@ -1500,7 +1502,7 @@ function TableSelect({ item, value, onChange, params = {} }) {
<
Tabs
<
Tabs
tabBarExtraContent=
{
tabBarExtraContent=
{
<
div
className=
"center"
>
<
div
className=
"center"
>
<
Dropdown
overlay
=
{
menu
(
value
??
[])
}
>
<
Dropdown
menu
=
{
menu
(
value
??
[])
}
>
<
a
>
<
a
>
已选择
{
value
?.
length
??
0
}
项
<
DownOutlined
/>
已选择
{
value
?.
length
??
0
}
项
<
DownOutlined
/>
</
a
>
</
a
>
...
...
src/components/InitForm/index.jsx
View file @
edd6acbb
...
@@ -130,7 +130,7 @@ function InitForm({
...
@@ -130,7 +130,7 @@ function InitForm({
variant=
"contained"
variant=
"contained"
onClick=
{
(
e
)
=>
{
onClick=
{
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
return
props
.
form
?.
submit
?.()
return
props
.
form
?.
submit
?.()
;
}
}
}
}
>
>
提交
提交
...
...
src/components/TreeRender/index.jsx
View file @
edd6acbb
...
@@ -369,7 +369,8 @@ function TreeRender({
...
@@ -369,7 +369,8 @@ function TreeRender({
</
IconButton
>
</
IconButton
>
<
Modal
<
Modal
{
...
drawer
}
{
...
drawer
}
closable=
{
true
}
closable=
{
false
}
maskClosable=
{
true
}
title=
"新增章标题"
title=
"新增章标题"
okText=
"新增"
okText=
"新增"
cancelText=
"取消"
cancelText=
"取消"
...
...
src/hooks/useDidUpdateEffect.js
0 → 100644
View file @
edd6acbb
import
{
useEffect
,
useRef
}
from
"react"
;
const
useDidUpdateEffect
=
(
fn
,
inputs
)
=>
{
const
didMountRef
=
useRef
(
false
);
useEffect
(()
=>
{
if
(
didMountRef
.
current
)
fn
();
else
didMountRef
.
current
=
true
;
},
inputs
);
};
export
default
useDidUpdateEffect
;
src/pages/lessons/index.jsx
View file @
edd6acbb
...
@@ -149,9 +149,9 @@ function Lessons() {
...
@@ -149,9 +149,9 @@ function Lessons() {
></
InitForm
>
></
InitForm
>
)
:
(
)
:
(
<
InitForm
<
InitForm
//
defaultFormValue=
{{
defaultFormValue=
{
{
//
teacherIdList: dialogprops?.teacherIdList,
teacherIdList
:
dialogprops
?.
teacherIdList
,
//
}}
}
}
fields=
{
[
fields=
{
[
{
{
rowKey
:
"id"
,
rowKey
:
"id"
,
...
...
Write
Preview
Markdown
is supported
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