Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
front-backend
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
framework
front-backend
Commits
a0a99739
Commit
a0a99739
authored
Nov 26, 2019
by
dqjdda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增代码生成器打包下载功能
parent
cbded8ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
src/api/generator/generator.js
+2
-1
src/views/generator/index.vue
+8
-1
No files found.
src/api/generator/generator.js
View file @
a0a99739
...
...
@@ -10,7 +10,8 @@ export function getAllTable() {
export
function
generator
(
tableName
,
type
)
{
return
request
({
url
:
'api/generator/'
+
tableName
+
'/'
+
type
,
method
:
'post'
method
:
'post'
,
responseType
:
type
===
2
?
'blob'
:
''
})
}
...
...
src/views/generator/index.vue
View file @
a0a99739
...
...
@@ -21,13 +21,14 @@
<span>
{{
parseTime
(
scope
.
row
.
createTime
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
width=
"1
4
0px"
align=
"center"
fixed=
"right"
>
<el-table-column
label=
"操作"
width=
"1
6
0px"
align=
"center"
fixed=
"right"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
style=
"margin-right: 2px"
type=
"text"
>
<router-link
:to=
"'/sys-tools/generator/preview/' + scope.row.tableName"
>
预览
</router-link>
</el-button>
<el-button
size=
"mini"
style=
"margin-left: -1px;margin-right: 2px"
type=
"text"
@
click=
"toDownload(scope.row.tableName)"
>
下载
</el-button>
<el-button
size=
"mini"
style=
"margin-left: -1px;margin-right: 2px"
type=
"text"
>
<router-link
:to=
"'/sys-tools/generator/config/' + scope.row.tableName"
>
编辑
...
...
@@ -78,6 +79,12 @@ export default {
duration
:
2500
})
})
},
toDownload
(
tableName
)
{
// 打包下载
generator
(
tableName
,
2
).
then
(
data
=>
{
this
.
downloadFile
(
data
,
tableName
,
'zip'
)
})
}
}
}
...
...
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