| | |
| | | <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> |
| | | ) |
| | | } else if (card.eleType === 'icon') { |
| | | return (<MkIcon type={card.icon}/>) |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (card.style.fontSize) { |
| | | fontSize = parseInt(card.style.fontSize) |
| | | } |
| | | if (card.style.lineHeight) { |
| | | lineHeight = parseFloat(card.style.lineHeight) |
| | | } |
| | | |
| | | let innerHeight = fontSize * lineHeight |
| | | return (<MkIcon style={{height: innerHeight}} className="ant-mk-icon" type={card.icon}/>) |
| | | } else if (card.eleType === 'slider') { |
| | | let val = card.value ? (card.value / card.maxValue) * 100 : 30 |
| | | return <MkProgress value={val} config={card}/> |
| | |
| | | .card-detail-row { |
| | | line-height: 1.5; |
| | | .ant-mk-text { |
| | | font-style: inherit; |
| | | font-weight: inherit; |
| | |
| | | background-position: center center; |
| | | background-repeat: no-repeat; |
| | | } |
| | | .ant-mk-icon { |
| | | vertical-align: top; |
| | | line-height: inherit; |
| | | } |
| | | .ant-switch-large { |
| | | min-width: 60px; |
| | | height: 30px; |
| | |
| | | }) |
| | | } |
| | | }) |
| | | return getTableSetting(card.setting, cards.columns, buttons) |
| | | return getTableSetting(card.setting, cards.columns, buttons, cards.action) |
| | | } else { |
| | | return getCarouselSetting(card.setting, cards.subtype === 'propcard') |
| | | } |
| | |
| | | /** |
| | | * @description tablecard setting表单配置信息 |
| | | */ |
| | | export function getTableSetting (setting, columns, buttons = []) { |
| | | export function getTableSetting (setting, columns, buttons = [], action = []) { |
| | | let _columns = columns.map(item => ({value: item.field, label: item.label})) |
| | | _columns.push({value: '$Index', label: '序号(前端)'}) |
| | | let appType = sessionStorage.getItem('appType') |
| | |
| | | initval: setting.linkbtn || '', |
| | | required: true, |
| | | options: buttons |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'swipe', |
| | | label: '滑动按钮', |
| | | initval: setting.swipe || 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '显示'}, |
| | | {value: 'false', label: '不显示'}, |
| | | ], |
| | | forbid: action.length === 0 || appType !== 'mob' |
| | | } |
| | | ] |
| | | |
| | |
| | | {value: 'false', label: '无'}, |
| | | {value: 'init', label: '初始化'}, |
| | | {value: 'always', label: '数据加载'}, |
| | | ] |
| | | ], |
| | | forbid: subtype === 'tablecard' |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | {value: 'backFont', label: '背景+文字'}, |
| | | {value: 'font', label: '文字'}, |
| | | ...(subtype === 'datacard' && appType === 'mob' ? [{value: 'check', label: '勾选'}] : []) |
| | | ] |
| | | // forbid: subtype !== 'propcard' |
| | | ], |
| | | forbid: subtype === 'tablecard' |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | |
| | | initval: wrap.slidetip || wrap.slidetip === '' ? wrap.slidetip : '没有更多了', |
| | | tooltip: '滑动加载至底部时的提示信息。', |
| | | required: false, |
| | | forbid: appType !== 'mob' |
| | | forbid: appType !== 'mob' || subtype === 'propcard' |
| | | }, |
| | | { |
| | | type: 'table', |
| | |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={card.style}> |
| | | {val ? <Tooltip title={val}> |
| | | <MkIcon type={card.icon}/> |
| | | </Tooltip> : <MkIcon type={card.icon}/>} |
| | | <MkIcon className="ant-mk-icon" style={{height: card.innerHeight || 'auto'}} type={card.icon}/> |
| | | </Tooltip> : <MkIcon className="ant-mk-icon" style={{height: card.innerHeight || 'auto'}} type={card.icon}/>} |
| | | </div> |
| | | </Col> |
| | | ) |
| | |
| | | |
| | | .card-cell-list { |
| | | position: relative; |
| | | line-height: 1.5; |
| | | |
| | | .ant-btn { |
| | | padding: 0; |
| | | } |
| | |
| | | .ant-mk-picture.scale { |
| | | cursor: zoom-in; |
| | | } |
| | | .ant-mk-icon { |
| | | vertical-align: top; |
| | | line-height: inherit; |
| | | } |
| | | .ant-switch-large { |
| | | min-width: 60px; |
| | | height: 30px; |
| | |
| | | col.elements = col.elements.map(cell => { |
| | | if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height) { |
| | | cell.innerHeight = 'auto' |
| | | } else if (cell.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (cell.style.fontSize) { |
| | | fontSize = parseInt(cell.style.fontSize) |
| | | } |
| | | if (cell.style.lineHeight) { |
| | | lineHeight = parseFloat(cell.style.lineHeight) |
| | | } |
| | | |
| | | cell.innerHeight = fontSize * lineHeight |
| | | } |
| | | return cell |
| | | }) |
| | |
| | | } |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { |
| | | cell.innerHeight = 'auto' |
| | | } else if (cell.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (cell.style.fontSize) { |
| | | fontSize = parseInt(cell.style.fontSize) |
| | | } |
| | | if (cell.style.lineHeight) { |
| | | lineHeight = parseFloat(cell.style.lineHeight) |
| | | } |
| | | |
| | | cell.innerHeight = fontSize * lineHeight |
| | | } |
| | | |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | |
| | | } |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { |
| | | cell.innerHeight = 'auto' |
| | | } else if (cell.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (cell.style.fontSize) { |
| | | fontSize = parseInt(cell.style.fontSize) |
| | | } |
| | | if (cell.style.lineHeight) { |
| | | lineHeight = parseFloat(cell.style.lineHeight) |
| | | } |
| | | |
| | | cell.innerHeight = fontSize * lineHeight |
| | | } |
| | | |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | }) |
| | | }) |
| | |
| | | } |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height) { |
| | | cell.innerHeight = 'auto' |
| | | } else if (cell.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (cell.style.fontSize) { |
| | | fontSize = parseInt(cell.style.fontSize) |
| | | } |
| | | if (cell.style.lineHeight) { |
| | | lineHeight = parseFloat(cell.style.lineHeight) |
| | | } |
| | | |
| | | cell.innerHeight = fontSize * lineHeight |
| | | } |
| | | |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | |
| | | } |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { |
| | | cell.innerHeight = 'auto' |
| | | } else if (cell.eleType === 'icon') { |
| | | let fontSize = 14 |
| | | let lineHeight = 1.5 |
| | | |
| | | if (cell.style.fontSize) { |
| | | fontSize = parseInt(cell.style.fontSize) |
| | | } |
| | | if (cell.style.lineHeight) { |
| | | lineHeight = parseFloat(cell.style.lineHeight) |
| | | } |
| | | |
| | | cell.innerHeight = fontSize * lineHeight |
| | | } |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | }) |