king
2024-05-16 b69b5f6329ca5f87932436b7a6c1ddfc3377e10f
src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx
@@ -40,6 +40,12 @@
    value: 'number',
    text: '数字'
  }, {
    value: 'custom',
    text: '自定义列'
  }, {
    value: 'formula',
    text: '公式'
  }, {
    value: 'picture',
    text: '图片'
  }, {
@@ -52,26 +58,20 @@
    value: 'textarea',
    text: '多行文本'
  }, {
    value: 'custom',
    text: '自定义列'
  }, {
    value: 'colspan',
    text: '合并列'
  }, {
    value: 'formula',
    text: '公式'
    value: 'extend',
    text: '扩展列'
  }, {
    value: 'index',
    text: '序号'
  }]
  if (!card.isSub) {
    options.push({
      value: 'action',
      text: '操作'
    })
  if (appType === 'mob') {
    options = options.filter(item => item.value !== 'extend')
  }
  if (!card.linkurl && (!card.linkmenu || card.linkmenu.length === 0)) {
    card.perspective = ''
  }
@@ -105,6 +105,8 @@
      key: 'nameField',
      label: '名称字段',
      initVal: card.nameField || '',
      tooltip: '名称字段为链接在界面中显示的内容,在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。',
      toolWidth: 350,
      required: false,
      options: [{uuid: 'empty', field: '', label: '空'}, ...fields]
    },
@@ -117,20 +119,6 @@
      label: '列宽',
      initVal: card.Width || 120,
      required: true
    },
    {
      type: 'radio',
      key: 'joint',
      label: '拼接参数',
      initVal: card.joint || 'true',
      required: true,
      options: [{
        value: 'true',
        text: '是'
      }, {
        value: 'false',
        text: '否'
      }]
    },
    {
      type: 'radio',
@@ -150,7 +138,7 @@
      type: 'radio',
      key: 'IsSort',
      label: '排序',
      initVal: card.IsSort || (card.isSub ? 'false' : 'true'),
      initVal: card.IsSort || (card.isSub || card.type === 'custom' ? 'false' : 'true'),
      required: true,
      options: [{
        value: 'true',
@@ -158,6 +146,32 @@
      }, {
        value: 'false',
        text: '否'
      }]
    },
    {
      type: 'select',
      key: 'sortField',
      label: '排序字段',
      initVal: card.sortField || '',
      required: true,
      options: fields
    },
    {
      type: 'radio',
      key: 'eval',
      label: '解析方式',
      initVal: card.eval || 'false',
      tooltip: '当公式内容涉及计算时请选择“计算”,当公式内容为字段拼接时请选择“字段替换”,使用函数时入参为data(数组)。',
      required: false,
      options: [{
        value: 'false',
        text: '字段替换'
      }, {
        value: 'true',
        text: '计算'
      }, {
        value: 'func',
        text: '函数'
      }]
    },
    {
@@ -175,6 +189,95 @@
      }, {
        value: 'right',
        text: '右对齐'
      }]
    },
    {
      type: 'radio',
      key: 'colUnit',
      label: '单位',
      initVal: card.colUnit || 'day',
      required: true,
      options: [{
        value: 'day',
        text: '天'
      }, {
        value: 'hour',
        text: '小时'
      }]
    },
    {
      type: 'number',
      key: 'shift',
      label: '偏移量',
      initVal: card.shift || 0,
      min: -1000,
      max: 1000,
      decimal: 0,
      required: true
    },
    {
      type: 'number',
      key: 'quota',
      label: '指标数',
      initVal: card.quota || 7,
      min: 1,
      max: 1000,
      decimal: 0,
      required: true
    },
    {
      type: 'select',
      key: 'dayFormat',
      label: '格式化',
      initVal: card.dayFormat || 'M/DD',
      required: true,
      options: [{
        value: 'M/DD',
        label: 'M/DD(4/29)'
      }, {
        value: 'M-DD',
        label: 'M-DD(4-29)'
      }, {
        value: 'M月DD日',
        label: 'M月DD日(4月29日)'
      }, {
        value: 'M/DD week',
        label: 'M/DD week(4/29 星期一)'
      }, {
        value: 'M-DD week',
        label: 'M-DD week(4-29 星期一)'
      }, {
        value: 'M月DD日 week',
        label: 'M月DD日 week(4月29日 星期一)'
      }]
    },
    {
      type: 'select',
      key: 'hourFormat',
      label: '格式化',
      initVal: card.hourFormat || 'H:00',
      required: true,
      options: [{
        value: 'H:00',
        label: 'H:00(15:00)'
      }, {
        value: 'H point',
        label: 'H(15点)'
      }, {
        value: 'h:00',
        label: 'h:00(3:00 pm)'
      }]
    },
    {
      type: 'text',
      key: 'supField',
      label: '上级字段',
      initVal: card.supField || '',
      tooltip: '来源于上级组件的字段集(上级组件为空时从url参数中选取),该字段值(用逗号分隔)可控制扩展列的列名。',
      required: false,
      rules: [{
        pattern: /^[0-9a-zA-Z_]*$/ig,
        message: '字段名只允许包含数字、字母以及_'
      }]
    },
    {
@@ -213,28 +316,13 @@
      }]
    },
    {
      type: 'radio',
      key: 'sum',
      label: '显示合计',
      initVal: card.sum || 'false',
      tooltip: '合计信息只在使用系统数据源时有效。',
      required: false,
      options: [{
        value: 'true',
        text: '是'
      }, {
        value: 'false',
        text: '否'
      }]
    },
    {
      type: 'number',
      key: 'decimal',
      min: 0,
      max: 18,
      decimal: 0,
      label: '小数位',
      initVal: card.decimal || 0,
      initVal: card.decimal,
      required: false
    },
    {
@@ -331,6 +419,18 @@
    },
    {
      type: 'radio',
      key: 'backgroundSize',
      label: '图像大小',
      initVal: card.backgroundSize || 'cover',
      required: false,
      options: [
        { value: 'cover', text: '覆盖' },
        { value: 'contain', text: '包含' },
        { value: 'auto', text: '自适应' },
      ]
    },
    {
      type: 'radio',
      key: 'scale',
      label: '点击缩放',
      initVal: card.scale || 'true',
@@ -342,6 +442,18 @@
        value: 'false',
        text: '否'
      }]
    },
    {
      type: 'radio',
      key: 'lostTip',
      label: '图片缺失',
      initVal: card.lostTip || 'true',
      tooltip: '图片地址不存在时,是否提示图片丢失。',
      required: false,
      options: [
        { value: 'true', text: '提示' },
        { value: 'false', text: '不提示' }
      ]
    },
    {
      type: 'radio',
@@ -358,7 +470,7 @@
        value: 'linkurl',
        text: '链接'
      }],
      forbidden: appType === 'mob'
      forbid: appType === 'mob'
    },
    {
      type: appType === 'pc' ? 'select' : 'cascader',
@@ -367,24 +479,17 @@
      initVal: card.linkmenu || (appType === 'pc' ? '' : []),
      required: true,
      options: menulist,
      forbidden: appType === 'mob'
      forbid: appType === 'mob'
    },
    {
      type: 'textarea',
      key: 'linkurl',
      label: '链接地址',
      initVal: card.linkurl || '',
      tooltip: '在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。',
      toolWidth: 350,
      required: true,
      forbidden: appType === 'mob'
    },
    {
      type: 'multiselect',
      key: 'linkfields',
      label: '关联字段',
      initVal: card.linkfields || [],
      required: false,
      options: fields,
      forbidden: appType === 'mob'
      forbid: appType === 'mob'
    },
    {
      type: 'radio',
@@ -399,18 +504,6 @@
      ]
    },
    {
      type: 'radio',
      key: 'eval',
      label: '解析',
      initVal: card.eval || 'true',
      tooltip: '当公式内容涉及计算时请选择“是”,当公式内容为字段拼接时请选择“否”。',
      required: false,
      options: [
        { value: 'true', text: '是' },
        { value: 'false', text: '否' }
      ]
    },
    {
      type: 'textarea',
      key: 'formula',
      label: '公式',
@@ -420,13 +513,28 @@
      required: true
    },
    {
      type: 'radio',
      key: 'noValue',
      label: '空值',
      initVal: card.noValue || 'show',
      tooltip: '数值为 0 或时间小于 1949-10-02 时,是否显示',
      required: false,
      options: [{
        value: 'show',
        text: '显示'
      }, {
        value: 'hide',
        text: '隐藏'
      }]
    },
    {
      type: 'multiselect',
      key: 'blacklist',
      label: '黑名单',
      initVal: card.blacklist || [],
      required: false,
      options: roleList,
      forbidden: appType === 'mob'
      forbid: appType === 'mob'
    }
  ]
}