king
2024-06-01 c62724a2cdbafa3c660538955acbedafa5a01871
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))
        })
      }
    })
@@ -80,14 +83,26 @@
      label: '数据源',
      initval: wrap.publicId || '',
      required: true,
      options: interfaces
      options: interfaces,
      reset_source: true,
      callback: (record) => {
        if (!record.publicId) return
        let d = interfaces.filter(m => m.value === record.publicId)[0]
        if (!d || !d.columns) return
        return {
          field: d.columns
        }
      }
    },
    {
      type: 'select',
      field: 'field',
      label: '文本字段',
      initval: wrap.field || '',
      tooltip: '选择动态值时,需设置文本字段才可生效,使用公共数据源时,需先保存数据源后再选取文本字段。',
      timestamp: new Date().getTime(),
      required: false,
      options: columns
    },
@@ -138,7 +153,7 @@
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
      forbid: !appType || ispop || isprint
    },
    {
      type: 'multiselect',
@@ -147,7 +162,7 @@
      initval: wrap.blacklist || [],
      required: false,
      options: roleList,
      forbid: !!appType
      forbid: !!appType || isprint
    },
  ]