Showing
1 changed file
with
38 additions
and
1 deletions
| @@ -25,6 +25,7 @@ const Normal_Page_Size = 20 // 常规每页数量 | @@ -25,6 +25,7 @@ const Normal_Page_Size = 20 // 常规每页数量 | ||
| 25 | 25 | ||
| 26 | const Rec_Page_Size = 10 // 推荐每页数量 | 26 | const Rec_Page_Size = 10 // 推荐每页数量 |
| 27 | 27 | ||
| 28 | +const SpecialComp: string[] = [CompStyle.Zh_Single_Column_03.toString()] | ||
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| 30 | * 处理返回后的数据 | 31 | * 处理返回后的数据 |
| @@ -379,7 +380,8 @@ export class PageHelper { | @@ -379,7 +380,8 @@ export class PageHelper { | ||
| 379 | */ | 380 | */ |
| 380 | private factoryCompArray(compList: CompDTO[]): ArrayList<CompDTO> { | 381 | private factoryCompArray(compList: CompDTO[]): ArrayList<CompDTO> { |
| 381 | let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器 | 382 | let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器 |
| 382 | - compList.forEach((element: CompDTO) => { | 383 | + let newCompList = this.createSpecialComp(compList) |
| 384 | + newCompList.forEach((element: CompDTO) => { | ||
| 383 | let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0); | 385 | let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0); |
| 384 | //移除音频 和 活动 | 386 | //移除音频 和 活动 |
| 385 | if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { | 387 | if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { |
| @@ -402,6 +404,41 @@ export class PageHelper { | @@ -402,6 +404,41 @@ export class PageHelper { | ||
| 402 | } | 404 | } |
| 403 | 405 | ||
| 404 | /** | 406 | /** |
| 407 | + * 竖直方向list,将数据拆出来,组装成comp | ||
| 408 | + */ | ||
| 409 | + private createSpecialComp(compList: CompDTO[]): CompDTO[]{ | ||
| 410 | + if (!compList) { | ||
| 411 | + return compList | ||
| 412 | + } | ||
| 413 | + let tmpList: CompDTO[] = [] | ||
| 414 | + compList.forEach((value, index) => { | ||
| 415 | + if (SpecialComp.includes(value.compStyle)) { | ||
| 416 | + let list = value.operDataList | ||
| 417 | + if (list) { | ||
| 418 | + if (list.length == 1) { | ||
| 419 | + tmpList.push(value) | ||
| 420 | + } else { | ||
| 421 | + list.forEach((content) => { | ||
| 422 | + let newComp = CompDTO.createNewsBean(value) | ||
| 423 | + newComp.operDataList = [] | ||
| 424 | + // 特殊样式,comp只保留一个content,多余的一一拆成新的comp | ||
| 425 | + newComp.operDataList.push(content) | ||
| 426 | + tmpList.push(newComp) | ||
| 427 | + }) | ||
| 428 | + } | ||
| 429 | + } else { | ||
| 430 | + tmpList.push(value) | ||
| 431 | + } | ||
| 432 | + } else { | ||
| 433 | + tmpList.push(value) | ||
| 434 | + } | ||
| 435 | + }) | ||
| 436 | + | ||
| 437 | + // 重新赋值,将contentList拆出来了。 | ||
| 438 | + return tmpList | ||
| 439 | + } | ||
| 440 | + | ||
| 441 | + /** | ||
| 405 | * 信息流页面,所有稿件需要参与批查,如 批查评论、批查关注状态等接口 | 442 | * 信息流页面,所有稿件需要参与批查,如 批查评论、批查关注状态等接口 |
| 406 | * @param compList | 443 | * @param compList |
| 407 | * @param pageModel | 444 | * @param pageModel |
-
Please register or login to post a comment