|
@@ -6,6 +6,7 @@ import Styles from './style.less'
|
6
|
6
|
import request from '../../../utils/request';
|
7
|
7
|
import apis from '../../../services/apis';
|
8
|
8
|
import AuthButton from '@/components/AuthButton';
|
|
9
|
+import { debuglog } from 'util';
|
9
|
10
|
|
10
|
11
|
function body() {
|
11
|
12
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -51,22 +52,6 @@ function body() {
|
51
|
52
|
getList({ pageNum: 1, pageSize: 10 })
|
52
|
53
|
}, [])
|
53
|
54
|
|
54
|
|
- function getList(params) {
|
55
|
|
- request({ ...apis.buildingType.getList, params: { ...params } }).then(res => {
|
56
|
|
- setData(res)
|
57
|
|
- }).catch(err => {
|
58
|
|
- // eslint-disable-next-line no-unused-expressions
|
59
|
|
- <Alert
|
60
|
|
- style={{
|
61
|
|
- marginBottom: 24,
|
62
|
|
- }}
|
63
|
|
- message={err}
|
64
|
|
- type="error"
|
65
|
|
- showIcon
|
66
|
|
- />
|
67
|
|
- })
|
68
|
|
- }
|
69
|
|
-
|
70
|
55
|
const openNotificationWithIcon = (type, message) => {
|
71
|
56
|
notification[type]({
|
72
|
57
|
message,
|
|
@@ -75,6 +60,15 @@ function body() {
|
75
|
60
|
});
|
76
|
61
|
}
|
77
|
62
|
|
|
63
|
+ function getList(params) {
|
|
64
|
+ request({ ...apis.buildingType.getList, params: { ...params } }).then(res => {
|
|
65
|
+ setData(res)
|
|
66
|
+ }).catch(err => {
|
|
67
|
+ // eslint-disable-next-line no-unused-expressions
|
|
68
|
+ openNotificationWithIcon('error', err)
|
|
69
|
+ })
|
|
70
|
+ }
|
|
71
|
+
|
78
|
72
|
// 分页
|
79
|
73
|
function onChange(pageNumber) {
|
80
|
74
|
// eslint-disable-next-line no-console
|
|
@@ -90,7 +84,7 @@ function body() {
|
90
|
84
|
}).then(() => {
|
91
|
85
|
openNotificationWithIcon('success', '操作成功')
|
92
|
86
|
}).catch(err => {
|
93
|
|
- openNotificationWithIcon('error', err)
|
|
87
|
+ //openNotificationWithIcon('error', err.message)
|
94
|
88
|
})
|
95
|
89
|
}
|
96
|
90
|
|