king
2020-11-10 5df578ff69f6b02e821d59a8883bc75d78695a62
src/menu/actioncomponent/formconfig.jsx
@@ -11,7 +11,7 @@
 * @param {*} permFuncField  存储过程可用的开始字段
 * @param {*} type           按钮类型,用于区分可选的打开方式
 */
export function getActionForm (card, functip, setting, permFuncField = [], type, menulist = []) {
export function getActionForm (card, functip, setting, permFuncField = [], type, menulist = [], modules = []) {
  let opentypes = [
    {
      value: 'pop',
@@ -43,23 +43,7 @@
    }
  ]
  if (card.intertype === 'inner' && !card.innerFunc) {
    card.intertype = 'system'
  }
  if (type === 'chart') {
    if (card.focus) {
      // 导入和导出excel,按钮名称直接为导入、导出
      card.label = '导出Excel'
      card.OpenType = 'excelOut'
      card.icon = 'download'
      card.intertype = setting.interType
      card.innerFunc = setting.innerFunc
      card.sysInterface = setting.sysInterface
      card.outerFunc = setting.outerFunc
      card.interface = setting.interface
      card.class = 'dgreen'
    }
    opentypes = [
      {
        value: 'excelIn',
@@ -119,10 +103,10 @@
        text: '系统'
      }, {
        value: 'inner',
        text: Formdict['header.form.interface.inner']
        text: Formdict['model.interface.inner']
      }, {
        value: 'outer',
        text: Formdict['header.form.interface.outer']
        text: Formdict['model.interface.outer']
      }]
    },
    {
@@ -130,8 +114,7 @@
      key: 'sqlType',
      label: Formdict['header.form.action.type'],
      initVal: card.sqlType || '',
      tooltip: Formdict['header.form.actionhelp.sqlType'],
      required: false,
      required: true,
      options: []
    },
    {
@@ -147,8 +130,7 @@
      key: 'sql',
      label: Formdict['model.form.tablename'],
      initVal: card.sql || setting.tableName || '',
      tooltip: Formdict['header.form.actionhelp.tablename'],
      required: false
      required: true
    },
    {
      type: 'text',
@@ -163,21 +145,13 @@
    },
    {
      type: 'select',
      key: 'linkTab',
      label: '关联标签',
      initVal: card.linkTab || '',
      required: false,
      options: []
    },
    {
      type: 'select',
      key: 'pageTemplate',
      label: Formdict['model.form.newpage.type'],
      initVal: card.pageTemplate || '',
      required: true,
      options: [{
        value: 'print',
        text: Formdict['header.menu.printTemplate']
        value: 'billprint',
        text: '单据打印'
      }, {
        value: 'pay',
        text: Formdict['model.pay']
@@ -230,20 +204,6 @@
      initVal: card.callbackFunc || '',
      required: false,
      readonly: false
    },
    {
      type: 'select',
      key: 'position',
      label: Formdict['header.form.position'],
      initVal: card.position || 'toolbar',
      required: true,
      options: [{
        value: 'toolbar',
        text: Formdict['header.form.toolbar']
      }, {
        value: 'grid',
        text: Formdict['header.form.grid']
      }]
    },
    {
      type: 'select',
@@ -332,11 +292,40 @@
      }]
    },
    {
      type: 'number',
      key: 'width',
      min: 1,
      max: 24,
      precision: 0,
      label: '宽度',
      initVal: card.width || 12,
      tooltip: '栅格布局,每行等分为24列。',
      forbid: type !== 'card',
      required: true
    },
    {
      type: 'select',
      key: 'show',
      label: "显示为",
      initVal: card.show || 'icon',
      required: true,
      options: [{
        value: 'icon',
        text: '图标'
      }, {
        value: 'button',
        text: '按钮'
      }, {
        value: 'link',
        text: '链接'
      }]
    },
    {
      type: 'select',
      key: 'icon',
      label: Formdict['model.icon'],
      initVal: card.icon,
      required: type === 'chart', // 图表必须使用图标
      required: false,
      options: []
    },
    {
@@ -396,6 +385,14 @@
        text: '非必填'
      }]
    },
    {
      type: 'mcascader',
      key: 'syncComponent',
      label: '同步刷新',
      initVal: card.syncComponent || [],
      required: false,
      options: modules
    },
    // {
    //   type: 'select',
    //   key: 'linkcomponents',
@@ -406,7 +403,5 @@
    // }
  ]
  if (type === 'chart') {
    return forms
  }
  return forms
}