From 88f02c2c018fb1e5c171bd4975dac534c584c3ba Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 10 十二月 2019 09:31:37 +0800 Subject: [PATCH] 2019-12-10 --- src/templates/comtableconfig/dragelement/index.jsx | 21 ++++----------------- 1 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/templates/comtableconfig/dragelement/index.jsx b/src/templates/comtableconfig/dragelement/index.jsx index 33993f6..2d63120 100644 --- a/src/templates/comtableconfig/dragelement/index.jsx +++ b/src/templates/comtableconfig/dragelement/index.jsx @@ -14,7 +14,8 @@ const { card, index } = findCard(id) const _cards = update(cards, { $splice: [[index, 1], [atIndex, 0, card]] }) setCards(_cards) - handleList({[type]: _cards}) + handleList(type, _cards) + // handleList({[type]: _cards}) } const findCard = id => { @@ -40,15 +41,6 @@ let copycard = JSON.parse(JSON.stringify(card)) copycard.uuid = Utils.getuuid() copycard.origin = false - // let names = cards.map(car => { return car.label }) - // let index = 1 - // let origin = copycard.label.split('(copy')[0] || 'button' - // let label = origin + '(copy)' - // while (names.includes(label)) { - // label = origin + `(copy${index})` - // index++ - // } - copycard.label = copycard.label + '(copy)' let indexes = cards.map(car => { return car.id }) @@ -57,12 +49,6 @@ newid++ } copycard.id = newid - - // const { index: overIndex } = findCard(`${card.id}`) - - // const _cards = update(cards, { $splice: [[overIndex + 1, 0, copycard]] }) - // setCards(_cards) - // handleList({action: _cards}) copyElement(copycard) } @@ -110,6 +96,7 @@ newcard.innerFunc = '' newcard.outerFunc = '' newcard.sql = '' + newcard.sqlType = '' newcard.Ot = 'requiredSgl' newcard.OpenType = item.subType newcard.icon = '' @@ -161,7 +148,7 @@ const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] }) setCards(_cards) - handleList({[type]: _cards}) + handleList(type, _cards, newcard) target = null } }) -- Gitblit v1.8.0