初始化 antd-pro
This commit is contained in:
24
admin-web/src/components/StandardFormRow/index.js
Normal file
24
admin-web/src/components/StandardFormRow/index.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import styles from './index.less';
|
||||
|
||||
const StandardFormRow = ({ title, children, last, block, grid, ...rest }) => {
|
||||
const cls = classNames(styles.standardFormRow, {
|
||||
[styles.standardFormRowBlock]: block,
|
||||
[styles.standardFormRowLast]: last,
|
||||
[styles.standardFormRowGrid]: grid,
|
||||
});
|
||||
|
||||
return (
|
||||
<div className={cls} {...rest}>
|
||||
{title && (
|
||||
<div className={styles.label}>
|
||||
<span>{title}</span>
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.content}>{children}</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default StandardFormRow;
|
||||
72
admin-web/src/components/StandardFormRow/index.less
Normal file
72
admin-web/src/components/StandardFormRow/index.less
Normal file
@@ -0,0 +1,72 @@
|
||||
@import '~antd/lib/style/themes/default.less';
|
||||
|
||||
.standardFormRow {
|
||||
display: flex;
|
||||
margin-bottom: 16px;
|
||||
padding-bottom: 16px;
|
||||
border-bottom: 1px dashed @border-color-split;
|
||||
:global {
|
||||
.ant-form-item {
|
||||
margin-right: 24px;
|
||||
}
|
||||
.ant-form-item-label label {
|
||||
margin-right: 0;
|
||||
color: @text-color;
|
||||
}
|
||||
.ant-form-item-label,
|
||||
.ant-form-item-control {
|
||||
padding: 0;
|
||||
line-height: 32px;
|
||||
}
|
||||
}
|
||||
.label {
|
||||
flex: 0 0 auto;
|
||||
margin-right: 24px;
|
||||
color: @heading-color;
|
||||
font-size: @font-size-base;
|
||||
text-align: right;
|
||||
& > span {
|
||||
display: inline-block;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
&::after {
|
||||
content: ':';
|
||||
}
|
||||
}
|
||||
}
|
||||
.content {
|
||||
flex: 1 1 0;
|
||||
:global {
|
||||
.ant-form-item:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.standardFormRowLast {
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.standardFormRowBlock {
|
||||
:global {
|
||||
.ant-form-item,
|
||||
div.ant-form-item-control-wrapper {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.standardFormRowGrid {
|
||||
:global {
|
||||
.ant-form-item,
|
||||
div.ant-form-item-control-wrapper {
|
||||
display: block;
|
||||
}
|
||||
.ant-form-item-label {
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user