mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Convert the data of the messge operator to a string array #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -22,6 +22,7 @@ import { useHandleFormValuesChange } from '../hooks/use-watch-form-change';
|
||||
import OperatorIcon from '../operator-icon';
|
||||
import {
|
||||
buildCategorizeListFromObject,
|
||||
convertToObjectArray,
|
||||
needsSingleStepDebugging,
|
||||
} from '../utils';
|
||||
import SingleDebugDrawer from './single-debug-drawer';
|
||||
@ -79,16 +80,23 @@ const FormSheet = ({
|
||||
form.clearErrors();
|
||||
}
|
||||
|
||||
const formData = node?.data?.form;
|
||||
|
||||
if (operatorName === Operator.Categorize) {
|
||||
const items = buildCategorizeListFromObject(
|
||||
get(node, 'data.form.category_description', {}),
|
||||
);
|
||||
const formData = node?.data?.form;
|
||||
if (isPlainObject(formData)) {
|
||||
// form.setFieldsValue({ ...formData, items });
|
||||
console.info('xxx');
|
||||
form.reset({ ...formData, items });
|
||||
}
|
||||
}
|
||||
if (operatorName === Operator.Message) {
|
||||
form.reset({
|
||||
...formData,
|
||||
content: convertToObjectArray(formData.content),
|
||||
});
|
||||
} else {
|
||||
// form.setFieldsValue(node?.data?.form);
|
||||
form.reset(node?.data?.form);
|
||||
@ -134,7 +142,7 @@ const FormSheet = ({
|
||||
<span>{t(`${lowerFirst(operatorName)}Description`)}</span>
|
||||
</section>
|
||||
</SheetHeader>
|
||||
<section className="pt-4">
|
||||
<section className="pt-4 overflow-auto max-h-[85vh]">
|
||||
{visible && (
|
||||
<FlowFormContext.Provider value={node}>
|
||||
<OperatorForm
|
||||
|
||||
Reference in New Issue
Block a user