king
2021-05-08 6afdec0062dacbded57e166230eb22cc55ced0c1
src/templates/zshare/formconfig.jsx
@@ -1135,7 +1135,7 @@
 * @param {object} card       // 搜索条件对象
 * @param {Array}  menulist   // 菜单列表-用于字段透视
 */
export function getColumnForm (card, menulist = []) {
export function getColumnForm (card, menulist = [], fields = []) {
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
    try {
@@ -1145,6 +1145,10 @@
    }
  } else {
    roleList = []
  }
  if (!card.linkurl && (!card.linkmenu || card.linkmenu.length === 0)) {
    card.perspective = ''
  }
  return [
@@ -1184,6 +1188,9 @@
      }, {
        value: 'textarea',
        text: Formdict['model.form.textarea']
      }, {
        value: 'index',
        text: '序号'
      }]
    },
    {
@@ -1394,8 +1401,11 @@
      type: 'radio',
      key: 'perspective',
      label: '字段透视',
      initVal: card.perspective || 'linkmenu',
      initVal: card.perspective || '',
      options: [{
        value: '',
        text: '无'
      }, {
        value: 'linkmenu',
        text: '菜单'
      }, {
@@ -1408,15 +1418,23 @@
      key: 'linkmenu',
      label: Formdict['model.menu'],
      initVal: card.linkmenu || [],
      required: false,
      required: true,
      options: menulist
    },
    {
      type: 'text',
      type: 'textarea',
      key: 'linkurl',
      label: '链接地址',
      initVal: card.linkurl || '',
      required: false
      required: true
    },
    {
      type: 'multiselect',
      key: 'linkfields',
      label: '关联字段',
      initVal: card.linkfields || [],
      required: false,
      options: fields
    },
    {
      type: 'multiselect',
@@ -1919,8 +1937,10 @@
    })
  }
  if (['textarea', 'fileupload', 'multiselect', 'checkbox', 'brafteditor'].includes(card.type)) {
  if (['fileupload', 'multiselect', 'checkbox'].includes(card.type)) {
    _fieldlength = 512
  } else if (['textarea', 'brafteditor'].includes(card.type)) {
    _fieldlength = 8000
  }
  return [
@@ -2406,13 +2426,27 @@
      }]
    },
    {
      type: 'radio',
      key: 'declareType',
      label: '数据类型',
      tooltip: '声明变量时的类型,时间格式datetime或文本格式nvarchar(50)。',
      initVal: card.declareType || 'datetime',
      options: [{
        value: 'datetime',
        text: 'datetime'
      }, {
        value: 'nvarchar(50)',
        text: 'nvarchar(50)'
      }]
    },
    {
      type: 'number',
      key: 'span',
      min: 1,
      max: 24,
      precision: 0,
      label: '表单宽度',
      initVal: card.span || ('textarea,hint,checkcard,brafteditor'.indexOf(card.type) > -1 ? 24 : 12),
      initVal: card.span || (['textarea', 'hint', 'checkcard', 'brafteditor'].includes(card.type) ? 24 : 12),
      tooltip: '栅格布局整行24等分。',
      required: true
    },
@@ -2424,7 +2458,7 @@
      precision: 1,
      label: '名称宽度',
      initVal: card.labelwidth || 33.3,
      tooltip: '名称占据表单宽度的百分比。注:存在多列表单时,当前表单如果想要占据整行可参照以下比例,两列(16.3)、三列(10.5)、四列(8.3)',
      tooltip: '名称占据表单宽度的百分比。注:存在多列表单时,当前表单如果想要占据整行可参照以下比例,两列(16.2)、三列(10.5)、四列(7.7)',
      required: true
    },
    {