<template>
  <nm-form-vuetify-drawer ref="form" v-bind="form" v-on="on" :parent="parent" :title="title" placement="left" :visible.sync="visible_">
    <v-text-field v-model="form.model.nId" label="编码" :rules="form.rules.nIdRules"></v-text-field>

    <v-text-field v-model="form.model.name" label="名称" :rules="form.rules.nameRules"></v-text-field>

    <v-text-field v-model="form.model.description" label="详情" :rules="form.rules.descriptionRules"></v-text-field>

    <v-text-field v-model="form.model.equipmentConfigurations" label="设备配置" :rules="form.rules.equipmentConfigurationsRules"></v-text-field>

    <v-text-field v-model="form.model.category" label="种类" :rules="form.rules.categoryRules"></v-text-field>

    <v-text-field v-model="form.model.equipmentGroupConfigurationParents" label="设备组配置父" :rules="form.rules.equipmentGroupConfigurationParentsRules"></v-text-field>

    <v-checkbox v-model="form.model.isLocked" label="是否锁定" :rules="form.rules.isLockedRules"> </v-checkbox>

    <v-checkbox v-model="form.model.isFrezen" label="是否冻结" :rules="form.rules.isFrezenRules"> </v-checkbox>
  </nm-form-vuetify-drawer>
</template>
<script>
import { mixins } from 'xmanager-ui'
const { add, edit, update } = $api.materialApp.equipmentGroupConfiguration

export default {
  mixins: [mixins.formSave],
  data() {
    return {
      title: '设备组配置',
      actions: { add, edit, update },
      parent: this,
      form: {
        model: {
          /** 编码 */
          nId: '',
          /** 名称 */
          name: '',
          /** 详情 */
          description: '',
          /** 设备配置 */
          equipmentConfigurations: '',
          /** 种类 */
          category: '',
          /** 设备组配置父 */
          equipmentGroupConfigurationParents: '',
          /** 是否锁定 */
          isLocked: false,
          /** 是否冻结 */
          isFrezen: false
        },
        rules: {
          nIdRules: [v => !!v || '编码 is required'],
          nameRules: [],
          descriptionRules: [],
          equipmentConfigurationsRules: [],
          categoryRules: [],
          equipmentGroupConfigurationParentsRules: [v => !!v || '设备组配置父 is required'],
          isLockedRules: [],
          isFrezenRules: []
        }
      }
    }
  }
}
</script>
