Commit d353e947 authored by wuhao's avatar wuhao 🎯

asder

parent ba8ec324
...@@ -335,3 +335,27 @@ table { ...@@ -335,3 +335,27 @@ table {
flex:1 flex:1
} }
} }
@media all {
.page-break {
display: none;
}
}
@media print {
html,
body {
height: initial !important;
overflow: initial !important;
-webkit-print-color-adjust: exact;
}
}
@media print {
.page-break {
margin-top: 2rem;
display: block;
page-break-after: always;
}
}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="theme-color" content="#1890ff" /> <meta name="theme-color" content="#1890ff" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta <meta name="keywords"
name="keywords" content="antd,umi,umijs,ant design,Scaffolding, layout, Ant Design, project, Pro, admin, console, homepage, out-of-the-box, middle and back office, solution, component library" />
content="antd,umi,umijs,ant design,Scaffolding, layout, Ant Design, project, Pro, admin, console, homepage, out-of-the-box, middle and back office, solution, component library" <meta name="description" content="
/> An out-of-box UI solution for enterprise applications as a React boilerplate." />
<meta <meta name="description" content="
name="description" Out-of-the-box mid-stage front-end/design solution." />
content=" <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
An out-of-box UI solution for enterprise applications as a React boilerplate."
/>
<meta
name="description"
content="
Out-of-the-box mid-stage front-end/design solution."
/>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
/>
<title>Ant Design Pro</title> <title>Ant Design Pro</title>
<link rel="icon" href="<%= context.config.publicPath +'favicon.ico'%>" type="image/x-icon" /> <link rel="icon" href="<%= context.config.publicPath +'favicon.ico'%>" type="image/x-icon" />
</head> </head>
<body>
<body>
<noscript> <noscript>
<div class="noscript-container"> <div class="noscript-container">
Hi there! Please Hi there! Please
...@@ -46,10 +37,12 @@ ...@@ -46,10 +37,12 @@
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#root { #root {
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% auto; background-size: 100% auto;
} }
.noscript-container { .noscript-container {
display: flex; display: flex;
align-content: center; align-content: center;
...@@ -59,16 +52,19 @@ ...@@ -59,16 +52,19 @@
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode',
Geneva, Verdana, sans-serif; Geneva, Verdana, sans-serif;
} }
.noscript-enableJS { .noscript-enableJS {
padding-right: 3px; padding-right: 3px;
padding-left: 3px; padding-left: 3px;
} }
.page-loading-warp { .page-loading-warp {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 98px; padding: 98px;
} }
.ant-spin { .ant-spin {
position: absolute; position: absolute;
display: none; display: none;
...@@ -170,7 +166,8 @@ ...@@ -170,7 +166,8 @@
height: 14px; height: 14px;
} }
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { @media all and (-ms-high-contrast: none),
(-ms-high-contrast: active) {
.ant-spin-blur { .ant-spin-blur {
background: #fff; background: #fff;
opacity: 0.5; opacity: 0.5;
...@@ -203,34 +200,28 @@ ...@@ -203,34 +200,28 @@
} }
} }
</style> </style>
<div <div style="
style="
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 100%; height: 100%;
min-height: 420px; min-height: 420px;
" ">
>
<img src="<%= context.config.publicPath +'pro_icon.svg'%>" alt="logo" width="256" /> <img src="<%= context.config.publicPath +'pro_icon.svg'%>" alt="logo" width="256" />
<div class="page-loading-warp"> <div class="page-loading-warp">
<div class="ant-spin ant-spin-lg ant-spin-spinning"> <div class="ant-spin ant-spin-lg ant-spin-spinning">
<span class="ant-spin-dot ant-spin-dot-spin" <span class="ant-spin-dot ant-spin-dot-spin"><i class="ant-spin-dot-item"></i><i
><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i></span>
><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i
></span>
</div> </div>
</div> </div>
<div style="display: flex; align-items: center; justify-content: center"> <div style="display: flex; align-items: center; justify-content: center">
<img <img src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" width="32"
src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" style="margin-right: 8px" />
width="32"
style="margin-right: 8px"
/>
Ant Design Ant Design
</div> </div>
</div> </div>
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -10,34 +10,7 @@ import { ProDescriptions } from '@ant-design/pro-components'; ...@@ -10,34 +10,7 @@ import { ProDescriptions } from '@ant-design/pro-components';
import JsBarcode from 'jsbarcode' import JsBarcode from 'jsbarcode'
import { useReactToPrint } from 'react-to-print'; import { useReactToPrint } from 'react-to-print';
import PrintProvider, { Print, NoPrint } from 'react-easy-print'; import PrintProvider, { Print, NoPrint } from 'react-easy-print';
const pageStyle = `
@media all {
.page-break {
display: none;
}
}
@media print {
html, body {
height: initial !important;
overflow: initial !important;
-webkit-print-color-adjust: exact;
}
}
@media print {
.page-break {
margin-top: 2rem;
display: block;
page-break-before: auto;
}
}
@page {
size: auto;
margin: 20mm;
}
`;
const initState = { const initState = {
vs: false, vs: false,
...@@ -203,7 +176,11 @@ const StoreApp = (props) => { ...@@ -203,7 +176,11 @@ const StoreApp = (props) => {
await dispatch({ type: "only" }); await dispatch({ type: "only" });
setTimeout(async () => { setTimeout(async () => {
await Promise.all(selectedRowKeys.map(async (it) => { await Promise.all(selectedRowKeys.map(async (it) => {
await JsBarcode("#s" + it.id, it.id); await JsBarcode("#s" + it.id, it.id, {
lineColor: "green",
width: 2,
height: 100,
});
})) }))
}, 600) }, 600)
...@@ -272,9 +249,6 @@ const StoreApp = (props) => { ...@@ -272,9 +249,6 @@ const StoreApp = (props) => {
extraparams={{ storeId: props?.curitem?.id ?? "0" }} extraparams={{ storeId: props?.curitem?.id ?? "0" }}
rowSelection={{ rowSelection={{
onChange: (selectedRowKeys, selectedRows) => { onChange: (selectedRowKeys, selectedRows) => {
console.log('====================================');
console.log(selectedRows);
console.log('====================================');
setselectedRowKeys(selectedRows) setselectedRowKeys(selectedRows)
}, },
...@@ -306,9 +280,6 @@ const StoreApp = (props) => { ...@@ -306,9 +280,6 @@ const StoreApp = (props) => {
{ {
selectedRowKeys.map(it => { selectedRowKeys.map(it => {
return <div> return <div>
<style type="text/css" media="print">
{pageStyle}
</style>
<NoPrint> <NoPrint>
<span>{it.storePositionName}</span> <span>{it.storePositionName}</span>
</NoPrint> </NoPrint>
......
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