Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2025-02-13 10:33:43 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
943b97a93481b90e97bd97ea70ec2f0aa472b2ad
943b97a9
1 parent
3d5ede46
fix 提交表单成功后,把成功信息保存到缓冲避免URL太长的问题
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
src/views/index.vue
src/views/success.vue
src/views/index.vue
View file @
943b97a
<!--
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 202
4-11-27 16:23:08
* @LastEditTime: 202
5-02-13 10:32:51
* @FilePath: /data-table/src/views/index.vue
* @Description: 首页
-->
...
...
@@ -965,11 +965,13 @@ const successHandle = () => { // 表单成功提交后续操作
if (successInfo.value.commit_action === 'url') {
window.location.href = successInfo.value.commit_url;
} else {
// 把成功信息写进cookies
Cookies.set(`form_${successInfo.value.id}_s_i`, JSON.stringify(successInfo.value));
// 跳转成功页面
$router.push({
path: "/success",
query: {
successI
nfo: JSON.stringify(successInfo.value)
,
successI
d: successInfo.value.id
,
},
});
}
...
...
src/views/success.vue
View file @
943b97a
<!--
* @Date: 2022-06-29 18:18:02
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 202
4-10-16 16:46:34
* @LastEditTime: 202
5-02-13 10:32:22
* @FilePath: /data-table/src/views/success.vue
* @Description: 文件描述
-->
...
...
@@ -58,12 +58,13 @@ const styleObj = {
const store = mainStore();
// const { successInfo } = storeToRefs(store);
const successInfo = ref({});
const successId = $route.query.successId;
const richText = '<div style="font-weight: bold;">123</div>'
onMounted(() => {
$('body').css('backgroundColor', 'white');
successInfo.value =
JSON.parse($route.query.successInfo)
successInfo.value =
Cookies.get(`form_${successId}_s_i`) ? JSON.parse(Cookies.get(`form_${successId}_s_i`)) : '';
});
const handle = () => {
...
...
Please
register
or
login
to post a comment