From f4a7438d3a15582f956f58253532d54a34f5cec0 Mon Sep 17 00:00:00 2001 From: pengjunlong <727137732@qq.com> Date: Mon, 10 Mar 2025 13:40:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E8=81=94=E8=A1=A8=E5=8D=95=E8=A1=8C?= =?UTF-8?q?=E5=86=85=E6=94=AF=E6=8C=81=E6=95=B0=E6=8D=AE=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E3=80=81=E5=A4=9A=E9=80=89=E6=94=AF=E6=8C=81=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 +-- .../TablePack/components/ValueEdit/index.js | 9 ++++-- .../Account/components/TablePack/index.js | 29 ++++++++++++++++--- .../widgets/advanced/RelationForm/index.js | 11 +++++-- 4 files changed, 42 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index af3feec..6914347 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "panda-xform", - "version": "6.10.98", - "description": "6.10.98 鏀寔琛屽唴鏃堕棿鑷姩璁$畻銆佸墠绔敓鎴愮紪鐮�", + "version": "6.10.99", + "description": "6.10.99 鍏宠仈琛ㄥ崟琛屽唴鏀寔鏁版嵁澶嶅埗銆佸閫夋敮鎸佹悳绱�", "keywords": [ "panda-xform" ], diff --git a/src/core/Account/components/TablePack/components/ValueEdit/index.js b/src/core/Account/components/TablePack/components/ValueEdit/index.js index f9a4a0e..da9a4c2 100644 --- a/src/core/Account/components/TablePack/components/ValueEdit/index.js +++ b/src/core/Account/components/TablePack/components/ValueEdit/index.js @@ -1,5 +1,5 @@ import React, { useEffect, useCallback, useMemo, useState } from 'react' -import { Input, InputNumber, DatePicker, Select } from 'antd' +import { Input, InputNumber, DatePicker, Select, Tooltip } from 'antd' import locale from 'antd/lib/date-picker/locale/zh_CN' import moment from 'moment' import { debounce } from '../../../../../../utils' @@ -394,7 +394,12 @@ const ValueEdit = (props) => { - return (<>{ renderWidget(widget) }</>) + return (<> + <Tooltip title={value}> + { renderWidget(widget) } + </Tooltip> + + </>) } diff --git a/src/core/Account/components/TablePack/index.js b/src/core/Account/components/TablePack/index.js index cecb437..d407bf3 100644 --- a/src/core/Account/components/TablePack/index.js +++ b/src/core/Account/components/TablePack/index.js @@ -1,8 +1,8 @@ import React, { useMemo, useState, forwardRef, useImperativeHandle, useRef, useEffect } from 'react' -import { Table, Button, Popconfirm, Input, Space, Tag, Popover, Checkbox, Form } from 'antd' +import { Table, Button, Popconfirm, Input, Space, Tag, Popover, Checkbox, Form, message } from 'antd' import { TweenOneGroup } from 'rc-tween-one' import styles from './index.less' -import { SearchOutlined, FormOutlined } from '@ant-design/icons' +import { SearchOutlined, FormOutlined, CopyOutlined } from '@ant-design/icons' import * as icons from '@ant-design/icons' import Text from './components/Text' import ResizeableTitle from './components/ResizeableTitle' @@ -315,7 +315,7 @@ const TablePack = (props, ref) => { } const btns = useMemo(() => { - let array = [] + let array = [{ title: '澶嶅埗', icon: <CopyOutlined /> }] //琛ㄦ牸鍙紪杈� if (isEdit) { if (!notUse?.includes('del')) { @@ -469,7 +469,9 @@ const TablePack = (props, ref) => { <Popconfirm key={v.title} title='纭畾瑕佸垹闄ゆ暟鎹悧锛�' - onConfirm={() => btnsClick({ type: v.title, row: r })} + onConfirm={() => { + btnsClick({ type: v.title, row: r }) + }} okText='纭畾' cancelText='鍙栨秷' > @@ -481,6 +483,25 @@ const TablePack = (props, ref) => { /> </Popconfirm> ) + }else if(v.title === '澶嶅埗'){ + return ( + <Button + key={v.title} + type='link' + title={v.title} + icon={v.icon} + style={{ padding: '0 7px' }} + onClick={() => { + let arr = []; + for (let key in r) { + arr.push(`${r[key]}`) + } + navigator.clipboard.writeText(arr.join('\t')); + message.success("鏁版嵁宸插鍒�"); + }} + > + </Button> + ) } return ( <Button diff --git a/src/core/widgets/advanced/RelationForm/index.js b/src/core/widgets/advanced/RelationForm/index.js index 628ed1f..7540010 100644 --- a/src/core/widgets/advanced/RelationForm/index.js +++ b/src/core/widgets/advanced/RelationForm/index.js @@ -67,7 +67,7 @@ const RelationForm = (props) => { const [paramsOther, setParamsOther] = useState(initParams) const [keys, setKeys] = useState([]) const baseFormRef = useRef(null) - + let clickDatas = useRef([]); const formDataObj = useMemo(() => { let formDataObj = {} if (addons) { @@ -449,7 +449,7 @@ const RelationForm = (props) => { let array = [] let items = [] let field = accountFieids.filter(v => v.webDisplay).map(v => v.fieldName) - dataSourceOther.forEach(v => { + clickDatas.current.forEach(v => { if (keys.includes(v.ID)) { let ID = `${getNanoid(10, '鍓嶇ID')}` @@ -489,6 +489,7 @@ const RelationForm = (props) => { } }) let dataList = await dealDataSource(array) + console.log(dataList, array, 'dataListdataListdataList'); setDataSources(dataList) // setDataSource([...dataSource, ...array]) setKeys([]) @@ -646,7 +647,11 @@ const RelationForm = (props) => { type: 'checkbox', selectedRowKeys: keys, fixed: 'left', - onChange: (keys) => setKeys(keys) + onChange: (key, rows) => { + const kList = [...new Set([...keys, ...key])] + clickDatas.current = [...new Map([...clickDatas.current, ...rows].map(item => [item.ID, item])).values()] + setKeys(kList) + } }} /> </div> -- 2.17.1