import React, {Component} from 'react'
|
import { is, fromJS } from 'immutable'
|
import { Button, Card, Spin, Icon, Row, Col } from 'antd'
|
|
import Api from '@/api'
|
// import Utils from '@/utils/utils.js'
|
import './index.scss'
|
|
class CardChart extends Component {
|
state = {
|
loading: false,
|
data: []
|
}
|
|
shouldComponentUpdate (nextProps, nextState) {
|
return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
|
}
|
|
UNSAFE_componentWillMount() {
|
this.getMobCards()
|
}
|
|
getMobCards = () => {
|
let param = {
|
func: 's_get_kei'
|
}
|
|
// _param.LText = Utils.formatOptions(_param.LText) // 关键字符替换,base64加密
|
// _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' // 时间戳
|
// _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) // md5密钥
|
|
Api.getCloudConfig(param).then(res => {
|
|
})
|
}
|
|
render() {
|
const { data, loading } = this.state
|
|
return (
|
<div className="mob-card-row-box">
|
{loading ?
|
<div className="loading-mask">
|
<div className="ant-spin-blur"></div>
|
<Spin />
|
</div> : null
|
}
|
<Row gutter={24}>
|
{data && data.length > 0 &&
|
data.map((item, i) => (
|
<Col key={i} span={6}>
|
<Card
|
size="small"
|
className="chart-card"
|
actions={[
|
<Button />,
|
]}
|
>
|
<div className="ant-card-meta-detail">
|
|
</div>
|
</Card>
|
</Col>
|
))
|
}
|
|
<Col span={6} key="insert">
|
<div className="chart-card insert" onClick={() => {}}>
|
<Icon type="plus" />
|
</div>
|
</Col>
|
</Row>
|
</div>
|
)
|
}
|
}
|
|
export default CardChart
|