king
2023-03-07 79006d19801eb10e7532eaf8478d1dd2c239954b
2023-03-07
20个文件已修改
652 ■■■■■ 已修改文件
src/components/paste/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/dragtitle/card.jsx 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/dragtitle/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/simple-form/index.jsx 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/step-form/index.jsx 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/tab-form/index.jsx 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/group/paste/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/pastebasetable/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/pastecomponent/index.jsx 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/tabs/paste/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/modalconfig/index.jsx 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/modalconfig/index.scss 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/modalconfig/index.jsx 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/modalconfig/pastecomponent/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/index.jsx 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/editcomponent/index.jsx 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.scss 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils-custom.js 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/paste/index.jsx
@@ -17,10 +17,6 @@
    visible: false
  }
  handleMenuClick = () => {
    this.setState({visible: true})
  }
  pasteSubmit = () => {
    const { options } = this.props
    this.pasteFormRef.handleConfirm().then(res => {
src/menu/components/form/dragtitle/card.jsx
@@ -9,9 +9,10 @@
import './index.scss'
const NormalForm = asyncIconComponent(() => import('@/components/normalform'))
const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent'))
const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
const Card = ({ id, card, sort, labelSize, active, moveCard, findCard, closeCard, selectCard, updateGroup }) => {
const Card = ({ id, card, sort, labelSize, active, moveCard, findCard, closeCard, selectCard, updateGroup, pasteForm }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: 'form', id, originalIndex },
@@ -79,6 +80,7 @@
          <EditOutlined style={{color: '#1890ff'}} title="编辑"/>
        </NormalForm>
        <CopyComponent type="formgroup" card={card}/>
        <PasteComponent options={['form', 'forms']} updateConfig={(res) => pasteForm(res, id)} />
        <CloseOutlined className="close" type="close" onClick={close} />
      </div>
    } trigger="hover">
src/menu/components/form/dragtitle/index.jsx
@@ -4,7 +4,7 @@
import Card from './card'
import './index.scss'
const Container = ({list, labelSize, selectId, tabtype, handleList, handleGroup, closeGroup, selectGroup}) => {
const Container = ({list, labelSize, selectId, tabtype, handleList, handleGroup, handleForm, closeGroup, selectGroup}) => {
  const [cards, setCards] = useState(list)
  const moveCard = (id, atIndex) => {
    const { card, index } = findCard(id)
@@ -33,6 +33,11 @@
    closeGroup(card)
  }
  const pasteForm = (res, id) => {
    const { card } = findCard(id)
    handleForm(card, res)
  }
  const selectCard = id => {
    const { card } = findCard(id)
    selectGroup(card)
@@ -51,6 +56,7 @@
          moveCard={moveCard}
          closeCard={closeCard}
          updateGroup={handleGroup}
          pasteForm={pasteForm}
          findCard={findCard}
          selectCard={selectCard}
        />
src/menu/components/form/simple-form/index.jsx
@@ -506,7 +506,7 @@
    let _config = fromJS(this.state.card).toJS()
    if (res.subButton) {
      let _this = this
      let that = this
      _config.subcards[0].setting.focus = res.focus
      _config.subcards[0].setting.cache = res.cache
@@ -527,12 +527,38 @@
      })
      confirm({
        content: `替换表单及按钮配置?`,
        content: '替换表单及按钮配置?',
        onOk() {
          _this.updateComponent(_config)
          that.updateComponent(_config)
        },
        onCancel() {}
      })
      return
    } else if (res.fields) {
      if (_config.subcards[0].fields.length > 0) {
        let that = this
        _config.subcards[0].fields = res.fields.map(item => {
          item.uuid = Utils.getuuid()
          return item
        })
        confirm({
          title: '确定替换表单吗?',
          content: '原表单将删除。',
          onOk() {
            that.updateComponent(_config)
          },
          onCancel() {}
        })
      } else {
        _config.subcards[0].fields = res.fields.map(item => {
          item.uuid = Utils.getuuid()
          return item
        })
        this.updateComponent(_config)
      }
      return
    }
@@ -636,7 +662,7 @@
              <EditOutlined style={{color: '#1890ff'}} title="编辑"/>
            </NormalForm>
            <CopyComponent type="simpleform" card={card}/>
            <PasteComponent config={card} options={['form', 'formgroup']} updateConfig={this.pasteForm} />
            <PasteComponent config={card} options={['form', 'forms', 'formgroup']} updateConfig={this.pasteForm} />
            <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/>
            <UserComponent config={card}/>
            <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} />
src/menu/components/form/step-form/index.jsx
@@ -688,6 +688,98 @@
    this.updateComponent(_card)
  }
  clearGroup = () => {
    let group = fromJS(this.state.group).toJS()
    let card = fromJS(this.state.card).toJS()
    let _this = this
    group.fields = []
    card.subcards = card.subcards.map(item => {
      if (item.uuid === group.uuid) {
        return group
      }
      return item
    })
    confirm({
      content: `确定清空表单吗?`,
      onOk() {
        _this.setState({group})
        _this.updateComponent(card)
      },
      onCancel() {}
    })
  }
  parseForm = (g, res) => {
    let _group = fromJS(g).toJS()
    let _confirm = false
    if (res.copyType === 'form') {
      let fieldrepet = false // 字段重复
      res.uuid = Utils.getuuid()
      _group.fields.forEach(item => {
        if (res.field && item.field && item.field.toLowerCase() === res.field.toLowerCase()) {
          fieldrepet = true
        }
      })
      if (fieldrepet) {
        notification.warning({
          top: 92,
          message: '字段已存在!',
          duration: 10
        })
        return
      }
      _group.fields.push(res)
    } else {
      if (_group.fields.length > 0) {
        _confirm = true
      }
      _group.fields = res.fields.map(item => {
        item.uuid = Utils.getuuid()
        return item
      })
    }
    if (_confirm) {
      let that = this
      confirm({
        title: '确定替换表单吗?',
        content: '原表单将删除。',
        onOk() {
          that.updateForms(_group)
        },
        onCancel() {}
      })
    } else {
      this.updateForms(_group)
    }
  }
  updateForms = (_group) => {
    const { group } = this.state
    let card = fromJS(this.state.card).toJS()
    card.subcards = card.subcards.map(item => {
      if (item.uuid === _group.uuid) {
        return _group
      }
      return item
    })
    if (_group.uuid === group.uuid) {
      this.setState({group: _group})
      this.updateComponent(card)
    } else {
      this.updateComponent(card)
    }
  }
  clickComponent = (e) => {
    if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') {
      e.stopPropagation()
@@ -734,12 +826,14 @@
          selectId={group ? group.uuid : ''}
          handleList={this.changecards}
          handleGroup={this.changeGroup}
          handleForm={this.parseForm}
          closeGroup={this.closeGroup}
          selectGroup={this.selectGroup}
        />
        {group ? <div className="form-area">
          <PlusOutlined className="plus" title="添加表单" onClick={this.addForm}/>
          <FieldsComponent config={group} type="form" plusFields={this.plusFields} />
          <span style={{color: 'red', marginLeft: '30px', cursor: 'pointer'}} onClick={this.clearGroup}>清空</span>
          <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />
          {appType !== 'mob' ? <Button className="mk-cols-change" onClick={() => this.changecols(1)}>1列</Button> : null}
          {appType !== 'mob' ? <Button className="mk-cols-change" onClick={() => this.changecols(2)}>2列</Button> : null}
src/menu/components/form/tab-form/index.jsx
@@ -713,6 +713,74 @@
    })
  }
  parseForm = (g, res) => {
    let _group = fromJS(g).toJS()
    let _confirm = false
    if (res.copyType === 'form') {
      let fieldrepet = false // 字段重复
      res.uuid = Utils.getuuid()
      _group.fields.forEach(item => {
        if (res.field && item.field && item.field.toLowerCase() === res.field.toLowerCase()) {
          fieldrepet = true
        }
      })
      if (fieldrepet) {
        notification.warning({
          top: 92,
          message: '字段已存在!',
          duration: 10
        })
        return
      }
      _group.fields.push(res)
    } else {
      if (_group.fields.length > 0) {
        _confirm = true
      }
      _group.fields = res.fields.map(item => {
        item.uuid = Utils.getuuid()
        return item
      })
    }
    if (_confirm) {
      let that = this
      confirm({
        title: '确定替换表单吗?',
        content: '原表单将删除。',
        onOk() {
          that.updateForms(_group)
        },
        onCancel() {}
      })
    } else {
      this.updateForms(_group)
    }
  }
  updateForms = (_group) => {
    const { group } = this.state
    let card = fromJS(this.state.card).toJS()
    card.subcards = card.subcards.map(item => {
      if (item.uuid === _group.uuid) {
        return _group
      }
      return item
    })
    if (_group.uuid === group.uuid) {
      this.setState({group: _group})
      this.updateComponent(card)
    } else {
      this.updateComponent(card)
    }
  }
  clickComponent = (e) => {
    if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') {
      e.stopPropagation()
@@ -760,6 +828,7 @@
          selectId={group ? group.uuid : ''}
          handleList={this.changecards}
          handleGroup={this.updateGroup}
          handleForm={this.parseForm}
          closeGroup={this.closeGroup}
          selectGroup={this.selectGroup}
        />
src/menu/components/group/paste/index.jsx
@@ -18,10 +18,6 @@
    visible: false
  }
  handleMenuClick = () => {
    this.setState({visible: true})
  }
  pasteSubmit = () => {
    let appType = sessionStorage.getItem('appType')
    let options = ['datacard', 'propcard', 'balcony', 'timeline', 'simpleform', 'stepform', 'tabform', 'normaltable', 'tablecard', 'line', 'bar', 'pie', 'scatter', 'sandbox']
src/menu/components/share/pastebasetable/index.jsx
@@ -19,10 +19,6 @@
    visible: false
  }
  handleMenuClick = () => {
    this.setState({visible: true})
  }
  pasteSubmit = () => {
    this.pasteFormRef.handleConfirm().then(res => {
      if (res.copyType !== 'basetable') {
src/menu/components/share/pastecomponent/index.jsx
@@ -21,10 +21,6 @@
    visible: false
  }
  handleMenuClick = () => {
    this.setState({visible: true})
  }
  resetconfig = (item, config) => {
    let _uuid = Utils.getuuid()
@@ -116,12 +112,17 @@
  pasteSubmit = () => {
    const { options } = this.props
    this.pasteFormRef.handleConfirm().then(res => {
      if (!options.includes(res.copyType)) {
        notification.warning({ top: 92, message: '配置信息格式错误!', duration: 5 })
        return
      }
      if (!this.props.config) {
        this.props.updateConfig(res)
        this.setState({visible: false})
        return
      }
      let type = res.copyType
      let config = fromJS(this.props.config).toJS()
src/menu/components/tabs/paste/index.jsx
@@ -19,10 +19,6 @@
    visible: false
  }
  handleMenuClick = () => {
    this.setState({visible: true})
  }
  resetconfig = (item) => {
    if (item.type === 'tabs') {
      item.uuid = MenuUtils.getuuid()
src/menu/modalconfig/index.jsx
@@ -4,8 +4,8 @@
import { DndProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
import moment from 'moment'
import { Button, Card, Modal, Collapse, notification, Switch } from 'antd'
import { SettingOutlined } from '@ant-design/icons'
import { Button, Card, Modal, Collapse, notification, Switch, message } from 'antd'
import { SettingOutlined, CopyOutlined } from '@ant-design/icons'
import Api from '@/api'
import Utils from '@/utils/utils.js'
@@ -456,8 +456,44 @@
    })
  }
  plusFields = (items) => {
  plusFields = (items, type) => {
    let _config = fromJS(this.state.config).toJS()
    if (type === 'forms') {
      if (_config.fields.length > 0) {
        let that = this
        _config.fields = items.fields.map(item => {
          item.uuid = Utils.getuuid()
          return item
        })
        confirm({
          title: '确定替换表单吗?',
          content: '原表单将删除。',
          onOk() {
            that.setState({
              config: _config
            })
          },
          onCancel() {}
        })
      } else {
        _config.fields = items.fields.map(item => {
          item.uuid = Utils.getuuid()
          return item
        })
        this.setState({
          config: _config
        })
        notification.success({
          top: 92,
          message: '粘贴成功!',
          duration: 2
        })
      }
      return
    }
    _config.fields.push(...items)
@@ -468,6 +504,39 @@
        this.handleForm(items[0])
      }
    })
  }
  triggerCopy = () => {
    const { config } = this.state
    let val = {
      copyType: 'forms',
      fields: config.fields || []
    }
    if (val.fields.length === 0) {
      message.warning('表单元素不可为空!')
      return
    }
    try {
      val = window.btoa(window.encodeURIComponent(JSON.stringify(val)))
    } catch (e) {
      console.warn(e)
      message.warning('复制失败,请重试!')
      val = ''
    }
    if (val) {
      let oInput = document.createElement('input')
      oInput.value = val
      document.body.appendChild(oInput)
      oInput.select()
      document.execCommand('Copy')
      document.body.removeChild(oInput)
      message.success('复制成功。')
    }
  }
  render () {
@@ -493,7 +562,7 @@
            <Card title="表单配置" bordered={false} extra={
              <div>
                <Button type="danger" onClick={this.clearConfig}>清空</Button>
                <EditComponent options={['form']} type="formboard" config={this.state.config} plusFields={this.plusFields}/>
                <EditComponent options={['form', 'forms']} type="formboard" config={this.state.config} plusFields={this.plusFields}/>
                <Button type="primary" id="save-modal-config" loading={saving} onClick={this.submitConfig}>保存</Button>
                <Button onClick={this.cancelConfig}>返回</Button>
              </div>
@@ -506,6 +575,7 @@
                  <Button className="mk-cols-change" onClick={() => this.changecols(2)}>2列</Button>
                  <Button className="mk-cols-change" onClick={() => this.changecols(3)}>3列</Button>
                  <Button className="mk-cols-change" onClick={() => this.changecols(4)}>4列</Button>
                  <CopyOutlined title="复制" onClick={this.triggerCopy} />
                  <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />
                </div>
                <div className="ant-modal-body">
src/menu/modalconfig/index.scss
@@ -117,10 +117,17 @@
          z-index: 10;
          background: transparent;
          min-height: 50px;
          padding-right: 75px;
          padding-right: 80px;
          .ant-modal-title {
            display: inline-block;
          }
          .anticon-copy {
            position: absolute;
            top: 18px;
            color: #26C281;
            right: 65px;
            font-size: 16px;
          }
          .ant-switch {
            position: absolute;
            top: 15px;
src/mob/modalconfig/index.jsx
@@ -4,7 +4,7 @@
import { DndProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
import moment from 'moment'
import { Button, Modal, Collapse, notification, Switch } from 'antd'
import { Button, Modal, Collapse, notification, Switch, message } from 'antd'
import { LeftOutlined } from '@ant-design/icons'
import Api from '@/api'
@@ -409,12 +409,83 @@
    })
  }
  insert = (config) => {
  insert = (config, type) => {
    if (type === 'forms') {
      let _config = fromJS(this.state.config).toJS()
      if (_config.fields.length > 0) {
        let that = this
        _config.fields = config.fields.map(item => {
          item.uuid = Utils.getuuid()
          return item
        })
        confirm({
          title: '确定替换表单吗?',
          content: '原表单将删除。',
          onOk() {
            that.setState({
              config: _config
            })
          },
          onCancel() {}
        })
      } else {
        _config.fields = config.fields.map(item => {
          item.uuid = Utils.getuuid()
          return item
        })
        this.setState({
          config: _config
        })
        notification.success({
          top: 92,
          message: '粘贴成功!',
          duration: 2
        })
      }
      return
    }
    this.setState({
      config
    }, () => {
      this.handleForm(config.fields[config.fields.length - 1])
    })
  }
  triggerCopy = () => {
    const { config } = this.state
    let val = {
      copyType: 'forms',
      fields: config.fields || []
    }
    if (val.fields.length === 0) {
      message.warning('表单元素不可为空!')
      return
    }
    try {
      val = window.btoa(window.encodeURIComponent(JSON.stringify(val)))
    } catch (e) {
      console.warn(e)
      message.warning('复制失败,请重试!')
      val = ''
    }
    if (val) {
      let oInput = document.createElement('input')
      oInput.value = val
      document.body.appendChild(oInput)
      oInput.select()
      document.execCommand('Copy')
      document.body.removeChild(oInput)
      message.success('复制成功。')
    }
  }
  clearConfig = () => {
@@ -453,6 +524,7 @@
            <Button icon="setting" onClick={this.changeSetting}>设置</Button>
            <Button type="primary" id="save-modal-config" loading={saving} onClick={this.submitConfig}>保存</Button>
            <Button onClick={this.cancelConfig}>返回</Button>
            <Button type="primary" style={{background: '#26C281', border: 'none'}} onClick={this.triggerCopy}>复制</Button>
            <PasteComponent config={config} updateConfig={this.insert} />
            <Button type="danger" onClick={this.clearConfig}>清空</Button>
            <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />
src/mob/modalconfig/pastecomponent/index.jsx
@@ -20,7 +20,11 @@
  pasteSubmit = () => {
    const { config } = this.props
    this.pasteFormRef.handleConfirm().then(res => {
      if (res.copyType !== 'form') {
      if (res.copyType === 'forms') {
        this.props.updateConfig(res, 'forms')
        this.setState({visible: false})
        return
      } else if (res.copyType !== 'form') {
        notification.warning({ top: 92, message: '配置信息格式错误!', duration: 5 })
        return
      }
src/templates/comtableconfig/index.jsx
@@ -58,7 +58,6 @@
    delActions: [],          // 删除按钮列表
    copyActions: [],         // 复制按钮组
    tabviews: [],            // 所有标签页
    thawButtons: [],         // 已选择要解冻的按钮
    activeKey: '0',          // 默认展开基本信息
    chartview: null,         // 当前视图
    openEdition: '',         // 编辑版本标记,防止多人操作
@@ -294,7 +293,7 @@
   */
  submitConfig = () => {
    const { menu } = this.props
    const { delActions, thawButtons, openEdition } = this.state
    const { delActions, openEdition } = this.state
    let _config = fromJS(this.state.config).toJS()
@@ -538,26 +537,7 @@
      }).then(resp => {
        if (resp === false) return
        if (thawButtons.length > 0) {
          let defers = thawButtons.map(item => {
            return new Promise((resolve) => {
              Api.getSystemConfig({
                func: 'sPC_MainMenu_ReDel',
                MenuID: item
              }).then(res => {
                if (res.status) {
                  resolve('')
                } else {
                  resolve(res.message)
                }
              })
            })
          })
          return Promise.all(defers)
        } else {
          return true
        }
        return true
      }).then(res => {
        if (res === true || res === false) return res
@@ -570,9 +550,6 @@
          })
          return false
        } else {
          this.setState({
            thawButtons: []
          })
          return true
        }
      }).then(resp => {
@@ -1001,7 +978,6 @@
   */
  editConfig = (res) => {
    this.setState({
      thawButtons: res.thawButtons,
      config: res.config
    })
  }
@@ -1227,7 +1203,7 @@
                <Unattended config={config} updateConfig={this.updateconfig}/>
                <Versions MenuId={menu.MenuID} open_edition={openEdition} updateConfig={this.refreshConfig}/>
                <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/>
                <EditComponent type="table" options={['search', 'form', 'action', 'columns']} config={this.state.config} MenuID={this.props.menu.MenuID} thawButtons={this.state.thawButtons} refresh={this.editConfig}/>
                <EditComponent type="table" options={['search', 'form', 'action', 'columns']} config={this.state.config} refresh={this.editConfig}/>
                <UpdateTable config={config}/>
                <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.config.enabled} onChange={this.onEnabledChange} />
                <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>保存</Button>
src/templates/modalconfig/index.jsx
@@ -733,7 +733,6 @@
    })
  }
  render () {
    const { editAction } = this.props
    const { config, openEdition } = this.state
src/templates/subtableconfig/index.jsx
@@ -59,7 +59,6 @@
    delActions: [],          // 删除按钮列表
    copyActions: [],         // 复制按钮组
    tabviews: [],            // 所有标签页
    thawButtons: [],         // 已选择要解冻的按钮
    activeKey: '0',          // 默认展开基本信息
    chartview: null,         // 当前视图
    openEdition: '',         // 编辑版本标记,防止多人操作
@@ -285,7 +284,7 @@
   * @description 标签页保存
   */
  submitConfig = () => {
    const { delActions, thawButtons, openEdition } = this.state
    const { delActions, openEdition } = this.state
    let _config = fromJS(this.state.config).toJS()
    let copyreg = /\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$/ig
@@ -478,26 +477,7 @@
    }).then(resp => {
      if (resp === false) return
      if (thawButtons.length > 0) {
        let defers = thawButtons.map(item => {
          return new Promise((resolve) => {
            Api.getSystemConfig({
              func: 'sPC_MainMenu_ReDel',
              MenuID: item
            }).then(res => {
              if (res.status) {
                resolve('')
              } else {
                resolve(res.message)
              }
            })
          })
        })
        return Promise.all(defers)
      } else {
        return true
      }
      return true
    }).then(res => {
      if (res === true || res === false) return res
@@ -510,9 +490,6 @@
        })
        return false
      } else {
        this.setState({
          thawButtons: []
        })
        return true
      }
    }).then(resp => {
@@ -834,7 +811,6 @@
   */
  updateConfig = (res) => {
    this.setState({
      thawButtons: res.thawButtons,
      config: res.config
    })
  }
@@ -1023,7 +999,7 @@
              <div>
                <Versions MenuId={config.uuid} open_edition={openEdition} updateConfig={this.refreshConfig}/>
                <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/>
                <EditComponent type="table" options={['search', 'form', 'action', 'columns']} config={config} MenuID={config.uuid} thawButtons={this.state.thawButtons} refresh={this.updateConfig}/>
                <EditComponent type="table" options={['search', 'form', 'action', 'columns']} config={config} refresh={this.updateConfig}/>
                <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} />
                <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>保存</Button>
                <Button onClick={this.cancelConfig}>返回</Button>
src/templates/zshare/editcomponent/index.jsx
@@ -1,117 +1,23 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Modal, Spin, notification, Button } from 'antd'
import { UnlockOutlined, SnippetsOutlined } from '@ant-design/icons'
import { Modal, notification, Button } from 'antd'
import { SnippetsOutlined } from '@ant-design/icons'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import PasteForm from '@/templates/zshare/pasteform'
import TransferForm from '@/templates/zshare/basetransferform'
import MKEmitter from '@/utils/events.js'
import './index.scss'
class editComponent extends Component {
  static propTpyes = {
    options: PropTypes.array,
    MenuID: PropTypes.any,
    config: PropTypes.object,
    thawButtons: PropTypes.any,
    refresh: PropTypes.func
  }
  state = {
    thawVisible: false,
    thawbtnlist: null,
    pasteVisible: false,
    targetKeys: []
  }
  /**
   * @description 解冻按钮
   */
  handleThaw = () => {
    const { MenuID } = this.props
    this.setState({
      thawVisible: true,
      targetKeys: []
    })
    Api.getSystemConfig({
      func: 'sPC_Get_FrozenMenu',
      ParentID: MenuID,
      TYPE: 40
    }).then(res => {
      if (res.status) {
        let _list = []
        res.data.forEach(menu => {
          let _conf = ''
          if (menu.ParentParam) {
            try {
              _conf = JSON.parse(window.decodeURIComponent(window.atob(menu.ParentParam)))
            } catch (e) {
              console.warn('Parse Failure')
              _conf = ''
            }
          }
          if (_conf) {
            _list.push({
              key: menu.MenuID,
              title: menu.MenuName,
              btnParam: _conf
            })
          }
        })
        this.setState({
          thawbtnlist: _list
        })
      } else {
        notification.warning({
          top: 92,
          message: res.message,
          duration: 5
        })
      }
    })
  }
  /**
   * @description 解冻按钮提交
   */
  thawBtnSubmit = () => {
    const { thawButtons } = this.props
    const { thawbtnlist, targetKeys } = this.state
    let config = fromJS(this.props.config).toJS()
    if (targetKeys.length === 0) {
      notification.warning({
        top: 92,
        message: '请选择解冻按钮',
        duration: 5
      })
    } else {
      thawbtnlist.forEach(item => {
        if (targetKeys.includes(item.key)) {
          config.action.push(item.btnParam)
        }
      })
      this.props.refresh({
        type: 'thaw',
        thawButtons: [...thawButtons, ...targetKeys],
        config: config
      })
      this.setState({
        thawVisible: false,
        targetKeys: []
      })
    }
    visible: false
  }
  pasteSubmit = () => {
@@ -176,6 +82,8 @@
        }
        
        this.props.plusFields([res])
      } else if (res.copyType === 'forms') {
        this.props.plusFields(res, 'forms')
      } else {
        notification.warning({
          top: 92,
@@ -185,45 +93,23 @@
        return
      }
      this.setState({
        pasteVisible: false
        visible: false
      })
    })
  }
  handleMenuClick = e => {
    if (e.key === 'thaw') {
      this.handleThaw()
    } else if (e.key === 'paste') {
      this.setState({pasteVisible: true})
    }
  }
  render() {
    const { MenuID } = this.props
    return (
      <div style={{display: 'inline-block'}}>
        {MenuID ? <Button className="mk-border-green" onClick={this.handleThaw}><UnlockOutlined /> 解冻按钮</Button> : null}
        <Button style={{borderColor: '#40a9ff', color: '#40a9ff'}} onClick={() => this.setState({pasteVisible: true})}><SnippetsOutlined /> 粘贴</Button>
        {/* 解冻按钮模态框 */}
        <Modal
          title="解冻按钮"
          visible={this.state.thawVisible}
          onOk={this.thawBtnSubmit}
          onCancel={() => {this.setState({thawVisible: false, thawbtnlist: null, targetKeys: []})}}
          destroyOnClose
        >
          {!this.state.thawbtnlist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />}
          {this.state.thawbtnlist && <TransferForm onChange={(vals) => this.setState({targetKeys: vals})} menulist={this.state.thawbtnlist}/>}
        </Modal>
        <Button style={{borderColor: '#40a9ff', color: '#40a9ff'}} onClick={() => this.setState({visible: true})}><SnippetsOutlined /> 粘贴</Button>
        {/* 按钮配置信息粘贴复制 */}
        <Modal
          title="粘贴"
          visible={this.state.pasteVisible}
          visible={this.state.visible}
          width={600}
          maskClosable={false}
          onOk={this.pasteSubmit}
          onCancel={() => {this.setState({pasteVisible: false})}}
          onCancel={() => {this.setState({visible: false})}}
          destroyOnClose
        >
          <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/>
src/templates/zshare/modalform/index.scss
@@ -47,4 +47,9 @@
    cursor: pointer;
    font-size: 14px;
  }
  >.ant-row >.ant-col {
    display: inline-block;
    vertical-align: top;
    float: none;
  }
}
src/utils/utils-custom.js
@@ -674,6 +674,14 @@
   * @description 按钮重置
   */
  static resetBtn (btn, commonId) {
    if (btn.OpenType === 'pop' || (btn.OpenType === 'funcbutton' && btn.execMode === 'pop')) {
      if (btn.modal && btn.modal.fields.length > 0) {
        btn.modal.fields = btn.modal.fields.map(m => {
          m.uuid = this.getuuid()
          return m
        })
      }
    }
    if (btn.switchTab && btn.switchTab.length > 0) {
      btn.switchTab = btn.switchTab.map(m => md5(commonId + m))
    }
@@ -750,6 +758,15 @@
          card.elements = card.elements.map(cell => {
            if (cell.eleType === 'button') {
              cell.uuid = md5(commonId + cell.uuid)
              if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
                if (cell.modal && cell.modal.fields.length > 0) {
                  cell.modal.fields = cell.modal.fields.map(m => {
                    m.uuid = this.getuuid()
                    return m
                  })
                }
              }
            } else {
              cell.uuid = this.getuuid()
            }
@@ -763,6 +780,14 @@
          card.backElements = card.backElements.map(cell => {
            if (cell.eleType === 'button') {
              cell.uuid = md5(commonId + cell.uuid)
              if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
                if (cell.modal && cell.modal.fields.length > 0) {
                  cell.modal.fields = cell.modal.fields.map(m => {
                    m.uuid = this.getuuid()
                    return m
                  })
                }
              }
            } else {
              cell.uuid = this.getuuid()
            }
@@ -781,6 +806,14 @@
        item.elements = item.elements.map(cell => {
          if (cell.eleType === 'button') {
            cell.uuid = md5(commonId + cell.uuid)
            if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
              if (cell.modal && cell.modal.fields.length > 0) {
                cell.modal.fields = cell.modal.fields.map(m => {
                  m.uuid = this.getuuid()
                  return m
                })
              }
            }
          } else {
            cell.uuid = this.getuuid()
          }
@@ -822,6 +855,14 @@
          }
          col.elements = col.elements.map(cell => {
            cell.uuid = md5(commonId + cell.uuid)
            if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
              if (cell.modal && cell.modal.fields.length > 0) {
                cell.modal.fields = cell.modal.fields.map(m => {
                  m.uuid = this.getuuid()
                  return m
                })
              }
            }
            return cell
          })
@@ -858,6 +899,14 @@
      }
      item.action = item.action.map(cell => {
        cell.uuid = md5(commonId + cell.uuid)
        if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
          if (cell.modal && cell.modal.fields.length > 0) {
            cell.modal.fields = cell.modal.fields.map(m => {
              m.uuid = this.getuuid()
              return m
            })
          }
        }
        return cell
      })