feat(sj_1.0.0): 完成通知配置
This commit is contained in:
parent
3867b49d40
commit
f2a03043ab
@ -25,8 +25,7 @@ const visible = defineModel<boolean>('visible', {
|
||||
watch(
|
||||
() => props.rowData,
|
||||
() => {
|
||||
console.log(props.rowData);
|
||||
const rowData = props.rowData?.notifyAttribute;
|
||||
const rowData = props.rowData?.notifyAttribute || null;
|
||||
notifyAttribute.value = JSON.parse(rowData!) || {};
|
||||
},
|
||||
{ immediate: true }
|
||||
|
@ -1,16 +1,22 @@
|
||||
<script setup lang="tsx">
|
||||
import { NButton, NPopconfirm, NTag } from 'naive-ui';
|
||||
import { ref } from 'vue';
|
||||
import { fetchGetNotifyConfigList, fetchUpdateNotifyStatus } from '@/service/api';
|
||||
import { $t } from '@/locales';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { useTable, useTableOperate } from '@/hooks/common/table';
|
||||
import NotifyConfigOperateDrawer from '@/views/notify/scene/modules/notify-config-operate-drawer.vue';
|
||||
import NotifyConfigSearch from '@/views/notify/scene/modules/notify-config-search.vue';
|
||||
import NotifyConfigDetailDrawer from '@/views/notify/scene/modules/notify-config-detail-drawer.vue';
|
||||
import StatusSwitch from '@/components/common/status-switch.vue';
|
||||
import { jobNotifyScene, retryNotifyScene } from '@/constants/business';
|
||||
import { jobNotifyScene, retryNotifyScene, systemTaskType } from '@/constants/business';
|
||||
import { tagColor } from '@/utils/common';
|
||||
|
||||
const appStore = useAppStore();
|
||||
const detailData = ref();
|
||||
const detailVisible = defineModel<boolean>('detailVisible', {
|
||||
default: false
|
||||
});
|
||||
|
||||
const { columns, columnChecks, data, getData, loading, mobilePagination, searchParams, resetSearchParams } = useTable({
|
||||
apiFn: fetchGetNotifyConfigList,
|
||||
@ -35,6 +41,24 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
||||
align: 'center',
|
||||
width: 64
|
||||
},
|
||||
{
|
||||
key: 'businessName',
|
||||
title: $t('page.notifyConfig.businessName'),
|
||||
align: 'left',
|
||||
width: 120,
|
||||
render: row => {
|
||||
function showDetailDrawer() {
|
||||
detailData.value = row || null;
|
||||
detailVisible.value = true;
|
||||
}
|
||||
|
||||
return (
|
||||
<n-button text tag="a" type="primary" onClick={showDetailDrawer} class="ws-normal">
|
||||
{row.businessName}
|
||||
</n-button>
|
||||
);
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'groupName',
|
||||
title: $t('page.notifyConfig.groupName'),
|
||||
@ -42,10 +66,19 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
key: 'businessName',
|
||||
title: $t('page.notifyConfig.businessName'),
|
||||
key: 'systemTaskType',
|
||||
title: $t('page.notifyConfig.systemTaskType'),
|
||||
align: 'left',
|
||||
width: 120
|
||||
width: 120,
|
||||
render: row => {
|
||||
if (row.systemTaskType === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const label = $t(systemTaskType[row.systemTaskType!]);
|
||||
|
||||
return <NTag type={tagColor(row.systemTaskType!)}>{label}</NTag>;
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'notifyStatus',
|
||||
@ -94,6 +127,12 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
||||
align: 'left',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
key: 'createDt',
|
||||
title: $t('common.createDt'),
|
||||
align: 'left',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
key: 'description',
|
||||
title: $t('page.notifyConfig.description'),
|
||||
@ -192,6 +231,7 @@ function edit(id: string) {
|
||||
:row-data="editingData"
|
||||
@submitted="getData"
|
||||
/>
|
||||
<NotifyConfigDetailDrawer v-model:visible="detailVisible" :row-data="detailData" />
|
||||
</NCard>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -0,0 +1,69 @@
|
||||
<script setup lang="ts">
|
||||
import { watch } from 'vue';
|
||||
import { enableStatusNumberRecord, jobNotifyScene, retryNotifyScene, systemTaskType } from '@/constants/business';
|
||||
import { $t } from '@/locales';
|
||||
import { tagColor } from '@/utils/common';
|
||||
|
||||
defineOptions({
|
||||
name: 'NotifyConfigDetailDrawer'
|
||||
});
|
||||
|
||||
interface Props {
|
||||
/** row data */
|
||||
rowData?: Api.NotifyConfig.NotifyConfig | null;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const visible = defineModel<boolean>('visible', {
|
||||
default: false
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.rowData,
|
||||
() => {
|
||||
console.log(props.rowData);
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<OperateDrawer v-model="visible" :title="$t('page.groupConfig.detail')">
|
||||
<NDescriptions label-placement="top" bordered :column="2">
|
||||
<NDescriptionsItem :label="$t('page.notifyConfig.businessName')" :span="2">
|
||||
{{ rowData?.businessName }}
|
||||
</NDescriptionsItem>
|
||||
<NDescriptionsItem :label="$t('page.groupConfig.groupName')" :span="2">
|
||||
{{ rowData?.groupName }}
|
||||
</NDescriptionsItem>
|
||||
<NDescriptionsItem :label="$t('page.notifyConfig.systemTaskType')" :span="1">
|
||||
<NTag :type="tagColor(rowData?.systemTaskType!)">{{ $t(systemTaskType[rowData?.systemTaskType!]) }}</NTag>
|
||||
</NDescriptionsItem>
|
||||
<NDescriptionsItem :label="$t('page.notifyConfig.notifyStatus')" :span="1">
|
||||
<NTag :type="tagColor(rowData?.notifyStatus!)">{{ $t(enableStatusNumberRecord[rowData?.notifyStatus!]) }}</NTag>
|
||||
</NDescriptionsItem>
|
||||
<NDescriptionsItem v-if="rowData?.systemTaskType === 1" :label="$t('page.notifyConfig.notifyScene')" :span="1">
|
||||
<NTag :type="tagColor(rowData?.notifyScene!)">
|
||||
{{ $t(retryNotifyScene[rowData?.notifyScene! as Api.NotifyConfig.RetryNotifyScene]) }}
|
||||
</NTag>
|
||||
</NDescriptionsItem>
|
||||
<NDescriptionsItem v-if="rowData?.systemTaskType === 3" :label="$t('page.notifyConfig.notifyScene')" :span="1">
|
||||
<NTag :type="tagColor(rowData?.notifyScene!)">
|
||||
{{ $t(jobNotifyScene[rowData?.notifyScene! as Api.NotifyConfig.JobNotifyScene]) }}
|
||||
</NTag>
|
||||
</NDescriptionsItem>
|
||||
<NDescriptionsItem :label="$t('page.notifyConfig.notifyThreshold')" :span="1">
|
||||
<NTag :type="tagColor(rowData?.notifyThreshold!)">{{ rowData?.notifyThreshold }}</NTag>
|
||||
</NDescriptionsItem>
|
||||
<NDescriptionsItem :label="$t('common.createDt')" :span="2">
|
||||
{{ rowData?.createDt }}
|
||||
</NDescriptionsItem>
|
||||
<NDescriptionsItem :label="$t('page.notifyConfig.description')" :span="2">
|
||||
{{ rowData?.description }}
|
||||
</NDescriptionsItem>
|
||||
</NDescriptions>
|
||||
</OperateDrawer>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
@ -97,7 +97,7 @@ function createDefaultModel(): Model {
|
||||
systemTaskType: 1,
|
||||
notifyStatus: 1,
|
||||
notifyScene: 1,
|
||||
notifyThreshold: 0,
|
||||
notifyThreshold: 16,
|
||||
rateLimiterStatus: 0,
|
||||
rateLimiterThreshold: 0,
|
||||
description: ''
|
||||
@ -316,12 +316,14 @@ watch(visible, () => {
|
||||
<NFormItem :label="$t('page.notifyConfig.rateLimiterThreshold')" path="rateLimiterThreshold">
|
||||
<NInputNumber
|
||||
v-model:value="model.rateLimiterThreshold"
|
||||
:min="1"
|
||||
:placeholder="$t('page.notifyConfig.form.rateLimiterThreshold')"
|
||||
/>
|
||||
</NFormItem>
|
||||
<NFormItem :label="$t('page.notifyConfig.notifyThreshold')" path="notifyThreshold">
|
||||
<NInputNumber
|
||||
v-model:value="model.notifyThreshold"
|
||||
:min="1"
|
||||
:placeholder="$t('page.notifyConfig.form.notifyThreshold')"
|
||||
/>
|
||||
</NFormItem>
|
||||
|
Loading…
Reference in New Issue
Block a user