king
2023-07-05 f45b2ad61211cf2821cdaab07676c7906c96410a
src/menu/components/calendar/options.jsx
@@ -1,3 +1,4 @@
import React from 'react'
/**
 * @description Wrap表单配置信息
 */
@@ -15,7 +16,18 @@
    roleList = []
  }
  const balconyWrapForm = [
  let menulist = sessionStorage.getItem('fstMenuList')
  if (menulist) {
    try {
      menulist = JSON.parse(menulist)
    } catch (e) {
      menulist = []
    }
  } else {
    menulist = []
  }
  const calendarWrapForm = [
    {
      type: 'text',
      field: 'title',
@@ -43,123 +55,52 @@
      required: true
    },
    {
      type: 'radio',
      field: 'direction',
      label: '轴线方向',
      initval: wrap.direction || 'vertical',
      required: false,
      type: 'checkbox',
      field: 'levels',
      label: '日历等级',
      initval: wrap.levels || [],
      required: true,
      options: [
        {value: 'vertical', label: '纵向'},
        {value: 'horizontal', label: '横向'},
      ],
      controlFields: [
        {field: 'mode', values: ['vertical']},
        {field: 'hmode', values: ['horizontal']},
        {field: 'label', values: ['vertical']},
        {field: 'iconSize', values: ['horizontal']},
        {field: 'dotSign', values: ['horizontal']},
      ]
    },
    {
      type: 'radio',
      field: 'mode',
      label: '轴线位置',
      initval: ['left', 'alternate', 'right'].includes(wrap.mode) ? wrap.mode : 'left',
      required: false,
      options: [
        {value: 'left', label: '左侧'},
        {value: 'alternate', label: '中间'},
        {value: 'right', label: '右侧'},
      ]
    },
    {
      type: 'radio',
      field: 'hmode',
      label: '轴线位置',
      initval: ['up', 'down'].includes(wrap.mode) ? wrap.mode : 'up',
      required: false,
      options: [
        {value: 'up', label: '上侧'},
        {value: 'down', label: '下侧'}
      ]
    },
    // {
    //   type: 'radio',
    //   field: 'reverse',
    //   label: '排序',
    //   initval: wrap.reverse || 'false',
    //   required: false,
    //   options: [
    //     {value: 'false', label: '正序'},
    //     {value: 'true', label: '倒序'},
    //   ]
    // },
    {
      type: 'color',
      field: 'color',
      label: '节点颜色',
      initval: wrap.color || '#1890ff',
      tooltip: '节点默认颜色。',
      required: false
    },
    {
      type: 'radio',
      field: 'line',
      label: '连线颜色',
      initval: wrap.line || '',
      required: false,
      options: [
        {value: '', label: '默认'},
        {value: 'system', label: '系统色'},
      ]
    },
    {
      type: 'radio',
      field: 'dotSign',
      label: '节点渲染',
      initval: wrap.dotSign || 'background',
      tooltip: '节点的渲染方式,在节点组中设置的颜色渲染图标还是渲染背景色。',
      required: false,
      options: [
        {value: 'background', label: '背景色'},
        {value: 'icon', label: '图标'},
        {value: 'day', label: '天'},
        {value: 'month', label: '月'},
      ]
    },
    {
      type: 'select',
      field: 'iconSize',
      label: '图标大小',
      initval: wrap.iconSize || '',
      tooltip: '图标可在节点组中添加。',
      required: false,
      options: [
        {value: '', label: '默认(14px)'},
        {value: 'size16', label: '16px'},
        {value: 'size18', label: '18px'},
        {value: 'size20', label: '20px'},
        {value: 'size22', label: '22px'},
        {value: 'size24', label: '24px'},
        {value: 'adaptive', label: '自适应'},
      ]
      field: 'timeField',
      label: '时间字段',
      initval: wrap.timeField || '',
      tooltip: '数据中的时间字段,用于在日历中标记事件位置。',
      required: true,
      options: columns
    },
    {
      type: 'select',
      field: 'label',
      label: '标签',
      initval: wrap.label || '',
      tooltip: '在内容对面单独展示。',
      required: false,
      options: columns,
      forbid: !appType
    },
    {
      type: 'select',
      field: 'node',
      label: '节点控制',
      initval: wrap.node || '',
      tooltip: '选择自定义节点的控制字段后,在节点组中添加节点样式。',
      field: 'endField',
      label: '结束时间',
      initval: wrap.endField || '',
      tooltip: '数据中事件的结束时间,用于在日历中标记事件位置。',
      required: false,
      options: columns
    },
    {
      type: 'select',
      field: 'remarkField',
      label: '信息字段',
      initval: wrap.remarkField || '',
      required: true,
      options: columns
    },
    {
      type: 'select',
      field: 'colorField',
      label: '颜色字段',
      initval: wrap.colorField || '',
      required: false,
      options: columns,
      controlFields: [
        {field: 'signs', notNull: true},
      ]
    },
    {
      type: 'radio',
@@ -175,16 +116,38 @@
    },
    {
      type: 'radio',
      field: 'empty',
      label: '空值隐藏',
      initval: wrap.empty || 'show',
      tooltip: '当查询数据为空时,隐藏该组件。',
      field: 'click',
      label: '点击事件',
      initval: wrap.click || '',
      tooltip: '可通过点击事件跳转至指定页面。',
      required: false,
      skip: true,
      options: [
        {value: 'show', label: '否'},
        {value: 'hidden', label: '是'},
        {value: '', label: '无'},
        {value: 'menu', label: '菜单'},
        {value: 'menus', label: '菜单组'}
      ],
      controlFields: [
        {field: 'menu', values: ['menu']},
        {field: 'menuType', values: ['menus']},
        {field: 'menus', values: ['menus']},
      ]
    },
    {
      type: 'select',
      field: 'menuType',
      label: '菜单类型',
      initval: wrap.menuType || '',
      required: true,
      options: columns,
    },
    {
      type: 'cascader',
      field: 'menu',
      label: '关联菜单',
      initval: wrap.menu || [],
      required: true,
      extendName: 'MenuNo',
      options: menulist,
    },
    {
      type: 'multiselect',
@@ -195,7 +158,66 @@
      options: roleList,
      forbid: !!appType
    },
    {
      type: 'table',
      field: 'signs',
      label: '颜色标识',
      initval: wrap.signs || [],
      required: false,
      span: 24,
      columns: [
        {
          title: '标识',
          dataIndex: 'sign',
          inputType: 'input',
          editable: true,
          unique: true,
          required: false,
          width: '30%'
        },
        {
          title: '颜色',
          dataIndex: 'background',
          inputType: 'color',
          editable: true,
          required: true,
          render: (text, record) => (<div style={{background: text, width: '100px', height: '25px'}}></div>),
          width: '40%'
        }
      ]
    },
    {
      type: 'table',
      field: 'menus',
      label: '菜单组',
      initval: wrap.menus || [],
      required: true,
      span: 24,
      actions: ['view'],
      columns: [
        {
          title: '标识',
          dataIndex: 'sign',
          inputType: 'input',
          editable: true,
          unique: true,
          required: false,
          width: '30%'
        },
        {
          title: '菜单',
          dataIndex: 'menu',
          inputType: 'cascader',
          editable: true,
          required: true,
          extends: 'Menu',
          width: '40%',
          render: (text, record) => record.label,
          options: menulist
        }
      ]
    },
  ]
  return balconyWrapForm
  return calendarWrapForm