This repository has been archived by the owner on Jan 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from longguikeji/dev/plpl
Dev/plpl
- Loading branch information
Showing
9 changed files
with
176 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { IUserApp } from '@/store/modules/user' | ||
|
||
export default function arrTrans(arr: Array<IUserApp>, num: number): Array<Array<IUserApp>> { | ||
if (arr.length === 0) return [] | ||
const arrTrans = new Array() | ||
if (num === 0 || num === 1) { | ||
arrTrans[0] = arr | ||
} else { | ||
const dimensionCapacity = Math.ceil(arr.length / num) | ||
arr.forEach((item, index) => { | ||
const arrTransIndex = Math.floor(index / dimensionCapacity) | ||
if (!arrTrans[arrTransIndex]) { | ||
arrTrans[arrTransIndex] = [] | ||
} | ||
arrTrans[arrTransIndex].push(item) | ||
}) | ||
} | ||
return arrTrans | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.