Merge branch 'dev' of github.com:jetlinks/jetlinks-ui-vue into dev
This commit is contained in:
commit
4767863dda
|
@ -1,6 +1,7 @@
|
|||
import { DeviceInstance, InstanceModel } from "@/views/device/Instance/typings"
|
||||
import { defineStore } from "pinia"
|
||||
import { detail } from '@/api/device/instance'
|
||||
import { onlyMessage } from "@/utils/comm"
|
||||
|
||||
export const useInstanceStore = defineStore({
|
||||
id: 'device',
|
||||
|
@ -15,10 +16,14 @@ export const useInstanceStore = defineStore({
|
|||
this.detail = current
|
||||
},
|
||||
async refresh(id: string) {
|
||||
const resp = await detail(id)
|
||||
const resp: any = await detail(id).catch((err) => {
|
||||
onlyMessage(err.response.data.message, 'error')
|
||||
})
|
||||
if(resp.status === 200){
|
||||
this.current = resp.result
|
||||
this.detail = resp.result
|
||||
} else {
|
||||
onlyMessage(resp?.message, 'error')
|
||||
}
|
||||
},
|
||||
setTabActiveKey(key: string) {
|
||||
|
|
|
@ -328,6 +328,7 @@ const jumpProduct = () => {
|
|||
};
|
||||
|
||||
onUnmounted(() => {
|
||||
instanceStore.current = {} as any
|
||||
statusRef.value && statusRef.value.unsubscribe();
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -51,7 +51,9 @@
|
|||
>
|
||||
<template #img>
|
||||
<img
|
||||
:src="
|
||||
:width="88"
|
||||
:height="88"
|
||||
:src="slotProps?.photoUrl ||
|
||||
getImage('/device/instance/device-card.png')
|
||||
"
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue