|
|
@@ -5,15 +5,10 @@
|
|
|
padding
|
|
|
background
|
|
|
>
|
|
|
- <platform-page
|
|
|
- class="l-flex__fill"
|
|
|
- @change="onTenantChanged"
|
|
|
- >
|
|
|
- <schema-table
|
|
|
- ref="table"
|
|
|
- :schema="schema"
|
|
|
- />
|
|
|
- </platform-page>
|
|
|
+ <schema-table
|
|
|
+ ref="table"
|
|
|
+ :schema="schema"
|
|
|
+ />
|
|
|
<confirm-dialog
|
|
|
ref="editDialog"
|
|
|
title="日志抓取配置"
|
|
|
@@ -97,6 +92,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
import { parseTime } from '@/utils'
|
|
|
import { getAssetUrl } from '@/api/asset'
|
|
|
import { getDevicesByTenant } from '@/api/device'
|
|
|
@@ -156,12 +152,12 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
currDeviceId: null,
|
|
|
- currDeviceTenant: null,
|
|
|
title: '',
|
|
|
sn: ''
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ ...mapGetters(['tenant']),
|
|
|
heartbeatSchema () {
|
|
|
return {
|
|
|
nonPagination: true,
|
|
|
@@ -194,7 +190,7 @@ export default {
|
|
|
return {
|
|
|
list: getRemoteLogs,
|
|
|
autoRefresh: true,
|
|
|
- condition: { tenant: this.currDeviceTenant, deviceId: this.currDeviceId },
|
|
|
+ condition: { tenant: this.tenant, deviceId: this.currDeviceId },
|
|
|
cols: [
|
|
|
{ prop: 'settingId', label: '事件' },
|
|
|
{ label: '执行状态', type: 'tag', render: ({ status }) => {
|
|
|
@@ -215,15 +211,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- onTenantChanged (tenant) {
|
|
|
- this.$tenant = tenant
|
|
|
- this.$refs.table?.pageTo(1)
|
|
|
- },
|
|
|
getDevicesByTenant (params) {
|
|
|
- if (!this.$tenant) {
|
|
|
- return Promise.resolve({ data: [] })
|
|
|
- }
|
|
|
- return getDevicesByTenant(this.$tenant.path, params)
|
|
|
+ return getDevicesByTenant(this.tenant, params)
|
|
|
},
|
|
|
getheartbeatData (params) {
|
|
|
if (this.sn) {
|
|
|
@@ -268,7 +257,6 @@ export default {
|
|
|
} else {
|
|
|
this.logSetting = { ...defaultLogSettingForm }
|
|
|
}
|
|
|
- this.currDeviceTenant = device.tenant
|
|
|
this.currDeviceId = device.id
|
|
|
this.$refs.editDialog.show()
|
|
|
})
|
|
|
@@ -284,7 +272,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
await startRemoteLog({
|
|
|
- tenant: this.currDeviceTenant,
|
|
|
+ tenant: this.tenant,
|
|
|
deviceId: this.currDeviceId,
|
|
|
duration,
|
|
|
activate: true,
|
|
|
@@ -295,7 +283,6 @@ export default {
|
|
|
},
|
|
|
onResult (device) {
|
|
|
this.$deviceName = device.name
|
|
|
- this.currDeviceTenant = device.tenant
|
|
|
this.currDeviceId = device.id
|
|
|
this.$refs.resultDialog.show()
|
|
|
},
|