增加集群部署支持,修复定时任务分组添加后选项不显示

This commit is contained in:
孟帅
2023-07-26 16:49:09 +08:00
parent 996ed818ee
commit 12bf36cd15
22 changed files with 1185 additions and 529 deletions

View File

@@ -51,10 +51,10 @@ export const columns = [
title: '表达式',
key: 'pattern',
},
{
title: '执行次数',
key: 'count',
},
// {
// title: '执行次数',
// key: 'count',
// },
{
title: '状态',
key: 'status',

View File

@@ -144,7 +144,7 @@
</n-modal>
</n-card>
<GroupModal ref="GroupModalRef" />
<GroupModal ref="GroupModalRef" @reloadGroupOption="reloadGroupOption"/>
</div>
</template>
@@ -450,7 +450,7 @@
openDrawer();
}
async function setDictSelect() {
async function reloadGroupOption() {
const tmp = await getSelect({});
optionTreeData.value = tmp.list;
if (optionTreeData.value === undefined || optionTreeData.value === null) {
@@ -467,7 +467,7 @@
}
onBeforeMount(async () => {
await setDictSelect();
await reloadGroupOption();
});
// 处理选项更新

View File

@@ -40,6 +40,7 @@
:default-value="formParams.pid"
@update:value="handleUpdateValue"
/>
<template #feedback>不选视为顶级分组</template>
</n-form-item>
<n-form-item label="分组名称" path="name">
<n-input placeholder="请输入分组名称" v-model:value="formParams.name" />
@@ -78,13 +79,14 @@
<script lang="ts" setup>
import { h, reactive, ref, onMounted } from 'vue';
import { TreeSelectOption, useDialog, useMessage } from 'naive-ui';
import { useDialog, useMessage } from 'naive-ui';
import { BasicTable, TableAction } from '@/components/Table';
import { columns } from './columns';
import { PlusOutlined } from '@vicons/antd';
import { GroupDelete, GroupEdit, GroupList, getSelect } from '@/api/sys/cron';
import { statusOptions } from '@/enums/optionsiEnum';
const emit = defineEmits(['reloadGroupOption']);
const optionTreeData = ref([]);
const message = useMessage();
const statusValue = ref(1);
@@ -206,6 +208,7 @@
function reloadTable() {
actionRef.value.reload();
emit('reloadGroupOption');
}
async function setDictSelect() {
@@ -221,10 +224,7 @@
});
// 处理选项更新
function handleUpdateValue(
value: string | number | Array<string | number> | null,
_option: TreeSelectOption | null | Array<TreeSelectOption | null>
) {
function handleUpdateValue(value: string | number | Array<string | number> | null) {
formParams.value.pid = value;
}
</script>

View File

@@ -7,7 +7,7 @@
preset="dialog"
:title="title"
>
<Index />
<Index @reloadGroupOption="reloadGroupOption" />
</n-modal>
</div>
</template>
@@ -16,6 +16,7 @@
import { ref } from 'vue';
import Index from './index.vue';
const emit = defineEmits(['reloadGroupOption']);
const showModal = ref(false);
const title = ref('管理分组');
@@ -23,6 +24,10 @@
showModal.value = true;
}
function reloadGroupOption() {
emit('reloadGroupOption');
}
defineExpose({ openDrawer });
</script>