From 49f09cc6f8ff8c30a75ed1a9d6f510b69b73962a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 12 十二月 2023 21:05:37 +0800 Subject: [PATCH] 2023-12-12 --- src/menu/components/card/cardcellcomponent/dragaction/card.jsx | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx index 8069bcf..4cbb8a3 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx @@ -1,7 +1,7 @@ import React from 'react' import { useDrag, useDrop } from 'react-dnd' import { Popover } from 'antd' -import { EditOutlined, CopyOutlined, CloseOutlined, FontColorsOutlined } from '@ant-design/icons' +import { EditOutlined, CopyOutlined, CloseOutlined, FontColorsOutlined, CaretUpOutlined, CaretDownOutlined } from '@ant-design/icons' import MkIcon from '@/components/mk-icon' import moment from 'moment' @@ -85,10 +85,16 @@ let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} val = <><span style={_s}>{card.prefix || ''}</span>{`${card.datatype === 'static' ? (card.value || '') : (card.field || '')}`}<span style={_s}>{card.postfix || ''}</span></> } + if (card.sortField) { + val = <><span>{val}</span><span className="sort-wrap"><CaretUpOutlined /><CaretDownOutlined /></span></> + } return ( <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div> ) } else if (card.eleType === 'icon') { + if (card.tipType === 'text') { + return <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{card.value || card.field || ''}</div> + } return (<MkIcon style={{height: card.innerHeight || 'auto'}} className="ant-mk-icon" type={card.icon || 'bell'}/>) } else if (card.eleType === 'slider') { let val = card.value ? (card.value / card.maxValue) * 100 : 30 @@ -209,6 +215,15 @@ if (card.style && card.style.clear === 'left') { _style_ = {clear: 'left'} + } else if (card.style && card.style.clear === 'right') { + _style_ = {float: 'right'} + } + + let mark = ['text', 'number', 'slider', 'sequence', 'formula'].includes(card.eleType) + if (parent.setting && parent.setting.cardRole === 'header') { + mark = false + } else if (card.eleType === 'formula' && card.eval === 'func') { + mark = false } return ( @@ -218,7 +233,7 @@ <CopyOutlined className="copy" title="澶嶅埗" onClick={() => copyCard(id)} /> <CloseOutlined className="close" title="鍒犻櫎" onClick={() => delCard(id)} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={() => changeStyle(id)}/> - {['text', 'number', 'slider', 'sequence', 'formula'].includes(card.eleType) ? <MarkColumn field={card.field || ''} columns={fields} type={card.eleType} marks={card.marks} onSubmit={(vals) => updateMarks({...card, marks: vals})} /> : null } + {mark ? <MarkColumn field={card.field || ''} columns={fields} type={card.eleType} marks={card.marks} onSubmit={(vals) => updateMarks({...card, marks: vals})} /> : null } </div> } trigger="hover"> <div ref={node => drag(drop(node))} style={_style_} className={'ant-col card-cell ant-col-' + card.width}> -- Gitblit v1.8.0