Commit 765877ac by wangql

功能代码提交

1 parent 0341a211
import request from './request'
import RequestMethods from './request.methods'
const path = 'fims.'
export function searchReportLog (data) {
data.method = `${path}reportlog.search`
return request(data)
}
......@@ -2,9 +2,9 @@ import request from './request'
import RequestMethods from './request.methods'
const path = 'fims.user.'
export function Modify (data) {
data.method = `${path}modify`
return request(data, RequestMethods.POST)
export function ModifyPassword (data) {
data.method = `${path}password.modify`
return request(data, RequestMethods.GET)
}
export function getLoginlogs (data) {
......
......@@ -18,6 +18,7 @@
</div>
<PersonDetailDialog
:personDialogVisible="detailVisible"
@detailClose="detailDialogClose"
/>
<PasswordDialog
:passwordDialogVisible="passVisible"
......@@ -36,6 +37,9 @@ export default {
PersonDetailDialog,
PasswordDialog
},
mounted () {
this.$event.$on('e-password-dialog',res=>this.passVisible =res)
},
computed: {
...mapState('d2admin/user', ['info'])
},
......@@ -54,6 +58,10 @@ export default {
this.logout({
confirm: true
})
},
detailDialogClose(){
this.detailVisible = false
}
}
}
......
......@@ -50,14 +50,14 @@
type="primary"
@click="savePassword('info')"
>保 存</el-button>
<el-button @click="passwordDialogVisible = false">取 消</el-button>
<el-button @click="handleClose">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { Modify } from '@api/userManage'
import { ModifyPassword } from '@api/userManage'
export default {
name: 'PasswordDialog',
components: {
......@@ -112,8 +112,7 @@ export default {
},
props: {
passwordDialogVisible: {
type: Boolean,
default: false
type: Boolean
}
// info: {
// type: Object,
......@@ -123,29 +122,23 @@ export default {
// }
},
watch: {
// passwordDialogVisible(val) {
// this.$validator.errors.clear()
// }
},
mounted () {
},
methods: {
// getPersonalType() {
// const params = {}
// params.method = ctMethods.GetPersonalType
// request
// .req(params)
// .then(res => {
// this.sendObjList = res.merchantDictList
// })
// .catch(err => {
// console.log(err)
// })
// },
// 修改密码
savePassword (formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
alert('submit!')
const params = {}
params.userId = ''
params.oldPassword = this.info.oldPassword
params.newPassword = this.info.newPassword
this.mergePassWord(params)
} else {
console.log('error submit!!')
return false
......@@ -153,16 +146,21 @@ export default {
})
},
handleClose () {
this.passwordDialogVisible = false
this.$event.$emit('e-password-dialog',false)
// this.passwordDialogVisible = false
},
// mergePassWord (params) {
// Modify(params)
// .then(res => {
// })
// .catch(err => console.log(err))
// }
mergePassWord (params) {
ModifyPassword(params)
.then(res => {
this.$message({
message: '密码修改成功',
type: 'success'
});
//this.passwordDialogVisible = false
})
.catch(err => console.log(err))
}
}
}
......
......@@ -67,7 +67,7 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="personDialogVisible = false">确 定</el-button>
<el-button type="primary" @click="handleClose">确 定</el-button>
</div>
</el-dialog>
</div>
......@@ -94,8 +94,7 @@ export default {
},
props: {
personDialogVisible: {
type: Boolean,
default: false
type: Boolean
}
// detail: {
// type: Object,
......@@ -138,7 +137,7 @@ export default {
// })
// },
handleClose () {
this.personDialogVisible = false
this.$emit('detailClose')
}
}
}
......
......@@ -16,10 +16,10 @@
</el-date-picker>
</el-form-item>
<el-form-item label="车辆编号">
<el-input v-model="searchForm.carNum" placeholder="请输入车辆编号" clearable></el-input>
<el-input v-model="searchForm.trafficCode" placeholder="请输入车辆编号" clearable></el-input>
</el-form-item>
<el-form-item label="归属车辆段">
<el-select v-model="searchForm.depot" placeholder="请选择" clearable filterable>
<el-select v-model="searchForm.stationName" placeholder="请选择" clearable filterable>
<el-option label="111" value="1"></el-option>
<el-option label="222" value="2"></el-option>
</el-select>
......@@ -38,7 +38,7 @@
</el-col>
</el-row>
<el-table
:data="tableData"
:data="tableData.data"
border
style="margin: 20px 0;"
>
......@@ -49,21 +49,13 @@
type='index'
></el-table-column>
<el-table-column
v-for="(item, index) in tableColumns"
v-for="(item, index) in tableData.column"
: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
......@@ -81,6 +73,7 @@
</template>
<script>
import { searchReportLog } from '@api/reportLogs'
export default {
name: 'reportingLogs',
data () {
......@@ -89,68 +82,101 @@ export default {
searchForm: {
beginTime: '',
endTime: '',
carNum: '',
depot: '',
trafficCode: '',
stationName: '',
subsystemNum: ''
},
tableData: [{
reportTime: '2019-08-16 14:45:21',
carNum: 'CRH45661-5648',
depot: '青岛',
subsystemNum: '3#1F',
subsystemType: '座椅',
subsystemManufactor: '长春通富机电设备有限公司',
reportContent: '00x4561aa'
}, {
reportTime: '2019-08-16 14:45:21',
carNum: 'CRH45661-5648',
depot: '青岛',
subsystemNum: '3#1F',
subsystemType: '座椅',
subsystemManufactor: '长春通富机电设备有限公司',
reportContent: '00x4561aa'
}, {
reportTime: '2019-08-16 14:45:21',
carNum: 'CRH45661-5648',
depot: '青岛',
subsystemNum: '3#1F',
subsystemType: '座椅',
subsystemManufactor: '长春通富机电设备有限公司',
reportContent: '00x4561aa'
}],
tableColumns: [{
label: '上报时间',
prop: 'reportTime'
}, {
label: '车辆编号',
prop: 'carNum'
}, {
label: '归属车辆段',
prop: 'depot'
}, {
label: '子系统编号',
prop: 'subsystemNum'
}, {
label: '子系统类型',
prop: 'subsystemType'
}, {
label: '子系统厂家',
prop: 'subsystemManufactor'
}, {
label: '上报内容',
prop: 'reportContent'
}],
tableData: {
border: true,
align: 'center',
data: [],
column: [
{
label: '上报时间',
prop: 'reportTime'
},
{
label: '车辆编号',
prop: 'trafficCode'
},
{
label: '归属车辆段',
prop: 'stationName'
},
{
label: '子系统编号',
prop: 'subSystemCode'
},
{
label: '子系统类型',
prop: 'subSystemType'
},
{
label: '子系统厂家',
prop: 'merchantName'
},
{
label: '上报内容',
prop: 'reportValue'
}
],
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()
searchReportLog(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()
},
// 页码
......
......@@ -32,9 +32,24 @@
<el-col>登录日志列表</el-col>
</el-row>
<el-table
:table="tableData"
:data="tableData.data"
v-loading="tableLoading"
>
<el-table-column
align="center"
width="60px"
label="序号"
type='index'
></el-table-column>
<el-table-column
v-for="(item, index) in tableData.column"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
align="center"
>
</el-table-column>
</el-table>
<el-pagination
background
......@@ -64,51 +79,9 @@ 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: {
border: true,
align: 'center',
// height: parseInt(this.$client_height() - 140),
data: [],
column: [
{
......@@ -117,7 +90,7 @@ export default {
},
{
label: '登录用户',
prop: 'loginUser'
prop: 'loginName'
},
{
label: '姓名',
......@@ -125,15 +98,15 @@ export default {
},
{
label: '联系电话',
prop: 'phone'
prop: 'mobile'
},
{
label: '登录方式',
prop: 'loginType'
prop: 'loginTypeValue'
},
{
label: '登录设备',
prop: 'loginDevice'
prop: 'deviceCode'
}
],
number: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!