|
|
@@ -136,6 +136,7 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
const [name, setName] = React.useState('');
|
|
|
const [appTypeList, setAppTypeList] = React.useState<AppTypeList>([]);
|
|
|
const [appVisibleList, setAppVisibleList] = React.useState<AppTypeList>([]); // 是否公开
|
|
|
+ const [visibleFlag, setVisibleFlag] = React.useState<string|number>(0); // 是否公开用来判断是否展示VIP用户
|
|
|
const [updateFlag, setUpdateFlag] = React.useState<boolean>();
|
|
|
const [createFlag, setCreateFlag] = React.useState<boolean>();
|
|
|
const [appProjectList, setAppProjectList] = React.useState<AppTypeList>([]);
|
|
|
@@ -299,7 +300,6 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
setIsDeepThinkVisible(false);
|
|
|
}
|
|
|
|
|
|
- console.log(info.knowledgeIds, 'info.knowledgeIds')
|
|
|
form.setFieldsValue({
|
|
|
id: info.id,
|
|
|
name: info.name, //应用名称
|
|
|
@@ -315,7 +315,7 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
questionList: sd, //问题列表
|
|
|
max_token: info.maxToken, //应用最大token
|
|
|
updateDate: info.updateDate, // 更新时间
|
|
|
- appProId: info.appProId,// 项目
|
|
|
+ appProId: info.appProId.join('-'),// 项目
|
|
|
typeId: info.typeId, //应用类型
|
|
|
visible: info.visible || '0', //是否公开
|
|
|
param_desc: data_info.param_desc, //回答风格
|
|
|
@@ -331,6 +331,7 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
//recall_index_type_list: info.recall_index_type_list, //知识库id
|
|
|
//rerank_index_type_list: info.rerank_index_type_list, //知识库id
|
|
|
})
|
|
|
+ setVisibleFlag(info.visible || '0')
|
|
|
if(info.vipList&&info.vipList.length>0){
|
|
|
setVipList(info.vipList);
|
|
|
}
|
|
|
@@ -391,6 +392,7 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
form.setFieldsValue({
|
|
|
visible: list[0]?.value
|
|
|
});
|
|
|
+ setVisibleFlag(list[0]?.value);
|
|
|
}
|
|
|
} catch (error: any) {
|
|
|
console.error(error);
|
|
|
@@ -432,7 +434,18 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
fetchAppProType: async () => {
|
|
|
try {
|
|
|
const res = await apis.fetchTakaiAppTypeList('projectTree');
|
|
|
- const list: AppTypeList = res.data;
|
|
|
+ console.log('res.data',res.data)
|
|
|
+ const list: AppTypeList = res.data?.reduce((acc:any,item: any) => {
|
|
|
+ if(item.children.length>0){
|
|
|
+ item.children.forEach((val:any)=>{
|
|
|
+ acc.push({
|
|
|
+ label: val.label,
|
|
|
+ value: `${item.value}-${val.value}`,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return acc;
|
|
|
+ },[]);
|
|
|
setAppProjectList(list);
|
|
|
} catch (error: any) {
|
|
|
console.error(error);
|
|
|
@@ -532,7 +545,7 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
typeId: values.typeId, // 应用类型
|
|
|
visible: values.visible, // 是否公开
|
|
|
vipList: vipList, // vip用户列表
|
|
|
- appProId: values.appProId,// 项目
|
|
|
+ appProId: values.appProId[0].split('-'),// 项目
|
|
|
userId: userId, // 用户id
|
|
|
};
|
|
|
console.log(info, 'info data');
|
|
|
@@ -764,6 +777,9 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
className='questionAnswerInfo-content-title'
|
|
|
placeholder='请选择是否公开'
|
|
|
allowClear={true}
|
|
|
+ onChange={(e) => {
|
|
|
+ setVisibleFlag(e)
|
|
|
+ }}
|
|
|
>
|
|
|
{
|
|
|
appVisibleList.map((item, index) => {
|
|
|
@@ -775,7 +791,7 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
{/* VIP用户 */}
|
|
|
- <FormItem
|
|
|
+ {visibleFlag==1&&<FormItem
|
|
|
label='VIP用户'
|
|
|
>
|
|
|
<div className='tags-info'>
|
|
|
@@ -801,7 +817,7 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
}} type="primary" variant="outlined" onClick={() => { setIsModalOpen(true) }}>选择</Button>
|
|
|
</p>
|
|
|
</div>
|
|
|
- </FormItem>
|
|
|
+ </FormItem>}
|
|
|
<FormItem
|
|
|
label='问答应用描述'
|
|
|
name='desc'
|