king
2024-07-15 f4b9504cad034ddcdef21c2081d14a4984fcd2d3
src/menu/components/editor/braft-editor/options.jsx
@@ -4,15 +4,18 @@
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 = []
  if (menu.interfaces) {
    menu.interfaces.forEach(item => {
      if (item.status === 'true') {
        interfaces.push({
          value: item.uuid,
          label: item.name
          label: item.name,
          columns: JSON.parse(JSON.stringify(item.columns))
        })
      }
    })
@@ -82,23 +85,15 @@
      required: true,
      options: interfaces,
      reset_source: true,
      callback: (map, record) => {
      callback: (record) => {
        if (!record.publicId) return
        let interfaces = window.GLOB.customMenu.interfaces || []
        let d = interfaces.filter(m => m.uuid === record.publicId && m.status === 'true')[0]
        let d = interfaces.filter(m => m.value === record.publicId)[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)
        return {
          field: d.columns
        }
      }
    },
@@ -107,6 +102,7 @@
      field: 'field',
      label: '文本字段',
      initval: wrap.field || '',
      timestamp: new Date().getTime(),
      required: false,
      options: columns
    },
@@ -157,7 +153,7 @@
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
      forbid: !appType || ispop || isprint
    },
    {
      type: 'multiselect',
@@ -166,7 +162,7 @@
      initval: wrap.blacklist || [],
      required: false,
      options: roleList,
      forbid: !!appType
      forbid: !!appType || isprint
    },
  ]