软件升级
This commit is contained in:
parent
0b41a53d62
commit
11ff458b25
|
@ -114,4 +114,4 @@ export function listAllDevice(query) {
|
|||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
}
|
|
@ -62,3 +62,12 @@ export function setDeviceMusic(data) {
|
|||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 管理员升级设备
|
||||
export function iotUpdateDevice(data) {
|
||||
return request({
|
||||
url: '/bst/device/iot/update',
|
||||
method: 'put',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -25,6 +25,14 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排除命令" prop="excludeCommand">
|
||||
<el-input
|
||||
v-model="queryParams.excludeCommand"
|
||||
placeholder="请输入排除命令"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="结果" prop="result">
|
||||
<el-input
|
||||
v-model="queryParams.result"
|
||||
|
@ -84,7 +92,9 @@
|
|||
<dict-tag :value="d.row.type" :options="dict.type.command_log_type" size="mini"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'location'">
|
||||
{{d.row.longitude | dv}},{{d.row.latitude | dv}}
|
||||
<el-button type="text" size="mini" @click="handleLocation(d.row)">
|
||||
{{d.row.longitude | dv}},{{d.row.latitude | dv}}
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'userName'">
|
||||
<user-link :id="d.row.userId" :text="d.row.userName"/>
|
||||
|
@ -137,7 +147,7 @@ export default {
|
|||
// 字段列表
|
||||
columns: [
|
||||
{key: 'id', visible: false, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: '80'},
|
||||
{key: 'reason', visible: true, label: '原因', minWidth: null, sortable: true, overflow: false, align: 'left', width: null},
|
||||
{key: 'reason', visible: true, label: '原因', minWidth: null, sortable: true, overflow: false, align: 'left', width: "300"},
|
||||
{key: 'mac', visible: true, label: 'MAC', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'operaTime', visible: true, label: '时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'command', visible: true, label: '命令', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
|
@ -173,6 +183,7 @@ export default {
|
|||
pageSize: 20,
|
||||
orderByColumn: defaultSort.prop,
|
||||
isAsc: defaultSort.order,
|
||||
excludeCommand: '111',
|
||||
id: null,
|
||||
type: null,
|
||||
mac: null,
|
||||
|
@ -312,6 +323,9 @@ export default {
|
|||
this.download('bst/commandLog/export', {
|
||||
...this.queryParams
|
||||
}, `commandLog_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
handleLocation(row) {
|
||||
window.open(`https://uri.amap.com/marker?position=${row.longitude},${row.latitude}`, '_blank');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -26,7 +26,10 @@
|
|||
<el-descriptions-item label="状态">
|
||||
<dict-tag :options="dict.type.device_status" :value="detail.status" size="mini"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="版本">{{ detail.hardwareVersion | dv }} | {{ detail.softwareVersion | dv }}</el-descriptions-item>
|
||||
<el-descriptions-item label="版本">
|
||||
{{ detail.hardwareVersion | dv }} | {{ detail.softwareVersion | dv }}
|
||||
<el-link v-has-permi="['bst:device:update']" @click="handleUpdateVersion" icon="el-icon-upload" type="primary" style="margin-left: 4px;">升级</el-link>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="锁状态">
|
||||
<dict-tag :options="dict.type.device_lock_status" :value="detail.lockStatus" size="mini"/>
|
||||
</el-descriptions-item>
|
||||
|
@ -49,12 +52,19 @@
|
|||
|
||||
<collapse-panel :value="true" title="位置信息">
|
||||
<el-descriptions :column="4">
|
||||
<el-descriptions-item label="定位" :span="2">
|
||||
<dict-tag :options="dict.type.device_location_type" :value="detail.locationType" size="mini"/>
|
||||
{{ detail.longitude | dv }}, {{ detail.latitude | dv }}
|
||||
<el-descriptions-item label="设备定位" :span="2">
|
||||
<el-link :href="`https://uri.amap.com/marker?position=${detail.longitude},${detail.latitude}`" type="primary" target="_blank">
|
||||
{{ detail.longitude | dv }}, {{ detail.latitude | dv }}
|
||||
</el-link>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="最后定位时间">{{ detail.lastLocationTime | dv }}</el-descriptions-item>
|
||||
<el-descriptions-item label="设备定位时间">{{ detail.lastLocationTime | dv }}</el-descriptions-item>
|
||||
<el-descriptions-item label="信号">{{ detail.signalStrength | dv }} | {{ detail.satellites | dv }}</el-descriptions-item>
|
||||
<el-descriptions-item label="手机定位" :span="2">
|
||||
<el-link :href="`https://uri.amap.com/marker?position=${detail.mobileLon},${detail.mobileLat}`" type="primary" target="_blank">
|
||||
{{ detail.mobileLon | dv }}, {{ detail.mobileLat | dv }}
|
||||
</el-link>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="手机定位时间">{{ detail.mobileLocationTime | dv }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</collapse-panel>
|
||||
|
||||
|
@ -126,7 +136,7 @@
|
|||
|
||||
<script>
|
||||
import { disableDevice, enableDevice, getDevice, inDevice, outDevice } from '@/api/bst/device';
|
||||
import { lockDevice, rebootDevice, refreshDevice, ringDevice, unlockDevice, unlockSeatDevice } from "@/api/bst/deviceIot";
|
||||
import { iotUpdateDevice, lockDevice, rebootDevice, refreshDevice, ringDevice, unlockDevice, unlockSeatDevice } from "@/api/bst/deviceIot";
|
||||
import BooleanTag from '@/components/BooleanTag/index.vue';
|
||||
import AreaLink from '@/components/Business/Area/AreaLink.vue';
|
||||
import OrderLink from '@/components/Business/Order/OrderLink.vue';
|
||||
|
@ -176,6 +186,23 @@ export default {
|
|||
this.getDetail();
|
||||
},
|
||||
methods: {
|
||||
handleUpdateVersion() {
|
||||
this.$confirm('是否确认升级设备【' + this.detail.sn + '】?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.loading = true;
|
||||
iotUpdateDevice({ id: this.detail.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success("操作成功,设备已升级");
|
||||
this.getDetail();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
})
|
||||
},
|
||||
// 获取设备详情
|
||||
getDetail() {
|
||||
this.loading = true;
|
||||
|
|
|
@ -111,13 +111,13 @@
|
|||
<order-link :id="d.row.orderId" :text="d.row.orderNo" size="mini"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'deviceSn'">
|
||||
{{d.row.deviceSn | dv}}
|
||||
</template>
|
||||
<template v-else-if="column.key === 'type'">
|
||||
<dict-tag :options="dict.type.order_device_type" :value="d.row.type" size="mini" />
|
||||
</template>
|
||||
<template v-else-if="column.key === 'status'">
|
||||
<dict-tag :options="dict.type.order_device_status" :value="d.row.status" size="mini"/>
|
||||
SN:{{d.row.deviceSn | dv}}
|
||||
<dict-tag :options="dict.type.order_device_type" :value="d.row.type" size="mini" style="margin-left: 4px;" />
|
||||
<dict-tag :options="dict.type.order_device_status" :value="d.row.status" size="mini" style="margin-left: 4px;" />
|
||||
<br/>
|
||||
MAC:{{ d.row.deviceMac | dv }}
|
||||
<br/>
|
||||
车牌号:{{ d.row.deviceVehicleNum | dv }}
|
||||
</template>
|
||||
<template v-else-if="column.key === 'reason'">
|
||||
<dict-tag :options="dict.type.order_device_reason" :value="d.row.reason" size="mini"/>
|
||||
|
@ -130,7 +130,8 @@
|
|||
{{d.row.returnLon | dv }},{{d.row.returnLat | dv}}
|
||||
</template>
|
||||
<template v-else-if="column.key === 'startTime'">
|
||||
{{d.row.startTime | dv}} ~ {{d.row.endTime | dv}}
|
||||
开始:{{d.row.startTime | dv}} <br/>
|
||||
结束:{{d.row.endTime | dv}}
|
||||
</template>
|
||||
<template v-else-if="column.key === 'deviceMchName'">
|
||||
<user-link :id="d.row.deviceMchId" :text="d.row.deviceMchName" size="mini"/>
|
||||
|
@ -160,11 +161,11 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listOrderDevice, getOrderDevice, delOrderDevice, addOrderDevice, updateOrderDevice } from "@/api/bst/orderDevice";
|
||||
import { $showColumns } from '@/utils/mixins';
|
||||
import { addOrderDevice, delOrderDevice, getOrderDevice, listOrderDevice, updateOrderDevice } from "@/api/bst/orderDevice";
|
||||
import OrderLink from '@/components/Business/Order/OrderLink.vue';
|
||||
import UserLink from '@/components/Business/User/UserLink.vue';
|
||||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import OrderLink from '@/components/Business/Order/OrderLink.vue'
|
||||
import UserLink from '@/components/Business/User/UserLink.vue'
|
||||
import { $showColumns } from '@/utils/mixins';
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
|
@ -192,16 +193,12 @@ export default {
|
|||
columns: [
|
||||
{key: 'id', visible: false, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"},
|
||||
{key: 'orderNo', visible: true, label: '订单', minWidth: null, sortable: true, overflow: false, align: 'left', width: "160"},
|
||||
{key: 'deviceSn', visible: true, label: 'SN', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'deviceMac', visible: true, label: 'MAC', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'deviceVehicleNum', visible: true, label: '车牌号', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'type', visible: true, label: '类型', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'status', visible: true, label: '状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'deviceSn', visible: true, label: 'SN', minWidth: null, sortable: true, overflow: false, align: 'left', width: "250"},
|
||||
{key: 'startTime', visible: true, label: '时间', minWidth: null, sortable: false, overflow: false, align: 'center', width: "260"},
|
||||
{key: 'deviceMchName', visible: true, label: '车辆归属', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'reason', visible: true, label: '换车原因', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'finishPicture', visible: true, label: '还车视频', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'returnMode', visible: true, label: '还车定位', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'returnMode', visible: true, label: '还车定位', minWidth: null, sortable: true, overflow: false, align: 'center', width: "200"},
|
||||
{key: 'reason', visible: true, label: '换车原因', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
],
|
||||
// 排序方式
|
||||
orderSorts: ['ascending', 'descending', null],
|
||||
|
|
Loading…
Reference in New Issue
Block a user