@@ -16,7 +16,7 @@ export default function DashboardScheduledOutToday({data, ...cardProps}) {
|
||||
const {t} = useTranslation();
|
||||
const [state, setState] = useState({
|
||||
sortedInfo: {},
|
||||
});
|
||||
filteredInfo: {},});
|
||||
const [isTvModeScheduledOut, setIsTvModeScheduledOut] = useLocalStorage(
|
||||
"isTvModeScheduledOut",
|
||||
false
|
||||
@@ -41,10 +41,11 @@ export default function DashboardScheduledOutToday({data, ...cardProps}) {
|
||||
joblines_body,
|
||||
joblines_ref,
|
||||
};
|
||||
}).sort(function (a, b) {
|
||||
return new Date(a.scheduled_completion) - new Date(b.scheduled_completion);
|
||||
});
|
||||
|
||||
console.log('Scheduled Out Today')
|
||||
console.dir(scheduledOutToday);
|
||||
|
||||
const tvFontSize = 18;
|
||||
const tvFontWeight = "bold";
|
||||
|
||||
@@ -106,6 +107,8 @@ export default function DashboardScheduledOutToday({data, ...cardProps}) {
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "owner" && state.sortedInfo.order,
|
||||
render: (text, record) => {
|
||||
console.log('Render record out today');
|
||||
console.dir(record);
|
||||
return record.ownerid ? (
|
||||
<Link
|
||||
to={"/manage/owners/" + record.ownerid}
|
||||
@@ -150,8 +153,8 @@ export default function DashboardScheduledOutToday({data, ...cardProps}) {
|
||||
</Link>
|
||||
) : (
|
||||
<span
|
||||
style={{fontSize: tvFontSize, fontWeight: tvFontWeight}}
|
||||
>{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
|
||||
style={{fontSize: tvFontSize, fontWeight: tvFontWeight}}>{`${
|
||||
record.v_model_yr || ""} ${record.v_make_desc || ""} ${
|
||||
record.v_model_desc || ""
|
||||
}`}</span>
|
||||
);
|
||||
@@ -178,7 +181,7 @@ export default function DashboardScheduledOutToday({data, ...cardProps}) {
|
||||
};
|
||||
})
|
||||
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||
[],
|
||||
[],onFilter: (value, record) => value.includes(record.alt_transport),
|
||||
render: (text, record) => (
|
||||
<span style={{fontSize: tvFontSize, fontWeight: tvFontWeight}}>
|
||||
{record.alt_transport}
|
||||
@@ -194,8 +197,8 @@ export default function DashboardScheduledOutToday({data, ...cardProps}) {
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
||||
filters:
|
||||
(data.scheduled_out_today &&
|
||||
data.scheduled_out_today
|
||||
(scheduledOutToday &&
|
||||
scheduledOutToday
|
||||
.map((j) => j.status)
|
||||
.filter(onlyUnique)
|
||||
.map((s) => {
|
||||
@@ -206,7 +209,7 @@ export default function DashboardScheduledOutToday({data, ...cardProps}) {
|
||||
})
|
||||
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||
[],
|
||||
render: (text, record) => (
|
||||
onFilter: (value, record) => value.includes(record.status),render: (text, record) => (
|
||||
<span style={{fontSize: tvFontSize, fontWeight: tvFontWeight}}>
|
||||
{record.status}
|
||||
</span>
|
||||
@@ -372,8 +375,8 @@ export default function DashboardScheduledOutToday({data, ...cardProps}) {
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "ins_co_nm" && state.sortedInfo.order,
|
||||
filters:
|
||||
(data.scheduled_out_today &&
|
||||
data.scheduled_out_today
|
||||
(scheduledOutToday &&
|
||||
scheduledOutToday
|
||||
.map((j) => j.ins_co_nm)
|
||||
.filter(onlyUnique)
|
||||
.map((s) => {
|
||||
@@ -396,8 +399,8 @@ export default function DashboardScheduledOutToday({data, ...cardProps}) {
|
||||
state.sortedInfo.columnKey === "alt_transport" &&
|
||||
state.sortedInfo.order,
|
||||
filters:
|
||||
(data.scheduled_out_today &&
|
||||
data.scheduled_out_today
|
||||
(scheduledOutToday &&
|
||||
scheduledOutToday
|
||||
.map((j) => j.alt_transport)
|
||||
.filter(onlyUnique)
|
||||
.map((s) => {
|
||||
@@ -408,11 +411,11 @@ export default function DashboardScheduledOutToday({data, ...cardProps}) {
|
||||
})
|
||||
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||
[],
|
||||
},
|
||||
onFilter: (value, record) => value.includes(record.alt_transport),},
|
||||
];
|
||||
|
||||
const handleTableChange = (sorter) => {
|
||||
setState({...state, sortedInfo: sorter});
|
||||
const handleTableChange = (pagination, filters, sorter) => {
|
||||
setState({...state, filteredInfo: filters, sortedInfo: sorter});
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -438,7 +441,7 @@ export default function DashboardScheduledOutToday({data, ...cardProps}) {
|
||||
scroll={{x: true, y: "calc(100% - 2em)"}}
|
||||
rowKey="id"
|
||||
style={{height: "85%"}}
|
||||
dataSource={data.scheduled_out_today}
|
||||
dataSource={scheduledOutToday}
|
||||
size={isTvModeScheduledOut ? "small" : "middle"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user