king
2021-12-10 2cb09105d702ccae0644126ca6ea7f85e1f218bc
src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
@@ -8,40 +8,12 @@
 * @param {object} card       // 图表对象
 */
export function getBaseForm (card) {
  // let appType = sessionStorage.getItem('appType')
  // let menulist = null
  // if (appType === 'pc') {
  //   menulist = sessionStorage.getItem('appMenus')
  //   if (Array.isArray(card.linkmenu)) {
  //     card.linkmenu = ''
  //   }
  // } else {
  //   menulist = sessionStorage.getItem('fstMenuList')
  // }
  // if (menulist) {
  //   try {
  //     menulist = JSON.parse(menulist)
  //     if (appType === 'pc') {
  //       menulist = menulist.map(item => {
  //         item.value = item.MenuID
  //         item.text = item.MenuName
  //         return item
  //       })
  //     }
  //   } catch {
  //     menulist = []
  //   }
  // } else {
  //   menulist = []
  // }
  let appType = sessionStorage.getItem('appType')
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
    } catch {
    } catch (e) {
      roleList = []
    }
  } else {
@@ -92,7 +64,8 @@
      initVal: card.blacklist || [],
      multi: true,
      required: false,
      options: roleList
      options: roleList,
      forbid: !!appType
    },
    // {
    //   type: 'cascader',
@@ -135,6 +108,7 @@
 * @param {Array}  columns    // 显示列
 */
export function getOptionForm (card, columns) {
  let appType = sessionStorage.getItem('appType')
  let shapes = []
  if (card.chartType === 'line') {
@@ -193,8 +167,8 @@
      tooltip: '统计图表适用于展示数据类型为动态值。',
      required: false,
      options: [
        { value: 'query', text: Formdict['header.form.query'] },
        { value: 'statistics', text: Formdict['header.form.statistics'] }
        { value: 'query', text: '查询' },
        { value: 'statistics', text: '统计' }
      ]
    }, {
      type: 'select',
@@ -311,7 +285,7 @@
        text: '百分比'
      }]
    }, {
      type: labelOptions.length > 2 ? 'select' : 'radio',
      type: labelOptions.length > 20 ? 'select' : 'radio',
      key: 'label',
      label: '标签',
      initVal: card.label || 'false',
@@ -364,6 +338,7 @@
      key: 'area',
      label: '面积图',
      initVal: card.area || 'false',
      // tooltip: '仅在形状为smooth时有效。',
      required: false,
      forbid: ['bar'].includes(card.chartType),
      options: [{
@@ -403,6 +378,33 @@
        text: '极坐标'
      }]
    }, {
      type: 'radio',
      key: 'grid',
      label: '网格线',
      initVal: card.grid || 'show',
      required: false,
      options: [{
        value: 'show',
        text: '显示'
      }, {
        value: 'hidden',
        text: '隐藏'
      }]
    }, {
      type: 'radio',
      key: 'y_line',
      label: 'y轴边线',
      initVal: card.y_line || 'hidden',
      tooltip: '图形左侧或右侧的边线。',
      required: false,
      options: [{
        value: 'show',
        text: '显示'
      }, {
        value: 'hidden',
        text: '隐藏'
      }]
    }, {
      type: 'number',
      key: 'barSize',
      label: '柱形宽度',
@@ -425,6 +427,20 @@
      forbid: !['bar'].includes(card.chartType),
      required: false
    }, {
      type: 'number',
      key: 'min',
      label: '最小值',
      tooltip: 'y轴最小值,为空时自适应。',
      initVal: card.min,
      required: false
    }, {
      type: 'number',
      key: 'max',
      label: '最大值',
      tooltip: 'y轴最大值,为空时自适应。',
      initVal: card.max,
      required: false
    }, {
      type: 'color',
      key: 'color',
      label: '色系',
@@ -433,12 +449,31 @@
      required: false
    }, {
      type: 'color',
      key: 'lineColor',
      label: '轴线颜色',
      initVal: card.lineColor,
      tooltip: '坐标轴线的颜色,包括x轴、y轴及网格线。',
      allowClear: true,
      required: false
    }, {
      type: 'color',
      key: 'selectColor',
      label: '选中颜色',
      initVal: card.selectColor || '',
      tooltip: '选中柱形图的颜色,在交互效果《元素选中(多选)》和《元素选中(单选)》中有效,自定义设置中无效。',
      tooltip: '选中柱形图的颜色,在交互效果《元素选中(多选)》和《元素选中(单选)》中有效,启用自定义设置时无效。',
      forbid: !['bar'].includes(card.chartType),
      allowClear: true,
      required: false
    }, {
      type: 'number',
      key: 'rotate',
      label: '旋转',
      tooltip: '坐标轴标注文本的旋转角度。',
      min: 0,
      max: 360,
      decimal: 0,
      initVal: card.rotate,
      forbid: appType !== 'mob',
      required: false
    }, {
      type: 'select',
@@ -447,6 +482,7 @@
      initVal: card.interaction || [],
      multi: true,
      required: false,
      forbid: appType === 'mob',
      options: [
        { value: 'element-active', label: '元素聚焦' },
        { value: 'element-selected', label: '元素选中(多选)' },