lisenzhou 2 years ago
parent
commit
ce26dd6ebf
1 changed files with 4 additions and 38 deletions
  1. 4
    38
      src/pages/supportability/index.jsx

+ 4
- 38
src/pages/supportability/index.jsx View File

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from "react";
2
-import { Link, useNavigate } from "react-router-dom";
2
+import { useNavigate } from "react-router-dom";
3 3
 import {
4 4
   Button,
5 5
   Row,
@@ -7,20 +7,14 @@ import {
7 7
   Form,
8 8
   Input,
9 9
   InputNumber,
10
-  DatePicker,
11
-  notification,
12 10
   Card,
13 11
   Checkbox,
14 12
 } from "antd";
15 13
 import {
16 14
   getSupportCapabilityDetail,
17 15
   updateSupportCapability,
18
-  saveSupportCapability,
19 16
 } from "@/services/supportCapability";
20 17
 
21
-const { TextArea } = Input;
22
-const { RangePicker } = DatePicker;
23
-
24 18
 const configList = [
25 19
   {
26 20
     //12个
@@ -214,34 +208,12 @@ const configList = [
214 208
 ];
215 209
 
216 210
 export default (props) => {
217
-  //   const { dataSource, setDataSource } = props;
218
-  //   const id = dataSource ? dataSource.id : undefined;
219 211
 
220
-  const navigate = useNavigate();
221 212
   const [form] = Form.useForm();
222
-  //   const [rangeDate, setRangeDate] = useState([]);
223
-  const [loading, setLoading] = useState(false);
224 213
 
225
-  const onChange = (dts) => {
226
-    // const [start, end] = dts;
227
-    // setRangeDate(dts);
228
-    // form.setFieldValue('startDate', start ? start.format('YYYY-MM-DD') : undefined);
229
-    // form.setFieldValue('endDate', end ? end.format('YYYY-MM-DD') : undefined);
230
-  };
214
+  const [loading, setLoading] = useState(false);
231 215
 
232 216
   const onFinish = (values) => {
233
-    console.log(values, "---");
234
-    // const notNull = Object.keys(values)
235
-    //   .map((k) => values[k])
236
-    //   .filter(Boolean);
237
-    // if (!notNull || notNull.length < 1) {
238
-    //   notification.warn({ message: "未检索到填写内容" });
239
-    //   return;
240
-    // }
241
-    // const [start, end] = rangeDate;
242
-    // const startDate = start ? start.format("YYYY-MM-DD") : undefined;
243
-    // const endDate = end ? end.format("YYYY-MM-DD") : undefined;
244
-    // const func = id ? updateGuaranteeTask : addGuaranteeTask;
245 217
     setLoading(true);
246 218
     updateSupportCapability(1, {
247 219
       ...values,
@@ -251,12 +223,8 @@ export default (props) => {
251 223
     })
252 224
       .then((res) => {
253 225
         setLoading(false);
254
-        // setDataSource(res);
255
-        // notification.success({ message: '操作成功' })
256 226
       })
257
-      .catch(() => {
258
-        // setLoading(false);
259
-      });
227
+      .catch(() => {});
260 228
   };
261 229
 
262 230
   useEffect(() => {
@@ -311,9 +279,7 @@ export default (props) => {
311 279
             <Button type="primary" htmlType="submit" loading={loading}>
312 280
               提交
313 281
             </Button>
314
-            {/* <Button style={{ marginLeft: "48px" }} onClick={() => navigate(-1)}>
315
-              返回
316
-            </Button> */}
282
+
317 283
           </Col>
318 284
         </Row>
319 285
       </Form>