Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
992d4e9b
提交
992d4e9b
authored
12月 18, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化:通知管理编辑
上级
df72cd35
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
29 行增加
和
5 行删除
+29
-5
resourceManageAPI.ts
src/api/modules/resourceManageAPI.ts
+4
-0
index.tsx
...s/resourceManage/noticeManage/comp/addEditModal/index.tsx
+13
-3
index.tsx
src/pages/resourceManage/noticeManage/index.tsx
+12
-2
没有找到文件。
src/api/modules/resourceManageAPI.ts
浏览文件 @
992d4e9b
...
@@ -106,6 +106,10 @@ export class ResourceManageAPI {
...
@@ -106,6 +106,10 @@ export class ResourceManageAPI {
static insertSystemMessage: insertSystemMessage = (params) =>
static insertSystemMessage: insertSystemMessage = (params) =>
axios.post('/userapp/message/insertSystemMessage', params);
axios.post('/userapp/message/insertSystemMessage', params);
// 后台发布消息——修改系统消息
static updateSystemMessage: insertSystemMessage = (params) =>
axios.post('/userapp/message/insertSystemMessage', params);
// 后台——删除消息
// 后台——删除消息
static removeMessage: removeMessage = (params) =>
static removeMessage: removeMessage = (params) =>
axios.get('/userapp/message/removeMessage', { params });
axios.get('/userapp/message/removeMessage', { params });
...
...
src/pages/resourceManage/noticeManage/comp/addEditModal/index.tsx
浏览文件 @
992d4e9b
import
React
from
'react'
;
import
React
,
{
useEffect
}
from
'react'
;
import
{
Form
,
Input
,
message
,
Modal
,
ModalProps
}
from
'antd'
;
import
{
Form
,
Input
,
message
,
Modal
,
ModalProps
}
from
'antd'
;
import
{
InterReqType
}
from
'~/api/interface'
;
import
{
InterReqType
}
from
'~/api/interface'
;
import
{
insertSystemMessage
}
from
'~/api/interface/resourceManageType'
;
import
{
insertSystemMessage
}
from
'~/api/interface/resourceManageType'
;
...
@@ -29,7 +29,12 @@ const AddEditModalView: React.FC<ModalProps & { data?: any; onCancel: () => void
...
@@ -29,7 +29,12 @@ const AddEditModalView: React.FC<ModalProps & { data?: any; onCancel: () => void
};
};
// 提交数据
// 提交数据
const
handleSubmit
=
async
(
values
:
ReqType
)
=>
{
const
handleSubmit
=
async
(
values
:
ReqType
)
=>
{
const
res
=
await
ResourceManageAPI
.
insertSystemMessage
(
values
);
const
res
=
await
ResourceManageAPI
[
props
.
data
?.
id
?
'updateSystemMessage'
:
'insertSystemMessage'
]({
...
props
.
data
,
...
values
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
if
(
res
&&
res
.
code
===
'200'
)
{
message
.
success
(
'操作成功'
);
message
.
success
(
'操作成功'
);
handleClose
();
handleClose
();
...
@@ -40,6 +45,11 @@ const AddEditModalView: React.FC<ModalProps & { data?: any; onCancel: () => void
...
@@ -40,6 +45,11 @@ const AddEditModalView: React.FC<ModalProps & { data?: any; onCancel: () => void
form
.
resetFields
();
form
.
resetFields
();
props
.
onCancel
?.();
props
.
onCancel
?.();
};
};
// 组件挂载
useEffect
(()
=>
{
if
(
!
props
.
data
)
return
;
form
.
setFieldsValue
(
props
.
data
);
},
[
props
.
data
]);
return
(
return
(
<
Modal
{
...
props
}
width=
{
680
}
onOk=
{
handleOk
}
onCancel=
{
handleClose
}
>
<
Modal
{
...
props
}
width=
{
680
}
onOk=
{
handleOk
}
onCancel=
{
handleClose
}
>
<
Form
<
Form
...
@@ -59,7 +69,7 @@ const AddEditModalView: React.FC<ModalProps & { data?: any; onCancel: () => void
...
@@ -59,7 +69,7 @@ const AddEditModalView: React.FC<ModalProps & { data?: any; onCancel: () => void
wrapperCol=
{
{
span
:
22
}
}
wrapperCol=
{
{
span
:
22
}
}
>
>
<
RichText
<
RichText
richTextContent=
{
form
.
getFieldValue
(
'content'
)
||
''
}
richTextContent=
{
form
.
getFieldValue
(
'content'
)
||
props
?.
data
?.
content
}
onChange=
{
(
e
)
=>
form
.
setFieldValue
(
'content'
,
e
)
}
onChange=
{
(
e
)
=>
form
.
setFieldValue
(
'content'
,
e
)
}
height=
{
250
}
height=
{
250
}
/>
/>
...
...
src/pages/resourceManage/noticeManage/index.tsx
浏览文件 @
992d4e9b
...
@@ -22,6 +22,8 @@ const NoticeManageView = () => {
...
@@ -22,6 +22,8 @@ const NoticeManageView = () => {
pageSize
:
10
,
pageSize
:
10
,
totalCount
:
0
,
totalCount
:
0
,
});
});
// 编辑的内容
const
[
recordData
,
setRecordData
]
=
useState
<
ListType
[
0
]
>
();
// 加载列表
// 加载列表
const
getTableList
=
async
(
value
=
{})
=>
{
const
getTableList
=
async
(
value
=
{})
=>
{
// 只需要修改这个地方的接口即可
// 只需要修改这个地方的接口即可
...
@@ -98,7 +100,13 @@ const NoticeManageView = () => {
...
@@ -98,7 +100,13 @@ const NoticeManageView = () => {
width
:
'200px'
,
width
:
'200px'
,
render
:
(
_text
,
record
)
=>
(
render
:
(
_text
,
record
)
=>
(
<>
<>
<
Button
type=
{
'link'
}
disabled
>
<
Button
type=
{
'link'
}
onClick=
{
()
=>
{
setRecordData
(
record
);
setAddEditModalVisible
(
true
);
}
}
>
编辑
编辑
</
Button
>
</
Button
>
<
Button
type=
{
'link'
}
danger
onClick=
{
()
=>
handleDelete
(
record
)
}
>
<
Button
type=
{
'link'
}
danger
onClick=
{
()
=>
handleDelete
(
record
)
}
>
...
@@ -139,11 +147,13 @@ const NoticeManageView = () => {
...
@@ -139,11 +147,13 @@ const NoticeManageView = () => {
}
}
}
}
/>
/>
<
AddEditModalView
<
AddEditModalView
title=
{
'新增通知'
}
title=
{
recordData
?.
id
?
'编辑通知'
:
'新增通知'
}
open=
{
addEditModalVisible
}
open=
{
addEditModalVisible
}
data=
{
recordData
}
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
setAddEditModalVisible
(
false
);
setAddEditModalVisible
(
false
);
paginationChange
(
pagination
.
pageNo
,
pagination
.
pageSize
);
paginationChange
(
pagination
.
pageNo
,
pagination
.
pageSize
);
setRecordData
(
undefined
);
}
}
}
}
/>
/>
</>
</>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论