|
|
@@ -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 &&
|
|
|
<>
|