<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <tenant-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tenant-form>
  </j-modal>
</template>

<script>
import TenantForm from './TenantForm'
export default {
  name: 'TenantModal',
  components: {
    TenantForm,
  },
  data() {
    return {
      title: '',
      width: 1200,
      visible: false,
      disableSubmit: false,
    }
  },
  methods: {
    add() {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.add()
      })
    },
    edit(record) {
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.edit(record)
      })
    },
    close() {
      this.$emit('close')
      this.visible = false
    },
    handleOk() {
      this.$refs.realForm.submitForm()
    },
    submitCallback() {
      this.$emit('ok')
      this.visible = false
    },
    handleCancel() {
      this.close()
    },
  },
}
</script>

<style lang="less" scoped>
/deep/.ant-tabs-nav .ant-tabs-tab-active {
  
}
/deep/.ant-tabs-ink-bar {
  
}
/deep/.action-button .ant-btn-primary {
  
  
  border-radius: 2px;
}
/deep/ .ant-modal-footer {
  padding: 10px 16px 45px;
  border-top: 0;
  > div {
    display: flex;
    justify-content: center;
  }
  .ant-btn {
    width: 76px;
    height: 35px;
    line-height: 34px;
    border-radius: 2px 2px 2px 2px;
    opacity: 1;
    
    padding: 0;

 
  }

  .ant-btn-primary {
    
    
    color: #ffffff;

    &:hover {
      color: #fff !important;
    }
  }
}

// 输入框
/deep/.ant-input {
  height: 38px;
}
/deep/ textarea.ant-input {
  height: auto;
}
// 下拉框
/deep/.ant-select {
  .ant-select-selection--single {
    height: 36px;
  }
  .ant-select-selection__rendered {
    line-height: 36px;
  }
  .ant-select-dropdown-menu-item-active:not(.ant-select-dropdown-menu-item-disabled) {
    
  }
}
/deep/.ant-select-dropdown.ant-select-dropdown--multiple
  .ant-select-dropdown-menu-item-selected
  .ant-select-selected-icon {
  
}
/deep/.ant-row {
  & > .ant-col:nth-child(2),
  & > .ant-col:nth-child(6),
  & > .ant-col:nth-child(10),
  & > .ant-col:nth-child(11),
  & > .ant-col:nth-child(17) {
    .ant-form-item-control-wrapper {
      position: relative;

      &::before {
        position: absolute;
        content: '*';
        color: #f10f0f;
        top: 0;
        right: -24px;
        font-size: 24px;
        line-height: 44px;
      }
    }
  }
}
/deep/.ant-calendar {
  width: auto;
}
</style>