增加编辑任务界面
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
|
||||
</el-card>
|
||||
|
||||
<!-- 使用新的计划表单组件 -->
|
||||
<!-- 计划表单 -->
|
||||
<PlanForm
|
||||
v-model:visible="dialogVisible"
|
||||
:plan-data="currentPlan"
|
||||
@@ -87,6 +87,25 @@
|
||||
@success="handlePlanSuccess"
|
||||
@cancel="handlePlanCancel"
|
||||
/>
|
||||
|
||||
<!-- 任务/子计划编辑器 -->
|
||||
<el-dialog
|
||||
v-model="taskEditorVisible"
|
||||
title="编辑计划内容"
|
||||
width="70%"
|
||||
top="5vh"
|
||||
>
|
||||
<plan-content-editor
|
||||
v-if="taskEditorVisible"
|
||||
:plan-id="selectedPlanIdForTasks"
|
||||
/>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="taskEditorVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -94,12 +113,14 @@
|
||||
import { Refresh } from '@element-plus/icons-vue';
|
||||
import apiClient from '../api/index.js';
|
||||
import PlanForm from './PlanForm.vue';
|
||||
import PlanContentEditor from './PlanContentEditor.vue'; // 导入新组件
|
||||
import cronParser from 'cron-parser';
|
||||
|
||||
export default {
|
||||
name: 'PlanList',
|
||||
components: {
|
||||
PlanForm,
|
||||
PlanContentEditor, // 注册新组件
|
||||
Refresh
|
||||
},
|
||||
data() {
|
||||
@@ -107,6 +128,7 @@ export default {
|
||||
plans: [],
|
||||
originalPlans: [], // Store the original unsorted list
|
||||
dialogVisible: false,
|
||||
taskEditorVisible: false, // 控制任务编辑器对话框
|
||||
isEdit: false,
|
||||
loading: false,
|
||||
error: null,
|
||||
@@ -118,6 +140,7 @@ export default {
|
||||
execute_num: 0,
|
||||
cron_expression: ''
|
||||
},
|
||||
selectedPlanIdForTasks: null, // 当前要编辑任务的计划ID
|
||||
startingPlanId: null,
|
||||
stoppingPlanId: null
|
||||
};
|
||||
@@ -215,9 +238,8 @@ export default {
|
||||
},
|
||||
|
||||
editTask(plan) {
|
||||
// TODO: Implement task editing logic
|
||||
console.log("Editing task for plan:", plan);
|
||||
this.$message.info('该功能正在开发中');
|
||||
this.selectedPlanIdForTasks = plan.id;
|
||||
this.taskEditorVisible = true;
|
||||
},
|
||||
|
||||
editPlan(plan) {
|
||||
|
||||
Reference in New Issue
Block a user