feat(plan): 计划自动化执行、结果列表与鉴权请求优化
- 新增 automationApi、PlanAutomationRun、PlanAutomationExecutionList - 计划构建/列表/执行/进度等接入自动化与路由 - request 与 authToken 处理 token 刷新与错误码 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="page-wrap">
|
||||
<page-section :title="isEditMode ? '编辑计划' : '计划构建'">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px" size="small">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="200px" size="small">
|
||||
<el-form-item label="产品名称" prop="productId">
|
||||
<el-select
|
||||
v-model="form.productId"
|
||||
@@ -70,6 +70,12 @@
|
||||
:value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否自动化测试计划" prop="isAuto">
|
||||
<el-select v-model.number="form.isAuto" placeholder="请选择" style="width: 200px;">
|
||||
<el-option :value="0" label="否" />
|
||||
<el-option :value="1" label="是" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" prop="start_time">
|
||||
<el-date-picker
|
||||
v-model="form.start_time"
|
||||
@@ -93,6 +99,14 @@
|
||||
<el-form-item label="描述">
|
||||
<el-input v-model="form.description" type="textarea" :rows="4"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="自动化执行 Jenkins URL">
|
||||
<el-input
|
||||
v-model.trim="form.jenkins_url"
|
||||
maxlength="512"
|
||||
show-word-limit
|
||||
placeholder="选填,自动化触发时使用的 Jenkins 地址"
|
||||
style="width: 480px;" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="goBack">返回</el-button>
|
||||
<el-button type="primary" :loading="saving" @click="submitForm">保存计划</el-button>
|
||||
@@ -128,7 +142,10 @@ export default {
|
||||
environment_id: '',
|
||||
start_time: '',
|
||||
end_time: '',
|
||||
description: ''
|
||||
description: '',
|
||||
jenkins_url: '',
|
||||
/** 是否自动化测试计划:0 否,1 是,提交字段名 isAuto */
|
||||
isAuto: 0
|
||||
},
|
||||
rules: {
|
||||
productId: [{ required: true, message: '请选择产品', trigger: 'change' }],
|
||||
@@ -245,6 +262,8 @@ export default {
|
||||
end_time: this.form.end_time,
|
||||
description: this.form.description
|
||||
}
|
||||
payload.jenkins_url = (this.form.jenkins_url || '').trim()
|
||||
payload.isAuto = this.form.isAuto === 1 ? 1 : 0
|
||||
this.saving = true
|
||||
const request = this.isEditMode
|
||||
? updatePlan(projectId, this.planId, payload)
|
||||
@@ -344,6 +363,10 @@ export default {
|
||||
this.form.start_time = this.toDatePickerValue(this.pickPlanDetailStartRaw(data))
|
||||
this.form.end_time = this.toDatePickerValue(this.pickPlanDetailEndRaw(data))
|
||||
this.form.description = data.description || ''
|
||||
this.form.jenkins_url = data.jenkins_url || data.jenkinsUrl || ''
|
||||
const autoRaw = data.isAuto !== undefined && data.isAuto !== null ? data.isAuto : data.is_auto
|
||||
this.form.isAuto =
|
||||
autoRaw === true || autoRaw === 1 || autoRaw === '1' ? 1 : 0
|
||||
}).catch(() => {})
|
||||
},
|
||||
initByRouteProject() {
|
||||
|
||||
Reference in New Issue
Block a user