|
@@ -6,6 +6,7 @@ import useScripts from './hooks/useScripts'
|
|
|
import { Button } from 'antd'
|
|
|
import ProTable, { ProColumnType } from '@ant-design/pro-table'
|
|
|
import LeftMenu from '../RuleCode/components/LeftMenu'
|
|
|
+import { connect } from '@umijs/max'
|
|
|
|
|
|
export const menuOptions = [{ label: '预算业务审批', value: BusinessType.BUDGET }]
|
|
|
|
|
@@ -13,12 +14,12 @@ type iProcessProps = {
|
|
|
activeKey: BusinessType
|
|
|
}
|
|
|
|
|
|
-const Process = () => {
|
|
|
+const Process = ({ dispatch, processList }) => {
|
|
|
const [state, setState] = useState<iProcessProps>({
|
|
|
activeKey: null
|
|
|
})
|
|
|
const [modal, ModalDOM] = useModal()
|
|
|
- const { query, data, loading, addOrEdit, del } = useScripts(modal)
|
|
|
+ const { data, loading, addOrEdit, del } = useScripts(modal)
|
|
|
|
|
|
const columns: ProColumnType<API.ExecutorItem>[] = [
|
|
|
{
|
|
@@ -77,7 +78,10 @@ const Process = () => {
|
|
|
const [subjectID, businessType] = key.split('_')
|
|
|
setState({ ...state, activeKey: key })
|
|
|
startTransition(() => {
|
|
|
- query({ subjectID, businessType })
|
|
|
+ dispatch({
|
|
|
+ type: 'business/queryExecutor',
|
|
|
+ payload: { subjectID, businessType }
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
return (
|
|
@@ -96,7 +100,7 @@ const Process = () => {
|
|
|
rowKey="ID"
|
|
|
search={false}
|
|
|
columns={columns}
|
|
|
- dataSource={data.items}
|
|
|
+ dataSource={processList}
|
|
|
loading={loading}
|
|
|
pagination={{ total: data.total }}
|
|
|
/>
|
|
@@ -107,4 +111,6 @@ const Process = () => {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
-export default Process
|
|
|
+export default connect(({ business }: { processList: BusinessModelState }) => ({
|
|
|
+ processList: business.processList
|
|
|
+}))(Process)
|