| | |
| | | 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 |
| | | |
| | |
| | | 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)} /> |
| | | } |
| | |
| | | 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 => { |
| | |
| | | |
| | | 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] |
| | | |
| | |
| | | }) |
| | | |
| | | 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 |