diff --git a/packages/lb-components/src/assets/attributeIcon/icon_eyeLock_a.svg b/packages/lb-components/src/assets/attributeIcon/icon_eyeLock_a.svg new file mode 100644 index 000000000..672367061 --- /dev/null +++ b/packages/lb-components/src/assets/attributeIcon/icon_eyeLock_a.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/lb-components/src/assets/attributeIcon/icon_eyeLock_h.svg b/packages/lb-components/src/assets/attributeIcon/icon_eyeLock_h.svg new file mode 100644 index 000000000..94fb1cea6 --- /dev/null +++ b/packages/lb-components/src/assets/attributeIcon/icon_eyeLock_h.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/lb-components/src/components/attributeList/index.tsx b/packages/lb-components/src/components/attributeList/index.tsx index a8744cba9..0a4c99d09 100644 --- a/packages/lb-components/src/components/attributeList/index.tsx +++ b/packages/lb-components/src/components/attributeList/index.tsx @@ -1,13 +1,17 @@ +import lockSvg from '@/assets/attributeIcon/icon_eyeLock_a.svg'; +import unlockSvg from '@/assets/attributeIcon/icon_eyeLock_h.svg'; import { COLORS_ARRAY, NULL_COLOR } from '@/data/Style'; import { ColorTag } from '@/components/colorTag'; import { Radio } from 'antd/es'; -import React, { useState } from 'react'; -import { Popover } from 'antd'; +import React, { useState, useEffect } from 'react'; +import { Popover, message } from 'antd'; import ColorPalette from '../colorPalette'; import { CloseOutlined } from '@ant-design/icons'; import { useTranslation } from 'react-i18next'; import { ILimit, IDefaultSize } from '@labelbee/lb-utils'; import LimitPopover from './components/limitPopover'; +import _ from 'lodash'; +import { CommonToolUtils, MathUtils } from '@labelbee/lb-annotation'; export const ATTRIBUTE_COLORS = [NULL_COLOR].concat(COLORS_ARRAY); @@ -39,6 +43,7 @@ const AttributeList = React.forwardRef((props: IProps, ref) => { const [paletteVisible, setPaletteVisible] = useState(false); const [editConfigIndex, setEditConfigIndex] = useState(undefined); + const [attributeLockList, setAttributeLockList] = useState([]); let NEW_ATTRIBUTE_COLORS = [...ATTRIBUTE_COLORS]; @@ -52,19 +57,84 @@ const AttributeList = React.forwardRef((props: IProps, ref) => { className = 'sensebee-radio-group-no-limit-height'; } + const keyDown = (e: any) => { + if (!CommonToolUtils.hotkeyFilter(e) || props?.forbidColor) { + // 如果为输入框则进行过滤 + return; + } + let keyCode = e.keyCode; + // 文件夹标签工具没有无属性 + if (props.forbidDefault === true) { + keyCode = keyCode - 1; + } + let attributeInfo; + + if (MathUtils.isInRange(e.keyCode, [48, 57])) { + attributeInfo = props.list[keyCode - 48]; + } + + if (MathUtils.isInRange(e.keyCode, [96, 105])) { + attributeInfo = props.list[keyCode - 96]; + } + if (e.shiftKey && attributeInfo) { + if (!props?.attributeLockChange) { + // 过滤属性查看事件 + return; + } + checkLock(e, attributeInfo); + e.preventDefault(); + return; + } + + if (MathUtils.isInRange(e.keyCode, [48, 57]) || MathUtils.isInRange(e.keyCode, [96, 105])) { + props?.attributeChanged?.(attributeInfo?.value ?? ''); + } + }; + + useEffect(() => { + window.addEventListener('keydown', keyDown); + return () => window.removeEventListener('keydown', keyDown); + }); + const changeColor = (value: string, color: string) => { if (props.updateColorConfig) { props.updateColorConfig(value, color); } }; + const attributeClick = (e: any, attributeInfo: any) => { + if (e.shiftKey && props?.attributeLockChange) { + checkLock(e, attributeInfo); + return; + } + props.attributeChanged(e.target.value); + }; + + const checkLock = (e: any, attributeInfo: any) => { + if (props?.forbidColor) { + return; + } + const hadLock = attributeLockList.includes(attributeInfo.value); + let newAttributeLockList = _.cloneDeep(attributeLockList); + if (hadLock) { + newAttributeLockList = newAttributeLockList.filter((i) => i !== attributeInfo.value); + } else { + newAttributeLockList.push(attributeInfo.value); + } + setAttributeLockList(newAttributeLockList); + props?.attributeLockChange?.(newAttributeLockList); + if (!hadLock) { + message.success(t('AttributeLockNotify', { label: attributeInfo.label })) + } + e.preventDefault(); + }; + return (
props.attributeChanged(e.target.value)} ref={ref as any} > {list.map((i: any, index: number) => { @@ -97,7 +167,7 @@ const AttributeList = React.forwardRef((props: IProps, ref) => { const showLimitPopover = isChosen && hasLimit && props.forbidShowLimitPopover !== true; return ( - + attributeClick(e, i)}> {!props?.forbidColor && ( { {i.label} + {!props?.forbidColor && props?.attributeLockChange && ( + checkLock(e, i)} + src={attributeLockList.includes(i.value) ? lockSvg : unlockSvg} + style={{ + display: attributeLockList.includes(i.value) ? 'inline-block' : '', + }} + className='sensebee-radio-icon' + /> + )} {showLimitPopover && } {hotKey} diff --git a/packages/lb-components/src/components/audioAnnotate/audioSide/clipSidebar/index.tsx b/packages/lb-components/src/components/audioAnnotate/audioSide/clipSidebar/index.tsx index 69a687c1f..122eb3253 100644 --- a/packages/lb-components/src/components/audioAnnotate/audioSide/clipSidebar/index.tsx +++ b/packages/lb-components/src/components/audioAnnotate/audioSide/clipSidebar/index.tsx @@ -11,6 +11,7 @@ import LongText from '@/components/longText'; import { classnames } from '@/utils'; import styles from './index.module.scss'; +import { useTranslation } from 'react-i18next'; interface IClipSidebarProps { /** 截取片段数组 */ @@ -22,6 +23,7 @@ interface IClipSidebarProps { const ClipSidebar = (props: IClipSidebarProps) => { const { regions = [], updateRegion, useAudioClipStore } = props; const { audioClipState, setAudioClipState } = useAudioClipStore(); + const { t } = useTranslation(); const { selectedAttribute, @@ -57,7 +59,7 @@ const ClipSidebar = (props: IClipSidebarProps) => { return (
-
已截取音频
+
{t('ClippedAudio')}
{regions.length > 0 ? (
{regions.map((item) => { @@ -67,7 +69,7 @@ const ClipSidebar = (props: IClipSidebarProps) => { const showText = `${ clipAttributeConfigurable ? getAttributeShowText(attribute, list) : '' }${clipAttributeConfigurable && clipTextConfigurable ? ',' : ''}${ - clipTextConfigurable ? `文本:${text}` : '' + clipTextConfigurable ? `${t('textTool')}:${text}` : '' }`; return (
{ })}
) : ( -
暂无截取内容
+
{t('NoClippedData')}
)}
{clipAttributeConfigurable && clipAttributeList?.length > 0 && ( diff --git a/packages/lb-components/src/components/audioAnnotate/audioSide/labelFilterInput/index.tsx b/packages/lb-components/src/components/audioAnnotate/audioSide/labelFilterInput/index.tsx index 01348e9e6..88e0f550b 100644 --- a/packages/lb-components/src/components/audioAnnotate/audioSide/labelFilterInput/index.tsx +++ b/packages/lb-components/src/components/audioAnnotate/audioSide/labelFilterInput/index.tsx @@ -2,6 +2,7 @@ import styles from './index.module.scss'; import React from 'react'; import { Input } from 'antd'; import { SearchOutlined } from '@ant-design/icons'; +import { useTranslation } from 'react-i18next'; const syntheticEventStopPagination = (e: React.KeyboardEvent) => { e.stopPropagation(); @@ -16,6 +17,8 @@ const LabelFilterInput = ({ value: string; onChange: (event: React.ChangeEvent) => void; }) => { + const { t } = useTranslation(); + return ( diff --git a/packages/lb-components/src/components/audioAnnotate/audioSide/labelSidebar/index.tsx b/packages/lb-components/src/components/audioAnnotate/audioSide/labelSidebar/index.tsx index 742e2bc4c..ec9d2c1b7 100644 --- a/packages/lb-components/src/components/audioAnnotate/audioSide/labelSidebar/index.tsx +++ b/packages/lb-components/src/components/audioAnnotate/audioSide/labelSidebar/index.tsx @@ -12,6 +12,7 @@ import { TagUtils } from '@labelbee/lb-annotation'; import clearSmall from '@/assets/annotation/common/icon_clearSmall.svg'; import clearSmallA from '@/assets/annotation/common/icon_clearSmall_a.svg'; import { IEntityDetail } from '@/types/tool' +import { withTranslation } from 'react-i18next'; const createHighlightLabel = (key: string, val: string) => { return highlightKeyword(key, val, '#666FFF'); @@ -69,11 +70,12 @@ interface IProps { entityMap?: Map; dynamicTag?: boolean; // 是否开始动态标签 withPanelTab?: boolean; + t: any; } const { Panel } = Collapse; -export default class LabelSidebar extends Component { +class LabelSidebar extends Component { private sideBar: React.RefObject = React.createRef(); public constructor(props: IProps) { @@ -165,6 +167,7 @@ export default class LabelSidebar extends Component { tagResult, clearResult, entityMap, + t, } = this.props; const { hoverDeleteIndex, expandKeyList, inputValue } = this.state; @@ -206,7 +209,6 @@ export default class LabelSidebar extends Component { if (!labelInfoSet) { return; } - return labelInfoSet.map((info: ILabelInfo | IFilteredLabelInfo, index: number) => { if (info.subSelected) { if (inputValue && !info.hasShow) { @@ -216,6 +218,7 @@ export default class LabelSidebar extends Component { // 判断是否有数据 const isResult = TagUtils.judgeResultIsInInputList(info.value, tagResult?.[info.value as keyof typeof tagResult], inputList); + return ( { > {info.key} - + { @@ -325,7 +328,7 @@ export default class LabelSidebar extends Component { return ( labelInfoSet.length === 0 ? ( -
暂无信息配置
+
{t('NoConfiguration')}
) : (
@@ -341,7 +344,7 @@ export default class LabelSidebar extends Component { color: '#999', }} > - 暂无数据 + {t('NoData')}
)}
@@ -351,3 +354,6 @@ export default class LabelSidebar extends Component { ); } } + +const LabelSidebarWithTrans = withTranslation()(LabelSidebar) +export default LabelSidebarWithTrans diff --git a/packages/lb-components/src/components/audioAnnotate/index.tsx b/packages/lb-components/src/components/audioAnnotate/index.tsx index 722310663..23d05f9bd 100644 --- a/packages/lb-components/src/components/audioAnnotate/index.tsx +++ b/packages/lb-components/src/components/audioAnnotate/index.tsx @@ -6,7 +6,7 @@ import { Layout } from 'antd/es'; import { Spin } from 'antd'; import { prefix } from '@/constant'; import { AppProps } from '@/App'; -import { cKeyCode, CommonToolUtils, cTool, uuid, TagUtils } from '@labelbee/lb-annotation'; +import { cKeyCode, CommonToolUtils, cTool, uuid, TagUtils, EventBus } from '@labelbee/lb-annotation'; import styles from './index.module.scss'; import TagResultShow from '@/components/audioAnnotate/tagResultShow'; import { AudioClipProvider, useAudioClipStore } from './audioContext'; @@ -330,6 +330,10 @@ const AudioAnnotate: React.FC = (props) => { } }, [loading]) + useEffect(() => { + initToolInstance() + }, []) + useEffect(() => { toolInstanceRef.current.exportData = () => { return [[result], { duration, valid }]; @@ -337,9 +341,36 @@ const AudioAnnotate: React.FC = (props) => { toolInstanceRef.current.setResult = updateResult toolInstanceRef.current.clearResult = clearResult - + toolInstanceRef.current.currentPageResult = result?.regions + toolInstanceRef.current.emit('updatePageNumber') }, [result]); + + const initToolInstance = () => { + toolInstanceRef.current.emit = (event: string) => { + const listener = toolInstanceRef.current.fns.get(event); + if (listener) { + listener.forEach((fn: any) => { + if (fn) { + fn?.(); + } + }); + } + } + toolInstanceRef.current.fns = new Map() + toolInstanceRef.current.singleOn = (event: string, func: () => void) => { + toolInstanceRef.current.fns.set(event, [func]); + }; + + toolInstanceRef.current.on = (event: string, func: () => void) => { + toolInstanceRef.current.singleOn(event, func); + }; + + toolInstanceRef.current.unbindAll = (eventName: string) => { + toolInstanceRef.current.fns.delete(eventName); + }; + } + const currentResult = useMemo(() => { const stepResult = basicInfo[`step_${stepInfo?.step}`] return stepResult?.result || [] @@ -482,6 +513,7 @@ const AudioAnnotate: React.FC = (props) => { const updateResult = (result: any) => { setResult(result) } + const clearResult = () => { setResult((result: any) => ({ ...result, @@ -489,6 +521,7 @@ const AudioAnnotate: React.FC = (props) => { tag: {}, regions: [], })) + EventBus.emit('clearRegions'); } return diff --git a/packages/lb-components/src/components/audioAnnotate/textInput/index.tsx b/packages/lb-components/src/components/audioAnnotate/textInput/index.tsx index bde4ec256..e4623f90f 100644 --- a/packages/lb-components/src/components/audioAnnotate/textInput/index.tsx +++ b/packages/lb-components/src/components/audioAnnotate/textInput/index.tsx @@ -9,6 +9,7 @@ import classnames from 'classnames'; import AudioContext, { useAudioClipStore } from '../audioContext'; import styles from './index.module.scss'; import { IInputList } from '@/types/main'; +import { useTranslation } from 'react-i18next'; // import { AlgorithmButtonForText } from '../icons/algorithmButton'; const EKeyCode = cKeyCode.default @@ -74,6 +75,8 @@ interface IProps { } export const SingleTextInput = (props: any) => { + const { t } = useTranslation(); + const ref = useRef(null); const [textAreaFocus, setTextAreaFocus] = useState(false); const [invalid, setInvalid] = useState(false); @@ -172,8 +175,8 @@ export const SingleTextInput = (props: any) => { const TextareaFooter = (
- {tabToSwitchEnabled && [切换]Tab} - [翻页]Ctrl+Enter + {tabToSwitchEnabled && [{t('Switch')}]Tab} + [{t('TurnPage')}]Ctrl+Enter
= maxLength ? styles.warning : ''}>{textLength}/ @@ -261,6 +264,8 @@ const TextInput = (props: IProps) => { clipAttributeList = [], } = props; + const { t } = useTranslation(); + const [focusIndex, setFocusIndex] = useState(0); const [placeholder, setPlaceholder] = useState(''); const placeholderTimer = useRef(null); @@ -429,7 +434,7 @@ const TextInput = (props: IProps) => { const { id, start, end, attribute } = item; // 兼容SingleTextInput的props const config = { - label: `文本(${timeFormat(start, 'ss.SSS')} - ${timeFormat(end, 'ss.SSS')})`, + label: `${t('textTool')}(${timeFormat(start, 'ss.SSS')} - ${timeFormat(end, 'ss.SSS')})`, key: id, maxLength: 3000, }; diff --git a/packages/lb-components/src/components/audioPlayer/combineTip/index.tsx b/packages/lb-components/src/components/audioPlayer/combineTip/index.tsx index a2d3227e1..958945d04 100644 --- a/packages/lb-components/src/components/audioPlayer/combineTip/index.tsx +++ b/packages/lb-components/src/components/audioPlayer/combineTip/index.tsx @@ -7,6 +7,8 @@ import React from 'react'; import { useAudioClipStore } from '@/components/audioAnnotate/audioContext'; import { useHover, useMouse } from 'ahooks'; +import styles from '../index.module.scss'; +import { useTranslation } from 'react-i18next'; interface IProps { /** 展示的容器 */ @@ -14,6 +16,8 @@ interface IProps { } const CombineTip = (props: IProps) => { + const { t } = useTranslation(); + const { container } = props; const { audioClipState } = useAudioClipStore(); const { combined } = audioClipState; @@ -26,12 +30,13 @@ const CombineTip = (props: IProps) => { return (
- 请点击希望合并的区间 + {t('AudioCombineTip')}
); }; diff --git a/packages/lb-components/src/components/audioPlayer/index.module.scss b/packages/lb-components/src/components/audioPlayer/index.module.scss index 4ba0e94d4..2ad0c70c6 100644 --- a/packages/lb-components/src/components/audioPlayer/index.module.scss +++ b/packages/lb-components/src/components/audioPlayer/index.module.scss @@ -90,12 +90,6 @@ position: relative; padding-bottom: 10px; transform: scaleY(-1); - &.clip { - //cursor: url('../../assets/annotation/audio/blackClip.svg'), default; - } - &.combined { - //cursor: url('../../assets/annotation/audio/combine.svg') 10 12, default; - } } &::-webkit-scrollbar { width: 8px; diff --git a/packages/lb-components/src/components/audioPlayer/index.tsx b/packages/lb-components/src/components/audioPlayer/index.tsx index 0df399c21..409907735 100644 --- a/packages/lb-components/src/components/audioPlayer/index.tsx +++ b/packages/lb-components/src/components/audioPlayer/index.tsx @@ -437,14 +437,12 @@ export const AudioPlayer = ({ playImmediately: true, }); - const regionParam: IAudioTimeSlice = { + const regionParam = { id, start: decimalReserved(start, 3), end: decimalReserved(end, 3), - attribute: '', - text: '', } - updateRegion?.(regionParam); + updateRegion?.(regionParam as IAudioTimeSlice); update(); }; @@ -808,8 +806,8 @@ export const AudioPlayer = ({ }} className={classnames({ [styles.waveform]: true, - [styles.combined]: audioClipStateRef.current.combined, - [styles.clip]: audioClipStateRef.current.clipConfigurable, + 'bee-audio-combined': audioClipStateRef.current.combined, + 'bee-audio-clip': audioClipStateRef.current.clipConfigurable, })} > {invalid && } diff --git a/packages/lb-components/src/components/audioPlayer/labelDisplayToggle/index.tsx b/packages/lb-components/src/components/audioPlayer/labelDisplayToggle/index.tsx index e9d3cb699..1694747cf 100644 --- a/packages/lb-components/src/components/audioPlayer/labelDisplayToggle/index.tsx +++ b/packages/lb-components/src/components/audioPlayer/labelDisplayToggle/index.tsx @@ -2,11 +2,13 @@ import { Switch } from 'antd'; import React, { useState } from 'react'; import styles from './index.module.scss'; +import { useTranslation } from 'react-i18next'; interface IProps { EventBus: any } const LabelDisplayToggle = (props: IProps) => { + const { t } = useTranslation(); const { EventBus } = props const [visible, setVisible] = useState(true); const onChange = (val: boolean) => { @@ -16,7 +18,7 @@ const LabelDisplayToggle = (props: IProps) => { return ( - 标签对照显示 + {t('CompareTags')} { const ref = useRef(null); + const { t } = useTranslation(); + const { segmentTimeTip } = props; const mouse = useMouse(ref.current); @@ -23,15 +27,18 @@ const SegmentTip = (props: IProps) => { return null; } + return (
- 请选择希望截取的时间点({timeFormat(segmentTimeTip, 'ss.SSS')}) + {t('AudioSegmentTip', { time: timeFormat(segmentTimeTip, 'ss.SSS')})}
); }; diff --git a/packages/lb-components/src/components/audioPlayer/zoomSlider/index.tsx b/packages/lb-components/src/components/audioPlayer/zoomSlider/index.tsx index 4f278055f..ca7c7f13b 100644 --- a/packages/lb-components/src/components/audioPlayer/zoomSlider/index.tsx +++ b/packages/lb-components/src/components/audioPlayer/zoomSlider/index.tsx @@ -7,6 +7,7 @@ import { cKeyCode } from '@labelbee/lb-annotation'; import { useLatest } from 'ahooks'; import styles from './index.module.scss'; +import { useTranslation } from 'react-i18next'; const EKeyCode = cKeyCode.default @@ -25,6 +26,7 @@ interface IZoomSliderProps { const ZoomSlider = (props: IZoomSliderProps) => { const { onChange, zoom } = props; + const { t } = useTranslation(); const zoomRef = useLatest(zoom); const changeHandler = (newValue: number) => { @@ -72,7 +74,7 @@ const ZoomSlider = (props: IZoomSliderProps) => { return (
-
缩放
+
{t('Scale')}
{ const { onChange, playerType } = props; + const { t } = useTranslation(); const PLAYBACK_RATE_SPEED = PLAYER_TYPE_RATE_SPEED[playerType]; const MAX_PLAYBACK_RATE_SPEED = PLAYBACK_RATE_SPEED.slice(-1)[0]; const MIN_PLAYBACK_RATE_SPEED = PLAYBACK_RATE_SPEED[0]; @@ -72,7 +74,7 @@ const SpeedController = (props: IProps) => { alignItems: 'center', }} > - 倍速 + {t('Speed')} {rate}x diff --git a/packages/lb-components/src/hooks/annotation.ts b/packages/lb-components/src/hooks/annotation.ts index ce51ead14..35f689964 100644 --- a/packages/lb-components/src/hooks/annotation.ts +++ b/packages/lb-components/src/hooks/annotation.ts @@ -12,9 +12,9 @@ export interface ICustomToolInstance { valid: boolean; exportData: () => [any, {}]; exportCustomData: () => {}; - singleOn: () => void; + singleOn: (eventName: string, callback: (...args: any[]) => void) => void; clearResult: () => void; - on: () => void; + on: (eventName: string, callback: (...args: any[]) => void) => void; unbind: () => void; setResult: (result: any) => void; setValid: (valid: boolean) => void; diff --git a/packages/lb-components/src/index.scss b/packages/lb-components/src/index.scss index 29de690a3..fa6b14e3f 100644 --- a/packages/lb-components/src/index.scss +++ b/packages/lb-components/src/index.scss @@ -349,6 +349,9 @@ $prefix: bee; &:hover { background: #f3f4ff; + .sensebee-radio-icon{ + display: inline-block; + } } > span:nth-child(2) { @@ -374,6 +377,10 @@ $prefix: bee; overflow: hidden; text-overflow: ellipsis; } + .sensebee-radio-icon{ + margin-right: 10px; + display: none; + } } } @@ -2264,3 +2271,10 @@ $predictTrackingPrefix: #{$prefix}-point-cloud-predict-tracking; right: 0; z-index: -200; } + +.bee-audio-clip{ + cursor: url('./assets/annotation/audio/blackClip.svg'), default; +} +.bee-audio-combined{ + cursor: url('./assets/annotation/audio/combine.svg') 10 12, default; +} diff --git a/packages/lb-components/src/views/MainView/index.tsx b/packages/lb-components/src/views/MainView/index.tsx index 0fc85c4b7..0e1077b7e 100644 --- a/packages/lb-components/src/views/MainView/index.tsx +++ b/packages/lb-components/src/views/MainView/index.tsx @@ -26,7 +26,7 @@ import LLMLayout from './LLMLayout'; import AudioAnnotate from '@/components/audioAnnotate' import { LoadingOutlined } from '@ant-design/icons'; import { useTranslation } from 'react-i18next'; -import { EAudioToolName, EPointCloudName } from '@labelbee/lb-annotation'; +import { EPointCloudName } from '@labelbee/lb-annotation'; interface IProps { path: string; @@ -85,7 +85,7 @@ const ViewportProviderLayout = (props: AppProps & IProps & { children: any }) => const { t } = useTranslation(); const { stepList, step } = props; const currentToolName = getStepConfig(stepList, step)?.tool; - const hasLangNode = ![EToolName.LLM, EAudioToolName.AudioTextTool].includes(currentToolName) + const hasLangNode = ![EToolName.LLM].includes(currentToolName) const hasHeaderOption = ![EToolName.LLM].includes(currentToolName) const hasPredictTrackingIcon = [EPointCloudName.PointCloud].includes(currentToolName) return ( diff --git a/packages/lb-components/src/views/MainView/toolFooter/FooterTips/ToolHotKey/audioText/index.tsx b/packages/lb-components/src/views/MainView/toolFooter/FooterTips/ToolHotKey/audioText/index.tsx index 720dcadb5..e68c8e4a5 100644 --- a/packages/lb-components/src/views/MainView/toolFooter/FooterTips/ToolHotKey/audioText/index.tsx +++ b/packages/lb-components/src/views/MainView/toolFooter/FooterTips/ToolHotKey/audioText/index.tsx @@ -25,6 +25,7 @@ import { } from '../line' import IconPolygonMerge from '@/assets/annotation/toolHotKeyIcon/icon_polygonMerge_kj.svg'; import IconPolygonCut from '@/assets/annotation/toolHotKeyIcon/icon_polygonCut_kj.svg'; +import DrawRectSvg from '@/assets/annotation/toolHotKeyIcon/icon_frame_kj.svg'; const audioForward = _.cloneDeep(forward); const audioBackward = _.cloneDeep(backward); @@ -40,19 +41,33 @@ const audioPrev = _.cloneDeep(preLine); const audioNext = _.cloneDeep(nextLine); export const combineAudio = { - name: '合并区间', + name: 'CombineAudio', icon: IconPolygonMerge, noticeInfo: '', shortCut: ['Alt', 'Z'], }; export const splitAudio = { - name: '分割区间', + name: 'ClipAudio', icon: IconPolygonCut, noticeInfo: '', shortCut: ['Alt', 'X'], }; +audioForward.name = 'NextFile'; +audioBackward.name = 'PreviousFile'; +audioBackTrack.name = 'Forward0.1'; +audioForwardTrack.name = 'Back0.1'; +audioToggleClipMode.name = 'SwitchClipMode'; +audioClipped.name = 'Clip'; +audioTag.name = 'TaggingOrAttr'; +audioPrev.name = 'PreviousInterval'; +audioNext.name = 'NextInterval'; + +audioClipped.icon = DrawRectSvg; + +audioToggleClipMode.noticeInfo = ''; + const audioTextToolShortCurTable = [ saveResult, audioToggleTagMode, diff --git a/packages/lb-components/src/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.tsx b/packages/lb-components/src/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.tsx index 194413661..a798b6be1 100644 --- a/packages/lb-components/src/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.tsx +++ b/packages/lb-components/src/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.tsx @@ -187,7 +187,7 @@ export const rewind = { }; export const toggleTagMode = { - name: '切换标签模式', + name: 'SwitchTagMode', icon: ToggleTagModeSvg, shortCut: ['L'], }; @@ -196,7 +196,7 @@ export const tag = { name: '打标签', icon: IconTagKj, shortCut: [DragWithLeftClickSvg], - noticeInfo: '左击', + noticeInfo: 'LeftClick', }; export const period = { @@ -207,27 +207,27 @@ export const period = { }; export const clipSelected = { - name: '截取选中', + name: 'ClipSelect', icon: IconClipSelected, shortCut: [DragWithRightClickShortCutSvg], - noticeInfo: '右击', + noticeInfo: 'RightClick', }; export const deleteRemark = { - name: '删除批注', + name: 'DeleteComment', icon: IconDeleteRemark, shortCut: ['Delete'], - noticeInfo: '选中时', + noticeInfo: 'SelectedStatus', }; export const nextRemark = { - name: '下一条批注', + name: 'NextComment', icon: IconNextRemark, shortCut: ['Tab'], }; export const preRemark = { - name: '上一条批注', + name: 'PreviousComment', icon: IconPreRemark, shortCut: ['Shift', 'Tab'], }; diff --git a/packages/lb-demo/src/mock/index.js b/packages/lb-demo/src/mock/index.js index 6722e0b77..d766cfc90 100644 --- a/packages/lb-demo/src/mock/index.js +++ b/packages/lb-demo/src/mock/index.js @@ -468,7 +468,7 @@ export const mockAudioList = [ id: 1, path: '230150176229189149233159179.mp3', name: '', - url: 'https://sensebee.oss-accelerate.aliyuncs.com/Development%2F8799%2F2.mp3?Expires=1693562399&OSSAccessKeyId=LTAI4Fcnhge5ysEwVNGjQCpU&Signature=ze0073LJhvux%2FJ%2FTVbquGVKlZX0%3D', + url: 'https://sensebee.oss-accelerate.aliyuncs.com/Development%2F8978%2F2.wav?Expires=1701341999&OSSAccessKeyId=LTAI4Fcnhge5ysEwVNGjQCpU&Signature=s5eX9GyK6VM42Xk0jZtYndYfwI0%3D', processedUrl: 'https://sensebee.oss-accelerate.aliyuncs.com/Development%2F8799%2F2.mp3?Expires=1693378799&OSSAccessKeyId=LTAI4Fcnhge5ysEwVNGjQCpU&Signature=5u3nNCoKi64X487g%2F23wJR1486w%3D', result: '', diff --git a/packages/lb-demo/src/mock/taskConfig.js b/packages/lb-demo/src/mock/taskConfig.js index 52210c207..6caa628d7 100644 --- a/packages/lb-demo/src/mock/taskConfig.js +++ b/packages/lb-demo/src/mock/taskConfig.js @@ -300,7 +300,7 @@ const audioToolConfig = { "skipWhileNoDependencies": false, "configList": [ { - "label": "文本", + "label": "测试文本", "key": "text", "required": false, "default": "", diff --git a/packages/lb-utils/src/i18n/resources.json b/packages/lb-utils/src/i18n/resources.json index a5bbe220e..7c856b117 100644 --- a/packages/lb-utils/src/i18n/resources.json +++ b/packages/lb-utils/src/i18n/resources.json @@ -83,6 +83,7 @@ "SwitchPattern": "Switch Pattern", "Tagging": "Tagging", "Hide": "Hide ", + "TaggingOrAttr": "Tag/attribute", "HideDrawnAnnotation": "Hidden Drawn Annotation", "Blue": "Blue", "Cyan": "Cyan", @@ -142,6 +143,7 @@ "PointCount": "Point Count", "Invalid": "Invalid", "Tag": "Tag", + "SearchTag": "Search tags", "Attribute": "Attribute", "SubAttribute": "SubAttribute", "PleaseSelect": "Please Select", @@ -267,7 +269,28 @@ "AnswerGenerationFailedPleaseTryAgainLater": "Answer generation failed, please try again later", "ReGenerate": "Re-generate", "AnswerTextEdit": "Answer text edit", - "ShowEditingResultDifferencesInTextModeOnly": "Show editing result differences in text mode only" + "ShowEditingResultDifferencesInTextModeOnly": "Show editing result differences in text mode only", + "AttributeLockNotify": "View Properties:{{label}},only display the annotation content of the selected properties", + "AudioSegmentTip": "Please select the desired time point for capture({{time}})", + "AudioCombineTip": "Please click on the intervals you wish to merge", + "ClippedAudio": "Captured content", + "NoClippedData": "No captured content", + "CompareTags": "Tag comparison display", + "CombineAudio": "Merge intervals", + "ClipAudio": "Split intervals", + "SwitchClipMode": "Switch to capture mode", + "SwitchTagMode": "Switch to tag mode", + "Clip": "Capture", + "PreviousInterval": "Previous interval", + "NextInterval": "Next interval", + "DeleteComment": "Delete Comments", + "PreviousComment": "Previous comment", + "NextComment": "Next comment", + "ClipSelect": "Select", + "Forward0.1": "Advance by 0.1 seconds", + "Back0.1": "Rewind by 0.1 seconds", + "LeftClick": "Left-click", + "RightClick": "Right-click" }, "cn": { "TextInput": "文本输入", @@ -352,6 +375,7 @@ "SwitchPattern": "切换绘制形式", "Tagging": "打标签", "Hide": "打标签", + "TaggingOrAttr": "打标签/属性", "HideDrawnAnnotation": "标注隐藏中", "Blue": "蓝", "Cyan": "青", @@ -412,6 +436,7 @@ "PointCount": "点数", "Invalid": "无效", "Tag": "标签", + "SearchTag": "搜索标签", "Attribute": "主属性", "SubAttribute": "副属性", "PleaseSelect": "请选择", @@ -537,6 +562,27 @@ "AnswerGenerationFailedPleaseTryAgainLater": "回答生成失败,请稍后重试", "ReGenerate": "重新生成", "AnswerTextEdit": "回答文本编辑", - "ShowEditingResultDifferencesInTextModeOnly": "仅文本模式下显示编辑结果差异" + "ShowEditingResultDifferencesInTextModeOnly": "仅文本模式下显示编辑结果差异", + "AttributeLockNotify": "查看属性:{{label}},只显示所选属性的标注内容", + "AudioSegmentTip": "请选择希望截取的时间点({{time}})", + "AudioCombineTip": "请点击希望合并的区间", + "ClippedAudio": "已截取音频", + "NoClippedData": "暂无截取内容", + "CompareTags": "标签对照显示", + "CombineAudio": "合并区间", + "ClipAudio": "分割区间", + "SwitchClipMode": "切换截取模式", + "SwitchTagMode": "切换标签模式", + "Clip": "截取", + "PreviousInterval": "上一区间", + "NextInterval": "下一区间", + "DeleteComment": "删除批注", + "PreviousComment": "上一条批注", + "NextComment": "下一条批注", + "ClipSelect": "截取选中", + "Forward0.1": "前进0.1s", + "Back0.1": "后退0.1s", + "LeftClick": "左击", + "RightClick": "右击" } } \ No newline at end of file