|
@@ -6,7 +6,7 @@ import { queryTable, queryDict } from "@/utils/request";
|
6
|
6
|
import Page from '@/components/Page';
|
7
|
7
|
import { getTaCheck } from '@/service/tacheck';
|
8
|
8
|
import { getTdLocType } from '@/service/tdloctype';
|
9
|
|
-import { getTaCheckAnswer } from '@/service/tacheckanswer';
|
|
9
|
+import { getTaCheckAnswer, exportTaCheckAnswer } from '@/service/tacheckanswer';
|
10
|
10
|
import useBool from '@/utils/hooks/useBool';
|
11
|
11
|
|
12
|
12
|
const getCheck = queryDict(getTaCheck, { labelKey: 'title', valueKey: 'checkId' });
|
|
@@ -21,6 +21,7 @@ export default (props) => {
|
21
|
21
|
const paramsRef = React.useRef();
|
22
|
22
|
const [notificationApi, contextHolder] = notification.useNotification();
|
23
|
23
|
const navigate = useNavigate();
|
|
24
|
+ const [params, setParams] = React.useState({});
|
24
|
25
|
|
25
|
26
|
const goToDetail = (row) => {
|
26
|
27
|
navigate(`/checkAnswer/loc/detail?answerId=${row.answerId}&itemType=loc`)
|
|
@@ -79,21 +80,22 @@ export default (props) => {
|
79
|
80
|
|
80
|
81
|
const beforeSearchSubmit = (params) => {
|
81
|
82
|
paramsRef.current = params;
|
|
83
|
+ setParams(params);
|
82
|
84
|
return params;
|
83
|
85
|
}
|
84
|
|
-
|
85
|
86
|
const onExport = () => {
|
86
|
|
- // if (!paramsRef.current) {
|
87
|
|
- // notificationApi.warning({ message: '请先进行条件查询' });
|
88
|
|
- // return
|
89
|
|
- // }
|
|
87
|
+ if (!paramsRef.current) {
|
|
88
|
+ notificationApi.warning({ message: '请先进行条件查询' });
|
|
89
|
+ return
|
|
90
|
+ }
|
90
|
91
|
|
91
|
|
- // startLoading();
|
92
|
|
- // exportTaCheckAnswer(paramsRef.current).then(() => {
|
93
|
|
- // stopLoading();
|
94
|
|
- // }).catch(() => {
|
95
|
|
- // stopLoading();
|
96
|
|
- // });
|
|
92
|
+ startLoading();
|
|
93
|
+ exportTaCheckAnswer({ ...addOnParams, ...params }).then(() => {
|
|
94
|
+ // console.log('params', params);
|
|
95
|
+ stopLoading();
|
|
96
|
+ }).catch(() => {
|
|
97
|
+ stopLoading();
|
|
98
|
+ });
|
97
|
99
|
}
|
98
|
100
|
|
99
|
101
|
return (
|
|
@@ -107,16 +109,16 @@ export default (props) => {
|
107
|
109
|
params={addOnParams}
|
108
|
110
|
beforeSearchSubmit={beforeSearchSubmit}
|
109
|
111
|
form={{ ignoreRules: false }}
|
110
|
|
- // toolBarRender={() => [
|
111
|
|
- // <Button
|
112
|
|
- // key="1"
|
113
|
|
- // type="primary"
|
114
|
|
- // loading={loading}
|
115
|
|
- // onClick={onExport}
|
116
|
|
- // >
|
117
|
|
- // 导出
|
118
|
|
- // </Button>,
|
119
|
|
- // ]}
|
|
112
|
+ toolBarRender={() => [
|
|
113
|
+ <Button
|
|
114
|
+ key="1"
|
|
115
|
+ type="primary"
|
|
116
|
+ loading={loading}
|
|
117
|
+ onClick={onExport}
|
|
118
|
+ >
|
|
119
|
+ 导出
|
|
120
|
+ </Button>,
|
|
121
|
+ ]}
|
120
|
122
|
/>
|
121
|
123
|
</Page>
|
122
|
124
|
)
|