From c5b6f6cb5bba7268aaa2496bbf21bf2965277f8b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 01 七月 2022 13:29:03 +0800 Subject: [PATCH] 2022-07-01 --- src/templates/zshare/modalform/datatable/index.jsx | 45 ++++++++++++++++++++++++--------------------- 1 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/templates/zshare/modalform/datatable/index.jsx b/src/templates/zshare/modalform/datatable/index.jsx index ec8b5a1..31e23ed 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)} /> } @@ -199,16 +202,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 => { @@ -369,11 +372,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 +444,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