feat:增加网关批量升级固件进度查询列表
This commit is contained in:
parent
89334e8f83
commit
38dbf95152
|
@ -12,7 +12,7 @@ port= 9988
|
||||||
|
|
||||||
# 服务端地址
|
# 服务端地址
|
||||||
// 陈志荣 本地
|
// 陈志荣 本地
|
||||||
//target = http://192.168.18.140:8899
|
// target = http://192.168.18.140:8899
|
||||||
// 黄明 本地
|
// 黄明 本地
|
||||||
// target = http://192.168.18.134:8899
|
// target = http://192.168.18.134:8899
|
||||||
//target = http://192.168.18.139:8899
|
//target = http://192.168.18.139:8899
|
||||||
|
|
|
@ -62,7 +62,7 @@ export function upgradeOta(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 新增固件版本
|
// 批量升级固件版本
|
||||||
export function upgradeBatch(data) {
|
export function upgradeBatch(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/iot/ota/upgradeBatch',
|
url: '/iot/ota/upgradeBatch',
|
||||||
|
@ -71,3 +71,10 @@ export function upgradeBatch(data) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询固件版本列表
|
||||||
|
export function listUpgradeByDeviceKey(deviceKey) {
|
||||||
|
return request({
|
||||||
|
url: '/iot/device/upgradeListByKey/' + deviceKey,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -87,9 +87,9 @@
|
||||||
.pagination-container {
|
.pagination-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 25px;
|
height: 25px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 20px;
|
||||||
margin-top: 15px;
|
margin-top: 5px;
|
||||||
padding: 10px 20px !important;
|
padding: 15px 20px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tree border */
|
/* tree border */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container dialog-bit">
|
<div class="dialog-bit">
|
||||||
<el-dialog class="eldialog-wrap-t" @close="close" :title="title" :close-on-click-modal="false" append-to-body :visible.sync="visible" :width="width">
|
<el-dialog class="eldialog-wrap-t" @close="close" :title="title" :close-on-click-modal="false" append-to-body :visible.sync="visible" :width="width">
|
||||||
<slot name="dialog-center"></slot>
|
<slot name="dialog-center"></slot>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
|
|
@ -65,9 +65,7 @@ export default {
|
||||||
watch: {
|
watch: {
|
||||||
sourceData: {
|
sourceData: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
if(val && val.length > 0) {
|
this.paramData = [...val];
|
||||||
this.paramData = this.sourceData;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -103,6 +101,7 @@ export default {
|
||||||
handleDelete(item) {
|
handleDelete(item) {
|
||||||
if (!this.paramData || !item) return;
|
if (!this.paramData || !item) return;
|
||||||
this.paramData = this.paramData.filter(v => v.guid !== item.guid)
|
this.paramData = this.paramData.filter(v => v.guid !== item.guid)
|
||||||
|
this.handleChange()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,173 @@
|
||||||
|
<template>
|
||||||
|
<div class="iot-batch-upgrade-rate">
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
size="mini"
|
||||||
|
@click="getDeviceList"
|
||||||
|
>刷新</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-table v-loading="loading" :data="deviceList" height="540px">
|
||||||
|
<el-table-column
|
||||||
|
type="index"
|
||||||
|
label="序号"
|
||||||
|
align="center"
|
||||||
|
:index="indexFormatter"
|
||||||
|
width="80px"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column label="设备key" align="left" width="200" prop="deviceKey" />
|
||||||
|
<el-table-column label="当前版本" align="center" width="120" prop="currentVersion" />
|
||||||
|
<el-table-column label="升级版本" align="center" width="120" prop="upgradeVersion" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span class="lay-table-textarea" :title="scope.row.upgradeVersion">
|
||||||
|
{{ scope.row.upgradeVersion }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="升级进度" align="center" width="350" prop="upgradeStatus" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div style="
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;"
|
||||||
|
>
|
||||||
|
<el-progress
|
||||||
|
style="width: 220px; margin-right: 10px;"
|
||||||
|
:text-inside="true"
|
||||||
|
:stroke-width="24"
|
||||||
|
:percentage="scope.row.upgradeProgress"
|
||||||
|
:status="upgradeStatusType(scope.row, 'upgradeStatus')"></el-progress>
|
||||||
|
<el-tag :type="upgradeStatusTagType(scope.row, 'upgradeStatus')">{{upgradeStatusTagTiltle(scope.row, 'upgradeStatus')}}</el-tag>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="升级信息" align="left" prop="upgradelnfo" />
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
width="160px"
|
||||||
|
|
||||||
|
prop="createTime"
|
||||||
|
/>
|
||||||
|
<!-- <el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
width="200px"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-error"
|
||||||
|
@click="handleDisassociate(scope.row)"
|
||||||
|
>取消关联</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['iot:device:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {listUpgradeByDeviceKey } from '@/api/iot/deviceOta'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'BatchUpgradeRate',
|
||||||
|
props: {
|
||||||
|
sourceKey: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1
|
||||||
|
},
|
||||||
|
loading: false,
|
||||||
|
deviceList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDeviceList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getDeviceList() {
|
||||||
|
this.deviceList = [];
|
||||||
|
if (!this.sourceKey && this.sourceKey !== 0)
|
||||||
|
return;
|
||||||
|
this.loading = true;
|
||||||
|
listUpgradeByDeviceKey(this.sourceKey).then(res => {
|
||||||
|
this.deviceList = [...res.rows];
|
||||||
|
this.loading = false
|
||||||
|
}).catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
this.loading = false;
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
upgradeStatusTagTiltle(row, type) {
|
||||||
|
switch(row[type].toString()) {
|
||||||
|
case '0':
|
||||||
|
return '升级中';
|
||||||
|
case '1':
|
||||||
|
return '成功';
|
||||||
|
case '2':
|
||||||
|
return '失败';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
upgradeStatusTagType(row, type) {
|
||||||
|
switch(row[type].toString()) {
|
||||||
|
case '0':
|
||||||
|
return '';
|
||||||
|
case '1':
|
||||||
|
return 'success';
|
||||||
|
case '2':
|
||||||
|
return 'danger';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
upgradeStatusType(row, type) {
|
||||||
|
switch(row[type].toString()) {
|
||||||
|
case '0':
|
||||||
|
return '';
|
||||||
|
case '1':
|
||||||
|
return 'success';
|
||||||
|
case '2':
|
||||||
|
return 'exception';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
indexFormatter(val) {
|
||||||
|
return (
|
||||||
|
val + 1
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -106,12 +106,19 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
|
<el-tab-pane label="升级进度" name="batchUpgradeRate" v-if="infoData.deviceId === pInfo.deviceId">
|
||||||
|
<div class="tabs-body">
|
||||||
|
<batch-upgrade-rate ref="batchUpgradeRate" v-if="activeName === 'batchUpgradeRate'" :sourceKey="pInfo.deviceKey"></batch-upgrade-rate>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div style="height: 0;">
|
||||||
<!-- 添加或修改建筑类型对话框 -->
|
<!-- 添加或修改建筑类型对话框 -->
|
||||||
<dialog-template
|
<dialog-template
|
||||||
|
style=""
|
||||||
:title="dialogTitle"
|
:title="dialogTitle"
|
||||||
:visible="dialogOpen"
|
:visible="dialogOpen"
|
||||||
width="880px"
|
width="880px"
|
||||||
|
@ -123,7 +130,6 @@
|
||||||
:sourceData="this.form.data"
|
:sourceData="this.form.data"
|
||||||
@handleChange="handleFirmwareChange"
|
@handleChange="handleFirmwareChange"
|
||||||
></e-batch-firmware-upgrade>
|
></e-batch-firmware-upgrade>
|
||||||
|
|
||||||
<div slot="dialog-footer" class="dialog-footer">
|
<div slot="dialog-footer" class="dialog-footer">
|
||||||
<el-button type="primary" size="mini" @click="submitForm"
|
<el-button type="primary" size="mini" @click="submitForm"
|
||||||
>确 定</el-button
|
>确 定</el-button
|
||||||
|
@ -148,6 +154,7 @@ import EDeviceScene from '@/views/profile/EDeviceScene/indexView'
|
||||||
import DialogTemplate from "@/components/DialogTemplate";
|
import DialogTemplate from "@/components/DialogTemplate";
|
||||||
import EBatchFirmwareUpgrade from '@/views/profile/BatchFirmwareUpgrade/example'
|
import EBatchFirmwareUpgrade from '@/views/profile/BatchFirmwareUpgrade/example'
|
||||||
import { upgradeBatch } from '@/api/iot/deviceOta'
|
import { upgradeBatch } from '@/api/iot/deviceOta'
|
||||||
|
import BatchUpgradeRate from "./BatchUpgradeRate";
|
||||||
export default {
|
export default {
|
||||||
name: "DetailsWrap",
|
name: "DetailsWrap",
|
||||||
props: ["sourceId", "isTenant", 'isPersonal'],
|
props: ["sourceId", "isTenant", 'isPersonal'],
|
||||||
|
@ -161,7 +168,8 @@ export default {
|
||||||
ChildDevice,
|
ChildDevice,
|
||||||
EDeviceScene,
|
EDeviceScene,
|
||||||
DialogTemplate,
|
DialogTemplate,
|
||||||
EBatchFirmwareUpgrade
|
EBatchFirmwareUpgrade,
|
||||||
|
BatchUpgradeRate
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -245,8 +253,7 @@ export default {
|
||||||
this.form.data = ev
|
this.form.data = ev
|
||||||
},
|
},
|
||||||
submitForm() {
|
submitForm() {
|
||||||
|
if((!this.form.data || this.form.data.length <= 0) || (this.form.data && this.form.data.filter(v => !v.otaId || !v.prodKey).length > 0)) {
|
||||||
if(!this.form.data || (this.form.data && this.form.data.filter(v => !v.otaId || !v.prodKey).length > 0)) {
|
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '未选择型号或固件',
|
message: '未选择型号或固件',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
|
@ -262,6 +269,10 @@ export default {
|
||||||
type: 'success'
|
type: 'success'
|
||||||
});
|
});
|
||||||
this.dialogOpen = false;
|
this.dialogOpen = false;
|
||||||
|
if (this.activeName === 'batchUpgradeRate'){
|
||||||
|
this.$refs.batchUpgradeRate.getDeviceList();
|
||||||
|
}
|
||||||
|
this.activeName = 'batchUpgradeRate';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue