Skip to content

Commit

Permalink
feat: C端增加重新填写入口, #182 (#392)
Browse files Browse the repository at this point in the history
Co-authored-by: jiangchunfu <[email protected]>
  • Loading branch information
webaddkevin and jiangchunfu authored Aug 12, 2024
1 parent 8109d35 commit f73bfb0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
9 changes: 8 additions & 1 deletion web/src/render/pages/IndexPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -56,6 +56,13 @@ onMounted(() => {
getDetail(surveyId as string)
})
watch(
() => route.query.t,
() => {
location.reload()
}
)
const getDetail = async (surveyPath: string) => {
const alert = useCommandComponent(AlertDialog)
Expand Down
4 changes: 2 additions & 2 deletions web/src/render/pages/RenderPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
></SubmitButton>
</div>
<LogoIcon :logo-conf="logoConf" :readonly="true" />
<VerifyWhiteDialog/>
<VerifyWhiteDialog />
</div>
</div>
</template>
Expand Down Expand Up @@ -114,7 +114,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 || '提交失败'
Expand Down
20 changes: 20 additions & 0 deletions web/src/render/pages/SuccessPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>

0 comments on commit f73bfb0

Please sign in to comment.