feat(event): 更新事件查询接口支持更多参数

master
钟良源 3 months ago
parent 62619fa51d
commit 1538c7470f

@ -38,9 +38,10 @@ export function queryEventItem(name: string) {
export function queryEventItemBySceneIdOld(sceneId: string) {
return axios.get(`${urlPrefix}/event/${sceneId}/get`);
}
// 事件管理-使用场景ID查询事件新
export function queryEventItemBySceneId(sceneId: string) {
return axios.get(`${urlPrefix}/event/${sceneId}/getTopic`);
export function queryEventItemBySceneId(data: { sceneId: string, nodeId?: string, appId?: string }) {
return axios.post(`${urlPrefix}/event/getTopic`, data);
}
// 事件管理-获取工程下可用的topic

@ -219,7 +219,7 @@ function IDEContainer() {
};
const getEvent = async () => {
const res: any = await queryEventItemBySceneId(urlParams.id);
const res: any = await queryEventItemBySceneId({ sceneId: urlParams.id });
const res1: any = await queryEventItemBySceneIdOld(urlParams.id);
if (res.code === 200) dispatch(updateEventList(res.data));
if (res1.code === 200) dispatch(updateEventListOld(res1.data));

@ -16,7 +16,7 @@ const ApplicationContainer = () => {
};
const getEventList = async () => {
const res: any = await queryEventItemBySceneId(info.id);
const res: any = await queryEventItemBySceneId({ sceneId: info.id });
if (res.code === 200) {
dispatch(updateEventTopicList(res.data

@ -235,7 +235,7 @@ const EventContainer = () => {
];
const fetchEventData = async () => {
const res: any = await queryEventItemBySceneId(info.id);
const res: any = await queryEventItemBySceneId({sceneId:info.id});
if (res && res.code === 200) setEventData(res.data.filter(item => !item.topic.includes('**empty**')));
};

Loading…
Cancel
Save