king
2023-06-05 4e570c993e66a47ead0f83de76b63b0a2f8c5446
2023-06-05
15个文件已修改
2个文件已添加
737 ■■■■ 已修改文件
src/components/pasteboard/index.jsx 134 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/pasteboard/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/chart/antv-X6/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/stylecontroller/index.jsx 98 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/colorsketch/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/basetable/index.jsx 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/popview/index.jsx 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/excelInbutton/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/exceloutbutton/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/popupbutton/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/editTable/index.jsx 190 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils-custom.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/pasteboard/index.jsx
New file
@@ -0,0 +1,134 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Input, notification, Modal } from 'antd'
import { SnippetsOutlined } from '@ant-design/icons'
// import './index.scss'
const { TextArea } = Input
class PaseComponent extends Component {
  static propTpyes = {
    inputSubmit: PropTypes.func // 回车事件
  }
  state = {
    visible: false,
    value: ''
  }
  trigger = () => {
    // navigator.clipboard
    //   .readText()
    //   .then((val) => {
    //     this.evalContent(val)
    //   })
    //   .catch((v) => {
    //     this.setState({visible: true, value: ''})
    //   })
    this.setState({visible: true, value: ''})
  }
  evalContent = (config) => {
    let _config = config.replace(/(\n|\s)+/g, '')
    if (!_config) {
      notification.warning({
        top: 92,
        message: '未获取到配置信息',
        duration: 5
      })
      return
    }
    try {
      _config = JSON.parse(window.decodeURIComponent(window.atob(_config)))
      if (typeof(_config) === 'object' && _config.$srcId) {
        let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId')
        if (srcid && _config.$srcId !== srcid) {
          notification.warning({
            top: 92,
            message: '当前系统无权限使用此项配置!',
            duration: 5
          })
          _config = ''
        } else {
          delete _config.$srcId
        }
      }
    } catch (e) {
      // 通过sql语句添加字段集
      if (/[a-zA-Z0-9_]+\s+(nvarchar\(\d+\)|Decimal\(18,\d+\)|Int)/ig.test(config)) {
        _config = {
          key: 'datasourcefield',
          type: 'array',
          data: []
        }
        let list = config.match(/[a-zA-Z0-9_]+\s+(nvarchar\(\d+\)|Decimal\(18,\d+\)|Int)/ig)
        list.forEach(item => {
          _config.data.unshift({
            datatype: item.split(/\s+/)[1],
            field: item.split(/\s+/)[0],
            label: item.split(/\s+/)[0],
          })
        })
      } else {
        notification.warning({
          top: 92,
          message: '解析错误',
          duration: 5
        })
        _config = ''
      }
    }
    if (!_config) return
    this.props.getPasteValue(_config, () => {
      this.setState({visible: false, value: ''})
    })
  }
  changeVal = (e) => {
    this.setState({value: e.target.value})
  }
  pasteSubmit = () => {
    this.evalContent(this.state.value)
  }
  enterPress = (e) => {
    e.stopPropagation()
    this.evalContent(this.state.value)
  }
  render() {
    const { children } = this.props
    const { visible, value } = this.state
    return (
      <>
        {children ? <span onClick={this.trigger}>{children}</span> : <SnippetsOutlined title="粘贴" onClick={this.trigger} />}
        <Modal
          title="粘贴"
          visible={visible}
          width={600}
          maskClosable={false}
          onOk={this.pasteSubmit}
          onCancel={() => {this.setState({visible: false})}}
          destroyOnClose
        >
          <TextArea placeholder="请输入配置信息" autoFocus autoSize={{ minRows: 8, maxRows: 8 }} value={value} onChange={this.changeVal} onPressEnter={this.enterPress}/>
        </Modal>
      </>
    )
  }
}
export default PaseComponent
src/components/pasteboard/index.scss
src/menu/components/chart/antv-X6/index.jsx
@@ -533,17 +533,16 @@
    })
    // graph.on('cell:click', ({ e, x, y, cell, view }) => {
    //   console.log(cell)
    //   console.log(view)
    // })
    graph.on('node:click', ({ e, x, y, node, view }) => {
      console.log(node)
    })
    graph.on('edge:click', ({ e, x, y, edge, view }) => {
      console.log(edge)
    })
    graph.on('blank:click', ({ e, x, y }) => {
      console.log(13)
    })
    const r1 = graph.createNode({
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -12,6 +12,7 @@
const { TextArea } = Input
const { Paragraph } = Typography
const MkEditIcon = asyncComponent(() => import('@/components/mkIcon'))
const MKTable = asyncComponent(() => import('@/components/normalform/modalform/mkTable'))
const acTyOptions = {
  pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hidden'],
  prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hidden'],
@@ -92,6 +93,8 @@
    let hasclass = true
    this.props.formlist.forEach(item => {
      if (!item.key) return
      this.record[item.key] = item.initVal
      if (item.key === 'class') {
@@ -520,6 +523,10 @@
      }
    }
    if (shows.includes('syncComponent') && this.record.syncComponent[0] === 'multiComponent') {
      shows.push('syncComponents')
    }
    if (this.record.show === 'icon') {
      reRequired.icon = true
    } else {
@@ -858,7 +865,14 @@
          { required: item.required, message: '请选择' + item.label + '!' }
        ]
        content = <Cascader options={item.options || []} expandTrigger="hover" placeholder=""/>
        content = <Cascader onChange={(value) => {this.optionChange(item.key, value)}} options={item.options || []} expandTrigger="hover" placeholder=""/>
      } else if (item.type === 'table') {
        span = 24
        className = 'textarea'
        rules = [
          { required: item.required, message: '请添加' + item.label + '!' }
        ]
        content = (<MKTable tip={''} columns={item.columns || []} actions={[]}/>)
      } else if (item.type === 'icon') {
        rules = [
          { required: item.required, message: '请选择' + item.label + '!' }
@@ -1041,7 +1055,7 @@
              }
            })
          }
          resolve(values)
        } else {
          reject(err)
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -749,7 +749,7 @@
      initVal: card.syncComponent || [],
      tooltip: '执行成功后(或弹窗标签关闭时),需要同步刷新的组件。注:选择当前组件的上级组件无效,刷新上级组件请选择成功后“刷新上级组件 - 行”。',
      required: false,
      options: modules
      options: modules.length ? [...modules, {value: 'multiComponent', label: '多组件'}] : []
    },
    {
      type: 'radio',
@@ -1168,6 +1168,27 @@
        value: 'progressbar',
        text: '进度条'
      }]
    },
    {
      type: 'table',
      key: 'syncComponents',
      label: '组件列表',
      initVal: card.syncComponents || [],
      required: true,
      actions: [],
      columns: [
        {
          title: '组件',
          dataIndex: 'syncComId',
          inputType: 'cascader',
          editable: true,
          required: true,
          extends: [{key: 'label', value: 'label'}],
          width: '70%',
          render: (text, record) => record.label,
          options: modules
        }
      ]
    }
  ]
@@ -1704,7 +1725,7 @@
      initVal: card.syncComponent || [],
      tooltip: '执行成功后(或弹窗标签关闭时),需要同步刷新的组件。注:选择当前组件的上级组件无效,刷新上级组件请选择成功后“刷新上级组件 - 行”。',
      required: false,
      options: modules
      options: modules.length ? [...modules, {value: 'multiComponent', label: '多组件'}] : []
    },
    {
      type: 'radio',
@@ -1931,6 +1952,27 @@
        value: 'progressbar',
        text: '进度条'
      }]
    },
    {
      type: 'table',
      key: 'syncComponents',
      label: '组件列表',
      initVal: card.syncComponents || [],
      required: true,
      actions: [],
      columns: [
        {
          title: '组件',
          dataIndex: 'syncComId',
          inputType: 'cascader',
          editable: true,
          required: true,
          extends: [{key: 'label', value: 'label'}],
          width: '70%',
          render: (text, record) => record.label,
          options: modules
        }
      ]
    }
  ]
src/menu/datasource/verifycard/index.jsx
@@ -64,6 +64,7 @@
        inputType: 'input',
        editable: true,
        unique: true,
        strict: true,
        copy: true,
        rules: [{
          pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/ig,
src/menu/stylecontroller/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Collapse, Form, Col, InputNumber, Input, Select, Radio, Drawer, Button } from 'antd'
import { Collapse, Form, Col, InputNumber, Input, Select, Radio, Drawer, Button, message } from 'antd'
import {
  ColumnHeightOutlined,
  FontSizeOutlined,
@@ -29,7 +29,7 @@
  ArrowLeftOutlined,
  ArrowRightOutlined,
  SwapOutlined,
  EnterOutlined,
  EnterOutlined
} from '@ant-design/icons'
import MKEmitter from '@/utils/events.js'
@@ -42,6 +42,7 @@
const { Panel } = Collapse
const { Option } = Select
const ColorSketch = asyncComponent(() => import('@/mob/colorsketch'))
const PasteBoard = asyncComponent(() => import('@/components/pasteboard'))
const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent'))
class MobController extends Component {
@@ -453,6 +454,77 @@
    this.updateStyle({[type]: val})
  }
  copy = () => {
    const { card, options } = this.state
    let msg = { copyType: 'style' }
    msg.data = card
    msg.options = options
    try {
      msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg)))
    } catch (e) {
      console.warn('Stringify Failure')
      msg = ''
    }
    if (msg) {
      let oInput = document.createElement('input')
      oInput.value = msg
      document.body.appendChild(oInput)
      oInput.select()
      document.execCommand('Copy')
      document.body.removeChild(oInput)
      message.success('复制成功。')
    }
  }
  paste = (res, callback) => {
    const { options } = this.state
    if (res.copyType !== 'style') {
      message.warning('配置信息格式错误!', 5)
      return
    } else if (JSON.stringify(res.options) !== JSON.stringify(options)) {
      message.warning('样式选项不一致,不可粘贴!', 5)
      return
    }
    let style = res.data || {}
    let backgroundImage = ''
    if (style.backgroundImage && /^url/ig.test(style.backgroundImage)) {
      backgroundImage = style.backgroundImage.replace(/^url\(/ig, '').replace(/\)$/ig, '')
    }
    let borposition = 'outer'
    if (!style.borderWidth) {
      if (style.borderLeftWidth) {
        borposition = 'left'
      } else if (style.borderRightWidth) {
        borposition = 'right'
      } else if (style.borderTopWidth) {
        borposition = 'top'
      } else if (style.borderBottomWidth) {
        borposition = 'bottom'
      }
    }
    this.setState({
      card: style,
      borposition,
      backgroundImage
    })
    this.callback && this.callback(style)
    callback()
    message.success('粘贴成功。')
  }
  render () {
    const { card, options, backgroundImage, borposition, fonts, type } = this.state
    const formItemLayout = {
@@ -561,7 +633,7 @@
                    label={<FontColorsOutlined title="字体颜色"/>}
                    labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
                  >
                    <ColorSketch value={card.color || 'rgba(0, 0, 0, 0.85)'} onChange={this.changeFontColor} />
                    <ColorSketch value={card.color || ''} onChange={this.changeFontColor} />
                  </Form.Item>
                  <Form.Item
                    colon={false}
@@ -771,11 +843,11 @@
                    label={<BgColorsOutlined title="边框颜色"/>}
                    labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
                  >
                    {borposition === 'outer' ? <ColorSketch value={card.borderColor || 'transparent'} onChange={this.changeBorderColor} /> : null}
                    {borposition === 'left' ? <ColorSketch value={card.borderLeftColor || 'transparent'} onChange={this.changeBorderColor} /> : null}
                    {borposition === 'right' ? <ColorSketch value={card.borderRightColor || 'transparent'} onChange={this.changeBorderColor} /> : null}
                    {borposition === 'top' ? <ColorSketch value={card.borderTopColor || 'transparent'} onChange={this.changeBorderColor} /> : null}
                    {borposition === 'bottom' ? <ColorSketch value={card.borderBottomColor || 'transparent'} onChange={this.changeBorderColor} /> : null}
                    {borposition === 'outer' ? <ColorSketch value={card.borderColor || ''} onChange={this.changeBorderColor} /> : null}
                    {borposition === 'left' ? <ColorSketch value={card.borderLeftColor || ''} onChange={this.changeBorderColor} /> : null}
                    {borposition === 'right' ? <ColorSketch value={card.borderRightColor || ''} onChange={this.changeBorderColor} /> : null}
                    {borposition === 'top' ? <ColorSketch value={card.borderTopColor || ''} onChange={this.changeBorderColor} /> : null}
                    {borposition === 'bottom' ? <ColorSketch value={card.borderBottomColor || ''} onChange={this.changeBorderColor} /> : null}
                  </Form.Item>
                  <Form.Item
                    colon={false}
@@ -802,7 +874,7 @@
                    label={<BgColorsOutlined title="阴影颜色"/>}
                    labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
                  >
                    <ColorSketch value={card.shadowColor || 'transparent'} onChange={this.changeShadowColor} />
                    <ColorSketch value={card.shadowColor || ''} onChange={this.changeShadowColor} />
                  </Form.Item>
                  <Form.Item
                    colon={false}
@@ -972,8 +1044,12 @@
              </Panel> : null}
            </Collapse> : null}
          </Form>
          <div style={{textAlign: 'right'}}>
            <Button style={{margin: '30px 10px 30px 0px'}} onClick={this.onCloseDrawer}>关闭</Button>
          <div style={{textAlign: 'right', lineHeight: '60px', marginBottom: '30px'}}>
            <div style={{float: 'left'}}>
              <Button onClick={() => this.copy()} className="mk-border-green" style={{marginRight: '10px'}}>复制</Button>
              <PasteBoard getPasteValue={this.paste}><Button style={{borderColor: 'rgb(64, 169, 255)', color: 'rgb(64, 169, 255)'}}>粘贴</Button></PasteBoard>
            </div>
            <Button style={{marginRight: '10px'}} onClick={this.onCloseDrawer}>关闭</Button>
          </div>
        </div>
      </Drawer>
src/mob/colorsketch/index.jsx
@@ -140,7 +140,7 @@
            <div className="color-sketch-block-inner" style={ {background: color} }></div>
          </div>
        </Popover>
        <div className="color-sketch-value">{color}{allowClear && color ? <CloseCircleFilled onClick={this.clear}/> : null}</div>
        <div className="color-sketch-value">{color || <span style={{color: '#ff4d4f'}}>无</span>}{allowClear && color ? <CloseCircleFilled onClick={this.clear}/> : null}</div>
      </div>
    )
  }
src/tabviews/basetable/index.jsx
@@ -348,10 +348,29 @@
                cell.$MenuID = this.props.MenuID
                cell.$view = 'popview'
                if (cell.syncComponentId && cell.syncComponentId === item.setting.supModule) {
                  cell.syncComponentId = ''
                  if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
                    cell.execSuccess = 'mainline'
                if (cell.syncComponentId) {
                  if (cell.syncComponentId === item.setting.supModule) {
                    cell.syncComponentId = ''
                    if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
                      cell.execSuccess = 'mainline'
                    }
                  } else if (cell.syncComponentId === 'multiComponent') {
                    let ids = cell.syncComponents.map(m => {
                      return m.syncComId.pop() || ''
                    })
                    if (item.setting.supModule && ids.includes(item.setting.supModule)) {
                      if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
                        cell.execSuccess = 'mainline'
                      }
                      ids = ids.filter(id => id !== item.setting.supModule)
                    }
                    if (ids.length === 0) {
                      cell.syncComponentId = ''
                    } else {
                      cell.syncComponentIds = ids
                    }
                  }
                }
@@ -414,10 +433,29 @@
          cell.$view = 'popview'
          cell.$toolbtn = true
          if (cell.syncComponentId && cell.syncComponentId === item.setting.supModule) {
            cell.syncComponentId = ''
            if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
              cell.execSuccess = 'mainline'
          if (cell.syncComponentId) {
            if (cell.syncComponentId === item.setting.supModule) {
              cell.syncComponentId = ''
              if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
                cell.execSuccess = 'mainline'
              }
            } else if (cell.syncComponentId === 'multiComponent') {
              let ids = cell.syncComponents.map(m => {
                return m.syncComId.pop() || ''
              })
              if (item.setting.supModule && ids.includes(item.setting.supModule)) {
                if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
                  cell.execSuccess = 'mainline'
                }
                ids = ids.filter(id => id !== item.setting.supModule)
              }
              if (ids.length === 0) {
                cell.syncComponentId = ''
              } else {
                cell.syncComponentIds = ids
              }
            }
          }
src/tabviews/custom/index.jsx
@@ -473,9 +473,7 @@
        item.search = Utils.initSearchVal(item.search)
      }
      let mutil = false
      if (item.wrap && item.wrap.supType === 'multi') { // 数据卡多上级组件
        mutil = true
        item.setting.supModule = item.supNodes[0].componentId
      } else if (item.setting && item.setting.supModule && typeof(item.setting.supModule) !== 'string') {
        let pid = item.setting.supModule.pop()
@@ -500,13 +498,6 @@
          cell = this.resetButton(item, cell, popview)
          cell.$toolbtn = true
          if (!mutil && cell.syncComponentId && cell.syncComponentId === item.setting.supModule) {
            cell.syncComponentId = ''
            if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
              cell.execSuccess = 'mainline'
            }
          }
          if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置
            cell = this.getPrinter(cell, item.uuid)
@@ -553,13 +544,6 @@
                  if (cell.hidden === 'true') return false
                  cell = this.resetButton(item, cell, popview)
                  if (cell.syncComponentId && cell.syncComponentId === item.setting.supModule) {
                    cell.syncComponentId = ''
                    if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
                      cell.execSuccess = 'mainline'
                    }
                  }
                  if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置
                    cell = this.getPrinter(cell, item.uuid)
@@ -618,13 +602,6 @@
              cell = this.resetButton(item, cell, popview)
              if (!mutil && cell.syncComponentId && cell.syncComponentId === item.setting.supModule) {
                cell.syncComponentId = ''
                if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
                  cell.execSuccess = 'mainline'
                }
              }
              if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置
                cell = this.getPrinter(cell, item.uuid)
              }
@@ -642,13 +619,6 @@
              if (cell.hidden === 'true') return false
              cell = this.resetButton(item, cell, popview)
              if (!mutil && cell.syncComponentId && cell.syncComponentId === item.setting.supModule) {
                cell.syncComponentId = ''
                if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
                  cell.execSuccess = 'mainline'
                }
              }
              if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置
                cell = this.getPrinter(cell, item.uuid)
@@ -673,13 +643,6 @@
            if (cell.hidden === 'true') return false
            cell = this.resetButton(item, cell, popview)
            if (cell.syncComponentId && cell.syncComponentId === item.wrap.supModule) {
              cell.syncComponentId = ''
              if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
                cell.execSuccess = 'mainline'
              }
            }
            if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置
              cell = this.getPrinter(cell, item.uuid)
@@ -805,6 +768,32 @@
      }
    }
    if (cell.syncComponentId) {
      if (cell.syncComponentId === item.setting.supModule) {
        cell.syncComponentId = ''
        if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
          cell.execSuccess = 'mainline'
        }
      } else if (cell.syncComponentId === 'multiComponent') {
        let ids = cell.syncComponents.map(m => {
          return m.syncComId.pop() || ''
        })
        if (item.setting.supModule && ids.includes(item.setting.supModule)) {
          if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
            cell.execSuccess = 'mainline'
          }
          ids = ids.filter(id => id !== item.setting.supModule)
        }
        if (ids.length === 0) {
          cell.syncComponentId = ''
        } else {
          cell.syncComponentIds = ids
        }
      }
    }
    return cell
  }
src/tabviews/custom/popview/index.jsx
@@ -302,9 +302,7 @@
        item.search = Utils.initSearchVal(item.search)
      }
      let mutil = false
      if (item.wrap && item.wrap.supType === 'multi') { // 数据卡多上级组件
        mutil = true
        item.setting.supModule = item.supNodes[0].componentId
      } else if (item.setting && item.setting.supModule && typeof(item.setting.supModule) !== 'string') {
        let pid = item.setting.supModule.pop()
@@ -322,13 +320,6 @@
          cell = this.resetButton(item, cell, Tab)
          cell.$toolbtn = true
          if (!mutil && cell.syncComponentId && cell.syncComponentId === item.setting.supModule) {
            cell.syncComponentId = ''
            if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
              cell.execSuccess = 'mainline'
            }
          }
          return true
        })
@@ -371,13 +362,6 @@
                  if (cell.hidden === 'true' || cell.OpenType === 'popview') return false
            
                  cell = this.resetButton(item, cell, Tab)
                  if (cell.syncComponentId && cell.syncComponentId === item.setting.supModule) {
                    cell.syncComponentId = ''
                    if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
                      cell.execSuccess = 'mainline'
                    }
                  }
                } else {
                  cell = this.resetElement(cell)
                }
@@ -430,13 +414,6 @@
              if (cell.hidden === 'true' || cell.OpenType === 'popview') return false
              cell = this.resetButton(item, cell, Tab)
              if (!mutil && cell.syncComponentId && cell.syncComponentId === item.setting.supModule) {
                cell.syncComponentId = ''
                if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
                  cell.execSuccess = 'mainline'
                }
              }
            } else {
              cell = this.resetElement(cell)
            }
@@ -451,13 +428,6 @@
              if (cell.hidden === 'true' || cell.OpenType === 'popview') return false
              cell = this.resetButton(item, cell, Tab)
              if (!mutil && cell.syncComponentId && cell.syncComponentId === item.setting.supModule) {
                cell.syncComponentId = ''
                if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
                  cell.execSuccess = 'mainline'
                }
              }
            } else {
              cell = this.resetElement(cell)
            }
@@ -478,13 +448,6 @@
            if (cell.hidden === 'true' || cell.OpenType === 'popview') return false
            cell = this.resetButton(item, cell, Tab)
            if (cell.syncComponentId && cell.syncComponentId === item.wrap.supModule) {
              cell.syncComponentId = ''
              if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
                cell.execSuccess = 'mainline'
              }
            }
          } else {
            cell = this.resetElement(cell)
          }
@@ -598,6 +561,32 @@
      }
    }
    if (cell.syncComponentId) {
      if (cell.syncComponentId === item.setting.supModule) {
        cell.syncComponentId = ''
        if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
          cell.execSuccess = 'mainline'
        }
      } else if (cell.syncComponentId === 'multiComponent') {
        let ids = cell.syncComponents.map(m => {
          return m.syncComId.pop() || ''
        })
        if (item.setting.supModule && ids.includes(item.setting.supModule)) {
          if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
            cell.execSuccess = 'mainline'
          }
          ids = ids.filter(id => id !== item.setting.supModule)
        }
        if (ids.length === 0) {
          cell.syncComponentId = ''
        } else {
          cell.syncComponentIds = ids
        }
      }
    }
    return cell
  }
src/tabviews/zshare/actionList/excelInbutton/index.jsx
@@ -199,8 +199,18 @@
      MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn, '', this.state.selines)
    }
    
    btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId)
    if (btn.syncComponentId) {
      if (btn.syncComponentId === 'multiComponent') {
        btn.syncComponentIds.forEach((id, i) => {
          setTimeout(() => {
            MKEmitter.emit('reloadData', id)
          }, 20 * i)
        })
      } else {
        MKEmitter.emit('reloadData', btn.syncComponentId)
      }
    }
    if (btn.switchTab && btn.switchTab.length > 0) {
      let id = btn.switchTab[btn.switchTab.length - 1]
      let node = document.getElementById('tab' + id)
src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -1118,7 +1118,17 @@
      MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn, '', [])
    }
    
    btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId)
    if (btn.syncComponentId) {
      if (btn.syncComponentId === 'multiComponent') {
        btn.syncComponentIds.forEach((id, i) => {
          setTimeout(() => {
            MKEmitter.emit('reloadData', id)
          }, 20 * i)
        })
      } else {
        MKEmitter.emit('reloadData', btn.syncComponentId)
      }
    }
    
    if (btn.switchTab && btn.switchTab.length > 0) {
      let id = btn.switchTab[btn.switchTab.length - 1]
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -2050,7 +2050,17 @@
      MKEmitter.emit('refreshDebugTable')
    }
    
    btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId)
    if (btn.syncComponentId) {
      if (btn.syncComponentId === 'multiComponent') {
        btn.syncComponentIds.forEach((id, i) => {
          setTimeout(() => {
            MKEmitter.emit('reloadData', id)
          }, 20 * i)
        })
      } else {
        MKEmitter.emit('reloadData', btn.syncComponentId)
      }
    }
    if (tabId) {
      MKEmitter.emit('reloadMenuView', tabId, 'table')
src/tabviews/zshare/actionList/popupbutton/index.jsx
@@ -222,7 +222,17 @@
      MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.popClose, btn)
    }
    btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId)
    if (btn.syncComponentId) {
      if (btn.syncComponentId === 'multiComponent') {
        btn.syncComponentIds.forEach((id, i) => {
          setTimeout(() => {
            MKEmitter.emit('reloadData', id)
          }, 20 * i)
        })
      } else {
        MKEmitter.emit('reloadData', btn.syncComponentId)
      }
    }
  }
  getPop = () => {
src/templates/zshare/editTable/index.jsx
@@ -3,17 +3,17 @@
import { is, fromJS } from 'immutable'
import { DndProvider, DragSource, DropTarget } from 'react-dnd'
import { Table, Input, InputNumber, Popconfirm, Form, Select, Radio, Cascader, notification, message, Modal, Typography } from 'antd'
import { CopyOutlined, EditOutlined, DeleteOutlined, SnippetsOutlined, SwapOutlined } from '@ant-design/icons'
import { CopyOutlined, EditOutlined, DeleteOutlined, SwapOutlined } from '@ant-design/icons'
import Utils from '@/utils/utils.js'
import ColorSketch from '@/mob/colorsketch'
import PasteForm from '@/templates/zshare/pasteform'
import asyncComponent from '@/utils/asyncComponent'
import CusSwitch from './cusSwitch'
import MKEmitter from '@/utils/events.js'
import './index.scss'
const MkEditIcon = asyncComponent(() => import('@/components/mkIcon'))
const PasteBoard = asyncComponent(() => import('@/components/pasteboard'))
const EditableContext = React.createContext()
const { confirm } = Modal
let dragingIndex = -1
@@ -172,7 +172,6 @@
  state = {
    data: [],
    editingKey: '',
    visible: false,
    editLineId: '',
    columns: []
  }
@@ -196,7 +195,7 @@
          操作
          <span className="copy-control">
            {actions.includes('copy') ? <CopyOutlined title="复制" onClick={() => this.copy()} /> : null}
            {actions.includes('copy') ? <SnippetsOutlined title="粘贴" onClick={this.paste} /> : null}
            {actions.includes('copy') ? <PasteBoard getPasteValue={this.pasteSubmit}/> : null}
            {actions.includes('clear') ? <DeleteOutlined title="清空" onClick={this.clear} /> : null}
          </span>
        </div>),
@@ -352,66 +351,74 @@
    }
  }
  
  paste = () => {
    this.setState({visible: true})
  }
  pasteSubmit = () => {
  pasteSubmit = (res, callback) => {
    const { type } = this.props
    const { columns } = this.state
    let data = fromJS(this.state.data).toJS()
    this.pasteFormRef.handleConfirm().then(res => {
      if (res.copyType === 'columns' && type === 'datasourcefield') {
        res.type = 'array'
        res.data = []
        res.columns.forEach(col => {
          if (!col.field) return
          if (col.type === 'number') {
            let datatype = 'Int'
            if (col.decimal) {
              datatype = `Decimal(18,${col.decimal})`
            }
            res.data.push({
              $index: res.data.length + 1,
              datatype: datatype,
              field: col.field,
              decimal: col.decimal,
              label: col.label,
              type: 'number',
              uuid: Utils.getuuid()
            })
          } else {
            let datatype = 'Nvarchar(50)'
            let fieldlength = 50
            if (col.fieldlength && [10, 20, 50, 100, 256, 512, 1024, 2048].includes(col.fieldlength)) {
              fieldlength = col.fieldlength
              datatype = `Nvarchar(${fieldlength})`
            }
            res.data.push({
              $index: res.data.length + 1,
              datatype: datatype,
              field: col.field,
              fieldlength: fieldlength,
              label: col.label,
              type: 'text',
              uuid: Utils.getuuid()
            })
    if (res.copyType === 'columns' && type === 'datasourcefield') {
      res.type = 'array'
      res.data = []
      res.columns.forEach(col => {
        if (!col.field) return
        if (col.type === 'number') {
          let datatype = 'Int'
          if (col.decimal) {
            datatype = `Decimal(18,${col.decimal})`
          }
        })
      } else if (res.key !== type) {
        message.warning('配置信息格式错误!')
        return
      }
      if (res.type === 'line') {
        let unique = true
        res.data.uuid = Utils.getuuid()
        columns.forEach(col => {
          if (col.unique !== true || !unique) return
          res.data.push({
            $index: res.data.length + 1,
            datatype: datatype,
            field: col.field,
            decimal: col.decimal,
            label: col.label,
            type: 'number',
            uuid: Utils.getuuid()
          })
        } else {
          let datatype = 'Nvarchar(50)'
          let fieldlength = 50
          if (col.fieldlength && [10, 20, 50, 100, 256, 512, 1024, 2048].includes(col.fieldlength)) {
            fieldlength = col.fieldlength
            datatype = `Nvarchar(${fieldlength})`
          }
          res.data.push({
            $index: res.data.length + 1,
            datatype: datatype,
            field: col.field,
            fieldlength: fieldlength,
            label: col.label,
            type: 'text',
            uuid: Utils.getuuid()
          })
        }
      })
    } else if (res.key !== type) {
      message.warning('配置信息格式错误!')
      return
    }
    if (res.type === 'line') {
      let unique = true
      res.data.uuid = Utils.getuuid()
      columns.forEach(col => {
        if (col.unique !== true || !unique) return
        if (col.strict) {
          let key = res.data[col.dataIndex].toLowerCase()
          let _index = data.findIndex(item => key === item[col.dataIndex].toLowerCase())
          if (_index > -1) {
            notification.warning({
              top: 92,
              message: col.title + '不可重复!',
              duration: 5
            })
            unique = false
          }
        } else {
          let _index = data.findIndex(item => res.data[col.dataIndex] === item[col.dataIndex])
          if (_index > -1) {
@@ -422,38 +429,49 @@
            })
            unique = false
          }
        })
        }
      })
        if (!unique) return
      if (!unique) return
        data.unshift(res.data)
        this.setState({ data, editingKey: '', editLineId: res.data.uuid || '', visible: false }, () => {
          this.props.onChange(data)
        })
      } else if (res.type === 'array') {
        res.data.forEach(cell => {
          let unique = true
          cell.uuid = Utils.getuuid()
          columns.forEach(col => {
            if (col.unique !== true || !unique) return
      data.unshift(res.data)
      this.setState({ data, editingKey: '', editLineId: res.data.uuid || '' }, () => {
        this.props.onChange(data)
      })
    } else if (res.type === 'array') {
      res.data.forEach(cell => {
        let unique = true
        cell.uuid = Utils.getuuid()
        columns.forEach(col => {
          if (col.unique !== true || !unique) return
          if (col.strict) {
            let _index = data.findIndex(item => cell[col.dataIndex].toLowerCase() === item[col.dataIndex].toLowerCase())
            if (_index > -1) {
              unique = false
            }
          } else {
            let _index = data.findIndex(item => cell[col.dataIndex] === item[col.dataIndex])
  
            if (_index > -1) {
              unique = false
            }
          })
          if (!unique) return
          data.push(cell)
          }
        })
        this.setState({ data, editingKey: '', visible: false }, () => {
          this.props.onChange(data)
        })
      }
      message.success('粘贴成功。')
    })
        if (!unique) return
        data.push(cell)
      })
      this.setState({ data, editingKey: '' }, () => {
        this.props.onChange(data)
      })
    }
    callback()
    message.success('粘贴成功。')
  }
  handleStatus = (record) => {
@@ -673,18 +691,6 @@
              })}
            />
          </DndProvider>
          {/* 信息粘贴 */}
          <Modal
            title="粘贴"
            visible={this.state.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>
      </EditableContext.Provider>
    )
src/utils/utils-custom.js
@@ -19,6 +19,8 @@
      } else if (item.type === 'tabs') {
        if (item.subtype === 'tabletabs') {
          item.subtabs.forEach(tab => {
            if (tab.components[0].uuid === selfId) return
            modules.push({
              value: tab.components[0].uuid,
              label: tab.label,
@@ -655,7 +657,12 @@
    if (btn.anchors && btn.anchors.length > 0) {
      btn.anchors = btn.anchors.map(m => md5(commonId + m))
    }
    if (btn.syncComponent && btn.syncComponent.length > 0) {
    if (btn.syncComponent && btn.syncComponent[0] === 'multiComponent' && btn.syncComponents) {
      btn.syncComponents = btn.syncComponents.map(m => {
        m.syncComId = m.syncComId.map(n => md5(commonId + n))
        return m
      })
    } else if (btn.syncComponent && btn.syncComponent.length > 0) {
      btn.syncComponent = btn.syncComponent.map(m => md5(commonId + m))
    }
  }