diff --git a/src/api/account/notificationRecord.ts b/src/api/account/notificationRecord.ts index 21269244..4d69c13f 100644 --- a/src/api/account/notificationRecord.ts +++ b/src/api/account/notificationRecord.ts @@ -7,6 +7,9 @@ export const getList_api = (data: any): any => server.post(`/notifications/_quer // 修改记录状态 export const changeStatus_api = (type: '_read' | '_unread', data: string[]): any => server.post(`/notifications/${type}`, data) +export const changeAllStatus = (type: '_read' | '_unread', data: string[]): any => server.post(`/notifications/${type}/provider`, data) + + // 查询告警记录详情 export const getDetail = (id: string): any => server.get(`/alarm/record/${id}`) diff --git a/src/views/account/Center/components/StationMessage/components/NotificationRecord/index.vue b/src/views/account/Center/components/StationMessage/components/NotificationRecord/index.vue index 70b18209..e6f9b234 100644 --- a/src/views/account/Center/components/StationMessage/components/NotificationRecord/index.vue +++ b/src/views/account/Center/components/StationMessage/components/NotificationRecord/index.vue @@ -5,7 +5,7 @@ :columns="columns" target="category" style="padding: 0" - @search="(params:any)=>queryParams = {...params}" + @search="queryParams" /> diff --git a/src/views/system/NoticeRule/components/Role/index.vue b/src/views/system/NoticeRule/components/Role/index.vue index e97a1af3..208daae5 100644 --- a/src/views/system/NoticeRule/components/Role/index.vue +++ b/src/views/system/NoticeRule/components/Role/index.vue @@ -86,6 +86,7 @@ const onSearch = (e: any) => { // 取消全选 const cancelSelect = () => { _selectedRowKeys.value = []; + emit('update:modelValue', []); }; const onSelect = (record: any, selected: boolean) => { diff --git a/src/views/system/NoticeRule/components/Save/components/NotifyConfig.vue b/src/views/system/NoticeRule/components/Save/components/NotifyConfig.vue index b57641d9..ad9ffaf6 100644 --- a/src/views/system/NoticeRule/components/Save/components/NotifyConfig.vue +++ b/src/views/system/NoticeRule/components/Save/components/NotifyConfig.vue @@ -159,11 +159,11 @@ const handleClick = (dt: any) => { if (_selectedRowKeys.value.includes(dt.id)) { _selectedRowKeys.value = []; emit('update:value', undefined); - emit('change', { provider: undefined }); + emit('change', { provider: undefined, value: undefined }); } else { _selectedRowKeys.value = [dt.id]; emit('update:value', dt.id); - emit('change', { provider: dt?.provider }); + emit('change', { provider: dt?.provider, value: dt.id }); } }; diff --git a/src/views/system/NoticeRule/components/Save/components/NotifyTemplate.vue b/src/views/system/NoticeRule/components/Save/components/NotifyTemplate.vue index 2fc13e1d..7b63dd50 100644 --- a/src/views/system/NoticeRule/components/Save/components/NotifyTemplate.vue +++ b/src/views/system/NoticeRule/components/Save/components/NotifyTemplate.vue @@ -138,12 +138,12 @@ const handleClick = (dt: any) => { if (_selectedRowKeys.value.includes(dt.id)) { _selectedRowKeys.value = []; emit('update:value', undefined); - emit('change', { templateName: undefined }); + emit('change', { templateName: undefined, value: undefined }); emit('update:detail', undefined); } else { _selectedRowKeys.value = [dt.id]; emit('update:value', dt.id); - emit('change', { templateName: dt?.name }); + emit('change', { templateName: dt?.name, value: dt?.id }); emit('update:detail', dt); } }; diff --git a/src/views/system/NoticeRule/components/Save/index.vue b/src/views/system/NoticeRule/components/Save/index.vue index ce5b5243..36731e98 100644 --- a/src/views/system/NoticeRule/components/Save/index.vue +++ b/src/views/system/NoticeRule/components/Save/index.vue @@ -12,20 +12,23 @@
@@ -89,8 +98,8 @@ const props = defineProps({ }, loading: { type: Boolean, - default: false - } + default: false, + }, }); const stepList = [ @@ -128,11 +137,13 @@ const _variableDefinitions = computed(() => { const handleVariable = (obj: any) => { const arr = ['user', 'org']; - const _array = variable.value.filter((item: any) => { - const _type = item.expands?.businessType || item.type || ''; - return arr.includes(_type); - }).map((i: any) => i?.id); - const _variable = variableMap.get(formModel.channelProvider) + const _array = variable.value + .filter((item: any) => { + const _type = item.expands?.businessType || item.type || ''; + return arr.includes(_type); + }) + .map((i: any) => i?.id); + const _variable = variableMap.get(formModel.channelProvider); const _obj = {}; [...new Set([..._array, _variable]).values()].map((item: string) => { _obj[item] = { @@ -153,7 +164,9 @@ const handleVariable = (obj: any) => { }; const jumpStep = async (val: number) => { - if (val === 1) { + if (val === 0) { + current.value = val; + } else if (val === 1) { if (formModel.channelProvider) { current.value = val; } else { @@ -197,6 +210,34 @@ const jumpStep = async (val: number) => { } }; +const onWayChange = (obj: any) => { + // 如果数据变化,清除后面的值 + if (formModel.channelProvider !== obj.value) { + formModel.channelConfiguration.notifierId = ''; + formModel.channelConfiguration.templateId = ''; + formModel.channelConfiguration.variables = {}; + } + formModel.channelProvider = obj?.value; + formModel.name = obj?.label; +}; + +const onConfigChange = (obj: any) => { + // 如果数据变化,清除后面的值 + if (formModel.channelConfiguration?.notifierId !== obj?.value) { + formModel.channelConfiguration.templateId = ''; + formModel.channelConfiguration.variables = {}; + } + formModel.channelConfiguration.notifierId = obj?.value; +}; + +const onTemplateChange = (obj: any) => { + // 如果数据变化,清除后面的值 + if (formModel.channelConfiguration?.templateId !== obj?.value) { + formModel.channelConfiguration.variables = {}; + } + formModel.channelConfiguration.templateId = obj?.value +}; + watchEffect(() => { Object.assign(formModel, props.data); });