style(接口测试): 修改自动化场景定时任务样式

This commit is contained in:
wxg0103 2022-04-12 20:08:04 +08:00 committed by 刘瑞斌
parent 6394e070d7
commit 5a12649d1a
7 changed files with 64 additions and 134 deletions

View File

@ -49,7 +49,7 @@
<env-popover :project-ids="projectIds"
:placement="'bottom-start'"
:project-list="projectList"
:env-map="runConfig.envMap"
:project-env-map="projectEnvListMap"
:environment-type.sync="runConfig.environmentType"
:group-id="runConfig.environmentGroupId"
:has-option-group="true"
@ -58,60 +58,25 @@
@showPopover="showPopover"
ref="envPopover" class="env-popover"/>
</div>
<div style="padding-top: 10px;">
<span class="ms-mode-span">{{ $t("run_mode.title") }}</span>
<el-radio-group v-model="runConfig.mode" @change="changeMode">
<el-radio label="serial">{{ $t("run_mode.serial") }}</el-radio>
<el-radio label="parallel">{{ $t("run_mode.parallel") }}</el-radio>
</el-radio-group>
</div>
<div class="ms-mode-div">
<el-row>
<el-col :span="3">
<span class="ms-mode-span">{{ $t("run_mode.other_config") }}</span>
</el-col>
<el-col :span="18">
<div>
<el-radio-group v-model="runConfig.reportType">
<el-radio label="iddReport">{{ $t("run_mode.idd_report") }}</el-radio>
<el-radio label="setReport">{{ $t("run_mode.set_report") }}</el-radio>
</el-radio-group>
</div>
<div style="padding-top: 10px">
<el-checkbox v-model="runConfig.runWithinResourcePool" style="padding-right: 10px;">
{{ $t('run_mode.run_with_resource_pool') }}
</el-checkbox>
<el-select :disabled="!runConfig.runWithinResourcePool" v-model="runConfig.resourcePoolId"
size="mini">
<el-option
v-for="item in resourcePools"
:key="item.id"
:label="item.name"
:disabled="!item.api"
:value="item.id">
</el-option>
</el-select>
</div>
<!--- 失败停止 -->
<div style="margin-top: 10px" v-if="runConfig.mode === 'serial'">
<el-checkbox v-model="runConfig.onSampleError">
{{ $t("api_test.fail_to_stop") }}
</el-checkbox>
</div>
</el-col>
</el-row>
<el-checkbox v-model="runConfig.runWithinResourcePool">
{{ $t('run_mode.run_with_resource_pool') }}
</el-checkbox>
<el-select style="margin-left: 10px" :disabled="!runConfig.runWithinResourcePool"
v-model="runConfig.resourcePoolId"
size="mini">
<el-option
v-for="item in resourcePools"
:key="item.id"
:label="item.name"
:disabled="!item.api"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="ms-mode-div" v-if="runConfig.reportType === 'setReport'">
<span class="ms-mode-span-label">{{ $t("run_mode.report_name") }}</span>
<el-input
v-model="runConfig.reportName"
:placeholder="$t('commons.input_content')"
size="small"
style="width: 300px"/>
</div>
<el-dialog width="60%" :title="$t('schedule.generate_expression')" :visible.sync="showCron"
:modal="false">
<crontab @hide="showCron=false" @fill="crontabFill" :expression="schedule.value"
@ -231,6 +196,7 @@ export default {
},
projectList: [],
projectIds: new Set(),
projectEnvListMap: {},
}
},
methods: {
@ -360,9 +326,7 @@ export default {
this.schedule = response.data;
if (response.data.config) {
this.runConfig = JSON.parse(response.data.config);
if (this.runConfig.envMap) {
this.runConfig.envMap = objToStrMap(this.runConfig.envMap);
}
this.runConfig.envMap = new Map;
}
} else {
this.schedule = {

View File

@ -4,23 +4,37 @@
<template>
<div>
<el-tabs v-model="activeName">
<el-tab-pane :label="$t('schedule.task_config')" name="first">
<div class="el-step__icon is-text" style="margin-right: 10px;">
<div class="el-step__icon-inner">1</div>
</div>
<span>{{ $t('schedule.edit_timer_task') }}</span>
<el-form :model="form" :rules="rules" ref="from" style="padding-top: 10px;margin-left: 20px;">
<el-form-item :label="$t('commons.schedule_cron_title')"
prop="cronValue">
<el-row :gutter="20">
<el-col :span="16">
<el-input :disabled="isReadOnly" v-model="form.cronValue" class="inp"
:placeholder="$t('schedule.please_input_cron_expression')" size="mini">
<a :disabled="isReadOnly" type="primary" @click="showCronDialog" slot="suffix" class="head">
{{ $t('schedule.generate_expression') }}
</a>
</el-input>
<span>{{ this.$t('commons.schedule_switch') }}</span>
<el-tooltip effect="dark" placement="bottom"
:content="schedule.enable ? $t('commons.close_schedule') : $t('commons.open_schedule')">
<el-switch v-model="schedule.enable" style="margin-left: 20px"></el-switch>
</el-tooltip>
</el-col>
<el-col :span="2">
<el-button :disabled="isReadOnly" type="primary" @click="saveCron" size="mini">{{
$t('commons.save')
}}
</el-button>
</el-col>
</el-row>
<el-tab-pane :label="$t('schedule.edit_timer_task')" name="first">
<el-form :model="form" :rules="rules" ref="from">
<el-form-item
prop="cronValue">
<el-input :disabled="isReadOnly" v-model="form.cronValue" class="inp"
:placeholder="$t('schedule.please_input_cron_expression')"/>
<!-- <el-button type="primary" @click="showCronDialog">{{$t('schedule.generate_expression')}}</el-button>-->
<el-button :disabled="isReadOnly" type="primary" @click="saveCron">{{
$t('commons.save')
}}
</el-button>
</el-form-item>
<el-form-item>
<el-link :disabled="isReadOnly" type="primary" @click="showCronDialog">
{{ $t('schedule.generate_expression') }}
</el-link>
</el-form-item>
<crontab-result :ex="form.cronValue" ref="crontabResult"/>
</el-form>
@ -219,4 +233,12 @@ export default {
margin-bottom: 10px;
}
.head {
border-bottom: 1px solid #7C3985;
color: #7C3985;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
font-size: 13px;
cursor: pointer;
}
</style>

View File

@ -46,20 +46,7 @@
<div class="el-step__icon-inner">2</div>
</div>
<span>{{ $t('load_test.runtime_config') }}</span>
<div style="margin-bottom: 10px; margin-top: 10px; ">
<span class="ms-mode-span">{{ $t("commons.environment") }}</span>
<env-popover :project-ids="projectIds"
:placement="'bottom-start'"
:project-list="projectList"
:env-map="runConfig.envMap"
:environment-type.sync="runConfig.environmentType"
:group-id="runConfig.environmentGroupId"
@setEnvGroup="setEnvGroup"
@setProjectEnvMap="setProjectEnvMap"
@showPopover="showPopover"
ref="envPopover" class="env-popover"/>
</div>
<div>
<div class="ms-mode-div">
<span class="ms-mode-span">{{ $t("run_mode.title") }}</span>
<el-radio-group v-model="runConfig.mode" @change="changeMode">
<el-radio label="serial">{{ $t("run_mode.serial") }}</el-radio>
@ -145,7 +132,6 @@ import CrontabResult from "@/business/components/common/cron/CrontabResult";
import {cronValidate} from "@/common/js/cron";
import MsScheduleNotification from "./ScheduleNotification";
import ScheduleSwitch from "@/business/components/api/automation/schedule/ScheduleSwitch";
import EnvPopover from "@/business/components/api/automation/scenario/EnvPopover";
import {ENV_TYPE} from "@/common/js/constants";
function defaultCustomValidate() {
@ -164,7 +150,6 @@ export default {
Crontab,
MsScheduleNotification,
"NoticeTemplate": noticeTemplate.default,
EnvPopover
},
props: {
@ -234,8 +219,6 @@ export default {
onSampleError: false,
runWithinResourcePool: false,
resourcePoolId: null,
envMap: new Map,
environmentGroupId: "",
environmentType: ENV_TYPE.JSON
},
projectList: [],
@ -319,7 +302,6 @@ export default {
listenGoBack(this.close);
this.activeName = 'first';
this.getResourcePools();
this.getWsProjects();
this.runConfig.environmentType = ENV_TYPE.JSON;
},
findSchedule() {
@ -330,9 +312,6 @@ export default {
this.schedule = response.data;
if (response.data.config) {
this.runConfig = JSON.parse(response.data.config);
if (this.runConfig.envMap) {
this.runConfig.envMap = objToStrMap(this.runConfig.envMap);
}
}
} else {
this.schedule = {
@ -457,41 +436,6 @@ export default {
this.runConfig.runWithinResourcePool = false;
this.runConfig.resourcePoolId = null;
},
setProjectEnvMap(projectEnvMap) {
this.runConfig.envMap = strMapToObj(projectEnvMap);
},
setEnvGroup(id) {
this.runConfig.environmentGroupId = id;
},
getWsProjects() {
this.$get("/project/getOwnerProjects", res => {
this.projectList = res.data;
})
},
showPopover() {
this.projectIds.clear();
let param = undefined;
let url = "";
if (this.type === 'apiCase') {
url = '/test/plan/api/case/env';
param = this.planCaseIds;
} else if (this.type === 'apiScenario') {
url = '/test/plan/api/scenario/env';
param = this.planCaseIds;
} else if (this.type === 'plan') {
url = '/test/plan/case/env';
param = {id: this.planId};
}
this.$post(url, param, res => {
let data = res.data;
if (data) {
for (let d in data) {
this.projectIds.add(d);
}
}
this.$refs.envPopover.openEnvSelect();
});
}
},
computed: {
isTesterPermission() {

@ -1 +1 @@
Subproject commit 8ee1df272a1ba3ca6e8ab2ceca227cf1899ccce9
Subproject commit 813801b0e68463394c67779853529a7da1c7fa22

View File

@ -36,7 +36,7 @@ export default {
close_schedule: 'Close Schedule',
open_schedule: 'Start Schedule',
schedule_switch: 'Schedule Switch',
schedule_cron_title: 'Schedule Time Expression',
schedule_cron_title: 'Cron Expression',
review_complete: 'Review Completed',
examples: 'examples',
help_documentation: 'Help',
@ -45,8 +45,8 @@ export default {
delete_cancelled: 'Delete cancelled',
option_cannot_spread_pages: 'This options not support spread pages.Do you want continue?',
workspace: 'Workspace',
space:'Space',
current_workspace:"Current Workspace",
space: 'Space',
current_workspace: "Current Workspace",
organization: 'Organization',
setting: 'Setting',
project: 'Project',

View File

@ -36,7 +36,7 @@ export default {
close_schedule: '关闭定时任务',
open_schedule: '开启定时任务',
schedule_switch: '定时任务开关',
schedule_cron_title: '定时任务时间表达式',
schedule_cron_title: 'Cron表达式',
review_complete: '评审完成',
examples: '示例',
help_documentation: '帮助文档',

View File

@ -36,7 +36,7 @@ export default {
close_schedule: '關閉定時任務',
open_schedule: '開啟定時任務',
schedule_switch: '定時任務開關',
schedule_cron_title: '定時任務時間運算式',
schedule_cron_title: 'Cron運算式',
review_complete: '評審完成',
examples: '示例',
help_documentation: '幫助文檔',
@ -44,8 +44,8 @@ export default {
confirm_delete: '是否刪除',
delete_cancelled: '已取消刪除',
workspace: '工作空間',
space:'空間',
current_workspace:"當前工作空間",
space: '空間',
current_workspace: "當前工作空間",
organization: '組織',
setting: '設置',
project: '項目',