From 1a08525fe39ea67325725c75dcf0397b9fdb710f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 03 六月 2021 16:57:13 +0800 Subject: [PATCH] 2021-06-03 --- src/tabviews/custom/components/card/table-card/index.jsx | 8 +- src/tabviews/custom/components/card/cardcellList/index.jsx | 9 ++ src/menu/components/card/cardcellcomponent/index.jsx | 11 +++ src/menu/components/share/markcomponent/index.jsx | 9 ++- src/mob/components/navbar/normal-navbar/menusetting/menuform/index.jsx | 12 +--- src/tabviews/custom/components/table/normal-table/index.jsx | 6 +- src/components/mkIcon/index.jsx | 11 ++- src/components/mkIcon/index.scss | 22 +++++++ src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 4 src/menu/components/card/cardcellcomponent/dragaction/card.jsx | 2 src/tabviews/subtable/index.jsx | 2 src/tabviews/custom/components/card/cardcellList/index.scss | 9 +++ src/tabviews/subtabtable/index.jsx | 2 src/tabviews/commontable/index.jsx | 2 src/tabviews/custom/components/card/data-card/index.jsx | 32 +++++++++- 15 files changed, 105 insertions(+), 36 deletions(-) diff --git a/src/components/mkIcon/index.jsx b/src/components/mkIcon/index.jsx index ba860be..8d7d560 100644 --- a/src/components/mkIcon/index.jsx +++ b/src/components/mkIcon/index.jsx @@ -13,6 +13,7 @@ state = { selectIcon: '', + allowClear: false, icons: [...minkeIconSystem.normal, ...minkeIconSystem.trademark, ...minkeIconSystem.data, ...minkeIconSystem.edit, ...minkeIconSystem.hint, ...minkeIconSystem.direction], visible: false } @@ -22,7 +23,8 @@ if (this.props['data-__meta']) { val = this.props['data-__meta'].initialValue || '' } - this.setState({selectIcon: val}) + + this.setState({selectIcon: val, allowClear: this.props.allowClear === true}) } shouldComponentUpdate (nextProps, nextState) { @@ -35,12 +37,13 @@ } render() { - const { selectIcon, visible, icons } = this.state + const { selectIcon, visible, icons, allowClear } = this.state return ( <div className="mk-icon-box"> - {selectIcon ? <Icon type={selectIcon}/> : null} - <Icon onClick={() => this.setState({visible: true})} type="appstore"/> + {selectIcon ? <Icon type={selectIcon}/> : <Icon style={{opacity: 0}} type="plus"/>} + <Icon className="trigger" onClick={() => this.setState({visible: true})} type="swap"/> + {allowClear ? <Icon className="close" onClick={() => this.checkIcon('')} type="close"/> : null} <Modal wrapClassName="popview-modal mk-icon-wrap" title={'鍥炬爣閫夋嫨'} diff --git a/src/components/mkIcon/index.scss b/src/components/mkIcon/index.scss index 1d15d8a..483ffdf 100644 --- a/src/components/mkIcon/index.scss +++ b/src/components/mkIcon/index.scss @@ -6,15 +6,35 @@ line-height: 32px; padding: 0px 0px 0px 10px; - .anticon:last-child { + .anticon.trigger { float: right; line-height: 32px; padding: 0 10px; border-left: 1px solid #d9d9d9; } + .close.anticon { + float: right; + margin-top: 6px; + margin-right: 5px; + background: #efefef; + border-radius: 50%; + color: #757575; + padding: 2px; + font-size: 13px; + opacity: 0; + transition: opacity 0.3s; + } } .mk-icon-box:hover { border-color: #1890ff; + .close.anticon { + opacity: 1; + } +} +.mk-icon-box::after { + content: ' '; + display: block; + clear: both; } .mk-icon-wrap { .ant-col { diff --git a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx index e538125..9ee5976 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx @@ -158,7 +158,7 @@ <Icon className="copy" title="澶嶅埗" type="copy" onClick={() => copyCard(id)} /> <Icon className="close" title="鍒犻櫎" type="close" onClick={() => delCard(id)} /> <Icon className="style" title="璋冩暣鏍峰紡" onClick={() => changeStyle(id)} type="font-colors" /> - {['text', 'number', 'slider'].includes(card.eleType) ? <MarkColumn columns={fields} type={card.eleType} marks={card.marks} onSubmit={(vals) => updateMarks({...card, marks: vals})} /> : null } + {['text', 'number', 'slider', 'sequence'].includes(card.eleType) ? <MarkColumn columns={fields} type={card.eleType} marks={card.marks} onSubmit={(vals) => updateMarks({...card, marks: vals})} /> : null } </div> } trigger="hover"> <div ref={node => drag(drop(node))} className={'ant-col card-cell ant-col-' + card.width}> diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index f45ca80..ea7caee 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -194,6 +194,17 @@ if (line) { _card.innerHeight = fontSize * lineHeight * line } + } else if (_card.eleType === 'sequence') { + _card.style = style + + let fontSize = 14 + let lineHeight = 1.5 + + if (_card.style.fontSize) { + fontSize = parseInt(_card.style.fontSize) + } + + _card.innerHeight = fontSize * lineHeight } else if (_card.eleType === 'barcode') { _card.style = style diff --git a/src/menu/components/share/markcomponent/index.jsx b/src/menu/components/share/markcomponent/index.jsx index 3608c2e..4518ab6 100644 --- a/src/menu/components/share/markcomponent/index.jsx +++ b/src/menu/components/share/markcomponent/index.jsx @@ -129,8 +129,11 @@ resetMark = () => { const { marks, columns, type } = this.props let markColumns = fromJS(this.state.markColumns).toJS() + let _columns = fromJS(columns).toJS() - let options = columns.map(col => { + _columns.unshift({field: '$Index', label: '搴忓彿'}) + + let options = _columns.map(col => { return { value: col.field, label: col.label, @@ -143,7 +146,7 @@ { value: 'dynamic', label: '鍔ㄦ�佸��', - children: columns.map(cell => { + children: _columns.map(cell => { return { value: cell.field, label: cell.label @@ -251,7 +254,7 @@ } ] - if (type === 'line') { + if (type === 'line' || type === 'sequence') { signs.pop() } else if (type === 'slider') { markColumns = markColumns.filter(col => { diff --git a/src/mob/components/navbar/normal-navbar/menusetting/menuform/index.jsx b/src/mob/components/navbar/normal-navbar/menusetting/menuform/index.jsx index c296151..ed60f8b 100644 --- a/src/mob/components/navbar/normal-navbar/menusetting/menuform/index.jsx +++ b/src/mob/components/navbar/normal-navbar/menusetting/menuform/index.jsx @@ -2,10 +2,11 @@ import PropTypes from 'prop-types' import { Form, Row, Col, Input, Radio, Tooltip, Icon, Select } from 'antd' -import { minkeIconSystem } from '@/utils/option.js' +import asyncComponent from '@/utils/asyncComponent' import './index.scss' const { TextArea } = Input +const MkIcon = asyncComponent(() => import('@/components/mkIcon')) class SettingForm extends Component { static propTpyes = { @@ -120,14 +121,7 @@ {getFieldDecorator('icon', { initialValue: menu.icon || '' })( - <Select showSearch allowClear> - {minkeIconSystem.normal.map(icon => <Select.Option key={icon} value={icon}><Icon type={icon} /></Select.Option>)} - {minkeIconSystem.trademark.map(icon => <Select.Option key={icon} value={icon}><Icon type={icon} /></Select.Option>)} - {minkeIconSystem.data.map(icon => <Select.Option key={icon} value={icon}><Icon type={icon} /></Select.Option>)} - {minkeIconSystem.edit.map(icon => <Select.Option key={icon} value={icon}><Icon type={icon} /></Select.Option>)} - {minkeIconSystem.hint.map(icon => <Select.Option key={icon} value={icon}><Icon type={icon} /></Select.Option>)} - {minkeIconSystem.direction.map(icon => <Select.Option key={icon} value={icon}><Icon type={icon} /></Select.Option>)} - </Select> + <MkIcon allowClear /> )} </Form.Item> </Col> diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 481b3e5..34aa1e7 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -698,7 +698,7 @@ item.key = index item.$$uuid = item[setting.primaryKey] || '' item.$$BID = BID || '' - item.$Index = start + index + item.$Index = start + index + '' return item }), diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index a316272..2f26876 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -267,10 +267,17 @@ const { data, cards } = this.props if (card.eleType === 'sequence') { + let _style = {} + if (card.marks) { + _style.width = card.innerHeight + _style.height = card.innerHeight + _style.lineHeight = card.innerHeight + 'px' + this.getMark(card.marks, _style) + } return ( <Col key={card.uuid} span={card.width}> <div style={card.style}> - <div className={'ant-mk-text'}>{data.$Index || ''}</div> + <div className="ant-mk-text"><span className="sequence-wrap" style={_style}>{data.$Index || ''}</span></div> </div> </Col> ) diff --git a/src/tabviews/custom/components/card/cardcellList/index.scss b/src/tabviews/custom/components/card/cardcellList/index.scss index dc5bab5..97c3ab3 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.scss +++ b/src/tabviews/custom/components/card/cardcellList/index.scss @@ -8,6 +8,15 @@ font-style: inherit; font-weight: inherit; text-decoration: inherit; + .sequence-wrap { + display: inline-block; + width: 22px; + height: 22px; + line-height: 22px; + white-space: nowrap; + border-radius: 50%; + overflow: visible; + } } .ant-mk-text:not(.line1):not(.line) { word-break: break-word; diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 26ab796..90e0085 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -86,7 +86,7 @@ item.key = index item.$$uuid = item[_config.setting.primaryKey] || '' item.$$BID = BID || '' - item.$Index = index + 1 + item.$Index = index + 1 + '' return item }) } @@ -147,7 +147,7 @@ item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$$BID = BID || '' - item.$Index = index + 1 + item.$Index = index + 1 + '' return item }) @@ -182,7 +182,15 @@ if (config.uuid !== menuId) return - this.loadData(btn) // 鏁版嵁鍒锋柊 + if (!btn || btn.resetPageIndex !== 'false') { + this.setState({ + pageIndex: 1 + }, () => { + this.loadData() + }) + } else { + this.loadData() + } if (btn.syncComponentId && btn.syncComponentId !== config.uuid && btn.syncComponentId !== config.setting.supModule) { MKEmitter.emit('reloadData', btn.syncComponentId) // 鍚岀骇鏍囩鍒锋柊 @@ -193,6 +201,20 @@ } else if (position === 'popclose') { // 鏍囩鍏抽棴鍒锋柊 config.setting.supModule && MKEmitter.emit('reloadData', config.setting.supModule, (BID || 'empty')) btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) + } + } + + reloadData = (btn) => { + if (!btn || btn.resetPageIndex !== 'false') { + this.setState({ + pageIndex: 1 + }, () => { + this.loadmaindata(true, 'true') + this.getStatFieldsValue() + }) + } else { + this.loadmaindata(true, 'false') + this.getStatFieldsValue() } } @@ -214,7 +236,7 @@ if (!config.setting.supModule || config.setting.supModule !== MenuID) return if (id !== this.state.BID) { - this.setState({ BID: id, BData: data }, () => { + this.setState({ BID: id, BData: data, pageIndex: 1 }, () => { this.loadData() }) } @@ -304,7 +326,7 @@ item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$$BID = BID || '' - item.$Index = index + start + item.$Index = index + start + '' return item }), total: result.total, diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx index 70a8e75..0ef7e77 100644 --- a/src/tabviews/custom/components/card/table-card/index.jsx +++ b/src/tabviews/custom/components/card/table-card/index.jsx @@ -58,7 +58,7 @@ item.key = index item.$$uuid = item[_config.setting.primaryKey] || '' item.$$BID = BID || '' - item.$Index = index + 1 + item.$Index = index + 1 + '' return item }) } @@ -138,7 +138,7 @@ item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$$BID = BID || '' - item.$Index = index + 1 + item.$Index = index + 1 + '' return item }) @@ -182,7 +182,7 @@ if (!config.setting.supModule || config.setting.supModule !== MenuID) return if (id !== this.state.BID) { - this.setState({ BID: id }, () => { + this.setState({ BID: id, pageIndex: 1 }, () => { this.loadData() }) } @@ -272,7 +272,7 @@ item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$$BID = BID || '' - item.$Index = index + start + item.$Index = index + start + '' return item }), total: result.total, diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index 62baa07..17b9f45 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -75,7 +75,7 @@ item.key = index item.$$uuid = item[_config.setting.primaryKey] || '' item.$$BID = BID || '' - item.$Index = index + 1 + item.$Index = index + 1 + '' return item }) } @@ -195,7 +195,7 @@ item.key = index item.$$uuid = item[setting.primaryKey] || '' item.$$BID = BID || '' - item.$Index = start + index + item.$Index = start + index + '' return item }), selectedData: [], @@ -516,7 +516,7 @@ item.key = index item.$$uuid = item[config.setting.primaryKey] || '' item.$$BID = BID || '' - item.$Index = index + 1 + item.$Index = index + 1 + '' return item }) diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index dcd0099..af4fcc8 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -628,7 +628,7 @@ item.key = index item.$$uuid = item[setting.primaryKey] || '' item.$$BID = BID || '' - item.$Index = start + index + item.$Index = start + index + '' return item }), diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index af27534..67dca7c 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -592,7 +592,7 @@ item.key = index item.$$uuid = item[setting.primaryKey] || '' item.$$BID = BID || '' - item.$Index = start + index + item.$Index = start + index + '' return item }), diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index d298a5d..4274b92 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -452,7 +452,7 @@ data && data.forEach((item, index) => { let _row = {} - item.$Index = index + 1 + item.$Index = index + 1 + '' btn.verify.columns.forEach((col, i) => { if (item[col.Column] && col.abs === 'true') { @@ -499,7 +499,7 @@ data && data.forEach((item, index) => { let _row = {} - item.$Index = index + 1 + item.$Index = index + 1 + '' _header.forEach(field => { if (item[field] && abses.includes(field)) { -- Gitblit v1.8.0