Merge branch 'dev' of https://github.com/jetlinks/jetlinks-ui-vue into dev
This commit is contained in:
commit
aba42ad1aa
|
@ -28,6 +28,7 @@ import { useUserInfo } from '@/store/userInfo';
|
||||||
|
|
||||||
import { useMenuStore } from '@/store/menu';
|
import { useMenuStore } from '@/store/menu';
|
||||||
import { getAllNotice } from '@/api/account/center';
|
import { getAllNotice } from '@/api/account/center';
|
||||||
|
import { flatten } from 'lodash-es';
|
||||||
|
|
||||||
const updateCount = computed(() => useUserInfo().alarmUpdateCount);
|
const updateCount = computed(() => useUserInfo().alarmUpdateCount);
|
||||||
const menuStory = useMenuStore();
|
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 = [
|
const tab = [
|
||||||
{
|
{
|
||||||
key: 'alarm',
|
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 tabs = ref<any>([]);
|
||||||
|
|
||||||
const queryTypeList = async () => {
|
const queryTypeList = async () => {
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
</template>
|
</template>
|
||||||
<j-spin :spinning="loading">
|
<j-spin :spinning="loading">
|
||||||
<div class="content">
|
<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">
|
<template v-for="i in list" :key="i.id">
|
||||||
<NoticeItem
|
<NoticeItem
|
||||||
:data="i"
|
:data="i"
|
||||||
|
@ -66,20 +66,11 @@ const emits = defineEmits(['action']);
|
||||||
type DataType = 'alarm' | 'system-monitor' | 'system-business';
|
type DataType = 'alarm' | 'system-monitor' | 'system-business';
|
||||||
|
|
||||||
const refreshObj = ref({
|
const refreshObj = ref({
|
||||||
alarm: true,
|
'alarm': true,
|
||||||
'system-monitor': true,
|
'system-monitor': true,
|
||||||
'system-business': 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({
|
const props = defineProps({
|
||||||
tabs: {
|
tabs: {
|
||||||
type: Array,
|
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[]) => {
|
const getData = (type: string[]) => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const params = {
|
const params = {
|
||||||
|
@ -124,7 +124,7 @@ const onChange = (_key: string) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
onChange('alarm');
|
onChange(props.tabs?.[0]?.key || "alarm");
|
||||||
});
|
});
|
||||||
|
|
||||||
const onRefresh = (id: string) => {
|
const onRefresh = (id: string) => {
|
||||||
|
|
|
@ -177,7 +177,7 @@ const columns = [
|
||||||
rename: 'id',
|
rename: 'id',
|
||||||
options: () =>
|
options: () =>
|
||||||
new Promise((resolve) => {
|
new Promise((resolve) => {
|
||||||
queryNoPagingPost({}).then((resp: any) => {
|
queryNoPagingPost({paging: false}).then((resp: any) => {
|
||||||
resolve(
|
resolve(
|
||||||
resp.result.map((item: any) => ({
|
resp.result.map((item: any) => ({
|
||||||
label: item.name,
|
label: item.name,
|
||||||
|
|
|
@ -245,6 +245,7 @@ const onAllRead = async () => {
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
onlyMessage('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
refresh();
|
refresh();
|
||||||
|
user.updateAlarm();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -61,16 +61,16 @@
|
||||||
</slot>
|
</slot>
|
||||||
</template>
|
</template>
|
||||||
<template #content>
|
<template #content>
|
||||||
<Ellipsis style="width: calc(100% - 100px)">
|
<div style="height: 110px">
|
||||||
|
<Ellipsis style="width: calc(100% - 100px)">
|
||||||
<h3 style="font-weight: 600">
|
<h3 style="font-weight: 600">
|
||||||
{{ slotProps.name }}
|
{{ slotProps.name }}
|
||||||
</h3>
|
</h3>
|
||||||
</Ellipsis>
|
</Ellipsis>
|
||||||
<div style="height: 95px">
|
<j-row>
|
||||||
<j-row>
|
|
||||||
<j-col :span="12" v-if="slotProps.channelInfo">
|
<j-col :span="12" v-if="slotProps.channelInfo">
|
||||||
<div class="card-item-content-text">
|
<div class="card-item-content-text">
|
||||||
{{ slotProps.channelInfo?.name }}
|
<j-ellipsis>{{ slotProps.channelInfo?.name }}</j-ellipsis>
|
||||||
</div>
|
</div>
|
||||||
<Ellipsis style="width: calc(100% - 20px)">
|
<Ellipsis style="width: calc(100% - 20px)">
|
||||||
<div>
|
<div>
|
||||||
|
@ -90,8 +90,7 @@
|
||||||
</j-row>
|
</j-row>
|
||||||
<j-row>
|
<j-row>
|
||||||
<j-col :span="24">
|
<j-col :span="24">
|
||||||
<Ellipsis style="width: calc(100% - 50px)"
|
<j-ellipsis style="width: calc(100% - 50px)">
|
||||||
>
|
|
||||||
<div class="context-access">
|
<div class="context-access">
|
||||||
{{
|
{{
|
||||||
getDescription(
|
getDescription(
|
||||||
|
@ -99,8 +98,7 @@
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</Ellipsis
|
</j-ellipsis>
|
||||||
>
|
|
||||||
</j-col>
|
</j-col>
|
||||||
</j-row>
|
</j-row>
|
||||||
</div>
|
</div>
|
||||||
|
@ -341,5 +339,4 @@ const add = () => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
</style>
|
</style>
|
|
@ -44,7 +44,7 @@
|
||||||
</j-tooltip>
|
</j-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #channelId="slotProps">
|
<template #channelId="slotProps">
|
||||||
<j-space>
|
<div style="display: flex; align-items: center;">
|
||||||
<Ellipsis style="width: 150px">
|
<Ellipsis style="width: 150px">
|
||||||
{{ slotProps.gbChannelId }}
|
{{ slotProps.gbChannelId }}
|
||||||
</Ellipsis>
|
</Ellipsis>
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
<AIcon type="EditOutlined" />
|
<AIcon type="EditOutlined" />
|
||||||
</j-button>
|
</j-button>
|
||||||
</j-popover>
|
</j-popover>
|
||||||
</j-space>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #status="slotProps">
|
<template #status="slotProps">
|
||||||
<j-space>
|
<j-space>
|
||||||
|
@ -182,8 +182,8 @@ const columns = [
|
||||||
title: '国标ID',
|
title: '国标ID',
|
||||||
dataIndex: 'channelId',
|
dataIndex: 'channelId',
|
||||||
key: 'channelId',
|
key: 'channelId',
|
||||||
ellipsis: true,
|
|
||||||
scopedSlots: true,
|
scopedSlots: true,
|
||||||
|
width: 200,
|
||||||
headerCell: 'gbChannelIdHeader', // 表头单元格插槽
|
headerCell: 'gbChannelIdHeader', // 表头单元格插槽
|
||||||
search: {
|
search: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
|
|
@ -179,6 +179,7 @@
|
||||||
"
|
"
|
||||||
placeholder="请输入端口"
|
placeholder="请输入端口"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
:precision="0"
|
||||||
/>
|
/>
|
||||||
</j-col>
|
</j-col>
|
||||||
</j-row>
|
</j-row>
|
||||||
|
@ -284,6 +285,7 @@
|
||||||
"
|
"
|
||||||
placeholder="请输入端口"
|
placeholder="请输入端口"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
:precision="0"
|
||||||
/>
|
/>
|
||||||
</j-col>
|
</j-col>
|
||||||
</j-row>
|
</j-row>
|
||||||
|
@ -670,8 +672,8 @@ onMounted(() => {
|
||||||
getDetail();
|
getDetail();
|
||||||
});
|
});
|
||||||
|
|
||||||
const regDomain =
|
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})+\.?/;
|
// /[j-zA-Z0-9][-j-zA-Z0-9]{0,62}(\.[j-zA-Z0-9][-j-zA-Z0-9]{0,62})+\.?/;
|
||||||
/**
|
/**
|
||||||
* 上级SIP地址 字段验证
|
* 上级SIP地址 字段验证
|
||||||
* @param _
|
* @param _
|
||||||
|
@ -700,10 +702,10 @@ const checkHost = (host: string, port: string | number | undefined) => {
|
||||||
} else if (!host) {
|
} else if (!host) {
|
||||||
return Promise.reject(new Error('请输入IP 地址'));
|
return Promise.reject(new Error('请输入IP 地址'));
|
||||||
} else if (host && !regDomain.test(host)) {
|
} 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) {
|
} else if (!port) {
|
||||||
return Promise.reject(new Error('请输入端口'));
|
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.reject(new Error('端口请输入1~65535之间的正整数'));
|
||||||
}
|
}
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
|
@ -739,8 +741,8 @@ const handleSubmit = () => {
|
||||||
id,
|
id,
|
||||||
cascadeName,
|
cascadeName,
|
||||||
proxyStream,
|
proxyStream,
|
||||||
publicHost,
|
// publicHost,
|
||||||
publicPort,
|
// publicPort,
|
||||||
...extraFormData
|
...extraFormData
|
||||||
} = formData.value;
|
} = formData.value;
|
||||||
const params = {
|
const params = {
|
||||||
|
@ -750,10 +752,10 @@ const handleSubmit = () => {
|
||||||
sipConfigs: [
|
sipConfigs: [
|
||||||
{
|
{
|
||||||
...extraFormData,
|
...extraFormData,
|
||||||
remotePublic: {
|
// remotePublic: {
|
||||||
host: publicHost,
|
// host: publicHost,
|
||||||
port: publicPort,
|
// port: publicPort,
|
||||||
},
|
// },
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,11 +9,13 @@
|
||||||
:fieldNames="{ title: 'name', key: 'id' }"
|
:fieldNames="{ title: 'name', key: 'id' }"
|
||||||
@select="onSelect"
|
@select="onSelect"
|
||||||
>
|
>
|
||||||
<template #icon="{ id, selected }">
|
<template #title="{id, name}">
|
||||||
<AIcon
|
<div class="name"><AIcon
|
||||||
type="VideoCameraOutlined"
|
type="VideoCameraOutlined" style="margin-right: 5px;"
|
||||||
v-if="!treeData.find((f: any) => f.id === id)"
|
v-if="!treeData.find((f: any) => f.id === id)"
|
||||||
/>
|
/><j-ellipsis>{{ name }}</j-ellipsis></div>
|
||||||
|
</template>
|
||||||
|
<template #icon>
|
||||||
</template>
|
</template>
|
||||||
</j-tree>
|
</j-tree>
|
||||||
</div>
|
</div>
|
||||||
|
@ -173,4 +175,9 @@ const onLoadData = ({ key, children }: any): Promise<void> => {
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@import './index.less';
|
@import './index.less';
|
||||||
|
|
||||||
|
.name {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue