|
@@ -0,0 +1,60 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <a-card>
|
|
|
|
|
+ <a-form
|
|
|
|
|
+ ref="formRef"
|
|
|
|
|
+ :model="formData"
|
|
|
|
|
+ :rules="formRules"
|
|
|
|
|
+ v-bind="layout"
|
|
|
|
|
+ :label-col="{ ...layout.labelCol, offset: 0 }"
|
|
|
|
|
+ :wrapper-col="{ ...layout.wrapperCol, offset: 0 }"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-form-item label="学号:" name="studentNum">
|
|
|
|
|
+ <a-input v-model:value="formData.studentNum" :maxlength="50" placeholder="请输入学号" allow-clear />
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item label="邮箱:" name="email">
|
|
|
|
|
+ <a-input v-model:value="formData.email" :maxlength="200" placeholder="请输入邮箱" allow-clear />
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item :wrapper-col="{ ...layout.wrapperCol, offset: layout.labelCol.span }">
|
|
|
|
|
+ <a-button type="primary" :loading="submitLoading" @click="onSubmit">激活</a-button>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-form>
|
|
|
|
|
+ </a-card>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script setup>
|
|
|
|
|
+ import { required } from '@/utils/formRules'
|
|
|
|
|
+ import {message} from 'ant-design-vue'
|
|
|
|
|
+ const formRef = ref()
|
|
|
|
|
+ let formData = ref({})
|
|
|
|
|
+ const submitLoading = ref(false)
|
|
|
|
|
+ // 默认要校验的
|
|
|
|
|
+ const formRules = {
|
|
|
|
|
+ studentNum: [required('请输入学号')],
|
|
|
|
|
+ email: [required('请输入邮箱')]
|
|
|
|
|
+ }
|
|
|
|
|
+ // 验证并提交数据
|
|
|
|
|
+ const onSubmit = () => {
|
|
|
|
|
+ formRef.value
|
|
|
|
|
+ .validate()
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ submitLoading.value = true
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ message.success('激活成功')
|
|
|
|
|
+ submitLoading.value = false
|
|
|
|
|
+ }, 1000)
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ submitLoading.value = false
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ const layout = {
|
|
|
|
|
+ labelCol: {
|
|
|
|
|
+ span: 3
|
|
|
|
|
+ },
|
|
|
|
|
+ wrapperCol: {
|
|
|
|
|
+ span: 21
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style lang="less" scoped></style>
|