


// 表单项下边距
$formItemMarginBottom: 19px;

// 只读模式下的输入框样式
@mixin readonlyInput{
    color:rgba(0, 0, 0, 0.85);
    background: #fff;
    border: none;
    border-bottom: 1px solid #d9d9d9;
    cursor: initial;
} 

.data-form{
    .data-form-item-wrapper{
        display: flex;
        .data-form-scopedSlots{
            width: 100%;
        }
        
        .data-form-item-content{
            flex:1;
            display: flex;
            flex-wrap: wrap;
            
            &>.data-form-item-input{
                // line-height: 0;
                flex: 1;
                &>div{
                    min-width: 130px;
                }
                &>.data-form-buttons{
                    min-width: initial;
                }
            }
            .data-form-item-extend{
                width:100%;
            }
        }
        &.left{
            text-align: left;
        }
        &.center{
            text-align: center;
        }
        &.right{
            text-align: right;
        }
        .ant-calendar-picker,
        .vxe-pulldown,
        .ant-input-number,
        .ant-time-picker{
            width: 100%!important;
        }
    }
    .ant-form-item-children{
        display: block;
    }
    
    .ant-form-item{
        margin-bottom: $formItemMarginBottom;
        display: flex;
        .ant-form-item-label{
            line-height: 40px;
        }
        .ant-form-item-label > label::after,
        .ant-form-item-required::before{
            display: none;
        }

        .data-form-item-title{
            width: 100px;
            text-align: right;
            line-height: 40px;
            &.left{
                text-align: left;  
            }
            &.center{
                text-align: center;  
            }
            &.colon:after {
                content: ':';
                margin: 0 8px 0 2px;
                position: relative;
                top: -0.5px;
            }
    
            &.required:before {
                display: inline-block;
                margin-right: 4px;
                content: '*';
                font-family: SimSun;
                line-height: 1;
                font-size: 14px;
                color: #f5222d;
            }
        }
        .ant-form-item-control-wrapper{
            flex:1;
        }
    }
    .ant-form-item-with-help{
        margin-bottom: 0;
    }
    .data-form-buttons{
        line-height: 40px;
        .ant-btn+.ant-btn{
            margin-left: 10px;
        }
    }

    .ant-select-selection-selected-value{
        position: absolute;
        top: 50%;
        left: 0;
        width: 100%;
        height: 20px;
        margin-top: -10px;
        overflow: hidden;
        line-height: 20px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }


    &.grid{
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    &.flex{
        display: flex;
        flex-wrap:wrap;
    }
    &.vertical{
        .data-form-item-wrapper{
            display: block;
            .data-form-item-title{
                text-align: left;
            }
        }
        .ant-form-item-children{
            display: inline-block;
        }
    }
    &.inline{
        .data-form-buttons{
            display: inline-block;
            
        }
        .ant-form-item{
            display: inline-block;
        }
    }
    
  
    

    &.readonly{
        .ant-input[disabled],
        .ant-select-disabled .ant-select-selection,
        .ant-input-disabled,
        .ant-cascader-picker-disabled,
        .ant-time-picker-input[disabled],
        .ant-select-auto-complete.ant-select .ant-input[disabled],
        .ant-input-number-disabled{
            @include readonlyInput;
        }
        .ant-select-arrow{
            display: none;
        }
        .ant-select-auto-complete.ant-select .ant-input[disabled]{
            border:none;
        }
        .data-form-item-title.required:before{
            content:""
        }
        .ant-calendar-picker .anticon{
            display:none;
        }
    }
    .input_readonly[disabled]:not(.ant-switch){
        @include readonlyInput;
    }
}

.date-range-split {
    display: flex;
    .item {
      flex: 1;
    }
    .fh {
      padding: 0 5px;
      font-size: 14px;
      line-height: 32px;
    }
    .ant-calendar-picker{
      min-width: auto!important;
    }
    
}

.ant-calendar-date.outside{
    background-color: #fafafa;
    width: auto;
}

.input-number-split {
    display: flex;
    .item {
      flex: 1;
    }
    .fh {
      padding: 0 5px;
      font-size: 14px;
      line-height: 32px;
    }
}

@media (max-width: 575px){
    .data-form{
        .ant-form-item-label{
            line-height: 39px;
        }
        .ant-form-item-control-wrapper, .ant-form-item-label{
            display: inline-block; 
            width: auto; 
        }
    }
}