|
@@ -1,7 +1,6 @@
|
|
|
import { updateAssembly } from '@/services/api/business'
|
|
|
import consts from '@/utils/consts'
|
|
|
import { CodepenSquareFilled, ProfileFilled, SlackSquareFilled } from '@ant-design/icons'
|
|
|
-import { connect } from '@umijs/max'
|
|
|
import { Button, Card, Checkbox, Col, message, Row } from 'antd'
|
|
|
import React, { useState } from 'react'
|
|
|
import { Assembly } from './AssemblyDetail'
|
|
@@ -11,9 +10,10 @@ type AddAssemblyProps = {
|
|
|
defaultData: API.MatterTreeItem
|
|
|
close: () => void
|
|
|
refresh: () => void
|
|
|
+ refreshData: () => void
|
|
|
}
|
|
|
|
|
|
-const AddAssemblyModal: React.FC<AddAssemblyProps> = ({ defaultData, close, refresh, dispatch }) => {
|
|
|
+const AddAssemblyModal: React.FC<AddAssemblyProps> = ({ defaultData, close, refresh, refreshData }) => {
|
|
|
const [assemblyList, setAssemblyList] = useState(defaultData?.assembly || [])
|
|
|
|
|
|
const handleAssemblyOnchange = (checked: boolean, checkName: string) => {
|
|
@@ -31,10 +31,7 @@ const AddAssemblyModal: React.FC<AddAssemblyProps> = ({ defaultData, close, refr
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
message.success('添加成功')
|
|
|
close()
|
|
|
- dispatch({
|
|
|
- type: 'business/queryMatterDetail',
|
|
|
- payload: { ID: defaultData?.ID }
|
|
|
- })
|
|
|
+ refreshData()
|
|
|
refresh()
|
|
|
}
|
|
|
}
|
|
@@ -65,7 +62,7 @@ const AddAssemblyModal: React.FC<AddAssemblyProps> = ({ defaultData, close, refr
|
|
|
</Col>
|
|
|
<Col span={8}>
|
|
|
<Card
|
|
|
- className={assemblyList.includes(Assembly.DATAPROFILE) ? 'cardBox' : null}
|
|
|
+ className={assemblyList.includes(Assembly.COSTPROFILE) ? 'cardBox' : null}
|
|
|
title={
|
|
|
<span>
|
|
|
<SlackSquareFilled className="mr-1" style={{ fontSize: '20px', color: '#52C41A' }} />
|
|
@@ -74,8 +71,8 @@ const AddAssemblyModal: React.FC<AddAssemblyProps> = ({ defaultData, close, refr
|
|
|
}
|
|
|
extra={
|
|
|
<Checkbox
|
|
|
- onChange={e => handleAssemblyOnchange(e.target.checked, Assembly.DATAPROFILE)}
|
|
|
- checked={assemblyList.includes(Assembly.DATAPROFILE)}
|
|
|
+ onChange={e => handleAssemblyOnchange(e.target.checked, Assembly.COSTPROFILE)}
|
|
|
+ checked={assemblyList.includes(Assembly.COSTPROFILE)}
|
|
|
/>
|
|
|
}>
|
|
|
<div className="min-h-70px">自定义审核资料模板,承载业务审批过程中资料及附件业务。</div>
|
|
@@ -84,7 +81,7 @@ const AddAssemblyModal: React.FC<AddAssemblyProps> = ({ defaultData, close, refr
|
|
|
</Col>
|
|
|
<Col span={8}>
|
|
|
<Card
|
|
|
- className={assemblyList.includes(Assembly.COSTPROFILE) ? 'cardBox' : null}
|
|
|
+ className={assemblyList.includes(Assembly.DATAPROFILE) ? 'cardBox' : null}
|
|
|
title={
|
|
|
<span>
|
|
|
<CodepenSquareFilled className="mr-1" style={{ fontSize: '20px', color: '#722ED1' }} />
|
|
@@ -93,8 +90,8 @@ const AddAssemblyModal: React.FC<AddAssemblyProps> = ({ defaultData, close, refr
|
|
|
}
|
|
|
extra={
|
|
|
<Checkbox
|
|
|
- onChange={e => handleAssemblyOnchange(e.target.checked, Assembly.COSTPROFILE)}
|
|
|
- checked={assemblyList.includes(Assembly.COSTPROFILE)}
|
|
|
+ onChange={e => handleAssemblyOnchange(e.target.checked, Assembly.DATAPROFILE)}
|
|
|
+ checked={assemblyList.includes(Assembly.DATAPROFILE)}
|
|
|
/>
|
|
|
}>
|
|
|
<div className="min-h-70px">
|
|
@@ -114,6 +111,4 @@ const AddAssemblyModal: React.FC<AddAssemblyProps> = ({ defaultData, close, refr
|
|
|
)
|
|
|
}
|
|
|
|
|
|
-export default connect(({ business }: { matterDetail: BusinessModelState }) => ({
|
|
|
- matterDetail: business.matterDetail
|
|
|
-}))(AddAssemblyModal)
|
|
|
+export default AddAssemblyModal
|