From 2682e38fcea26a70d3bac34c79931973b989eab5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 10 十二月 2023 19:12:14 +0800 Subject: [PATCH] 2023-12-10 --- src/views/rolemanage/index.jsx | 2 src/components/normalform/modalform/index.scss | 1 src/menu/components/chart/antv-bar/chartcompile/index.jsx | 20 ++++++ src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx | 114 +++++++++++++++++++++++++++++--------- src/components/normalform/modalform/index.jsx | 21 +++--- src/menu/components/chart/antv-bar/chartcompile/index.scss | 2 src/views/rolemanage/index.scss | 4 7 files changed, 121 insertions(+), 43 deletions(-) diff --git a/src/components/normalform/modalform/index.jsx b/src/components/normalform/modalform/index.jsx index a277d8a..aafd7bf 100644 --- a/src/components/normalform/modalform/index.jsx +++ b/src/components/normalform/modalform/index.jsx @@ -18,7 +18,8 @@ const MKCheckbox = asyncComponent(() => import('./mkCheckbox')) const StyleInput = asyncComponent(() => import('./styleInput')) const MKFileUpload = asyncComponent(() => import('@/tabviews/zshare/fileupload')) -const MKColor = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkColor')) +const MKColor = asyncComponent(() => import('@/mob/colorsketch')) +// const MKColor = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkColor')) const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent')) @@ -110,7 +111,7 @@ let supItem = fieldMap.get(key) let supval = supItem.initval - if (supItem.initval && supItem.type !== 'checkbox' && supItem.type !== 'multiselect' && JSON.stringify(supItem.initval) === '[]') { + if (supval && JSON.stringify(supval) === '[]') { supval = '' } @@ -126,13 +127,13 @@ } else if (supItem.hidden) { cell.hidden = true + } else if (item.notNull) { + cell.hidden = !supval } else if (supItem.type === 'checkbox' || supItem.type === 'multiselect') { - let vals = [...supval, ...item.values] + let vals = [...(supval || []), ...item.values] if (vals.length === new Set(vals).size) { cell.hidden = true } - } else if (item.notNull) { - cell.hidden = !supval } else if (!item.values.includes(supval)) { cell.hidden = true } @@ -196,7 +197,7 @@ let reset = (current) => { let val = this.record[current.field] - if (val && current.type !== 'checkbox' && current.type !== 'multiselect' && JSON.stringify(val) === '[]') { + if (val && JSON.stringify(val) === '[]') { val = '' } @@ -205,15 +206,15 @@ if (current.hidden) { m.hidden = true + } else if (cell.notNull) { + m.hidden = !val } else if (current.type === 'checkbox' || current.type === 'multiselect') { - let vals = [...val, ...cell.values] + let vals = [...(val || []), ...cell.values] if (vals.length !== new Set(vals).size) { m.hidden = false } else { m.hidden = true } - } else if (cell.notNull) { - m.hidden = !val } else { m.hidden = !cell.values.includes(val) } @@ -287,7 +288,7 @@ } else if (item.type === 'select' || item.type === 'multiselect') { content = (<MKSelect config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)} />) } else if (item.type === 'color') { - content = (<MKColor config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>) + content = (<MKColor config={item} allowClear={item.allowClear} onChange={(val) => this.recordChange({[item.field]: val})}/>) } else if (item.type === 'styleInput') { content = (<StyleInput config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>) } else if (item.type === 'radio') { diff --git a/src/components/normalform/modalform/index.scss b/src/components/normalform/modalform/index.scss index 4bd743d..3def0e9 100644 --- a/src/components/normalform/modalform/index.scss +++ b/src/components/normalform/modalform/index.scss @@ -42,6 +42,7 @@ overflow: hidden; .color-sketch-block-box { min-width: 50px; + max-width: 100px; .color-sketch-block-inner { box-shadow: 0 0 0 1px rgba(0, 0, 0, .1) inset; } diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx index 6fb1663..93d5a34 100644 --- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx @@ -273,6 +273,28 @@ }]) } + let axis = [] + if (card.grid !== 'hidden') { + axis.push('grid') + } + if (card.x_line !== 'hidden') { + axis.push('x_line') + } + if (card.y_line !== 'hidden') { + axis.push('y_line') + } + if (card.tick !== 'hidden') { + axis.push('tick') + } + + let tickVals = [] + if (card.x_label !== 'hidden') { + tickVals.push('x_label') + } + if (card.y_label !== 'hidden') { + tickVals.push('y_label') + } + return [ { type: 'radio', @@ -504,32 +526,70 @@ label: '鏋佸潗鏍�' }] }, { - type: 'radio', - field: 'grid', - label: '缃戞牸绾�', - initval: card.grid || 'show', + type: 'checkbox', + field: 'axis', + label: '鍧愭爣杞�', + initval: axis, required: false, options: [{ - value: 'show', - label: '鏄剧ず' + value: 'grid', + label: '缃戞牸绾�' }, { - value: 'hidden', - label: '闅愯棌' - }] + value: 'x_line', + label: 'X杞�' + }, { + value: 'y_line', + label: 'Y杞�' + }, { + value: 'tick', + label: '鍒诲害绾�' + }], + controlFields: [ + {field: 'lineColor', notNull: true}, + ] }, { - type: 'radio', - field: 'y_line', - label: 'y杞磋竟绾�', - initval: card.y_line || 'hidden', - tooltip: '鍥惧舰宸︿晶鎴栧彸渚х殑杈圭嚎銆�', + type: 'checkbox', + field: 'tickVals', + label: '鍒诲害鍊�', + initval: tickVals, required: false, options: [{ - value: 'show', - label: '鏄剧ず' + value: 'x_label', + label: 'X杞�' }, { - value: 'hidden', - label: '闅愯棌' - }] + value: 'y_label', + label: 'Y杞�' + }], + controlFields: [ + {field: 'color', notNull: true}, + ] + // }, { + // type: 'radio', + // field: 'grid', + // label: '缃戞牸绾�', + // initval: card.grid || 'show', + // required: false, + // options: [{ + // value: 'show', + // label: '鏄剧ず' + // }, { + // value: 'hidden', + // label: '闅愯棌' + // }] + // }, { + // type: 'radio', + // field: 'y_line', + // label: 'y杞磋竟绾�', + // initval: card.y_line || 'hidden', + // tooltip: '鍥惧舰宸︿晶鎴栧彸渚х殑杈圭嚎銆�', + // required: false, + // options: [{ + // value: 'show', + // label: '鏄剧ず' + // }, { + // value: 'hidden', + // label: '闅愯棌' + // }] }, { type: 'radio', field: 'download', @@ -602,17 +662,17 @@ required: false }, { type: 'color', - field: 'color', - label: '鍒诲害鍊奸鑹�', - initval: card.color || 'rgba(0, 0, 0, 0.65)', - tooltip: '鍒诲害鍊肩殑鏂囧瓧棰滆壊銆�', + field: 'lineColor', + label: '鍧愭爣杞撮鑹�', + initval: card.lineColor || '', + tooltip: '鍧愭爣杞寸嚎鐨勯鑹诧紝鍖呮嫭x杞淬�亂杞淬�佺綉鏍肩嚎銆佸埢搴︾嚎銆�', + allowClear: true, required: false }, { type: 'color', - field: 'lineColor', - label: '杞寸嚎棰滆壊', - initval: card.lineColor, - tooltip: '鍧愭爣杞寸嚎鐨勯鑹诧紝鍖呮嫭x杞淬�亂杞村強缃戞牸绾裤��', + field: 'color', + label: '鍒诲害鍊奸鑹�', + initval: card.color || '', allowClear: true, required: false }, { diff --git a/src/menu/components/chart/antv-bar/chartcompile/index.jsx b/src/menu/components/chart/antv-bar/chartcompile/index.jsx index d7ba22d..8b6a146 100644 --- a/src/menu/components/chart/antv-bar/chartcompile/index.jsx +++ b/src/menu/components/chart/antv-bar/chartcompile/index.jsx @@ -482,6 +482,22 @@ resetPlot = (_plot) => { const { config } = this.props + if (_plot.axis) { + _plot.grid = _plot.axis.includes('grid') ? 'show' : 'hidden' + _plot.x_line = _plot.axis.includes('x_line') ? 'show' : 'hidden' + _plot.y_line = _plot.axis.includes('y_line') ? 'show' : 'hidden' + _plot.tick = _plot.axis.includes('tick') ? 'show' : 'hidden' + + delete _plot.axis + } + + if (_plot.tickVals) { + _plot.x_label = _plot.tickVals.includes('x_label') ? 'show' : 'hidden' + _plot.y_label = _plot.tickVals.includes('y_label') ? 'show' : 'hidden' + + delete _plot.tickVals + } + if (_plot.datatype === 'statistics') { _plot.enabled = 'false' _plot.customs = [] @@ -613,14 +629,14 @@ <Modal wrapClassName="mk-pop-modal" visible={visible} - width={1100} + width={1200} maskClosable={false} onOk={this.onSubmit} onCancel={() => { this.setState({ visible: false }) }} destroyOnClose > {config.name ? <div className="mk-com-name">{config.name} - 缂栬緫</div> : null} - <Tabs activeKey={view} className="menu-chart-edit-box" onChange={this.changeTab}> + <Tabs activeKey={view} className="menu-chart-line-edit-box" onChange={this.changeTab}> <TabPane tab="缁勪欢璁剧疆" key="base"> <ModalForm formlist={baseFormlist} inputSubmit={this.onSubmit} wrappedComponentRef={(inst) => this.baseRef = inst}/> </TabPane> diff --git a/src/menu/components/chart/antv-bar/chartcompile/index.scss b/src/menu/components/chart/antv-bar/chartcompile/index.scss index 9e4f721..b9b128d 100644 --- a/src/menu/components/chart/antv-bar/chartcompile/index.scss +++ b/src/menu/components/chart/antv-bar/chartcompile/index.scss @@ -4,7 +4,7 @@ color: #1890ff; } } -.menu-chart-edit-box { +.menu-chart-line-edit-box { .ant-radio-wrapper { margin-right: 5px; } diff --git a/src/views/rolemanage/index.jsx b/src/views/rolemanage/index.jsx index 3a273df..8f03846 100644 --- a/src/views/rolemanage/index.jsx +++ b/src/views/rolemanage/index.jsx @@ -51,7 +51,7 @@ key: 'action', align: 'center', render: (text, record) => ( - <div> + <div style={{minWidth: '125px'}}> {record.type !== 'none' ? <Button type="link" onClick={() => this.deleteMenu(record)} style={{color: '#ff4d4f'}}>鍒犻櫎</Button> : <Button type="link" onClick={() => { diff --git a/src/views/rolemanage/index.scss b/src/views/rolemanage/index.scss index 277ceb0..41d5905 100644 --- a/src/views/rolemanage/index.scss +++ b/src/views/rolemanage/index.scss @@ -68,8 +68,8 @@ border-radius: 4px; } .ant-table-tbody { - > tr.ant-table-row-selected td { - background: #bae7ff; + td:nth-child(1), td:nth-child(2) { + word-break: break-all; } } } -- Gitblit v1.8.0