Fix: Updated color parsing functions and optimized component logic. (#10159)

### What problem does this PR solve?

refactor(timeline, modal, dataflow-result, dataset-overview): Updated
color parsing functions and optimized component logic.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
chanx
2025-09-19 09:57:44 +08:00
committed by GitHub
parent 5c1791d7f0
commit f9c7404bee
16 changed files with 298 additions and 72 deletions

View File

@ -1,3 +1,4 @@
import { TimelineNode } from '@/components/originui/timeline';
import Spotlight from '@/components/spotlight';
import { Spin } from '@/components/ui/spin';
import classNames from 'classnames';
@ -6,13 +7,18 @@ import { useTranslation } from 'react-i18next';
import FormatPreserveEditor from './components/parse-editer';
import RerunButton from './components/rerun-button';
import { useFetchParserList, useFetchPaserText } from './hooks';
const ParserContainer = () => {
interface IProps {
isChange: boolean;
setIsChange: (isChange: boolean) => void;
step?: TimelineNode;
}
const ParserContainer = (props: IProps) => {
const { isChange, setIsChange, step } = props;
const { data: initialValue, rerun: onSave } = useFetchPaserText();
const { t } = useTranslation();
const { loading } = useFetchParserList();
const [initialText, setInitialText] = useState(initialValue);
const [isChange, setIsChange] = useState(false);
const handleSave = (newContent: string) => {
console.log('保存内容:', newContent);
if (newContent !== initialText) {
@ -23,14 +29,17 @@ const ParserContainer = () => {
}
// Here, the API is called to send newContent to the backend
};
const handleReRunFunc = () => {
setIsChange(false);
};
return (
<>
{isChange && (
<div className=" absolute top-2 right-6">
<RerunButton />
<RerunButton step={step} onRerun={handleReRunFunc} />
</div>
)}
<div className={classNames('flex flex-col w-3/5')}>
<div className={classNames('flex flex-col w-full')}>
<Spin spinning={loading} className="" size="large">
<div className="h-[50px] flex flex-col justify-end pb-[5px]">
<div>