Forráskód Böngészése

问答广场新增是否公开字段

sunsheng 3 hónapja
szülő
commit
e64af13662
2 módosított fájl, 43 hozzáadás és 15 törlés
  1. 0 15
      package-lock.json
  2. 43 0
      src/pages/deepseek/questionAnswer/info/index.tsx

+ 0 - 15
package-lock.json

@@ -5748,21 +5748,6 @@
       "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
       "dev": true
     },
-    "node_modules/yaml": {
-      "version": "2.8.1",
-      "resolved": "https://registry.npmmirror.com/yaml/-/yaml-2.8.1.tgz",
-      "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==",
-      "dev": true,
-      "license": "ISC",
-      "optional": true,
-      "peer": true,
-      "bin": {
-        "yaml": "bin.mjs"
-      },
-      "engines": {
-        "node": ">= 14.6"
-      }
-    },
     "node_modules/zwitch": {
       "version": "2.0.4",
       "resolved": "https://registry.npmmirror.com/zwitch/-/zwitch-2.0.4.tgz",

+ 43 - 0
src/pages/deepseek/questionAnswer/info/index.tsx

@@ -127,6 +127,7 @@ const QuestionAnswerInfo: React.FC = () => {
     const [isDeepThinkVisible, setIsDeepThinkVisible] = React.useState(false);
     const [name, setName] = React.useState('');
     const [appTypeList, setAppTypeList] = React.useState<AppTypeList>([]);
+    const [appVisibleList, setAppVisibleList] = React.useState<AppTypeList>([]); // 是否公开 
     const [updateFlag, setUpdateFlag] = React.useState<boolean>();
     const [createFlag, setCreateFlag] = React.useState<boolean>();
     const [appProjectList, setAppProjectList] = React.useState<AppTypeList>([]);
@@ -148,6 +149,7 @@ const QuestionAnswerInfo: React.FC = () => {
             api.fetchAppType(),
             // api.fetchModelList(),
             api.fetchAppProType(),
+            api.fetchAppVisible(id)
         ])
         if (id) {
             await api.fetchDetail(id);
@@ -305,6 +307,7 @@ const QuestionAnswerInfo: React.FC = () => {
                     updateDate: info.updateDate, // 更新时间
                     appProId: info.appProId,// 项目
                     typeId: info.typeId, //应用类型
+                    visible: info.visible||'0', //是否公开
                     param_desc: data_info.param_desc, //回答风格
                     show_recall_result: data_info.show_recall_result, //是否展示召回结果
                     recall_method: data_info.recall_method, //召回方式
@@ -362,6 +365,27 @@ const QuestionAnswerInfo: React.FC = () => {
                 console.error(error);
             }
         },
+        // 获取是否公开类型
+        fetchAppVisible: async (id:string) => {
+            try {
+                const res = await apis.fetchTakaiAppTypeList('app_visible');
+                console.log('res.data',res.data)
+                const list = res.data.map((item: any) => {
+                    return {
+                        label: item.dictLabel,
+                        value: item.dictValue,
+                    }
+                });
+                setAppVisibleList(list);
+                if(!id){
+                    form.setFieldsValue({
+                        visible: list[0].value
+                    });
+                }
+            } catch (error: any) {
+                console.error(error);
+            }
+        },
 
         // 获取模型列表
         fetchModelList: async () => {
@@ -466,6 +490,7 @@ const QuestionAnswerInfo: React.FC = () => {
                 knowledge_info: JSON.stringify(data_info),
                 max_token: values.max_token, //应用最大token
                 typeId: values.typeId, // 应用类型
+                visible: values.visible, // 是否公开
                 appProId: values.appProId,// 项目
                 userId: userId, // 用户id
             };
@@ -537,6 +562,24 @@ const QuestionAnswerInfo: React.FC = () => {
                                 }
                             </Select>
                         </FormItem>
+                        <FormItem
+                            label='是否公开'
+                            name='visible'
+                        >
+                            <Select
+                                className='questionAnswerInfo-content-title'
+                                placeholder='请选择是否公开'
+                                allowClear={true}
+                            >
+                                {
+                                    appVisibleList.map((item, index) => {
+                                        return <Option value={item.value} key={index}>
+                                            {item.label}
+                                        </Option>
+                                    })
+                                }
+                            </Select>
+                        </FormItem>
                         {
                             isAppPro &&
                             <>