Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
XieYongHong 2023-07-13 14:04:23 +08:00
commit f7310c0e9e
16 changed files with 115 additions and 95 deletions

View File

@ -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 () => {

View File

@ -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) => {

View File

@ -4,7 +4,7 @@
:type='type' :type='type'
:request='(data) => saveSearchHistory(data, target)' :request='(data) => saveSearchHistory(data, target)'
:historyRequest='() => getSearchHistory(target)' :historyRequest='() => getSearchHistory(target)'
:deleteRequest='deleteSearchHistory' :deleteRequest='(_target: string, id: string) => deleteSearchHistory(target, id)'
:columns='columns' :columns='columns'
:class='props.class' :class='props.class'
style='padding-top: 18px; padding-bottom: 18px;' style='padding-top: 18px; padding-bottom: 18px;'

View File

@ -98,6 +98,10 @@ const props: JUploadProps = defineProps({
borderStyle: { borderStyle: {
type: Object, type: Object,
default: undefined default: undefined
},
size: {
type: Number,
default: undefined,
} }
}); });

View File

@ -337,7 +337,7 @@ import BatchUpdate from './components/BatchUpdate/index.vue';
import SaveModBus from './Save/SaveModBus.vue'; import SaveModBus from './Save/SaveModBus.vue';
import SaveOPCUA from './Save/SaveOPCUA.vue'; import SaveOPCUA from './Save/SaveOPCUA.vue';
import Scan from './Scan/index.vue'; import Scan from './Scan/index.vue';
import { colorMap } from '../data.ts'; import { colorMap } from '../data';
import { cloneDeep, isNumber, throttle } from 'lodash-es'; import { cloneDeep, isNumber, throttle } from 'lodash-es';
import { getWebSocket } from '@/utils/websocket'; import { getWebSocket } from '@/utils/websocket';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
@ -441,14 +441,6 @@ const columns = [
label: '运行中', label: '运行中',
value: 'running', value: 'running',
}, },
{
label: '部分错误',
value: 'partialError',
},
{
label: '错误',
value: 'failed',
},
{ {
label: '已停止', label: '已停止',
value: 'stopped', value: 'stopped',

View File

@ -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,

View File

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

View File

@ -1,5 +1,5 @@
<template> <template>
<j-spin :spinning="loading" v-if="_metadata.length"> <j-spin :spinning="loading" v-if="_metadata?.length">
<j-card :bordered="false"> <j-card :bordered="false">
<template #title> <template #title>
<TitleComponent data="点位映射"></TitleComponent> <TitleComponent data="点位映射"></TitleComponent>

View File

@ -146,7 +146,7 @@ const selectChange = (e: any) => {
visible.value = true; visible.value = true;
} }
const item = productList.value.filter((i: any) => i.id === e)[0]; const item = productList.value.filter((i: any) => i.id === e)[0];
const array = JSON.parse(item.metadata || [])?.properties?.map( const array = JSON.parse(item.metadata || '{}')?.properties?.map(
(i: any) => ({ (i: any) => ({
metadataType: 'property', metadataType: 'property',
metadataName: `${i.name}(${i.id})`, metadataName: `${i.name}(${i.id})`,

View File

@ -1,5 +1,5 @@
<template> <template>
<j-spin :spinning="loading" v-if="metadata.properties.length"> <j-spin :spinning="loading" v-if="metadata.properties?.length">
<j-card :bordered="false" style="padding: 0"> <j-card :bordered="false" style="padding: 0">
<template #extra> <template #extra>
<j-space> <j-space>
@ -263,7 +263,7 @@ const channelList = ref<any[]>([]);
const _properties = computed(() => { const _properties = computed(() => {
const _cur = current.value >= 1 ? current.value : 1; const _cur = current.value >= 1 ? current.value : 1;
return metadata.properties.slice((_cur - 1) * 10, _cur * 10); return metadata.properties?.slice((_cur - 1) * 10, _cur * 10) || [];
}); });
const modelRef = reactive<{ const modelRef = reactive<{

View File

@ -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>

View File

@ -13,7 +13,7 @@
<j-row type="flex"> <j-row type="flex">
<j-col flex="180px"> <j-col flex="180px">
<j-form-item name="photoUrl"> <j-form-item name="photoUrl">
<JProUpload accept="image/jpeg,image/png" v-model="modelRef.photoUrl" /> <JProUpload accept="image/jpeg,image/png" v-model="modelRef.photoUrl" :size="4"/>
</j-form-item> </j-form-item>
</j-col> </j-col>
<j-col flex="auto"> <j-col flex="auto">
@ -184,7 +184,7 @@ const vailId = async (_: Record<string, any>, value: string) => {
if (!props?.data?.id && value) { if (!props?.data?.id && value) {
const resp = await isExists(value); const resp = await isExists(value);
if (resp.status === 200 && resp.result) { if (resp.status === 200 && resp.result) {
return Promise.reject('ID重复'); return Promise.reject('该ID已存在');
} else { } else {
return Promise.resolve(); return Promise.resolve();
} }

View File

@ -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',

View File

@ -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,
}, // },
}, },
], ],
}; };

View File

@ -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>

View File

@ -60,6 +60,12 @@ const getUserList = (oParams: any) => {
column: 'id$in-dimension$role$not', column: 'id$in-dimension$role$not',
value: props.roleId, value: props.roleId,
}, },
{
column: 'username',
value: 'admin',
termType: 'not',
type: 'and'
}
], ],
}, },
], ],