king
2021-08-04 abe961768cb069e84ed958f4c768c512cc3db598
src/menu/components/card/balcony/options.jsx
@@ -1,12 +1,30 @@
import { fromJS } from 'immutable'
import MenuUtils from '@/utils/utils-custom.js'
/**
 * @description Wrap表单配置信息
 */
export const balconyWrapForm = [
export default function (wrap) {
  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')
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
    } catch {
      roleList = []
    }
  } else {
    roleList = []
  }
  const balconyWrapForm = [
  {
    type: 'text',
    field: 'name',
    label: '组件名称',
    initval: '',
      initval: wrap.name || '',
    tooltip: '用于组件间的区分。',
    required: true
  },
@@ -14,7 +32,7 @@
    type: 'number',
    field: 'width',
    label: '宽度',
    initval: '',
      initval: wrap.width || 24,
    tooltip: '栅格布局,每行等分为24列。',
    min: 1,
    max: 24,
@@ -25,7 +43,7 @@
    type: 'radio',
    field: 'datatype',
    label: '数据来源',
    initval: '',
      initval: wrap.datatype || 'static',
    tooltip: '选择静态值,无需配置数据源。',
    required: false,
    options: [
@@ -37,7 +55,7 @@
    type: 'radio',
    field: 'linkType',
    label: '受控类型',
    initval: 'static',
      initval: wrap.linkType || 'static',
    tooltip: '组件与其他组件之间的控制类型,独立表示与其他没有关联。',
    required: false,
    options: [
@@ -56,16 +74,16 @@
    type: 'cascader',
    field: 'supModule',
    label: '上级组件',
    initval: '',
      initval: wrap.supModule || '',
    required: true,
    options: []
      options: supmodules
  },
  {
    type: 'radio',
    field: 'supControl',
    label: '显示控制',
    tooltip: '当前组件在主表选中行时显示,还是始终显示。',
    initval: 'show',
      initval: wrap.supControl || 'show',
    required: false,
    options: [
      {value: 'hidden', label: '选行'},
@@ -76,15 +94,15 @@
    type: 'cascader',
    field: 'syncModule',
    label: '同步组件',
    initval: '',
      initval: wrap.syncModule || '',
    required: true,
    options: []
      options: modules
  },
  {
    type: 'radio',
    field: 'checkAll',
    label: '全选',
    initval: 'hidden',
      initval: wrap.checkAll || 'hidden',
    tooltip: '当同步组件可多选时,设置全选有效。',
    required: false,
    options: [
@@ -96,7 +114,7 @@
    type: 'radio',
    field: 'position',
    label: '位置',
    initval: 'relative',
      initval: wrap.position || 'relative',
    tooltip: '使用固定定位时,请在测试环境中查看定位效果。',
    required: false,
    options: [
@@ -136,42 +154,42 @@
    type: 'styleInput',
    field: 'top',
    label: '距上',
    initval: '',
      initval: wrap.top || '',
    required: false
  },
  {
    type: 'styleInput',
    field: 'right',
    label: '距右',
    initval: '',
      initval: wrap.right || '',
    required: false
  },
  {
    type: 'styleInput',
    field: 'bottom',
    label: '距下',
    initval: '',
      initval: wrap.bottom || '',
    required: false
  },
  {
    type: 'styleInput',
    field: 'left',
    label: '距左',
    initval: '',
      initval: wrap.left || '',
    required: false
  },
  {
    type: 'styleInput',
    field: 'realwidth',
    label: '实际宽度',
    initval: '',
      initval: wrap.realwidth || '',
    required: false
  },
  {
    type: 'select',
    field: 'transform',
    label: '变换',
    initval: '',
      initval: wrap.transform || '',
    required: false,
    options: [
      {value: 'translateY(-50%)', label: '上移50%'},
@@ -188,8 +206,11 @@
    type: 'multiselect',
    field: 'blacklist',
    label: '黑名单',
    initval: '',
      initval: wrap.blacklist || '',
    required: false,
    options: []
      options: roleList
  },
]
  return balconyWrapForm
}