fix: bug#11028、11030、11068、10924、11056、10941

This commit is contained in:
JiangQiming 2023-03-28 09:27:12 +08:00
parent f6947dd3e5
commit 067e471b4c
6 changed files with 43 additions and 18 deletions

View File

@ -1,17 +1,17 @@
<template>
<div class="notice-container">
<j-dropdown :trigger="['click']" @visible-change="visibleChange">
<j-dropdown
v-model:visible="visible"
:trigger="['click']"
@visible-change="visibleChange"
>
<div class="icon-content">
<AIcon
type="BellOutlined"
@click.prevent
style="font-size: 16px"
/>
<AIcon type="BellOutlined" style="font-size: 16px" />
<span class="unread" v-show="total > 0">{{ total }}</span>
</div>
<template #overlay>
<div>
<NoticeInfo :data="list" @on-action="getList" />
<NoticeInfo :data="list" @on-action="handleRead" />
</div>
</template>
</j-dropdown>
@ -106,6 +106,12 @@ watch(updateCount, () => getList());
const visibleChange = (bool: boolean) => {
bool && getList();
};
const visible = ref(false);
const handleRead = () => {
visible.value = false;
getList();
};
</script>
<style lang="less" scoped>

View File

@ -3,20 +3,23 @@
<j-tabs :activeKey="'default'">
<j-tab-pane key="default" tab="未读消息">
<div class="no-data" v-if="props.data.length === 0">
<img src="https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg" alt="" />
<img
src="https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg"
alt=""
/>
</div>
<div v-else class="content">
<ul class="list">
<li
<j-scrollbar class="list" max-height="400">
<div
class="list-item"
v-for="item in props.data"
@click="read(item.id)"
@click.stop="read(item.id)"
>
<h5>{{ item.topicName }}</h5>
<p>{{ item.message }}</p>
</li>
</ul>
</div>
</j-scrollbar>
<div class="btns">
<span @click="read()">当前标记为已读</span>
<span @click="jumpPage('account/NotificationRecord')"
@ -41,8 +44,13 @@ const { jumpPage } = useMenuStore();
const read = (id?: string) => {
const ids = id ? [id] : props.data.map((item) => item.id);
changeStatus_api('_read', ids).then((resp:any) => {
if (resp.status === 200) emits('onAction');
changeStatus_api('_read', ids).then((resp: any) => {
if (resp.status === 200) {
jumpPage('account/NotificationRecord', {
row: props.data.find((f: any) => f.id === id),
});
emits('onAction');
}
});
};
</script>
@ -97,7 +105,7 @@ const read = (id?: string) => {
color: rgba(0, 0, 0, 0.45);
}
&:hover{
&:hover {
background: #f0f5ff;
}
}

View File

@ -56,7 +56,7 @@
? '标为未读'
: '标为已读',
}"
>
>
<AIcon type="icon-a-PIZHU1" />
</PermissionButton>
<PermissionButton
@ -94,6 +94,7 @@ import { dictItemType } from '@/views/system/DataSource/typing';
import moment from 'moment';
import { message } from 'ant-design-vue';
import { useUserInfo } from '@/store/userInfo';
import { useRouterParams } from '@/utils/hooks/useParams';
const { updateAlarm } = useUserInfo();
const columns = [
@ -180,6 +181,7 @@ const table = {
});
},
view: (row: any) => {
console.log('row: ', row);
viewItem.value = row;
viewVisible.value = true;
},
@ -190,6 +192,13 @@ const table = {
const viewVisible = ref<boolean>(false);
const viewItem = ref<any>({});
const routerParams = useRouterParams();
onMounted(() => {
if (routerParams.params?.value.row) {
table.view(routerParams.params?.value.row);
}
});
</script>
<style lang="less" scoped>

View File

@ -487,6 +487,7 @@ const table = {
},
clickEdit: (row?: any) => {
const ids = row ? [row.id] : [...tableData._selectedRowKeys];
if (ids.length < 1) return message.warning('请勾选需要编辑的数据');
if (row || tableData.selectedRows.length === 1) {
const permissionList =

View File

@ -46,7 +46,7 @@
<AIcon type="DisconnectOutlined" />批量解绑
</PermissionButton>
</template>
<template #state="slotProps">
<template #status="slotProps">
<BadgeStatus
:status="slotProps.status"
:text="slotProps.status ? '正常' : '禁用'"

View File

@ -154,6 +154,7 @@ const form = reactive({
*/
checkUnique: () => {
if (
props.data?.id ||
!form.data.relation ||
!form.data.objectType ||
!form.data.targetType