|
|
@ -6,7 +6,7 @@ import moment from "moment"; |
|
|
|
import '../style.less'; |
|
|
|
import { push } from 'react-router-redux'; |
|
|
|
import PointModel from '../components/pointModel' |
|
|
|
import { Model } from 'echarts'; |
|
|
|
import { Model } from 'qrcode'; |
|
|
|
|
|
|
|
|
|
|
|
const Information = (props) => { |
|
|
@ -27,11 +27,12 @@ const Information = (props) => { |
|
|
|
const [form] = Form.useForm(); |
|
|
|
|
|
|
|
var QRCode = require('qrcode') |
|
|
|
const { createCanvas, loadImage, registerFont } = require('canvas') |
|
|
|
|
|
|
|
|
|
|
|
const qrCodeId = props?.match?.params?.id |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
console.log(props?.match?.params?.id); |
|
|
|
projectList(query) |
|
|
|
}, []) |
|
|
|
|
|
|
@ -71,8 +72,58 @@ const Information = (props) => { |
|
|
|
return url |
|
|
|
} |
|
|
|
|
|
|
|
// const createQrCode = (name) => {
|
|
|
|
// const CW = 400, FONTSIZE = 30, FR = 2, CH = CW + FONTSIZE * FR;
|
|
|
|
// let url = ''
|
|
|
|
// // QRCode.toFile('F',name,
|
|
|
|
// // {
|
|
|
|
// // margin: 1,//二维码内边距,默认为4。单位px
|
|
|
|
// // height: CW,//二维码高度
|
|
|
|
// // width: CW,//二维码宽度
|
|
|
|
// // color: {
|
|
|
|
// // dark: '#000', //
|
|
|
|
// // light: '#fff' //
|
|
|
|
// // }
|
|
|
|
// // });
|
|
|
|
|
|
|
|
// QRCode.toDataURL(name, {
|
|
|
|
// errorCorrectionLevel: 'low',
|
|
|
|
// type: 'image/png',
|
|
|
|
// quality: 0.3,
|
|
|
|
// margin: 2,
|
|
|
|
// maskPattern: 9,
|
|
|
|
// width: 400,
|
|
|
|
// color: {
|
|
|
|
// dark: "#000000ff",
|
|
|
|
// light: "#ffffffff"
|
|
|
|
// }
|
|
|
|
// }, function (err, v) {
|
|
|
|
// url = v
|
|
|
|
// })
|
|
|
|
// // return url
|
|
|
|
|
|
|
|
// const canvas = createCanvas(CW, CH)
|
|
|
|
// const ctx = canvas.getContext('2d')
|
|
|
|
// ctx.clearRect(0, 0, CW, CH)
|
|
|
|
// ctx.fillStyle = 'rgba(255,255,255,1)'
|
|
|
|
// ctx.fillRect(0, 0, CW, CH)
|
|
|
|
// ctx.fillStyle = 'rgba(0,0,0,1)'
|
|
|
|
// ctx.font = `${FONTSIZE}px ZiTiQuanWeiJunHei`
|
|
|
|
// // ctx.font = `700 ${FONTSIZE}px `
|
|
|
|
// let image = loadImage(url)
|
|
|
|
// ctx.drawImage(image, 0, 0, CW, CW)
|
|
|
|
// const text = ctx.measureText(name)
|
|
|
|
// ctx.fillText(name, (CW - text.width) * 0.5, CH - FONTSIZE)
|
|
|
|
// canvas.toDataURL('image/png', (err, png) => {
|
|
|
|
// if (!err) {
|
|
|
|
// console.log(png);
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// return url
|
|
|
|
// }
|
|
|
|
|
|
|
|
const columns = [ |
|
|
|
|
|
|
|
const columns = [ |
|
|
|
{ |
|
|
|
title: '序号', |
|
|
|
dataIndex: 'index', |
|
|
@ -109,7 +160,7 @@ const Information = (props) => { |
|
|
|
|
|
|
|
>编辑</Button> |
|
|
|
<Popconfirm |
|
|
|
title='确认删除工程信息?' |
|
|
|
title={<div style={{ width: 184 }}>删除该点位后,与巡检计划关联的点位删除,对应的巡检记录删除,是否确认删除?</div>} |
|
|
|
position='topLeft' |
|
|
|
onConfirm={() => { |
|
|
|
dispatch(projectRegime.delPosition(record.id)).then(res => { |
|
|
@ -140,9 +191,9 @@ const Information = (props) => { |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<img src={selec} /> |
|
|
|
|
|
|
@ -205,7 +256,7 @@ const Information = (props) => { |
|
|
|
/> : "" |
|
|
|
} |
|
|
|
</> |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
function mapStateToProps (state) { |
|
|
|