Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
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
linweijiong
jinfa-platform
Commits
4ee3800a
Commit
4ee3800a
authored
Jun 24, 2021
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改增加考评bug
parent
9d954dd7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
18 deletions
+70
-18
FormilyUploadFiles.tsx
src/components/UploadFiles/FormilyUploadFiles.tsx
+15
-4
add.tsx
src/pages/member/memberEvaluate/createEvaluate/add.tsx
+7
-7
add.tsx
src/pages/member/memberEvaluate/schema/add.tsx
+46
-5
detail.tsx
src/pages/member/memberEvaluate/tobeEvaluate/detail.tsx
+2
-2
No files found.
src/components/UploadFiles/FormilyUploadFiles.tsx
View file @
4ee3800a
...
...
@@ -7,7 +7,15 @@ interface Iprops {
value
:
UploadFile
[],
editable
:
boolean
,
props
:
{
[
'x-component-props'
]:
any
,
[
'x-component-props'
]:
{
/**
* ☹
* 这里表现相对奇怪,当这个组件放在了table 下切这个组件是必填的话,会出现两个错误情况,我通过外部传值干掉其中一个
*/
showError
?:
boolean
,
}
&
{
[
key
:
string
]:
any
},
},
mutators
:
{
change
:
(
params
:
UploadFile
[])
=>
void
...
...
@@ -25,8 +33,11 @@ const toArray = (value: string | UploadFile[]): UploadFile[] => {
}
const
FormilyUploadFiles
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
{
value
,
editable
,
errors
}
=
props
;
const
{
value
,
editable
,
errors
,
}
=
props
;
const
componentProps
=
props
.
props
?.[
'x-component-props'
]
||
{};
const
{
showError
,
...
rest
}
=
componentProps
;
const
isShowError
=
typeof
showError
===
'undefined'
?
true
:
showError
;
const
fileList
=
toArray
(
value
);
const
onChange
=
(
info
:
UploadChangeParam
)
=>
{
...
...
@@ -54,9 +65,9 @@ const FormilyUploadFiles: React.FC<Iprops> = (props: Iprops) => {
return
(
<
div
>
<
UploadFiles
fileList=
{
fileList
}
onChange=
{
onChange
}
onRemove=
{
onRemove
}
disable=
{
!
editable
}
{
...
componentProps
}
/>
<
UploadFiles
fileList=
{
fileList
}
onChange=
{
onChange
}
onRemove=
{
onRemove
}
disable=
{
!
editable
}
{
...
rest
}
/>
{
errors
.
length
>
0
&&
(
isShowError
&&
errors
.
length
>
0
&&
(
<
div
>
<
p
style=
{
{
color
:
'#ff4d4f'
}
}
>
{
errors
.
join
(
""
)
}
</
p
>
</
div
>
...
...
src/pages/member/memberEvaluate/createEvaluate/add.tsx
View file @
4ee3800a
...
...
@@ -143,17 +143,13 @@ const EvaluateAdd = (props) => {
<
PlusOutlined
/>
添加
</
div
>
)
/**
*
* @tofix 修改subMemberId
*/
const
handleRemove
=
(
index
:
number
)
=>
{
const
dataSource
=
formActions
.
getFieldValue
(
'tabs.tab-2.items'
)
||
[];
const
target
=
dataSource
[
index
];
if
(
"id"
in
target
)
{
if
(
target
.
type
!==
0
)
{
// 表示他不是来自于系统的
const
projectDataSource
=
formActions
.
getFieldValue
(
'tabs.tab-2.selectProject'
)
const
newProjectKeys
=
projectDataSource
.
filter
((
_item
)
=>
_item
.
subMemberId
!==
target
.
id
);
const
newProjectKeys
=
projectDataSource
.
filter
((
_item
)
=>
_item
.
type
!==
target
.
type
);
formActions
.
setFieldValue
(
'tabs.tab-2.selectProject'
,
newProjectKeys
);
}
const
newSource
=
[...
dataSource
];
...
...
@@ -183,6 +179,10 @@ const EvaluateAdd = (props) => {
content
:
_item
.
typeDesc
,
// id: _item.id,
type
:
_item
.
type
,
memberName
:
{
userId
:
0
,
name
:
"系统"
}
}))
||
[]
// const withProjectId = new Set(tempData.map((_item) => _item.id));
const
dataSource
=
formActions
.
getFieldValue
(
'tabs.tab-2.items'
)
||
[];
...
...
src/pages/member/memberEvaluate/schema/add.tsx
View file @
4ee3800a
...
...
@@ -140,7 +140,7 @@ export const evaluateAddSchema: ISchema = {
type
:
'string'
,
editable
:
false
,
"x-render"
:
(
props
)
=>
{
const
numberIndex
=
FormPath
.
transform
(
props
.
name
,
/
\d
/
,
$1
=>
{
const
numberIndex
=
FormPath
.
transform
(
(
props
as
any
)
.
name
,
/
\d
/
,
$1
=>
{
return
`
${
$1
}
`
});
return
<
div
style=
{
{
marginBottom
:
'24px'
}
}
>
{
+
numberIndex
+
1
}
</
div
>
...
...
@@ -200,6 +200,16 @@ export const evaluateAddSchema: ISchema = {
required
:
true
,
message
:
'请选择考评人'
,
}
],
'x-linkages'
:
[
{
type
:
'value:state'
,
target
:
'..[].*(memberName)'
,
// true 的时候不能填
state
:
{
editable
:
'{{$value && $value.userId !== 0}}'
}
},
]
},
sendAppraisal
:
{
...
...
@@ -208,8 +218,37 @@ export const evaluateAddSchema: ISchema = {
'x-component'
:
'FormilyCheckbox'
,
"x-props"
:
{
width
:
128
}
},
'x-linkages'
:
[
{
type
:
'value:state'
,
target
:
'..[].*(grade,reports)'
,
// true 的时候不能填
state
:
{
visible
:
'{{!$value}}'
}
},
{
type
:
'value:schema'
,
// 考评人打分没勾选, 这几项都为必填
target
:
'..[].*(grade,scoreWeight,templates,reports)'
,
condition
:
`{{ !$value }}`
,
schema
:
{
"x-rules"
:
[
{
required
:
true
,
}
]
},
otherwise
:
{
"x-rules"
:
[
{
required
:
false
,
}
]
}
}
]
},
scoreWeight
:
{
title
:
'考评权重'
,
...
...
@@ -243,7 +282,8 @@ export const evaluateAddSchema: ISchema = {
'x-component-props'
:
{
mode
:
'link'
,
buttonText
:
'上传'
,
fileContainerClassName
:
'customizeFileContainer'
fileContainerClassName
:
'customizeFileContainer'
,
showError
:
false
,
},
"x-props"
:
{
width
:
180
,
...
...
@@ -256,7 +296,8 @@ export const evaluateAddSchema: ISchema = {
'x-component-props'
:
{
mode
:
'link'
,
buttonText
:
'上传'
,
fileContainerClassName
:
'customizeFileContainer'
fileContainerClassName
:
'customizeFileContainer'
,
showError
:
false
,
},
"x-props"
:
{
width
:
180
,
...
...
src/pages/member/memberEvaluate/tobeEvaluate/detail.tsx
View file @
4ee3800a
...
...
@@ -14,7 +14,7 @@ import useModal from '../hooks/useModal';
import
styles
from
'./detail.less'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
useInitialValue
from
'@/pages/handling/common/hooks/useInitialValue'
;
import
{
GetMemberAppraisal
Summary
GetResponse
}
from
'@/services/MemberV2Api'
;
import
{
GetMemberAppraisal
WaitGrade
GetResponse
}
from
'@/services/MemberV2Api'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
findLastIndexFlowState
}
from
'@/utils'
;
import
FlowRecords
from
'@/components/FlowRecords'
;
...
...
@@ -37,7 +37,7 @@ const TobeEvaluateDetail = () => {
const
{
visible
,
toggle
}
=
useModal
()
const
{
id
}
=
usePageStatus
();
const
params
=
useMemo
(()
=>
{
return
id
?
{
id
:
id
.
toString
()
}
:
null
},
[
id
]);
const
{
loading
,
initialValue
}
=
useInitialValue
<
GetMemberAppraisal
SummaryGetResponse
,
{
id
:
string
}
>
(
PublicApi
.
getMemberAppraisalSummary
Get
,
params
)
const
{
loading
,
initialValue
}
=
useInitialValue
<
GetMemberAppraisal
WaitGradeGetResponse
,
{
id
:
string
}
>
(
PublicApi
.
getMemberAppraisalWaitGrade
Get
,
params
)
const
{
anchorHeader
,
basicInfoList
,
evaluateResultColumn
,
auditProcess
}
=
useGetDetailCommon
({
blackList
:
[
'result'
],
initialValue
:
initialValue
})
const
[
hasScoring
,
setHasScoring
]
=
useState
<
boolean
>
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
<
boolean
>
(
false
);
...
...
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