king
2021-05-25 2f95e9ca3984bba9bfe602596c2401e98e84f323
2021-05-25
16个文件已修改
2个文件已添加
241 ■■■■■ 已修改文件
src/menu/components/card/cardcellcomponent/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcomponent/index.jsx 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcomponent/pastecomponent/index.jsx 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcomponent/pastecomponent/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/columns/index.jsx 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/wrapsetting/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/wrapsetting/settingform/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/pastecontroller/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/index.scss 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/share/normalTable/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/normal-table/index.jsx 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/normal-table/index.scss 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/excelInbutton/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/exceloutbutton/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/popupbutton/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/printbutton/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/index.scss
@@ -16,6 +16,10 @@
    cursor: pointer;
  }
  .ant-btn {
    padding: 0;
  }
  .card-button-cell {
    float: left;
    button {
src/menu/components/card/cardcomponent/index.jsx
@@ -15,6 +15,7 @@
const CardCellComponent = asyncComponent(() => import('../cardcellcomponent'))
const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
const PasteComponent = asyncIconComponent(() => import('./pastecomponent'))
class CardBoxComponent extends Component {
  static propTpyes = {
@@ -88,7 +89,7 @@
    this.props.updateElement(_card)
  }
  updateCard = (elements) => {
  updateCard = (elements, type) => {
    const { card, side } = this.state
    let _card = {}
@@ -99,9 +100,16 @@
      _card = {...card, elements: elements}
    }
    if (type === 'paste') {
      this.setState({
        card: _card,
        elements: fromJS(elements).toJS()
      })
    } else {
    this.setState({
      card: _card
    })
    }
    this.props.updateElement(_card)
  }
@@ -246,6 +254,7 @@
                <Icon className="plus" title="添加按钮" onClick={this.addButton} type="plus-square" />
                <Icon className="edit" title="编辑" type="edit" onClick={() => this.setState({settingVisible: true})} />
                <CopyComponent type="cardcell" card={card}/>
                <PasteComponent elements={elements} options={['action', 'customCardElement']} updateConfig={(list) => this.updateCard(list, 'paste')} />
                <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" />
                {cards.subtype === 'propcard' ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
                  <div className="mk-popover-control">
src/menu/components/card/cardcomponent/pastecomponent/index.jsx
New file
@@ -0,0 +1,77 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Icon, Modal, notification } from 'antd'
import Utils from '@/utils/utils.js'
import MKEmitter from '@/utils/events.js'
import asyncComponent from '@/utils/asyncComponent'
import './index.scss'
const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform'))
class PasteController extends Component {
  static propTpyes = {
    config: PropTypes.object,        // 组件配置
    updateConfig: PropTypes.func
  }
  state = {
    visible: false
  }
  handleMenuClick = () => {
    this.setState({visible: true})
  }
  pasteSubmit = () => {
    const { options, elements } = this.props
    this.pasteFormRef.handleConfirm().then(res => {
      if (!options.includes(res.copyType)) {
        notification.warning({ top: 92, message: '配置信息格式错误!', duration: 5 })
        return
      }
      let _uuid = Utils.getuuid()
      if (res.copyType === 'action' && res.OpenType === 'popview') {
        let _cell = fromJS(res).toJS()
        _cell.$originUuid = res.uuid
        _cell.uuid = _uuid
        MKEmitter.emit('copyButtons', [_cell])
      }
      res.uuid = _uuid
      this.props.updateConfig([...elements, res])
      this.setState({visible: false})
      notification.success({
        top: 92,
        message: '粘贴成功!',
        duration: 2
      })
    })
  }
  render() {
    const { visible } = this.state
    return (
      <div style={{display: 'inline-block'}}>
        <Icon type="snippets" style={{color: 'purple'}} onClick={() => {this.setState({visible: true})}} />
        <Modal
          title="粘贴"
          visible={visible}
          width={600}
          maskClosable={false}
          onOk={this.pasteSubmit}
          onCancel={() => {this.setState({visible: false})}}
          destroyOnClose
        >
          <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/>
        </Modal>
      </div>
    )
  }
}
export default PasteController
src/menu/components/card/cardcomponent/pastecomponent/index.scss
src/menu/components/table/normal-table/columns/index.jsx
@@ -49,7 +49,7 @@
  }
  render() {
    const { connectDragSource, connectDropTarget, moveCol, addElement, updateCol, editColumn, deleteCol, index, column, align, fields, children, ...restProps } = this.props
    const { connectDragSource, connectDropTarget, moveCol, addElement, updateCol, editColumn, changeStyle, deleteCol, index, column, align, fields, children, ...restProps } = this.props
    if (index !== undefined) {
      return connectDragSource(
@@ -60,6 +60,7 @@
                <Icon className="plus" title="添加" type="plus" onClick={() => this.props.addElement(column)} /> : null
              }
              <Icon className="edit" title="编辑" type="edit" onClick={() => this.props.editColumn(column)} />
              {column && column.type === 'custom' ? <Icon className="style" title="调整样式" onClick={() => this.props.changeStyle(column)} type="font-colors" /> : null}
              <Icon className="close" title="删除" type="delete" onClick={this.deleteCol} />
              {column && ['text', 'number'].includes(column.type) ? <MarkColumn columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null }
            </div>
@@ -143,7 +144,7 @@
    if (column && column.type === 'custom') {
      return (
        <td style={{padding: 0, minWidth: column.Width || 100}} className={className}>
        <td style={{padding: 0, minWidth: column.Width || 100, ...(column.style || {})}} className={className}>
          <CardCellComponent cards={config} cardCell={column} elements={column.elements} updateElement={this.updateCard}/>
        </td>
      )
@@ -183,6 +184,7 @@
    refresh: false,    // 强制刷新
    columns: [],
    fields: [],
    editStyleCard: null,
    lineMarks: []
  }
@@ -343,6 +345,24 @@
    this.updateCol(col)
  }
  changeStyle = (col) => {
    this.setState({
      editStyleCard: fromJS(col).toJS()
    })
    MKEmitter.emit('changeStyle', [col.uuid], ['font', 'padding'], col.style || {})
  }
  getStyle = (comIds, style) => {
    const { editStyleCard } = this.state
    if (!editStyleCard || comIds[0] !== editStyleCard.uuid || comIds.length !== 1) return
    let _card = {...editStyleCard, style}
    this.updateCol(_card)
  }
  cancelCol = () => {
    const { card } = this.state
@@ -435,6 +455,7 @@
          updateCol: this.updateCol,
          addElement: this.addElement,
          editColumn: this.editColumn,
          changeStyle: this.changeStyle,
          deleteCol: this.deleteCol,
        }),
        children: col.subcols && col.subcols.length ? this.handlecolumns(col.subcols, fields, config, true) : null,
@@ -482,6 +503,20 @@
    })
  }
  componentDidMount () {
    MKEmitter.addListener('submitStyle', this.getStyle)
  }
  /**
   * @description 组件销毁,清除state更新,清除快捷键设置
   */
  componentWillUnmount () {
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('submitStyle', this.getStyle)
  }
  render() {
    const { config } = this.props
    const { fields, card, lineMarks, dict, tableId } = this.state
src/menu/components/table/normal-table/wrapsetting/index.jsx
@@ -60,7 +60,7 @@
          wrapClassName="popview-modal"
          title="表格设置"
          visible={visible}
          width={700}
          width={750}
          maskClosable={false}
          okText={dict['model.submit']}
          onOk={this.verifySubmit}
src/menu/components/table/normal-table/wrapsetting/settingform/index.jsx
@@ -136,6 +136,18 @@
                )}
              </Form.Item>
            </Col>
            {appType !== 'mob' ? <Col span={12}>
              <Form.Item label="可收起">
                {getFieldDecorator('collapse', {
                  initialValue: wrap.collapse || 'false'
                })(
                  <Radio.Group>
                    <Radio key="true" value="true"> 是 </Radio>
                    <Radio key="false" value="false"> 否 </Radio>
                  </Radio.Group>
                )}
              </Form.Item>
            </Col> : null}
            <Col span={12}>
              <Form.Item label="表格大小">
                {getFieldDecorator('size', {
src/menu/pastecontroller/index.jsx
@@ -177,6 +177,9 @@
        return cell
      })
    }
    if (item.setting && item.setting.supModule) {
      item.setting.supModule = ''
    }
    return item
  }
src/tabviews/custom/components/card/cardcellList/index.scss
@@ -1,7 +1,9 @@
.card-cell-list {
  position: relative;
  .ant-btn {
    padding: 0;
  }
  .ant-mk-text {
    font-style: inherit;
    font-weight: inherit;
src/tabviews/custom/components/share/normalTable/index.jsx
@@ -350,6 +350,10 @@
      )
    } else if (col.type === 'custom') {
      style.padding = '0px'
      if (col.style) {
        style = {...style, ...col.style}
      }
      resProps.children = (
        <CardCellComponent data={record} cards={config} elements={col.elements}/>
      )
src/tabviews/custom/components/table/normal-table/index.jsx
@@ -2,7 +2,7 @@
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import { notification } from 'antd'
import { notification, Collapse } from 'antd'
import Api from '@/api'
import Utils from '@/utils/utils.js'
@@ -18,6 +18,8 @@
const MainAction = asyncComponent(() => import('@/tabviews/zshare/actionList'))
const MainTable = asyncComponent(() => import('@/tabviews/custom/components/share/normalTable'))
const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader'))
const { Panel } = Collapse
class NormalTable extends Component {
  static propTpyes = {
@@ -101,6 +103,10 @@
    }
    if (setting.fontSize) {
      setting.style.fontSize = setting.fontSize
    }
    if (_config.wrap.collapse === 'true') {
      _config.wrap.title = _config.wrap.title || ' '
    }
    this.setState({
@@ -553,6 +559,36 @@
    return (
      <div className="custom-normal-table" style={config.style}>
        {config.wrap.collapse === 'true' ? <Collapse bordered={false} defaultActiveKey="1" expandIconPosition="right">
          <Panel forceRender={true} header={<NormalHeader config={config}/>} key="1">
            {searchlist && searchlist.length ?
              <MainSearch BID={BID} setting={config.wrap} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null
            }
            <MainAction
              BID={BID}
              setting={setting}
              actions={actions}
              BData={this.state.BData}
              columns={config.columns}
              selectedData={selectedData}
            />
            <div className={'main-table-box ' + (!actions || actions.length === 0 ? 'no-action' : '')}>
              <MainTable
                setting={setting}
                columns={columns}
                MenuID={config.uuid}
                data={this.state.data}
                fields={config.columns}
                total={this.state.total}
                lineMarks={config.lineMarks}
                loading={this.state.loading}
                refreshdata={this.refreshbytable}
                statFValue={this.state.statFValue}
                chgSelectData={(selects) => this.setState({selectedData: selects})}
              />
            </div>
          </Panel>
        </Collapse> : <>
        <NormalHeader config={config}/>
        {searchlist && searchlist.length ?
          <MainSearch BID={BID} setting={config.wrap} searchlist={searchlist} menuType={this.props.menuType} refreshdata={this.refreshbysearch}/> : null
@@ -580,6 +616,7 @@
            chgSelectData={(selects) => this.setState({selectedData: selects})}
          />
        </div>
        </>}
      </div>
    )
  }
src/tabviews/custom/components/table/normal-table/index.scss
@@ -60,4 +60,32 @@
      float: right;
    }
  }
  .ant-collapse {
    background-color: transparent;
    border-radius: 0px;
    > .ant-collapse-item {
      border: 0;
      >.ant-collapse-header {
        padding: 0;
        .normal-header {
          padding-right: 40px;
        }
      }
    }
    .ant-collapse-item:last-child > .ant-collapse-content {
      border-radius: 0;
      .ant-collapse-content-box {
        padding: 0;
        >.button-list.toolbar-button {
          padding: 0;
          line-height: 55px;
          padding-right: 60px;
          button {
            margin-right: 0px;
            margin-bottom: 0px;
          }
        }
      }
    }
  }
}
src/tabviews/zshare/actionList/excelInbutton/index.jsx
@@ -74,7 +74,7 @@
    if ((triggerId && btn.uuid !== triggerId) || loading) return
    if (Tab && Tab.supMenu && !BID) {
    if (((Tab && Tab.supMenu) || setting.supModule) && !BID) {
      notification.warning({
        top: 92,
        message: '需要上级主键值!',
src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -78,7 +78,7 @@
    if ((triggerId && btn.uuid !== triggerId) || loading) return
    if (Tab && Tab.supMenu && !BID) {
    if (((Tab && Tab.supMenu) || setting.supModule) && !BID) {
      notification.warning({
        top: 92,
        message: '需要上级主键值!',
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -99,12 +99,12 @@
   * @description 触发按钮操作
   */
  actionTrigger = (triggerId, record) => {
    const { Tab, BID, btn, selectedData } = this.props
    const { Tab, BID, btn, selectedData, setting } = this.props
    const { loading } = this.state
    if ((triggerId && btn.uuid !== triggerId) || loading) return
    if (Tab && Tab.supMenu && !BID) {
    if (((Tab && Tab.supMenu) || setting.supModule) && !BID) {
      notification.warning({
        top: 92,
        message: '需要上级主键值!',
src/tabviews/zshare/actionList/popupbutton/index.jsx
@@ -94,7 +94,7 @@
    if ((triggerId && btn.uuid !== triggerId) || loading) return
    if (Tab && Tab.supMenu && !BID) {
    if (((Tab && Tab.supMenu) || setting.supModule) && !BID) {
      notification.warning({
        top: 92,
        message: '需要上级主键值!',
@@ -197,7 +197,7 @@
            BID={popData ? primaryId : this.props.BID}
            BData={popData || this.props.BData}
          /> : null}
          {btn.$view === 'CustomPage' ? <CustomPage Tab={btn} MenuID={btn.uuid} param={{BID: (popData ? primaryId : this.props.BID), data: (popData || this.props.BData)}} /> : null}
          {btn.$view === 'CustomPage' ? <CustomPage Tab={btn} MenuID={btn.uuid} param={{$BID: (popData ? primaryId : this.props.BID), ...(popData || this.props.BData || {})}} /> : null}
        </Modal>
      </div>
    )
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -81,12 +81,12 @@
   * @description 触发按钮操作
   */
  actionTrigger = (triggerId, record) => {
    const { Tab, BID, btn, selectedData } = this.props
    const { Tab, BID, btn, selectedData, setting } = this.props
    const { loading } = this.state
    if ((triggerId && btn.uuid !== triggerId) || loading) return
    if (Tab && Tab.supMenu && !BID) {
    if (((Tab && Tab.supMenu) || setting.supModule) && !BID) {
      notification.warning({
        top: 92,
        message: '需要上级主键值!',
src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx
@@ -140,7 +140,7 @@
        </Col>
      ))}
      {cards.length > 0 ? <Col key="action" className="action" span={6}>
        <div className="ant-row ant-form-item" style={{lineHeight: '40px', height: '55px', marginBottom: 0}}>
        <div className="ant-row ant-form-item" style={{whiteSpace: 'nowrap', lineHeight: '40px', height: '55px', marginBottom: 0}}>
          <div className="ant-col ant-form-item-label ant-col-xs-24 ant-col-sm-8">
          </div>
          <div className="ant-col ant-form-item-control-wrapper ant-col-xs-24 ant-col-sm-16">