提交 7bd91132 authored 作者: 钟是志's avatar 钟是志

卡片组件修改

上级 67ebac4b
...@@ -25,7 +25,6 @@ export default function MobileCard(props) { ...@@ -25,7 +25,6 @@ export default function MobileCard(props) {
} }
const dataSource = value?.dataSource || otherProps?.defaultDataSource || []; const dataSource = value?.dataSource || otherProps?.defaultDataSource || [];
const { columns = [], primaryKey = '', style = {}, handleClick, emptyDataInfo } = otherProps; const { columns = [], primaryKey = '', style = {}, handleClick, emptyDataInfo } = otherProps;
console.log(dataSource);
return ( return (
<> <>
{dataSource.map((g, index) => { {dataSource.map((g, index) => {
...@@ -44,7 +43,7 @@ export default function MobileCard(props) { ...@@ -44,7 +43,7 @@ export default function MobileCard(props) {
<WingBlank> <WingBlank>
{columns.map((c, cIndex) => { {columns.map((c, cIndex) => {
const { style: cStyle, data: cData } = c; const { style: cStyle, data: cData } = c;
const clickFunction = // 点击某一行 const clickOneRow = // 点击某一行
typeof c.handleClick === 'function' typeof c.handleClick === 'function'
? e => { ? e => {
if (e && e.stopPropagation) { if (e && e.stopPropagation) {
...@@ -55,24 +54,24 @@ export default function MobileCard(props) { ...@@ -55,24 +54,24 @@ export default function MobileCard(props) {
} }
: undefined; : undefined;
return ( return (
<div key={c.key} style={cStyle || {}} onClick={clickFunction}> <div key={c.key} style={cStyle || {}} onClick={clickOneRow}>
{cData.map((h, hIndex) => { {cData.map((h, hIndex) => {
let hProps = h.props || {}; let hProps = h.props || {};
const clickFunction = // 点击某一个单元格 const clickOneCell = // 点击某一个单元格
typeof hProps.handleClick === 'function' typeof h.handleClick === 'function'
? e => { ? e => {
if (e && e.stopPropagation) { if (e && e.stopPropagation) {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
} }
return hProps.handleClick(g, h.key || h, value); return h.handleClick(g, h.key || h, value);
} }
: undefined; : undefined;
if (h.diyProps && typeof h.diyProps === 'function') { if (h.diyProps && typeof h.diyProps === 'function') {
hProps = h.diyProps(g, h.key || h, value) || {}; hProps = h.diyProps(g, h.key || h, value) || {};
} }
return ( return (
<div style={hProps.style} onClick={clickFunction} key={hIndex}> <div style={hProps.style} onClick={clickOneCell} key={h.key}>
{hProps.children ? ( {hProps.children ? (
<>{hProps.children}</> <>{hProps.children}</>
) : ( ) : (
......
...@@ -2980,7 +2980,6 @@ ${obj[dataColumn.base52]} ...@@ -2980,7 +2980,6 @@ ${obj[dataColumn.base52]}
const tabsProps = configOption.tabsProps || {}; const tabsProps = configOption.tabsProps || {};
const tabPaneProps = configOption.tabPaneProps || {}; const tabPaneProps = configOption.tabPaneProps || {};
let activeKey = this.state.activeKey || configOption.data[0].key; let activeKey = this.state.activeKey || configOption.data[0].key;
console.log(configOption);
cm = ( cm = (
<Tabs onChange={this.changeTabsActiveKey} activeKey={activeKey} {...tabsProps}> <Tabs onChange={this.changeTabsActiveKey} activeKey={activeKey} {...tabsProps}>
{configOption.data.map(r => { {configOption.data.map(r => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论