king
2022-09-16 66cc7818cf5e13c44f4372e7d47fb72df7d2f752
src/menu/components/share/actioncomponent/dragaction/index.jsx
@@ -104,6 +104,45 @@
  const [, drop] = useDrop({
    accept: 'action',
    drop(item) {
      if (item.$init) { // 拖拽添加
        let newcard = {}
        newcard.uuid = Utils.getuuid()
        newcard.focus = true
        if (item.class === 'element') {
          delete item.overIndex
          return
        } else {
          newcard.label = 'button'
          newcard.verify = null
          newcard.show = 'link'
          newcard.Ot = 'requiredSgl'
          newcard.OpenType = item.value
          newcard.class = 'primary'
          if (newcard.OpenType === 'excelIn') {
            newcard.label = item.text
            newcard.class = 'dgreen'
            newcard.Ot = 'notRequired'
          } else if (item.subType === 'excelOut') {
            newcard.label = item.text
            newcard.execSuccess = 'never'
            newcard.class = 'dgreen'
          }
        }
        if (item.overIndex) {
          const { index } = findCard(item.overIndex)
          const _cards = update(cards, { $splice: [[index + 1, 0, newcard]] })
          handleList(_cards, newcard)
        } else {
          handleList([...cards, newcard], newcard)
        }
        delete item.overIndex
        return
      }
      const { index } = findCard(item.id)
      if (index > -1) return
      dropButton(item.id)