fmt
This commit is contained in:
@ -1,40 +1,46 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card shadow="always" style="width: 55%; margin: 0 auto">
|
||||
<research-form ref="researchFormRef" v-model="form" is-add/>
|
||||
<research-form ref="researchFormRef" v-model="form" is-add />
|
||||
<div :style="{ marginLeft: labelWidth + 'px' }">
|
||||
<el-button @click="$router.go(-1)">取消</el-button>
|
||||
<el-button @click="router.push('/identity/index')">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import ResearchForm from '@/views/components/ResearchForm'
|
||||
import {reactive, ref, toRefs} from "vue";
|
||||
import ResearchForm from "@/views/components/ResearchForm";
|
||||
import { reactive, ref, toRefs } from "vue";
|
||||
import { insertResearch } from "@/api/identity";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
const router = useRouter();
|
||||
const props = defineProps({
|
||||
labelWidth: {
|
||||
type: Number,
|
||||
default: 120
|
||||
}
|
||||
})
|
||||
default: 120,
|
||||
},
|
||||
});
|
||||
const data = reactive({
|
||||
form: {
|
||||
industrys: [],
|
||||
}
|
||||
})
|
||||
const {form} = toRefs(data)
|
||||
const researchFormRef = ref()
|
||||
form: {},
|
||||
});
|
||||
const { form } = toRefs(data);
|
||||
const researchFormRef = ref();
|
||||
|
||||
const submitForm = async () => {
|
||||
if (!researchFormRef.value) return
|
||||
const valid = await researchFormRef.value.validateForm()
|
||||
if (!researchFormRef.value) return;
|
||||
const valid = await researchFormRef.value.validateForm();
|
||||
if (valid) {
|
||||
// TODO: submit laboratory
|
||||
insertResearch(form.value).then((resp) => {
|
||||
ElMessage.success("申请入驻成功");
|
||||
router.push("/identity/index");
|
||||
});
|
||||
} else {
|
||||
console.log("verify failed");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
Reference in New Issue
Block a user