Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TF-MOM-WEB
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TFMOM
TF-MOM-WEB
Commits
f59bca27
Commit
f59bca27
authored
Dec 04, 2023
by
“lixuyan”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
前端导入
parent
b7c16042
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
util.js
applications/architecture-dee/src/utils/util.js
+18
-1
No files found.
applications/architecture-dee/src/utils/util.js
View file @
f59bca27
...
...
@@ -19,6 +19,7 @@ import _get from 'lodash.get'
import
_set
from
'lodash.set'
import
router
from
'../router'
import
{
downFileByFileId
}
from
'../api/file'
import
{
export_json_to_excel
}
from
'@/Excel/Export2Excel'
// 限制promise并发数量
export
function
promiseLimit
(
func
,
funcParams
,
limit
=
5
)
{
let
i
=
0
...
...
@@ -1593,6 +1594,21 @@ export function getTargetJobResponses(item, responseName) {
}
}
function formatJson(filterVal, jsonData) {
return jsonData.map(row => filterVal.map(j => _get(row, j)))
}
export function export_excel(columns, tableData, title) {
const tHeader = []
const filterVal = []
columns.forEach(col => {
tHeader.push(col.title)
filterVal.push(col.key)
})
// tHeader.push('id')
// filterVal.push('id')
const data = formatJson(filterVal, tableData)
export_json_to_excel(tHeader, data, title)
}
export default {
treeFindBackArray,
throttle,
...
...
@@ -1678,5 +1694,6 @@ export default {
findForm,
sumArray,
subNum,
getTargetJobResponses
getTargetJobResponses,
export_excel
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment