Commit 89db360f authored by Bill's avatar Bill

fix: 修改pc 活动页装修

parent a33e2024
......@@ -202,7 +202,7 @@ const createComponent = (
props: isDept
? omit(current, ['childrenData'])
: specialKey && specialKey === otherProps[floor - 1].type
? { label: labels[`${childProps}-${rest.join("-")}`] || [] , ...childProps }
? { label: labels[`${rest.join("-")}-${childProps.id}`] || [] , ...childProps }
: childProps,
otherProps: otherProps[floor - 1],
childNodes: parentChildKeys,
......
......@@ -8,6 +8,7 @@ import { history } from 'umi';
type Options = {
id: number;
environment?: "app" | "web"
}
/** 数组转合集 */
......@@ -59,7 +60,7 @@ type ResultType = {
} & ActivityContent
function useSaveData(options: Options) {
const { id } = options
const { id, environment = 'app' } = options
const [saving, setSaving] = useState<boolean>(false);
const generaterData = (source: ResultType, dataIndex: string, assignData: {[key: string]: any} ) => {
......@@ -102,22 +103,7 @@ function useSaveData(options: Options) {
childrenData: childrenData
}
});
} else if (ACTIVITY_LIST.includes( dataIndex as ACTIVITY_KEYS ) && dataIndex !== 'combination') {
const { ...otherProps } = props || {};
const childrenData = childNodes.map((_record) => {
const childTargetProps = pageConfig[_record].props;
return childTargetProps.id;
}).filter(Boolean);
// const childrenData = products?.map((_item) => _item.id) || [];
result = generaterData(result, dataIndex, {
sort: sort,
props: {
...pick(otherProps, ['theme', 'title']),
visible: props.status ?? true,
childrenData: childrenData
}
});
} else if (dataIndex === 'suggestProduct' || dataIndex === 'combination') {
} else if (dataIndex === 'suggestProduct' || (dataIndex === 'combination' && environment === 'app')) {
const { ...otherProps } = props || {};
const { childNodes } = target;
const temp = {
......@@ -148,7 +134,22 @@ function useSaveData(options: Options) {
}
};
result = generaterData(result, dataIndex, temp);
}
} else if (ACTIVITY_LIST.includes( dataIndex as ACTIVITY_KEYS )) {
const { ...otherProps } = props || {};
const childrenData = childNodes.map((_record) => {
const childTargetProps = pageConfig[_record].props;
return childTargetProps.id;
}).filter(Boolean);
// const childrenData = products?.map((_item) => _item.id) || [];
result = generaterData(result, dataIndex, {
sort: sort,
props: {
...pick(otherProps, ['theme', 'title']),
visible: props.status ?? true,
childrenData: childrenData
}
});
}
});
const withThemeStyle = {
...result,
......
......@@ -24,7 +24,7 @@ const Web = () => {
// useDraggable(el);
const { id } = usePageStatus();
const [scale, setScale] = useState(0.75);
const { saving, onSave } = useSaveData({ id: +id });
const { saving, onSave } = useSaveData({ id: +id, environment: 'web' });
const [leftBarVisible, setLeftBarVisible] = useState<boolean>(true);
const { detail, loading } = useGetWebLayout();
......
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