king
2023-06-14 08cce3334a2dc81d690b518136b0aaea64e48b0b
src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx
@@ -14,7 +14,6 @@
    roleList = []
  }
  // if (['picture', 'link', 'colspan'].includes(card.type)) {
  if (['picture', 'link'].includes(card.type)) {
    card.type = 'text'
  }
@@ -34,9 +33,6 @@
  }, {
    value: 'colspan',
    text: '合并列'
  // }, {
  //   value: 'action',
  //   text: '操作'
  }, {
    value: 'formula',
    text: '公式'
@@ -44,13 +40,6 @@
    value: 'index',
    text: '序号'
  }]
  if (!card.isSub) {
    options.push({
      value: 'action',
      text: '操作'
    })
  }
  let editCols = [
    {
@@ -66,22 +55,30 @@
      label: '无动作'
    }
  ]
  columns.forEach(col => {
    if (col.editable === 'true' && col.uuid !== card.uuid) {
      editCols.push({
        field: col.uuid,
        label: col.label
      })
    } else if (col.type === 'colspan') {
      col.subcols.forEach(subcol => {
        if (subcol.editable === 'true' && subcol.uuid !== card.uuid) {
          editCols.push({
            field: subcol.uuid,
            label: col.label + '-' + subcol.label
          })
        }
      })
    }
  let cols = []
  let getcols = (columns, suplabel = '') => {
    columns.forEach(col => {
      if (col.editable === 'true' && col.uuid !== card.uuid) {
        cols.push({
          field: col.uuid,
          label: suplabel + col.label
        })
      } else if (col.type === 'colspan') {
        getcols(col.subcols, col.label + '-')
      }
    })
  }
  getcols(columns)
  editCols.push(...cols)
  cols.forEach(col => {
    editCols.push({
      field: '$next_' + col.field,
      label: col.label + '(下一行)'
    })
  })
  return [
@@ -148,6 +145,18 @@
    },
    {
      type: 'radio',
      key: 'eval',
      label: '解析',
      initVal: card.eval || 'false',
      tooltip: '当公式内容涉及计算时请选择“是”,当公式内容为字段拼接时请选择“否”。',
      required: false,
      options: [
        { value: 'true', text: '是' },
        { value: 'false', text: '否' }
      ]
    },
    {
      type: 'radio',
      key: 'Align',
      label: '对齐方式',
      initVal: card.Align || 'left',
@@ -161,21 +170,6 @@
      }, {
        value: 'right',
        text: '右对齐'
      }]
    },
    {
      type: 'radio',
      key: 'sum',
      label: '显示合计',
      initVal: card.sum || 'false',
      tooltip: '合计信息只在使用系统数据源时有效。',
      required: false,
      options: [{
        value: 'true',
        text: '是'
      }, {
        value: 'false',
        text: '否'
      }]
    },
    {
@@ -260,16 +254,6 @@
      }]
    },
    {
      type: 'select',
      key: 'editField',
      label: '编辑字段',
      initVal: card.editField || '',
      tooltip: '当值与提示文字不同时,可额外添加编辑字段,作为实际值的录入字段。',
      allowClear: true,
      required: false,
      options: fields
    },
    {
      type: 'options',
      key: 'options',
      label: '选项',
@@ -281,6 +265,7 @@
      key: 'dataSource',
      label: '数据源',
      initVal: card.dataSource || '',
      placeholder: '系统变量:mk_departmentcode、mk_organization、mk_user_type。',
      required: true,
    },
    {
@@ -370,27 +355,28 @@
      type: 'select',
      key: 'enter',
      label: '回车切换',
      initVal: card.enter || '$next',
      initVal: card.enter || '$noAct',
      tooltip: '包括文本或数值回车事件、下拉菜单选中事件、开关切换事件。',
      options: editCols
    },
    // {
    //   type: 'radio',
    //   key: 'footEnter',
    //   label: '末行回车',
    //   initVal: card.footEnter || 'false',
    //   tooltip: '新增功能仅在表格可新增时有效。',
    //   options: [{
    //     value: 'sub',
    //     text: '提交'
    //   }, {
    //     value: 'add',
    //     text: '新增'
    //   }, {
    //     value: 'false',
    //     text: '无动作'
    //   }]
    // },
    {
      type: 'select',
      key: 'ctrlField',
      label: '禁用字段',
      initVal: card.ctrlField || '',
      tooltip: '控制单元格是否可以编辑。',
      allowClear: true,
      required: false,
      options: fields
    },
    {
      type: 'text',
      key: 'ctrlValue',
      label: '禁用值',
      initVal: card.ctrlValue || '',
      tooltip: '多个值用逗号分隔。',
      required: false
    },
    {
      type: 'number',
      key: 'decimal',
@@ -398,7 +384,7 @@
      max: 18,
      precision: 0,
      label: '小数位',
      initVal: card.decimal || 0,
      initVal: card.decimal,
      required: false
    },
    {
@@ -472,18 +458,6 @@
      required: false,
    },
    {
      type: 'radio',
      key: 'eval',
      label: '解析',
      initVal: card.eval || 'true',
      tooltip: '当公式内容涉及计算时请选择“是”,当公式内容为字段拼接时请选择“否”。',
      required: false,
      options: [
        { value: 'true', text: '是' },
        { value: 'false', text: '否' }
      ]
    },
    {
      type: 'textarea',
      key: 'formula',
      label: '公式',
@@ -501,6 +475,21 @@
      options: fields
    },
    {
      type: 'radio',
      key: 'noValue',
      label: '空值',
      initVal: card.noValue || 'show',
      tooltip: '当值为0时是否显示',
      required: false,
      options: [{
        value: 'show',
        text: '显示'
      }, {
        value: 'hide',
        text: '隐藏'
      }]
    },
    {
      type: 'multiselect',
      key: 'blacklist',
      label: '黑名单',