!2904 优化:复制bbs模态框输入框只复制输入框的值

pull/2917/MERGE
钱若寒 2 months ago committed by 黄诗津
parent 13df2458ae
commit be94893a13

@ -808,7 +808,7 @@ export class BBSRemarksComponent extends React.Component<IBBSComponentProps>
{
render()
{
const { board, option, index, click } = this.props;
const { board, option, index, click, } = this.props;
return (
<div
className="bbs-list-td bbs-td remarks"

@ -8,14 +8,15 @@ import { ParseBoardRectHoleType } from "../../../Add-on/DrawDrilling/HoleUtils";
import { EBoardKeyList } from "../../../Common/BoardKeyList";
import { CheckObjectType } from "../../../Common/CheckoutVaildValue";
import { BigFaceSelectOption, ComposingFaceSelectOption, LineTypeSelectOption } from "../../../Common/CommonSelectOption";
import { FixedNotZero } from "../../../Common/Utils";
import { KeyBoard } from "../../../Common/KeyEnum";
import { copyTextToClipboard, FixedNotZero } from "../../../Common/Utils";
import { safeEval } from "../../../Common/eval";
import { Board } from "../../../DatabaseServices/Entity/Board";
import { LinesType } from "../../../DatabaseServices/Entity/BoardInterface";
import { ObjectId } from "../../../DatabaseServices/ObjectId";
import { ProcessingGroupRecord } from "../../../DatabaseServices/ProcessingGroup/ProcessingGroupRecord";
import { userConfig } from "../../../Editor/UserConfig";
import { TotalTabbarTitlesInfos, bbsEditorStore } from "../../Store/BBSEditorStore";
import { bbsEditorStore, TotalTabbarTitlesInfos } from "../../Store/BBSEditorStore";
import { BoardProcessOption } from "../../Store/OptionInterface/BoardProcessOption";
import { TopPanelStore } from "../../Store/TopPanelStore";
import { ToasterInput } from "../Toaster";
@ -137,6 +138,7 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
style={{
...this.props.style, width: "fit-content", background: `${trBgColor}`
}}
onKeyDown={(e) => this.HandleOnKeyDown(e)}
>
<div
className="bbs-list-td bbs-td bbsNumber"
@ -363,6 +365,16 @@ export class BoardInfoList extends React.Component<IBoardInfoListProps, {}>
UpdateSeletctedBr(index, findSameTypeBrDataKey);
this.isSelected = this.props.selectedBrOnList.includes(this.props.realBr);
};
HandleOnKeyDown = (e) =>
{
if (e.keyCode === KeyBoard.KeyC && e.ctrlKey)
{
e.stopPropagation();
e.preventDefault();
const copiedText = document.getSelection().toString();
copyTextToClipboard(copiedText);
}
};
GetBgColor = () =>
{
let isLightTheme = document.body.classList.contains("light-golden");

@ -26,7 +26,7 @@ interface IBoardListProps
isCtrlDown: boolean;
processGroupMap: Map<string, ObjectId[]>;
modifyBoardData: Map<Board, IBoardInfoOptions>;
UpdateSeletctedBr: (index: number, findSameTypeBrDataKey?: string, isSelect?: boolean) => void;
UpdateSeletctedBr: (index: number, findSameTypeBrDataKey?: string, isSelect?: boolean, selectedCount?: number) => void;
ModifyBoard: (br: Board, opts: IBoardInfoOptions) => void;
TitleResize: (e: React.PointerEvent<HTMLDivElement>, title: string) => void;
}
@ -65,10 +65,12 @@ export class BoardList extends React.Component<IBoardListProps>
this.selectTool = new SelectBBSDataTool(listElement) as SelectBBSDataTool;
this.selectTool.SelectCallBack = (sequence: number[]) =>
{
this.props.selectedBrOnList.length = 0;
let selectedCount = sequence.length;//判断是框选还是单选
if (selectedCount > 1 || sequence[0] > this.props.searchRes.realBr.length)//框选或者点击了bbs表格空白处
this.props.selectedBrOnList.length = 0;
for (const index of sequence)
{
this.props.UpdateSeletctedBr(index, undefined, true);
this.props.UpdateSeletctedBr(index, undefined, true, selectedCount);
}
this.selected++;
};

@ -629,15 +629,34 @@ export class LookOverBoardInfosModal extends React.Component<LookOverBoardInfosM
app.Editor.SelectCtrl.UpdateView();
};
//更新选中板件
UpdateSeletctedBr = action((index: number, findSameTypeBrDataKey?: string, isSelect?: boolean) =>
UpdateSeletctedBr = action((index: number, findSameTypeBrDataKey?: string, isSelect?: boolean, selectedCount?: number) =>
{
if (index >= this.searchRes.realBr.length) return;
// 点击超出bbs表格的部分
if (index >= this.searchRes.realBr.length)
{
return;
}
let br = this.searchRes.realBr[index];
if (isSelect)
{
if (!this.selectedBrOnList.includes(br))
// 按住Ctrl多选
if (this.isCtrlDown)
{
this.selectedBrOnList.push(br);
if (this.selectedBrOnList.includes(br))
{
this.selectedBrOnList = this.selectedBrOnList.filter((b) => b !== br);
}
else
this.selectedBrOnList.push(br);
}
else
{
if (selectedCount === 1)// 根据选中数组长度判断是框选还是单选
this.selectedBrOnList.length = 0;
if (!this.selectedBrOnList.includes(br))
{
this.selectedBrOnList.push(br);
}
}
}
else

Loading…
Cancel
Save