张涛 1 year ago
parent
commit
c8fca8e040
2 changed files with 37 additions and 40 deletions
  1. 37
    36
      src/pages/custom/index.jsx
  2. 0
    4
      src/store/aaa.js

+ 37
- 36
src/pages/custom/index.jsx View File

@@ -1,66 +1,67 @@
1
-import React from 'react'
2
-import { useNavigate } from 'react-router-dom'
3
-import { Button, Popconfirm, message } from 'antd'
4
-import { ProTable } from '@ant-design/pro-components'
5
-import { queryTable } from '@/utils/request'
6
-import { getTaCustom, deleteTaCustom } from '@/services/taCustom'
7
-import Page from '@/components/Page'
1
+import React, { useEffect } from "react";
2
+import { useNavigate } from "react-router-dom";
3
+import { Button, Popconfirm, message } from "antd";
4
+import { ProTable } from "@ant-design/pro-components";
5
+import { queryTable } from "@/utils/request";
6
+import { getTaCustom, deleteTaCustom } from "@/services/taCustom";
7
+import Page from "@/components/Page";
8 8
 
9
-const customList = queryTable(getTaCustom)
9
+const customList = queryTable(getTaCustom);
10 10
 
11 11
 export default (props) => {
12
-  const actionRef = React.useRef()
13
-  const navigate = useNavigate()
12
+  const actionRef = React.useRef();
13
+  const navigate = useNavigate();
14 14
 
15 15
   const handleDelete = (id) => {
16 16
     if (id) {
17 17
       deleteTaCustom(id).then((res) => {
18
-        actionRef.current.reload()
19
-      })
18
+        actionRef.current.reload();
19
+      });
20 20
     }
21
-  }
21
+  };
22
+
22 23
 
23 24
   const columns = [
24 25
     {
25
-      title: '公司',
26
-      dataIndex: 'customName',
26
+      title: "公司",
27
+      dataIndex: "customName",
27 28
       ellipsis: true,
28 29
     },
29 30
     {
30
-      title: '税号',
31
-      dataIndex: 'dutyParagraph',
31
+      title: "税号",
32
+      dataIndex: "dutyParagraph",
32 33
       ellipsis: true,
33 34
       search: false,
34 35
     },
35 36
     {
36
-      title: '开户行',
37
-      dataIndex: 'openingBank',
37
+      title: "开户行",
38
+      dataIndex: "openingBank",
38 39
       ellipsis: true,
39 40
     },
40 41
     {
41
-      title: '账号',
42
-      dataIndex: 'account',
42
+      title: "账号",
43
+      dataIndex: "account",
43 44
       ellipsis: true,
44 45
     },
45 46
     {
46
-      title: '联系人姓名',
47
-      dataIndex: 'contactsName',
47
+      title: "联系人姓名",
48
+      dataIndex: "contactsName",
48 49
       ellipsis: true,
49 50
     },
50 51
     {
51
-      title: '联系人头衔',
52
-      dataIndex: 'contactsTitle',
52
+      title: "联系人头衔",
53
+      dataIndex: "contactsTitle",
53 54
       search: false,
54 55
       ellipsis: true,
55 56
     },
56 57
     {
57
-      title: '联系人手机',
58
-      dataIndex: 'contactsPhone',
58
+      title: "联系人手机",
59
+      dataIndex: "contactsPhone",
59 60
       ellipsis: true,
60 61
     },
61 62
     {
62
-      title: '联系人邮箱',
63
-      dataIndex: 'contactsEmail',
63
+      title: "联系人邮箱",
64
+      dataIndex: "contactsEmail",
64 65
       search: false,
65 66
       ellipsis: true,
66 67
     },
@@ -70,8 +71,8 @@ export default (props) => {
70 71
     //   ellipsis: true,
71 72
     // },
72 73
     {
73
-      title: '操作',
74
-      valueType: 'option',
74
+      title: "操作",
75
+      valueType: "option",
75 76
       width: 200,
76 77
       render: (_, record) => [
77 78
         <Button
@@ -79,7 +80,7 @@ export default (props) => {
79 80
           style={{ padding: 0 }}
80 81
           type="link"
81 82
           onClick={() => {
82
-            navigate(`/custom/edit?id=${record.customId}`)
83
+            navigate(`/custom/edit?id=${record.customId}`);
83 84
           }}
84 85
         >
85 86
           编辑
@@ -97,7 +98,7 @@ export default (props) => {
97 98
         </Popconfirm>,
98 99
       ],
99 100
     },
100
-  ]
101
+  ];
101 102
 
102 103
   return (
103 104
     <Page>
@@ -109,7 +110,7 @@ export default (props) => {
109 110
             key="1"
110 111
             type="primary"
111 112
             onClick={() => {
112
-              navigate('/custom/edit')
113
+              navigate("/custom/edit");
113 114
             }}
114 115
           >
115 116
             新增
@@ -119,5 +120,5 @@ export default (props) => {
119 120
         columns={columns}
120 121
       />
121 122
     </Page>
122
-  )
123
-}
123
+  );
124
+};

+ 0
- 4
src/store/aaa.js View File

@@ -1,4 +0,0 @@
1
-
2
-import React from 'react'
3
-
4
-export const a= React.useRef()