|
@@ -2057,9 +2057,11 @@ export struct LocalMusic {
|
|
|
// 处理文件选择的函数
|
|
// 处理文件选择的函数
|
|
|
handleFileSelection(item: VideoItem, checked: boolean) {
|
|
handleFileSelection(item: VideoItem, checked: boolean) {
|
|
|
if (checked) {
|
|
if (checked) {
|
|
|
- this.selectedFiles.push(item);
|
|
|
|
|
|
|
+ if (!this.selectedFiles.some(x => x.filePath == item.filePath)) {
|
|
|
|
|
+ this.selectedFiles.push(item);
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
- const index = this.selectedFiles.indexOf(item);
|
|
|
|
|
|
|
+ const index = this.selectedFiles.findIndex(x => x.filePath == item.filePath);
|
|
|
if (index > -1) {
|
|
if (index > -1) {
|
|
|
this.selectedFiles.splice(index, 1);
|
|
this.selectedFiles.splice(index, 1);
|
|
|
}
|
|
}
|
|
@@ -3249,7 +3251,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
|
|
|
|
|
Checkbox({ name: 'checkbox' + index })
|
|
Checkbox({ name: 'checkbox' + index })
|
|
|
- .select(this.selectedFiles.some(x => x.filePath === item.filePath))
|
|
|
|
|
|
|
+ .select(this.selectedFiles.some(x => x.filePath == item.filePath))
|
|
|
.selectedColor(this.themeColor)
|
|
.selectedColor(this.themeColor)
|
|
|
.shape(CheckBoxShape.CIRCLE)
|
|
.shape(CheckBoxShape.CIRCLE)
|
|
|
.opacity(this.isMultiSelect ? 1 : 0)
|
|
.opacity(this.isMultiSelect ? 1 : 0)
|
|
@@ -3269,7 +3271,8 @@ export struct LocalMusic {
|
|
|
.height(this.getGridAllHeight())
|
|
.height(this.getGridAllHeight())
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
if(this.isMultiSelect&&item.type!==CommonConstants.TYPE_IS_DIR){
|
|
if(this.isMultiSelect&&item.type!==CommonConstants.TYPE_IS_DIR){
|
|
|
- this.handleFileSelection(item, !this.selectedFiles.some(x => x.filePath === item.filePath))
|
|
|
|
|
|
|
+ const isChecked = this.selectedFiles.some(x => x.filePath == item.filePath);
|
|
|
|
|
+ this.handleFileSelection(item, !isChecked);
|
|
|
}else{
|
|
}else{
|
|
|
this.doPlay(item, index)
|
|
this.doPlay(item, index)
|
|
|
}
|
|
}
|
|
@@ -3495,8 +3498,12 @@ export struct LocalMusic {
|
|
|
&& item.type !== CommonConstants.TYPE_IS_CSJAD &&
|
|
&& item.type !== CommonConstants.TYPE_IS_CSJAD &&
|
|
|
!this.isHistory) ? { end: this.DeleteButton(item, index, item.filePath) } : {}) //左滑
|
|
!this.isHistory) ? { end: this.DeleteButton(item, index, item.filePath) } : {}) //左滑
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
-
|
|
|
|
|
- this.doPlay(item, index)
|
|
|
|
|
|
|
+ if(this.isMultiSelect&&item.type!==CommonConstants.TYPE_IS_DIR){
|
|
|
|
|
+ const isChecked = this.selectedFiles.some(x => x.filePath == item.filePath);
|
|
|
|
|
+ this.handleFileSelection(item, !isChecked);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.doPlay(item, index)
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|