king
2023-10-13 ab262bbe2c64ba086a14f181e5a27eba4b46b555
src/templates/zshare/modalform/index.jsx
@@ -15,7 +15,6 @@
const { TextArea } = Input
const ColorSketch = asyncComponent(() => import('@/mob/colorsketch'))
const FieldsTable = asyncComponent(() => import('./fieldtable'))
const DataTable = asyncComponent(() => import('./datatable'))
const MkEditIcon = asyncComponent(() => import('@/components/mkIcon'))
const modalTypeOptions = {
@@ -457,13 +456,13 @@
            this.record.options = this.record.options.map(cell => {
              cell.Value = cell.Value || cell.$value || ''
              cell.Text = cell[field] || ''
              delete cell.$value
              return cell
            })
          } else {
            this.record.options = this.record.options.map(cell => {
              cell.Value = cell.Value || cell.$value || ''
              delete cell.$value
              return cell
            })
          }
@@ -778,7 +777,21 @@
              linkSubFields = []
            }
          }
          content = <EditTable type={type} module="form" transfield={transfield} linkSubFields={linkSubFields} onChange={this.changeOptions}/>
          let columns = []
          if (type === 'link') {
            columns.push({ title: 'ParentID', key: 'ParentID', strict: true })
          }
          columns.push({ title: 'Value', key: 'Value', strict: true })
          columns.push({ title: 'Text', key: 'Text' })
          linkSubFields.forEach(field => {
            if (field === 'Value' || field === 'Text') return
            columns.push({ title: transfield[field] || field, key: field })
          })
          content = <EditTable columns={columns} module="form" onChange={this.changeOptions}/>
        } else {
          if (this.record.multiple === 'true') {
            linkSubFields = []
@@ -786,7 +799,34 @@
          if (this.record.linkField) {
            type = 'link'
          }
          content = <DataTable type={type} display={this.record.display} linkSubFields={linkSubFields} transfield={transfield} fields={this.record.fields || []} onChange={this.changeOptions}/>
          let columns = []
          let fields = this.record.fields || []
          let keys = ['ParentID', 'pid']
          if (type === 'link') {
            columns.push({ title: 'ParentID', key: 'ParentID', strict: true })
          }
          columns.push({ title: 'Value', key: '$value', strict: true })
          if (this.record.display === 'picture') {
            columns.push({ title: 'url', key: '$url', type: 'file' })
          } else if (this.record.display === 'color') {
            columns.push({ title: 'Color', key: '$color' })
          }
          fields.forEach(item => {
            keys.push(item.field)
            columns.push({ title: item.field, key: item.field })
          })
          linkSubFields.forEach(m => {
            if (keys.includes(m)) return
            columns.push({ title: transfield[m] || m, key: m })
          })
          content = <EditTable columns={columns} onChange={this.changeOptions}/>
        }
      } else if (item.type === 'fields') {
        span = 24
@@ -836,7 +876,7 @@
    let isNumber = true
    options.forEach(item => {
      if (!/^([0-9]|[1-9]\d{0,2})$/.test(item.Value)) {
      if (!item.Value || isNaN(item.Value)) {
        isNumber = false
      }
    })