|
@@ -1,7 +1,7 @@
|
|
|
import BasicTable from '@/components/Table'
|
|
import BasicTable from '@/components/Table'
|
|
|
import { apiRoadAddCompany, queryRoadcompanyList } from '@/services/product'
|
|
import { apiRoadAddCompany, queryRoadcompanyList } from '@/services/product'
|
|
|
import { Button, Input, message, Tag } from 'antd'
|
|
import { Button, Input, message, Tag } from 'antd'
|
|
|
-import React, { useRef, useEffect } from 'react'
|
|
|
|
|
|
|
+import React, { useRef, useEffect, useState } from 'react'
|
|
|
import { dayjsFormat } from '@/utils/utils'
|
|
import { dayjsFormat } from '@/utils/utils'
|
|
|
import consts from '@/consts'
|
|
import consts from '@/consts'
|
|
|
import { connect, useAccess, useDispatch } from '@umijs/max'
|
|
import { connect, useAccess, useDispatch } from '@umijs/max'
|
|
@@ -13,6 +13,11 @@ const Enterprise = ({ compilationv2, shouldUpdate }) => {
|
|
|
const dispatch = useDispatch()
|
|
const dispatch = useDispatch()
|
|
|
const dispatchModal = useModal()
|
|
const dispatchModal = useModal()
|
|
|
const tRef = useRef()
|
|
const tRef = useRef()
|
|
|
|
|
+ const [state, setState] = useState({
|
|
|
|
|
+ params: {
|
|
|
|
|
+ projectType: 2
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
// 重置到默认值,包括表单
|
|
// 重置到默认值,包括表单
|
|
|
const initData = () => {
|
|
const initData = () => {
|
|
|
tRef.current?.reset()
|
|
tRef.current?.reset()
|
|
@@ -117,6 +122,10 @@ const Enterprise = ({ compilationv2, shouldUpdate }) => {
|
|
|
renderText: text => dayjsFormat(text, 'YYYY-MM-DD HH:mm')
|
|
renderText: text => dayjsFormat(text, 'YYYY-MM-DD HH:mm')
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
|
|
+ const handleSearch = value => {
|
|
|
|
|
+ tRef.current?.reloadAndRest()
|
|
|
|
|
+ setState({ ...state, params: { ...state.params, search: value } })
|
|
|
|
|
+ }
|
|
|
return (
|
|
return (
|
|
|
<PageContainer title={false} breadcrumb={false}>
|
|
<PageContainer title={false} breadcrumb={false}>
|
|
|
<BasicTable
|
|
<BasicTable
|
|
@@ -125,6 +134,7 @@ const Enterprise = ({ compilationv2, shouldUpdate }) => {
|
|
|
rowKey={record => record.ID}
|
|
rowKey={record => record.ID}
|
|
|
actionRef={tRef}
|
|
actionRef={tRef}
|
|
|
columns={columns}
|
|
columns={columns}
|
|
|
|
|
+ params={state.params}
|
|
|
request={async (params, sort, filter) => {
|
|
request={async (params, sort, filter) => {
|
|
|
const {
|
|
const {
|
|
|
code = -1,
|
|
code = -1,
|
|
@@ -138,7 +148,12 @@ const Enterprise = ({ compilationv2, shouldUpdate }) => {
|
|
|
}}
|
|
}}
|
|
|
toolbar={{
|
|
toolbar={{
|
|
|
search: (
|
|
search: (
|
|
|
- <Input.Search style={{ width: '250px' }} allowClear={true} placeholder="请输入手机、QQ进行搜索" />
|
|
|
|
|
|
|
+ <Input.Search
|
|
|
|
|
+ style={{ width: '250px' }}
|
|
|
|
|
+ allowClear={true}
|
|
|
|
|
+ placeholder="请输入手机、QQ进行搜索"
|
|
|
|
|
+ onSearch={handleSearch}
|
|
|
|
|
+ />
|
|
|
),
|
|
),
|
|
|
actions: [
|
|
actions: [
|
|
|
<Button
|
|
<Button
|