浏览代码

Merge branch '1.1.3-master_web' of http://8.130.72.63:18081/shenzhen/tjdify into 1.1.3-master

CzRger 2 月之前
父节点
当前提交
28310ec280

+ 24 - 3
web/app/(commonLayout)/apps/Apps.tsx

@@ -41,6 +41,7 @@ const getKey = (
   keywords: string,
   dept: string,
   authType: number,
+  creator: string,
 ) => {
   if (!pageIndex || previousPageData.has_more) {
     const params: any = { url: 'apps', params: { page: pageIndex + 1, limit: 30, name: keywords, is_created_by_me: isCreatedByMe } }
@@ -53,9 +54,11 @@ const getKey = (
     if (tags.length)
       params.params.tag_ids = tags
     if (dept)
-      params.params.creatorDept = dept
+      params.params.creator_dept = dept
     if (authType)
-      params.params.authType = authType
+      params.params.auth_type = authType
+    if (creator)
+      params.params.creator = creator
     return params
   }
   return null
@@ -95,8 +98,17 @@ const Apps = () => {
     { name: '授权编辑', value: '3' },
     { name: '授权可见', value: '4' },
   ]
+  const [creator, setCreator] = useState('')
+  const [searchCreator, setSearchCreator] = useState('')
+  const { run: handleSearchCreator } = useDebounceFn(() => {
+    setSearchCreator(creator)
+  }, { wait: 500 })
+  const handleCreatorChange = (value: string) => {
+    setCreator(value)
+    handleSearchCreator()
+  }
   const { data, isLoading, setSize, mutate } = useSWRInfinite(
-    (pageIndex: number, previousPageData: AppListResponse) => getKey(pageIndex, previousPageData, activeTab, isCreatedByMe, tagIDs, searchKeywords, dept, authType),
+    (pageIndex: number, previousPageData: AppListResponse) => getKey(pageIndex, previousPageData, activeTab, isCreatedByMe, tagIDs, searchKeywords, dept, authType, searchCreator),
     fetchAppList,
     { revalidateFirstPage: true },
   )
@@ -168,6 +180,15 @@ const Apps = () => {
           options={options}
         />
         <div className='flex items-center gap-2'>
+          <Input
+            showLeftIcon
+            showClearIcon
+            wrapperClassName='w-[200px]'
+            value={creator}
+            onChange={e => handleCreatorChange(e.target.value)}
+            onClear={() => handleCreatorChange('')}
+            placeholder="请输入创建人"
+          />
           <SimpleSelect
             wrapperClassName="h-[32px] w-[200px]"
             defaultValue={authType}

+ 1 - 0
web/app/(commonLayout)/apps/hooks/useAppsQueryState.ts

@@ -4,6 +4,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react'
 type AppsQuery = {
   tagIDs?: string[]
   keywords?: string
+  creator?: string
   isCreatedByMe?: boolean
 }
 

+ 21 - 1
web/app/(commonLayout)/datasets/Container.tsx

@@ -68,6 +68,17 @@ const Container = () => {
     setKeywords(value)
     handleSearch()
   }
+
+  const [creator, setCreator] = useState('')
+  const [searchCreator, setSearchCreator] = useState('')
+  const { run: handleSearchCreator } = useDebounceFn(() => {
+    setSearchCreator(creator)
+  }, { wait: 500 })
+  const handleCreatorChange = (value: string) => {
+    setCreator(value)
+    handleSearchCreator()
+  }
+
   const [tagFilterValue, setTagFilterValue] = useState<string[]>([])
   const [tagIDs, setTagIDs] = useState<string[]>([])
   const { run: handleTagsUpdate } = useDebounceFn(() => {
@@ -127,6 +138,15 @@ const Container = () => {
         />
         {activeTab === 'dataset' && (
           <div className='flex items-center justify-center gap-2'>
+            <Input
+              showLeftIcon
+              showClearIcon
+              wrapperClassName='w-[200px]'
+              value={creator}
+              onChange={e => handleCreatorChange(e.target.value)}
+              onClear={() => handleCreatorChange('')}
+              placeholder="请输入创建人"
+            />
             <SimpleSelect
               wrapperClassName="h-[32px] w-[200px]"
               defaultValue={authType}
@@ -191,7 +211,7 @@ const Container = () => {
       </div>
       {activeTab === 'dataset' && (
         <>
-          <Datasets containerRef={containerRef} tags={tagIDs} keywords={searchKeywords} includeAll={includeAll} type={searchType} dept={dept} authType={authType} />
+          <Datasets containerRef={containerRef} tags={tagIDs} keywords={searchKeywords} includeAll={includeAll} type={searchType} dept={dept} authType={authType} creator={searchCreator} />
           <DatasetFooter />
           {showTagManagementModal && (
             <TagManagementModal type='knowledge' show={showTagManagementModal} />

+ 6 - 1
web/app/(commonLayout)/datasets/Datasets.tsx

@@ -19,6 +19,7 @@ const getKey = (
   type: string,
   dept: string,
   authType: string,
+  creator: string,
 ) => {
   if (!pageIndex || previousPageData.has_more) {
     const params: FetchDatasetsParams = {
@@ -39,6 +40,8 @@ const getKey = (
       params.params.creatorDept = dept
     if (authType)
       params.params.authType = authType
+    if (creator)
+      params.params.creator = creator
     return params
   }
   return null
@@ -52,6 +55,7 @@ type Props = {
   type: string,
   dept: string,
   authType: string,
+  creator: string,
 }
 
 const Datasets = ({
@@ -62,10 +66,11 @@ const Datasets = ({
   type,
   dept,
   authType,
+  creator,
 }: Props) => {
   const { isCurrentWorkspaceEditor } = useAppContext()
   const { data, isLoading, setSize, mutate } = useSWRInfinite(
-    (pageIndex: number, previousPageData: DataSetListResponse) => getKey(pageIndex, previousPageData, tags, keywords, includeAll, type, dept, authType),
+    (pageIndex: number, previousPageData: DataSetListResponse) => getKey(pageIndex, previousPageData, tags, keywords, includeAll, type, dept, authType, creator),
     fetchDatasets,
     { revalidateFirstPage: false, revalidateAll: true },
   )

+ 24 - 27
web/app/components/workflow/nodes/intent-recon-train/panel.tsx

@@ -9,12 +9,9 @@ import AuthorizationModal from './components/authorization'
 import type { HttpNodeType } from './types'
 import Timeout from './components/timeout'
 import CurlPanel from './components/curl-panel'
-import cn from '@/utils/classnames'
 import Field from '@/app/components/workflow/nodes/_base/components/field'
 import Split from '@/app/components/workflow/nodes/_base/components/split'
 import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars'
-import { Settings01 } from '@/app/components/base/icons/src/vender/line/general'
-import { FileArrow01 } from '@/app/components/base/icons/src/vender/line/files'
 import type { NodePanelProps } from '@/app/components/workflow/types'
 import BeforeRunForm from '@/app/components/workflow/nodes/_base/components/before-run-form'
 import ResultPanel from '@/app/components/workflow/run/result-panel'
@@ -69,33 +66,33 @@ const Panel: FC<NodePanelProps<HttpNodeType>> = ({
       <div className='space-y-4 px-4 pb-4'>
         <Field
           title={t(`${i18nPrefix}.api`)}
-          operations={
-            <div className='flex'>
-              <div
-                onClick={showAuthorization}
-                className={cn(!readOnly && 'cursor-pointer hover:bg-gray-50', 'flex h-6 items-center space-x-1 rounded-md px-2 ')}
-              >
-                {!readOnly && <Settings01 className='h-3 w-3 text-gray-500' />}
-                <div className='text-xs font-medium text-gray-500'>
-                  {t(`${i18nPrefix}.authorization.authorization`)}
-                  <span className='ml-1 text-gray-700'>{t(`${i18nPrefix}.authorization.${inputs.authorization.type}`)}</span>
-                </div>
-              </div>
-              <div
-                onClick={showCurlPanel}
-                className={cn(!readOnly && 'cursor-pointer hover:bg-gray-50', 'flex h-6 items-center space-x-1 rounded-md px-2 ')}
-              >
-                {!readOnly && <FileArrow01 className='h-3 w-3 text-gray-500' />}
-                <div className='text-xs font-medium text-gray-500'>
-                  {t(`${i18nPrefix}.curl.title`)}
-                </div>
-              </div>
-            </div>
-          }
+          // operations={
+          //   <div className='flex'>
+          //     <div
+          //       onClick={showAuthorization}
+          //       className={cn(!readOnly && 'cursor-pointer hover:bg-gray-50', 'flex h-6 items-center space-x-1 rounded-md px-2 ')}
+          //     >
+          //       {!readOnly && <Settings01 className='h-3 w-3 text-gray-500' />}
+          //       <div className='text-xs font-medium text-gray-500'>
+          //         {t(`${i18nPrefix}.authorization.authorization`)}
+          //         <span className='ml-1 text-gray-700'>{t(`${i18nPrefix}.authorization.${inputs.authorization.type}`)}</span>
+          //       </div>
+          //     </div>
+          //     <div
+          //       onClick={showCurlPanel}
+          //       className={cn(!readOnly && 'cursor-pointer hover:bg-gray-50', 'flex h-6 items-center space-x-1 rounded-md px-2 ')}
+          //     >
+          //       {!readOnly && <FileArrow01 className='h-3 w-3 text-gray-500' />}
+          //       <div className='text-xs font-medium text-gray-500'>
+          //         {t(`${i18nPrefix}.curl.title`)}
+          //       </div>
+          //     </div>
+          //   </div>
+          // }
         >
           <ApiInput
             nodeId={id}
-            readonly={readOnly}
+            readonly={true}
             method={inputs.method}
             onMethodChange={handleMethodChange}
             url={inputs.url}