Browse Source

二维码管理-图片错误替换

master
liujiangyong 2 years ago
parent
commit
3fe0850662
  1. BIN
      web/client/assets/images/no_qcoder.png
  2. 8
      web/client/src/sections/projectRegime/containers/qrCode.js

BIN
web/client/assets/images/no_qcoder.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

8
web/client/src/sections/projectRegime/containers/qrCode.js

@ -26,6 +26,12 @@ const QrCode = (props) => {
}
})
}
const imgError = (e) => {
const img = e.currentTarget;
img.src = '/assets/images/no_qcoder.png';
img.onerror = null;
}
return (
<>
@ -68,7 +74,7 @@ const QrCode = (props) => {
<span>结构物名称{firmList?.filter(u => u.value == v.projectId)[0]?.label}</span>
<span>点位名称{v.name}</span>
</div>
<img src={`/_file-server/${v.qrCode}`} style={{ display: 'inline-block', width: 260 }} />
<img src={`/_file-server/${v.qrCode}`} style={{ display: 'inline-block', width: 260 }} onError={imgError} />
<div style={{
width: 260, height: 60, background: '#e1d4d42e', display: 'flex',
justifyContent: 'center', alignItems: 'center', borderTop: '1px solid #3c383824'

Loading…
Cancel
Save