Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jump_hm_warehouse
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
毛勇泽
jump_hm_warehouse
Commits
49aca914
Commit
49aca914
authored
Jan 20, 2024
by
huangqy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
全选加取消
parent
85f4ce7a
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
7 行增加
和
14 行删除
+7
-14
WzInList.ets
entry/src/main/ets/pages/metailmange/WzInPage/WzInList.ets
+2
-1
WzInPage.ets
entry/src/main/ets/pages/metailmange/WzInPage/WzInPage.ets
+5
-13
没有找到文件。
entry/src/main/ets/pages/metailmange/WzInPage/WzInList.ets
View file @
49aca914
...
...
@@ -4,6 +4,7 @@ import { pzlx_dict } from '@ohos/common'
@Component
export struct WzInList {
@ObjectLink item: WzinClass
@Link checkedList: Array<string>
renderPzlx(pzlx) {
return pzlx_dict.find(v => v.value == pzlx).text
...
...
@@ -14,7 +15,7 @@ export struct WzInList {
Row() {
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
.selectedColor('#007DFF')
.select(this.
item.checked
)
.select(this.
checkedList.includes(this.item.guid)
)
.onChange((value: boolean) => {
console.info('Checkbox1 change is' + value)
}).margin({ right: 10, left: 10 })
...
...
entry/src/main/ets/pages/metailmange/WzInPage/WzInPage.ets
View file @
49aca914
...
...
@@ -25,6 +25,7 @@ export struct WzInPage {
@State selectedFontColor: string = '#fff'
@State currentIndex: number = 0
@State dataSource: WzinClass[] = []
@State checkedList: Array<string> = []
private controller: TabsController = new TabsController()
private searchcontroller: SearchController = new SearchController()
...
...
@@ -136,21 +137,12 @@ export struct WzInPage {
Button("全选")
.bottomBtnSty().fontColor("#0fa983") .fontSize("14vp")
.onClick(() => {
promptAction.showToast({
message: '进来了' + this.dataSource.length
})
this.dataSource = this.dataSource.map((item) => {
return {
checked: true,
...item
}
})
Logger.info('全选:' + this.dataSource.length, JSON.stringify(this.dataSource))
this.checkedList = this.dataSource.map((item) => item.guid)
})
Button("清空选择")
.bottomBtnSty()
.onClick(() => {
this.checkedList = []
}).fontColor("#0fa983").fontSize("14vp")
}
}.height(80)
...
...
@@ -230,10 +222,10 @@ export struct WzInPage {
List({ space: 2}) {
ForEach(this.dataSource, (item) => {
ListItem() {
WzInList({ item }).width('100%').backgroundColor('#fff')
WzInList({ item
, checkedList: $checkedList
}).width('100%').backgroundColor('#fff')
}
})
}.padding(
20
)
}.padding(
18
)
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论