feat(sj_1.0.0): 优化任务类型与通知场景联动
This commit is contained in:
parent
04d2472a91
commit
e83f20d14e
@ -9,6 +9,14 @@ export function fetchGetGroupConfigList(params?: Api.GroupConfig.GroupConfigSear
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function fetchGetAllGroupNameList(params?: Api.GroupConfig.GroupConfigSearchParams) {
|
||||||
|
return request<string[]>({
|
||||||
|
url: '/group/all/group-name/list',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** add groupConfig */
|
/** add groupConfig */
|
||||||
export function fetchAddGroupConfig(data: Api.GroupConfig.GroupConfig) {
|
export function fetchAddGroupConfig(data: Api.GroupConfig.GroupConfig) {
|
||||||
return request<boolean>({
|
return request<boolean>({
|
||||||
|
@ -36,3 +36,15 @@ export function translateOptions(options: CommonType.Option<string | number>[])
|
|||||||
label: $t(option.label as App.I18n.I18nKey)
|
label: $t(option.label as App.I18n.I18nKey)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translate options
|
||||||
|
*
|
||||||
|
* @param options
|
||||||
|
*/
|
||||||
|
export function translateOptions2(options: string[]) {
|
||||||
|
return options.map(option => ({
|
||||||
|
value: option,
|
||||||
|
label: option
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, reactive, watch } from 'vue';
|
import { computed, nextTick, onMounted, reactive, ref, watch } from 'vue';
|
||||||
import { useFormRules, useNaiveForm } from '@/hooks/common/form';
|
import { useFormRules, useNaiveForm } from '@/hooks/common/form';
|
||||||
import OperateDrawer from '@/components/common/operate-drawer.vue';
|
import OperateDrawer from '@/components/common/operate-drawer.vue';
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
import { fetchAddNotify, fetchEditNotify } from '@/service/api';
|
import { fetchAddNotify, fetchEditNotify, fetchGetAllGroupNameList } from '@/service/api';
|
||||||
import {
|
import {
|
||||||
enableStatus01Options,
|
enableStatus01Options,
|
||||||
jobNotifySceneOptions,
|
jobNotifySceneOptions,
|
||||||
retryNotifySceneOptions,
|
retryNotifySceneOptions,
|
||||||
systemTaskTypeOptions
|
systemTaskTypeOptions
|
||||||
} from '@/constants/business';
|
} from '@/constants/business';
|
||||||
import { translateOptions } from '@/utils/common';
|
import { translateOptions, translateOptions2 } from '@/utils/common';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'NotifyConfigOperateDrawer'
|
name: 'NotifyConfigOperateDrawer'
|
||||||
@ -23,6 +23,7 @@ interface Props {
|
|||||||
rowData?: Api.NotifyConfig.NotifyConfig | null;
|
rowData?: Api.NotifyConfig.NotifyConfig | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const groupNameList = ref<string[]>([]);
|
||||||
const props = defineProps<Props>();
|
const props = defineProps<Props>();
|
||||||
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
@ -62,6 +63,18 @@ type Model = Pick<
|
|||||||
| 'description'
|
| 'description'
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
nextTick(() => {
|
||||||
|
getGroupNameList();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
async function getGroupNameList() {
|
||||||
|
const res = await fetchGetAllGroupNameList();
|
||||||
|
console.log(res.data);
|
||||||
|
groupNameList.value = res.data as string[];
|
||||||
|
}
|
||||||
|
|
||||||
const model: Model = reactive(createDefaultModel());
|
const model: Model = reactive(createDefaultModel());
|
||||||
|
|
||||||
function createDefaultModel(): Model {
|
function createDefaultModel(): Model {
|
||||||
@ -159,7 +172,12 @@ watch(visible, () => {
|
|||||||
<OperateDrawer v-model="visible" :title="title" @handle-submit="handleSubmit">
|
<OperateDrawer v-model="visible" :title="title" @handle-submit="handleSubmit">
|
||||||
<NForm ref="formRef" :model="model" :rules="rules">
|
<NForm ref="formRef" :model="model" :rules="rules">
|
||||||
<NFormItem :label="$t('page.notifyConfig.groupName')" path="name">
|
<NFormItem :label="$t('page.notifyConfig.groupName')" path="name">
|
||||||
<NSelect v-model:value="model.groupName" :placeholder="$t('page.notifyConfig.form.groupName')" clearable />
|
<NSelect
|
||||||
|
v-model:value="model.groupName"
|
||||||
|
:placeholder="$t('page.notifyConfig.form.groupName')"
|
||||||
|
:options="translateOptions2(groupNameList)"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NFormItem :label="$t('page.notifyConfig.notifyStatus')" path="notifyStatus">
|
<NFormItem :label="$t('page.notifyConfig.notifyStatus')" path="notifyStatus">
|
||||||
<NRadioGroup v-model:value="model.notifyStatus" name="notifyStatus">
|
<NRadioGroup v-model:value="model.notifyStatus" name="notifyStatus">
|
||||||
|
Loading…
Reference in New Issue
Block a user