fix: 修改设备网关的样式
This commit is contained in:
parent
ef6c66600f
commit
74c0b9fc0a
|
@ -16,14 +16,10 @@ export const useInstanceStore = defineStore({
|
|||
this.detail = current
|
||||
},
|
||||
async refresh(id: string) {
|
||||
const resp: any = await detail(id).catch((err) => {
|
||||
onlyMessage(err.response.data.message, 'error')
|
||||
})
|
||||
const resp: any = await detail(id)
|
||||
if(resp.status === 200){
|
||||
this.current = resp.result
|
||||
this.detail = resp.result
|
||||
} else {
|
||||
onlyMessage(resp?.message, 'error')
|
||||
}
|
||||
},
|
||||
setTabActiveKey(key: string) {
|
||||
|
|
|
@ -151,6 +151,8 @@ const errorHandler = (error: any) => {
|
|||
path: LoginPath
|
||||
})
|
||||
}, 0)
|
||||
} else if (status === 404) {
|
||||
showNotification(error?.code, error?.response?.data?.message, '404')
|
||||
}
|
||||
} else if (error.response === undefined) {
|
||||
showNotification(error.message, (error.stack + '').substr(0, 90), undefined)
|
||||
|
|
|
@ -53,7 +53,8 @@
|
|||
<img
|
||||
:width="88"
|
||||
:height="88"
|
||||
:src="slotProps?.photoUrl ||
|
||||
:src="
|
||||
slotProps?.photoUrl ||
|
||||
getImage('/device/instance/device-card.png')
|
||||
"
|
||||
/>
|
||||
|
@ -85,8 +86,42 @@
|
|||
</j-row>
|
||||
</template>
|
||||
<template #actions="item">
|
||||
<j-dropdown
|
||||
placement="bottomRight"
|
||||
v-if="item.key === 'others'"
|
||||
>
|
||||
<j-button>
|
||||
<AIcon :type="item.icon" />
|
||||
<span>{{ item.text }}</span>
|
||||
</j-button>
|
||||
<template #overlay>
|
||||
<j-menu>
|
||||
<j-menu-item
|
||||
v-for="(o, i) in item.children"
|
||||
:key="i"
|
||||
>
|
||||
<PermissionButton
|
||||
:disabled="o.disabled"
|
||||
:popConfirm="o.popConfirm"
|
||||
:tooltip="{
|
||||
...o.tooltip,
|
||||
}"
|
||||
@click="o.onClick"
|
||||
:hasPermission="
|
||||
'edge/Device:' + o.key
|
||||
"
|
||||
type="link"
|
||||
>
|
||||
<AIcon :type="o.icon" />
|
||||
<span>{{ o?.text }}</span>
|
||||
</PermissionButton>
|
||||
</j-menu-item>
|
||||
</j-menu>
|
||||
</template>
|
||||
</j-dropdown>
|
||||
<PermissionButton
|
||||
:disabled="item.disabled"
|
||||
v-else
|
||||
:popConfirm="item.popConfirm"
|
||||
:tooltip="{
|
||||
...item.tooltip,
|
||||
|
@ -383,36 +418,6 @@ const getActions = (
|
|||
current.value = data;
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'setting',
|
||||
text: '远程控制',
|
||||
tooltip: {
|
||||
title: '远程控制',
|
||||
},
|
||||
icon: 'ControlOutlined',
|
||||
onClick: () => {
|
||||
menuStory.jumpPage('edge/Device/Remote', { id: data.id });
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'password',
|
||||
text: '重置密码',
|
||||
tooltip: {
|
||||
title: '重置密码',
|
||||
},
|
||||
icon: 'RedoOutlined',
|
||||
popConfirm: {
|
||||
title: '确认重置密码为P@ssw0rd?',
|
||||
onConfirm: async () => {
|
||||
restPassword(data.id).then((resp: any) => {
|
||||
if (resp.status === 200) {
|
||||
message.success('操作成功!');
|
||||
edgeDeviceRef.value?.reload();
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'action',
|
||||
text: data.state?.value !== 'notActive' ? '禁用' : '启用',
|
||||
|
@ -443,7 +448,43 @@ const getActions = (
|
|||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
const others = [
|
||||
{
|
||||
key: 'setting',
|
||||
text: '远程控制',
|
||||
tooltip: {
|
||||
title: '远程控制',
|
||||
},
|
||||
icon: 'ControlOutlined',
|
||||
onClick: () => {
|
||||
menuStory.jumpPage('edge/Device/Remote', {
|
||||
id: data.id,
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'password',
|
||||
text: '重置密码',
|
||||
tooltip: {
|
||||
title: '重置密码',
|
||||
},
|
||||
icon: 'RedoOutlined',
|
||||
popConfirm: {
|
||||
title: '确认重置密码为P@ssw0rd?',
|
||||
onConfirm: async () => {
|
||||
restPassword(data.id).then((resp: any) => {
|
||||
if (resp.status === 200) {
|
||||
message.success('操作成功!');
|
||||
edgeDeviceRef.value?.reload();
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const deleteItem = {
|
||||
key: 'delete',
|
||||
text: '删除',
|
||||
disabled: data.state?.value !== 'notActive',
|
||||
|
@ -466,11 +507,23 @@ const getActions = (
|
|||
},
|
||||
},
|
||||
icon: 'DeleteOutlined',
|
||||
};
|
||||
|
||||
if (type === 'card') {
|
||||
const arr = actions.filter((i: ActionsType) => i.key !== 'view');
|
||||
return [
|
||||
...arr,
|
||||
{
|
||||
key: 'others',
|
||||
text: '其他',
|
||||
icon: 'EllipsisOutlined',
|
||||
children: [...others],
|
||||
},
|
||||
deleteItem,
|
||||
];
|
||||
if (type === 'card')
|
||||
return actions.filter((i: ActionsType) => i.key !== 'view');
|
||||
return actions;
|
||||
} else {
|
||||
return [...actions, ...others, deleteItem];
|
||||
}
|
||||
};
|
||||
|
||||
const handleSearch = (_params: any) => {
|
||||
|
|
|
@ -3700,8 +3700,8 @@ jetlinks-store@^0.0.3:
|
|||
|
||||
jetlinks-ui-components@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#1cd2b4b99afdda515bffd05f7fc9dd61a3cff16d"
|
||||
integrity sha512-cIB/6wOiU+GHDKI3dUnGLa27VrHXuEOoOsqKI30GcKRHbdamBfApchOcvAON+SHpv19n5i3inKw8pNXaHOeKZw==
|
||||
resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#c71ecae61776bff738f43efe46aac7264f092736"
|
||||
integrity sha512-+1a/4nA5RCiInRFyyaVCMEWSBzNU8lzxOYTTpY0GiNhuJuhGE5AbBsVp9CXXF0lFECK2iqaAElY+QN4Wjms1Dw==
|
||||
dependencies:
|
||||
"@vueuse/core" "^9.12.0"
|
||||
ant-design-vue "^3.2.15"
|
||||
|
|
Loading…
Reference in New Issue