|
@@ -1,10 +1,11 @@
|
|
|
import { useRequest, useModel } from '@umijs/max';
|
|
|
import { getScadaPage, queryV2Projects } from '../../services/scada';
|
|
|
-import { Table } from 'antd';
|
|
|
+import { Button, Form, Input, Table } from 'antd';
|
|
|
import { getToken } from '@/utils/utils';
|
|
|
const Scada = () => {
|
|
|
const token = getToken();
|
|
|
- const { data, loading } = useRequest(queryV2Projects);
|
|
|
+
|
|
|
+ const { data, loading, run: geList } = useRequest(queryV2Projects);
|
|
|
|
|
|
const handleClick = (id) => {
|
|
|
let domain = location.host.includes('work.greentech.com.cn')
|
|
@@ -26,6 +27,36 @@ const Scada = () => {
|
|
|
render: (record) => <a onClick={() => handleClick(record.ID)}>跳转</a>,
|
|
|
},
|
|
|
];
|
|
|
- return <Table dataSource={data?.list} columns={columns} loading={loading} />;
|
|
|
+
|
|
|
+ const handleSearch = (value) => {
|
|
|
+ console.log(value);
|
|
|
+ const params = {};
|
|
|
+ if (value.Name) {
|
|
|
+ params.Name = value.Name;
|
|
|
+ }
|
|
|
+ if (value.Code) {
|
|
|
+ params.Code = value.Code;
|
|
|
+ }
|
|
|
+ geList(params);
|
|
|
+ };
|
|
|
+
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ <Form layout="inline" onFinish={handleSearch}>
|
|
|
+ <Form.Item label="项目名称" name="Name">
|
|
|
+ <Input allowClear />
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item label="项目编号" name="Code">
|
|
|
+ <Input allowClear />
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item>
|
|
|
+ <Button type="primary" htmlType="submit">
|
|
|
+ 查询
|
|
|
+ </Button>
|
|
|
+ </Form.Item>
|
|
|
+ </Form>
|
|
|
+ <Table dataSource={data?.list} columns={columns} loading={loading} />
|
|
|
+ </div>
|
|
|
+ );
|
|
|
};
|
|
|
export default Scada;
|