king
2022-11-21 f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89
src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -1,9 +1,11 @@
import MenuUtils from '@/utils/utils-custom.js'
/**
 * @description 获取元素配置信息
 * @param {*} card
 * @param {*} type
 */
export function getCardCellForm (card, type, subtype, cardCell, anchors) {
export function getCardCellForm (card, cards, cardCell) {
  let _options = [
    { value: 'text', text: '文本'},
    { value: 'number', text: '数值'},
@@ -18,27 +20,22 @@
    { value: 'formula', text: '公式'},
  ]
  if (type === 'table' || (type === 'card' && subtype === 'datacard')) {
  let anchors = []
  if (window.GLOB.customMenu.Template === 'BaseTable') {
    anchors = null
  } else {
    anchors = MenuUtils.getAnchors(window.GLOB.customMenu.components, cards.uuid) || []
  }
  if (cards.type === 'table' || (cards.type === 'card' && cards.subtype === 'datacard')) {
    _options.push({value: 'sequence', text: '序号'})
  } else if (card.eleType === 'sequence') { // 拖拽添加类型转换
    card.eleType = 'text'
  }
  let appMenus = []
  const isApp = sessionStorage.getItem('appType') === 'pc'
  if (isApp) {
    appMenus = sessionStorage.getItem('appMenus')
    if (appMenus) {
      try {
        appMenus = JSON.parse(appMenus)
      } catch (e) {
        appMenus = []
  if (card.eleType === 'icon' && card.datatype === 'dynamic' && !card.field) { // 拖拽添加类型转换
    card.datatype = 'static'
      }
    } else {
      appMenus = []
    }
  }
  let appType = sessionStorage.getItem('appType')
  let tooltip = ''
  if (cardCell.$cardType === 'extendCard') {
@@ -53,13 +50,6 @@
      initVal: card.eleType,
      required: true,
      options: _options
    },
    {
      type: 'icon',
      key: 'icon',
      label: '图标',
      initVal: card.icon,
      required: true
    },
    {
      type: 'radio',
@@ -80,6 +70,13 @@
      initVal: card.field || '',
      required: true,
      options: []
    },
    {
      type: 'icon',
      key: 'icon',
      label: '图标',
      initVal: card.icon,
      required: true
    },
    {
      type: 'text',
@@ -225,7 +222,8 @@
      key: 'tooltip',
      label: '提示信息',
      initVal: card.tooltip || '',
      tooltip: '鼠标悬浮时显示。',
      tooltip: '鼠标悬浮时显示。注:如使用动态信息,请在此处填写相应的字段名。',
      forbid: appType === 'mob',
      required: false
    },
    {
@@ -364,7 +362,8 @@
      initVal: card.anchors || [],
      tooltip: sessionStorage.getItem('appType') === 'mob' ? '注:小程序中无效' : '',
      required: false,
      options: anchors
      options: anchors,
      forbid: !anchors
    },
    {
      type: 'number',
@@ -500,27 +499,6 @@
    },
    {
      type: 'select',
      key: 'linkmenu',
      label: '关联菜单',
      initVal: card.linkmenu || '',
      required: true,
      forbid: !isApp,
      options: appMenus
    },
    // {
    //   type: 'radio',
    //   key: 'open',
    //   label: '打开方式',
    //   initVal: card.open || 'blank',
    //   required: false,
    //   forbid: !isApp,
    //   options: [
    //     { value: 'blank', text: '新页面' },
    //     { value: 'self', text: '当前页面' }
    //   ]
    // },
    {
      type: 'select',
      key: 'linkurl',
      label: '链接地址',
      initVal: card.linkurl || '',
@@ -570,7 +548,7 @@
      key: 'noValue',
      label: '空值',
      initVal: card.noValue || 'show',
      tooltip: '当元素内容为空时,是否显示当前元素。',
      tooltip: '当元素内容为空时,是否显示当前元素。注:数值类型元素包括数字0(非文本)。',
      required: false,
      options: [
        { value: 'show', text: '显示' },