<script lang="ts" setup>
|
import { onMounted, reactive, toRefs } from 'vue';
|
import { useRoute } from 'vue-router';
|
|
import { getEmailInfo } from '#/api/extend/email';
|
|
import DetailMain from './DetailMain.vue';
|
|
defineOptions({ name: 'ExtendEmailDetail' });
|
|
defineEmits(['register']);
|
|
interface State {
|
dataForm: any;
|
isSend: boolean;
|
loading: boolean;
|
}
|
|
const state = reactive<State>({
|
dataForm: {},
|
isSend: false,
|
loading: false,
|
});
|
const route = useRoute();
|
const { dataForm, isSend, loading } = toRefs(state);
|
|
function init() {
|
state.loading = true;
|
const id = route.query.id;
|
if (!id) return (state.loading = false);
|
getEmailInfo(id).then((res) => {
|
state.dataForm = res.data;
|
state.loading = false;
|
});
|
}
|
|
onMounted(() => {
|
init();
|
});
|
</script>
|
|
<template>
|
<div class="jnpf-content-wrapper bg-white" v-loading="loading">
|
<DetailMain :data-form="dataForm" :is-send="isSend" class="overflow-auto" />
|
</div>
|
</template>
|