king
2020-05-18 ff4295358a99b2d35265a5fed445e4407cf6ed9a
2020-05-18
12个文件已修改
220 ■■■■■ 已修改文件
src/components/sidemenu/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/index.jsx 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/index.jsx 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/cardcomponent/dragdetail/index.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/cardcomponent/index.jsx 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/columncomponent/index.jsx 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/settingform/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/tabscomponent/index.jsx 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/index.jsx
@@ -30,7 +30,7 @@
  state = {
    dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS,
    mainMenuList: null,      // 一级菜单,编辑调整上级菜单时获取
    subMenulist: null,       // 二级菜单
    subMenulist: [],         // 二级菜单
    editMenu: null,          // 编辑三级菜单时设置
    rootSubmenuKeys: null,
    createThirdMenu: false,
@@ -41,7 +41,7 @@
  async loadsubmenu (menu) {
    if (!menu || !menu.MenuID) { // 没有主菜单时,清空下级菜单
      this.setState({
        subMenulist: null,
        subMenulist: [],
        rootSubmenuKeys: [],
        openKeys: [],
        editMenu: null
@@ -61,7 +61,7 @@
      
      if (result.data.length === 0) { // 查询菜单为空
        this.setState({
          subMenulist: null,
          subMenulist: [],
          rootSubmenuKeys: [],
          openKeys: []
        })
src/index.js
@@ -95,7 +95,7 @@
if (process.env.NODE_ENV === 'production') { // 用于校验是否存在开发权限
  window.GLOB.linkurl = window.location.href.split('#')[0]
} else {
  window.GLOB.linkurl = 'http://qingqiumarket.cn/MKWMS/Index.html'
  window.GLOB.linkurl = ''
}
src/templates/comtableconfig/index.jsx
@@ -82,7 +82,7 @@
    if (!_LongParam) {
      _config = fromJS(Source.baseConfig).toJS()
      if (!menu.isSubtable) { // 不是选择主子表时,隐藏标签页
        _config.tabs = []
        _config.tabgroups = [{ uuid: 'tabs', sublist: [] }]
      }
      _config.isAdd = true
    } else {
@@ -105,7 +105,6 @@
    }
    // 配置默认值,兼容
    _config.tabs = _config.tabs || []
    _config.Template = 'CommonTable'
    _config.easyCode = _config.easyCode || ''
src/templates/formtabconfig/index.jsx
@@ -905,9 +905,7 @@
        if (config.groups[0] && config.groups[0].sublist[0] && config.groups[0].sublist[0].origin) {
          config.groups[0].sublist = config.groups[0].sublist.filter(item => !item.origin)
        }
        if (config.tabs[0] && config.tabs[0].origin) {
          config.tabs = config.tabs.filter(item => !item.origin)
        }
        config.tabgroups[0].sublist = config.tabgroups[0].sublist.filter(item => !item.origin)
      }
      let btnNames = config.action.map(item => item.label)
src/templates/sharecomponent/actioncomponent/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { is, fromJS } from 'immutable'
import { Icon, Tooltip, Modal, notification, Button } from 'antd'
import moment from 'moment'
@@ -63,6 +63,8 @@
    if (nextProps.pasteContent && nextProps.pasteContent.copyType === 'action') {
      this.setState({actionlist: [...actionlist, nextProps.pasteContent]})
      this.handleAction(nextProps.pasteContent)
    } else if (!is(fromJS(nextProps.config.action), fromJS(this.props.config.action)) && !is(fromJS(nextProps.config.action), fromJS(actionlist))) {
      this.setState({actionlist: fromJS(nextProps.config.action).toJS()})
    }
  }
@@ -76,8 +78,9 @@
      this.setState({actionlist: list})
      this.handleAction(card)
    } else {
      this.setState({actionlist: list})
      this.props.updateaction({...config, action: list})
      this.setState({actionlist: list}, () => {
        this.props.updateaction({...config, action: list})
      })
    }
  }
@@ -349,9 +352,9 @@
          actionlist: _actionlist,
          copying: false,
          visible: false
        }, () => {
          this.props.updateaction({...config, action: _actionlist, gridBtn: _gridBtn}, copyActionId)
        })
        this.props.updateaction({...config, action: _actionlist, gridBtn: _gridBtn}, copyActionId)
      })
    })
  }
@@ -549,10 +552,6 @@
        _actionlist = _actionlist.filter(item => item.uuid !== card.uuid)
        _this.setState({
          actionlist: _actionlist
        })
        let _hasGridbtn = _actionlist.filter(act => act.position === 'grid').length > 0
        let _gridBtn = config.gridBtn ? fromJS(config.gridBtn).toJS() : null
@@ -577,7 +576,11 @@
          card: card
        }
        _this.props.updateaction({...config, action: _actionlist, gridBtn: _gridBtn}, '', delcard)
        _this.setState({
          actionlist: _actionlist
        }, () => {
          _this.props.updateaction({...config, action: _actionlist, gridBtn: _gridBtn}, '', delcard)
        })
      },
      onCancel() {}
    })
@@ -616,8 +619,9 @@
      this.setState({
        actionlist: _actionlist,
        profVisible: false
      }, () => {
        this.props.updateaction({...config, action: _actionlist})
      })
      this.props.updateaction({...config, action: _actionlist})
    })
  }
@@ -785,9 +789,9 @@
          this.setState({
            actionlist: _actionlist
          }, () => {
            this.props.updateaction({...config, action: _actionlist, gridBtn: _gridBtn})
          })
          this.props.updateaction({...config, action: _actionlist, gridBtn: _gridBtn})
        })
      })
    })
src/templates/sharecomponent/cardcomponent/dragdetail/index.jsx
@@ -5,8 +5,8 @@
import Card from './card'
import './index.scss'
const Container = ({list, handleList, handleMenu, deleteMenu }) => {
  const [cards, setCards] = useState(list)
const Container = ({cardObj, handleList, handleMenu, deleteMenu }) => {
  const [cards, setCards] = useState(cardObj.details)
  const moveCard = (id, atIndex) => {
    const { card, index } = findCard(id)
    const _cards = update(cards, { $splice: [[index, 1], [atIndex, 0, card]] })
@@ -14,8 +14,8 @@
    handleList(_cards)
  }
  if (!is(fromJS(cards), fromJS(list))) {
    setCards(list)
  if (!is(fromJS(cards), fromJS(cardObj.details))) {
    setCards(cardObj.details)
  }
  
  const findCard = id => {
@@ -30,8 +30,13 @@
    accept: 'detail'
  })
  let marginLeft = 0
  if (cardObj.subelement.includes('avatar')) {
    marginLeft = 48
  }
  return (
    <div ref={drop} className="ant-card-meta-detail" style={{marginLeft: 48}}>
    <div ref={drop} className="ant-card-meta-detail" style={{marginLeft: marginLeft}}>
      {cards.map(card => (
        <Card
          key={card.uuid}
src/templates/sharecomponent/cardcomponent/index.jsx
@@ -142,6 +142,10 @@
  render() {
    const { card } = this.props
    const { dict, visible, cardcell } = this.state
    let _width = '100%'
    if (card.actions.length > 0) {
      _width = Math.floor((100 / card.actions.length) * 10000) / 10000 + '%'
    }
    return (
      <div className="line-card-edit-box">
@@ -150,47 +154,46 @@
          className={'ant-card ant-card-bordered chart-card' + (card.widthType === 'ratio' ? ' ant-col ant-col-' + card.cardWidth : '')}
          style={card.widthType === 'absolute' ? { width: card.cardWidth } : null}
        >
          <div className="ant-card-head">
            <div className="ant-card-head-wrapper">
              <div className="ant-card-head-title">Card Title</div>
              <div className="ant-card-extra">
                <span>Action</span>
          {card.subelement.includes('header') ?
            <div className="ant-card-head">
              <Icon className="edit" title="Edit" type="edit" onClick={this.editHeader} />
              <div className="ant-card-head-wrapper">
                <div className="ant-card-head-title">{card.header.title.content}</div>
                <div className="ant-card-extra">
                  <span>Action</span>
                </div>
              </div>
            </div>
          </div>
          <div className="ant-card-body">
            </div> : null
          }
          {card.subelement.includes('content') ? <div className="ant-card-body">
            <div className="ant-card-meta">
              <Icon type="plus" onClick={() => this.editdetail()} />
              {card.cardType === 'card2' ? <div className="ant-card-meta-avatar">
                <span className="ant-avatar ant-avatar-circle ant-avatar-image" style={{width: 32, height: 32}}>
                  <img src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" alt=""/>
                </span>
              </div> : null }
              {card.subelement.includes('avatar') ?
                <div className="ant-card-meta-avatar">
                  <Icon className="edit" title="Edit" type="edit" onClick={this.editAvatar} />
                  <span className="ant-avatar ant-avatar-circle ant-avatar-image" style={{width: 32, height: 32}}>
                    <img src={card.avatar.content || 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'} alt=""/>
                  </span>
                </div> : null
              }
              <DragDetail
                list={card.details}
                cardObj={card}
                handleList={this.handleList}
                handleMenu={this.editdetail}
                deleteMenu={this.deletedetail}
              />
            </div>
          </div>
          {card.cardType === 'card2' ? <ul className="ant-card-actions">
            <li style={{width: '33.3333%'}}>
              <span>
                <Icon type="setting"/>
              </span>
            </li>
            <li style={{width: '33.3333%'}}>
              <span>
                <Icon type="edit"/>
              </span>
            </li>
            <li style={{width: '33.3333%'}}>
              <span>
                <Icon type="edit"/>
              </span>
            </li>
          </ul> : null}
          </div> : null}
          {card.subelement.includes('actions') ?
            <ul className="ant-card-actions">
              <Icon className="edit" title="Edit" type="edit" onClick={this.editAction} />
              {card.actions.map(item => (<li style={{width: _width}}>
                <span>
                  <Icon type={item.icon || 'dash'}/>
                </span>
              </li>))}
            </ul> : null
          }
        </div>
        {/* 显示列编辑 */}
        <Modal
src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx
@@ -111,17 +111,17 @@
    {
      uuid: 'card1',
      url: card1,
      type: 'card1'
      subelement: ['content']
    },
    {
      uuid: 'card2',
      url: card2,
      type: 'card2'
      subelement: ['content', 'avatar']
    },
    {
      uuid: 'card3',
      url: card3,
      type: 'card3'
      subelement: ['content', 'avatar', 'header', 'actions']
    }
  ]
}
@@ -417,7 +417,7 @@
              result.Yaxis = result.Yaxis[0] || ''
            }
          } else if (result.chartType === 'card') {
            result.cardType = selectlegend.type
            result.subelement = selectlegend.subelement
            if (!result.details) {
              result.details = [
@@ -425,7 +425,11 @@
                {bold: 'false', uuid: 'carddescription', content: 'Card content', datatype: 'static', align: 'left'}
              ]
              result.actions = []
              result.title = ''
              result.header = {
                title: {content: 'Card title', datatype: 'static'},
                actions: []
              }
              result.avatar = {content: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png', datatype: 'static', width: 32, height: 32}
            }
          }
src/templates/sharecomponent/columncomponent/index.jsx
@@ -60,7 +60,7 @@
    ) {
      this.setState({columnlist: nextProps.pasteContent.columns})
    } else if (!is(fromJS(nextProps.config.columns), fromJS(this.props.config.columns)) && !is(fromJS(nextProps.config.columns), fromJS(columnlist))) {
      this.setState({columnlist: nextProps.config.columns})
      this.setState({columnlist: fromJS(nextProps.config.columns).toJS()})
    }
  }
@@ -74,8 +74,9 @@
      this.setState({columnlist: list})
      this.handleColumn(card)
    } else {
      this.setState({columnlist: list})
      this.props.updatecolumn({...config, columns: list})
      this.setState({columnlist: list}, ()=> {
        this.props.updatecolumn({...config, columns: list})
      })
    }
  }
@@ -280,8 +281,9 @@
          card: null,
          columnlist: _columnlist,
          modaltype: ''
        }, ()=> {
          this.props.updatecolumn({...config, columns: _columnlist})
        })
        this.props.updatecolumn({...config, columns: _columnlist})
      })
    } else if (modaltype === 'gridbtn') {
      this.gridBtnFormRef.handleConfirm().then(res => {
@@ -330,8 +332,9 @@
        _this.setState({
          columnlist: _columnlist
        }, ()=> {
          _this.props.updatecolumn({...config, columns: _columnlist})
        })
        _this.props.updatecolumn({...config, columns: _columnlist})
      },
      onCancel() {}
    })
@@ -417,9 +420,9 @@
      card: null,
      columnlist: _columnlist,
      modaltype: ''
    }, ()=> {
      this.props.updatecolumn({...config, columns: _columnlist})
    })
    this.props.updatecolumn({...config, columns: _columnlist})
  }
  /**
src/templates/sharecomponent/searchcomponent/index.jsx
@@ -53,7 +53,7 @@
      this.setState({searchlist: [...searchlist, nextProps.pasteContent]})
      this.handleSearch(nextProps.pasteContent)
    } else if (!is(fromJS(nextProps.config.search), fromJS(this.props.config.search)) && !is(fromJS(nextProps.config.search), fromJS(searchlist))) {
      this.setState({searchlist: nextProps.config.search})
      this.setState({searchlist: fromJS(nextProps.config.search).toJS()})
    }
  }
@@ -67,8 +67,9 @@
      this.setState({searchlist: list})
      this.handleSearch(card)
    } else {
      this.setState({searchlist: list})
      this.props.updatesearch({...config, search: list})
      this.setState({searchlist: list}, ()=> {
        this.props.updatesearch({...config, search: list})
      })
    }
  }
@@ -212,8 +213,9 @@
              sqlVerifing: false,
              searchlist: _searchlist,
              visible: false
            }, ()=> {
              this.props.updatesearch({...config, search: _searchlist}, optionLibs)
            })
            this.props.updatesearch({...config, search: _searchlist}, optionLibs)
          } else {
            this.setState({sqlVerifing: false})
            
@@ -226,8 +228,9 @@
        this.setState({
          searchlist: _searchlist,
          visible: false
        }, ()=> {
          this.props.updatesearch({...config, search: _searchlist}, optionLibs)
        })
        this.props.updatesearch({...config, search: _searchlist}, optionLibs)
      }
    })
  }
src/templates/sharecomponent/settingcomponent/settingform/index.jsx
@@ -350,12 +350,14 @@
        })
      }
      // 数据源处理
      if (/\s/.test(_dataresource)) {
        _dataresource = '(' + _dataresource + ') tb'
      }
      // 数据源处理, 存在显示列时
      if (arr_field) {
        if (/\s/.test(_dataresource)) {
          _dataresource = '(' + _dataresource + ') tb'
        }
      _dataresource = `select ${_setting.laypage !== 'false' ?  'top 10' : ''} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_setting.order}) as rows from ${_dataresource}) tmptable ${_setting.laypage !== 'false' ?  'where rows > 0' : ''} order by tmptable.rows`
        _dataresource = `select ${_setting.laypage !== 'false' ?  'top 10' : ''} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_setting.order}) as rows from ${_dataresource}) tmptable ${_setting.laypage !== 'false' ?  'where rows > 0' : ''} order by tmptable.rows`
      }
      if (_setting.queryType === 'statistics') {
        regoptions.forEach(item => {
src/templates/sharecomponent/tabscomponent/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { is, fromJS } from 'immutable'
import { Icon, Tooltip, Modal, notification } from 'antd'
import Utils from '@/utils/utils.js'
@@ -43,6 +43,17 @@
  }
  /**
   * @description 标签组变化时,更新标签
   */
  UNSAFE_componentWillReceiveProps (nextProps) {
    const { tabgroups } = this.state
    if (!is(fromJS(nextProps.config.tabgroups), fromJS(this.props.config.tabgroups)) && !is(fromJS(nextProps.config.tabgroups), fromJS(tabgroups))) {
      this.setState({tabgroups: fromJS(nextProps.config.tabgroups).toJS()})
    }
  }
  /**
   * @description 元素添加或拖动时顺序变化
   */
  handleList = (list, card, groupId) => {
@@ -62,8 +73,9 @@
      this.setState({tabgroups: _tabgroups})
      this.handleTab(card, _group)
    } else {
      this.setState({tabgroups: _tabgroups})
      this.props.updatetabs({...config, tabgroups: _tabgroups})
      this.setState({tabgroups: _tabgroups}, () => {
        this.props.updatetabs({...config, tabgroups: _tabgroups})
      })
    }
  }
@@ -169,8 +181,9 @@
        group: null,
        tabgroups: tabgroups, 
        visible: false
      }, () => {
        this.props.updatetabs({...config, tabgroups: tabgroups})
      })
      this.props.updatetabs({...config, tabgroups: tabgroups})
    })
  }
  
@@ -196,8 +209,9 @@
        _this.setState({
          tabgroups: tabgroups
        }, () => {
          _this.props.updatetabs({...config, tabgroups: tabgroups}, [card])
        })
        _this.props.updatetabs({...config, tabgroups: tabgroups}, [card])
      },
      onCancel() {}
    })
@@ -229,8 +243,9 @@
        _this.setState({
          tabgroups: _tabgroups
        }, () => {
          _this.props.updatetabs({...config, tabgroups: _tabgroups})
        })
        _this.props.updatetabs({...config, tabgroups: _tabgroups})
      },
      onCancel() {}
    })
@@ -249,13 +264,13 @@
      okText: this.state.dict['model.confirm'],
      cancelText: this.state.dict['header.cancel'],
      onOk() {
        _tabgroups = _tabgroups.filter(_group => _group.uuid !== group.uuid)
        _this.setState({
          tabgroups: _tabgroups
        }, () => {
          _this.props.updatetabs({...config, tabgroups: _tabgroups}, group.sublist)
        })
        _this.props.updatetabs({...config, tabgroups: _tabgroups}, group.sublist)
      },
      onCancel() {}
    })
@@ -276,8 +291,9 @@
    this.setState({
      tabgroups: _tabgroups
    }, () => {
      this.props.updatetabs({...config, tabgroups: _tabgroups})
    })
    this.props.updatetabs({...config, tabgroups: _tabgroups})
    notification.success({
      top: 92,
@@ -308,8 +324,9 @@
        group: null,
        tabgroups: _tabgroups,
        visible: false
      }, () => {
        this.props.updatetabs({...config, tabgroups: _tabgroups})
      })
      this.props.updatetabs({...config, tabgroups: _tabgroups})
    } else {
      this.setState({
        card: null,