Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 3.11 #3337

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/frontend/src/domain/source/task-execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ class TaskExecute extends ModuleBase {
}

// 获取作业步骤实例详情
getOneStepInstance({ id }) {
return Request.get(`${this.path}/task-instance/step_instance/${id}`);
getOneStepInstance(params) {
return Request.get(`${this.path}/taskInstance/${params.taskInstanceId}/stepInstance/${params.id}/detail`);
}

// 获取作业实例全局参数
Expand Down Expand Up @@ -175,7 +175,8 @@ class TaskExecute extends ModuleBase {
taskExecutionStepOperate(payload) {
const params = { ...payload };
delete params.id;
return Request.post(`${this.path}/do-step-operation/stepInstanceId/${payload.id}`, {
delete params.taskInstanceId;
return Request.post(`${this.path}/taskInstance/${payload.taskInstanceId}/stepInstance/${payload.id}/operate`, {
params,
});
}
Expand Down Expand Up @@ -254,8 +255,9 @@ class TaskExecute extends ModuleBase {
// 获取步骤执行历史
getStepExecutionHistory(params = {}) {
const realParams = { ...params };
delete realParams.taskInstanceId;
delete realParams.stepInstanceId;
return Request.get(`${this.path}/step-execution-history/${params.stepInstanceId}`, {
return Request.get(`${this.path}/taskInstance/${params.taskInstanceId}/stepInstance/${params.stepInstanceId}/stepExecutionHistory`, {
params: realParams,
});
}
Expand Down
22 changes: 14 additions & 8 deletions src/frontend/src/views/cron-job/list/components/detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
</detail-layout>
</template>
<script>
import CronJobService from '@service/cron-job';
import NotifyService from '@service/notify';
import QueryGlobalSettingService from '@service/query-global-setting';
import TaskPlanService from '@service/task-plan';
Expand Down Expand Up @@ -158,15 +159,20 @@
* @desc 获取定时人详情
*/
fetchData() {
TaskPlanService.fetchPlanDetailInfo({
templateId: this.data.taskTemplateId,
id: this.data.taskPlanId,
}).then((planInfo) => {
return Promise.all([
CronJobService.getDetail({
id: this.data.id,
}),
TaskPlanService.fetchPlanDetailInfo({
templateId: this.data.taskTemplateId,
id: this.data.taskPlanId,
}),
]).then(([cronJobDetail, planDetail]) => {
// 使用执行方案的变量
// 如果定时任务任务中存有变量变量值——拷贝过来
const currentPlanVariableList = planInfo.variableList;
const currentPlanVariableList = planDetail.variableList;
// 当前定时任务变量
const cronJobVariableMap = this.data.variableValue.reduce((result, variableItem) => {
const cronJobVariableMap = cronJobDetail.variableValue.reduce((result, variableItem) => {
result[variableItem.id] = variableItem;
return result;
}, {});
Expand All @@ -187,7 +193,7 @@
* @desc 通知人列表
*/
fetchRoleList() {
NotifyService.fetchRoleList()
return NotifyService.fetchRoleList()
.then((data) => {
const roleMap = {};
data.forEach((role) => {
Expand All @@ -200,7 +206,7 @@
* @desc 通知渠道
*/
fetchAllChannel() {
QueryGlobalSettingService.fetchActiveNotifyChannel()
return QueryGlobalSettingService.fetchActiveNotifyChannel()
.then((data) => {
const channelMap = {};
data.forEach((channel) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
// 步骤详情
fetchStep() {
return TaskExecuteService.fetchStepInstance({
taskInstanceId: this.taskId,
id: this.id,
}).then((data) => {
if (data.rollingEnabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
*/
fetchStepExecutionHistory: _.debounce(function (from) {
TaskExecuteService.fetchStepExecutionHistory({
taskInstanceId: this.$route.params.taskInstanceId,
stepInstanceId: this.stepInstanceId,
batch: this.batch,
}).then((data) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
created() {
this.timer = '';


const { taskInstanceId } = this.$route.params;
const { stepInstanceId, executeCount = 0 } = this.$route.query;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
methods: {
handleChangeStatus(operationCode) {
return TaskExecuteService.updateTaskExecutionStepOperate({
taskInstanceId: this.$route.params.taskInstanceId,
id: this.data.stepInstanceId,
operationCode,
confirmReason: this.confirmReason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@

// 步骤详情
const fetchStep = () => TaskExecuteService.fetchStepInstance({
taskInstanceId: props.taskId,
id: props.id,
}).then((data) => {
if (data.rollingEnabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@
handleStatusUpdate(operationCode) {
this.$Progress.start();
return TaskExecuteService.updateTaskExecutionStepOperate({
taskInstanceId: this.taskInstanceId,
id: this.params.id,
operationCode,
}).then((data) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
},
handleChangeStatus(operationCode, confirmReason) {
return TaskExecuteService.updateTaskExecutionStepOperate({
taskInstanceId: this.$route.params.id,
id: this.data.stepInstanceId,
operationCode,
confirmReason,
Expand Down
Loading