ny
昨天 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<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>