Commit 1e1abed3 by 胡悦

设备登录添加设备类型

1 parent 006e5b48
......@@ -105,6 +105,30 @@ export const devicesList = [{
label: '后视镜',
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>
<div class="dev-login">
<gl-row :gutter="50">
......@@ -133,6 +134,24 @@
>
</gl-input>
</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-button
:size="size"
......@@ -159,7 +178,7 @@
<script>
import { devicesMethods, request } from '@/api'
import { pickerOptions } from '@/common/constants'
import { devicesLoginList } from '@/common/constants'
// import ECharts from 'vue-echarts'
// import 'echarts/lib/chart/line'
import loadMap from '@/common/loadmap'
......@@ -174,13 +193,25 @@ export default {
loading: false,
searcher: {
daterange: [
new Date().getTime() - 3600 * 1000 * 24 * 7,
new Date().getTime() - 3600 * 1000 * 24 * 2,
new Date().getTime()
],
sn: ''
sn: '',
type: ''
},
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: {
border: true,
stripe: true,
......@@ -205,6 +236,12 @@ export default {
}
},
{
label: '设备类型',
formatter: (cellValue) => {
return this.devicesList[`${this.searcher.type - 1}`].label
}
},
{
label: '登录ip',
prop: 'ip'
},
......@@ -240,7 +277,8 @@ export default {
if (flag) {
const params = {
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
else params.sn = searcher.sn
......@@ -266,6 +304,7 @@ export default {
},
onSearch() {
this.findAll()
console.log(this.searcher.deviceType - 1)
},
onReset() {
this.searcher = {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!