hookehuyr

✨ feat: 删除存在cookie, 未完成的表单功能

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: 2024-11-21 12:15:57 4 + * @LastEditTime: 2024-11-21 13:02:15
5 * @FilePath: /data-table/src/views/index.vue 5 * @FilePath: /data-table/src/views/index.vue
6 * @Description: 首页 6 * @Description: 首页
7 --> 7 -->
...@@ -512,7 +512,7 @@ onMounted(async () => { ...@@ -512,7 +512,7 @@ onMounted(async () => {
512 } 512 }
513 513
514 // TAG:不同类型提交表单处理 514 // TAG:不同类型提交表单处理
515 - if (page_type === 'add' && model === 'edit') { // 表单为新增状态, 检查是否有未完成的表单信息 515 + if (page_type === 'add') { // 表单为新增状态, 检查是否有未完成的表单信息
516 const existingCookie = Cookies.get($route.query.code); 516 const existingCookie = Cookies.get($route.query.code);
517 if (existingCookie) { 517 if (existingCookie) {
518 // 如果Cookie存在,更新它 518 // 如果Cookie存在,更新它
...@@ -973,6 +973,8 @@ const successHandle = () => { // 表单成功提交后续操作 ...@@ -973,6 +973,8 @@ const successHandle = () => { // 表单成功提交后续操作
973 }, 973 },
974 }); 974 });
975 } 975 }
976 + // 删除存在cookie, 未完成的表单功能
977 + Cookies.remove($route.query.code);
976 } 978 }
977 979
978 const onSubmit = async (values) => { // 表单提交回调 980 const onSubmit = async (values) => { // 表单提交回调
......