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
cf32c84d
Commit
cf32c84d
authored
May 18, 2021
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加考评详情
parent
961df397
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
977 additions
and
112 deletions
+977
-112
memberRoute.ts
config/routes/memberRoute.ts
+12
-1
index.less
src/components/CustomizeColumn/index.less
+26
-0
index.tsx
src/components/CustomizeColumn/index.tsx
+62
-0
index.tsx
src/pages/member/components/CustomizeQueryList/index.tsx
+59
-0
index.tsx
src/pages/member/components/FormilyCheckBox/index.tsx
+36
-0
detail.tsx
src/pages/member/memberEvaluate/allQuery/detail.tsx
+148
-0
index.tsx
src/pages/member/memberEvaluate/allQuery/index.tsx
+66
-0
detail.tsx
src/pages/member/memberEvaluate/columns/detail.tsx
+84
-0
index.less
.../memberEvaluate/components/FormilySelectMember/index.less
+11
-0
index.tsx
...r/memberEvaluate/components/FormilySelectMember/index.tsx
+154
-0
schema.tsx
.../memberEvaluate/components/FormilySelectMember/schema.tsx
+96
-0
add.less
src/pages/member/memberEvaluate/createEvaluate/add.less
+3
-0
add.tsx
src/pages/member/memberEvaluate/createEvaluate/add.tsx
+37
-8
index.tsx
src/pages/member/memberEvaluate/createEvaluate/index.tsx
+5
-51
useEvaluateColumn.tsx
src/pages/member/memberEvaluate/hooks/useEvaluateColumn.tsx
+29
-0
useFetchList.tsx
src/pages/member/memberEvaluate/hooks/useFetchList.tsx
+31
-0
useModal.tsx
src/pages/member/memberEvaluate/hooks/useModal.tsx
+64
-0
add.tsx
src/pages/member/memberEvaluate/schema/add.tsx
+54
-52
No files found.
config/routes/memberRoute.ts
View file @
cf32c84d
...
...
@@ -319,8 +319,19 @@ const MemberRoute: RouterChild = {
name
:
'会员考评'
,
routes
:
[
{
path
:
'/memberCenter/memberAbility/memberEvaluate/allQuery'
,
name
:
'会员考评查询'
,
component
:
'@/pages/member/memberEvaluate/allQuery/index'
,
},
{
path
:
'/memberCenter/memberAbility/memberEvaluate/detail'
,
name
:
'会员考评详情'
,
component
:
'@/pages/member/memberEvaluate/allQuery/detail'
,
noMargin
:
true
,
},
{
path
:
'/memberCenter/memberAbility/memberEvaluate/createEvaluate'
,
name
:
'
会员考评管理
'
,
name
:
'
待新建考评单
'
,
component
:
'@/pages/member/memberEvaluate/createEvaluate/index'
,
},
{
...
...
src/components/CustomizeColumn/index.less
0 → 100644
View file @
cf32c84d
.container {
display: flex;
flex: row;
.row {
display: flex;
flex-direction: row;
margin-bottom: @margin-md;
}
.col {
flex: 1;
.title {
color: #909399;
font-size: 12;
width: 104px;
display: inline-block;
}
}
.lastRow {
margin-bottom: 0;
}
}
src/components/CustomizeColumn/index.tsx
0 → 100644
View file @
cf32c84d
/**
* 详情页分裂显示,
* 这里类似table 组件, 同样有column
*/
import
React
from
'react'
;
import
MellowCard
,
{
MellowCardProps
}
from
'@/components/MellowCard'
;
import
styles
from
'./index.less'
;
import
cx
from
'classnames'
;
type
ColumnType
=
{
dataIndex
:
string
,
title
:
string
,
render
?:
(
value
?:
any
,
record
?:
any
,
dataIndex
?:
string
)
=>
React
.
ReactNode
}
interface
Iprops
extends
MellowCardProps
{
/**
* 列
*/
columns
:
{
[
key
:
string
]:
ColumnType
[]
},
/**
* 数据
*/
dataSource
:
{
[
key
:
string
]:
any
}
}
const
CustomizeColumn
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
{
columns
,
dataSource
,
...
rest
}
=
props
;
return
(
<
MellowCard
{
...
rest
}
>
<
div
className=
{
styles
.
container
}
>
{
Object
.
keys
(
columns
).
map
((
_item
)
=>
{
return
(
<
div
className=
{
styles
.
col
}
key=
{
_item
}
>
{
columns
[
_item
].
map
((
_row
,
index
)
=>
{
const
length
=
columns
[
_item
].
length
;
return
(
<
div
className=
{
cx
(
styles
.
row
,
{
[
styles
.
lastRow
]:
index
===
length
-
1
})
}
key=
{
_row
.
dataIndex
}
>
<
span
className=
{
styles
.
title
}
>
{
_row
.
title
}
</
span
>
{
_row
.
render
&&
(
_row
.
render
(
dataSource
[
_row
.
dataIndex
],
dataSource
,
_row
.
dataIndex
))
||
(<
span
>
{
dataSource
[
_row
.
dataIndex
]
}
</
span
>)
}
</
div
>
)
})
}
</
div
>
)
})
}
</
div
>
</
MellowCard
>
)
}
export
default
CustomizeColumn
src/pages/member/components/CustomizeQueryList/index.tsx
0 → 100644
View file @
cf32c84d
/**
* 通用的列表页
*/
import
React
,
{
useRef
}
from
'react'
;
import
{
Card
}
from
'antd'
import
{
StandardTable
}
from
'god'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
createFormActions
,
ISchema
}
from
'@formily/antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
interface
Iprops
{
columns
:
ColumnsType
,
schema
:
ISchema
,
fetchListData
:
<
T
>
(
params
:
T
)
=>
Promise
<
any
>
,
effects
:
(
$
:
any
,
actions
:
any
)
=>
void
,
expressionScope
?:
any
,
}
const
formActions
=
createFormActions
();
const
CustomizeColumn
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
{
columns
,
schema
,
fetchListData
,
expressionScope
,
effects
}
=
props
;
const
ref
=
useRef
<
any
>
({});
const
handleEffects
=
(
$
,
action
)
=>
{
effects
?.(
$
,
action
)
}
return
(
// <Card>
<
StandardTable
tableProps=
{
{
rowKey
:
'validateId'
,
}
}
columns=
{
columns
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchListData
(
params
)
}
controlRender=
{
<
NiceForm
schema=
{
schema
}
actions=
{
formActions
}
onSubmit=
{
values
=>
ref
.
current
?.
reload
(
values
)
}
expressionScope=
{
expressionScope
}
effects=
{
(
$
,
actions
)
=>
handleEffects
(
$
,
actions
)
}
/>
}
/>
// </Card>
)
}
CustomizeColumn
.
defaultProps
=
{
expressionScope
:
{},
effects
:
null
}
export
default
CustomizeColumn
src/pages/member/components/FormilyCheckBox/index.tsx
0 → 100644
View file @
cf32c84d
import
React
from
'react'
;
import
{
Checkbox
}
from
'antd'
;
import
{
CheckboxChangeEvent
}
from
'antd/lib/checkbox'
interface
Iprops
{
value
:
boolean
,
editable
:
boolean
,
props
:
{
[
'x-component-props'
]:
any
,
},
mutators
:
{
change
:
(
checked
:
boolean
)
=>
void
},
}
const
FormilyCheckBox
:
React
.
FC
<
Iprops
>
&
{
isFieldComponent
?:
boolean
}
=
(
props
:
Iprops
)
=>
{
const
{
value
,
editable
}
=
props
;
const
componentProps
=
props
.
props
?.[
'x-component-props'
]
||
{};
const
children
=
props
.
props
?.[
'x-component-props'
]?.[
'children'
]
||
''
const
checked
=
!!
value
;
const
handleChange
=
(
e
:
CheckboxChangeEvent
)
=>
{
props
.
mutators
.
change
(
e
.
target
.
checked
);
}
return
(
<
Checkbox
checked=
{
checked
}
onChange=
{
handleChange
}
disabled=
{
!
editable
}
{
...
componentProps
}
>
{
children
}
</
Checkbox
>
)
}
FormilyCheckBox
.
isFieldComponent
=
true
export
default
FormilyCheckBox
src/pages/member/memberEvaluate/allQuery/detail.tsx
0 → 100644
View file @
cf32c84d
import
React
from
'react'
;
import
{
Spin
,
Card
,
Steps
,
Table
,
Progress
,
Button
}
from
'antd'
;
import
AnchorPage
from
'@/layouts/AnchorPage'
;
import
theme
from
'../../../../../config/lingxi.theme.config'
;
import
{
projectColumns
,
recordColumn
}
from
'../columns/detail'
;
import
CustomizeColumn
from
'@/components/CustomizeColumn'
;
const
{
Step
}
=
Steps
;
const
EvaluateDetail
=
()
=>
{
const
anchorHeader
=
[
{
key
:
'progress'
,
name
:
'流转进度'
,
},
{
key
:
'detail'
,
name
:
'基本信息'
,
},
{
key
:
'project'
,
name
:
'考评项目'
},
{
key
:
'result'
,
name
:
'考评结果'
},
{
key
:
'record'
,
name
:
'流转记录'
}
]
const
columnList
=
{
col1
:
[
{
title
:
'考察主题'
,
dataIndex
:
'theme'
,
},
{
title
:
'会员名称'
,
dataIndex
:
'memberName'
,
},
{
title
:
'考察类型'
,
dataIndex
:
'type'
}
],
col2
:
[
{
title
:
'考察日期'
,
dataIndex
:
'date'
},
{
title
:
'考察代表'
,
dataIndex
:
'present'
},
{
title
:
"考察原因"
,
dataIndex
:
'reason'
}
],
col3
:
[
{
title
:
'考察要求附件'
,
dataIndex
:
'file'
,
render
:
(
value
?)
=>
{
return
(
<
div
>
132
</
div
>
)
}
},
]
}
const
resultList
=
{
col
:
[
{
title
:
'考评最终分'
,
dataIndex
:
'score'
,
render
:
(
value
)
=>
{
return
(
<
div
style=
{
{
width
:
'80px'
,
height
:
'40px'
}
}
>
<
Progress
type=
"dashboard"
percent=
{
75
}
gapDegree=
{
145
}
width=
{
80
}
/>
</
div
>
)
}
},
],
col2
:
[
{
title
:
'考察日期'
,
dataIndex
:
'date'
},
{
title
:
'考察代表'
,
dataIndex
:
'present'
},
{
title
:
"考察原因"
,
dataIndex
:
'reason'
}
],
col3
:
[
{
title
:
'考察要求附件'
,
dataIndex
:
'file'
,
render
:
(
value
?)
=>
{
return
(
<
div
>
132
</
div
>
)
}
},
]
}
return
(
<
Spin
spinning=
{
false
}
>
<
AnchorPage
title=
{
`温州市隆昌皮业有限公式`
}
anchors=
{
anchorHeader
}
// extra={headExtra && headExtra(detailInfo, returnAddress, exchangeAddress)}
>
<
Card
title=
"流转进度"
id=
"progress"
>
<
Steps
current=
{
1
}
progressDot
>
<
Step
title=
"Finished"
description=
"You can hover on the dot."
/>
<
Step
title=
"In Progress"
description=
"You can hover on the dot."
/>
<
Step
title=
"Waiting"
description=
"You can hover on the dot."
/>
<
Step
title=
"Waiting"
description=
"You can hover on the dot."
/>
</
Steps
>
</
Card
>
<
div
style=
{
{
margin
:
`${theme["@margin-md"]} 0`
}
}
>
<
CustomizeColumn
id=
"detail"
columns=
{
columnList
}
dataSource=
{
{}
}
title=
"基本信息"
/>
</
div
>
<
Card
title=
"考评项目"
id=
"project"
style=
{
{
margin
:
`${theme["@margin-md"]} 0`
}
}
>
<
Table
columns=
{
projectColumns
}
></
Table
>
</
Card
>
<
div
style=
{
{
margin
:
`${theme["@margin-md"]} 0`
}
}
>
<
CustomizeColumn
id=
"result"
columns=
{
resultList
}
dataSource=
{
{}
}
title=
"考评结果"
/>
</
div
>
<
Card
title=
"流转记录"
id=
"record"
extra=
{
<
Button
>
内部流转
</
Button
>
}
>
<
Table
columns=
{
recordColumn
}
></
Table
>
</
Card
>
</
AnchorPage
>
</
Spin
>
)
}
export
default
EvaluateDetail
;
src/pages/member/memberEvaluate/allQuery/index.tsx
0 → 100644
View file @
cf32c84d
import
React
,
{
useRef
}
from
'react'
;
import
{
Card
,
Space
,
Button
}
from
'antd'
import
{
StandardTable
}
from
'god'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
useEvaluateColumn
,
{
InspectionData
}
from
'../hooks/useEvaluateColumn'
;
import
{
evaluationListSchema
}
from
'../schema'
;
import
useFetchList
from
'../hooks/useFetchList'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
CustomizeQueryList
from
'../../components/CustomizeQueryList'
;
// const formActions = createFormActions();
interface
Iprops
{};
const
List
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
{
fetchListData
}
=
useFetchList
();
const
{
columns
}
=
useEvaluateColumn
<
InspectionData
>
([
{
title
:
'操作'
,
render
:
(
_text
,
_record
)
=>
(
<
Space
>
<
a
>
删除
</
a
>
</
Space
>
)
}
])
const
controllerBtns
=
(
<
div
>
<
Button
type=
"primary"
>
<
PlusOutlined
/>
新建
</
Button
>
</
div
>
)
const
handleFetch
=
async
(
params
)
=>
{
const
result
=
fetchListData
(
PublicApi
.
getMemberAbilitySubPage
,
params
);
return
result
}
return
(
<
Card
>
<
CustomizeQueryList
columns=
{
columns
}
schema=
{
evaluationListSchema
}
fetchListData=
{
handleFetch
}
expressionScope=
{
{
controllerBtns
,
}
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'name'
,
FORM_FILTER_PATH
,
);
}
}
/>
</
Card
>
)
}
export
default
List
src/pages/member/memberEvaluate/columns/detail.tsx
0 → 100644
View file @
cf32c84d
import
{
ColumnsType
}
from
'antd/es/table'
;
/**
* 详情页考评项目
*/
export
const
projectColumns
:
ColumnsType
<
any
>
=
[
{
title
:
'序号'
,
dataIndex
:
'id'
,
},
{
title
:
'考评项目'
,
dataIndex
:
"projectName"
},
{
title
:
'状态'
,
dataIndex
:
"status"
},
{
title
:
'考评人'
,
dataIndex
:
'member'
},
{
title
:
'考评人打分'
,
dataIndex
:
'memberScoring'
},
{
title
:
'权重'
,
dataIndex
:
'weight'
},
{
title
:
'考评计分'
,
dataIndex
:
'scoring'
},
{
title
:
'得分'
,
dataIndex
:
'score'
},
{
title
:
'考评模板'
,
dataIndex
:
'template'
,
},
{
title
:
'考评报告'
,
dataIndex
:
'report'
}
]
export
const
recordColumn
:
ColumnsType
<
any
>
=
[
{
title
:
'序号'
,
dataIndex
:
'id'
},
{
title
:
'操作角色'
,
dataIndex
:
'role'
,
},
{
title
:
"部门"
,
dataIndex
:
'apartment'
,
},
{
title
:
"职位"
,
dataIndex
:
"pos"
},
{
title
:
'状态'
,
dataIndex
:
'status'
},
{
title
:
"操作"
,
dataIndex
:
'action'
},
{
title
:
"操作时间"
,
dataIndex
:
'actionTime'
},
{
title
:
"审核意见"
,
dataIndex
:
'suggest'
},
]
src/pages/member/memberEvaluate/components/FormilySelectMember/index.less
0 → 100644
View file @
cf32c84d
.value {
display: flex;
flex-direction: column;
.name {
margin-bottom: 4px;
}
}
.main {
color: @main-color;
cursor: pointer;
}
src/pages/member/memberEvaluate/components/FormilySelectMember/index.tsx
0 → 100644
View file @
cf32c84d
import
React
,
{
useCallback
,
useRef
,
useState
}
from
'react'
;
import
{
Drawer
,
Button
}
from
'antd'
;
// import { useModel } from '@/.umi/plugin-model/useModel';
import
useModel
from
'../../hooks/useModal'
;
import
{
StandardTable
}
from
'god'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
memberSchema
from
'./schema'
;
import
styles
from
'./index.less'
const
formActions
=
createFormActions
();
interface
Iprops
{
value
:
boolean
,
editable
:
boolean
,
schema
:
any
,
props
:
{
[
'x-component-props'
]:
any
,
},
mutators
:
{
change
:
(
checked
:
boolean
)
=>
void
},
}
const
FormilySelectMember
:
React
.
FC
<
Iprops
>
&
{
isFieldComponent
:
boolean
}
=
(
props
:
Iprops
)
=>
{
const
{
value
,
editable
}
=
props
;
const
ref
=
useRef
<
any
>
({});
const
{
visible
,
toggleShow
,
handleCancel
,
handleConfirm
}
=
useModel
({});
const
[
selectedRecord
,
setSelectedRecord
]
=
useState
<
any
>
(
null
);
// schema.getExtendsComponentProps() || {}
const
columns
:
ColumnsType
=
[
{
title
:
'序号'
,
dataIndex
:
'id'
},
{
title
:
'姓名'
,
dataIndex
:
'name'
},
{
title
:
'手机号码'
,
dataIndex
:
'telephone'
,
},
{
title
:
'所属机构'
,
dataIndex
:
'org'
},
{
title
:
'职位'
,
dataIndex
:
'pos'
}
];
const
fetchListData
=
async
(
params
:
any
)
=>
{
return
{
totalCount
:
0
,
data
:
[{
id
:
1
,
name
:
'123'
},
{
id
:
2
,
name
:
'456'
}]
}
}
const
onSelectChange
=
(
record
,
selected
,
selectedRows
)
=>
{
console
.
log
(
'selectedRowKeys changed: '
,
record
,
selected
,
selectedRows
);
setSelectedRecord
(
record
);
};
const
onCancel
=
useCallback
(()
=>
{
handleCancel
()
},
[
handleCancel
])
const
onConfirm
=
()
=>
{
handleConfirm
(()
=>
{
props
.
mutators
.
change
(
selectedRecord
);
})
}
return
(
<
div
>
<
Drawer
title=
"选择用户"
width=
{
1000
}
visible=
{
visible
}
onClose=
{
onCancel
}
footer=
{
<
div
style=
{
{
textAlign
:
'right'
,
}
}
>
<
Button
onClick=
{
onCancel
}
style=
{
{
marginRight
:
8
}
}
>
取消
</
Button
>
<
Button
onClick=
{
onConfirm
}
type=
"primary"
>
提交
</
Button
>
</
div
>
}
>
<
StandardTable
tableProps=
{
{
rowKey
:
'id'
,
}
}
columns=
{
columns
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchListData
(
params
)
}
rowSelection=
{
{
type
:
'radio'
,
onSelect
:
onSelectChange
,
selectedRowKeys
:
value
?
[
value
?.
id
]
:
[],
}
}
controlRender=
{
<
NiceForm
schema=
{
memberSchema
}
actions=
{
formActions
}
onSubmit=
{
values
=>
ref
.
current
?.
reload
(
values
)
}
expressionScope=
{
{}
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'name'
,
FORM_FILTER_PATH
,
);
}
}
/>
}
/>
</
Drawer
>
<
div
className=
{
styles
.
value
}
>
<
span
className=
{
styles
.
name
}
>
{
value
?.
name
}
</
span
>
{
editable
&&
(
<
span
className=
{
styles
.
main
}
onClick=
{
toggleShow
}
>
{
value
?
'重新选择'
:
'选择考评人'
}
</
span
>
)
}
</
div
>
</
div
>
)
}
FormilySelectMember
.
isFieldComponent
=
true
export
default
FormilySelectMember
src/pages/member/memberEvaluate/components/FormilySelectMember/schema.tsx
0 → 100644
View file @
cf32c84d
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
ISchema
}
from
'@formily/antd'
;
const
memberSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
mageLayout
:
{
type
:
'object'
,
'x-component'
:
'Mega-Layout'
,
properties
:
{
topLayout
:
{
type
:
'object'
,
'x-component'
:
'Mega-Layout'
,
'x-component-props'
:
{
grid
:
true
,
},
properties
:
{
// ctl: {
// type: 'object',
// 'x-component': 'Children',
// 'x-component-props': {
// children: '{{controllerBtns}}',
// },
// },
name
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'搜索'
,
tip
:
'输入 会员名称 进行搜索'
,
},
},
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'Flex-Layout'
,
'x-component-props'
:
{
colStyle
:
{
marginLeft
:
20
,
},
},
properties
:
{
memberTypeId
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'会员类型(全部)'
,
allowClear
:
true
,
style
:
{
width
:
160
,
},
},
},
roleId
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'会员角色(全部)'
,
allowClear
:
true
,
style
:
{
width
:
160
,
},
},
},
level
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'会员等级(全部)'
,
allowClear
:
true
,
style
:
{
width
:
160
,
},
},
},
submit
:
{
'x-component'
:
'Submit'
,
'x-mega-props'
:
{
span
:
1
,
},
'x-component-props'
:
{
children
:
'查询'
,
},
},
},
},
},
},
},
};
export
default
memberSchema
src/pages/member/memberEvaluate/createEvaluate/add.less
View file @
cf32c84d
...
...
@@ -3,5 +3,8 @@
.ant-table-cell {
padding: 8px 8px;
}
.ant-btn {
padding: 2px 0px;
}
}
}
src/pages/member/memberEvaluate/createEvaluate/add.tsx
View file @
cf32c84d
...
...
@@ -5,20 +5,15 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout';
import
{
LinkOutlined
,
PlusOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
Input
,
ArrayTable
,
DatePicker
,
FormBlock
,
FormItemGrid
,
FormLayout
}
from
'@formily/antd-components'
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
evaluateAddSchema
}
from
'../schema/add'
;
import
UploadFiles
from
'@/components/UploadFiles/UploadFiles'
;
import
{
UploadProps
,
UploadChangeParam
,
UploadFile
}
from
'antd/lib/upload/interface'
import
FormilyUploadFiles
from
'@/components/UploadFiles/FormilyUploadFiles'
;
import
FormilyRangeTime
from
'@/components/RangeTime/FormilyRangeTime'
;
import
FormilyCheckbox
from
'../../components/FormilyCheckBox'
;
import
FormilySelectMember
from
'../components/FormilySelectMember'
;
import
moment
from
'moment'
;
import
theme
from
'../../../../../config/lingxi.theme.config'
;
import
styles
from
'./add.less'
;
...
...
@@ -46,6 +41,16 @@ const EvaluateAdd = () => {
time
:
[
moment
(
'2015/01/01'
,
'YYYY/MM/DD'
),
moment
(
'2015/01/08'
,
'YYYY/MM/DD'
),
],
array
:
[
{
id
:
1
,
projectName
:
"123"
,
memberName
:
{
"id"
:
2
,
"name"
:
"456"
}
}
]
})
resolve
()
...
...
@@ -65,6 +70,23 @@ const EvaluateAdd = () => {
</
div
>
)
const
handleRemove
=
(
index
)
=>
{
console
.
log
(
index
);
}
const
renderListTableRemove
=
(
index
:
number
)
=>
(
<>
<
a
onClick=
{
()
=>
handleRemove
(
index
)
}
style=
{
{
color
:
'#ff4d4f'
,
}
}
>
删除
</
a
>
</>
);
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
...
...
@@ -91,7 +113,13 @@ const EvaluateAdd = () => {
initialValues=
{
initialValue
}
schema=
{
evaluateAddSchema
}
actions=
{
formActions
}
components=
{
{
FormilyUploadFiles
,
FormilyRangeTime
,
ArrayTable
}
}
components=
{
{
FormilyUploadFiles
,
FormilyRangeTime
,
ArrayTable
,
FormilyCheckbox
,
FormilySelectMember
}
}
expressionScope=
{
{
renderAddition
:
renderAddition
,
connectMember
:
(
...
...
@@ -100,6 +128,7 @@ const EvaluateAdd = () => {
选择
</
div
>
),
renderListTableRemove
,
}
}
effects=
{
()
=>
{}
}
/>
...
...
src/pages/member/memberEvaluate/createEvaluate/index.tsx
View file @
cf32c84d
...
...
@@ -9,7 +9,8 @@ import { evaluationListSchema } from '../schema';
import
{
PublicApi
}
from
'@/services/api'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
useEvaluateColumn
from
'../hooks/useEvaluateColumn'
;
import
useEvaluateColumn
,
{
InspectionData
}
from
'../hooks/useEvaluateColumn'
;
import
useFetchList
from
'../hooks/useFetchList'
;
const
formActions
=
createFormActions
();
...
...
@@ -18,38 +19,6 @@ const formActions = createFormActions();
*/
interface
Iprops
{};
/**
* @todo 修改类型
*/
interface
InspectionData
{
id
:
number
,
/**
* 会员名称
*/
name
:
string
;
/**
* 考察主题
*/
theme
:
string
,
/**
* 考察类型
* 1 => 入库考察, 2 => 真该考察, 3 => 计划考察, 4 => 入库考察
*/
type
:
number
,
/**
* 考察日期
*/
date
:
number
,
/**
* 考察评分
*/
score
:
number
,
/**
* 内部状态
*/
status
:
0
|
1
,
}
type
PaginationParam
=
{
current
:
number
,
pageSize
:
number
,
...
...
@@ -57,6 +26,7 @@ type PaginationParam = {
const
MemberEvaluate
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
ref
=
useRef
<
any
>
({});
const
{
fetchListData
}
=
useFetchList
();
const
{
columns
}
=
useEvaluateColumn
<
InspectionData
>
([
{
title
:
'操作'
,
...
...
@@ -73,21 +43,9 @@ const MemberEvaluate: React.FC<Iprops> = (props: Iprops) => {
<
Button
type=
"primary"
>
<
PlusOutlined
/>
新建
</
Button
>
<
Button
>
导入
</
Button
>
<
Button
>
导入
</
Button
>
</
div
>
)
const
fetchListData
=
async
(
params
:
PaginationParam
&
{
theme
?:
string
,
type
?:
number
})
=>
{
console
.
log
(
params
);
return
{
totalCount
:
0
,
data
:
[]
}
}
return
(
<
Card
>
<
StandardTable
...
...
@@ -96,7 +54,7 @@ const MemberEvaluate: React.FC<Iprops> = (props: Iprops) => {
}
}
columns=
{
columns
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchListData
(
params
)
}
fetchTableData=
{
(
params
:
any
)
=>
fetchListData
(
PublicApi
.
getMemberAbilitySubPage
,
params
)
}
controlRender=
{
<
NiceForm
schema=
{
evaluationListSchema
}
...
...
@@ -112,10 +70,6 @@ const MemberEvaluate: React.FC<Iprops> = (props: Iprops) => {
'name'
,
FORM_FILTER_PATH
,
);
// useAsyncInitSelect(
// ['memberTypeId', 'roleId', 'level', 'source', 'innerStatus', 'outerStatus'],
// fetchSelectOptions,
// );
}
}
/>
}
...
...
src/pages/member/memberEvaluate/hooks/useEvaluateColumn.tsx
View file @
cf32c84d
import
React
,
{
useState
}
from
'react'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
export
interface
InspectionData
{
id
:
number
,
/**
* 会员名称
*/
name
:
string
;
/**
* 考察主题
*/
theme
:
string
,
/**
* 考察类型
* 1 => 入库考察, 2 => 真该考察, 3 => 计划考察, 4 => 入库考察
*/
type
:
number
,
/**
* 考察日期
*/
date
:
number
,
/**
* 考察评分
*/
score
:
number
,
/**
* 内部状态
*/
status
:
0
|
1
,
}
/**
* 根据类型获取考评column
*/
...
...
src/pages/member/memberEvaluate/hooks/useFetchList.tsx
0 → 100644
View file @
cf32c84d
import
{
useCallback
}
from
"react"
;
type
ResultType
<
R
=
any
>
=
{
totalCount
:
number
,
data
:
R
[]
}
interface
IdefaultRes
{
code
:
number
,
data
:
any
,
message
:
string
}
function
useFetchList
()
{
const
fetchListData
=
useCallback
(
async
<
P
extends
IdefaultRes
,
T
extends
Object
,
K
=
any
>
(api: (params: T) =
>
Promise
<
P
>
, params: T): Promise
<
ResultType
<
K
>
>
=
>
{
const
{
code
,
data
}
=
await
api
(
params
);
if
(
code
===
1000
)
{
return
data
;
}
return
{
totalCount
:
0
,
data
:
[]
}
}
, [])
return
{
fetchListData
}
}
export default useFetchList
src/pages/member/memberEvaluate/hooks/useModal.tsx
0 → 100644
View file @
cf32c84d
import
React
,
{
useCallback
,
useEffect
,
useState
}
from
'react'
;
type
ParamsType
=
{
// onCancel?: (() => void) | (() => Promise<any>)
// onConfirm?: (() => void) | (() => Promise<any>)
onVisible
?:
(()
=>
void
)
}
const
isPromise
=
(
value
:
any
)
=>
{
return
value
&&
Object
.
prototype
.
toString
.
call
(
value
)
===
"[object Promise]"
}
function
useModal
(
params
:
ParamsType
)
{
const
[
visible
,
setVisible
]
=
useState
<
boolean
>
(
false
);
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
useEffect
(()
=>
{
if
(
visible
)
{
params
.
onVisible
?.()
}
},
[
visible
])
/**
* 取消
*/
const
handleCancel
=
useCallback
((
onCancel
?:
(()
=>
void
)
|
(()
=>
Promise
<
any
>
))
=>
{
if
(
isPromise
(
onCancel
))
{
setLoading
(()
=>
true
);
(
onCancel
()
as
Promise
<
any
>
)
.
then
((
data
)
=>
{
setLoading
(()
=>
false
);
setVisible
(()
=>
false
)
})
return
;
}
onCancel
?.();
setVisible
(
false
);
},
[])
/**
* 确认
*/
const
handleConfirm
=
useCallback
((
onConfirm
?:
(()
=>
void
)
|
(()
=>
Promise
<
any
>
))
=>
{
if
(
isPromise
(
onConfirm
))
{
setLoading
(()
=>
true
);
(
onConfirm
()
as
Promise
<
any
>
)
.
then
((
data
)
=>
{
setLoading
(()
=>
false
);
setVisible
(()
=>
false
)
})
return
;
}
onConfirm
?.();
setVisible
(()
=>
false
)
},
[])
const
toggleShow
=
useCallback
(()
=>
{
setVisible
(()
=>
true
)
},
[])
return
{
visible
,
loading
,
handleConfirm
,
handleCancel
,
toggleShow
}
}
export
default
useModal
src/pages/member/memberEvaluate/schema/add.tsx
View file @
cf32c84d
import
{
ISchema
}
from
'@formily/antd'
;
import
React
from
'react'
;
import
styles
from
'../createEvaluate/add.less'
;
export
const
evaluateAddSchema
:
ISchema
=
{
type
:
"object"
,
...
...
@@ -118,90 +116,89 @@ export const evaluateAddSchema: ISchema = {
"type"
:
"array"
,
"x-component"
:
"arraytable"
,
"x-component-props"
:
{
// "operationsWidth": 300
// rowClassName: styles.evaluateRow,
operations
:
false
,
// operations: false,
renderAddition
:
"{{renderAddition}}"
,
renderRemove
:
'{{renderListTableRemove}}'
,
renderMoveDown
:
()
=>
null
,
renderMoveUp
:
()
=>
null
,
operations
:
{
title
:
'操作'
},
},
items
:
{
type
:
"object"
,
properties
:
{
id
:
{
title
:
"序号"
,
// type: 'Text',
"x-component"
:
'Text'
,
"x-props"
:
{
width
:
65
,
},
"x-component-props"
:
{
style
:
{
width
:
30
},
operations
:
{
operationsWidth
:
30
,
width
:
30
}
}
// 'x-component': 'Children',
// "x-component": "input",
// "description": "hello world",
},
projectName
:
{
title
:
'考评项目'
,
type
:
'string'
,
"x-component-props"
:
{
operations
:
{
operationsWidth
:
30
,
width
:
30
}
// operationswidth: 30,
"x-component-props"
:
{},
"x-props"
:
{
width
:
160
,
}
},
projectContent
:
{
title
:
'考评内容'
,
type
:
'textarea'
,
"x-component-props"
:
{
'x-props'
:
{
width
:
424
,
},
'x-component-props'
:
{
row
:
1
,
style
:
{
// width: 408,
},
width
:
30
,
height
:
32
,
}
}
},
memberName
:
{
title
:
"考评人"
,
type
:
'string'
type
:
'object'
,
'x-props'
:
{
width
:
128
,
},
"x-component"
:
"FormilySelectMember"
,
// "x-component-props": {
// children: '选择考评人'
// }
},
memberScore
:
{
title
:
"考评人打分"
,
type
:
'string'
,
'x-component'
:
'FormilyCheckbox'
,
"x-props"
:
{
width
:
128
}
},
// memberScore: {
// title: "考评人打分",
// type: 'string',
// 'x-component': 'CheckboxGroup',
// enum: []
// },
weight
:
{
title
:
'考评权重'
,
type
:
'string'
,
"x-component-props"
:
{
style
:
{
width
:
80
}
}
"x-props"
:
{
width
:
95
,
},
},
score1
:
{
title
:
'考评计分'
,
type
:
'string'
,
"x-component-props"
:
{
style
:
{
width
:
80
}
}
"x-props"
:
{
width
:
95
,
},
"x-component-props"
:
{}
},
score
:
{
title
:
'考评内容'
,
"x-component-props"
:
{
style
:
{
width
:
80
}
"x-props"
:
{
width
:
95
,
},
"x-component-props"
:
{},
type
:
'string'
},
moban
:
{
...
...
@@ -211,6 +208,9 @@ export const evaluateAddSchema: ISchema = {
'x-component-props'
:
{
mode
:
'link'
,
buttonText
:
'上传'
},
"x-props"
:
{
width
:
180
,
}
},
baogao
:
{
...
...
@@ -220,9 +220,11 @@ export const evaluateAddSchema: ISchema = {
'x-component-props'
:
{
mode
:
'link'
,
buttonText
:
'上传'
},
"x-props"
:
{
width
:
180
,
}
}
},
}
}
}
...
...
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