mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 01:48:04 +08:00
chore(web): migrate lodash-es to es-toolkit compat (#30126)
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { RiArrowDownSLine } from '@remixicon/react'
|
||||
import { capitalize } from 'lodash-es'
|
||||
import { capitalize } from 'es-toolkit/compat'
|
||||
import { useState } from 'react'
|
||||
import Button from '@/app/components/base/button'
|
||||
import {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { MetadataShape } from '@/app/components/workflow/nodes/knowledge-retrieval/types'
|
||||
import { noop } from 'lodash-es'
|
||||
import { noop } from 'es-toolkit/compat'
|
||||
import {
|
||||
useCallback,
|
||||
useState,
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
import type { FC } from 'react'
|
||||
import type { ModelConfig } from '../../../types'
|
||||
import type { MultipleRetrievalConfig, SingleRetrievalConfig } from '../types'
|
||||
import type { ModelParameterModalProps } from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal'
|
||||
import type { DataSet } from '@/models/datasets'
|
||||
import type { DatasetConfigs } from '@/models/debug'
|
||||
import { RiEqualizer2Line } from '@remixicon/react'
|
||||
@ -28,8 +29,8 @@ type Props = {
|
||||
onRetrievalModeChange: (mode: RETRIEVE_TYPE) => void
|
||||
onMultipleRetrievalConfigChange: (config: MultipleRetrievalConfig) => void
|
||||
singleRetrievalModelConfig?: ModelConfig
|
||||
onSingleRetrievalModelChange?: (config: ModelConfig) => void
|
||||
onSingleRetrievalModelParamsChange?: (config: ModelConfig) => void
|
||||
onSingleRetrievalModelChange?: ModelParameterModalProps['setModel']
|
||||
onSingleRetrievalModelParamsChange?: ModelParameterModalProps['onCompletionParamsChange']
|
||||
readonly?: boolean
|
||||
rerankModalOpen: boolean
|
||||
onRerankModelOpenChange: (open: boolean) => void
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type { FC } from 'react'
|
||||
import type { KnowledgeRetrievalNodeType } from './types'
|
||||
import type { NodePanelProps } from '@/app/components/workflow/types'
|
||||
import { intersectionBy } from 'lodash-es'
|
||||
import { intersectionBy } from 'es-toolkit/compat'
|
||||
import {
|
||||
memo,
|
||||
useMemo,
|
||||
@ -104,7 +104,7 @@ const Panel: FC<NodePanelProps<KnowledgeRetrievalNodeType>> = ({
|
||||
onRetrievalModeChange={handleRetrievalModeChange}
|
||||
onMultipleRetrievalConfigChange={handleMultipleRetrievalConfigChange}
|
||||
singleRetrievalModelConfig={inputs.single_retrieval_config?.model}
|
||||
onSingleRetrievalModelChange={handleModelChanged as any}
|
||||
onSingleRetrievalModelChange={handleModelChanged}
|
||||
onSingleRetrievalModelParamsChange={handleCompletionParamsChange}
|
||||
readonly={readOnly || !selectedDatasets.length}
|
||||
rerankModalOpen={rerankModelOpen}
|
||||
|
||||
@ -9,8 +9,8 @@ import type {
|
||||
MultipleRetrievalConfig,
|
||||
} from './types'
|
||||
import type { DataSet } from '@/models/datasets'
|
||||
import { isEqual } from 'es-toolkit/compat'
|
||||
import { produce } from 'immer'
|
||||
import { isEqual } from 'lodash-es'
|
||||
import {
|
||||
useCallback,
|
||||
useEffect,
|
||||
|
||||
@ -6,7 +6,7 @@ import type {
|
||||
import {
|
||||
uniq,
|
||||
xorBy,
|
||||
} from 'lodash-es'
|
||||
} from 'es-toolkit/compat'
|
||||
import { DATASET_DEFAULT } from '@/config'
|
||||
import {
|
||||
DEFAULT_WEIGHTED_SCORE,
|
||||
|
||||
Reference in New Issue
Block a user