import { reactive } from 'vue'
import { EQUIPMENT_TYPE } from '@/utils/dictionary.js'

export const form = reactive({
  mountForm: {
    code: null,
    name: null,
    type: null
  },
  mountRules: {
    boxSn: [{ required: true, message: '请输入设备编号', trigger: 'blur' }],
    name: [{ required: true, message: '请输入盒子名称', type: 'string', trigger: 'blur' }],
    type: [{ required: true, type: 'number', message: '请输入通道编码', trigger: 'blur' }]
  },
  formItem: [
    { type: 'input', key: 'code', label: '设备编号', props: { maxlength: '20', placeholder: '请输入设备编号', clearable: true }},
    { type: 'input', key: 'name', label: '设备名称', props: { maxlength: '20', placeholder: '请输入盒子名称', clearable: true }},
    { type: 'select', key: 'type', label: '设备类型', props: { options: EQUIPMENT_TYPE, clearable: true }},
    { type: 'input', key: 'note', label: '备注', props: { type: 'textarea', autosize: { maxlength: '200', minRows: 3, maxRows: 3 }}}
  ]
})
