From e0aff8f4c0e9c8f16d1ba07863cf600638067514 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 13 四月 2021 15:08:47 +0800 Subject: [PATCH] 2021-04-13 --- src/tabviews/custom/components/card/cardcellList/index.jsx | 22 ++++++++++++++++------ 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index 525c471..def201a 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -21,6 +21,11 @@ const BarCode = asyncElementComponent(() => import('@/components/barcode')) const QrCode = asyncElementComponent(() => import('@/components/qrcode')) const Video = asyncComponent(() => import('@/components/video')) +const PicRadio = { + '4:3': '75%', '3:2': '66.67%', '16:9': '56.25%', '2:1': '50%', '3:1': '33.33%', '4:1': '25%', + '5:1': '20%', '6:1': '16.67%', '7:1': '14.29%', '8:1': '12.5%', '9:1': '11.11%', + '10:1': '10%', '3:4': '133.33%', '2:3': '150%', '9:16': '177.78%' +} class CardCellComponent extends Component { static propTpyes = { @@ -443,12 +448,8 @@ _imagestyle.borderRadius = _style.borderRadius } - if (card.lenWidRadio === '16:9') { - _imagestyle.paddingTop = '56.25%' - } else if (card.lenWidRadio === '3:2') { - _imagestyle.paddingTop = '66.67%' - } else if (card.lenWidRadio === '4:3') { - _imagestyle.paddingTop = '75%' + if (PicRadio[card.lenWidRadio]) { + _imagestyle.paddingTop = PicRadio[card.lenWidRadio] } else { _imagestyle.paddingTop = '100%' } @@ -534,6 +535,13 @@ </Col> ) } else if (card.eleType === 'button') { + if (card.$type === 'tableButton' && card.controlField) { // 琛ㄦ牸涓寜閽殣钘忔帶鍒� + if (data[card.controlField] === card.controlVal) { + return null + } else if (card.controlVal && card.controlVal.split(',').includes(data[card.controlField])) { + return null + } + } if (['exec', 'prompt', 'pop'].includes(card.OpenType)) { return ( <Col key={card.uuid} span={card.width}> @@ -656,6 +664,8 @@ } } } + + return null } render() { -- Gitblit v1.8.0