feat: C端增加重新填写入口, #182 (#392)

Co-authored-by: jiangchunfu <jiangchunfu@kaike.la>
This commit is contained in:
Jiangchunfu 2024-08-12 19:43:55 +08:00 committed by sudoooooo
parent 23f4dd5756
commit 28591f00a3
3 changed files with 30 additions and 2 deletions

View File

@ -2,7 +2,7 @@
<router-view></router-view>
</template>
<script setup lang="ts">
import { onMounted } from 'vue'
import { onMounted, watch } from 'vue'
import { useRoute } from 'vue-router'
import { getPublishedSurveyInfo, getPreviewSchema } from '../api/survey'
@ -56,6 +56,13 @@ onMounted(() => {
getDetail(surveyId as string)
})
watch(
() => route.query.t,
() => {
location.reload()
}
)
const getDetail = async (surveyPath: string) => {
const alert = useCommandComponent(AlertDialog)

View File

@ -16,6 +16,7 @@
></SubmitButton>
</div>
<LogoIcon :logo-conf="logoConf" :readonly="true" />
<VerifyWhiteDialog />
</div>
</div>
</template>
@ -112,7 +113,7 @@ const submitSurver = async () => {
console.log(params)
const res: any = await submitForm(params)
if (res.code === 200) {
router.push({ name: 'successPage' })
router.replace({ name: 'successPage' })
} else {
alert({
title: res.errmsg || '提交失败'

View File

@ -4,6 +4,18 @@
<div class="result-content">
<img src="/imgs/icons/success.webp" />
<div class="msg" v-html="successMsg"></div>
<router-link
:to="{
name: 'renderPage',
query: {
t: new Date().getTime()
}
}"
replace
class="reset-link"
>
重新填写
</router-link>
</div>
<LogoIcon :logo-conf="logoConf" :readonly="true" />
</div>
@ -65,5 +77,13 @@ const successMsg = computed(() => {
font-weight: 500;
margin-top: 0.15rem;
}
.reset-link {
margin-top: 0.24rem;
font-size: 0.27rem;
color: #5094f0;
text-decoration: underline;
display: block;
}
}
</style>