From 5eacf724e0b10c92a17db0fa4f3681082d0d97a1 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 15 二月 2024 16:01:55 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/components/TableSearch/index.jsx | 13 +++++++++++--
zy-asrs-flow/src/pages/system/role/index.jsx | 28 +++-------------------------
2 files changed, 14 insertions(+), 27 deletions(-)
diff --git a/zy-asrs-flow/src/components/TableSearch/index.jsx b/zy-asrs-flow/src/components/TableSearch/index.jsx
index 636ceb7..8117076 100644
--- a/zy-asrs-flow/src/components/TableSearch/index.jsx
+++ b/zy-asrs-flow/src/components/TableSearch/index.jsx
@@ -7,12 +7,21 @@
<Input
style={{ width: 188, marginBottom: 8, display: 'block' }}
value={props.selectedKeys[0]}
- onChange={e => props.setSelectedKeys(e.target.value ? [e.target.value] : [])}
+ onChange={e => {
+ props.setSelectedKeys(e.target.value ? [e.target.value] : [])
+ }}
/>
<Space>
<Button
type="primary"
- onClick={() => props.confirm()}
+ onClick={() => {
+ props.confirm();
+ props.setSearchParam(prevState => ({
+ ...prevState,
+ [props.name]: props.selectedKeys[0]
+ }));
+ props.actionRef.current?.reload();
+ }}
size="small"
style={{ width: 90 }}
>
diff --git a/zy-asrs-flow/src/pages/system/role/index.jsx b/zy-asrs-flow/src/pages/system/role/index.jsx
index d770d00..4efe91c 100644
--- a/zy-asrs-flow/src/pages/system/role/index.jsx
+++ b/zy-asrs-flow/src/pages/system/role/index.jsx
@@ -1,14 +1,14 @@
import React, { useState, useRef, useEffect } from 'react';
import { useIntl, FormattedMessage } from '@umijs/max';
-import { Button, message, Modal, Input, Space } from 'antd';
+import { Button, message, Modal } from 'antd';
import {
FooterToolbar,
PageContainer,
ProTable,
LightFilter,
} from '@ant-design/pro-components';
-import { PlusOutlined, ExportOutlined, SearchOutlined } from '@ant-design/icons';
+import { PlusOutlined, ExportOutlined } from '@ant-design/icons';
import Http from '@/utils/http';
import Edit from './components/edit'
import Filter from '@/components/TableSearch'
@@ -117,7 +117,7 @@
title: '鏍囪瘑',
dataIndex: 'code',
valueType: 'text',
- filterDropdown: (props) => <Filter {...props} />,
+ filterDropdown: (props) => <Filter name='code' {...props} actionRef={actionRef} setSearchParam={setSearchParam} />,
},
{
title: '鎿嶄綔',
@@ -211,30 +211,8 @@
</Button>,
],
}}
- // toolBarRender={() => [
- // <Button
- // type="primary"
- // key="save"
- // onClick={async () => {
- // setModalVisible(true)
- // }}
- // >
- // <PlusOutlined />
- // 娣诲姞
- // </Button>,
- // <Button
- // key="export"
- // onClick={async () => {
- // handleExport();
- // }}
- // >
- // <ExportOutlined />
- // 瀵煎嚭
- // </Button>,
- // ]}
request={(params, sorter, filter) =>
Http.doPostPromise('/api/role/page', { ...params, ...searchParam }, (res) => {
- console.log(filter);
return {
data: res.data.records,
total: res.data.total,
--
Gitblit v1.9.1