feat: 回显表单
This commit is contained in:
@@ -329,16 +329,19 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onUnmounted } from 'vue'
|
||||
import { ref, onUnmounted, onMounted } from 'vue'
|
||||
import { debounce } from 'lodash-es'
|
||||
import type { Rule } from 'ant-design-vue/es/form'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { Https } from '@/tool/https'
|
||||
import { useRoute } from 'vue-router'
|
||||
import type { UploadChangeParam } from 'ant-design-vue'
|
||||
import VerifycationCodeInput from './components/VerificationCodeInput.vue'
|
||||
import { Https } from '@/tool/https'
|
||||
import UploadStatus from './components/UploadStatus.vue'
|
||||
import Success from './components/Success.vue'
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const isCompleted = ref(false)
|
||||
|
||||
const hasValidEmail = ref(false)
|
||||
@@ -562,6 +565,8 @@
|
||||
},
|
||||
fullData: true
|
||||
}).then(res => {
|
||||
console.log('coderes', res)
|
||||
|
||||
form.value.secureToken = res.data.secureToken
|
||||
|
||||
message.success('Verification successful!')
|
||||
@@ -581,7 +586,10 @@
|
||||
.validate()
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
Https.axiosPost(Https.httpUrls.submitForm, form.value)
|
||||
Https.axiosPost(Https.httpUrls.submitForm, form.value).then(res => {
|
||||
console.log('res', res)
|
||||
isCompleted.value = true
|
||||
})
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
@@ -900,7 +908,18 @@
|
||||
}
|
||||
])
|
||||
|
||||
// 组件卸载时清理定时器
|
||||
const handleEchoForm = () => {
|
||||
Https.axiosGet(Https.httpUrls.getContestantByID + route.query.id).then(res => {
|
||||
console.log('获取到的值---', res)
|
||||
Object.assign(form.value, res)
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (route.query.id) {
|
||||
handleEchoForm()
|
||||
}
|
||||
})
|
||||
onUnmounted(() => {
|
||||
clearCountdown()
|
||||
})
|
||||
@@ -924,7 +943,7 @@
|
||||
width: 2rem;
|
||||
height: 1rem;
|
||||
}
|
||||
.apply-container{
|
||||
.apply-container {
|
||||
min-height: calc(100% -18rem);
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user