Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
web-ci-test
Commits
26337165
提交
26337165
authored
5月 27, 2023
作者:
翁进城
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
项目资讯补充
上级
08c2d1a8
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
60 行增加
和
9 行删除
+60
-9
index.tsx
pages/projectInfo/components/bids/index.tsx
+1
-1
index.ts
pages/projectInfo/components/requirements/api/index.ts
+15
-0
index.tsx
pages/projectInfo/components/requirements/index.tsx
+44
-8
没有找到文件。
pages/projectInfo/components/bids/index.tsx
浏览文件 @
26337165
...
...
@@ -65,7 +65,7 @@ export default function Bids(props: Props) {
<
div
className=
{
styles
.
item
}
key=
{
item
.
id
}
>
<
div
className=
{
styles
.
info
}
>
<
div
className=
{
styles
.
title
}
>
项目需求:
{
item
.
tenderContent
}
{
item
.
tenderContent
}
</
div
>
</
div
>
{
item
.
apply
?
(
...
...
pages/projectInfo/components/requirements/api/index.ts
浏览文件 @
26337165
...
...
@@ -29,6 +29,12 @@ export interface Item {
updateTime
?:
string
;
}
export
interface
SolveRequireParams
{
requirementsInfoId
:
number
,
//需求id
userAccountId
:
number
//用户id
}
export
default
{
/**
* 需求发布列表
...
...
@@ -37,5 +43,13 @@ export default {
*/
listPublishPage
(
params
:
ListPublishPageParams
,
options
=
{}):
Promise
<
Response
<
ListPublishPageResp
>>
{
return
request
(
'/release/requirements/listPublishPage'
,
'post'
,
params
,
options
);
},
/**
* 需求已解决
* @param params
* @returns
*/
solveRequire
(
params
:
SolveRequireParams
):
Promise
<
Response
<
null
>>
{
return
request
(
'/release/requirements/solveRequire'
,
'get'
,
params
);
}
}
\ No newline at end of file
pages/projectInfo/components/requirements/index.tsx
浏览文件 @
26337165
import
{
Button
,
Empty
,
Pagination
,
Spin
}
from
"antd"
;
import
{
Button
,
Empty
,
Pagination
,
Popconfirm
,
Spin
}
from
"antd"
;
import
router
from
"next/router"
;
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
api
,
{
Item
}
from
"./api"
;
...
...
@@ -22,12 +22,18 @@ export default function Requirements(props: Props) {
});
const
[
count
,
setCount
]
=
useState
(
0
);
const
[
abort
,
setAbort
]
=
useState
<
AbortController
|
null
>
(
null
);
const
[
userId
,
setUserId
]
=
useState
(
-
1
);
const
[
reload
,
setReload
]
=
useState
(
false
);
useEffect
(()
=>
{
setUserId
(
Number
(
window
.
localStorage
.
getItem
(
"userId"
)
||
-
1
));
},
[]);
useEffect
(()
=>
{
//中断前一次请求
abort
?.
abort
();
setAbort
(
new
AbortController
());
},
[
pageParams
,
props
.
params
]);
},
[
pageParams
,
props
.
params
,
reload
]);
useEffect
(()
=>
{
if
(
!
abort
)
{
...
...
@@ -58,6 +64,24 @@ export default function Requirements(props: Props) {
});
};
/**
* 确认解决
* @param e
*/
const
confirmSolved
=
(
item
:
Item
)
=>
{
api
.
solveRequire
({
requirementsInfoId
:
item
.
id
,
userAccountId
:
userId
}).
then
(
res
=>
{
if
(
res
.
code
===
'200'
){
window
.
messageApi
.
success
(
'提交完成'
);
setReload
(
!
reload
);
}
})
};
return
(
<
Spin
spinning=
{
loading
}
delay=
{
500
}
>
<
div
className=
{
styles
.
requirements
}
style=
{
{
height
:
635
}
}
>
...
...
@@ -76,12 +100,24 @@ export default function Requirements(props: Props) {
具体需求:
{
item
.
requireDescription
}
</
div
>
</
div
>
<
Button
type=
"primary"
style=
{
{
width
:
120
,
height
:
40
,
flexShrink
:
0
}
}
>
申请合作
</
Button
>
{
item
.
userAccountId
===
userId
&&
(
<
Popconfirm
title=
"提示"
description=
"确认该需求已经解决了吗?"
onConfirm=
{
()
=>
confirmSolved
(
item
)
}
okText=
"是"
cancelText=
"否"
disabled=
{
!!
item
.
solved
}
>
<
Button
type=
"primary"
style=
{
{
width
:
120
,
height
:
40
,
flexShrink
:
0
}
}
disabled=
{
!!
item
.
solved
}
>
已解决
</
Button
>
</
Popconfirm
>
)
}
</
div
>
);
})
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论