Commit 3bff5f16 authored by Bill's avatar Bill

fix: 修改品类导航页

parent 344c7709
......@@ -63,7 +63,6 @@ export function useFilterSameOption() {
});
});
});
console.log(result);
return result;
}, [pageConfig]);
......
......@@ -2,19 +2,9 @@ import React, { useEffect, useState } from 'react';
import { updatePageConfig } from '@lingxi-disign/core';
import { cloneDeep } from 'lodash';
import pageConfig from '../schema/pageConfig';
import mock from '../mock/index.json';
import { PublicApi } from '@/services/api';
import { usePageStatus } from '@/hooks/usePageStatus';
const getData = async () => {
const random = Math.floor(Math.random() * 3) + 1;
return new Promise((resolve) => {
setTimeout(() => {
resolve(mock);
}, random);
});
};
function useGetLayout() {
const [info, setInfo] = useState<any>(null);
const { id } = usePageStatus();
......
......@@ -18,10 +18,6 @@ import StatusTag from '@/components/StatusTag';
import CustomInputSearch from '@/components/NiceForm/components/CustomInputSearch';
import CustomCategorySearch from '@/components/NiceForm/components/CustomCategorySearch';
// import ActivityImage from '@/pages/pageCustomized/icons/ActivityImage.svg';
interface CommodityDrawerProps {
visible: boolean,
onClose: () => void,
......
......@@ -14,7 +14,7 @@ const Toolbar: React.FC<Iprops> = (props: Iprops) => {
Modal.confirm({
title: '确认离开装修页?',
onOk: () => {
history.goBacK()
history.goBack()
},
})
// history.goBack();
......
......@@ -75,7 +75,7 @@ const CategoryNavigation = () => {
}, [info]);
const onSave = async (pageConfig, rest) => {
const hasRequestTabKey = rest.hasRequestTabKey.map((_item: string) => _item.match(/id_(.*)\/\.\$(\d+)/)?.[1]);
const hasRequestTabKey = rest.hasRequestTabKey.map((_item: string) => _item.match(/id_(.*)\/\.\$(\d+)/)?.[1]) || [];
/** domKey 从7开始都是tab 的值 */
const tabChildren = pageConfig[4].childNodes.slice(1);
......@@ -85,6 +85,9 @@ const CategoryNavigation = () => {
return ;
}
const { id, name, visible = true } = pageConfig[_nodeKey].props;
if (!id) {
return;
}
if (!hasRequestTabKey.includes(id.toString())) {
return dataSourceFromRequest[id];
}
......@@ -114,7 +117,7 @@ const CategoryNavigation = () => {
tabProps['children'] = tabItemData;
return tabProps;
});
const postData = { style: 0, category: result };
const postData = { style: 0, category: result.filter(Boolean) };
const { data, code } = await PublicApi.postTemplateAdornAppChannelSave({
templateId: Number(id),
categoryAdornContent: postData as any,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment