Commit f8b037ef by wangql

调用接口

1 parent de4a8a9e
const userManagePath = 'fims.user.'
import request from './request'
import RequestMethods from './request.methods'
const path = 'fims.user.'
const userMethods = {
Modify: `${userManagePath}modify`,
Loginlog: `${userManagePath}search.loginlog`
export function Modify (data) {
data.method = `${path}modify`
return request(data, RequestMethods.POST)
}
export {
userMethods
}
\ No newline at end of file
export function getLoginlogs (data) {
data.method = `${path}search.loginlog`
return request(data)
}
......@@ -57,7 +57,7 @@
</template>
<script>
// import { ctMethods, request } from '@/api'
import { Modify } from '@api/userManage'
export default {
name: 'PasswordDialog',
components: {
......@@ -156,17 +156,13 @@ export default {
this.passwordDialogVisible = false
},
mergePassWord (params) {
// mergeBg
// .req(params)
// .then(res => {
// this.$message({
// message: '密码已修改',
// type: 'success'
// });
// })
// .catch(err => console.log(err))
}
// mergePassWord (params) {
// Modify(params)
// .then(res => {
// })
// .catch(err => console.log(err))
// }
}
}
......
......@@ -203,7 +203,7 @@ export const resources = {
component: _import('userManage/loginLogs')
},
'108': {
path: 'page',
path: 'reportingLogs',
icon: 'folder-o',
name: '上报日志',
meta: {
......
......@@ -32,33 +32,9 @@
<el-col>登录日志列表</el-col>
</el-row>
<el-table
:data="tableData"
border
style="margin: 20px 0;"
:table="tableData"
v-loading="tableLoading"
>
<el-table-column
align="center"
width="60px"
label="序号"
type='index'
></el-table-column>
<el-table-column
v-for="(item, index) in tableColumns"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
align="center"
>
<template slot-scope="scope">
<template v-if="item.formatter">
{{item.formatter(scope.row)}}
</template>
<template v-else>
{{tableData[scope.$index][item.prop]}}
</template>
</template>
</el-table-column>
</el-table>
<el-pagination
background
......@@ -75,10 +51,12 @@
</template>
<script>
import { getLoginlogs } from '@api/userManage'
export default {
name: 'loginLogs',
data () {
return {
tableLoading: false,
times: [],
searchForm: {
beginTime: '',
......@@ -86,58 +64,135 @@ export default {
field: '',
loginType: ''
},
tableData: [{
loginTime: '2019-08-16 14:45:21',
loginUser: 'abc123',
userName: '张三',
phone: '13511111111',
loginType: 'PC',
loginDevice: 'win10/chrome'
}, {
loginTime: '2019-08-16 14:45:21',
loginUser: 'abc123',
userName: '李四',
phone: '13511111111',
loginType: '小程序',
loginDevice: 'iphone8'
}, {
loginTime: '2019-08-16 14:45:21',
loginUser: 'abc123',
userName: '王五',
phone: '13511111111',
loginType: 'PC',
loginDevice: 'win10/chrome'
}],
tableColumns: [{
label: '登录时间',
prop: 'loginTime'
}, {
label: '登录用户',
prop: 'loginUser'
}, {
label: '姓名',
prop: 'userName'
}, {
label: '联系电话',
prop: 'phone'
}, {
label: '登录方式',
prop: 'loginType'
}, {
label: '登录设备',
prop: 'loginDevice'
}],
// tableData: [{
// loginTime: '2019-08-16 14:45:21',
// loginUser: 'abc123',
// userName: '张三',
// phone: '13511111111',
// loginType: 'PC',
// loginDevice: 'win10/chrome'
// }, {
// loginTime: '2019-08-16 14:45:21',
// loginUser: 'abc123',
// userName: '李四',
// phone: '13511111111',
// loginType: '小程序',
// loginDevice: 'iphone8'
// }, {
// loginTime: '2019-08-16 14:45:21',
// loginUser: 'abc123',
// userName: '王五',
// phone: '13511111111',
// loginType: 'PC',
// loginDevice: 'win10/chrome'
// }],
// tableColumns: [{
// label: '登录时间',
// prop: 'loginTime'
// }, {
// label: '登录用户',
// prop: 'loginUser'
// }, {
// label: '姓名',
// prop: 'userName'
// }, {
// label: '联系电话',
// prop: 'phone'
// }, {
// label: '登录方式',
// prop: 'loginType'
// }, {
// label: '登录设备',
// prop: 'loginDevice'
// }],
tableData: {
border: true,
align: 'center',
// height: parseInt(this.$client_height() - 140),
data: [],
column: [
{
label: '登录时间',
prop: 'loginTime'
},
{
label: '登录用户',
prop: 'loginUser'
},
{
label: '姓名',
prop: 'userName'
},
{
label: '联系电话',
prop: 'phone'
},
{
label: '登录方式',
prop: 'loginType'
},
{
label: '登录设备',
prop: 'loginDevice'
}
],
number: {
label: '序号',
width: '50px',
index: index => {
++index
return index < 10 && index > 0 ? '0' + index : index
}
},
console: {
}
},
// 页码
currentPage: 1,
pageSize: 10,
total: 30
total: 10
}
},
mounted() {
this.loadingGetList()
},
methods: {
loadingGetList() {
this.tableLoading = true
this.getList()
},
getParams() {
return Object.assign(
{
pageCount: this.pageSize,
pageSize: this.pageNum
},
this.searchForm
)
},
getList() {
if (this.times.length) {
this.searchForm.beginTime = this.times[0]
this.searchForm.endTime = this.times[1]
}
const params = this.getParams()
getLoginlogs(params).then(res => {
// res.pagination && (this.total = res.pagination.totalCount)
this.tableData.data = res
console.log(this.tableData)
this.tableLoading = false
})
.catch(err => {
this.tableLoading = false
console.log(err)
})
},
// 搜索
handleSearch () {
console.log(this.searchForm)
this.loadingGetList()
},
// 页码
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!