改样式

This commit is contained in:
2025-09-22 17:16:05 +08:00
parent a67f55d7c8
commit 3a250e8d73
2 changed files with 19 additions and 15 deletions

View File

@@ -18,7 +18,7 @@
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span>{{ plan.name }} - 内容</span> <span>{{ plan.name }} - 内容</span>
<el-button class="button" text>操作按钮</el-button> <el-button class="button" @click="handleEdit">编辑</el-button>
</div> </div>
</template> </template>
<div v-if="plan.content_type === 'tasks'"> <div v-if="plan.content_type === 'tasks'">
@@ -112,6 +112,10 @@ export default {
this.loading = false; this.loading = false;
} }
}, },
handleEdit() {
// Placeholder for future implementation
this.$message.info('编辑功能正在开发中');
},
editTask(task) { editTask(task) {
console.log('编辑任务:', task); console.log('编辑任务:', task);
this.$message.info('编辑任务功能正在开发中'); this.$message.info('编辑任务功能正在开发中');

View File

@@ -62,10 +62,10 @@
{{ formatNextExecutionTime(scope.row.cron_expression) }} {{ formatNextExecutionTime(scope.row.cron_expression) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="300"> <el-table-column label="操作" width="280">
<template #default="scope"> <template #default="scope">
<el-button size="small" @click="editPlan(scope.row)">编辑计划</el-button> <el-button size="small" @click="editPlan(scope.row)">编辑</el-button>
<el-button size="small" @click="editTask(scope.row)">编辑任务</el-button> <el-button size="small" @click="showDetails(scope.row)">详情</el-button>
<el-button v-if="scope.row.status === 1" size="small" type="warning" @click="stopPlan(scope.row)" :loading="stoppingPlanId === scope.row.id"> <el-button v-if="scope.row.status === 1" size="small" type="warning" @click="stopPlan(scope.row)" :loading="stoppingPlanId === scope.row.id">
停止 停止
</el-button> </el-button>
@@ -88,20 +88,20 @@
@cancel="handlePlanCancel" @cancel="handlePlanCancel"
/> />
<!-- 任务/子计划编辑器 --> <!-- 计划详情 -->
<el-dialog <el-dialog
v-model="taskEditorVisible" v-model="detailsVisible"
title="编辑计划内容" title="计划详情"
width="70%" width="70%"
top="5vh" top="5vh"
> >
<plan-content-editor <plan-content-editor
v-if="taskEditorVisible" v-if="detailsVisible"
:plan-id="selectedPlanIdForTasks" :plan-id="selectedPlanIdForDetails"
/> />
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="taskEditorVisible = false">关闭</el-button> <el-button @click="detailsVisible = false">关闭</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@@ -128,7 +128,7 @@ export default {
plans: [], plans: [],
originalPlans: [], // Store the original unsorted list originalPlans: [], // Store the original unsorted list
dialogVisible: false, dialogVisible: false,
taskEditorVisible: false, // 控制任务编辑器对话框 detailsVisible: false, // 控制详情对话框
isEdit: false, isEdit: false,
loading: false, loading: false,
error: null, error: null,
@@ -140,7 +140,7 @@ export default {
execute_num: 0, execute_num: 0,
cron_expression: '' cron_expression: ''
}, },
selectedPlanIdForTasks: null, // 当前要编辑任务的计划ID selectedPlanIdForDetails: null, // 当前要查看详情的计划ID
startingPlanId: null, startingPlanId: null,
stoppingPlanId: null stoppingPlanId: null
}; };
@@ -237,9 +237,9 @@ export default {
this.dialogVisible = true; this.dialogVisible = true;
}, },
editTask(plan) { showDetails(plan) {
this.selectedPlanIdForTasks = plan.id; this.selectedPlanIdForDetails = plan.id;
this.taskEditorVisible = true; this.detailsVisible = true;
}, },
editPlan(plan) { editPlan(plan) {