|
@@ -0,0 +1,759 @@
|
|
|
+<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" @keyup.enter.native="handleFilter" />
|
|
|
+ 锁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" />
|
|
|
+ </el-select>
|
|
|
+ 状态 <el-select v-model="listQuery.lockStatus" placeholder="请填写" style="width: 130px;" class="filter-item" 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>
|
|
|
+ </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.vehicleId)(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="handleModifyStatus(row, 1)">上线</el-button>
|
|
|
+ <el-button v-if="row.isOnline!=0" size="mini" type="danger" @click="handleModifyStatus(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)" />
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <!-- <pagination v-show="total>0" :total="total" :page.sync="listQuery.curIndex" :limit.sync="listQuery.pageSize" @pagination="getList" /> -->
|
|
|
+ <!-- 新增 -->
|
|
|
+ <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 style="margin-left: 20%;">
|
|
|
+ <el-form-item label="业务线" prop="bizType">
|
|
|
+ <el-input v-model="addDeviceData.bizType" :disabled="true" style="width:200px;" placeholder="单车" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="锁类型" prop="lockModel">
|
|
|
+ <el-select v-model="addDeviceData.lockModel" class="filter-item" filterable clearable placeholder="请填写" @change="chooseLockType()">
|
|
|
+ <el-option v-for="item in lockModelList" :key="item.model" :label="item.modelName" :value="item.model" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="锁供应商" prop="lockSupplier">
|
|
|
+ <el-select v-model="addDeviceData.lockSupplier" :disabled="shouldShow" class="filter-item" filterable clearable placeholder="请填写">
|
|
|
+ <el-option v-for="item in lockSupplierList" :key="item.supplierId" :label="item.supplierName" :value="item.supplierId" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div style="margin-left: 30%;">
|
|
|
+ <el-form-item label="车辆个数" prop="deviceNum">
|
|
|
+ <el-input v-model="addDeviceData.deviceNum" style="width:200px;" placeholder="请填写" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="车供应商" style="flex-grow:1" prop="bikeSupplier">
|
|
|
+ <el-select v-model="addDeviceData.bikeSupplier" class="filter-item" filterable clearable placeholder="请填写">
|
|
|
+ <el-option v-for="item in bikeSupplierList" :key="item.supplierId" :label="item.supplierName" :value="item.supplierId" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="车辆类型" prop="bikeModel">
|
|
|
+ <el-select v-model="addDeviceData.bikeModel" class="filter-item" filterable clearable placeholder="请填写">
|
|
|
+ <el-option v-for="item in bikeModelList" :key="item.model" :label="item.modelName" :value="item.model" />
|
|
|
+ </el-select>
|
|
|
+ </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(addDeviceData)">确定</el-button>
|
|
|
+ </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">
|
|
|
+ <div style="margin-left: 20%;">
|
|
|
+ <el-form-item label="业务线" prop="bizType">
|
|
|
+ <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-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="车辆ID" prop="vehicleId">
|
|
|
+ <el-input v-model="DetailData.vehicleId" 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-form-item>
|
|
|
+ <el-form-item label="经度" prop="deviceLng">
|
|
|
+ <el-input v-model="DetailData.deviceLng" style="width:200px;" placeholder="请填写" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="纬度" prop="deviceLat">
|
|
|
+ <el-input v-model="DetailData.deviceLat" 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-form-item>
|
|
|
+ <el-form-item label="IccID" prop="iccid">
|
|
|
+ <el-input v-model="DetailData.iccid" 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-form-item>
|
|
|
+ <el-form-item label="bluetooth_key" prop="bluetoothKey">
|
|
|
+ <el-input v-model="DetailData.bluetoothKey" 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-form-item>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ <br><br><br>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogDetailVisible = false">关闭</el-button>
|
|
|
+ <!-- <el-button v-if="showSubmitBtn" type="primary">确定</el-button> -->
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 编辑 -->
|
|
|
+ <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogCreateVisible" 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="请填写" />
|
|
|
+ </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="单车" />
|
|
|
+ </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>
|
|
|
+ <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>
|
|
|
+ <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="车辆供应商" 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="EcuID" 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="IccID" 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="Mac地址" 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="bluetooth_key" 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="bluetooth_password" style="flex-grow:1" prop="returnDataTypeStr">
|
|
|
+ <el-input v-model="serviceData.customName" :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>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <!-- changeCopy, -->
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { queryLockCreateInfo, queryVehicleCreateInfo, createDevice, deleteDevice, deviceOnline, deviceOffline, unlockVehicle, lockVehicle, updateLockAttr, getDevices, getLockAttrInfo } 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
|
|
|
+
|
|
|
+var envSelections = []
|
|
|
+var consumerSelections = []
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'Httpmock',
|
|
|
+ components: { Pagination },
|
|
|
+ directives: { waves },
|
|
|
+ filters: {
|
|
|
+ statusFilter(status) {
|
|
|
+ const statusMap = {
|
|
|
+ 1: 'success',
|
|
|
+ draft: 'info',
|
|
|
+ 0: 'danger'
|
|
|
+ }
|
|
|
+ return statusMap[status]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+
|
|
|
+ dialogFormVisible: false,
|
|
|
+ dialogDetailVisible: false,
|
|
|
+ dialogCreateVisible: 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: ''
|
|
|
+ // },
|
|
|
+ statusMaps: new Map([[1, '已开启'], [0, '未开启']]),
|
|
|
+ lockStatusMaps: new Map([[1, '已开锁'], [0, '已关锁']]),
|
|
|
+ statusOperateMap: 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: ''
|
|
|
+ },
|
|
|
+ textMap: {
|
|
|
+ update: '编辑',
|
|
|
+ create: '新增',
|
|
|
+ details: '设备详情'
|
|
|
+ },
|
|
|
+ userInformation: localStorage.getItem('username'),
|
|
|
+ userNames: localStorage.getItem('realname'),
|
|
|
+ userData: '',
|
|
|
+ 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: '',
|
|
|
+ bikeModel: '',
|
|
|
+ deviceNum: '',
|
|
|
+ lockSupplier: '',
|
|
|
+ bikeSupplier: ''
|
|
|
+ },
|
|
|
+ DetailData: {},
|
|
|
+ serviceData: {
|
|
|
+ customName: ''
|
|
|
+
|
|
|
+ },
|
|
|
+ serviceDataRules: {},
|
|
|
+ serviceDataExt: {
|
|
|
+ id: 0
|
|
|
+ },
|
|
|
+ dialogStatus: '',
|
|
|
+ listLoading: true,
|
|
|
+ dialogDetails: false,
|
|
|
+
|
|
|
+ dialogPvVisible: false,
|
|
|
+ pvData: [],
|
|
|
+ addDeviceDataRules: {
|
|
|
+ lockModel: [{ required: true, message: '锁类型不能为空', trigger: 'change' }],
|
|
|
+ bikeModel: [{ required: true, message: '车辆类型不能为空', trigger: 'change' }],
|
|
|
+ deviceNum: [{ required: true, message: '车辆个数不能为空', trigger: 'change' }],
|
|
|
+ lockSupplier: [{ required: true, message: '锁供应商不能为空', trigger: 'change' }],
|
|
|
+ bikeSupplier: [{ required: true, message: '车辆供应商不能为空', trigger: 'change' }]
|
|
|
+
|
|
|
+ },
|
|
|
+ downloadLoading: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getMyDevicesList()
|
|
|
+ this.getLockModelList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ createdCode() {
|
|
|
+ this.dialogStatus = 'create'
|
|
|
+ },
|
|
|
+ // 查看设备详情
|
|
|
+ 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
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取锁类型、锁供应商类型
|
|
|
+ getLockModelList() {
|
|
|
+ queryLockCreateInfo().then(response => {
|
|
|
+ // console.log(response.data)
|
|
|
+ this.lockModelList = response.data.modelInfos
|
|
|
+ this.lockSupplierList = response.data.supplierInfos
|
|
|
+ })
|
|
|
+ // queryLockCreateInfo().catch(res => {
|
|
|
+ // console.log(res)
|
|
|
+ // })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取车类型、车供应商
|
|
|
+ chooseLockType() {
|
|
|
+ // console.log(this.addDeviceData.lockModel)
|
|
|
+ queryVehicleCreateInfo(this.addDeviceData.lockModel).then(response => {
|
|
|
+ // console.log(response.data)
|
|
|
+ this.bikeModelList = response.data.modelInfos
|
|
|
+ this.bikeSupplierList = response.data.supplierInfos
|
|
|
+ console.log(this.bikeModelList)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 搜索
|
|
|
+ getDevicesList(vel) {
|
|
|
+ this.listQuery = 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
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 进首页
|
|
|
+ getMyDevicesList() {
|
|
|
+ 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
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ explain() {
|
|
|
+ if (this.showexplain === false) {
|
|
|
+ this.showexplain = true
|
|
|
+ } else {
|
|
|
+ this.showexplain = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deleteCodeData(e) {
|
|
|
+ this.$confirm('确定要删除这条车辆信息吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.handleDelete(e)
|
|
|
+ this.$message({ type: 'success', message: '删除成功!' })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 编辑
|
|
|
+ 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 => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.successFun()
|
|
|
+ this.getAllList()
|
|
|
+ } else {
|
|
|
+ this.errorFun()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ 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' })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 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()
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ // 点击提交时调用
|
|
|
+ createData(ele) {
|
|
|
+ this.$refs['addDeviceForms'].validate((valid) => {
|
|
|
+ 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 => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ // this.getList()
|
|
|
+ this.$notify({ title: 'Success', message: response.msg, type: 'success', duration: 1000 })
|
|
|
+ } else {
|
|
|
+ this.$notify({ title: 'Failed', message: response.msg, type: 'error', duration: 1000 })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 编辑
|
|
|
+ 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
|
|
|
+ // 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()
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ updateData(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') {
|
|
|
+ return parseTime(v[j])
|
|
|
+ } else {
|
|
|
+ return v[j]
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ },
|
|
|
+ redirectTo(id, mehtodName, methodProtocol) {
|
|
|
+ console.log(methodProtocol)
|
|
|
+ this.$router.push({
|
|
|
+ path: `/mock/httpmock/${id}`, query: { mehtodName: mehtodName, methodProtocol: methodProtocol }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</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;
|
|
|
+}
|
|
|
+</style>
|