|
@@ -1,76 +1,81 @@
|
|
|
-<template style="height=0px;improtanent">
|
|
|
- <div class="app-container">
|
|
|
- <el-header style="height: auto;!improtant">
|
|
|
- <div class="filter-container" style="padding-bottom: 20px;!improtant">
|
|
|
- <div style="font-size:13px" color="#333B4A">
|
|
|
- 车辆ID<el-input v-model="listQuery.vehicleId" placeholder="请填写" style="width: 130px;" class="filter-item" />
|
|
|
- 锁ID <el-input v-model="listQuery.lockNo" placeholder="请填写" style="width: 130px;" class="filter-item" />
|
|
|
- 锁类型 <el-select v-model="listQuery.lockModel" placeholder="请填写" style="width: 130px;" class="filter-item" filterable clearable @change="getDataType(listQuery.lockModel)">
|
|
|
+<template>
|
|
|
+ <div class="set-background">
|
|
|
+ <div class="block">
|
|
|
+ <el-form :model="listQuery">
|
|
|
+ <div class="set-head">
|
|
|
+ 车辆ID<el-input v-model="listQuery.vehicleId" placeholder="请填写" style="width:18%;" />
|
|
|
+ 锁ID <el-input v-model="listQuery.lockNo" placeholder="请填写" style="width:18%;" />
|
|
|
+ 锁类型 <el-select v-model="listQuery.lockModel" placeholder="请填写" style="width:18%;" filterable clearable>
|
|
|
<el-option v-for="item in lockModelList" :key="item.model" :label="item.modelName" :value="item.model" />
|
|
|
</el-select>
|
|
|
- 状态 <el-select v-model="listQuery.lockStatus" placeholder="请填写" style="width: 130px;" class="filter-item" filterable clearable>
|
|
|
+ 状态 <el-select v-model="listQuery.lockStatus" placeholder="请填写" style="width: 18%;" filterable clearable>
|
|
|
<el-option v-for="item in lockStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
-
|
|
|
- <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getDevicesList(listQuery)">搜索</el-button>
|
|
|
- <el-button class="filter-item" style="margin-left: 1px;" type="primary" icon="el-icon-edit" @click="dialogFormVisible = true, createdCode()">新增</el-button>
|
|
|
</div>
|
|
|
+ <div class="set-between">
|
|
|
+ <el-button type="primary" icon="el-icon-search" @click="getDevicesList(listQuery)">搜索</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-edit" @click="dialogFormVisible = true, createdCode()">新增</el-button>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ <div class="set-locate">
|
|
|
+ <el-table :key="tableKey" :data="list" fit highlight-current-row style="width: 100%;" border :header-cell-style="{background:'#F0F7FF',color:'#606266'}">
|
|
|
+ <el-table-column label="车辆ID" prop="vehicleId" align="center" min-width="120">
|
|
|
+ <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="dialogDetailVisible = true,deviceDetails(scope.row)">{{ scope.row.vehicleId }}</a></template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column label="锁ID" min-width="100px" align="center">
|
|
|
+ <template slot-scope="scope"><span>{{ scope.row.lockNo }}</span></template>
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column label="锁ID" prop="lockNo" min-width="100px" align="center" />
|
|
|
+ <el-table-column label="锁类型" min-width="80px" align="center">
|
|
|
+ <template slot-scope="scope"><span>{{ scope.row.lockModelInfo.modelName }}</span></template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="在线状态" class-name="status-col" min-width="100">
|
|
|
+ <template slot-scope="{row}"><el-tag :type="row.isOnline | statusFilter">{{ statusMaps.get(row.isOnline) }}</el-tag></template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="锁状态" class-name="status-col" min-width="100px">
|
|
|
+ <template slot-scope="{row}"><el-tag :type="row.lockStatus | statusFilter">{{ lockStatusMaps.get(row.lockStatus) }}</el-tag></template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="经度" min-width="80px" align="center">
|
|
|
+ <template slot-scope="scope"><span>{{ scope.row.deviceLng }}</span></template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="纬度" min-width="80px" align="center">
|
|
|
+ <template slot-scope="scope"><span>{{ scope.row.deviceLat }}</span></template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="创建时间" min-width="120px" align="center">
|
|
|
+ <template slot-scope="scope"><span>{{ scope.row.createTime }}</span></template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" min-width="300px" class-name="small-padding fixed-width" fixed="right">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <el-button v-if="row.isOnline!=1" size="mini" type="success" @click="handleDeviceStatus(row, 1)">上线</el-button>
|
|
|
+ <el-button v-if="row.isOnline!=0" size="mini" type="danger" @click="handleDeviceStatus(row, 0)">下线</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="handleUpdate(row)">编辑</el-button>
|
|
|
+ <el-button type="danger" size="mini" @click="deleteCodeData(row)">删除</el-button>
|
|
|
+ <el-button v-if="row.lockStatus!=0" size="mini" type="info" @click="handleLockStatus(row, 0)">关锁</el-button>
|
|
|
+ <el-button v-if="row.lockStatus!=1" size="mini" type="warning" @click="handleLockStatus(row, 1)">开锁</el-button>
|
|
|
+ <!-- <i v-if="row.lockStatus!=0" style="font-size: 25px;" class="el-icon-unlock" @click="handleLockStatus(row, 0)" />
|
|
|
+ <i v-if="row.lockStatus!=1" style="font-size: 25px;" class="el-icon-lock" @click="handleLockStatus(row, 1)" /> -->
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <el-pagination
|
|
|
+ align="center"
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :total="1000"
|
|
|
+ />
|
|
|
</div>
|
|
|
- </el-header>
|
|
|
-
|
|
|
- <el-table :key="tableKey" :data="list" fit highlight-current-row style="width: 100%;" border :header-cell-style="{background:'#F0F7FF',color:'#606266'}">
|
|
|
- <el-table-column label="车辆ID" prop="vehicleId" align="center" min-width="100">
|
|
|
- <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff" @click="dialogDetailVisible = true,deviceDetails(scope.row)(scope.row.vehicleId)">{{ scope.row.vehicleId }}</a></template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="锁ID" min-width="100px" align="center">
|
|
|
- <template slot-scope="scope"><span>{{ scope.row.lockNo }}</span></template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="锁类型" min-width="80px" align="center">
|
|
|
- <template slot-scope="scope"><span>{{ scope.row.lockModelInfo.modelName }}</span></template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column label="在线状态" class-name="status-col" min-width="100">
|
|
|
- <template slot-scope="{row}"><el-tag :type="row.isOnline | statusFilter">{{ statusMaps.get(row.isOnline) }}</el-tag></template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="锁状态" class-name="status-col" min-width="100px">
|
|
|
- <template slot-scope="{row}"><el-tag :type="row.lockStatus | statusFilter">{{ lockStatusMaps.get(row.lockStatus) }}</el-tag></template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="经度" min-width="80px" align="center">
|
|
|
- <template slot-scope="scope"><span>{{ scope.row.deviceLng }}</span></template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="纬度" min-width="80px" align="center">
|
|
|
- <template slot-scope="scope"><span>{{ scope.row.deviceLat }}</span></template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="创建时间" min-width="120px" align="center">
|
|
|
- <template slot-scope="scope"><span>{{ scope.row.createTime }}</span></template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" align="center" min-width="250px" class-name="small-padding fixed-width" fixed="right">
|
|
|
- <template slot-scope="{row}">
|
|
|
-
|
|
|
- <el-button v-if="row.isOnline!=1" size="mini" type="success" @click="handleDeviceStatus(row, 1)">上线</el-button>
|
|
|
- <el-button v-if="row.isOnline!=0" size="mini" type="danger" @click="handleDeviceStatus(row, 0)">下线</el-button>
|
|
|
- <el-button type="primary" size="mini" @click="handleUpdate(row)">编辑</el-button>
|
|
|
- <el-button type="danger" size="mini" @click="deleteCodeData(row)">删除</el-button>
|
|
|
- <i v-if="row.lockStatus!=0" style="font-size: 20px;" class="el-icon-unlock" @click="handleLockStatus(row, 0)" />
|
|
|
- <i v-if="row.lockStatus!=1" style="font-size: 20px;" class="el-icon-lock" @click="handleLockStatus(row, 1)" />
|
|
|
-
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <el-pagination
|
|
|
- align="center"
|
|
|
- background
|
|
|
- layout="prev, pager, next"
|
|
|
- :total="1000"
|
|
|
- />
|
|
|
- <!-- <pagination v-show="total>0" :total="listQuery.length" :page.sync="this.curIndex" :limit.sync="this.pageSize" @pagination="getMyDevicesList" /> -->
|
|
|
+ </div>
|
|
|
+
|
|
|
<!-- 新增 -->
|
|
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="75%">
|
|
|
- <el-form ref="addDeviceForms" :rules="addDeviceDataRules" :model="addDeviceData" label-position="left" label-width="80px" style="width: 250px; margin-left:80px;">
|
|
|
- <div class="set-font" style="display:flex;justfy-content:space-between">
|
|
|
- <div style="margin-left: 20%;">
|
|
|
+ <el-form ref="addDeviceForms" :rules="addDeviceDataRules" :model="addDeviceData" label-position="left" label-width="80px" style="width: 100%; margin-left:0px; margin-top:25px">
|
|
|
+ <div class="set-font" style="display:flex;justfy-content:space-between" width="100%">
|
|
|
+ <div style="margin-left: 14%;">
|
|
|
<el-form-item label="业务线" prop="bizType">
|
|
|
- <el-input v-model="addDeviceData.bizType" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
|
+ <el-input v-model="addDeviceData.bizType" :disabled="true" style="width:100%;" placeholder="单车" />
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="锁类型" prop="lockModel">
|
|
@@ -85,9 +90,9 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
- <div style="margin-left: 30%;">
|
|
|
+ <div style="margin-left: 10%;">
|
|
|
<el-form-item label="车辆个数" prop="deviceNum">
|
|
|
- <el-input v-model="addDeviceData.deviceNum" style="width:200px;" placeholder="请填写" />
|
|
|
+ <el-input v-model="addDeviceData.deviceNum" style="width:100%;" placeholder="请填写" />
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="车供应商" style="flex-grow:1" prop="bikeSupplier">
|
|
@@ -112,8 +117,8 @@
|
|
|
</el-dialog>
|
|
|
<!-- 查看详情 -->
|
|
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogDetailVisible" width="73%">
|
|
|
- <el-form ref="serviceDataForms" :rules="serviceDataRules" :model="detailData" label-position="left" label-width="110px" style="width: 200px; margin-left:66px;">
|
|
|
- <div class="set-font" style="display:flex;justfy-content:space-between">
|
|
|
+ <el-form ref="serviceDataForms" :rules="serviceDataRules" :model="detailData" label-width="70px" style="width: 100%; margin-left:80px;">
|
|
|
+ <!-- <div class="set-font" style="display:flex;justfy-content:space-between">
|
|
|
<div style="margin-left: 20%;">
|
|
|
<el-form-item label="业务线" prop="bizType">
|
|
|
<el-input v-model="detailData.bizType" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
@@ -158,7 +163,50 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
</div>
|
|
|
+ </div> -->
|
|
|
+ <!-- <div class="set-font" style="width:100%"> -->
|
|
|
+ <div class="table-th" style="width:82%;margin-top=15px">
|
|
|
+ <table cellspacing="0" width="103%;" bordercolor="#ddd" class="border-color">
|
|
|
+ <tr width="100%">
|
|
|
+ <th width="12%" height="40" style="background-color:#F1F4F7;">业务线</th>
|
|
|
+ <td width="15%">单车</td>
|
|
|
+ <th width="10%" style="background-color:#F1F4F7">锁ID</th>
|
|
|
+ <td width="15%"> {{ detailData.lockNo }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th width="12%" height="40" style="background-color:#F1F4F7">经度</th>
|
|
|
+ <td>{{ detailData.deviceLng }}</td>
|
|
|
+ <th style="background-color:#F1F4F7">纬度 </th>
|
|
|
+ <td> {{ detailData.deviceLat }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th width="12%" height="40" style="background-color:#F1F4F7">锁状态</th>
|
|
|
+ <td>{{ detailData.lockStatus }}</td>
|
|
|
+ <th style="background-color:#F1F4F7">车辆ID </th>
|
|
|
+ <td> {{ detailData.vehicleId }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th height="40" style="background-color:#F1F4F7">EcuID</th>
|
|
|
+ <td> {{ detailData.deviceId }}</td>
|
|
|
+ <th style="background-color:#F1F4F7">IccID</th>
|
|
|
+ <td> {{ detailData.iccid }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th height="40" style="background-color:#F1F4F7">电量信息</th>
|
|
|
+ <td> {{ detailData.lockBatteryLevel }}</td>
|
|
|
+ <th style="background-color:#F1F4F7">Mac地址</th>
|
|
|
+ <td> {{ detailData.macAddr }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th style="background-color:#F1F4F7">bluetooth_key</th>
|
|
|
+ <td> {{ detailData.bluetoothKey }}</td>
|
|
|
+ <th height="40" style="background-color:#F1F4F7">bluetoothPassword</th>
|
|
|
+ <td> {{ detailData.bluetoothPassword }}</td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
</div>
|
|
|
+ <!-- </div> -->
|
|
|
+
|
|
|
</el-form>
|
|
|
<br><br><br>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -167,56 +215,57 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!-- 编辑 -->
|
|
|
- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogUpdateVisible" width="75%">
|
|
|
- <el-form ref="serviceDataForms" :rules="serviceDataRules" :model="serviceData" label-position="left" label-width="80px" style="width: 250px; margin-left:80px;">
|
|
|
- <div class="set-font">
|
|
|
- <div class="block">
|
|
|
- <div style="display:flex;justify-content:space-between">
|
|
|
+ <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogUpdateVisible" width="75%" class="setPercent">
|
|
|
+ <el-form ref="serviceDataForms" :rules="serviceDataRules" :model="serviceData" label-position="left" label-width="70px" style="width: 100%; margin-left:80px;">
|
|
|
+ <div class="set-font" style="width:100%">
|
|
|
+ <div class="block-edit">
|
|
|
+ <div style="display:flex;justify-content:space-between;width:92%">
|
|
|
<el-form-item label="经度" prop="deviceLat">
|
|
|
- <el-input v-model="serviceData.deviceLat" style="width:200px;" placeholder="单车" />
|
|
|
+ <el-input v-model="serviceData.deviceLat" style="width:100%;" placeholder="单车" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="电量" prop="lockBatteryLevel">
|
|
|
- <el-input v-model="serviceData.lockBatteryLevel" style="width:200px;" placeholder="请填写" />
|
|
|
+ <el-input v-model="serviceData.lockBatteryLevel" style="width:100%;" placeholder="请填写" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div style="display:flex;justify-content:space-between;width:92%">
|
|
|
+ <el-form-item label="纬度" prop="deviceLng">
|
|
|
+ <el-input v-model="serviceData.deviceLng" style="width:100%;" placeholder="请填写" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
- <el-form-item label="纬度" prop="deviceLng">
|
|
|
- <el-input v-model="serviceData.deviceLng" style="width:200px;" placeholder="请填写" />
|
|
|
- </el-form-item>
|
|
|
</div>
|
|
|
- <div class="block">
|
|
|
- <el-form-item label="业务线" prop="bizType">
|
|
|
- <el-input v-model="serviceData.bizType" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="锁ID" prop="lockNo">
|
|
|
- <el-input v-model="serviceData.lockNo" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="锁状态" prop="lockStatus">
|
|
|
- <el-input v-model="serviceData.lockStatus" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="车辆ID" prop="vehicleId">
|
|
|
- <el-input v-model="serviceData.vehicleId" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
- </el-form-item>
|
|
|
- <!-- <el-form-item label="锁供应商" prop="returnDataTypeStr">
|
|
|
- <el-input v-model="serviceData.customName" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="车辆供应商" prop="returnDataTypeStr">
|
|
|
- <el-input v-model="serviceData.customName" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
|
- </el-form-item> -->
|
|
|
- <el-form-item label="EcuID" prop="deviceId">
|
|
|
- <el-input v-model="serviceData.deviceId" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="IccID" prop="iccid">
|
|
|
- <el-input v-model="serviceData.iccid" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="Mac地址" prop="macAddr">
|
|
|
- <el-input v-model="serviceData.macAddr" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="bluetooth_key" prop="bluetoothKey">
|
|
|
- <el-input v-model="serviceData.bluetoothKey" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="bluetooth_password" prop="bluetoothPassword">
|
|
|
- <el-input v-model="serviceData.bluetoothPassword" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
- </el-form-item>
|
|
|
+ <div class="block-edit table-th" style="width:82%">
|
|
|
+ <table cellspacing="0" width="103%;" bordercolor="#ddd" class="border-color">
|
|
|
+ <tr width="100%">
|
|
|
+ <th width="12%" height="40" style="background-color:#F1F4F7;">业务线</th>
|
|
|
+ <td width="15%">单车</td>
|
|
|
+ <th width="10%" style="background-color:#F1F4F7">锁ID</th>
|
|
|
+ <td width="15%"> {{ serviceData.lockNo }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th width="12%" height="40" style="background-color:#F1F4F7">锁状态</th>
|
|
|
+ <td>{{ serviceData.lockStatus }}</td>
|
|
|
+ <th style="background-color:#F1F4F7">车辆ID </th>
|
|
|
+ <td> {{ serviceData.vehicleId }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th height="40" style="background-color:#F1F4F7">EcuID</th>
|
|
|
+ <td> {{ serviceData.deviceId }}</td>
|
|
|
+ <th style="background-color:#F1F4F7">IccID</th>
|
|
|
+ <td> {{ serviceData.iccid }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th height="40" style="background-color:#F1F4F7">Mac地址</th>
|
|
|
+ <td> {{ serviceData.macAddr }}</td>
|
|
|
+ <th style="background-color:#F1F4F7">bluetooth_key</th>
|
|
|
+ <td> {{ serviceData.bluetoothKey }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th height="40" style="background-color:#F1F4F7">bluetooth_password</th>
|
|
|
+ <td> {{ serviceData.bluetoothPassword }}</td>
|
|
|
+ <th style="background-color:#F1F4F7" />
|
|
|
+ <td />
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form>
|
|
@@ -228,20 +277,19 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
</div>
|
|
|
- <!-- changeCopy, -->
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { queryLockCreateInfo, queryVehicleCreateInfo, createDevice, deleteDevice, deviceOnline, deviceOffline, unlockVehicle, lockVehicle, updateLockAttr, getDevices, getLockAttrInfo } from '@/api/htVehicle'
|
|
|
+import { queryLockCreateInfo, queryVehicleCreateInfo, createDevice, deleteDevice, deviceOnline, deviceOffline, unlockVehicle, lockVehicle, updateLockAttr, getDevices } from '@/api/htVehicle'
|
|
|
import waves from '@/directive/waves' // waves directive
|
|
|
import { parseTime } from '@/utils'
|
|
|
-import Pagination from '@/components/Pagination' // secondary package based on el-pagination
|
|
|
+// import Pagination from '@/components/Pagination' // secondary package based on el-pagination
|
|
|
|
|
|
var envSelections = []
|
|
|
var consumerSelections = []
|
|
|
|
|
|
export default {
|
|
|
- name: 'Httpmock',
|
|
|
+ name: 'HTvehicle',
|
|
|
// components: { Pagination },
|
|
|
directives: { waves },
|
|
|
filters: {
|
|
@@ -261,30 +309,23 @@ export default {
|
|
|
dialogDetailVisible: false,
|
|
|
dialogUpdateVisible: false,
|
|
|
shouldShow: false,
|
|
|
-
|
|
|
total: 0,
|
|
|
num: '',
|
|
|
tableKey: 0,
|
|
|
list: null,
|
|
|
curIndex: 1,
|
|
|
pageSize: 10,
|
|
|
-
|
|
|
- statusMaps: new Map([[1, '已开启'], [0, '未开启']]),
|
|
|
+ statusMaps: new Map([[1, '在线'], [0, '下线']]),
|
|
|
lockStatusMaps: new Map([[1, '已开锁'], [0, '已关锁']]),
|
|
|
- statusOperateMap: new Map([[1, '开启'], [0, '关闭']]),
|
|
|
- options: [{ value: '', label: '全部显示' }, { value: '1', label: '已开启' }, { value: '0', label: '未开启' }],
|
|
|
+ statusOperateMaps: new Map([[1, '在线'], [0, '离线']]),
|
|
|
+ options: [{ value: '', label: '全部显示' }, { value: '1', label: '在线' }, { value: '0', label: '离线' }],
|
|
|
bizType: [{ value: '1', label: '电单车' }, { value: '2', label: '单车' }],
|
|
|
lockStatusOptions: [{ value: '1', label: '已开锁' }, { value: '2', label: '已关锁' }],
|
|
|
lockModelList: [],
|
|
|
lockSupplierList: [],
|
|
|
bikeModelList: [],
|
|
|
bikeSupplierList: [],
|
|
|
- listQuery: {
|
|
|
- // lockModel: '',
|
|
|
- // bikeModel: '',
|
|
|
- // vehicleId: '',
|
|
|
- // lockNo: ''
|
|
|
- },
|
|
|
+ listQuery: {},
|
|
|
textMap: {
|
|
|
update: '编辑',
|
|
|
create: '新增',
|
|
@@ -296,23 +337,11 @@ export default {
|
|
|
importanceOptions: [1, 2, 3],
|
|
|
envSelectDataType: '',
|
|
|
envSelections,
|
|
|
- methodProtocol: 'http',
|
|
|
consumerSelections,
|
|
|
sortOptions: [{ label: 'ID Ascending', key: '+id' }, { label: 'ID Descending', key: '-id' }],
|
|
|
statusOptions: ['published', 'draft', 'deleted'],
|
|
|
showReviewer: false,
|
|
|
showSubmitBtn: true,
|
|
|
- // temp: {
|
|
|
- // id: undefined,
|
|
|
- // importance: 1,
|
|
|
- // actualUrl: '',
|
|
|
- // creator: '',
|
|
|
- // mockUrl: '',
|
|
|
- // timestamp: new Date(),
|
|
|
- // title: '',
|
|
|
- // type: '',
|
|
|
- // status: 'published'
|
|
|
- // },
|
|
|
addDeviceData: {
|
|
|
bizType: '单车',
|
|
|
lockModel: '',
|
|
@@ -418,7 +447,6 @@ export default {
|
|
|
this.serviceData = vel
|
|
|
this.dialogUpdateVisible = true
|
|
|
},
|
|
|
-
|
|
|
updateData(vel) {
|
|
|
if (vel === this.serviceData) {
|
|
|
this.bizData = {
|
|
@@ -460,7 +488,6 @@ export default {
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
this.handleDelete(e)
|
|
|
- // this.$message({ type: 'success', message: '删除成功!' })
|
|
|
}).catch(() => {
|
|
|
this.$message({
|
|
|
type: 'info',
|
|
@@ -470,41 +497,38 @@ export default {
|
|
|
},
|
|
|
|
|
|
handleDelete(row) {
|
|
|
- var deleteData = { 'vehicleId': row.vehicleId }
|
|
|
- deleteDevice(deleteData).then(response => {
|
|
|
+ // var deleteData = { 'vehicleId': row.vehicleId }
|
|
|
+ deleteDevice(row.vehicleId).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
this.getMyDevicesList()
|
|
|
this.$notify({ title: 'Success', message: response.msg, type: 'success', duration: 3000 })
|
|
|
} else {
|
|
|
+ this.getMyDevicesList()
|
|
|
this.$notify({ title: 'Failed', message: response.msg, type: 'error', duration: 3000 })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- handleFilter() {
|
|
|
- // this.getList()
|
|
|
- },
|
|
|
-
|
|
|
// 设备上线、下线调用
|
|
|
handleDeviceStatus(row, isOnline) {
|
|
|
- var statusData = { 'lockNo': row.lockNo }
|
|
|
+ // var statusData = { 'lockNo': row.lockNo }
|
|
|
if (isOnline === 1) {
|
|
|
- deviceOnline(statusData).then(response => {
|
|
|
+ deviceOnline(row.lockNo).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
row.isOnline = isOnline
|
|
|
- this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(isOnline) + '成功!', type: 'success' })
|
|
|
+ this.$message({ message: '锁ID:' + row.lockNo.toString() + ' ' + this.statusOperateMaps.get(isOnline) + '成功!', type: 'success' })
|
|
|
} else {
|
|
|
- this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(isOnline) + '失败!', type: 'danger' })
|
|
|
+ this.$message({ message: '锁ID:' + row.lockNo.toString() + ' ' + this.statusOperateMaps.get(isOnline) + '失败!', type: 'danger' })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
if (isOnline === 0) {
|
|
|
- deviceOffline(statusData).then(response => {
|
|
|
+ deviceOffline(row.lockNo).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
row.isOnline = isOnline
|
|
|
- this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(isOnline) + '成功!', type: 'success' })
|
|
|
+ this.$message({ message: '锁ID:' + row.lockNo.toString() + ' ' + this.statusOperateMaps.get(isOnline) + '成功!', type: 'success' })
|
|
|
} else {
|
|
|
- this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(isOnline) + '失败!', type: 'danger' })
|
|
|
+ this.$message({ message: '锁ID:' + row.lockNo.toString() + ' ' + this.statusOperateMaps.get(isOnline) + '失败!', type: 'danger' })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -512,25 +536,23 @@ export default {
|
|
|
|
|
|
// 点击锁开启,关闭时调用
|
|
|
handleLockStatus(row, lockStatus) {
|
|
|
- var lockStatusData = { 'lockNo': row.lockNo }
|
|
|
- var vehicleStatusData = { 'vehicleId': row.vehicleId }
|
|
|
if (lockStatus === 1) {
|
|
|
- unlockVehicle(lockStatusData).then(response => {
|
|
|
+ unlockVehicle(row.lockNo).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
row.lockStatus = lockStatus
|
|
|
- this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(lockStatus) + '成功!', type: 'success' })
|
|
|
+ this.$message({ message: '锁ID:' + row.lockNo.toString() + ' ' + this.lockStatusMaps.get(lockStatus) + '成功!', type: 'success' })
|
|
|
} else {
|
|
|
- this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(lockStatus) + '失败!', type: 'danger' })
|
|
|
+ this.$message({ message: '锁ID:' + row.lockNo.toString() + ' ' + this.lockStatusMaps.get(lockStatus) + '失败!', type: 'danger' })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
if (lockStatus === 0) {
|
|
|
- lockVehicle(vehicleStatusData).then(response => {
|
|
|
+ lockVehicle(row.vehicleId).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
row.lockStatus = lockStatus
|
|
|
- this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(lockStatus) + '成功!', type: 'success' })
|
|
|
+ this.$message({ message: '锁ID:' + row.lockNo.toString() + ' ' + this.lockStatusMaps.get(lockStatus) + '成功!', type: 'success' })
|
|
|
} else {
|
|
|
- this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(lockStatus) + '失败!', type: 'danger' })
|
|
|
+ this.$message({ message: '锁ID:' + row.lockNo.toString() + ' ' + this.lockStatusMaps.get(lockStatus) + '失败!', type: 'danger' })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -542,14 +564,14 @@ export default {
|
|
|
if (valid) {
|
|
|
this.addDeviceData = ele
|
|
|
this.addDeviceData.bizType = 2
|
|
|
- console.log(this.userData)
|
|
|
this.userData = { id: '', ename: this.userInformation, name: this.userNames }
|
|
|
this.objData = { htwDeviceInfo: this.addDeviceData, user: this.userData }
|
|
|
createDevice(this.objData).then(response => {
|
|
|
+ console.log(response)
|
|
|
if (response.code === 200) {
|
|
|
- this.dialogFormVisible = false
|
|
|
- // this.getList()
|
|
|
+ this.getMyDevicesList()
|
|
|
this.$notify({ title: 'Success', message: response.msg, type: 'success', duration: 3000 })
|
|
|
+ this.dialogFormVisible = false
|
|
|
} else {
|
|
|
this.$notify({ title: 'Failed', message: response.msg, type: 'error', duration: 3000 })
|
|
|
}
|
|
@@ -558,58 +580,6 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- // 查看
|
|
|
- handleCheck(row) {
|
|
|
- // this.shouldShow = true
|
|
|
- // this.serviceData = row
|
|
|
-
|
|
|
- // this.dialogStatus = 'update'
|
|
|
- // this.dialogFormVisible = true
|
|
|
- // this.showSubmitBtn = false
|
|
|
-
|
|
|
- },
|
|
|
- // 复制
|
|
|
- handleCopy(row) {
|
|
|
- this.serviceData = row
|
|
|
- // var queryData = { id: row.id }
|
|
|
- this.shouldShow = false
|
|
|
-
|
|
|
- this.dialogStatus = 'create'
|
|
|
- this.dialogFormVisible = true
|
|
|
- this.showSubmitBtn = true
|
|
|
- // this.$nextTick(() => {
|
|
|
- // this.$refs['serviceDataForms'].clearValidate()
|
|
|
- // })
|
|
|
- // })
|
|
|
- },
|
|
|
- qq(ele) {
|
|
|
- // this.$refs['serviceDataForms'].validate((valid) => {
|
|
|
- // if (valid) {
|
|
|
- // console.log(ele)
|
|
|
- // const tempData = {
|
|
|
- // id: this.serviceData.id,
|
|
|
- // customName: this.serviceData.customName,
|
|
|
- // url: this.serviceData.url,
|
|
|
- // envChannel: this.serviceData.envChannel,
|
|
|
- // method: ele.method,
|
|
|
- // actualUrl: this.serviceData.actualUrl,
|
|
|
- // status: this.serviceData.status,
|
|
|
- // creator: this.serviceData.creator,
|
|
|
- // returnDataType: ele.returnDataTypeStr,
|
|
|
- // mockUrl: this.serviceData.mockUrl
|
|
|
- // }
|
|
|
- // updateService(tempData).then(response => {
|
|
|
- // if (response.code === 200) {
|
|
|
- // this.dialogFormVisible = false
|
|
|
- // this.getList()
|
|
|
- // this.$notify({ title: 'Success', message: response.msg, type: 'success', duration: 2000 })
|
|
|
- // } else {
|
|
|
- // this.$notify({ title: 'Failed', message: response.msg, type: 'error', duration: 2000 })
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
- },
|
|
|
formatJson(filterVal, jsonData) {
|
|
|
return jsonData.map(v => filterVal.map(j => {
|
|
|
if (j === 'timestamp') {
|
|
@@ -628,48 +598,83 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-
|
|
|
-<style scoped>
|
|
|
-.showInfo {
|
|
|
- width: 400px;
|
|
|
- height: 400px;
|
|
|
- text-align: center;
|
|
|
- position: fixed;
|
|
|
- top: 50%;
|
|
|
- left: 50%;
|
|
|
- transform: translate(-50%,-50%);
|
|
|
-}
|
|
|
-.showZm {
|
|
|
- position:absolute;
|
|
|
- background-color: #ccc;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- opacity: 0.5;
|
|
|
-}
|
|
|
-.showBtn {
|
|
|
- color: red;
|
|
|
- padding-left: 200px;
|
|
|
-}
|
|
|
-.filter-item {
|
|
|
- margin-top: 10px;
|
|
|
-}
|
|
|
-.box {
|
|
|
- flex-direction: column ;
|
|
|
-}
|
|
|
-</style>
|
|
|
-
|
|
|
<style lang="stylus" scoped>
|
|
|
- .app-container >>> .el-dialog
|
|
|
- background-color #F2F3F6
|
|
|
+ .set-background
|
|
|
+ background-color #F1F4F7
|
|
|
+ display flex
|
|
|
+ justify-content center
|
|
|
+ min-width 700px
|
|
|
+ .setPercent >>> .el-dialog__body
|
|
|
+ width 100%
|
|
|
+ .block
|
|
|
+ background-color rgba(255,255,255,1)
|
|
|
+ box-shadow 0px 0px 11px 0px rgba(238,240,245,1)
|
|
|
+ border-radius 7px
|
|
|
+ width 93%
|
|
|
+ margin 25px 0
|
|
|
+ padding 20px
|
|
|
+ min-height calc(100vh - 100px)
|
|
|
+ .block >>> .el-form
|
|
|
+ display flex
|
|
|
+ justify-content space-between
|
|
|
+ .block >>> .el-form-item
|
|
|
+ display flex
|
|
|
+ width 20%
|
|
|
+ margin-right 10px
|
|
|
+ .block >>> .el-select
|
|
|
+ width 13%
|
|
|
+ margin-right 10px
|
|
|
+ .block >>> .el-form-item__content
|
|
|
+ margin-left 0 !important
|
|
|
+ .block >>> th
|
|
|
+ background-color #F0F7FF !important
|
|
|
+ .set-head
|
|
|
+ font-size 13px
|
|
|
+ width 100%
|
|
|
+ color #333B4A
|
|
|
+ // .set-head >>> .el-input
|
|
|
+ // width 18%
|
|
|
+ .set-between
|
|
|
+ display flex
|
|
|
+ .set-between >>> .el-button
|
|
|
+ height 40px
|
|
|
+ .set-locate
|
|
|
+ margin-top 20px
|
|
|
+ .specail-lock
|
|
|
+ display flex
|
|
|
+ justify-content center
|
|
|
+ .el-icon-lock
|
|
|
+ font-size 20px
|
|
|
+ margin 4px 7px 0 0
|
|
|
+ opacity 0.7
|
|
|
.set-font >>> .el-input__inner
|
|
|
color #3e3c3c
|
|
|
.set-font >>> .is-disabled input::placeholder
|
|
|
color #3e3c3c
|
|
|
- .block
|
|
|
+ .block-edit
|
|
|
background-color rgba(255,255,255,1)
|
|
|
box-shadow 0px 0px 11px 0px rgba(238,240,245,1)
|
|
|
border-radius 7px
|
|
|
width 59vw
|
|
|
margin-top 25px
|
|
|
padding 20px
|
|
|
+ .table-th
|
|
|
+ text-align center
|
|
|
+ .border-color
|
|
|
+ margin-left -12px
|
|
|
+ border-right 0px solid #dcdfe6
|
|
|
+ border-bottom 0px solid #dcdfe6
|
|
|
+ border-left 1px solid #dcdfe6
|
|
|
+ border-top 1px solid #dcdfe6
|
|
|
+ .border-color td
|
|
|
+ border-bottom 1px solid #dcdfe6
|
|
|
+ border-right 1px solid #dcdfe6
|
|
|
+ .border-color th
|
|
|
+ border-bottom 1px solid #dcdfe6
|
|
|
+ border-right 1px solid #dcdfe6
|
|
|
+ .table-th >>> .table
|
|
|
+ border-top 1px solid #999
|
|
|
+ border-left 1px solid #999
|
|
|
+ border-spacing 0
|
|
|
+
|
|
|
</style>
|