import React, { useState, useRef, useEffect } from 'react';
import { connect } from 'react-redux';
import { Button, Empty, Space, Spin, Tag, Descriptions } from 'antd';
import '../style.less';
import { ProTable } from '@ant-design/pro-table';
import { render } from 'react-dom';
import { Link } from 'react-router-dom';
const ProtocolInfo = (props) => {
const { dispatch, actions, productId, product, products, loading } = props
const { meta } = actions;
useEffect(() => {
if (!!productId) {
dispatch(meta.getProduct(productId))
}
}, []);
const columns = [{
title: '能力',
dataIndex: 'cmname'
}, {
title: '描述',
dataIndex: 'cmdesc'
}, {
title: '接口',
dataIndex: 'iname'
}, {
title: '协议名',
dataIndex: 'pmdesc'
}, {
title: '协议',
dataIndex: 'pmname',
render: (_, item) => {
return {item.pmname};
},
},
]
const actionRef = useRef();
return (
{product?.Id}
{product?.Name}
{product?.Model}
{product?.Desc}
{product?.UpdatedAt}
{product?.CreatedAt}
{product?.Company}
{product?.Username}
{product?.FilterResource}
能力集合
)
}
function mapStateToProps(state) {
const { auth, global, product } = state;
console.log(product)
let raw = product
let p = {}
if (product && product.data && (product.data.data ?? []).length > 0) {
p = product.data.data[0];
}
console.log(raw.data?.data ?? [])
return {
user: auth.user,
actions: global.actions,
loading: product.isRequesting,
product: p,
products: raw.data?.data ?? [],
};
}
export default connect(mapStateToProps)(ProtocolInfo);