Commit 17df40b6 authored by XieZhiXiong's avatar XieZhiXiong
parents 2c0675dd 462ee6f8
...@@ -5,7 +5,7 @@ import { CaretDownOutlined } from '@ant-design/icons' ...@@ -5,7 +5,7 @@ import { CaretDownOutlined } from '@ant-design/icons'
export interface TableOperationProps { export interface TableOperationProps {
record: any, record: any,
statusOperationMap: any, // 所有状态和操作名称的映射 statusOperationMap: any, // 所有状态和操作名称的映射
operationHandler: any, // 所有的操作句柄 operationHandler: any, // 所有的操作句柄函数
priorityOperationName?: string, // 优先靠前的操作名称 priorityOperationName?: string, // 优先靠前的操作名称
} }
...@@ -16,13 +16,14 @@ const TableOperation:React.FC<TableOperationProps> = (props) => { ...@@ -16,13 +16,14 @@ const TableOperation:React.FC<TableOperationProps> = (props) => {
const [operationName, setOperationName] = useState<string[]>([]) const [operationName, setOperationName] = useState<string[]>([])
useEffect(() => { useEffect(() => {
// let maps = statusOperationMap[record.status] let maps = statusOperationMap[record.status]
// if(maps.length > 2){ if(maps.length > 2 && priorityOperationName && maps.includes(priorityOperationName)){
// setOperationName(() => statusOperationMap[record.status].filter(_ => _ != priorityOperationName)) let temp = maps.filter(_ => _ != priorityOperationName)
// }else{ temp.unshift(priorityOperationName)
setOperationName(temp)
// } }else{
setOperationName(() => statusOperationMap[record.status]) setOperationName(() => statusOperationMap[record.status])
}
}, []) }, [])
return ( <> return ( <>
...@@ -30,13 +31,7 @@ const TableOperation:React.FC<TableOperationProps> = (props) => { ...@@ -30,13 +31,7 @@ const TableOperation:React.FC<TableOperationProps> = (props) => {
operationName.length > 2 operationName.length > 2
? ?
<> <>
{/* { <Button type='link' onClick={operationHandler[operationName[0]]}>{operationName[0]}</Button>
priorityOperationName
?
<Button type='link' onClick={operationHandler[priorityOperationName]}>{priorityOperationName}</Button>
: */}
<Button type='link' onClick={operationHandler[operationName[0]]}>{operationName[0]}</Button>
{/* } */}
<Dropdown overlay={ <Dropdown overlay={
<Menu> <Menu>
{ {
......
...@@ -20,7 +20,7 @@ const SearchForm = (props) => { ...@@ -20,7 +20,7 @@ const SearchForm = (props) => {
onFieldValueChange$('pagination').subscribe((state) => { onFieldValueChange$('pagination').subscribe((state) => {
console.log("pagination") console.log("pagination")
// handleSearch({...state.value}) handleSubmit({...state.value})
}) })
!!effects && effects(); !!effects && effects();
} }
......
...@@ -23,6 +23,7 @@ const tableSchema = { ...@@ -23,6 +23,7 @@ const tableSchema = {
"columns": columns, "columns": columns,
"rowKey": "id", "rowKey": "id",
"pagination":false, "pagination":false,
// loading: true,
"rowSelection": "{{rowSelection}}" "rowSelection": "{{rowSelection}}"
} }
}, },
...@@ -62,8 +63,8 @@ const ProcessProducts = ({visible, cancel, actions, ...restProps}) => { ...@@ -62,8 +63,8 @@ const ProcessProducts = ({visible, cancel, actions, ...restProps}) => {
// const status = actions.getFieldValue('status'); // 状态 // const status = actions.getFieldValue('status'); // 状态
const postData = { const postData = {
name: name || '', name: name || '',
current: 1, ...paginationParams,
pageSize: 10, ...params
} }
fetchData(postData).then((data) => { fetchData(postData).then((data) => {
setTableStatus({dataSource:data.data, totalCount: data.totalCount}) setTableStatus({dataSource:data.data, totalCount: data.totalCount})
......
/* /*
* @Author: Bill * @Author: Bill
* @Date: 2020-10-14 18:45:31 * @Date: 2020-10-14 18:45:31
* @LastEditTime: 2020-10-16 17:39:55 * @LastEditTime: 2020-10-19 09:56:52
* @desc 选择加工商品schema * @desc 选择加工商品schema
* 这里其实就是两个flex 布局加一个table, 通过expressScrope 注入代码 * 这里其实就是两个flex 布局加一个table, 通过expressScrope 注入代码
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment