From b8fe12c5ff7dc2ce750af72c78d4043e836ad9ab Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 15 二月 2024 20:54:17 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/components/TableSearch/index.jsx | 50 ++++++++++++++++++++++++-
zy-asrs-flow/src/pages/system/role/index.jsx | 27 ++++++++++++-
2 files changed, 72 insertions(+), 5 deletions(-)
diff --git a/zy-asrs-flow/src/components/TableSearch/index.jsx b/zy-asrs-flow/src/components/TableSearch/index.jsx
index 2054aeb..3e7fdb5 100644
--- a/zy-asrs-flow/src/components/TableSearch/index.jsx
+++ b/zy-asrs-flow/src/components/TableSearch/index.jsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { Input, Button, Space } from 'antd';
+import { Input, Button, Space, Select } from 'antd';
const TextFilter = (props) => {
return (
@@ -39,4 +39,50 @@
);
}
-export { TextFilter };
\ No newline at end of file
+const SelectFilter = (props) => {
+ return (
+ <div style={{ padding: 8 }}>
+ <Select
+ style={{ width: 188, marginBottom: 8 }}
+ placeholder="閫夋嫨涓�涓�夐」"
+ value={props.selectedKeys[0]}
+ onChange={value => props.setSelectedKeys(value ? [value] : [])}
+ >
+ {props.data.map(item => (
+ <Select.Option key={item.value} value={item.value}>
+ {item.label}
+ </Select.Option>
+ ))}
+ </Select>
+ <Space>
+ <Button
+ type="primary"
+ onClick={() => {
+ props.confirm();
+ props.setSearchParam(prevState => ({
+ ...prevState,
+ [props.name]: props.selectedKeys[0]
+ }));
+ props.actionRef.current?.reload();
+ }}
+ size="small"
+ style={{ width: 90 }}
+ >
+ 纭畾
+ </Button>
+ <Button
+ onClick={() => {
+ setSelectedKeys([]);
+ clearFilters();
+ }}
+ size="small"
+ style={{ width: 90 }}
+ >
+ 閲嶇疆
+ </Button>
+ </Space>
+ </div>
+ );
+}
+
+export { TextFilter, SelectFilter };
\ No newline at end of file
diff --git a/zy-asrs-flow/src/pages/system/role/index.jsx b/zy-asrs-flow/src/pages/system/role/index.jsx
index c45062e..d0661d0 100644
--- a/zy-asrs-flow/src/pages/system/role/index.jsx
+++ b/zy-asrs-flow/src/pages/system/role/index.jsx
@@ -11,7 +11,7 @@
import { PlusOutlined, ExportOutlined } from '@ant-design/icons';
import Http from '@/utils/http';
import Edit from './components/edit'
-import { TextFilter } from '@/components/TableSearch'
+import { TextFilter, SelectFilter } from '@/components/TableSearch'
const handleSave = async (val) => {
const hide = message.loading('姝e湪娣诲姞');
@@ -112,13 +112,23 @@
dataIndex: 'name',
valueType: 'text',
copyable: true,
- filterDropdown: (props) => <TextFilter name='name' {...props} actionRef={actionRef} setSearchParam={setSearchParam} />,
+ filterDropdown: (props) => <TextFilter
+ name='name'
+ {...props}
+ actionRef={actionRef}
+ setSearchParam={setSearchParam}
+ />,
},
{
title: '鏍囪瘑',
dataIndex: 'code',
valueType: 'text',
- filterDropdown: (props) => <TextFilter name='code' {...props} actionRef={actionRef} setSearchParam={setSearchParam} />,
+ filterDropdown: (props) => <TextFilter
+ name='code'
+ {...props}
+ actionRef={actionRef}
+ setSearchParam={setSearchParam}
+ />,
},
{
title: '鍏徃',
@@ -129,6 +139,17 @@
title: '鐘舵��',
dataIndex: 'status$',
valueType: 'text',
+ filterDropdown: (props) => <SelectFilter
+ name='status'
+ {...props}
+ actionRef={actionRef}
+ setSearchParam={setSearchParam}
+ data={[
+ { label: '姝e父', value: 1 },
+ { label: '绂佺敤', value: 0 },
+ ]}
+ />,
+
},
{
title: '淇敼鏃堕棿',
--
Gitblit v1.9.1