trunk/pc4mobx/organization/components/VersionsSlider.js

94 lines
2.7 KiB
JavaScript
Raw Normal View History

2022-12-09 17:51:10 +08:00
import {
WeaFormItem,
WeaTab,
WeaTableEdit
} from 'ecCom'
import {
Spin,
Button,
Tooltip,
Row, Col, Select
} from 'antd'
import { chunk, isEmpty } from 'lodash';
import { toJS } from "mobx";
const Option = Select.Option;
export default class VersionsSlider extends React.Component {
componentDidMount() {
}
2022-12-15 19:45:38 +08:00
isEmptyObject(obj) {
for (let key in obj) {
return false;
}
return true;
}
2022-12-09 17:51:10 +08:00
render() {
const {
versionList,
handleChange
} = this.props;
const newData = chunk(versionList.datas, 2);
return (
2022-12-15 19:45:38 +08:00
<div style={{ "marginTop": "50px", "paddingLeft": "30px", "height": "30px", "lineHeight": "30px", "paddingRight": "30px" }}>
<Row>
<Col span={8}>
<p>操作人: {versionList.operateName}</p>
</Col>
<Col span={8}>
<p>操作时间: {versionList.operateTime}</p>
</Col>
<Col span={8}>
<div>版本: <Select showSearch
style={{ width: 100 }}
placeholder="请选择版本"
defaultValue="1.0"
optionFilterProp="children"
notFoundContent="无法找到"
onChange={handleChange}
>
{
versionList.versions.map((item) => {
return (<Option value={item.value}>V{item.value}</Option>)
})
}
2022-12-09 17:51:10 +08:00
2022-12-15 19:45:38 +08:00
</Select></div>
</Col>
</Row>
<div style={{ "marginTop": "30px", "width": "100%" }}>
{newData.map((item, index) => {
2022-12-09 17:51:10 +08:00
return (
2022-12-15 19:45:38 +08:00
<div key={index} style={{ "display": "flex" }}>
{item.map((subItem) => {
return (
<div style={{ "width": "50%", "height": "40px", "overflow": "hidden", "testOverflow": "ellipsis", "whiteSpace": "nowrap" }}>
<span style={{ "width": "80px", "display": "inline-block", "textAlign": "right", "color": "#999999" }}>{subItem.fieldId}</span>
{subItem.fieldValue.length > 10 ? <Tooltip placement="topLeft" title={subItem.fieldValue}>
<span style={{ "marginLeft": "20px" }}>{subItem.fieldValue}</span>
</Tooltip> : <span style={{ "marginLeft": "20px" }}>{subItem.fieldValue}</span>}
2022-12-09 17:51:10 +08:00
2022-12-15 19:45:38 +08:00
</div>
2022-12-09 17:51:10 +08:00
2022-12-15 19:45:38 +08:00
);
})}
</div>
2022-12-09 17:51:10 +08:00
);
})}
</div>
2022-12-15 19:45:38 +08:00
</div>
2022-12-09 17:51:10 +08:00
)
}
}