Commit e4d24655 by 胡悦

提交角色和操作日志部分接口

1 parent a8f6e802
......@@ -285,7 +285,7 @@ export default {
this.getListApi(params).then(res => {
var data = res.data
this.data = data[this.tableParams.listName]
this.total = data.total
this.total = data.totalElements
this.loading = false
}).catch(() => {
this.loading = false
......
......@@ -97,8 +97,7 @@
node-key="id"
ref="tree"
highlight-current
@getCheckedKeys="getCheckedKeys"
@setCheckedNodes="setCheckedNodes"
check-strictly
>
</el-tree>
</div>
......@@ -142,7 +141,7 @@ export default {
prop: 'roleName'
}, {
label: '创建时间',
prop: 'createDate'
prop: 'createdDate'
}, {
label: '备注',
prop: 'remark'
......@@ -194,7 +193,6 @@ export default {
}
},
mounted() {
this.getMenuTree()
},
methods: {
// 重置搜索条件
......@@ -210,9 +208,21 @@ export default {
let params = JSON.parse(JSON.stringify(this.roleForm))
params.enableStatus = this.roleForm.enableStatus ? 1 : 2
let api = addRole
if (params.id) api = editRole
if (params.id) {
api = editRole
delete params.maxUser
if (params.roleVisibility != 2) delete params.roleTenants
}
console.log(params)
api(params).then(res => {
this.handleClose()
if (res.code == '200') {
this.$message({
type: 'success',
message: '操作成功!'
})
this.handleClose()
this.$refs.roleTable.refreshTable()
}
})
} else {
console.log('error')
......@@ -225,6 +235,7 @@ export default {
this.$refs.roleForm.$children[0].resetFields()
}
this.roleVisible = !this.roleVisible
if (!this.roleVisible) this.$refs.tree.setCheckedKeys([])
},
// 按钮事件
btnClick(pType, scope) {
......@@ -236,6 +247,7 @@ export default {
enableStatus: true,
menuIdList: []
}
this.getMenuTree()
this.getTenantList()
this.handleClose()
break
......@@ -250,10 +262,11 @@ export default {
},
// 编辑触发事件
editEvent(row) {
const that = this
roleInfo({ id: row.id }).then(res => {
this.roleForm = JSON.parse(JSON.stringify(res.data))
this.roleForm.enableStatus = res.data.enableStatus == 1 ? true : false
this.getMenuTree({ roleId: row.id })
this.getMenuTree({ roleId: 1 })
this.handleClose(res.data)
})
},
......@@ -286,7 +299,10 @@ export default {
getMenuTree(params) {
getMenuTree(params).then(res => {
console.log(res)
this.treedata = res.data
this.treedata = res.data.menuTree
setTimeout(() => {
this.$refs.tree.setCheckedKeys(res.data.checkedIds)
}, 1000 / 60)
})
},
// 获取选中菜单数组
......@@ -294,9 +310,6 @@ export default {
this.roleForm.menuIdList = this.$refs.tree.getCheckedKeys()
console.log(this.$refs.tree.getCheckedKeys())
},
setCheckedNodes() {
this.$refs.tree.setCheckedNodes([])
},
// 获取租户列表
getTenantList() {
getTenantList().then(res => {
......
......@@ -29,6 +29,7 @@
>导出</el-button>
</div>
<basic-table
ref="worklogTable"
:tableParams="tableParams"
:getListApi="getListApi"
:beforeSearchFn="beforeSearchFn"
......@@ -196,7 +197,9 @@ export default {
},
// 导出列表
exportTable() {
exportWorkLog().then(res => {
console.log(this.$refs.worklogTable)
const params = this.$refs.worklogTable.page
exportWorkLog(params).then(res => {
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!