This commit is contained in:
haodd 2023-07-13 14:03:10 +08:00
commit aba42ad1aa
8 changed files with 97 additions and 79 deletions

View File

@ -28,6 +28,7 @@ import { useUserInfo } from '@/store/userInfo';
import { useMenuStore } from '@/store/menu';
import { getAllNotice } from '@/api/account/center';
import { flatten } from 'lodash-es';
const updateCount = computed(() => useUserInfo().alarmUpdateCount);
const menuStory = useMenuStore();
@ -99,46 +100,6 @@ const read = (type: string, data: any) => {
});
};
//
const getList = () => {
if(tabs.value.length <= 0) return;
loading.value = true;
const params = {
sorts: [{
name: 'notifyTime',
order: 'desc'
}],
terms: [
{
terms: [
{
type: 'or',
value: 'unread',
termType: 'eq',
column: 'state',
},
],
},
],
};
getList_api(params)
.then((resp: any) => {
total.value = resp.result.total;
})
.finally(() => (loading.value = false));
};
const visibleChange = (bool: boolean) => {
bool && getList();
};
const handleRead = () => {
visible.value = false;
getList();
};
watch(updateCount, () => getList());
const tab = [
{
key: 'alarm',
@ -163,6 +124,56 @@ const tab = [
},
];
//
const getList = () => {
if(tabs.value.length <= 0) return;
loading.value = true;
const params = {
sorts: [{
name: 'notifyTime',
order: 'desc'
}],
terms: [
{
terms: [
{
type: 'and',
value: 'unread',
termType: 'eq',
column: 'state',
},
],
},
{
terms: [
{
type: 'and',
value: flatten(tabs.value.map((i: any) => i?.type)),
termType: 'in',
column: 'topicProvider',
},
],
},
],
};
getList_api(params)
.then((resp: any) => {
total.value = resp.result.total;
})
.finally(() => (loading.value = false));
};
const visibleChange = (bool: boolean) => {
bool && getList();
};
const handleRead = () => {
visible.value = false;
getList();
};
watch(updateCount, () => getList());
const tabs = ref<any>([]);
const queryTypeList = async () => {

View File

@ -16,7 +16,7 @@
</template>
<j-spin :spinning="loading">
<div class="content">
<j-scrollbar class="list" :max-height="450" v-if="total">
<j-scrollbar class="list" :max-height="450" v-if="list.length">
<template v-for="i in list" :key="i.id">
<NoticeItem
:data="i"
@ -66,20 +66,11 @@ const emits = defineEmits(['action']);
type DataType = 'alarm' | 'system-monitor' | 'system-business';
const refreshObj = ref({
alarm: true,
'alarm': true,
'system-monitor': true,
'system-business': true,
});
const loading = ref(false);
const total = ref(0);
const list = ref<any[]>([]);
const activeKey = ref<DataType>('alarm');
const menuStory = useMenuStore();
const route = useRoute();
const userInfo = useUserInfo();
const props = defineProps({
tabs: {
type: Array,
@ -87,6 +78,15 @@ const props = defineProps({
}
})
const loading = ref(false);
const total = ref(0);
const list = ref<any[]>([]);
const activeKey = ref<DataType>(props.tabs?.[0]?.key || 'alarm');
const menuStory = useMenuStore();
const route = useRoute();
const userInfo = useUserInfo();
const getData = (type: string[]) => {
loading.value = true;
const params = {
@ -124,7 +124,7 @@ const onChange = (_key: string) => {
};
onMounted(async () => {
onChange('alarm');
onChange(props.tabs?.[0]?.key || "alarm");
});
const onRefresh = (id: string) => {

View File

@ -177,7 +177,7 @@ const columns = [
rename: 'id',
options: () =>
new Promise((resolve) => {
queryNoPagingPost({}).then((resp: any) => {
queryNoPagingPost({paging: false}).then((resp: any) => {
resolve(
resp.result.map((item: any) => ({
label: item.name,

View File

@ -245,6 +245,7 @@ const onAllRead = async () => {
if (resp.status === 200) {
onlyMessage('操作成功!');
refresh();
user.updateAlarm();
}
};

View File

@ -61,16 +61,16 @@
</slot>
</template>
<template #content>
<div style="height: 110px">
<Ellipsis style="width: calc(100% - 100px)">
<h3 style="font-weight: 600">
{{ slotProps.name }}
</h3>
</Ellipsis>
<div style="height: 95px">
<j-row>
<j-col :span="12" v-if="slotProps.channelInfo">
<div class="card-item-content-text">
{{ slotProps.channelInfo?.name }}
<j-ellipsis>{{ slotProps.channelInfo?.name }}</j-ellipsis>
</div>
<Ellipsis style="width: calc(100% - 20px)">
<div>
@ -90,8 +90,7 @@
</j-row>
<j-row>
<j-col :span="24">
<Ellipsis style="width: calc(100% - 50px)"
>
<j-ellipsis style="width: calc(100% - 50px)">
<div class="context-access">
{{
getDescription(
@ -99,8 +98,7 @@
)
}}
</div>
</Ellipsis
>
</j-ellipsis>
</j-col>
</j-row>
</div>
@ -341,5 +339,4 @@ const add = () => {
</script>
<style scoped>
</style>

View File

@ -44,7 +44,7 @@
</j-tooltip>
</template>
<template #channelId="slotProps">
<j-space>
<div style="display: flex; align-items: center;">
<Ellipsis style="width: 150px">
{{ slotProps.gbChannelId }}
</Ellipsis>
@ -92,7 +92,7 @@
<AIcon type="EditOutlined" />
</j-button>
</j-popover>
</j-space>
</div>
</template>
<template #status="slotProps">
<j-space>
@ -182,8 +182,8 @@ const columns = [
title: '国标ID',
dataIndex: 'channelId',
key: 'channelId',
ellipsis: true,
scopedSlots: true,
width: 200,
headerCell: 'gbChannelIdHeader', //
search: {
type: 'string',

View File

@ -179,6 +179,7 @@
"
placeholder="请输入端口"
style="width: 100%"
:precision="0"
/>
</j-col>
</j-row>
@ -284,6 +285,7 @@
"
placeholder="请输入端口"
style="width: 100%"
:precision="0"
/>
</j-col>
</j-row>
@ -670,8 +672,8 @@ onMounted(() => {
getDetail();
});
const regDomain =
/[j-zA-Z0-9][-j-zA-Z0-9]{0,62}(\.[j-zA-Z0-9][-j-zA-Z0-9]{0,62})+\.?/;
const regDomain = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?:\.|$)){4}$/
// /[j-zA-Z0-9][-j-zA-Z0-9]{0,62}(\.[j-zA-Z0-9][-j-zA-Z0-9]{0,62})+\.?/;
/**
* 上级SIP地址 字段验证
* @param _
@ -700,10 +702,10 @@ const checkHost = (host: string, port: string | number | undefined) => {
} else if (!host) {
return Promise.reject(new Error('请输入IP 地址'));
} else if (host && !regDomain.test(host)) {
return Promise.reject(new Error('请输入正确的IP地址'));
return Promise.reject(new Error('请输入0.0.0.0~255.255.255.255的IP地址'));
} else if (!port) {
return Promise.reject(new Error('请输入端口'));
} else if ((host && Number(host) < 1) || Number(host) > 65535) {
} else if ((port && Number(port) < 1) || Number(port) > 65535) {
return Promise.reject(new Error('端口请输入1~65535之间的正整数'));
}
return Promise.resolve();
@ -739,8 +741,8 @@ const handleSubmit = () => {
id,
cascadeName,
proxyStream,
publicHost,
publicPort,
// publicHost,
// publicPort,
...extraFormData
} = formData.value;
const params = {
@ -750,10 +752,10 @@ const handleSubmit = () => {
sipConfigs: [
{
...extraFormData,
remotePublic: {
host: publicHost,
port: publicPort,
},
// remotePublic: {
// host: publicHost,
// port: publicPort,
// },
},
],
};

View File

@ -9,11 +9,13 @@
:fieldNames="{ title: 'name', key: 'id' }"
@select="onSelect"
>
<template #icon="{ id, selected }">
<AIcon
type="VideoCameraOutlined"
<template #title="{id, name}">
<div class="name"><AIcon
type="VideoCameraOutlined" style="margin-right: 5px;"
v-if="!treeData.find((f: any) => f.id === id)"
/>
/><j-ellipsis>{{ name }}</j-ellipsis></div>
</template>
<template #icon>
</template>
</j-tree>
</div>
@ -173,4 +175,9 @@ const onLoadData = ({ key, children }: any): Promise<void> => {
<style lang="less" scoped>
@import './index.less';
.name {
display: flex;
align-items: center;
}
</style>