oeeToolBar.js
1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* eslint-disable */
import React from "react";
import oeeStyle from "./oee.less";
import OeeSearchComponent from "./oeeSearchComponent";
import * as commonUtils from "../../utils/utils";
const OeeToolBar = props => {
const { slaveConfig } = props;
const onBtnClick = item => {
console.log(item);
};
const buttonConfig = commonUtils.isNotEmptyObject(slaveConfig)
? slaveConfig.gdsconfigformslave.filter(
item =>
item.sName === "" &&
item.showName !== "" &&
item.sControlName !== "" &&
item.bVisible &&
item.sControlName.indexOf("Btn") > -1
)
: [];
return (
<div className={oeeStyle.bottomBtns}>
<div className={oeeStyle.btnBrints}>
{commonUtils.isNotEmptyArr(buttonConfig)
? buttonConfig.map((item, index) => {
return (
// eslint-disable-next-line jsx-a11y/anchor-is-valid,react/no-array-index-key
<a
key={index}
style={{ background: `${item.sColorTerms}` }}
onClick={() => onBtnClick(item)}
>
{item.showName}
</a>
);
})
: ""}
</div>
<div className={oeeStyle.searchComponent}>
<OeeSearchComponent {...props} />
</div>
</div>
);
};
export default OeeToolBar;