fix: bug#17687

fix: bug#17687
This commit is contained in:
qiaochuLei 2023-08-30 10:59:48 +08:00 committed by GitHub
parent abfb305181
commit 06a323e6f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -17,12 +17,12 @@
<j-spin :spinning="loading"> <j-spin :spinning="loading">
<div class="content"> <div class="content">
<j-scrollbar class="list" :max-height="450" v-if="list.length"> <j-scrollbar class="list" :max-height="450" v-if="list.length">
<template v-for="i in list" :key="i.id"> <template v-for="(i,index) in list" :key="i.id">
<NoticeItem <NoticeItem
:data="i" :data="i"
:type="item.key" :type="item.key"
@action="emits('action')" @action="emits('action')"
@refresh="onRefresh(item.key)" @refresh="onRefresh(item.key,index)"
/> />
</template> </template>
<div <div
@ -114,7 +114,9 @@ const getData = (type: string[]) => {
getList_api(params) getList_api(params)
.then((resp: any) => { .then((resp: any) => {
total.value = resp.result.total; total.value = resp.result.total;
list.value = resp.result?.data || []; list.value = resp.result?.data?.filter((item:any)=>{
return item?.state?.value === "unread"
}) || [];
}) })
.finally(() => (loading.value = false)); .finally(() => (loading.value = false));
}; };
@ -128,12 +130,13 @@ onMounted(async () => {
onChange(props.tabs?.[0]?.key || "alarm"); onChange(props.tabs?.[0]?.key || "alarm");
}); });
const onRefresh = (id: string) => { const onRefresh = (id: string,index:number) => {
const flag = cloneDeep(refreshObj.value[id]); const flag = cloneDeep(refreshObj.value[id]);
refreshObj.value = { refreshObj.value = {
...refreshObj.value, ...refreshObj.value,
[id]: !flag, [id]: !flag,
}; };
list.value.splice(index,1);
}; };
const onMore = (key: string) => { const onMore = (key: string) => {

View File

@ -66,7 +66,7 @@
) )
" "
> >
<j-radio-button :value="true" <j-radio-button :value="true" :disabled="formData.type ==='MQTT_CLIENT'"
>共享配置</j-radio-button >共享配置</j-radio-button
> >
<j-radio-button :value="false" <j-radio-button :value="false"
@ -1280,6 +1280,9 @@ const changeType = (value: string) => {
if (value !== 'MQTT_CLIENT') { if (value !== 'MQTT_CLIENT') {
const { configuration } = dynamicValidateForm.cluster[0]; const { configuration } = dynamicValidateForm.cluster[0];
value && (configuration.host = '0.0.0.0'); value && (configuration.host = '0.0.0.0');
}else{
formData.value.shareCluster = false
changeShareCluster(formData.value.shareCluster)
} }
if(value ==='TCP_SERVER'){ if(value ==='TCP_SERVER'){
getTs().then((res:any)=>{ getTs().then((res:any)=>{