king
2022-10-20 6de5ea0a0c6f06e0321ae41846473118fb85de48
src/menu/components/table/base-table/columns/editColumn/formconfig.jsx
@@ -3,7 +3,6 @@
 * @param {object} card       // 搜索条件对象
 */
export function getColumnForm (card, fields = []) {
  let appType = sessionStorage.getItem('appType')
  let roleList = sessionStorage.getItem('sysRoles')
  if (roleList) {
    try {
@@ -15,13 +14,7 @@
    roleList = []
  }
  let menulist = []
  if (appType === 'pc') {
    menulist = sessionStorage.getItem('appMenus')
  } else if (!appType) {
    menulist = sessionStorage.getItem('fstMenuList')
  }
  let menulist = sessionStorage.getItem('fstMenuList')
  if (menulist) {
    try {
@@ -69,10 +62,6 @@
    })
  }
  if (!card.linkurl && (!card.linkmenu || card.linkmenu.length === 0)) {
    card.perspective = ''
  }
  return [
    {
      type: 'text',
@@ -90,20 +79,19 @@
      options: options
    },
    {
      type: 'select',
      type: card.isSub ? 'select' : 'text',
      key: 'field',
      label: '字段',
      initVal: card.field,
      required: true,
      options: fields
      options: card.isSub ? fields : []
    },
    {
      type: 'select',
      type: 'text',
      key: 'nameField',
      label: '名称字段',
      initVal: card.nameField || '',
      required: false,
      options: [{uuid: 'empty', field: '', label: '空'}, ...fields]
      required: false
    },
    {
      type: 'number',
@@ -335,24 +323,21 @@
        value: 'linkurl',
        text: '链接'
      }],
      forbidden: appType === 'mob'
    },
    {
      type: appType === 'pc' ? 'select' : 'cascader',
      type: 'cascader',
      key: 'linkmenu',
      label: '菜单',
      initVal: card.linkmenu || (appType === 'pc' ? '' : []),
      initVal: card.linkmenu || [],
      required: true,
      options: menulist,
      forbidden: appType === 'mob'
      options: menulist
    },
    {
      type: 'textarea',
      key: 'linkurl',
      label: '链接地址',
      initVal: card.linkurl || '',
      required: true,
      forbidden: appType === 'mob'
      required: true
    },
    {
      type: 'multiselect',
@@ -361,19 +346,6 @@
      initVal: card.linkfields || [],
      required: false,
      options: fields,
      forbidden: appType === 'mob'
    },
    {
      type: 'radio',
      key: 'open',
      label: '打开方式',
      initVal: card.open || 'blank',
      required: false,
      forbid: appType !== 'pc',
      options: [
        { value: 'blank', text: '新窗口' },
        { value: 'self', text: '当前窗口' }
      ]
    },
    {
      type: 'radio',
@@ -402,8 +374,7 @@
      label: '黑名单',
      initVal: card.blacklist || [],
      required: false,
      options: roleList,
      forbidden: appType === 'mob'
      options: roleList
    }
  ]
}