|
|
@@ -17,7 +17,7 @@ import {
|
|
|
Space,
|
|
|
Row,
|
|
|
Col,
|
|
|
- Input
|
|
|
+ Input, Cascader
|
|
|
} from 'antd';
|
|
|
import {
|
|
|
PlusOutlined,
|
|
|
@@ -251,14 +251,17 @@ const QuestionAnswerList: React.FC = () => {
|
|
|
const appProTypeApi = {
|
|
|
fetchAppProType: async () => {
|
|
|
try {
|
|
|
- const res = await apis.fetchTakaiAppTypeList('project_type');
|
|
|
- const list = res.data.map((item: any) => {
|
|
|
- return {
|
|
|
- label: item.dictLabel,
|
|
|
- value: item.dictCode,
|
|
|
- }
|
|
|
- });
|
|
|
+ const res = await apis.fetchTakaiAppTypeList('projectTree');
|
|
|
+ const list: AppTypeList = res.data;
|
|
|
setAppProjectList(list);
|
|
|
+ // const res = await apis.fetchTakaiAppTypeList('projectTree');
|
|
|
+ // const list = res.data.map((item: any) => {
|
|
|
+ // return {
|
|
|
+ // label: item.dictLabel,
|
|
|
+ // value: item.dictCode,
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // setAppProjectList(list);
|
|
|
} catch (error: any) {
|
|
|
console.error(error);
|
|
|
}
|
|
|
@@ -351,6 +354,9 @@ const QuestionAnswerList: React.FC = () => {
|
|
|
if (values.typeId === '全部') {
|
|
|
values.typeId = null;
|
|
|
}
|
|
|
+ if(values.projectId instanceof Array && values.projectId.length == 2) {
|
|
|
+ values.projectId = values.projectId[1];
|
|
|
+ }
|
|
|
await indexApi.fetchIndex(values.typeId, values.projectId);
|
|
|
await appApi.fetchList(values.typeId, values.projectId);
|
|
|
}).catch((error) => {
|
|
|
@@ -507,29 +513,34 @@ const QuestionAnswerList: React.FC = () => {
|
|
|
))
|
|
|
} */ }
|
|
|
<FormItem name='projectId'>
|
|
|
- <Select
|
|
|
- placeholder='请选择项目'
|
|
|
- allowClear
|
|
|
- onChange={(value) => {
|
|
|
- // 项目选择器自动提交逻辑
|
|
|
- const currentTypeId = form.getFieldValue('typeId');
|
|
|
- const typeId = currentTypeId === '全部' ? null : currentTypeId;
|
|
|
- appApi.fetchList(typeId, value);
|
|
|
- indexApi.fetchIndex(typeId, value);
|
|
|
- }}
|
|
|
- >
|
|
|
- {
|
|
|
- projectList.map((item, index) => {
|
|
|
- return <Option value={item.value} key={index}>
|
|
|
- {item.label}
|
|
|
- </Option>
|
|
|
- })
|
|
|
- }
|
|
|
- </Select>
|
|
|
- </FormItem>
|
|
|
- <FormItem name='keyword'>
|
|
|
- <Input placeholder='请输入关键字' allowClear />
|
|
|
+ <Cascader
|
|
|
+ options={appProjectList}
|
|
|
+ placeholder="请选择项目"
|
|
|
+ showSearch
|
|
|
+ />
|
|
|
+ {/*<Select*/}
|
|
|
+ {/* placeholder='请选择项目'*/}
|
|
|
+ {/* allowClear*/}
|
|
|
+ {/* onChange={(value) => {*/}
|
|
|
+ {/* // 项目选择器自动提交逻辑*/}
|
|
|
+ {/* const currentTypeId = form.getFieldValue('typeId');*/}
|
|
|
+ {/* const typeId = currentTypeId === '全部' ? null : currentTypeId;*/}
|
|
|
+ {/* appApi.fetchList(typeId, value);*/}
|
|
|
+ {/* indexApi.fetchIndex(typeId, value);*/}
|
|
|
+ {/* }}*/}
|
|
|
+ {/*>*/}
|
|
|
+ {/* {*/}
|
|
|
+ {/* projectList.map((item, index) => {*/}
|
|
|
+ {/* return <Option value={item.value} key={index}>*/}
|
|
|
+ {/* {item.label}*/}
|
|
|
+ {/* </Option>*/}
|
|
|
+ {/* })*/}
|
|
|
+ {/* }*/}
|
|
|
+ {/*</Select>*/}
|
|
|
</FormItem>
|
|
|
+ {/*<FormItem name='keyword'>*/}
|
|
|
+ {/* <Input placeholder='请输入关键字' allowClear />*/}
|
|
|
+ {/*</FormItem>*/}
|
|
|
<FormItem>
|
|
|
<Space size={12}>
|
|
|
<Tooltip title="重置">
|
|
|
@@ -552,7 +563,7 @@ const QuestionAnswerList: React.FC = () => {
|
|
|
|
|
|
{/* {
|
|
|
createFlag && (
|
|
|
-
|
|
|
+
|
|
|
<div style={ { marginLeft: 'auto' } }>
|
|
|
<Button type='primary'
|
|
|
icon={ <PlusOutlined /> }
|
|
|
@@ -561,7 +572,7 @@ const QuestionAnswerList: React.FC = () => {
|
|
|
} }>创建问答应用</Button>
|
|
|
</div>
|
|
|
)
|
|
|
- }
|
|
|
+ }
|
|
|
*/}
|
|
|
{/* 创建按钮已移至面包屑组件 */}
|
|
|
|
|
|
@@ -817,4 +828,4 @@ const QuestionAnswerList: React.FC = () => {
|
|
|
)
|
|
|
};
|
|
|
|
|
|
-export default observer(QuestionAnswerList);
|
|
|
+export default observer(QuestionAnswerList);
|