| 1 | <template> |
| 2 | <div class="visitor-form-layout"> |
| 3 | <ConfigSection :readonly="readonly"> |
| 4 | <VisitorBaseSection v-model="form" :readonly="readonly" :editing="editing" /> |
| 5 | </ConfigSection> |
| 6 | <VisitorConnectionSection v-model="form" :readonly="readonly" /> |
| 7 | <VisitorTransportSection v-model="form" :readonly="readonly" /> |
| 8 | <VisitorXtcpSection v-if="form.type === 'xtcp'" v-model="form" :readonly="readonly" /> |
| 9 | </div> |
| 10 | </template> |
| 11 | |
| 12 | <script setup lang="ts"> |
| 13 | import { computed } from 'vue' |
| 14 | import type { VisitorFormData } from '../../types' |
| 15 | import ConfigSection from '../ConfigSection.vue' |
| 16 | import VisitorBaseSection from './VisitorBaseSection.vue' |
| 17 | import VisitorConnectionSection from './VisitorConnectionSection.vue' |
| 18 | import VisitorTransportSection from './VisitorTransportSection.vue' |
| 19 | import VisitorXtcpSection from './VisitorXtcpSection.vue' |
| 20 | |
| 21 | const props = withDefaults(defineProps<{ |
| 22 | modelValue: VisitorFormData |
| 23 | readonly?: boolean |
| 24 | editing?: boolean |
| 25 | }>(), { readonly: false, editing: false }) |
| 26 | |
| 27 | const emit = defineEmits<{ 'update:modelValue': [value: VisitorFormData] }>() |
| 28 | |
| 29 | const form = computed({ |
| 30 | get: () => props.modelValue, |
| 31 | set: (val) => emit('update:modelValue', val), |
| 32 | }) |
| 33 | </script> |