king
2020-11-20 6e106eb13ce404d9955d6c9045d21050d3e08294
src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx
@@ -8,48 +8,11 @@
 * @param {object} card       // 图表对象
 * @param {Array}  columns    // 显示列
 */
export function getPieChartOptionForm (card, columns, sysRoles = [], MenuType) {
export function getOptionForm (card, columns) {
  let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype))
  let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype))
  let _sysRoles = sysRoles.map(item => ({...item, field: item.value, label: item.text}))
  return [
    {
      type: 'text',
      key: 'title',
      label: '标题',
      initVal: card.title,
      required: false
    },
    {
      type: 'text',
      key: 'name',
      label: '组件名称',
      initVal: card.name,
      tooltip: '用于组件间的区分。',
      required: true
    },
    {
      type: 'number',
      key: 'width',
      label: '宽度',
      initVal: card.width,
      tooltip: '栅格布局,每行等分为24列。',
      min: 1,
      max: 24,
      decimal: 0,
      required: true
    },
    {
      type: 'number',
      key: 'height',
      label: '高度',
      initVal: card.height,
      min: 100,
      max: 1000,
      decimal: 0,
      required: true
    },
    {
      type: 'radio',
      key: 'shape',
@@ -126,7 +89,7 @@
    {
      type: 'radio',
      key: 'tooltip',
      label: '提示信息',
      label: '悬浮提示',
      initVal: card.tooltip || 'true',
      required: false,
      options: [{
@@ -140,21 +103,21 @@
    {
      type: 'radio',
      key: 'show',
      label: '显示值',
      label: '格式化',
      initVal: card.show || 'value',
      required: false,
      options: [{
        value: 'value',
        text: '无'
      }, {
        value: 'percent',
        text: '百分比'
      }, {
        value: 'value',
        text: '数值'
      }]
    },
    {
      type: 'radio',
      key: 'label',
      label: '标注',
      label: '标注值',
      initVal: card.label || 'false',
      required: false,
      options: [{
@@ -197,15 +160,6 @@
        value: 'white',
        text: '白色'
      }]
    }, {
      type: 'select',
      key: 'blacklist',
      label: '黑名单',
      initVal: card.blacklist || [],
      multi: true,
      required: false,
      forbid: MenuType === 'billPrint',
      options: _sysRoles
    }
  ]
}