Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
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
zhaochengxiang
szse
Commits
a669fc26
Commit
a669fc26
authored
Oct 17, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
评估方案
parent
b0f5c229
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
14 deletions
+40
-14
assetmanage.js
src/model/assetmanage.js
+2
-2
dataassetmanager.js
src/service/dataassetmanager.js
+1
-1
add.jsx
src/view/Manage/AssetEvaluate/add.jsx
+11
-5
index.jsx
src/view/Manage/AssetEvaluate/index.jsx
+26
-6
No files found.
src/model/assetmanage.js
View file @
a669fc26
...
...
@@ -301,8 +301,8 @@ export function* saveEvaluation(payload) {
return
yield
call
(
service
.
saveEvaluation
,
payload
)
}
export
function
*
runEvaluation
(
payload
)
{
return
yield
call
(
service
.
runEvaluation
,
payload
)
export
function
*
runEvaluation
s
(
payload
)
{
return
yield
call
(
service
.
runEvaluation
s
,
payload
)
}
export
function
*
deleteEvaluations
(
payload
)
{
...
...
src/service/dataassetmanager.js
View file @
a669fc26
...
...
@@ -308,7 +308,7 @@ export function saveEvaluation(payload) {
return
PostJSON
(
'/dataassetmanager/evaluationApi/saveProject'
,
payload
)
}
export
function
runEvaluation
(
payload
)
{
export
function
runEvaluation
s
(
payload
)
{
return
PostJSON
(
'/dataassetmanager/evaluationApi/run'
,
payload
)
}
...
...
src/view/Manage/AssetEvaluate/add.jsx
View file @
a669fc26
...
...
@@ -5,7 +5,7 @@ import produce from "immer"
import
{
dispatch
}
from
'../../../model'
const
FC
=
(
props
)
=>
{
const
{
visible
,
onCancel
}
=
props
const
{
visible
,
item
,
action
,
onCancel
}
=
props
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
elements
,
setElements
]
=
React
.
useState
()
...
...
@@ -43,7 +43,7 @@ const FC = (props) => {
dispatch
({
type
:
'assetmanage.saveEvaluation'
,
payload
:
{
data
:
row
data
:
(
action
===
'add'
)?
row
:{...
item
,
...
row
}
},
callback
:
data
=>
{
close
(
true
)
...
...
@@ -80,7 +80,7 @@ const FC = (props) => {
onCancel=
{
()
=>
{
close
()
}
}
>
<
Spin
spinning=
{
loading
||
waiting
}
>
<
Basic
ref=
{
basicRef
}
elements=
{
elements
}
/>
<
Basic
ref=
{
basicRef
}
item=
{
item
}
elements=
{
elements
}
/>
</
Spin
>
</
Modal
>
)
...
...
@@ -88,15 +88,21 @@ const FC = (props) => {
export
default
FC
const
Basic
=
React
.
forwardRef
(
function
({
elements
},
ref
)
{
const
Basic
=
React
.
forwardRef
(
function
({
item
,
elements
},
ref
)
{
const
[
form
]
=
Form
.
useForm
()
React
.
useImperativeHandle
(
ref
,
()
=>
({
validate
:
async
()
=>
{
return
await
form
.
validateFields
()
return
await
form
?
.
validateFields
()
},
}),
[
form
])
React
.
useEffect
(()
=>
{
if
(
item
)
{
form
?.
setFieldsValue
(
item
)
}
},
[
item
])
return
(
<
Form
form=
{
form
}
...
...
src/view/Manage/AssetEvaluate/index.jsx
View file @
a669fc26
...
...
@@ -28,7 +28,9 @@ const FC = (props) => {
const
$keyword
=
React
.
useMemo
(()
=>
new
Subject
(),
[])
const
[
keyword
,
setKeyword
]
=
React
.
useState
()
const
[
addEvaluateParams
,
setAddEvaluateParams
]
=
React
.
useState
({
visible
:
false
visible
:
false
,
item
:
undefined
,
action
:
undefined
})
const
[
selectedRows
,
setSelectedRows
]
=
React
.
useState
([])
...
...
@@ -126,6 +128,20 @@ const FC = (props) => {
ellipsis
:
true
,
render
:
(
_
,
record
)
=>
record
.
createTimestamp
?
new
Date
(
record
.
createTimestamp
).
toLocaleString
()
:
''
},
{
title
:
'操作'
,
key
:
'action'
,
width
:
120
,
render
:
(
_
,
record
)
=>
(
<
a
onClick=
{
()
=>
{
setAddEvaluateParams
({
visible
:
true
,
item
:
record
,
action
:
'edit'
,
})
}
}
>
编辑
</
a
>
)
}
]
const
getEvaluations
=
()
=>
{
...
...
@@ -163,7 +179,9 @@ const FC = (props) => {
<
Space
>
<
Button
onClick=
{
()
=>
{
setAddEvaluateParams
({
visible
:
true
visible
:
true
,
item
:
undefined
,
action
:
'add'
,
})
}
}
>
新增
</
Button
>
<
Tooltip
title=
{
((
selectedRows
??[]).
length
===
0
)?
'请先选择评估方案'
:
''
}
>
...
...
@@ -184,7 +202,7 @@ const FC = (props) => {
}
},
callback
:
data
=>
{
showMessage
(
'
warn
'
,
'运行成功'
)
showMessage
(
'
success
'
,
'运行成功'
)
},
})
}
...
...
@@ -209,7 +227,7 @@ const FC = (props) => {
}
},
callback
:
data
=>
{
showMessage
(
'
warn
'
,
'删除成功'
)
showMessage
(
'
success
'
,
'删除成功'
)
getEvaluations
()
},
})
...
...
@@ -220,7 +238,7 @@ const FC = (props) => {
</
Space
>
<
Space
>
<
Input
size=
"middle"
placeholder=
"
任务编号/分配人
"
placeholder=
"
方案名称
"
value=
{
keyword
}
bordered=
{
true
}
allowClear
onChange=
{
(
e
)
=>
{
...
...
@@ -271,7 +289,9 @@ const FC = (props) => {
{
...
addEvaluateParams
}
onCancel=
{
(
refresh
)
=>
{
setAddEvaluateParams
({
visible
:
false
visible
:
false
,
item
:
undefined
,
action
:
undefined
})
refresh
&&
getEvaluations
()
...
...
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