From d1cd5af5adb53e91efdd278328e1b6f8ad834fb5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 06 二月 2025 21:11:56 +0800 Subject: [PATCH] Merge branch 'positec' into dms --- src/templates/modalconfig/dragelement/index.jsx | 39 ++++++++++++++++++++++++--------------- 1 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/templates/modalconfig/dragelement/index.jsx b/src/templates/modalconfig/dragelement/index.jsx index 4db46b0..eb3a147 100644 --- a/src/templates/modalconfig/dragelement/index.jsx +++ b/src/templates/modalconfig/dragelement/index.jsx @@ -2,12 +2,12 @@ import { useDrop } from 'react-dnd' import { is, fromJS } from 'immutable' import update from 'immutability-helper' -import { Col } from 'antd' +import { Col, message } from 'antd' import Utils from '@/utils/utils.js' import Card from './card' import './index.scss' -const Container = ({list, setting, placeholder, handleList, handleForm, closeForm, showField }) => { +const Container = ({list, setting, handleList, handleForm, closeForm, showField }) => { const [cards, setCards] = useState(list) const moveCard = (id, atIndex) => { const { card, index } = findCard(id) @@ -62,12 +62,7 @@ let val = JSON.parse(JSON.stringify(_card)) val.copyType = 'form' - delete val.$srcId - - let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') - if (srcid) { - val.$srcId = srcid - } + _card.$copy = true oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) document.body.appendChild(oInput) @@ -77,11 +72,15 @@ oInput.style.display = 'none' document.body.removeChild(oInput) - const _cards = update(cards, { $splice: [[overIndex + 1, 0, _card]] }) - - setCards(_cards) - - handleList(_cards, _card) + if (window.GLOB.CopyOnly) { + message.success('澶嶅埗鎴愬姛銆�') + } else { + const _cards = update(cards, { $splice: [[overIndex + 1, 0, _card]] }) + + setCards(_cards) + + handleList(_cards, _card) + } } const [, drop] = useDrop({ @@ -99,10 +98,14 @@ newcard.options = [] newcard.readonly = 'false' newcard.required = 'true' + newcard.readin = 'top' newcard.focus = true if (item.subType === 'linkMain') { newcard.hidden = 'true' + newcard.verifyVal = 'true' + } else if (item.subType === 'textarea') { + newcard.required = 'false' } let targetId = '' @@ -114,7 +117,13 @@ targetId = cards[cards.length - 1].uuid } - const { index: overIndex } = findCard(`${targetId}`) // cards涓虹┖鏃� overIndex 涓� -1 + const { index: overIndex, card } = findCard(`${targetId}`) // cards涓虹┖鏃� overIndex 涓� -1 + + if (card) { + newcard.span = card.span || 12 + newcard.labelwidth = card.labelwidth || 33.3 + } + const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] }) setCards(_cards) @@ -142,7 +151,7 @@ })} {cards.length === 0 && <div className="modal-drawarea-placeholder"> - {placeholder} + 璇锋坊鍔犺〃鍗� </div> } </div> -- Gitblit v1.8.0