|
@@ -4,27 +4,23 @@
|
|
|
<div class="block">
|
|
|
<el-form :model="queryCode">
|
|
|
<div class="set-between">
|
|
|
- <div class="special-input">
|
|
|
- <el-input v-model="queryCode.vehicleId" size="medium" placeholder="车辆ID" clearable />
|
|
|
- <el-input v-model="queryCode.ecuId" size="medium" placeholder="ECUID" clearable />
|
|
|
- <el-input v-model="queryCode.vehicleVersion" size="medium" placeholder="车辆类型" clearable />
|
|
|
- </div>
|
|
|
- <div class="special-input-chose">
|
|
|
- <el-select v-model="queryCode.lockStatus" size="medium" placeholder="锁状态" clearable>
|
|
|
- <el-option v-for="item in lockOptions" :key="item.lockStatusCode" :label="item.name" :value="item.lockStatusCode" />
|
|
|
- </el-select>
|
|
|
- <el-select v-model="queryCode.isActive" size="medium" placeholder="链接状态" clearable>
|
|
|
- <el-option v-for="item in linkOptions" :key="item.isActiveCode" :label="item.name" :value="item.isActiveCode" />
|
|
|
- </el-select>
|
|
|
- <el-select v-model="queryCode.cityName" size="medium" filterable placeholder="城市" clearable>
|
|
|
- <el-option
|
|
|
- v-for="item in city"
|
|
|
- :key="item.CityID"
|
|
|
- :label="item.name"
|
|
|
- :value="item.name"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
+ <el-input v-model="queryCode.vehicleId" size="medium" placeholder="车辆ID" clearable style="width:13%;margin-right: 15px;" />
|
|
|
+ <el-input v-model="queryCode.ecuId" size="medium" placeholder="ECUID" clearable style="width:13%;margin-right: 15px;" />
|
|
|
+ <el-input v-model="queryCode.vehicleVersion" size="medium" placeholder="车辆类型" clearable style="width:13%;margin-right: 15px;" />
|
|
|
+ <el-select v-model="queryCode.lockStatus" size="medium" placeholder="锁状态" clearable style="width:15%;margin-right: 15px;">
|
|
|
+ <el-option v-for="item in lockOptions" :key="item.lockStatusCode" :label="item.name" :value="item.lockStatusCode" />
|
|
|
+ </el-select>
|
|
|
+ <el-select v-model="queryCode.isActive" size="medium" placeholder="链接状态" clearable style="width:15%;margin-right: 15px;">
|
|
|
+ <el-option v-for="item in linkOptions" :key="item.isActiveCode" :label="item.name" :value="item.isActiveCode" />
|
|
|
+ </el-select>
|
|
|
+ <el-select v-model="queryCode.cityName" size="medium" filterable placeholder="城市" clearable style="width:15%;margin-right: 15px;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in city"
|
|
|
+ :key="item.CityID"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.name"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</div>
|
|
|
<div class="set-between">
|
|
|
<el-button type="primary" size="medium" plain @click="dataQuery(queryCode)">搜索</el-button>
|
|
@@ -45,7 +41,11 @@
|
|
|
label="车辆ID"
|
|
|
align="center"
|
|
|
width="95"
|
|
|
- />
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <a href="javascript:void(0)" style="color:#20a0ff" @click="toastDetail(scope.row)">{{ scope.row.vehicleId }}</a>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="ecuId"
|
|
|
label="ECUID"
|
|
@@ -102,8 +102,8 @@
|
|
|
<div class="specail-lock">
|
|
|
<div :class="{ 'el-icon-lock': scope.row.lockStatus === 0 ,'el-icon-unlock': scope.row.lockStatus === 1}" @click="updateLock(scope.row.ecuId, scope.row.lockStatus, scope.row.isActive)" />
|
|
|
<div>
|
|
|
- <el-button size="mini" type="success" plain @click="activate(scope.row.ecuId)">激活</el-button>
|
|
|
- <el-button size="mini" type="info" plain @click="offHmvirtual(scope.row.ecuId)">下线</el-button>
|
|
|
+ <el-button size="mini" :type="scope.row.isActive === 1 ? 'info' : 'success'" plain @click="activateOrOffHmvirtual(scope.row, scope.row.isActive)">{{ scope.row.isActive === 1 ? '下线' : '激活' }}</el-button>
|
|
|
+ <!-- <el-button size="mini" type="info" plain @click="offHmvirtual(scope.row.ecuId)">下线</el-button> -->
|
|
|
<el-button size="mini" type="danger" @click="dialogBug(scope.row.ecuId)">删除</el-button>
|
|
|
<el-button size="mini" type="primary">....</el-button>
|
|
|
<el-dialog
|
|
@@ -121,6 +121,59 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <el-dialog
|
|
|
+ title="设备详情"
|
|
|
+ :visible.sync="dialogVisibleDetail"
|
|
|
+ width="80%"
|
|
|
+ >
|
|
|
+ <el-divider />
|
|
|
+ <div style="padding:20px">
|
|
|
+ <table class="table-suit">
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <td>硬件中控ID</td>
|
|
|
+ <td>{{ pauseToast.ecuId }}</td>
|
|
|
+ <td>车辆ID</td>
|
|
|
+ <td>{{ pauseToast.vehicleId }}</td>
|
|
|
+ <td>电池ID</td>
|
|
|
+ <td>{{ pauseToast.batteryId }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>终端IMSI码</td>
|
|
|
+ <td>{{ pauseToast.imsi }}</td>
|
|
|
+ <td>终端IMEI码</td>
|
|
|
+ <td>{{ pauseToast.imei }}</td>
|
|
|
+ <td>投放城市名称</td>
|
|
|
+ <td>{{ pauseToast.cityName }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>车辆状态</td>
|
|
|
+ <td>{{ pauseToast.vehicleStatusString }}</td>
|
|
|
+ <td>锁状态</td>
|
|
|
+ <td>{{ pauseToast.lockStatus | toLockStatus }}</td>
|
|
|
+ <td>车辆版本</td>
|
|
|
+ <td>{{ pauseToast.vehicleVersion }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>运营状态</td>
|
|
|
+ <td>{{ pauseToast.operationStatusString }}</td>
|
|
|
+ <td>连接状态</td>
|
|
|
+ <td>{{ pauseToast.isActive | toActiveStatus }}</td>
|
|
|
+ <td>纬度</td>
|
|
|
+ <td>{{ pauseToast.lastLat }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>激活时间</td>
|
|
|
+ <td>{{ pauseToast.gmtActive | toData }}</td>
|
|
|
+ <td>创建时间</td>
|
|
|
+ <td>{{ pauseToast.gmtCreate | toData }}</td>
|
|
|
+ <td>经度</td>
|
|
|
+ <td>{{ pauseToast.lastLng }}</td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<el-pagination background style="margin-top:30px;" align="center" :current-page="curIndex" :page-size="pageSize" layout="prev, pager, next" :total="total" @current-change="handleCurrentChange" />
|
|
|
</div>
|
|
|
</div>
|
|
@@ -148,9 +201,70 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ dialogVisibleDetail: false,
|
|
|
tableData: [],
|
|
|
+ vehicleSelect: [
|
|
|
+ {
|
|
|
+ code: 0,
|
|
|
+ name: '正常'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 1,
|
|
|
+ name: '故障'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 2,
|
|
|
+ name: '高危不可用'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 10,
|
|
|
+ name: '低危'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 11,
|
|
|
+ name: '高危可用'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ operationSelect: [
|
|
|
+ {
|
|
|
+ code: 100,
|
|
|
+ name: '运营中'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 200,
|
|
|
+ name: '待运营-出厂'
|
|
|
+ }, {
|
|
|
+ code: 201,
|
|
|
+ name: '待运营-库存'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 202,
|
|
|
+ name: '待运营-移库'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 301,
|
|
|
+ name: '停运-调度中'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 304,
|
|
|
+ name: '停运-没收'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 306,
|
|
|
+ name: '停运-已返厂'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 307,
|
|
|
+ name: '停运-在库'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 400,
|
|
|
+ name: '退出运营-报废'
|
|
|
+ }
|
|
|
+ ],
|
|
|
loading: true,
|
|
|
form: {},
|
|
|
+ pauseToast: {},
|
|
|
queryCode: {},
|
|
|
curIndex: 1,
|
|
|
pageSize: 20,
|
|
@@ -191,7 +305,7 @@ export default {
|
|
|
_queryDeviceInfo() {
|
|
|
const params = { page: this.curIndex, pageSize: this.pageSize }
|
|
|
queryDeviceInfo(params).then(res => {
|
|
|
- res.code === 200 ? this.tableData = res.data.ebikeInfos : this.errorFun(res.msg)
|
|
|
+ res.code === 200 ? this.tableData = res.data.ebikeInfos : this.$message.error(res.msg)
|
|
|
this.total = res.data.total
|
|
|
this.loading = false
|
|
|
})
|
|
@@ -206,7 +320,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
queryDeviceInfo(queryCode).then(res => {
|
|
|
- res.code === 200 ? this.tableData = res.data.ebikeInfos : this.errorFun(res.msg)
|
|
|
+ res.code === 200 ? this.tableData = res.data.ebikeInfos : this.$message.error(res.msg)
|
|
|
this.total = res.data.total
|
|
|
})
|
|
|
},
|
|
@@ -219,17 +333,27 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
queryDeviceInfo(queryCode).then(res => {
|
|
|
- res.code === 200 ? this.tableData = res.data.ebikeInfos : this.errorFun(res.msg)
|
|
|
+ res.code === 200 ? this.tableData = res.data.ebikeInfos : this.$message.error(res.msg)
|
|
|
this.total = res.data.total
|
|
|
})
|
|
|
},
|
|
|
+ // 详情
|
|
|
+ toastDetail(ele) {
|
|
|
+ this.pauseToast = ele
|
|
|
+ this.pauseToast.operationStatusString = this.operationSelect.filter(each => each.code === this.pauseToast.operationStatus)[0].name
|
|
|
+ this.pauseToast.vehicleStatusString = this.vehicleSelect.filter(each => each.code === this.pauseToast.vehicleStatus)[0].name
|
|
|
+ this.dialogVisibleDetail = true
|
|
|
+ },
|
|
|
oneKeyCreate() {
|
|
|
createHmVirtualDevice(this.form).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
- this.successFun('create')
|
|
|
+ this.$message({
|
|
|
+ message: '创建成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
this._queryDeviceInfo()
|
|
|
} else {
|
|
|
- this.errorFun(res.msg)
|
|
|
+ this.$message.error(res.msg)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -242,43 +366,54 @@ export default {
|
|
|
},
|
|
|
updateLock(ecuId, lockStatus, judge) {
|
|
|
if (judge !== 1) {
|
|
|
- this.errorFun('请先激活设备')
|
|
|
+ this.$message({
|
|
|
+ message: '请先激活设备',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
return
|
|
|
}
|
|
|
const params = { ecuId: ecuId, lockStatus: (lockStatus + 1) % 2 }
|
|
|
updateLockStatus(params).then(res => {
|
|
|
this._queryDeviceInfo()
|
|
|
if (res.code === 200) {
|
|
|
- this.successFun('update')
|
|
|
- // this._queryDeviceInfo()
|
|
|
+ this.$message({
|
|
|
+ message: `${lockStatus === 1 ? '关锁' : '开锁'}成功`,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
} else {
|
|
|
- this.errorFun(res.msg)
|
|
|
+ this.$message.error(res.msg)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- activate(ecuId) {
|
|
|
- const params = { ecuId: ecuId }
|
|
|
- activeHmVirtualDevice(params).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.successFun('activate')
|
|
|
- setTimeout(() => {
|
|
|
+ activateOrOffHmvirtual(scope, activatStatus) {
|
|
|
+ const params = { ecuId: scope.ecuId }
|
|
|
+ if (activatStatus === 1) {
|
|
|
+ offHmvirtualDevice(params).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
this._queryDeviceInfo()
|
|
|
- }, 500)
|
|
|
- } else {
|
|
|
- this.errorFun(res.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- offHmvirtual(ecuId) {
|
|
|
- const params = { ecuId: ecuId }
|
|
|
- offHmvirtualDevice(params).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.successFun('offLine')
|
|
|
- this._queryDeviceInfo()
|
|
|
- } else {
|
|
|
- this.errorFun(res.msg)
|
|
|
- }
|
|
|
- })
|
|
|
+ this.$message({
|
|
|
+ message: `车辆ID ${scope.vehicleId} 下线成功`,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ activeHmVirtualDevice(params).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ setTimeout(() => {
|
|
|
+ this._queryDeviceInfo()
|
|
|
+ this.$message({
|
|
|
+ message: `车辆ID ${scope.vehicleId} 激活成功`,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }, 500)
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
// id Bug
|
|
|
dialogBug(e) {
|
|
@@ -289,20 +424,23 @@ export default {
|
|
|
const params = { ecuId: this.pauseId }
|
|
|
delHmVirtualDevice(params).then(res => {
|
|
|
if (res.success === 1) {
|
|
|
- this.successFun('delete')
|
|
|
+ this.$message({
|
|
|
+ message: '删除成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
this._queryDeviceInfo()
|
|
|
} else {
|
|
|
- this.errorFun(res.msg)
|
|
|
+ this.$message.error(res.msg)
|
|
|
}
|
|
|
})
|
|
|
this.dialogVisible = false
|
|
|
- },
|
|
|
- successFun(successText) {
|
|
|
- this.$notify({ title: 'Success', message: `${successText} Successfully`, type: 'success', duration: 2000 })
|
|
|
- },
|
|
|
- errorFun(errorText) {
|
|
|
- this.$notify({ title: 'Failed', message: errorText, type: 'error', duration: 2000 })
|
|
|
}
|
|
|
+ // successFun(successText) {
|
|
|
+ // this.$notify({ title: 'Success', message: `${successText} Successfully`, type: 'success', duration: 2000 })
|
|
|
+ // },
|
|
|
+ // errorFun(errorText) {
|
|
|
+ // this.$notify({ title: 'Failed', message: errorText, type: 'error', duration: 2000 })
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -324,12 +462,12 @@ export default {
|
|
|
.block >>> .el-form
|
|
|
display flex
|
|
|
justify-content space-between
|
|
|
- .block >>> .special-input .el-input
|
|
|
- width 29.5%
|
|
|
- margin-right 10px
|
|
|
- .block >>> .special-input-chose .el-select
|
|
|
- width 27%
|
|
|
- margin-right 10px
|
|
|
+ // .block >>> .special-input .el-input
|
|
|
+ // width 29.5%
|
|
|
+ // margin-right 10px
|
|
|
+ // .block >>> .special-input-chose .el-select
|
|
|
+ // width 27%
|
|
|
+ // margin-right 10px
|
|
|
.block >>> .el-form-item__content
|
|
|
margin-left 0 !important
|
|
|
.block >>> th
|
|
@@ -337,7 +475,7 @@ export default {
|
|
|
.set-between
|
|
|
display flex
|
|
|
.set-locate
|
|
|
- margin-top 40px
|
|
|
+ margin-top 25px
|
|
|
.specail-lock
|
|
|
display flex
|
|
|
justify-content center
|
|
@@ -347,4 +485,20 @@ export default {
|
|
|
.specail-lock >>> .el-dialog__footer
|
|
|
display flex
|
|
|
justify-content center
|
|
|
+ .set-locate >>> .el-divider--horizontal
|
|
|
+ margin 0
|
|
|
+ .table-suit
|
|
|
+ width 100%
|
|
|
+ margin-top 30px
|
|
|
+ tr
|
|
|
+ border 1px solid #eee
|
|
|
+ tr:nth-child(2n)
|
|
|
+ background #fbfbfb
|
|
|
+ tr td
|
|
|
+ padding 10px 20px
|
|
|
+ border-right 1px solid #eee
|
|
|
+ tr td:nth-child(2n-1)
|
|
|
+ font-weight 500
|
|
|
+ tr td:last-child
|
|
|
+ border-right 0
|
|
|
</style>
|