李志伟 2 years ago
parent
commit
fd434df3f1
2 changed files with 19 additions and 5 deletions
  1. 3
    3
      config/proxy.js
  2. 16
    2
      src/components/PageTable/index.jsx

+ 3
- 3
config/proxy.js View File

11
     // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
11
     // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
12
     '/api/': {
12
     '/api/': {
13
       // 要代理的地址
13
       // 要代理的地址
14
-      target: 'http://192.168.89.147:9002',
14
+      target: 'http://192.168.89.25:9002',
15
       changeOrigin: true,
15
       changeOrigin: true,
16
       headers: {
16
       headers: {
17
-        origin: 'http://192.168.89.147:9002',
18
-        referer: 'http://192.168.89.147:9002',
17
+        origin: 'http://192.168.89.25:9002',
18
+        referer: 'http://192.168.89.25:9002',
19
       },
19
       },
20
 
20
 
21
       // target: 'http://resumework-service.njyunzhi.com',
21
       // target: 'http://resumework-service.njyunzhi.com',

+ 16
- 2
src/components/PageTable/index.jsx View File

1
 import React, { useState, useCallback, useRef } from 'react';
1
 import React, { useState, useCallback, useRef } from 'react';
2
-import { Button } from 'antd';
2
+import { Button, message } from 'antd';
3
 import { UploadOutlined } from '@ant-design/icons';
3
 import { UploadOutlined } from '@ant-design/icons';
4
 import ProTable from '@ant-design/pro-table';
4
 import ProTable from '@ant-design/pro-table';
5
 import { queryTable } from '@/utils/request';
5
 import { queryTable } from '@/utils/request';
30
   const [exporting, exportFunc] = useExport(expfunc);
30
   const [exporting, exportFunc] = useExport(expfunc);
31
 
31
 
32
   const handleExport = useCallback(() => {
32
   const handleExport = useCallback(() => {
33
+
33
     if (!exportParams.current) {
34
     if (!exportParams.current) {
34
       const formData = ref.current ? ref.current.getFieldsValue() : {};
35
       const formData = ref.current ? ref.current.getFieldsValue() : {};
35
       exportParams.current = { ...formData, ...params }
36
       exportParams.current = { ...formData, ...params }
36
     }
37
     }
37
-    exportFunc(exportParams.current);
38
+    let obj = exportParams.current
39
+    if (obj.prefix) {
40
+      if (obj.start) {
41
+        if (obj.end) {
42
+          exportFunc(exportParams.current);
43
+        } else {
44
+          message.info('请输入终止号码点击查询后再点击导出')
45
+        }
46
+      } else {
47
+        message.info('请输入起始号码点击查询后再点击导出')
48
+      }
49
+    } else {
50
+      message.info('请输入卡号前缀点击查询后再点击导出')
51
+    }
38
   }, [exportFunc, params]);
52
   }, [exportFunc, params]);
39
 
53
 
40
   // 添加导出按钮
54
   // 添加导出按钮