king
2022-01-03 ab744f965257e832d17869418bd96233bd63a756
2022-01-03
5个文件已修改
109 ■■■■ 已修改文件
src/components/normalform/modalform/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/tabs/antv-tabs/index.jsx 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/tabs/antv-tabs/options.jsx 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/data-card/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/tabs/antv-tabs/index.jsx 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/normalform/modalform/index.jsx
@@ -110,7 +110,7 @@
            cell.hidden = true
          }
        } else if (item.notNull) {
          cell.hidden = !supItem.initval
          cell.hidden = !supItem.initval || JSON.stringify(supItem.initval) === '[]'
        } else if (!item.values.includes(supItem.initval)) {
          cell.hidden = true
        }
@@ -180,7 +180,7 @@
              m.hidden = true
            }
          } else if (cell.notNull) {
            m.hidden = !val
            m.hidden = !val || JSON.stringify(val) === '[]'
          } else {
            m.hidden = !cell.values.includes(val)
          }
@@ -246,7 +246,7 @@
      } else if (item.type === 'fileupload') {
        content = (<MKFileUpload config={item} onChange={(val) => this.recordChange({[item.field]: val})} />)
      } else if (item.type === 'cascader') {
        content = (<Cascader allowClear={!!item.allowClear} options={item.options} expandTrigger="hover" placeholder="" />)
        content = (<Cascader allowClear={!!item.allowClear} onChange={(val) => this.recordChange({[item.field]: val}, item)} options={item.options} expandTrigger="hover" placeholder="" />)
      } else if (item.type === 'textarea') {
        content = (<TextArea rows={item.rows || 2} placeholder=""/>)
      } else if (item.type === 'mkicon') {
src/menu/components/tabs/antv-tabs/index.jsx
@@ -2,7 +2,7 @@
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Tabs, Popover, Modal } from 'antd'
import { PlusOutlined, CloseOutlined, EditOutlined, SearchOutlined, DeleteOutlined, FontColorsOutlined, ToolOutlined } from '@ant-design/icons'
import { PlusOutlined, CloseOutlined, EditOutlined, DeleteOutlined, FontColorsOutlined, ToolOutlined } from '@ant-design/icons'
import MKEmitter from '@/utils/events.js'
import asyncComponent from '@/utils/asyncComponent'
@@ -316,7 +316,8 @@
    editab.label = res.label
    editab.icon = res.icon
    editab.hasSearch = res.hasSearch || ''
    // editab.hasSearch = res.hasSearch || ''
    editab.controlVal = res.controlVal || ''
    editab.blacklist = res.blacklist
    if (editab.uuid) {
@@ -343,7 +344,7 @@
  getTabsForms = () => {
    const { tabs } = this.state
    return getTabsSetForm(tabs.setting)
    return getTabsSetForm(tabs.setting, tabs.uuid)
  }
  updateTabs = (res) => {
@@ -356,7 +357,7 @@
  }
  render() {
    const { tabs, appType, defaultActiveKey } = this.state
    const { tabs, defaultActiveKey } = this.state
    let _style = resetStyle(tabs.style)
    return (
@@ -376,8 +377,8 @@
                <span>{tab.icon ? <MkIcon type={tab.icon} /> : null}{tab.label}</span>
              </Popover>
            } key={tab.uuid}>
              {appType === 'mob' && tabs.setting.position === 'top' && tabs.setting.display === 'inline-block' && tab.hasSearch === 'icon' ?
                <SearchOutlined className="search-icon" onDoubleClick={() => this.setSearch(tab)}/> : null}
              {/* {appType === 'mob' && tabs.setting.position === 'top' && tabs.setting.display === 'inline-block' && tab.hasSearch === 'icon' ?
                <SearchOutlined className="search-icon" onDoubleClick={() => this.setSearch(tab)}/> : null} */}
              <TabComponents config={tab} handleList={this.updateTabComponent} deleteCard={this.deleteCard} />
            </TabPane>
          ))}
src/menu/components/tabs/antv-tabs/options.jsx
@@ -1,3 +1,5 @@
import MenuUtils from '@/utils/utils-custom.js'
/**
 * @description tab表单配置信息
 */
@@ -34,17 +36,27 @@
      allowClear: true,
      span: 22
    },
    // {
    //   type: 'radio',
    //   field: 'hasSearch',
    //   label: '搜索',
    //   initval: tab.hasSearch || 'false',
    //   required: false,
    //   options: [
    //     {value: 'false', label: '无'},
    //     {value: 'icon', label: '有'},
    //   ],
    //   forbid: appType !== 'mob' || setting.position !== 'top' || setting.display !== 'inline-block',
    //   span: 22
    // },
    {
      type: 'radio',
      field: 'hasSearch',
      label: '搜索',
      initval: tab.hasSearch || 'false',
      type: 'text',
      field: 'controlVal',
      label: '隐藏标记',
      initval: tab.controlVal || '',
      tooltip: '当禁用字段值与隐藏标记相等时,标签页会隐藏。',
      required: false,
      options: [
        {value: 'false', label: '无'},
        {value: 'icon', label: '有'},
      ],
      forbid: appType !== 'mob' || setting.position !== 'top' || setting.display !== 'inline-block',
      forbid: appType === 'mob',
      span: 22
    },
    {
@@ -65,9 +77,11 @@
/**
 * @description tabs表单配置信息
 */
export function getTabsSetForm(setting) {
export function getTabsSetForm(setting, uuid) {
  let appType = sessionStorage.getItem('appType')
  let roleList = sessionStorage.getItem('sysRoles')
  let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, uuid) || []
  if (roleList) {
    try {
@@ -165,6 +179,29 @@
      ]
    },
    {
      type: 'cascader',
      field: 'supModule',
      label: '上级组件',
      initval: setting.supModule || [],
      tooltip: '标签组可以选择上级组件,填入禁用字段,用于控制标签隐藏。',
      required: false,
      allowClear: true,
      options: modules,
      controlFields: [
        {field: 'controlField', notNull: true},
      ],
      forbid: appType === 'mob',
    },
    {
      type: 'text',
      field: 'controlField',
      label: '禁用字段',
      initval: setting.controlField || '',
      tooltip: '用于控制标签隐藏的字段,在标签中填入隐藏标记。',
      required: true,
      forbid: appType === 'mob',
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
src/tabviews/custom/components/card/data-card/index.jsx
@@ -671,12 +671,12 @@
        _selectKeys = selectKeys.filter(key => key !== index)
        _selectedData = selectedData.filter(cell => cell.key !== index)
        _activeKey = _selectKeys.slice(-1)[0]
        _item = selectedData.slice(-1)[0] || ''
        _item = _selectedData.slice(-1)[0] || ''
      } else if (selectKeys.indexOf(index) > -1) {
        _selectKeys = selectKeys.filter(key => key !== index)
        _selectedData = selectedData.filter(cell => cell.key !== index)
        _activeKey = activeKey
        _item = selectedData.filter(cell => cell.key === activeKey)[0] || ''
        _item = _selectedData.filter(cell => cell.key === activeKey)[0] || ''
      } else {
        _selectKeys = [...selectKeys, index]
        _selectedData = [...selectedData, item]
src/tabviews/custom/components/tabs/antv-tabs/index.jsx
@@ -29,8 +29,9 @@
  UNSAFE_componentWillMount () {
    const { config, bids } = this.props
    this.setState({
      tabs: config,
      tabs: fromJS(config).toJS(),
      parentIds: config.parentIds || [],
      bids: bids ? bids : {}
    })
@@ -61,15 +62,35 @@
  }
  resetParentParam = (MenuID, id, data) => {
    const { parentIds, bids } = this.state
    const { parentIds, bids, tabs } = this.state
    if (!parentIds.includes(MenuID)) return
    if (parentIds.includes(MenuID)) {
    this.setState({
      bids: {...bids, [MenuID]: id, [MenuID + '_data']: data}
    })
  }
    if (tabs.setting.supModule === MenuID) {
      if (!data || data[tabs.setting.controlField] === undefined) {
        this.setState({
          tabs: {...tabs, subtabs: this.props.config.subtabs}
        })
      } else {
        let val = data[tabs.setting.controlField]
        this.setState({
          tabs: {...tabs, subtabs: this.props.config.subtabs.filter(tab => {
            if (tab.controlVal === val) {
              return false
            } else if (/,/ig.test(tab.controlVal)) {
              return tab.controlVal.split(',').includes(val)
            }
            return true
          })}
        })
      }
    }
  }
  autoSwitch = (interval) => {
    const { tabs, activeIndex } = this.state