king
2020-04-02 5b94d171aea661d000509a32448921363c77af9b
2020-04-02
5个文件已修改
130 ■■■■■ 已修改文件
src/components/header/index.jsx 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.scss 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/dragelement/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx
@@ -5,6 +5,7 @@
import { is, fromJS } from 'immutable'
import moment from 'moment'
import {Dropdown, Menu, Icon, Modal, Form, notification, Switch, Button } from 'antd'
import asyncComponent from '@/utils/asyncComponent'
import {
  toggleCollapse,
@@ -17,6 +18,7 @@
  logout
} from '@/store/action'
import Api from '@/api'
import options from '@/store/options.js'
import zhCN from '@/locales/zh-CN/header.js'
import enUS from '@/locales/en-US/header.js'
import Utils from '@/utils/utils.js'
@@ -145,7 +147,7 @@
  async loadmenu () {
    // 获取主菜单
    let _param = {func: 'sPC_Get_MainMenu'}
    let _param = {func: 'sPC_Get_MainMenu', systemType: options.systemType}
    if (sessionStorage.getItem('isEditState') === 'true') { // 编辑状态时,获取一级菜单,增加参数debug
      _param.debug = 'Y'
    }
src/components/sidemenu/index.jsx
@@ -6,8 +6,9 @@
import { Menu, Icon, notification } from 'antd'
import asyncComponent from '@/utils/asyncComponent'
import {modifyTabview, resetEditLevel} from '@/store/action'
import { modifyTabview, resetEditLevel } from '@/store/action'
import { SySMenuList } from './config.js'
import options from '@/store/options.js'
import zhCN from '@/locales/zh-CN/header.js'
import enUS from '@/locales/en-US/header.js'
import Api from '@/api'
@@ -48,7 +49,7 @@
      return
    }
    let _param = {func: 'sPC_Get_FunMenu', ParentID: menu.MenuID}
    let _param = {func: 'sPC_Get_FunMenu', ParentID: menu.MenuID, systemType: options.systemType}
    if (sessionStorage.getItem('isEditState') === 'true') { // 编辑状态时,获取菜单,增加参数debug
      _param.debug = 'Y'
src/templates/comtableconfig/index.jsx
@@ -4,7 +4,7 @@
import { is, fromJS } from 'immutable'
import { DndProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
import { Button, Card, Modal, Collapse, notification, Spin, Select, List, Icon, Empty, Switch, Tooltip } from 'antd'
import { Button, Card, Modal, Collapse, notification, Spin, Select, List, Icon, Empty, Switch, Tooltip, message } from 'antd'
import moment from 'moment'
import Api from '@/api'
@@ -2653,6 +2653,27 @@
    })
  }
  copycolumn = () => {
    const { config } = this.state
    let oInput = document.createElement('input')
    let val = {
      copyType: 'columns',
      columns: config.columns
    }
    oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val)))
    document.body.appendChild(oInput)
    oInput.select()
    document.execCommand('Copy')
    oInput.className = 'oInput'
    oInput.style.display = 'none'
    message.success('复制成功。')
    document.body.removeChild(oInput)
  }
  /**
   * @description 选择不保存时,如有复制按钮,则删除
   */
@@ -2668,37 +2689,53 @@
  }
  pasteSubmit = () => {
    const { config } = this.state
    this.pasteFormRef.handleConfirm().then(res => {
      if (res.copyType !== 'action') {
      if (res.copyType === 'action') {
        this.setState({
          modaltype: ''
        }, () => {
          this.handleAction(res, 'copy')
        })
      } else if (res.copyType === 'columns') {
        if (config.columns && config.columns.length > 0) {
          notification.warning({
            top: 92,
            message: '显示列已存在!',
            duration: 10
          })
          return
        }
        this.setState({
          modaltype: '',
          config: {...config, columns: res.columns}
        })
      } else {
        notification.warning({
          top: 92,
          message: '配置信息格式错误!',
          duration: 10
        })
        return
      }
      this.setState({
        modaltype: ''
      }, () => {
        this.handleAction(res, 'copy')
      })
    })
  }
  render () {
    const { modaltype, activeKey } = this.state
    const configAction = this.state.config.action.filter(_action =>
    const { modaltype, activeKey, config } = this.state
    const configAction = config.action.filter(_action =>
      !_action.origin && (_action.OpenType === 'pop' || _action.OpenType === 'popview' || _action.OpenType === 'blank' || _action.OpenType === 'tab')
    )
    let configTabs = []
    this.state.config.tabgroups.forEach(group => {
      configTabs.push(...this.state.config[group])
    config.tabgroups.forEach(group => {
      configTabs.push(...config[group])
    })
    let hasbtncrtinter = false
    if (modaltype === 'actionEdit' && this.state.config.setting.interType === 'inner' && !this.state.config.setting.innerFunc && this.state.config.setting.dataresource) {
    if (modaltype === 'actionEdit' && config.setting.interType === 'inner' && !config.setting.innerFunc && config.setting.dataresource) {
      hasbtncrtinter = true
    }
@@ -2856,7 +2893,7 @@
                </Tooltip>
                <DragElement
                  type="search"
                  list={this.state.config.search}
                  list={config.search}
                  handleList={this.handleList}
                  handleMenu={this.handleSearch}
                  deleteMenu={this.deleteElement}
@@ -2872,8 +2909,8 @@
                </div>
                <DragElement
                  type="action"
                  list={this.state.config.action}
                  setting={this.state.config.setting}
                  list={config.action}
                  setting={config.setting}
                  handleList={this.handleList}
                  handleMenu={this.handleAction}
                  copyElement={(val) => this.handleAction(val, 'copy')}
@@ -2888,12 +2925,13 @@
                <Tooltip placement="bottomLeft" overlayClassName="middle" title="在左侧工具栏《显示列》中,选择对应类型的显示列拖至此处添加;或点击《添加显示列》按钮批量添加,选择批量添加时,需提前选择使用表。注:添加合并列时,需设置可选列。">
                  <Icon type="question-circle" />
                </Tooltip>
                {config.columns && config.columns.length > 0 ? <Icon className="column-copy" title="copy" type="copy" onClick={this.copycolumn} /> : null}
                <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showColumnName} onChange={this.onColumnNameChange} />
                <DragElement
                  type="columns"
                  list={this.state.config.columns}
                  setting={this.state.config.setting}
                  gridBtn={this.state.config.gridBtn}
                  list={config.columns}
                  setting={config.setting}
                  gridBtn={config.gridBtn}
                  handleList={this.handleList}
                  handleMenu={this.handleColumn}
                  deleteMenu={this.deleteElement}
@@ -2903,13 +2941,13 @@
                />
              </div>
              {/* 标签组 */}
              {this.state.config.tabgroups.map((groupId, index) => {
              {config.tabgroups.map((groupId, index) => {
                return (
                  <div key={index} className="tab-list">
                    {index === 0 ? <Tooltip placement="bottomLeft" overlayClassName="middle" title="在左侧工具栏《标签页》中,选择对应类型的标签页拖至此处添加。">
                      <Icon type="question-circle" />
                    </Tooltip> : null}
                    {index !== (this.state.config.tabgroups.length - 1) ?
                    {index !== (config.tabgroups.length - 1) ?
                      <Icon type="arrow-down" onClick={() => {this.handleGroup(index, 'down')}} /> : null
                    }
                    {index !== 0 ? <Icon type="arrow-up" onClick={() => {this.handleGroup(index, 'up')}} /> : null}
@@ -2918,7 +2956,7 @@
                    <TabDragElement
                      type="tabs"
                      groupId={groupId}
                      list={this.state.config[groupId]}
                      list={config[groupId]}
                      handleList={this.handleList}
                      handleMenu={this.handleTab}
                      deleteMenu={this.deleteElement}
@@ -2970,7 +3008,7 @@
            tabs={this.state.tabviews}
            formlist={this.state.formlist}
            inputSubmit={this.handleSubmit}
            setting={this.state.config.setting}
            setting={config.setting}
            wrappedComponentRef={(inst) => this.actionFormRef = inst}
          />
        </Modal>
@@ -3006,7 +3044,7 @@
            dict={this.state.dict}
            card={this.state.card}
            inputSubmit={this.handleSubmit}
            columns={this.state.config.columns}
            columns={config.columns}
            wrappedComponentRef={(inst) => this.columnFormRef = inst}
          />
        </Modal>
@@ -3023,7 +3061,7 @@
          <GridBtnForm
            dict={this.state.dict}
            inputSubmit={this.handleSubmit}
            card={this.state.config.gridBtn}
            card={config.gridBtn}
            wrappedComponentRef={(inst) => this.gridBtnFormRef = inst}
          />
        </Modal>
@@ -3088,7 +3126,7 @@
            <VerifyCard
              card={this.state.card}
              dict={this.state.dict}
              columns={this.state.config.columns}
              columns={config.columns}
              wrappedComponentRef={(inst) => this.verifyRef = inst}
            /> : null
          }
@@ -3096,7 +3134,7 @@
            <VerifyCardPrint
              card={this.state.card}
              dict={this.state.dict}
              columns={this.state.config.columns}
              columns={config.columns}
              wrappedComponentRef={(inst) => this.verifyRef = inst}
            /> : null
          }
@@ -3104,7 +3142,7 @@
            <VerifyCardExcelIn
              card={this.state.card}
              dict={this.state.dict}
              columns={this.state.config.columns}
              columns={config.columns}
              wrappedComponentRef={(inst) => this.verifyRef = inst}
            /> : null
          }
@@ -3139,8 +3177,8 @@
            dict={this.state.dict}
            menu={this.props.menu}
            inputSubmit={this.settingSave}
            data={this.state.config.setting}
            columns={this.state.config.columns}
            data={config.setting}
            columns={config.columns}
            usefulFields={this.props.permFuncField}
            wrappedComponentRef={(inst) => this.settingRef = inst}
          />
src/templates/comtableconfig/index.scss
@@ -328,6 +328,13 @@
          right: 20px;
          top: -10px;
        }
        .column-copy {
          position: absolute;
          font-size: 16px;
          right: 75px;
          top: -7px;
          color: #26C281;
        }
        > .ant-row {
          background: #fafafa;
          border-radius: 4px;
src/templates/zshare/dragelement/index.jsx
@@ -11,7 +11,7 @@
const Container = ({list, setting, gridBtn, type, placeholder, handleList, handleMenu, deleteMenu, copyElement, profileMenu, handleGridBtn, showfield, doubleClickCard }) => {
  let target = null
  const [cards, setCards] = useState(list)
  const moveCard = (id, atIndex) => {
    const { card, index } = findCard(id)
@@ -186,13 +186,13 @@
    let _hideCol = []
    cards.forEach(col => {
      if (col.type === 'colspan' && col.sublist) {
        _hideCol = _hideCol.concat(col.sublist)
        _hideCol.push(...col.sublist)
      }
    })
    cards.forEach(col => {
      if (!_hideCol.includes(col.uuid)) {
        _colCards.push(col)
      }
      if (_hideCol.includes(col.uuid)) return
      _colCards.push(col)
    })
  }
@@ -280,10 +280,10 @@
          </div>
        ))
      }
      {cards.length === 0 &&
      {cards.length === 0 ?
        <div className="common-drawarea-placeholder">
          {placeholder}
        </div>
        </div> : null
      }
    </div>
  )