Commit f84d5d03f6ffde5e60d6a6dc27639e109032142f

Authored by 田强
1 parent 95de3e0e

refactor: 完善demo

... ... @@ -8,7 +8,7 @@ export default defineConfig({
8 8 'process.env.site': 'http://qx-test.qgutech.com',
9 9 // 'process.env.apiUrl': 'http://192.168.181.107/qgyun-api',
10 10 // 'process.env.apiUrl': 'http://192.168.1.180/qx-api',
11   - 'process.env.apiUrl': 'http://test.qgutech.com/qx-api',
  11 + 'process.env.apiUrl': 'http://test.qixiaocloud.com/qx-api',
12 12 // 'process.env.apiUrl': 'https://uat.qgutech.com/qx-api',
13 13 'process.env.wf.appCode': 'wf',
14 14 'process.env.wf.funCode': 'ew57e',
... ...
1   -import React, { memo, useEffect } from 'react';
  1 +import React, { memo } from 'react';
2 2 import { Space } from 'antd';
3 3 import { QxSearchForm, QxTable, QxToolbar } from '@/src/components/view-render';
  4 +import { useRequest } from 'ahooks';
4 5 import { getData } from './services';
5 6 import data from './data.json';
6 7
7 8 const AppView: React.FC<AppViewProps> = (props) => {
8 9 const { search, list, bar } = data;
  10 + const { data: tableData = {} as any, run, loading } = useRequest(getData);
  11 +
9 12 const changeFullscreen = () => {};
10   -
11   - useEffect(() => {
12   - getData().then((res: any) => {
13   - console.log('res', res);
14   - });
15   - }, []);
16 13
17 14 return (
18 15 <Space direction="vertical" size={20}>
19   - <QxSearchForm {...search} />
  16 + <QxSearchForm {...search} onSearch={() => run()} />
20 17 <QxToolbar
21 18 isFullscreen
22 19 changeFullscreen={changeFullscreen}
23 20 buttons={bar.buttons}
24 21 />
25   - <QxTable columns={list.columns} />
  22 + <QxTable
  23 + loading={loading}
  24 + columns={list.columns}
  25 + dataSource={tableData.list}
  26 + />
26 27 </Space>
27 28 );
28 29 };
... ...