Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
chengen02
2024-05-22 14:06:45 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
3bed1eec69c8440f57ddb38744e7425a980ce1b9
3bed1eec
2 parents
9a74f099
3d7d8350
Merge remote-tracking branch 'origin/main'
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
1 deletions
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageHelper.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageHelper.ets
View file @
3bed1ee
...
...
@@ -25,6 +25,7 @@ const Normal_Page_Size = 20 // 常规每页数量
const Rec_Page_Size = 10 // 推荐每页数量
const SpecialComp: string[] = [CompStyle.Zh_Single_Column_03.toString()]
/**
* 处理返回后的数据
...
...
@@ -379,7 +380,8 @@ export class PageHelper {
*/
private factoryCompArray(compList: CompDTO[]): ArrayList<CompDTO> {
let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器
compList.forEach((element: CompDTO) => {
let newCompList = this.createSpecialComp(compList)
newCompList.forEach((element: CompDTO) => {
let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0);
//移除音频 和 活动
if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) {
...
...
@@ -402,6 +404,41 @@ export class PageHelper {
}
/**
* 竖直方向list,将数据拆出来,组装成comp
*/
private createSpecialComp(compList: CompDTO[]): CompDTO[]{
if (!compList) {
return compList
}
let tmpList: CompDTO[] = []
compList.forEach((value, index) => {
if (SpecialComp.includes(value.compStyle)) {
let list = value.operDataList
if (list) {
if (list.length == 1) {
tmpList.push(value)
} else {
list.forEach((content) => {
let newComp = CompDTO.createNewsBean(value)
newComp.operDataList = []
// 特殊样式,comp只保留一个content,多余的一一拆成新的comp
newComp.operDataList.push(content)
tmpList.push(newComp)
})
}
} else {
tmpList.push(value)
}
} else {
tmpList.push(value)
}
})
// 重新赋值,将contentList拆出来了。
return tmpList
}
/**
* 信息流页面,所有稿件需要参与批查,如 批查评论、批查关注状态等接口
* @param compList
* @param pageModel
...
...
Please
register
or
login
to post a comment