<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.category" label="种类" :rules="form.rules.categoryRules"></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.equipment" label="设备" :rules="form.rules.equipmentRules"></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.equipmentGroup

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