| | |
| | | const inspection = () => { }; |
| | | |
| | | const print = () => { |
| | | // const imageUrls = ['https://www.baidu.com/img/flexible/logo/pc/result@2.png',] |
| | | // const iframe = document.createElement('iframe'); |
| | | // iframe.style.display = 'none'; |
| | | // document.body.appendChild(iframe); |
| | | |
| | | // const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; |
| | | // iframeDoc.open(); |
| | | // iframeDoc.write('<html><head><title>Print Images</title></head><body>'); |
| | | |
| | | // // 将图片插入到 iframe 中 |
| | | // imageUrls.forEach((imageUrl) => { |
| | | // iframeDoc.write(`<img src="${imageUrl}" style="margin: 10px;">`); |
| | | // }); |
| | | |
| | | // iframeDoc.write('</body></html>'); |
| | | // iframeDoc.close(); |
| | | |
| | | // // 等待图片加载完成后触发打印 |
| | | // iframe.contentWindow.onload = () => { |
| | | // iframe.contentWindow.print(); |
| | | // // 打印完成后移除 iframe |
| | | // document.body.removeChild(iframe); |
| | | // }; |
| | | }; |
| | | |
| | | |
| | |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt" > |
| | | <Button label="toolbar.print" onClick={print}> |
| | | {/* <Button label="toolbar.print" onClick={print}> |
| | | <FileDownloadIcon /> |
| | | </Button> |
| | | </Button> */} |
| | | {/* <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> */} |
| | | <MyButton setCreateDialog={setCreateDialog} setmodalType={setmodalType} /> |
| | | {/* <Button |