fix: bug#11011、11072、11077、11079

This commit is contained in:
JiangQiming 2023-03-28 17:52:11 +08:00
parent 0ea4214ee3
commit be224bbe5d
10 changed files with 59 additions and 20 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -6,7 +6,6 @@ export const getList_api = (data: object): any => server.get(`/notifications/_qu
export const getListByUnRead_api = (data: object): any => server.post(`/notifications/_query`, data)
// 修改记录状态
export const changeStatus_api = (type: '_read' | '_unread', data: string[]): any => server.post(`/notifications/${type}`, data)
export const read = (id: string): any => server.get(`notifications/${id}/read`)
const encodeParams = (params: Record<string, any>) => {

View File

@ -5,10 +5,13 @@
:trigger="['click']"
@visible-change="visibleChange"
>
<div class="icon-content">
<!-- <div class="icon-content">
<AIcon type="BellOutlined" style="font-size: 16px" />
<span class="unread" v-show="total > 0">{{ total }}</span>
</div>
</div> -->
<j-badge :count="total" :offset="[3, -3]">
<AIcon type="BellOutlined" style="font-size: 16px" />
</j-badge>
<template #overlay>
<div>
<NoticeInfo :data="list" @on-action="handleRead" />
@ -26,6 +29,9 @@ import { notification, Button } from 'ant-design-vue';
import { changeStatus_api } from '@/api/account/notificationRecord';
import { useUserInfo } from '@/store/userInfo';
import { useMenuStore } from '@/store/menu';
const { jumpPage } = useMenuStore();
const updateCount = computed(() => useUserInfo().$state.alarmUpdateCount);
const total = ref(0);
@ -44,29 +50,37 @@ const subscribeNotice = () => {
class="ellipsis"
style={{ cursor: 'pointer' }}
onClick={() => {
changeStatus_api('_read', [resp.id]);
{
/* changeStatus_api('_read', [resp.id]); */
}
read('', resp);
}}
>
{resp?.payload?.message}
</div>
),
onClick: () => {
changeStatus_api('_read', [resp.id]);
// changeStatus_api('_read', [resp.id])
read('', resp);
},
key: resp.payload.id,
btn: (
<Button
type="primary"
size="small"
onClick={() => {
changeStatus_api('_read', [resp.id]).then(
onClick={(e) => {
{
/* changeStatus_api('_read', [resp.id]).then(
(resp: any) => {
if (resp.status === 200) {
notification.close(resp.payload.id);
getList();
}
},
);
); */
}
e.stopPropagation();
read('_read', resp);
}}
>
标记已读
@ -75,6 +89,21 @@ const subscribeNotice = () => {
});
});
};
const read = (type: string, data: any) => {
changeStatus_api('_read', [data.payload.id]).then((resp: any) => {
if (resp.status !== 200) return;
notification.close(data.payload.id);
getList();
if (type !== '_read') {
jumpPage('account/NotificationRecord', {
row: data.payload.detail,
});
}
});
};
const getList = () => {
loading.value = true;
const params = {

View File

@ -1,5 +1,5 @@
<template>
<page-container :tabList="list" @tabChange="onTabChange">
<page-container :tabList="list" :tabActiveKey="activeKey" @tabChange="onTabChange">
<AccessLog v-if="activeKey === '1'" />
<SystemLog v-else />
</page-container>
@ -8,7 +8,9 @@
import { defineComponent, ref } from 'vue';
import AccessLog from './Access/index.vue';
import SystemLog from './System/index.vue';
import {useRouterParams} from "@/utils/hooks/useParams";
const routerParams = useRouterParams()
const activeKey = ref('1');
const list = [
@ -25,4 +27,10 @@ const list = [
const onTabChange = (e: string) => {
activeKey.value = e;
};
onMounted(() => {
if (routerParams.params.value.tab === 'system') {
activeKey.value = '2';
}
});
</script>

View File

@ -565,6 +565,9 @@ onMounted(() => {
if (routerParams.params.value.type === 'add') {
handleAdd();
}
if (routerParams.params.value.type === 'import') {
importVisible.value = true;
}
});
const handleParams = (config: Record<string, any>) => {

View File

@ -193,31 +193,31 @@ const opsStepDetails: recommendList[] = [
title: '协议管理',
details:
'根据业务需求自定义开发对应的产品(设备模型)接入协议,并上传到平台。',
iconUrl: '/images/home/bottom-1.png',
iconUrl: '/images/home/Frame 4528.png',
linkUrl: 'link/Protocol',
},
{
title: '证书管理',
details: '统一维护平台内的证书,用于数据通信加密。',
iconUrl: '/images/home/bottom-6.png',
iconUrl: '/images/home/Frame 4528.png',
linkUrl: 'link/Certificate',
},
{
title: '网络组件',
details: '根据不同的传输类型配置平台底层网络组件相关参数。',
iconUrl: '/images/home/bottom-3.png',
iconUrl: '/images/home/Frame 4529.png',
linkUrl: 'link/Type',
},
{
title: '设备接入网关',
details: '根据不同的传输类型,关联消息协议,配置设备接入网关相关参数。',
iconUrl: '/images/home/bottom-4.png',
iconUrl: '/images/home/Frame 4528(1).png',
linkUrl: 'link/AccessConfig',
},
{
title: '日志管理',
details: '监控系统日志,及时处理系统异常。',
iconUrl: '/images/home/bottom-5.png',
iconUrl: '/images/home/Frame 4528.png',
linkUrl: 'Log',
params: {
tab: 'system',

View File

@ -53,31 +53,31 @@ const opsStepDetails: recommendList[] = [
title: '协议管理',
details:
'根据业务需求自定义开发对应的产品(设备模型)接入协议,并上传到平台。',
iconUrl: '/images/home/bottom-1.png',
iconUrl: '/images/home/Frame 4528.png',
linkUrl: 'link/Protocol',
},
{
title: '证书管理',
details: '统一维护平台内的证书,用于数据通信加密。',
iconUrl: '/images/home/bottom-6.png',
iconUrl: '/images/home/Frame 4528.png',
linkUrl: 'link/Certificate',
},
{
title: '网络组件',
details: '根据不同的传输类型配置平台底层网络组件相关参数。',
iconUrl: '/images/home/bottom-3.png',
iconUrl: '/images/home/Frame 4529.png',
linkUrl: 'link/Type',
},
{
title: '设备接入网关',
details: '根据不同的传输类型,关联消息协议,配置设备接入网关相关参数。',
iconUrl: '/images/home/bottom-4.png',
iconUrl: '/images/home/Frame 4528(1).png',
linkUrl: 'link/AccessConfig',
},
{
title: '日志管理',
details: '监控系统日志,及时处理系统异常。',
iconUrl: '/images/home/bottom-5.png',
iconUrl: '/images/home/Frame 4528.png',
linkUrl: 'Log',
params: {
tab: 'system',

View File

@ -139,7 +139,7 @@ const deviceStepDetails: recommendList[] = [
linkUrl: 'device/Instance',
auth: devicePermission('import'),
params: {
import: true,
type: 'import',
},
},
];