From cb9ade2afd2a367ad767bc605ab7086c695dd010 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 09 十二月 2022 15:53:32 +0800 Subject: [PATCH] 2022-12-09 --- src/templates/zshare/modalform/datatable/index.jsx | 48 +++++++++++++++++++++++++----------------------- 1 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/templates/zshare/modalform/datatable/index.jsx b/src/templates/zshare/modalform/datatable/index.jsx index ec8b5a1..7492418 100644 --- a/src/templates/zshare/modalform/datatable/index.jsx +++ b/src/templates/zshare/modalform/datatable/index.jsx @@ -6,9 +6,11 @@ import { PlusOutlined, EditOutlined, DeleteOutlined, SwapOutlined } from '@ant-design/icons' import Utils from '@/utils/utils.js' -import FileUpload from '@/tabviews/zshare/fileupload' +import asyncComponent from '@/utils/asyncComponent' +// import FileUpload from '@/tabviews/zshare/fileupload' import './index.scss' +const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent')) const EditableContext = React.createContext() let dragingIndex = -1 @@ -73,12 +75,13 @@ getInput = (form) => { const { inputType, record } = this.props if (inputType === 'file') { - return <FileUpload config={{ - initval: record ? (record.$url || '') : '', - suffix: '', - maxfile: 1, - fileType: 'picture-card' - }}/> + return <SourceComponent initialValue={record ? (record.$url || '') : ''} type="" placement="right"/> + // return <FileUpload config={{ + // initval: record ? (record.$url || '') : '', + // suffix: '', + // maxfile: 1, + // fileType: 'picture-card' + // }}/> } else { return <Input onPressEnter={() => this.getValue(form)} /> } @@ -143,7 +146,6 @@ class EdiDataTable extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� transfield: PropTypes.object, // 瀛楁鍚嶇О type: PropTypes.string, // 鏄惁涓哄叧鑱旇〃鍗� display: PropTypes.string, // 鏁版嵁绫诲瀷锛屾枃鏈�佸浘鐗� @@ -199,16 +201,16 @@ return <span style={{display: 'block', width: '70px', height: '70px'}}><img style={{width: '100%', height: '100%'}} src={text} alt="" /></span> } }) - } else { - columns = fields.map(item => { - keys.push(item.field) - return { - title: item.field, - dataIndex: item.field, - editable: true, - } - }) } + + fields.forEach(item => { + keys.push(item.field) + columns.push({ + title: item.field, + dataIndex: item.field, + editable: true, + }) + }) if (linkSubFields.length > 0) { linkSubFields.forEach(m => { @@ -261,7 +263,7 @@ <span className="hide-control" title="鏄剧ず/闅愯棌" onClick={() => {editingKey === '' && this.handleHide(record.key)}}><SwapOutlined /></span> {editingKey === '' ? <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(record.key) }> <span className="danger"><DeleteOutlined /></span> @@ -369,11 +371,11 @@ if (display === 'picture') { item.$url = '' - } else { - fields.forEach(f => { - item[f.field] = `${this.state.data.length + 1}` - }) } + + fields.forEach(f => { + item[f.field] = `${this.state.data.length + 1}` + }) let data = [...this.state.data, item] @@ -441,7 +443,7 @@ }) let addable = false - if (this.props.display === 'picture') { + if (this.props.display === 'picture' || this.props.display === 'color') { addable = true } else if (this.props.fields && this.props.fields.length > 0) { addable = true -- Gitblit v1.8.0