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
2023-02-16 16:08:53 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0b0247f27b5a94e951e65e294d70396d4d2ef0d1
0b0247f2
1 parent
019441d5
✨ feat(提交成功反馈页面): 联调API接口
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
15 deletions
src/store/index.js
src/utils/tools.js
src/views/index.vue
src/views/success.vue
src/store/index.js
View file @
0b0247f
/*
* @Date: 2022-04-18 15:59:42
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 202
2-12-06 11:24:58
* @LastEditTime: 202
3-02-16 10:01:56
* @FilePath: /data-table/src/store/index.js
* @Description: 文件描述
*/
...
...
@@ -25,6 +25,7 @@ export const mainStore = defineStore('main', {
keepPages
:
[
'default'
],
// 很坑爹,空值全部都缓存
fieldName
:
''
,
formSetting
:
{},
// 表单数据收集设置
successInfo
:
{},
// 表单提交返回值
};
},
getters
:
{
...
...
@@ -76,5 +77,8 @@ export const mainStore = defineStore('main', {
changeFormSetting
(
v
)
{
this
.
formSetting
=
v
;
},
changeSuccessInfo
(
v
)
{
this
.
successInfo
=
v
;
},
},
});
...
...
src/utils/tools.js
View file @
0b0247f
/*
* @Date: 2022-04-18 15:59:42
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-02-
09 16:48:05
* @LastEditTime: 2023-02-
15 18:20:03
* @FilePath: /data-table/src/utils/tools.js
* @Description: 文件描述
*/
...
...
@@ -101,7 +101,10 @@ const changeURLArg = (url, arg, arg_val) => {
return
url
+
'\n'
+
arg
+
'\n'
+
arg_val
;
}
// 获取参数key/value值对
const
getUrlParams
=
(
url
)
=>
{
// 没有参数处理
if
(
url
.
split
(
'?'
).
length
===
1
)
return
false
;
let
arr
=
url
.
split
(
'?'
);
let
res
=
arr
[
1
].
split
(
'&'
);
let
items
=
{};
...
...
src/views/index.vue
View file @
0b0247f
<!--
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-02-1
0 18:01:13
* @LastEditTime: 2023-02-1
6 10:18:37
* @FilePath: /data-table/src/views/index.vue
* @Description: 首页
-->
...
...
@@ -471,9 +471,17 @@ const onSubmit = async (values) => {
});
if (result.code) {
showSuccessToast("提交成功");
$router.push({
path: "/success",
});
// 缓存表单返回值
store.changeSuccessInfo(result.data);
// 如果类型为跳转网页
if (result.data.commit_action === 'url') {
window.location.href = result.data.commit_url;
} else {
// 跳转成功页面
$router.push({
path: "/success",
});
}
}
} else {
console.warn(validOther().key + "不通过验证");
...
...
src/views/success.vue
View file @
0b0247f
<!--
* @Date: 2022-06-29 18:18:02
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 202
2-06-29 18:18:0
9
* @FilePath: /
tswj/src/views/test/404
.vue
* @LastEditTime: 202
3-02-16 10:20:1
9
* @FilePath: /
data-table/src/views/success
.vue
* @Description: 文件描述
-->
<template>
<div class="success-page">
<div
style="padding-top: 2rem; padding-bottom: 2rem; text-align: cent
er">
<div
v-if="successInfo.commit_text_type === 'default'" class="text-wrapp
er">
<van-image
round
width="10rem"
...
...
@@ -15,13 +15,13 @@
style="vertical-align: bottom"
:src="icon_success"
/>
<p style="font-size: 1.05rem; margin: 0.5rem; font-weight: bold">提交成功!</p>
<!-- <p style="font-size: 0.9rem; margin-bottom: 0.5rem">您的作品正在审核中</p> -->
<!-- <p style="font-size: 0.9rem">请耐心等待~~</p> -->
<p class="name">{{ successInfo.form_name }}</p>
<p class="text">{{ successInfo.commit_text }}</p>
</div>
<div style="padding: 0 15% 1rem 15%">
<div v-else class="rich-text" v-html="successInfo.commit_text" />
<!-- <div style="padding: 0 15% 1rem 15%">
<div class="button-plain" :style="styleObj" @click="handle">返回</div>
</div>
</div>
-->
</div>
</template>
...
...
@@ -54,7 +54,16 @@ const styleObj = {
color: "#FFFFFF",
};
onMounted(() => {});
// 获取成功返回信息
const store = mainStore();
const { successInfo } = storeToRefs(store);
const richText = '<div style="font-weight: bold;">123</div>'
onMounted(() => {
$('body').css('backgroundColor', 'white');
console.warn(successInfo.value);
});
const handle = () => {
$router.go(-1);
...
...
@@ -63,6 +72,25 @@ const handle = () => {
<style lang="less" scoped>
.success-page {
.text-wrapper {
padding-top: 2rem;
padding-bottom: 2rem;
text-align: center;
.name {
font-size: 1.25rem;
margin: 0.5rem;
font-weight: bold;
}
.text {
font-size: 1.05rem;
margin: 0.5rem;
font-weight: bold;
}
}
.rich-text {
padding: 1rem 2rem;
white-space: pre-wrap;
}
.button-plain {
width: auto;
height: auto;
...
...
Please
register
or
login
to post a comment