|
|
@@ -84,7 +84,6 @@
|
|
|
size="lg fixed"
|
|
|
title="心跳记录"
|
|
|
:schema="heartbeatSchema"
|
|
|
- @hook:beforeDestroy="closeTimer"
|
|
|
/>
|
|
|
</wrapper>
|
|
|
</template>
|
|
|
@@ -115,18 +114,18 @@ export default {
|
|
|
return {
|
|
|
logSetting: {},
|
|
|
schema: {
|
|
|
+ autoRefreshEachPage: true,
|
|
|
list: this.getDevicesByTenant,
|
|
|
buttons: [
|
|
|
{ label: '心跳记录', on: this.onHeartbeats }
|
|
|
],
|
|
|
filters: [
|
|
|
- { key: 'name', type: 'search', placeholder: '设备名称' }
|
|
|
+ { key: 'name', type: 'search', placeholder: '名称' }
|
|
|
],
|
|
|
cols: [
|
|
|
- { type: 'refresh' },
|
|
|
- { prop: 'name', label: '设备名称' },
|
|
|
- { prop: 'serialNumber', label: '序列号' },
|
|
|
- { prop: 'mac', label: 'MAC' },
|
|
|
+ { prop: 'remark', label: '型号', width: 100 },
|
|
|
+ { prop: 'name', label: '名称', 'min-width': 120 },
|
|
|
+ { prop: 'address', label: '地址', 'min-width': 120 },
|
|
|
{ type: 'tag', render: ({ activate, onlineStatus }) => activate
|
|
|
? onlineStatus === 0
|
|
|
? { type: 'primary', label: '待接入' }
|
|
|
@@ -144,13 +143,13 @@ export default {
|
|
|
},
|
|
|
heartbeatSchema: {
|
|
|
nonPagination: true,
|
|
|
+ autoRefresh: true,
|
|
|
list: this.getheartbeatData,
|
|
|
filters: [
|
|
|
- { key: 'name', type: 'search', placeholder: '设备名称' }
|
|
|
+ { key: 'name', type: 'search', placeholder: '名称' }
|
|
|
],
|
|
|
cols: [
|
|
|
- { type: 'refresh' },
|
|
|
- { prop: 'name', label: '设备名称', sortable: true },
|
|
|
+ { prop: 'name', label: '名称', sortable: true },
|
|
|
{ prop: 'sn', label: '序列号', sortable: true },
|
|
|
{ prop: 'mac', label: 'MAC', width: 140 },
|
|
|
{ prop: 'ip', label: 'ip', width: 140 },
|
|
|
@@ -165,9 +164,9 @@ export default {
|
|
|
resultSchema () {
|
|
|
return {
|
|
|
list: getRemoteLogs,
|
|
|
+ autoRefresh: true,
|
|
|
condition: { deviceId: this.curDeviceId },
|
|
|
cols: [
|
|
|
- { type: 'refresh' },
|
|
|
{ prop: 'settingId', label: '事件' },
|
|
|
{ label: '执行状态', type: 'tag', render: ({ status }) => {
|
|
|
return {
|
|
|
@@ -186,14 +185,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- beforeDestroy () {
|
|
|
- this.closeTimer()
|
|
|
- },
|
|
|
methods: {
|
|
|
- closeTimer () {
|
|
|
- clearTimeout(this.$timer)
|
|
|
- this.$timer = null
|
|
|
- },
|
|
|
onTenantChanged (tenant) {
|
|
|
this.$tenant = tenant
|
|
|
this.$refs.table?.pageTo(1)
|
|
|
@@ -253,11 +245,7 @@ export default {
|
|
|
this.$refs.resultDialog.show()
|
|
|
},
|
|
|
getheartbeatData () {
|
|
|
- this.closeTimer()
|
|
|
return getHeartbeats(this.$mac).then(({ data }) => {
|
|
|
- this.$timer = setTimeout(() => {
|
|
|
- this.$refs?.heartbeatDialog.getTable()?.onPagination()
|
|
|
- }, 5 * 1000)
|
|
|
if (!data) {
|
|
|
return { data: [] }
|
|
|
}
|