<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.workCalendarNId" label="工作日历" :rules="form.rules.workCalendarNIdRules"></v-text-field>

    <v-text-field v-model="form.model.status" label="状态" :rules="form.rules.statusRules"></v-text-field>

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

    <v-text-field v-model="form.model.levelNId" label="程度" :rules="form.rules.levelNIdRules"></v-text-field>

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

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

export default {
  mixins: [mixins.formSave],
  data() {
    return {
      title: '设备',
      actions: { add, edit, update },
      parent: this,
      form: {
        model: {
          /** 编码 */
          nId: '',
          /** 名称 */
          name: '',
          /** 详情 */
          description: '',
          /** 工作日历 */
          workCalendarNId: '',
          /** 状态 */
          status: '',
          /** 设备配置 */
          equipmentConfigurationId: '',
          /** 程度 */
          levelNId: '',
          /** 是否锁定 */
          isLocked: false,
          /** 是否冻结 */
          isFrozen: false
        },
        rules: {
          nIdRules: [v => !!v || '编码 is required'],
          nameRules: [v => !!v || '名称 is required'],
          descriptionRules: [],
          workCalendarNIdRules: [],
          statusRules: [],
          equipmentConfigurationIdRules: [],
          levelNIdRules: [],
          isLockedRules: [],
          isFrozenRules: []
        }
      }
    }
  }
}
</script>
