57 lines
1.8 KiB
JavaScript
57 lines
1.8 KiB
JavaScript
import { Col, Collapse, Row } from "antd";
|
|
import React from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
import { connect } from "react-redux";
|
|
import { createStructuredSelector } from "reselect";
|
|
import { selectPrintCenter } from "../../redux/modals/modals.selectors";
|
|
import { TemplateList } from "../../utils/TemplateConstants";
|
|
import PrintCenterItem from "../print-center-item/print-center-item.component";
|
|
import PrintCenterSpeedPrint from "../print-center-speed-print/print-center-speed-print.component";
|
|
|
|
const mapStateToProps = createStructuredSelector({
|
|
printCenterModal: selectPrintCenter,
|
|
});
|
|
|
|
const mapDispatchToProps = (dispatch) => ({});
|
|
|
|
const colSpan = { md: { span: 24 }, lg: { span: 12 } };
|
|
|
|
export function PrintCenterJobsComponent({ printCenterModal }) {
|
|
const { t } = useTranslation();
|
|
const { id: jobId } = printCenterModal.context;
|
|
const tempList = TemplateList("job", {});
|
|
const JobsReportsList = Object.keys(tempList).map((key) => {
|
|
return tempList[key];
|
|
});
|
|
|
|
return (
|
|
<div>
|
|
<Row gutter={[16, 16]}>
|
|
<Col {...colSpan}>
|
|
<PrintCenterSpeedPrint jobId={jobId} />
|
|
</Col>
|
|
<Col {...colSpan}>
|
|
<Collapse accordion>
|
|
<Collapse.Panel header={t("printcenter.labels.repairorder")}>
|
|
<ul style={{ columns: "3 auto" }}>
|
|
{JobsReportsList.map((item) => (
|
|
<PrintCenterItem
|
|
key={item.key}
|
|
item={item}
|
|
id={jobId}
|
|
disabled={item.disabled}
|
|
/>
|
|
))}
|
|
</ul>
|
|
</Collapse.Panel>
|
|
</Collapse>
|
|
</Col>
|
|
</Row>
|
|
</div>
|
|
);
|
|
}
|
|
export default connect(
|
|
mapStateToProps,
|
|
mapDispatchToProps
|
|
)(PrintCenterJobsComponent);
|