| | |
| | | |
| | | |
| | | const inspection = () => { }; |
| | | const print = () => { }; |
| | | |
| | | 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); |
| | | }; |
| | | }; |
| | | |
| | | |
| | | return ( |
| | |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <MyField |
| | | source="code" |
| | | label="table.field.asnOrder.code" |
| | | onClick={(event, record, val) => { |
| | | event.stopPropagation(); |
| | | assign(record); |
| | | }} |
| | | /> |
| | | <TextField source="code" label="table.field.asnOrder.code" /> |
| | | <TextField source="poCode" label="table.field.asnOrder.poCode" /> |
| | | <NumberField source="poId" label="table.field.asnOrder.poId" /> |
| | | <TextField source="type" label="table.field.asnOrder.type" /> |