Commit 1e1abed3 by 胡悦

设备登录添加设备类型

1 parent 006e5b48
...@@ -105,6 +105,30 @@ export const devicesList = [{ ...@@ -105,6 +105,30 @@ export const devicesList = [{
label: '后视镜', label: '后视镜',
value: '12134' value: '12134'
}] }]
/**
* 设备登录设备类型
*/
export const devicesLoginList = [{
label: '车机后视镜',
value: '1'
}, {
label: '追踪器',
value: '2'
}, {
label: 'OBD',
value: '3'
}, {
label: '车充',
value: '4'
}, {
label: '行车记录仪',
value: '5'
}, {
label: '普方达记录仪',
value: '6'
}]
/** /**
* 嘀加设备状态 * 嘀加设备状态
*/ */
......
<!-- 设备登录 -->
<template> <template>
<div class="dev-login"> <div class="dev-login">
<gl-row :gutter="50"> <gl-row :gutter="50">
...@@ -133,6 +134,24 @@ ...@@ -133,6 +134,24 @@
> >
</gl-input> </gl-input>
</gl-form-item> </gl-form-item>
<gl-form-item
label="设备类型:"
prop="deviceType"
>
<gl-select
:size="size"
v-model="searcher.type"
placeholder="全部"
clearable
>
<gl-option
:label="op.label"
:value="op.value"
v-for="(op,index) in devicesList"
:key="index"
></gl-option>
</gl-select>
</gl-form-item>
<gl-form-item label=""> <gl-form-item label="">
<gl-button <gl-button
:size="size" :size="size"
...@@ -159,7 +178,7 @@ ...@@ -159,7 +178,7 @@
<script> <script>
import { devicesMethods, request } from '@/api' import { devicesMethods, request } from '@/api'
import { pickerOptions } from '@/common/constants' import { devicesLoginList } from '@/common/constants'
// import ECharts from 'vue-echarts' // import ECharts from 'vue-echarts'
// import 'echarts/lib/chart/line' // import 'echarts/lib/chart/line'
import loadMap from '@/common/loadmap' import loadMap from '@/common/loadmap'
...@@ -174,13 +193,25 @@ export default { ...@@ -174,13 +193,25 @@ export default {
loading: false, loading: false,
searcher: { searcher: {
daterange: [ daterange: [
new Date().getTime() - 3600 * 1000 * 24 * 7, new Date().getTime() - 3600 * 1000 * 24 * 2,
new Date().getTime() new Date().getTime()
], ],
sn: '' sn: '',
type: ''
}, },
count: 0, count: 0,
pickerOptions: pickerOptions, devicesList: devicesLoginList,
pickerOptions: {
disabledDate(date) {
var curDate = new Date()
curDate.setDate(curDate.getDate() - 2)
var startTime = new Date(curDate).toLocaleDateString()
if (date.getTime() < new Date(startTime).getTime() || date > new Date()) {
return true
}
return false
}
},
devLogintable: { devLogintable: {
border: true, border: true,
stripe: true, stripe: true,
...@@ -205,6 +236,12 @@ export default { ...@@ -205,6 +236,12 @@ export default {
} }
}, },
{ {
label: '设备类型',
formatter: (cellValue) => {
return this.devicesList[`${this.searcher.type - 1}`].label
}
},
{
label: '登录ip', label: '登录ip',
prop: 'ip' prop: 'ip'
}, },
...@@ -240,7 +277,8 @@ export default { ...@@ -240,7 +277,8 @@ export default {
if (flag) { if (flag) {
const params = { const params = {
beginTime: this.$moment(searcher.daterange[0]).format('YYYYMMDD 00:00:00'), beginTime: this.$moment(searcher.daterange[0]).format('YYYYMMDD 00:00:00'),
endTime: this.$moment(searcher.daterange[1]).format('YYYYMMDD 23:59:59') endTime: this.$moment(searcher.daterange[1]).format('YYYYMMDD 23:59:59'),
type: searcher.type
} }
if (searcher.sn.length >= 20) params.iccid = searcher.sn if (searcher.sn.length >= 20) params.iccid = searcher.sn
else params.sn = searcher.sn else params.sn = searcher.sn
...@@ -266,6 +304,7 @@ export default { ...@@ -266,6 +304,7 @@ export default {
}, },
onSearch() { onSearch() {
this.findAll() this.findAll()
console.log(this.searcher.deviceType - 1)
}, },
onReset() { onReset() {
this.searcher = { this.searcher = {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!