king
2022-08-02 8d66ff34fae5b048a6b7923cc75d34f13a08be9d
src/menu/components/card/balcony/options.jsx
@@ -1,3 +1,4 @@
import React from 'react'
import { fromJS } from 'immutable'
import MenuUtils from '@/utils/utils-custom.js'
@@ -8,11 +9,12 @@
  let modules = MenuUtils.getLinkModules(fromJS(window.GLOB.customMenu).toJS().components) || []
  let supmodules = MenuUtils.getSupModules(fromJS(window.GLOB.customMenu).toJS().components, '') || []
  let roleList = sessionStorage.getItem('sysRoles')
  let appType = sessionStorage.getItem('appType')
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
    } catch {
    } catch (e) {
      roleList = []
    }
  } else {
@@ -56,7 +58,12 @@
      field: 'linkType',
      label: '受控类型',
      initval: wrap.linkType || 'static',
      tooltip: '组件与其他组件之间的控制类型,独立表示与其他没有关联。',
      tooltip: <div>
        <div>组件与其他组件之间的控制类型: </div>
        <div>1、独立表示与其他组件没有关联。</div>
        <div>2、同步类型中公式、按钮以及全选元素比较特殊,操作数据为其同步组件的数据。</div>
        <div>3、上级类型需添加当前组件的上级组件,并可设置当前组件为始终显示,还是只有在上级组件选行后才显示。</div>
      </div>,
      required: false,
      options: [
        {value: 'static', label: '独立'},
@@ -74,7 +81,8 @@
      type: 'cascader',
      field: 'supModule',
      label: '上级组件',
      initval: wrap.supModule || '',
      initval: wrap.supModule || [],
      // tooltip: '当上级组件不存在或没有权限时,当前组件不显示。',
      required: true,
      options: supmodules
    },
@@ -82,8 +90,8 @@
      type: 'radio',
      field: 'supControl',
      label: '显示控制',
      tooltip: '当前组件在主表选中行时显示,还是始终显示。',
      initval: wrap.supControl || 'show',
      tooltip: '当前组件在主表选中行时显示,还是始终显示。',
      required: false,
      options: [
        {value: 'hidden', label: '选行'},
@@ -95,6 +103,7 @@
      field: 'syncModule',
      label: '同步组件',
      initval: wrap.syncModule || '',
      tooltip: '当同步组件不存在或没有权限时,当前组件不显示。',
      required: true,
      options: modules
    },
@@ -115,20 +124,17 @@
      field: 'position',
      label: '位置',
      initval: wrap.position || 'relative',
      tooltip: '使用固定定位时,请在测试环境中查看定位效果。',
      tooltip: '相对定位是相对其正常位置的偏移;绝对定位是相对于原组件的偏移,原组件高度可视为0;固定定位是相对于窗口的位置,定位效果测试环境中查看。',
      required: false,
      options: [
        {value: 'relative', label: '相对定位'},
        {value: 'absolute', label: '绝对定位'},
        {value: 'fixed', label: '固定定位'},
      ],
      controlFields: [
        {field: 'quick', values: ['fixed']},
        {field: 'top', values: ['fixed']},
        {field: 'right', values: ['fixed']},
        {field: 'bottom', values: ['fixed']},
        {field: 'left', values: ['fixed']},
        {field: 'realwidth', values: ['fixed']},
        {field: 'transform', values: ['fixed']},
        {field: 'realwidth', values: ['fixed', 'absolute']},
        {field: 'transform', values: ['fixed', 'absolute']},
      ]
    },
    {
@@ -203,12 +209,25 @@
      ]
    },
    {
      type: 'radio',
      field: 'permission',
      label: '权限验证',
      initval: wrap.permission || 'false',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !appType
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
      initval: wrap.blacklist || '',
      initval: wrap.blacklist || [],
      required: false,
      options: roleList
      options: roleList,
      forbid: !!appType
    },
  ]