Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
Project
Project
Details
Activity
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
shenshaokai
jinfa-admin
Commits
0aa96a0b
Commit
0aa96a0b
authored
Jul 27, 2021
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 消息bug以及内容管理bug
parent
4f7da662
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
40 deletions
+47
-40
index.tsx
src/pages/content/advertisement/index.tsx
+15
-16
announceInfo.tsx
src/pages/content/announcements/announceInfo.tsx
+2
-2
index.tsx
src/pages/content/announcements/schema/index.tsx
+2
-1
statusList.ts
src/pages/content/statusList.ts
+1
-1
addMessage.tsx
src/pages/message/addMessage.tsx
+26
-20
index.less
src/pages/message/index.less
+1
-0
No files found.
src/pages/content/advertisement/index.tsx
View file @
0aa96a0b
...
...
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
import
{
FilterTable
}
from
'../components/FilterTable'
;
import
{
Card
,
Input
,
Button
,
Table
,
Dropdown
,
Menu
,
Select
,
Space
,
Popconfirm
,
Modal
}
from
'antd'
;
import
{
createVirtualBox
,
createFormActions
,
FormEffectHooks
,
createEffectHook
}
from
'@formily/antd'
;
import
{
history
,
Link
}
from
'umi'
;
import
{
history
,
Link
}
from
'umi'
;
import
{
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
;
import
{
timeRange
}
from
'@/utils/index'
;
import
{
PublicApi
}
from
'@/services/api'
;
...
...
@@ -41,9 +41,9 @@ const Advertisement = () => {
state
.
visible
=
false
;
})
})
merge
(
onFieldValueChange$
(
'status'
),
onFieldValueChange$
(
'status'
),
onFieldValueChange$
(
'time'
),
).
subscribe
(
fieldState
=>
{
...
...
@@ -65,9 +65,9 @@ const Advertisement = () => {
const
postData
=
{
title
:
title
||
''
,
status
:
status
!=
0
?
status
:
''
,
startTime
:
st
&&
st
*
1000
,
endTime
:
et
&&
et
*
1000
,
current
:
1
,
startTime
:
st
||
null
,
endTime
:
et
||
null
,
current
:
1
,
pageSize
:
10
,
...
params
,
}
...
...
@@ -85,7 +85,7 @@ const Advertisement = () => {
})
},
})
}
// 修改状态
...
...
@@ -109,7 +109,7 @@ const Advertisement = () => {
return
(
<
Card
>
<
FilterTable
<
FilterTable
schema=
{
advertisementSchema
}
components=
{
{
CustomSearch
,
...
...
@@ -148,7 +148,7 @@ const Advertisement = () => {
</
span
>
)
},
toggleFilters
:
()
=>
{
actions
.
setFieldState
(
'FILTERS'
,
state
=>
{
const
visible
=
!
state
.
visible
;
...
...
@@ -160,10 +160,10 @@ const Advertisement = () => {
)
})
});
},
renderOperation
:
(
val
,
record
)
=>
{
const
status
=
[
""
,
"上架"
,
"下架"
,
"上架"
];
const
status
=
[
""
,
"上架"
,
"下架"
,
"上架"
];
const
canModify
=
[
1
,
3
]
const
menu
=
(
<
Menu
>
...
...
@@ -176,7 +176,7 @@ const Advertisement = () => {
<
a
>
删除
</
a
>
</
Menu
.
Item
>
</
Menu
.
Item
>
</
Menu
>
)
return
(
...
...
@@ -192,7 +192,7 @@ const Advertisement = () => {
</
Popconfirm
>
{
/* // 只有待上架, 已下架架才有 修改和删除 */
}
{
canModify
.
includes
(
record
.
status
)
canModify
.
includes
(
record
.
status
)
?
(
<
Dropdown
overlay=
{
menu
}
>
<
a
>
...
...
@@ -205,7 +205,7 @@ const Advertisement = () => {
</
Space
>
)
},
}
}
effects=
{
advertisementEffects
()
}
>
...
...
@@ -214,4 +214,4 @@ const Advertisement = () => {
)
}
export
default
Advertisement
;
\ No newline at end of file
export
default
Advertisement
;
src/pages/content/announcements/announceInfo.tsx
View file @
0aa96a0b
...
...
@@ -29,8 +29,8 @@ const AdvertisementInfo = () => {
const
isView
=
id
&&
preview
;
useEffect
(()
=>
{
const
data
=
initialValues
.
data
||
{}
const
content
=
data
.
content
;
const
data
=
initialValues
?
.
data
||
{}
const
content
=
data
?
.
content
;
if
(
content
)
{
const
editorState
=
BraftEditor
.
createEditorState
(
content
);
actions
.
setFieldValue
(
'layout.contentLayout.content'
,
editorState
);
...
...
src/pages/content/announcements/schema/index.tsx
View file @
0aa96a0b
...
...
@@ -29,7 +29,7 @@ const columns = [
)
},
{
title
:
'
操作
时间'
,
title
:
'
发布
时间'
,
dataIndex
:
'createTime'
,
render
:
(
text
)
=>
(
moment
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
...
...
@@ -169,6 +169,7 @@ const announcementSchema = {
type
:
'string'
,
'x-component'
:
'Select'
,
'x-component-props'
:
{
placeholder
:
'发布时间(全部)'
,
options
:
TimeList
,
style
:
{
width
:
'160px'
,
...
...
src/pages/content/statusList.ts
View file @
0aa96a0b
...
...
@@ -6,7 +6,7 @@
*/
export
const
TimeList
=
[
{
label
:
'
单据
时间(全部)'
,
value
:
0
label
:
'
发布
时间(全部)'
,
value
:
0
},
{
label
:
'今天'
,
value
:
1
...
...
src/pages/message/addMessage.tsx
View file @
0aa96a0b
...
...
@@ -15,21 +15,33 @@ interface Irole {
value
:
number
}
type
SubmitType
=
{
/** 消息标题 */
title
:
string
,
/** 消息内容 */
content
:
string
,
/** 跳转链接 */
url
:
string
,
/** 发送对象 */
roleIds
:
number
,
}
const
AddMessage
:
React
.
FC
<
{}
>
=
()
=>
{
const
[
roles
,
setRoles
]
=
useState
<
Irole
[]
>
([])
const
{
pageStatus
}
=
usePageStatus
()
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
const
handleSubmit
=
(
val
)
=>
{
const
data
=
{
const
handleSubmit
=
async
(
val
:
SubmitType
)
=>
{
setLoading
(
true
)
const
postData
=
{
...
val
,
roleIds
:
val
.
roleIds
===
0
?
roles
.
map
((
item
)
=>
item
.
value
)
:
[
val
.
roleIds
],
}
PublicApi
.
postReportMessagePlatformSend
(
data
)
.
then
((
data
)
=>
{
if
(
data
.
code
===
1000
)
{
history
.
push
(
'/message/messageList'
);
}
})
const
{
data
,
code
}
=
await
PublicApi
.
postMessageMessagePlatformSend
(
postData
);
setLoading
(
false
)
if
(
data
.
code
===
1000
)
{
history
.
push
(
'/message/messageList'
);
}
}
const
getSendTargets
=
async
()
=>
{
const
res
=
await
PublicApi
.
getMemberManageRoleAll
();
...
...
@@ -55,7 +67,7 @@ const AddMessage: React.FC<{}> = () => {
title=
"新建消息"
>
<
Card
>
<
NiceForm
<
NiceForm
labelCol=
{
4
}
labelAlign=
"left"
wrapperCol=
{
12
}
...
...
@@ -68,12 +80,7 @@ const AddMessage: React.FC<{}> = () => {
type
:
'string'
,
title
:
'发送对象'
,
required
:
true
,
enum
:
[
{
label
:
'One'
,
value
:
'1'
},
{
label
:
'Two'
,
value
:
'2'
},
{
label
:
'Three'
,
value
:
'3'
},
{
label
:
'Four'
,
value
:
'4'
}
],
enum
:
[],
},
title
:
{
type
:
'textarea'
,
...
...
@@ -115,12 +122,12 @@ const AddMessage: React.FC<{}> = () => {
}
}
}
onSubmit=
{
handleSubmit
}
effects=
{
creatEffect
()
}
>
<
FormButtonGroup
offset=
{
4
}
>
<
Submit
>
发送
</
Submit
>
<
Button
onClick=
{
()
=>
history
.
goBack
()
}
>
取消
</
Button
>
<
Submit
loading=
{
loading
}
>
发送
</
Submit
>
{
/* <Button onClick={()=>history.goBack()}>取消</Button> */
}
</
FormButtonGroup
>
</
NiceForm
>
</
Card
>
...
...
@@ -128,4 +135,4 @@ const AddMessage: React.FC<{}> = () => {
);
}
export
default
AddMessage
\ No newline at end of file
export
default
AddMessage
src/pages/message/index.less
View file @
0aa96a0b
...
...
@@ -2,6 +2,7 @@
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 8px;
}
.customList{
...
...
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