From 76a4300654a18d228838c3f27455dc8e7a8cd616 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 15 一月 2021 17:04:42 +0800 Subject: [PATCH] Merge branch 'master' into bms --- src/menu/components/share/markcomponent/index.jsx | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/menu/components/table/normal-table/columns/markcolumn/index.jsx b/src/menu/components/share/markcomponent/index.jsx similarity index 92% rename from src/menu/components/table/normal-table/columns/markcolumn/index.jsx rename to src/menu/components/share/markcomponent/index.jsx index 0d4f09b..03dd41d 100644 --- a/src/menu/components/table/normal-table/columns/markcolumn/index.jsx +++ b/src/menu/components/share/markcomponent/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { fromJS } from 'immutable' -import { Icon, Modal } from 'antd' +import { Icon, Modal, Col } from 'antd' import Utils from '@/utils/utils.js' import asyncComponent from '@/utils/asyncComponent' @@ -127,6 +127,7 @@ resetMark = () => { const { marks, columns, type } = this.props + let markColumns = fromJS(this.state.markColumns).toJS() let options = columns.map(col => { return { @@ -251,12 +252,18 @@ if (type === 'line') { signs.pop() + } else if (type === 'slider') { + markColumns = markColumns.filter(col => { + col.width = '20%' + return col.dataIndex !== 'signType' + }) + signs = [] } this.setState({ visible: true, marks: marks ? fromJS(marks).toJS() : [], - markColumns: this.state.markColumns.map(col => { + markColumns: markColumns.map(col => { if (col.dataIndex === 'field') { col.options = options } else if (col.dataIndex === 'signType') { @@ -276,7 +283,7 @@ }) let marks = this.state.marks.map(item => { - if (item.signType[0] === 'background') { + if (item.signType && item.signType[0] === 'background') { try { let colors = item.color.match(/\d+/g) if ((colors[0] * 0.299 + colors[1] * 0.578 + colors[2] * 0.114) * colors[3] < 192) { @@ -313,6 +320,7 @@ destroyOnClose > <MarkForm dict={dict} signs={signs} columns={options} markChange={this.markChange}/> + <Col style={{fontSize: '12px', color: '#757575', paddingLeft: '10px'}} span={24}>娉細浠庝笂鍒颁笅锛屽尮閰嶇涓�涓鍚堟潯浠剁殑鏍囪銆�</Col> <EditTable actions={['edit', 'move', 'del']} data={marks} columns={markColumns} onChange={(marks) => this.setState({marks})}/> </Modal> </div> -- Gitblit v1.8.0