<template>
  <a-form v-model="computedModelValue" :config="config" :disabled="disabled" :span="24"> </a-form>
</template>

<script setup lang="ts">
import AForm from '@/components/AForm/index.vue'
import { StrAnyObj } from '@/typings'
import { FormConfigType } from '@/components/AForm/type'

const props = withDefaults(
  defineProps<{
    modelValue: StrAnyObj
    disabled: boolean
  }>(),
  {
    disabled: false
  }
)

const emits = defineEmits(['update:modelValue'])

const computedModelValue = computed({
  get() {
    return props.modelValue
  },
  set(newValue) {
    emits('update:modelValue', newValue)
  }
})

const config: FormConfigType[] = [
  {
    type: 'input',
    prop: 'nodeCode',
    label: '节点编码'
  },
  {
    type: 'input',
    prop: 'nodeName',
    label: '节点名称'
  }
]
</script>
