<template>
  <nm-form-vuetify-drawer ref="form" v-bind="form" v-on="on" :parent="parent" :title="title" placement="left" :visible.sync="visible_">
    <v-checkbox v-model="form.model.isDeleted" label="是否删除"> </v-checkbox>

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

    <v-checkbox v-model="form.model.isFrozen" label="是否冻结"> </v-checkbox>

    <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-checkbox v-model="form.model.isHidden" label="是否隐藏" :rules="form.rules.isHiddenRules"> </v-checkbox>

    <v-checkbox v-model="form.model.isSystemDefined" label="是否系统定义" :rules="form.rules.isSystemDefinedRules"> </v-checkbox>
  </nm-form-vuetify-drawer>
</template>
<script>
import { mixins } from 'xmanager-ui'
const { add, edit, update } = $api.reference.uoMDimension

export default {
  mixins: [mixins.formSave],
  data() {
    return {
      title: '单位类别',
      actions: { add, edit, update },
      parent: this,
      form: {
        model: {
          /** 是否删除 */
          isDeleted: false,
          /** 是否锁定 */
          isLocked: false,
          /** 是否冻结 */
          isFrozen: false,
          /** 单位类别编码 */
          nId: '',
          /** 单位类别名称 */
          name: '',
          /** 单位类别描述 */
          description: '',
          /** 是否隐藏 */
          isHidden: false,
          /** 是否系统定义 */
          isSystemDefined: false
        },
        rules: {
          isDeletedRules: [],
          isLockedRules: [],
          isFrozenRules: [],
          nIdRules: [v => !!v || '单位类别编码 is required'],
          nameRules: [v => !!v || '单位类别名称 is required'],
          descriptionRules: [],
          isHiddenRules: [],
          isSystemDefinedRules: [v => !!v || '是否系统定义 is required']
        }
      }
    }
  }
}
</script>
