king
2021-11-18 c98e45bfac25e9110ad0383faac54a54d98ea9d5
src/menu/components/card/data-card/options.jsx
@@ -1,12 +1,20 @@
import { fromJS } from 'immutable'
import MenuUtils from '@/utils/utils-custom.js'
/**
 * @description Wrap表单配置信息
 */
export default function (wrap, subtype, columns) {
export default function (wrap, subtype, columns, id) {
  let appType = sessionStorage.getItem('appType')
  let MenuType = ''
  let menu = fromJS(window.GLOB.customMenu).toJS()
  if (window.GLOB.customMenu.parentId === 'BillPrintTemp') {
  if (menu.parentId === 'BillPrintTemp') {
    MenuType = 'billPrint'
  }
  let modules = []
  if (subtype === 'propcard') {
    modules = MenuUtils.getSupModules(menu.components, id) || []
  }
  let roleList = sessionStorage.getItem('sysRoles')
@@ -59,6 +67,10 @@
        {value: 'dynamic', label: '动态'},
        {value: 'static', label: '静态'},
      ],
      controlFields: [
        {field: 'goback', values: ['dynamic']},
        {field: 'supModule', values: ['static']},
      ],
      forbid: subtype !== 'propcard'
    },
    {
@@ -66,7 +78,7 @@
      field: 'pagestyle',
      label: '分页风格',
      initval: wrap.pagestyle || 'page',
      tooltip: '数据源选择分页时有效。',
      tooltip: '数据源选择分页时有效。注:滑动加载只有第一个有效',
      required: false,
      options: [
        {value: 'page', label: '页码'},
@@ -84,7 +96,7 @@
      options: [
        {value: '', label: '不可选'},
        {value: 'radio', label: '单选'},
        {value: 'checkbox', label: '多选', forbid: subtype === 'propcard'},
        {value: 'checkbox', label: '多选', disabled: subtype === 'propcard'},
      ],
      controlFields: [
        {field: 'checkAll', values: ['checkbox']},
@@ -101,7 +113,7 @@
      options: [
        {value: 'false', label: '无'},
        {value: 'init', label: '初始化'},
        {value: 'always', label: '数据加载', forbid: subtype === 'propcard'},
        {value: 'always', label: '数据加载', disabled: subtype === 'propcard'},
      ]
    },
    {
@@ -167,6 +179,29 @@
      forbid: !columns || appType !== 'mob'
    },
    {
      type: 'radio',
      field: 'goback',
      label: '空值返回',
      initval: wrap.goback || 'false',
      tooltip: '当查询数据为空时,返回上一界面。',
      required: false,
      options: [
        {value: 'true', label: '是'},
        {value: 'false', label: '否'},
      ],
      forbid: subtype !== 'propcard' || appType !== 'mob'
    },
    {
      type: 'cascader',
      field: 'supModule',
      label: '上级组件',
      initval: wrap.supModule || [],
      required: false,
      options: modules,
      allowClear: true,
      forbid: subtype !== 'propcard'
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
@@ -178,7 +213,7 @@
  ]
  return cardWrapForm.map(item => {
    if (['pagestyle', 'cardType', 'selected'].includes(item.field)) {
    if (['pagestyle'].includes(item.field)) {
      item.options = item.options.filter(option => !option.forbid)
    }