king
2021-06-05 c6f7462d80ab626174329b69045fb7e5704c0683
src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
@@ -8,34 +8,34 @@
 * @param {object} card       // 图表对象
 */
export function getBaseForm (card) {
  let appType = sessionStorage.getItem('appType')
  let menulist = null
  // 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 (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 = []
  }
  // 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 roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
@@ -94,38 +94,38 @@
      required: false,
      options: roleList
    },
    {
      type: 'cascader',
      key: 'linkmenu',
      label: '关联菜单',
      initVal: card.linkmenu || [],
      tooltip: '在使用柱形图且未启用自定义设置时有效。',
      required: false,
      forbid: appType === 'pc' || appType === 'mob',
      options: menulist
    },
    {
      type: 'select',
      key: 'linkmenu',
      label: '关联菜单',
      initVal: card.linkmenu || '',
      tooltip: '双击柱状图,会打开关联的菜单。',
      required: false,
      forbid: appType !== 'pc',
      options: menulist
    },
    {
      type: 'radio',
      key: 'open',
      label: '打开方式',
      initVal: card.open || 'blank',
      required: false,
      forbid: appType !== 'pc',
      options: [
        { value: 'blank', text: '新窗口' },
        { value: 'self', text: '当前窗口' }
      ]
    }
    // {
    //   type: 'cascader',
    //   key: 'linkmenu',
    //   label: '关联菜单',
    //   initVal: card.linkmenu || [],
    //   tooltip: '在使用柱形图且未启用自定义设置时有效。',
    //   required: false,
    //   forbid: appType === 'pc' || appType === 'mob',
    //   options: menulist
    // },
    // {
    //   type: 'select',
    //   key: 'linkmenu',
    //   label: '关联菜单',
    //   initVal: card.linkmenu || '',
    //   tooltip: '双击柱状图,会打开关联的菜单。',
    //   required: false,
    //   forbid: appType !== 'pc',
    //   options: menulist
    // },
    // {
    //   type: 'radio',
    //   key: 'open',
    //   label: '打开方式',
    //   initVal: card.open || 'blank',
    //   required: false,
    //   forbid: appType !== 'pc',
    //   options: [
    //     { value: 'blank', text: '新窗口' },
    //     { value: 'self', text: '当前窗口' }
    //   ]
    // }
  ]
}
@@ -331,6 +331,20 @@
      }]
    }, {
      type: 'radio',
      key: 'area',
      label: '面积图',
      initVal: card.area || 'false',
      required: false,
      forbid: ['bar'].includes(card.chartType),
      options: [{
        value: 'true',
        text: '显示'
      }, {
        value: 'false',
        text: '不显示'
      }]
    }, {
      type: 'radio',
      key: 'repeat',
      label: '重复数据',
      initVal: card.repeat || 'unrepeat',
@@ -388,6 +402,15 @@
      tooltip: '坐标轴提示文字及示例的颜色。',
      required: false
    }, {
      type: 'color',
      key: 'selectColor',
      label: '选中颜色',
      initVal: card.selectColor || '',
      tooltip: '选中柱形图的颜色,在交互效果《元素选中(多选)》和《元素选中(单选)》中有效,自定义设置中无效。',
      forbid: !['bar'].includes(card.chartType),
      allowClear: true,
      required: false
    }, {
      type: 'select',
      key: 'interaction',
      label: '交互效果',