Commit 50f50f80 authored by fahrur huzain's avatar fahrur huzain

filter master data CAT

parent b28a8825
...@@ -602,13 +602,13 @@ export default class MasterDataCAT extends Component { ...@@ -602,13 +602,13 @@ export default class MasterDataCAT extends Component {
let data = response.data.data let data = response.data.data
let listData = data.sort((a, b) => a.item_report_id - b.item_report_id).map((item, index) => { let listData = data.sort((a, b) => a.item_report_id - b.item_report_id).map((item, index) => {
return [ return [
index, index,
item.item_report_id, item.item_report_id,
item.item_report_name,
item.company_name,
item.report_name, item.report_name,
item.weight, item.item_report_name,
item.years, item.years,
item.company_name,
item.weight,
item.status, item.status,
item.company_id item.company_id
] ]
...@@ -848,11 +848,12 @@ export default class MasterDataCAT extends Component { ...@@ -848,11 +848,12 @@ export default class MasterDataCAT extends Component {
name: "Action", name: "Action",
options: { options: {
sort: false, sort: false,
filter: false,
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{this.state.buttonEdit && {this.state.buttonEdit &&
<span> <span>
<a data-tip={'Edit'} data-for="edit"> <a data-tip={'Edit'} data-for="edit">
<button <button
style={{ style={{
...@@ -870,7 +871,7 @@ export default class MasterDataCAT extends Component { ...@@ -870,7 +871,7 @@ export default class MasterDataCAT extends Component {
</span> </span>
} }
{this.state.buttonDelete && {this.state.buttonDelete &&
<span> <span>
<a data-tip={'Delete'} data-for="delete"> <a data-tip={'Delete'} data-for="delete">
<button <button
style={{ style={{
...@@ -893,96 +894,96 @@ export default class MasterDataCAT extends Component { ...@@ -893,96 +894,96 @@ export default class MasterDataCAT extends Component {
} }
} }
}, },
{ {
name: "ID", name: "ID",
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{val}</span> <span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[1]}</span>
</div > </div >
); );
}
} }
} },
}, {
{ name: "Report Name",
name: "Report Name", options: {
options: { customBodyRender: (val, tableMeta) => {
customBodyRender: (val, tableMeta) => { return (
return ( <div style={{ display: 'flex' }}>
<div style={{ display: 'flex' }}> <span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[2]}</span>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[4]}</span> </div >
</div > );
); }
} }
} },
}, {
{ name: "Item Report Name",
name: "Item Report Name", options: {
options: { customBodyRender: (val, tableMeta) => {
customBodyRender: (val, tableMeta) => { return (
return ( <div style={{ display: 'flex' }}>
<div style={{ display: 'flex' }}> <span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[3]}</span>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[2]}</span> </div >
</div > );
); }
} }
} },
}, {
{ name: "Year",
name: "Year", options: {
options: { customBodyRender: (val, tableMeta) => {
customBodyRender: (val, tableMeta) => { return (
return ( <div style={{ display: 'flex' }}>
<div style={{ display: 'flex' }}> <span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[4]}</span>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[6]}</span> </div >
</div > );
); }
} }
} },
}, {
{ name: "Company Name",
name: "Company Name", options: {
options: { customBodyRender: (val, tableMeta) => {
customBodyRender: (val, tableMeta) => { return (
return ( <div style={{ display: 'flex' }}>
<div style={{ display: 'flex' }}> <span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[5]}</span>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[3]}</span> </div >
</div > );
); }
} }
} },
}, {
{ name: "Weight",
name: "Weight", options: {
options: { customBodyRender: (val, tableMeta) => {
customBodyRender: (val, tableMeta) => { return (
return ( <div style={{ display: 'flex' }}>
<div style={{ display: 'flex' }}> <span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[6]}</span>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[5]}</span> </div >
</div > );
); }
} }
} },
}, {
{ name: "Status",
name: "Status", options: {
options: { customBodyRender: (val, tableMeta) => {
customBodyRender: (val, tableMeta) => { return (
return ( <div style={{ display: 'flex' }}>
<div style={{ display: 'flex' }}> <span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[7]}</span>
<span style={{ color: tableMeta.rowData[7] === "Active" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{tableMeta.rowData[7]}</span> </div >
</div > );
); }
}
},
{
name: "company id",
options: {
display: false
} }
} }
},
{
name: "company id",
options: {
display: false
}
}
] ]
const loadingComponent = ( const loadingComponent = (
<div style={{ position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}> <div style={{ position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment