Explorar el Código

修改项目的过滤方式

richard hace 3 años
padre
commit
29e95950a3
Se han modificado 3 ficheros con 30 adiciones y 4 borrados
  1. 10 1
      src/pages/equipment/accessControl.tsx
  2. 10 1
      src/pages/equipment/dust.tsx
  3. 10 2
      src/pages/videos/index.tsx

+ 10 - 1
src/pages/equipment/accessControl.tsx

@@ -256,10 +256,18 @@ const accessControl: React.FC = () => {
                     top: 33,
                     placeholder: '请选择项目',
                     component: (props) => (
-                        <Select loading={projectListState.loading} {...props}>
+                        <Select
+                            showSearch
+                            filterOption={(inputValue, option) => {
+                                return option?.title.indexOf(inputValue) !== -1
+                            }}
+                            loading={projectListState.loading}
+                            {...props}
+                        >
                             {projectListState.dataSouce.map((project) => {
                                 return (
                                     <Select.Option
+                                        title={project.name}
                                         key={project.id}
                                         value={project.id}
                                     >
@@ -294,6 +302,7 @@ const accessControl: React.FC = () => {
                 </Col>
             </Row>
             <Modal
+                maskClosable={false}
                 title="新增"
                 visible={addModalState.visible}
                 width={600}

+ 10 - 1
src/pages/equipment/dust.tsx

@@ -159,12 +159,20 @@ const dust: React.FC<RouteComponentProps> = () => {
                 required: true,
                 children: (
                     <Select
+                        showSearch
+                        filterOption={(inputValue, option) => {
+                            return option?.title.indexOf(inputValue) !== -1
+                        }}
                         placeholder="请选择项目"
                         loading={projectListState.loading}
                     >
                         {projectListState.dataSouce.map((project) => {
                             return (
-                                <Option key={project.id} value={project.id}>
+                                <Option
+                                    title={project.name}
+                                    key={project.id}
+                                    value={project.id}
+                                >
                                     {project.name}
                                 </Option>
                             )
@@ -330,6 +338,7 @@ const dust: React.FC<RouteComponentProps> = () => {
                 }}
             ></Table>
             <Modal
+                maskClosable={false}
                 destroyOnClose
                 width={800}
                 okText="确认"

+ 10 - 2
src/pages/videos/index.tsx

@@ -177,6 +177,7 @@ const videos: React.FC<RouteComponentProps> = ({ history }) => {
                 loading={VideoListState.loading}
             ></Table>
             <Modal
+                maskClosable={false}
                 title="添加设备"
                 visible={state.visibleModal}
                 okText="确认"
@@ -196,14 +197,21 @@ const videos: React.FC<RouteComponentProps> = ({ history }) => {
                     </Form.Item>
                     <Form.Item
                         name="projectId"
-                        label="工程名"
+                        label="项目"
                         required
                         rules={[{ required: true, message: '请选择工程项目' }]}
                     >
-                        <Select placeholder="请选择工程项目">
+                        <Select
+                            showSearch
+                            filterOption={(inputValue, option) => {
+                                return option?.title.indexOf(inputValue) !== -1
+                            }}
+                            placeholder="请选择工程项目"
+                        >
                             {projectListState.dataSouce.map((project) => {
                                 return (
                                     <Select.Option
+                                        title={project.name}
                                         key={project.id}
                                         value={project.id}
                                     >