|
@@ -3,7 +3,7 @@
|
|
|
<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" @keyup.enter.native="handleFilter" />
|
|
|
+ 车辆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)">
|
|
|
<el-option v-for="item in lockModelList" :key="item.model" :label="item.modelName" :value="item.model" />
|
|
@@ -20,7 +20,7 @@
|
|
|
|
|
|
<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.vehicleId)(scope.row.vehicleId)">{{ scope.row.vehicleId }}</a></template>
|
|
|
+ <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>
|
|
@@ -47,21 +47,27 @@
|
|
|
<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="handleModifyStatus(row, 1)">上线</el-button>
|
|
|
- <el-button v-if="row.isOnline!=0" size="mini" type="danger" @click="handleModifyStatus(row, 0)">下线</el-button>
|
|
|
+ <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!=1" class="el-icon-unlock" @click="handleModifyStatus(row, 1)" />
|
|
|
- <i v-if="row.lockStatus!=0" class="el-icon-lock" @click="handleModifyStatus(row, 0)" />
|
|
|
+ <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>
|
|
|
- <!-- <pagination v-show="total>0" :total="total" :page.sync="listQuery.curIndex" :limit.sync="listQuery.pageSize" @pagination="getList" /> -->
|
|
|
+ <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" /> -->
|
|
|
<!-- 新增 -->
|
|
|
<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 style="display:flex;justfy-content:space-between">
|
|
|
+ <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="addDeviceData.bizType" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
@@ -105,57 +111,52 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!-- 查看详情 -->
|
|
|
- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogDetailVisible" width="75%">
|
|
|
- <el-form ref="serviceDataForms" :rules="serviceDataRules" :model="DetailData" label-position="left" label-width="100px" style="width: 250px; margin-left:80px;">
|
|
|
- <div style="display:flex;justfy-content:space-between">
|
|
|
+ <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">
|
|
|
<div style="margin-left: 20%;">
|
|
|
<el-form-item label="业务线" prop="bizType">
|
|
|
- <el-input v-model="DetailData.bizType" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
|
+ <el-input v-model="detailData.bizType" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="锁ID" prop="lockNo">
|
|
|
- <el-input v-model="DetailData.lockNo" style="width:200px;" placeholder="请填写" />
|
|
|
+ <el-input v-model="detailData.lockNo" :disabled="true" style="width:200px;color:#3e3c3c !important" placeholder="无" />
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="车辆ID" prop="vehicleId">
|
|
|
- <el-input v-model="DetailData.vehicleId" style="width:200px;" placeholder="请填写" />
|
|
|
+ <el-input v-model="detailData.vehicleId" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
</el-form-item>
|
|
|
- <!-- <el-form-item label="锁供应商" prop="test1">
|
|
|
- <el-input v-model="serviceData.test2" style="width:200px;" placeholder="请填写" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="车辆供应商" prop="test1">
|
|
|
- <el-input v-model="serviceData.test2" style="width:200px;" placeholder="请填写" />
|
|
|
- </el-form-item> -->
|
|
|
<el-form-item label="锁状态" prop="lockStatus">
|
|
|
- <el-input v-model="DetailData.lockStatus" style="width:200px;" placeholder="请填写" />
|
|
|
+ <el-input v-model="detailData.lockStatus" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="经度" prop="deviceLng">
|
|
|
- <el-input v-model="DetailData.deviceLng" style="width:200px;" placeholder="请填写" />
|
|
|
+ <el-input v-model="detailData.deviceLng" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="纬度" prop="deviceLat">
|
|
|
- <el-input v-model="DetailData.deviceLat" style="width:200px;" placeholder="请填写" />
|
|
|
+ <el-input v-model="detailData.deviceLat" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
</el-form-item>
|
|
|
|
|
|
</div>
|
|
|
<div style="margin-left: 30%;">
|
|
|
<el-form-item label="EcuID" prop="deviceId">
|
|
|
- <el-input v-model="DetailData.deviceId" style="width:200px;" placeholder="请填写" />
|
|
|
+ <el-input v-model="detailData.deviceId" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="IccID" prop="iccid">
|
|
|
- <el-input v-model="DetailData.iccid" style="width:200px;" placeholder="请填写" />
|
|
|
+ <el-input v-model="detailData.iccid" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="Mac地址" prop="macAddr">
|
|
|
- <el-input v-model="DetailData.macAddr" style="width:200px;" placeholder="请填写" />
|
|
|
+ <el-input v-model="detailData.macAddr" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="电量信息" prop="lockBatteryLevel">
|
|
|
+ <el-input v-model="detailData.lockBatteryLevel" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="bluetooth_key" prop="bluetoothKey">
|
|
|
- <el-input v-model="DetailData.bluetoothKey" style="width:200px;" placeholder="请填写" />
|
|
|
+ <el-input v-model="detailData.bluetoothKey" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="bluetooth_password" prop="bluetoothPassword">
|
|
|
- <el-input v-model="DetailData.bluetoothPassword" style="width:200px;" placeholder="请填写" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="电量信息" prop="lockBatteryLevel">
|
|
|
- <el-input v-model="DetailData.lockBatteryLevel" style="width:200px;" placeholder="请填写" />
|
|
|
+ <el-input v-model="detailData.bluetoothPassword" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
</el-form-item>
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form>
|
|
@@ -166,67 +167,63 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!-- 编辑 -->
|
|
|
- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogCreateVisible" width="75%">
|
|
|
+ <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 style="display:flex;justfy-content:space-between">
|
|
|
- <div style="margin-left: 20%;">
|
|
|
- <el-form-item label="经度" prop="customName">
|
|
|
- <el-input v-model="serviceData.customName" style="width:200px;" placeholder="单车" />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item label="纬度" prop="url">
|
|
|
- <el-select v-model="serviceData.returnDataTypeStr" class="filter-item" filterable clearable placeholder="请填写">
|
|
|
- <el-option v-for="item in envSelectDataType" :key="item.code" :label="item.msg" :value="item.code" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="电量" prop="test2">
|
|
|
- <el-input v-model="serviceData.test2" style="width:200px;" placeholder="请填写" />
|
|
|
+ <div class="set-font">
|
|
|
+ <div class="block">
|
|
|
+ <div style="display:flex;justify-content:space-between">
|
|
|
+ <el-form-item label="经度" prop="deviceLat">
|
|
|
+ <el-input v-model="serviceData.deviceLat" style="width:200px;" placeholder="单车" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="电量" prop="lockBatteryLevel">
|
|
|
+ <el-input v-model="serviceData.lockBatteryLevel" style="width:200px;" 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 style="margin-left: 30%;">
|
|
|
-
|
|
|
- <el-form-item label="业务线" style="flex-grow:1" prop="returnDataTypeStr">
|
|
|
- <el-input v-model="serviceData.customName" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="锁ID" style="flex-grow:1" prop="returnDataTypeStr">
|
|
|
- <el-input v-model="serviceData.customName" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
|
+ <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="锁状态" style="flex-grow:1" prop="returnDataTypeStr">
|
|
|
- <el-input v-model="serviceData.customName" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
|
+ <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="车辆ID" style="flex-grow:1" prop="returnDataTypeStr">
|
|
|
- <el-input v-model="serviceData.customName" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
|
+ <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="锁供应商" style="flex-grow:1" prop="returnDataTypeStr">
|
|
|
- <el-input v-model="serviceData.customName" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
|
+ <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="车辆供应商" style="flex-grow:1" prop="returnDataTypeStr">
|
|
|
+ <!-- <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" style="flex-grow:1" prop="returnDataTypeStr">
|
|
|
+ <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" style="flex-grow:1" prop="returnDataTypeStr">
|
|
|
- <el-input v-model="serviceData.customName" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
|
+ <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地址" style="flex-grow:1" prop="returnDataTypeStr">
|
|
|
- <el-input v-model="serviceData.customName" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
|
+ <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" style="flex-grow:1" prop="returnDataTypeStr">
|
|
|
- <el-input v-model="serviceData.customName" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
|
+ <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" style="flex-grow:1" prop="returnDataTypeStr">
|
|
|
- <el-input v-model="serviceData.customName" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
|
+ <el-form-item label="bluetooth_password" prop="bluetoothPassword">
|
|
|
+ <el-input v-model="serviceData.bluetoothPassword" :disabled="true" style="width:200px;" placeholder="无" />
|
|
|
</el-form-item>
|
|
|
-
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
<br><br><br>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="dialogFormVisible = false">取消</el-button>
|
|
|
- <el-button v-if="showSubmitBtn" type="primary" @click="createData(serviceData)">确定</el-button>
|
|
|
+ <el-button @click="dialogUpdateVisible = false">取消</el-button>
|
|
|
+ <el-button v-if="showSubmitBtn" type="primary" @click="updateData(serviceData)">确定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -245,7 +242,7 @@ var consumerSelections = []
|
|
|
|
|
|
export default {
|
|
|
name: 'Httpmock',
|
|
|
- components: { Pagination },
|
|
|
+ // components: { Pagination },
|
|
|
directives: { waves },
|
|
|
filters: {
|
|
|
statusFilter(status) {
|
|
@@ -262,44 +259,16 @@ export default {
|
|
|
|
|
|
dialogFormVisible: false,
|
|
|
dialogDetailVisible: false,
|
|
|
- dialogCreateVisible: false,
|
|
|
+ dialogUpdateVisible: false,
|
|
|
shouldShow: false,
|
|
|
|
|
|
total: 0,
|
|
|
num: '',
|
|
|
tableKey: 0,
|
|
|
list: null,
|
|
|
- // list: {
|
|
|
- // vehicleId: '',
|
|
|
- // lockNo: '',
|
|
|
- // lockBatteryLevel: '',
|
|
|
- // deviceId: '',
|
|
|
- // macAddr: '',
|
|
|
- // bluetoothPassword: '',
|
|
|
- // bluetoothKey: '',
|
|
|
- // bluetoothVersion: '',
|
|
|
- // lockCommVersion: '',
|
|
|
- // iccid: '',
|
|
|
- // deviceLat: '',
|
|
|
- // deviceLng: '',
|
|
|
- // isOnline: '',
|
|
|
- // lockStatus: '',
|
|
|
- // lockModelNo: '',
|
|
|
- // headstockNo: '',
|
|
|
- // headstockNoUrl: '',
|
|
|
- // tailstockNo: '',
|
|
|
- // tailstockNoUrl: '',
|
|
|
- // frameNo: '',
|
|
|
- // lockNoUrl: '',
|
|
|
- // bikeModelInfo: {
|
|
|
- // model: '',
|
|
|
- // modelName: '' },
|
|
|
- // lockModelInfo: {
|
|
|
- // model: '',
|
|
|
- // modelName: '' },
|
|
|
- // createTime: '',
|
|
|
- // modiftTime: ''
|
|
|
- // },
|
|
|
+ curIndex: 1,
|
|
|
+ pageSize: 10,
|
|
|
+
|
|
|
statusMaps: new Map([[1, '已开启'], [0, '未开启']]),
|
|
|
lockStatusMaps: new Map([[1, '已开锁'], [0, '已关锁']]),
|
|
|
statusOperateMap: new Map([[1, '开启'], [0, '关闭']]),
|
|
@@ -352,9 +321,13 @@ export default {
|
|
|
lockSupplier: '',
|
|
|
bikeSupplier: ''
|
|
|
},
|
|
|
- DetailData: {},
|
|
|
+ detailData: {
|
|
|
+ bizType: '单车',
|
|
|
+ vehicleId: ''
|
|
|
+
|
|
|
+ },
|
|
|
serviceData: {
|
|
|
- customName: ''
|
|
|
+ bizType: '单车'
|
|
|
|
|
|
},
|
|
|
serviceDataRules: {},
|
|
@@ -389,13 +362,8 @@ export default {
|
|
|
// 查看设备详情
|
|
|
deviceDetails(vel) {
|
|
|
this.dialogStatus = 'details'
|
|
|
- this.listQuery.vehicleId = vel
|
|
|
- this.userData = { id: '', ename: this.userInformation, name: this.userNames }
|
|
|
- this.objData = { deviceQueryInfo: this.listQuery, user: this.userData }
|
|
|
- getDevices(this.objData).then(response => {
|
|
|
- this.list = response.data
|
|
|
- this.total = response.data.total
|
|
|
- })
|
|
|
+ console.log('参数:' + vel)
|
|
|
+ this.detailData = vel
|
|
|
},
|
|
|
|
|
|
// 获取锁类型、锁供应商类型
|
|
@@ -437,10 +405,47 @@ export default {
|
|
|
this.objData = { deviceQueryInfo: this.listQuery, user: this.userData }
|
|
|
getDevices(this.objData).then(response => {
|
|
|
this.list = response.data
|
|
|
+ this.serviceData = response.data
|
|
|
+ this.detailData = response.data
|
|
|
this.total = response.data.total
|
|
|
+ console.log(this.detailData)
|
|
|
})
|
|
|
},
|
|
|
+ // 编辑
|
|
|
+ handleUpdate(vel) {
|
|
|
+ console.log(vel)
|
|
|
+ this.dialogStatus = 'update'
|
|
|
+ this.serviceData = vel
|
|
|
+ this.dialogUpdateVisible = true
|
|
|
+ },
|
|
|
|
|
|
+ updateData(vel) {
|
|
|
+ if (vel === this.serviceData) {
|
|
|
+ this.bizData = {
|
|
|
+ lockNo: vel.lockNo,
|
|
|
+ lockBatteryLevel: vel.lockBatteryLevel,
|
|
|
+ deviceLat: vel.deviceLat,
|
|
|
+ deviceLng: vel.deviceLng
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.bizData = vel
|
|
|
+ this.bizData.lockNo = vel.lockNo
|
|
|
+ this.bizData.lockBatteryLevel = vel.lockBatteryLevel
|
|
|
+ this.bizData.deviceLat = vel.deviceLat
|
|
|
+ this.bizData.deviceLng = vel.deviceLng
|
|
|
+ }
|
|
|
+
|
|
|
+ updateLockAttr(this.bizData).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.dialogUpdateVisible = false
|
|
|
+ // this.getList()
|
|
|
+ this.$notify({ title: 'Success', message: response.msg, type: 'success', duration: 3000 })
|
|
|
+ } else {
|
|
|
+ this.$notify({ title: 'Failed', message: response.msg, type: 'error', duration: 3000 })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 删除设备
|
|
|
explain() {
|
|
|
if (this.showexplain === false) {
|
|
|
this.showexplain = true
|
|
@@ -455,7 +460,7 @@ export default {
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
this.handleDelete(e)
|
|
|
- this.$message({ type: 'success', message: '删除成功!' })
|
|
|
+ // this.$message({ type: 'success', message: '删除成功!' })
|
|
|
}).catch(() => {
|
|
|
this.$message({
|
|
|
type: 'info',
|
|
@@ -464,138 +469,73 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- // 编辑
|
|
|
- updateDeviceInfo(vel) {
|
|
|
- if (vel === this.list) {
|
|
|
- this.bizData = {
|
|
|
- name: vel.name,
|
|
|
- id: vel.id,
|
|
|
- role: vel.role,
|
|
|
- email: vel.email,
|
|
|
- teamId: vel.bizId,
|
|
|
- bizId: vel.bizId
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.bizData = vel
|
|
|
- this.bizData.name = vel.name
|
|
|
- this.bizData.role = vel.role
|
|
|
- this.bizData.email = vel.email
|
|
|
- this.bizData.teamId = vel.teamId
|
|
|
- this.bizData.bizId = vel.bizId
|
|
|
- }
|
|
|
- this.userData = { id: '', ename: this.userInformation, name: this.userNames }
|
|
|
- this.objData = { teamMembersInfo: this.bizData, user: this.userData }
|
|
|
- updateMembers(this.objData).then(response => {
|
|
|
+ handleDelete(row) {
|
|
|
+ var deleteData = { 'vehicleId': row.vehicleId }
|
|
|
+ deleteDevice(deleteData).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
- this.dialogFormVisible = false
|
|
|
- this.successFun()
|
|
|
- this.getAllList()
|
|
|
+ this.getMyDevicesList()
|
|
|
+ this.$notify({ title: 'Success', message: response.msg, type: 'success', duration: 3000 })
|
|
|
} else {
|
|
|
- this.errorFun()
|
|
|
+ this.$notify({ title: 'Failed', message: response.msg, type: 'error', duration: 3000 })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- handleDelete(e) {
|
|
|
- // this.userData = { id: '', ename: this.userInformation, name: this.userNames }
|
|
|
- // deleteMembers(e.id, this.userData).then(response => {
|
|
|
- // if (response.code === 200) {
|
|
|
- // this.getAllList()
|
|
|
- // // this.queryList({ 'teamId': e.teamId })
|
|
|
- // this.successFun()
|
|
|
- // } else {
|
|
|
- // this.errorFun(response.msg)
|
|
|
- // }
|
|
|
- // })
|
|
|
- },
|
|
|
- // 获取method方法
|
|
|
- // mockGetMethod() {
|
|
|
- // this.envMethod = []
|
|
|
- // getSupportMethods().then(response => {
|
|
|
- // if (response.code) {
|
|
|
- // for (var i = 0; i < response.data.length; i++) {
|
|
|
- // var obj = {}
|
|
|
- // obj.str = response.data[i]
|
|
|
- // this.envMethod.push(obj)
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // this.$message({ message: '请求失败!', type: 'danger' })
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
- // getMethod(val) {
|
|
|
- // this.listQuery.method = val
|
|
|
- // },
|
|
|
- // 获取data数据
|
|
|
- // mockDataTypes() {
|
|
|
- // this.envSelectDataType = []
|
|
|
- // changeDataType().then(response => {
|
|
|
- // if (response.code) {
|
|
|
- // this.envSelectDataType = response.data
|
|
|
- // } else {
|
|
|
- // this.$message({ message: '请求失败!', type: 'danger' })
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
- // getDataType(val) {
|
|
|
- // this.listQuery.returnDataType = val
|
|
|
- // },
|
|
|
- // 点击搜索时调用
|
|
|
+
|
|
|
handleFilter() {
|
|
|
// this.getList()
|
|
|
},
|
|
|
- // 点击开启,关闭时调用
|
|
|
- handleModifyStatus(row, status) {
|
|
|
- // var statusData = { id: row.id, status: status }
|
|
|
- // changeStatus(statusData).then(response => {
|
|
|
- // if (response.code === 200) {
|
|
|
- // row.status = status
|
|
|
- // this.$message({ message: row.id.toString() + ' ' + this.statusOperateMap.get(status) + '成功!', type: 'success' })
|
|
|
- // } else {
|
|
|
- // this.$message({ message: row.id.toString() + ' ' + this.statusOperateMap.get(status) + '失败!', type: 'danger' })
|
|
|
- // }
|
|
|
- // })
|
|
|
+
|
|
|
+ // 设备上线、下线调用
|
|
|
+ handleDeviceStatus(row, isOnline) {
|
|
|
+ var statusData = { 'lockNo': row.lockNo }
|
|
|
+ if (isOnline === 1) {
|
|
|
+ deviceOnline(statusData).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ row.isOnline = isOnline
|
|
|
+ this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(isOnline) + '成功!', type: 'success' })
|
|
|
+ } else {
|
|
|
+ this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(isOnline) + '失败!', type: 'danger' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (isOnline === 0) {
|
|
|
+ deviceOffline(statusData).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ row.isOnline = isOnline
|
|
|
+ this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(isOnline) + '成功!', type: 'success' })
|
|
|
+ } else {
|
|
|
+ this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(isOnline) + '失败!', type: 'danger' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
- // sortChange(data) {
|
|
|
- // const { prop, order } = data
|
|
|
- // if (prop === 'id') {
|
|
|
- // this.sortByID(order)
|
|
|
- // }
|
|
|
- // },
|
|
|
- // sortByID(order) {
|
|
|
- // if (order === 'ascending') {
|
|
|
- // this.listQuery.sort = '+id'
|
|
|
- // } else {
|
|
|
- // this.listQuery.sort = '-id'
|
|
|
- // }
|
|
|
- // this.handleFilter()
|
|
|
- // },
|
|
|
- // resetServiceData() {
|
|
|
- // this.serviceData = {
|
|
|
- // customName: '',
|
|
|
- // url: '',
|
|
|
- // method: '',
|
|
|
- // returnDataTypeStr: '',
|
|
|
- // mockUrl: '',
|
|
|
- // returnDataType: '',
|
|
|
- // envChannel: 1,
|
|
|
- // id: '',
|
|
|
- // status: 1,
|
|
|
- // actualUrl: '',
|
|
|
- // creator: ''
|
|
|
- // }
|
|
|
- // },
|
|
|
- // hearder新增时调用
|
|
|
- handleCreate() {
|
|
|
- // this.shouldShow = false
|
|
|
- // this.resetServiceData()
|
|
|
- // this.dialogStatus = 'create'
|
|
|
- // this.dialogFormVisible = true
|
|
|
- // this.showSubmitBtn = true
|
|
|
- // this.$nextTick(() => {
|
|
|
- // this.$refs['serviceDataForms'].clearValidate()
|
|
|
- // })
|
|
|
+ // 点击锁开启,关闭时调用
|
|
|
+ handleLockStatus(row, lockStatus) {
|
|
|
+ var lockStatusData = { 'lockNo': row.lockNo }
|
|
|
+ var vehicleStatusData = { 'vehicleId': row.vehicleId }
|
|
|
+ if (lockStatus === 1) {
|
|
|
+ unlockVehicle(lockStatusData).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ row.lockStatus = lockStatus
|
|
|
+ this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(lockStatus) + '成功!', type: 'success' })
|
|
|
+ } else {
|
|
|
+ this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(lockStatus) + '失败!', type: 'danger' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (lockStatus === 0) {
|
|
|
+ lockVehicle(vehicleStatusData).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ row.lockStatus = lockStatus
|
|
|
+ this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(lockStatus) + '成功!', type: 'success' })
|
|
|
+ } else {
|
|
|
+ this.$message({ message: row.lockNo.toString() + ' ' + this.statusOperateMap.get(lockStatus) + '失败!', type: 'danger' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
+
|
|
|
// 点击提交时调用
|
|
|
createData(ele) {
|
|
|
this.$refs['addDeviceForms'].validate((valid) => {
|
|
@@ -609,58 +549,15 @@ export default {
|
|
|
if (response.code === 200) {
|
|
|
this.dialogFormVisible = false
|
|
|
// this.getList()
|
|
|
- this.$notify({ title: 'Success', message: response.msg, type: 'success', duration: 1000 })
|
|
|
+ this.$notify({ title: 'Success', message: response.msg, type: 'success', duration: 3000 })
|
|
|
} else {
|
|
|
- this.$notify({ title: 'Failed', message: response.msg, type: 'error', duration: 1000 })
|
|
|
+ this.$notify({ title: 'Failed', message: response.msg, type: 'error', duration: 3000 })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 编辑
|
|
|
- handleUpdate(row) {
|
|
|
- this.dialogCreateVisible = true
|
|
|
- var queryData = {
|
|
|
- lockBatteryLevel: row.lockBatteryLevel,
|
|
|
- deviceLat: row.deviceLat,
|
|
|
- deviceLng: row.deviceLng
|
|
|
- // vehicleId: row.vehicleId,
|
|
|
- // lockNo: row.lockNo,
|
|
|
- // creator: row.creator,
|
|
|
- // method: row.method,
|
|
|
-
|
|
|
- // mockUrl: row.mockUrl,
|
|
|
- // lockStatus: row.lockStatus,
|
|
|
- // iccid: row.iccid,
|
|
|
- // deviceId: row.deviceId,
|
|
|
- // macAddr: row.macAddr,
|
|
|
- // bluetoothPassword: row.bluetoothPassword,
|
|
|
- // bluetoothKey: row.bluetoothKey
|
|
|
- }
|
|
|
- var rowList = row
|
|
|
- this.shouldShow = false
|
|
|
- updateLockAttr(queryData).then(response => {
|
|
|
- if (response.data) {
|
|
|
- this.serviceData.lockBatteryLevel = rowList.lockBatteryLevel
|
|
|
- this.serviceData.deviceLat = rowList.deviceLat
|
|
|
- this.serviceData.deviceLng = rowList.deviceLng
|
|
|
- this.serviceData.vehicleId = rowList.vehicleId
|
|
|
- this.serviceData.lockNo = rowList.lockNo
|
|
|
- this.serviceData.lockStatus = rowList.lockStatus
|
|
|
- this.serviceData.iccid = rowList.iccid
|
|
|
- this.serviceData.deviceId = rowList.deviceId
|
|
|
- this.serviceData.macAddr = rowList.macAddr
|
|
|
- this.serviceData.bluetoothPassword = rowList.bluetoothPassword
|
|
|
- this.serviceData.bluetoothKey = rowList.bluetoothKey
|
|
|
- this.dialogStatus = 'update'
|
|
|
- this.dialogFormVisible = true
|
|
|
- this.showSubmitBtn = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs['serviceDataForms'].clearValidate()
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
+
|
|
|
// 查看
|
|
|
handleCheck(row) {
|
|
|
// this.shouldShow = true
|
|
@@ -685,7 +582,7 @@ export default {
|
|
|
// })
|
|
|
// })
|
|
|
},
|
|
|
- updateData(ele) {
|
|
|
+ qq(ele) {
|
|
|
// this.$refs['serviceDataForms'].validate((valid) => {
|
|
|
// if (valid) {
|
|
|
// console.log(ele)
|
|
@@ -756,4 +653,23 @@ export default {
|
|
|
.filter-item {
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
+.box {
|
|
|
+ flex-direction: column ;
|
|
|
+}
|
|
|
+</style>
|
|
|
+
|
|
|
+<style lang="stylus" scoped>
|
|
|
+ .app-container >>> .el-dialog
|
|
|
+ background-color #F2F3F6
|
|
|
+ .set-font >>> .el-input__inner
|
|
|
+ color #3e3c3c
|
|
|
+ .set-font >>> .is-disabled input::placeholder
|
|
|
+ color #3e3c3c
|
|
|
+ .block
|
|
|
+ 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
|
|
|
</style>
|