fix(sj_1.3.0-beta1): 修复定时任务问题

This commit is contained in:
xlsea 2024-12-27 21:37:07 +08:00
parent 0f2940d61a
commit d33fdf69a3
3 changed files with 11 additions and 14 deletions

View File

@ -961,7 +961,7 @@ declare namespace Api {
/** 负责人id */ /** 负责人id */
owerId: string; owerId: string;
/** 负责人名 */ /** 负责人名 */
owerName: string; owerName?: string;
/** 通知场景ids */ /** 通知场景ids */
notifyIds: number[]; notifyIds: number[];
/** 任务名称 */ /** 任务名称 */

View File

@ -299,6 +299,11 @@ async function handleBatchDelete() {
onBatchDeleted(); onBatchDeleted();
} }
function add() {
editingData.value = null;
handleAdd();
}
function edit(id: string) { function edit(id: string) {
handleEdit(id); handleEdit(id);
} }
@ -353,7 +358,7 @@ function handleExport() {
:loading="loading" :loading="loading"
:disabled-delete="checkedRowKeys.length === 0" :disabled-delete="checkedRowKeys.length === 0"
:show-delete="hasAuth('R_ADMIN')" :show-delete="hasAuth('R_ADMIN')"
@add="handleAdd" @add="add"
@delete="handleBatchDelete" @delete="handleBatchDelete"
@refresh="getData" @refresh="getData"
> >

View File

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { computed, nextTick, onMounted, reactive, ref, watch } from 'vue'; import { computed, reactive, ref, watch } from 'vue';
import { type FormInst, NInputNumber } from 'naive-ui'; import { type FormInst, NInputNumber } from 'naive-ui';
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';
@ -62,7 +62,6 @@ type Model = Pick<
| 'id' | 'id'
| 'groupName' | 'groupName'
| 'owerId' | 'owerId'
| 'owerName'
| 'notifyIds' | 'notifyIds'
| 'jobName' | 'jobName'
| 'argsStr' | 'argsStr'
@ -83,12 +82,6 @@ type Model = Pick<
| 'notifyScene' | 'notifyScene'
>; >;
onMounted(() => {
nextTick(() => {
getNotifyConfigSystemTaskTypeList();
});
});
async function getNotifyConfigSystemTaskTypeList() { async function getNotifyConfigSystemTaskTypeList() {
const res = await fetchGetNotifyConfigSystemTaskTypeList(3); const res = await fetchGetNotifyConfigSystemTaskTypeList(3);
notifyNameList.value = res.data as CommonType.Option<number>[]; notifyNameList.value = res.data as CommonType.Option<number>[];
@ -100,7 +93,8 @@ function createDefaultModel(): Model {
return { return {
// @ts-expect-error groupName is required // @ts-expect-error groupName is required
groupName: undefined, groupName: undefined,
owerId: '', // @ts-expect-error owerId is required
owerId: undefined,
notifyIds: [], notifyIds: [],
jobName: '', jobName: '',
argsStr: '', argsStr: '',
@ -272,7 +266,6 @@ async function handleSubmit() {
id, id,
groupName, groupName,
owerId, owerId,
owerName,
notifyIds, notifyIds,
jobName, jobName,
argsType, argsType,
@ -309,7 +302,6 @@ async function handleSubmit() {
const { error } = await fetchAddJob({ const { error } = await fetchAddJob({
groupName, groupName,
owerId, owerId,
owerName,
notifyIds, notifyIds,
jobName, jobName,
argsStr, argsStr,
@ -337,7 +329,6 @@ async function handleSubmit() {
id, id,
groupName, groupName,
owerId, owerId,
owerName,
notifyIds, notifyIds,
jobName, jobName,
argsStr, argsStr,
@ -384,6 +375,7 @@ watch(visible, () => {
if (visible.value) { if (visible.value) {
handleUpdateModelWhenEdit(); handleUpdateModelWhenEdit();
restoreValidation(); restoreValidation();
getNotifyConfigSystemTaskTypeList();
customformRef.value?.restoreValidation(); customformRef.value?.restoreValidation();
} }
}); });