From cc1a76df575c18f0d0ee96e8658461efdce3a918 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 17 一月 2023 18:01:01 +0800 Subject: [PATCH] 2023-01-17 --- src/components/normalform/modalform/mkTable/index.jsx | 29 ++++++++++++++++++++++++++--- 1 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/components/normalform/modalform/mkTable/index.jsx b/src/components/normalform/modalform/mkTable/index.jsx index 28dafc3..ae23f22 100644 --- a/src/components/normalform/modalform/mkTable/index.jsx +++ b/src/components/normalform/modalform/mkTable/index.jsx @@ -3,9 +3,10 @@ import { fromJS } from 'immutable' import { DndProvider, DragSource, DropTarget } from 'react-dnd' import { Table, Input, InputNumber, Popconfirm, Form, Select, Radio, Cascader, notification, Typography, Button } from 'antd' -import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons' +import { PlusOutlined, EditOutlined, DeleteOutlined, ArrowRightOutlined } from '@ant-design/icons' import Utils from '@/utils/utils.js' +import MKEmitter from '@/utils/events.js' import ColorSketch from '@/mob/colorsketch' import asyncComponent from '@/utils/asyncComponent' import './index.scss' @@ -74,14 +75,14 @@ class EditableCell extends Component { getInput = (form) => { - const { inputType, options, min, max, unlimit } = this.props + const { inputType, options, min, max, unlimit, allowClear } = this.props if (inputType === 'number' && unlimit) { return <InputNumber onPressEnter={() => this.getValue(form)} /> } else if (inputType === 'number') { return <InputNumber min={min} max={max} precision={0} onPressEnter={() => this.getValue(form)} /> } else if (inputType === 'color') { - return <ColorSketch /> + return <ColorSketch allowClear={allowClear}/> } else if (inputType === 'icon') { return <MkEditIcon allowClear/> } else if (inputType === 'select') { @@ -165,6 +166,7 @@ } UNSAFE_componentWillMount () { + let actions = this.props.actions || [] let columns = fromJS(this.props.columns).toJS() let operation = { @@ -196,6 +198,7 @@ <span className="danger"><DeleteOutlined /></span> </Popconfirm> : null} {editingKey !== '' ? <span className="danger"><DeleteOutlined /></span> : null} + {actions.includes('view') ? <span className="copy" onClick={() => {editingKey === '' && this.changeMenu(record.menu)}}><ArrowRightOutlined /></span> : null} </div> ) } @@ -213,6 +216,24 @@ // shouldComponentUpdate (nextProps, nextState) { // return !is(fromJS(this.state), fromJS(nextState)) // } + + changeMenu = (MenuId) => { + if (MenuId === 'IM') { + if (!sessionStorage.getItem('instantMessage')) return + + let param = { + MenuID: sessionStorage.getItem('instantMessage'), + copyMenuId: '', + type: 'view' + } + + param = window.btoa(window.encodeURIComponent(JSON.stringify(param))) + + MKEmitter.emit('changeEditMenu', {routerUrl: '/imdesign/' + param}) + } else { + MKEmitter.emit('changeEditMenu', {MenuID: MenuId}) + } + } isEditing = record => record.uuid === this.state.editingKey @@ -399,6 +420,7 @@ unlimit: col.unlimit, required: col.required !== false ? true : false, title: col.title, + allowClear: col.allowClear === true, editing: this.isEditing(record), onSave: this.execSave, }), @@ -431,6 +453,7 @@ })} /> </DndProvider> + {this.props.tip ? this.props.tip : null} </div> </EditableContext.Provider> ) -- Gitblit v1.8.0