king
2023-12-12 49f09cc6f8ff8c30a75ed1a9d6f510b69b73962a
src/menu/components/editor/braft-editor/options.jsx
@@ -4,6 +4,8 @@
export default function (wrap, columns) {
  let appType = sessionStorage.getItem('appType')
  let roleList = sessionStorage.getItem('sysRoles')
  let isprint = sessionStorage.getItem('MenuType') === 'billPrint'
  let ispop = sessionStorage.getItem('editMenuType') === 'popview'
  let menu = window.GLOB.customMenu
  let interfaces = []
@@ -80,14 +82,33 @@
      label: '数据源',
      initval: wrap.publicId || '',
      required: true,
      options: interfaces
      options: interfaces,
      reset_source: true,
      callback: (map, record) => {
        if (!record.publicId) return
        let interfaces = window.GLOB.customMenu.interfaces || []
        let d = interfaces.filter(m => m.uuid === record.publicId && m.status === 'true')[0]
        if (!d || !d.columns) return
        let columns = JSON.parse(JSON.stringify(d.columns))
        let _field = map.get('field')
        if (_field) {
          _field.options = columns
          _field.oriOptions = columns
          map.set('field', _field)
        }
      }
    },
    {
      type: 'select',
      field: 'field',
      label: '文本字段',
      initval: wrap.field || '',
      tooltip: '选择动态值时,需设置文本字段才可生效,使用公共数据源时,需先保存数据源后再选取文本字段。',
      required: false,
      options: columns
    },
@@ -118,6 +139,18 @@
    },
    {
      type: 'radio',
      field: 'firstTr',
      label: '表格首行',
      initval: wrap.firstTr || 'deep',
      tooltip: '富文本中table的首行背景颜色。',
      required: false,
      options: [
        {value: 'deep', label: '深色'},
        {value: 'light', label: '浅色'},
      ]
    },
    {
      type: 'radio',
      field: 'permission',
      label: '权限验证',
      initval: wrap.permission || 'false',
@@ -126,7 +159,7 @@
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
      forbid: !appType || ispop || isprint
    },
    {
      type: 'multiselect',
@@ -135,7 +168,7 @@
      initval: wrap.blacklist || [],
      required: false,
      options: roleList,
      forbid: !!appType
      forbid: !!appType || isprint
    },
  ]