king
2022-08-02 8d66ff34fae5b048a6b7923cc75d34f13a08be9d
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