Showing
1 changed file
with
11 additions
and
12 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-07-18 10:22:22 | 2 | * @Date: 2022-07-18 10:22:22 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-11-18 11:09:09 | 4 | + * @LastEditTime: 2022-11-21 13:40:08 |
| 5 | * @FilePath: /data-table/src/views/index.vue | 5 | * @FilePath: /data-table/src/views/index.vue |
| 6 | * @Description: 首页 | 6 | * @Description: 首页 |
| 7 | --> | 7 | --> |
| ... | @@ -33,6 +33,7 @@ import _ from "lodash"; | ... | @@ -33,6 +33,7 @@ import _ from "lodash"; |
| 33 | import { useRoute } from "vue-router"; | 33 | import { useRoute } from "vue-router"; |
| 34 | import { queryFormAPI } from "@/api/form.js"; | 34 | import { queryFormAPI } from "@/api/form.js"; |
| 35 | import { addFormDataAPI } from "@/api/data.js"; | 35 | import { addFormDataAPI } from "@/api/data.js"; |
| 36 | +import { showSuccessToast, showFailToast } from "vant"; | ||
| 36 | 37 | ||
| 37 | const $route = useRoute(); | 38 | const $route = useRoute(); |
| 38 | const table_cover = ref(""); | 39 | const table_cover = ref(""); |
| ... | @@ -102,17 +103,15 @@ const onSubmit = async (values) => { | ... | @@ -102,17 +103,15 @@ const onSubmit = async (values) => { |
| 102 | // 检查非表单输入项 | 103 | // 检查非表单输入项 |
| 103 | if (validOther()) { | 104 | if (validOther()) { |
| 104 | // 通过验证 | 105 | // 通过验证 |
| 105 | - // const result = await addFormDataAPI({ | 106 | + const result = await addFormDataAPI({ |
| 106 | - // form_code: $route.query.code, | 107 | + form_code: $route.query.code, |
| 107 | - // data: JSON.stringify(postData.value), | 108 | + data: JSON.stringify(postData.value), |
| 108 | - // }); | 109 | + }); |
| 109 | - // console.warn(result); | 110 | + if (result.code) { |
| 110 | - // if (code) { | 111 | + showSuccessToast("提交成功"); |
| 111 | - // console.warn("提交成功"); | 112 | + } |
| 112 | - // console.warn(data); | 113 | + // console.warn(postData.value); |
| 113 | - // } | 114 | + // console.warn("通过验证"); |
| 114 | - console.warn(postData.value); | ||
| 115 | - console.warn("通过验证"); | ||
| 116 | } else { | 115 | } else { |
| 117 | console.warn("不通过验证"); | 116 | console.warn("不通过验证"); |
| 118 | } | 117 | } | ... | ... |
-
Please register or login to post a comment