File tree Expand file tree Collapse file tree 3 files changed +45
-6
lines changed Expand file tree Collapse file tree 3 files changed +45
-6
lines changed Original file line number Diff line number Diff line change @@ -57,3 +57,11 @@ export function delTable(tableId) {
57
57
} )
58
58
}
59
59
60
+ // 生成代码到项目
61
+ export function toProjectTable ( tableId ) {
62
+ return request ( {
63
+ url : '/api/v1/gen/toproject/' + tableId ,
64
+ method : 'get'
65
+ } )
66
+ }
67
+
Original file line number Diff line number Diff line change 25
25
</li >
26
26
<li class =" list-group-item" >
27
27
<svg-icon icon-class =" tree" />所属部门
28
- <div v-if = " user.dept " class =" pull-right" >{{ user.dept. deptName }} / {{ postGroup }}</div >
28
+ <div class =" pull-right" >{{ deptName }}</div >
29
29
</li >
30
30
<li class =" list-group-item" >
31
31
<svg-icon icon-class =" peoples" />所属角色
32
- <div class =" pull-right" >{{ roleGroup }}</div >
32
+ <div class =" pull-right" >{{ roleName }}</div >
33
33
</li >
34
34
<li class =" list-group-item" >
35
35
<svg-icon icon-class =" date" />创建日期
@@ -72,7 +72,14 @@ export default {
72
72
user: {},
73
73
roleGroup: {},
74
74
postGroup: {},
75
- activeTab: ' userinfo'
75
+ deptGroup: {},
76
+ activeTab: ' userinfo' ,
77
+ roleIds: undefined ,
78
+ postIds: undefined ,
79
+ roleName: undefined ,
80
+ postName: undefined ,
81
+ dept: {},
82
+ deptName: undefined
76
83
}
77
84
},
78
85
created () {
@@ -82,8 +89,20 @@ export default {
82
89
getUser () {
83
90
getUserProfile ().then (response => {
84
91
this .user = response .data
85
- this .roleGroup = response .roleGroup
86
- this .postGroup = response .postGroup
92
+ this .roleIds = response .roleIds
93
+ this .roleGroup = response .roles
94
+
95
+ if (this .roleIds [0 ]) {
96
+ for (const key in this .roleGroup ) {
97
+ if (this .roleIds [0 ] === this .roleGroup [key].roleId ) {
98
+ this .roleName = this .roleGroup [key].roleName
99
+ }
100
+ }
101
+ } else {
102
+ this .roleName = ' 暂无'
103
+ }
104
+ this .dept = response .dept
105
+ this .deptName = this .dept .deptName
87
106
})
88
107
}
89
108
}
Original file line number Diff line number Diff line change 108
108
icon =" el-icon-view"
109
109
@click =" handlePreview(scope.row)"
110
110
>预览</el-button >
111
+ <el-button
112
+
113
+ type =" text"
114
+ size =" small"
115
+ icon =" el-icon-view"
116
+ @click =" handleToProject(scope.row)"
117
+ >生成到项目</el-button >
111
118
<el-button
112
119
113
120
type =" text"
150
157
</template >
151
158
152
159
<script >
153
- import { listTable , previewTable , delTable } from ' @/api/tools/gen'
160
+ import { listTable , previewTable , delTable , toProjectTable } from ' @/api/tools/gen'
154
161
import importTable from ' ./importTable'
155
162
import { downLoadFile } from ' @/utils/zipdownload'
156
163
export default {
@@ -244,6 +251,11 @@ export default {
244
251
this .preview .open = true
245
252
})
246
253
},
254
+ handleToProject (row ) {
255
+ toProjectTable (row .tableId ).then (response => {
256
+ this .msgSuccess (response .msg )
257
+ })
258
+ },
247
259
// 多选框选中数据
248
260
handleSelectionChange (selection ) {
249
261
this .ids = selection .map (item => item .tableId )
You can’t perform that action at this time.
0 commit comments