import React, { useEffect, useState } from 'react'; import { connect } from 'react-redux'; import { Spin, Card, Form, Input, Select, Button, Table, Modal, Popconfirm, Tooltip } from 'antd'; import moment from "moment"; import '../style.less'; import { push } from 'react-router-redux'; import ProjectAddModel from '../components/projectAddModel' import { Model } from 'echarts'; const Information = (props) => { const { dispatch, actions, user, loading } = props const { projectRegime } = actions const [firmList, setFirmList] = useState([]) const [tableList, settableList] = useState([]) const [addModel, setAddModel] = useState(false) const [modelData, setModelData] = useState({}) const [query, setQuery] = useState({ limit: 10, page: 0 }) const [limits, setLimits] = useState() const [search, setSearch] = useState({}) const [isPicture, setIsPicture] = useState(false) const [pictureUrl, setPictureUrl] = useState() const [companyID, setCompanyId] = useState('') const [select, setSelect] = useState([]) const [selec, setSelec] = useState() var QRCode = require('qrcode') useEffect(() => { projectList(query) }, []) const projectList = (obj) => { const { limit, page, name } = obj dispatch(projectRegime.getProjectList({ limit, page, name, })).then(res => { // console.log(res) if (res.success) { settableList(res.payload.data?.rows?.map(v => ({ ...v, key: v.id }))) setLimits(res.payload.data?.count) } }) } const createQrCode = (name) => { let url = '' 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 columns = [ { title: '序号', dataIndex: 'index', key: 'index', render: (text, record, index) => index + 1 }, { title: '结构物名称', dataIndex: 'name', key: 'name', }, { title: '所在地区', dataIndex: 'type', key: 'type', render: (text, record, index) => { return record.longitude && record.latitude ?