Commit 6266d747 authored by GuanHua's avatar GuanHua

feat: 修改装修组件库版本

parent add7e20b
......@@ -64,9 +64,9 @@
"core-js": "^3.6.5",
"crypto-js": "^4.0.0",
"god": "^0.2.4",
"lingxi-design": "^1.0.14",
"lingxi-design-ui": "^1.1.23",
"lingxi-editor-core": "^1.0.7",
"lingxi-design": "^2.0.1",
"lingxi-design-ui": "^2.0.1",
"lingxi-editor-core": "^2.0.1",
"lingxi-web": "^1.0.6",
"lint-staged": "^10.0.7",
"mobx": "^5.15.4",
......
......@@ -387,7 +387,6 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
switch (fixedItem.name) {
// 导航
case 'navList':
if (fixedItem.content) {
mainNavConfig[mainNavConfig.key].props.menuData = fixedItem.content
} else {
......@@ -633,7 +632,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...flowConfigInfo,
...FooterConfig
}
console.log(config)
setComponentConfigs(config)
setLoading(false)
}
......@@ -651,179 +650,6 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
})
}
/**
* 保存模板修改
*/
const handleSave = () => {
const resultConfig: DesingConfigItemType[] = []
const goodsList: DesingConfigItemType[] = []
let goodsSort = 0
console.log(componentConfigs, 'componentConfigs')
Object.keys(componentConfigs).forEach((key, index) => {
const componentConfigsItem = componentConfigs[key]
if(componentConfigsItem.componentType) {
switch(componentConfigsItem.componentType) {
case PROPS_TYPES.mallNav:
resultConfig.push({
name: 'navList',
status: true,
sort: index,
content: componentConfigsItem.props.menuData
})
break
case PROPS_TYPES.platformAdvert:
const { type, advertList } = componentConfigsItem.props
// 'banner' | 'bannerRight' | 'bannerBottom' | 'floorBanner' | 'service'
switch (type) {
case 'banner':
resultConfig.push({
name: 'bannerAdvert',
status: true,
sort: index,
content: advertList
})
break
case 'bannerRight':
resultConfig.push({
name: 'bannerRightAdvert',
status: true,
sort: index,
content: advertList
})
break
case 'bannerBottom':
resultConfig.push({
name: 'banneBottomrAdvert',
status: true,
sort: index,
content: advertList
})
break
case 'floorBanner':
resultConfig.push({
name: 'middleAdvert',
status: true,
sort: index,
content: advertList
})
break
case 'service':
resultConfig.push({
name: 'bottomAdvert',
status: true,
sort: index,
content: advertList
})
break
default:
break
}
break
case PROPS_TYPES.platformQuickNav:
const { sellQuickNavList, buyQuickNavList, quickNavList } = componentConfigsItem.props
resultConfig.push({
name: 'fastVisit',
status: true,
sort: index,
content: {
sellerBOList: sellQuickNavList,
buyerBOList: buyQuickNavList,
fastFunctionBOList: quickNavList
}
})
break
case PROPS_TYPES.platformGoods:
if (goodsSort === 0) {
goodsSort = index
}
goodsList.push(componentConfigsItem.props.dataInfo)
break
case PROPS_TYPES.platformBrand:
resultConfig.push({
name: 'brand',
sort: index,
status: true,
content: componentConfigsItem.props.dataList
})
break
case PROPS_TYPES.platformMechant:
resultConfig.push({
name: 'merchant',
sort: index,
status: true,
content: componentConfigsItem.props.dataList
})
break
case PROPS_TYPES.platformInformation:
const { marketList, information } = componentConfigsItem.props
resultConfig.push({
name: 'marketInformation',
status: true,
sort: index,
content: {
marketList: marketList,
information: information
}
})
break
case PROPS_TYPES.platformPurchaseAdvert:
resultConfig.push({
name: 'purchase',
sort: index,
status: true,
content: componentConfigsItem.props.advertList
})
break
case PROPS_TYPES.platformLogistics:
resultConfig.push({
name: 'logistics',
sort: index,
status: true,
content: componentConfigsItem.props.dataInfo
})
break
case PROPS_TYPES.platformProcess:
resultConfig.push({
name: 'process',
sort: index,
status: true,
content: componentConfigsItem.props.dataInfo
})
break
case PROPS_TYPES.platformService:
resultConfig.push({
name: 'platform',
sort: index,
status: true,
content: componentConfigsItem.props.dataList
})
break
default:
break
}
}
})
const newList: DesingConfigItemType[] = []
let addStatus = false
for (const item of resultConfig) {
if (item.sort && item.sort > goodsSort && !addStatus) {
newList.push({
name: 'goods',
sort: goodsSort,
status: true,
content: goodsList
})
addStatus = true
}
newList.push(item)
}
console.log(newList, 'resultConfig')
setConfirmLoading(true)
saveWebPlatformDesign(newList)
}
const saveWebPlatformDesign = (configList: DesingConfigItemType[]) => {
const param: any = {
templateId: id,
......
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