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 = { export function Modify (data) {
Modify: `${userManagePath}modify`, data.method = `${path}modify`
Loginlog: `${userManagePath}search.loginlog` return request(data, RequestMethods.POST)
} }
export {
userMethods
}
\ No newline at end of file \ No newline at end of file
export function getLoginlogs (data) {
data.method = `${path}search.loginlog`
return request(data)
}
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
</template> </template>
<script> <script>
// import { ctMethods, request } from '@/api' import { Modify } from '@api/userManage'
export default { export default {
name: 'PasswordDialog', name: 'PasswordDialog',
components: { components: {
...@@ -156,17 +156,13 @@ export default { ...@@ -156,17 +156,13 @@ export default {
this.passwordDialogVisible = false this.passwordDialogVisible = false
}, },
mergePassWord (params) { // mergePassWord (params) {
// mergeBg // Modify(params)
// .req(params) // .then(res => {
// .then(res => {
// this.$message({ // })
// message: '密码已修改', // .catch(err => console.log(err))
// type: 'success' // }
// });
// })
// .catch(err => console.log(err))
}
} }
} }
......
...@@ -203,7 +203,7 @@ export const resources = { ...@@ -203,7 +203,7 @@ export const resources = {
component: _import('userManage/loginLogs') component: _import('userManage/loginLogs')
}, },
'108': { '108': {
path: 'page', path: 'reportingLogs',
icon: 'folder-o', icon: 'folder-o',
name: '上报日志', name: '上报日志',
meta: { meta: {
......
...@@ -32,33 +32,9 @@ ...@@ -32,33 +32,9 @@
<el-col>登录日志列表</el-col> <el-col>登录日志列表</el-col>
</el-row> </el-row>
<el-table <el-table
:data="tableData" :table="tableData"
border v-loading="tableLoading"
style="margin: 20px 0;"
> >
<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-table>
<el-pagination <el-pagination
background background
...@@ -75,10 +51,12 @@ ...@@ -75,10 +51,12 @@
</template> </template>
<script> <script>
import { getLoginlogs } from '@api/userManage'
export default { export default {
name: 'loginLogs', name: 'loginLogs',
data () { data () {
return { return {
tableLoading: false,
times: [], times: [],
searchForm: { searchForm: {
beginTime: '', beginTime: '',
...@@ -86,58 +64,135 @@ export default { ...@@ -86,58 +64,135 @@ export default {
field: '', field: '',
loginType: '' loginType: ''
}, },
tableData: [{ // tableData: [{
loginTime: '2019-08-16 14:45:21', // loginTime: '2019-08-16 14:45:21',
loginUser: 'abc123', // loginUser: 'abc123',
userName: '张三', // userName: '张三',
phone: '13511111111', // phone: '13511111111',
loginType: 'PC', // loginType: 'PC',
loginDevice: 'win10/chrome' // loginDevice: 'win10/chrome'
}, { // }, {
loginTime: '2019-08-16 14:45:21', // loginTime: '2019-08-16 14:45:21',
loginUser: 'abc123', // loginUser: 'abc123',
userName: '李四', // userName: '李四',
phone: '13511111111', // phone: '13511111111',
loginType: '小程序', // loginType: '小程序',
loginDevice: 'iphone8' // loginDevice: 'iphone8'
}, { // }, {
loginTime: '2019-08-16 14:45:21', // loginTime: '2019-08-16 14:45:21',
loginUser: 'abc123', // loginUser: 'abc123',
userName: '王五', // userName: '王五',
phone: '13511111111', // phone: '13511111111',
loginType: 'PC', // loginType: 'PC',
loginDevice: 'win10/chrome' // loginDevice: 'win10/chrome'
}], // }],
tableColumns: [{ // tableColumns: [{
label: '登录时间', // label: '登录时间',
prop: 'loginTime' // prop: 'loginTime'
}, { // }, {
label: '登录用户', // label: '登录用户',
prop: 'loginUser' // prop: 'loginUser'
}, { // }, {
label: '姓名', // label: '姓名',
prop: 'userName' // prop: 'userName'
}, { // }, {
label: '联系电话', // label: '联系电话',
prop: 'phone' // prop: 'phone'
}, { // }, {
label: '登录方式', // label: '登录方式',
prop: 'loginType' // prop: 'loginType'
}, { // }, {
label: '登录设备', // label: '登录设备',
prop: 'loginDevice' // 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, currentPage: 1,
pageSize: 10, pageSize: 10,
total: 30 total: 10
} }
}, },
mounted() {
this.loadingGetList()
},
methods: { 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 () { 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!