-
Notifications
You must be signed in to change notification settings - Fork 905
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,877 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { request } from '@/utils/request'; | ||
import Api from '@/core/permission/modules/sys/task'; | ||
|
||
type CommonParams = { | ||
id: number; | ||
}; | ||
|
||
export function getSysTaskList(params?: API.PageParams) { | ||
return request<API.TableListResult<API.SysTaskListItem[]>>({ | ||
url: Api.page, | ||
method: 'get', | ||
params, | ||
}); | ||
} | ||
|
||
export function getSysTaskInfo(params: CommonParams) { | ||
return request<API.SysTaskInfoResult>({ | ||
url: Api.info, | ||
method: 'get', | ||
params, | ||
}); | ||
} | ||
|
||
export function sysTaskAdd(data?: API.PageParams) { | ||
return request( | ||
{ | ||
url: Api.add, | ||
method: 'post', | ||
data, | ||
}, | ||
{ | ||
successMsg: '添加成功', | ||
}, | ||
); | ||
} | ||
|
||
export function sysTaskDelete(data?: API.PageParams) { | ||
return request({ | ||
url: Api.delete, | ||
method: 'post', | ||
data, | ||
}); | ||
} | ||
|
||
export function sysTaskUpdate(data?: API.PageParams) { | ||
return request( | ||
{ | ||
url: Api.update, | ||
method: 'post', | ||
data, | ||
}, | ||
{ | ||
successMsg: '修改成功', | ||
}, | ||
); | ||
} | ||
|
||
export function sysTaskOnce(data: CommonParams) { | ||
return request({ | ||
url: Api.once, | ||
method: 'post', | ||
data, | ||
}); | ||
} | ||
|
||
export function sysTaskStart(data: CommonParams) { | ||
return request({ | ||
url: Api.start, | ||
method: 'post', | ||
data, | ||
}); | ||
} | ||
|
||
export function sysTaskStop(data: CommonParams) { | ||
return request({ | ||
url: Api.stop, | ||
method: 'post', | ||
data, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
declare namespace API { | ||
/** 任务列表项 */ | ||
export type SysTaskListItem = { | ||
createdAt: string; | ||
updatedAt: string; | ||
id: number; | ||
name: string; | ||
service: string; | ||
type: number; | ||
status: number; | ||
startTime: string; | ||
endTime: string; | ||
limit: number; | ||
cron: string; | ||
every: number; | ||
data: string; | ||
jobOpts: string; | ||
remark: string; | ||
}; | ||
/** 添加任务参数 */ | ||
export type SysTaskAddParams = { | ||
name: string; | ||
service: string; | ||
type: number; | ||
status: number; | ||
startTime: string; | ||
endTime: string; | ||
limit: number; | ||
cron: string; | ||
every: number; | ||
data: string; | ||
remark: string; | ||
}; | ||
|
||
/** 更新任务参数 */ | ||
export type SysTaskUpdateParams = SysTaskAddParams & { | ||
id: number; | ||
}; | ||
/** 获取任务详情返回结果 */ | ||
export type SysTaskInfoResult = { | ||
createdAt: string; | ||
updatedAt: string; | ||
id: number; | ||
name: string; | ||
service: string; | ||
type: number; | ||
status: number; | ||
startTime: string; | ||
endTime: string; | ||
limit: number; | ||
cron: string; | ||
every: number; | ||
data: string; | ||
jobOpts: string; | ||
remark: string; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.