feat: 增加帮助文档跳转

This commit is contained in:
wenyann 2020-08-31 17:40:56 +08:00
parent 98194ab778
commit 8d88ff7f6e
6 changed files with 384 additions and 267 deletions

View File

@ -1,22 +1,92 @@
<template>
<el-dialog width="35%" class="schedule-edit" :title="$t('schedule.edit_timer_task')" :visible.sync="dialogVisible" @close="close">
<div id="app">
<el-dialog :close-on-click-modal="false" width="35%" class="schedule-edit" :visible.sync="dialogVisible"
@close="close">
<template>
<div>
<el-tabs v-model="activeName" @tab-click="handleClick">
<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-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-link :disabled="isReadOnly" type="primary" @click="showCronDialog">
{{$t('schedule.generate_expression')}}
</el-link>
</el-form-item>
<crontab-result :ex="form.cronValue" ref="crontabResult" />
<crontab-result :ex="form.cronValue" ref="crontabResult"/>
</el-form>
<el-dialog :title="$t('schedule.generate_expression')" :visible.sync="showCron" :modal="false">
<crontab @hide="showCron=false" @fill="crontabFill" :expression="schedule.value" ref="crontab"/>
</el-dialog>
</el-tab-pane>
<el-tab-pane :label="$t('schedule.task_notification')" name="second">
<template>
<el-table
:data="tableData"
style="width: 100%">
<el-table-column
prop="event"
:label="$t('schedule.event')"
>
</el-table-column>
<el-table-column
prop="receiver"
:label="$t('schedule.receiver')"
width="200"
>
<template v-slot:default="{row}">
<el-input
size="mini"
type="textarea"
:rows="1"
class="edit-input"
v-model="row.receiver"
:placeholder="$t('schedule.receiver')"
clearable>
</el-input>
</template>
</el-table-column>
<el-table-column
prop="email"
:label="$t('schedule.receiving_mode')"
width="300">
<template v-slot:default="{row}">
<el-input
size="mini"
type="textarea"
:rows="1"
class="edit-input"
v-model="row.email"
:placeholder="$t('schedule.input_email')"
clearable>
</el-input>
</template>
</el-table-column>
<el-table-column
align="center"
:label="$t('schedule.operation')"
show-overflow-tooltip>
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
:active-value="1"
:inactive-value="2"
active-color="#13ce66"
inactive-color="#ff4949"
/>
</template>
</el-table-column>
</el-table>
</template>
</el-tab-pane>
</el-tabs>
</div>
</template>
</el-dialog>
</template>
@ -27,7 +97,9 @@
import {cronValidate} from "../../../../common/js/cron";
import {listenGoBack, removeGoBackListener} from "../../../../common/js/utils";
function defaultCustomValidate() {return {pass: true};}
function defaultCustomValidate() {
return {pass: true};
}
export default {
name: "MsScheduleEdit",
@ -60,24 +132,44 @@
// else if(!this.intervalShortValidate()) {
// callback(new Error(this.$t('schedule.cron_expression_interval_short_error')));
// }
else if (!customValidate.pass){
else if (!customValidate.pass) {
callback(new Error(customValidate.info));
} else {
callback();
}
};
return {
operation: true,
dialogVisible: false,
showCron: false,
form: {
cronValue: ""
},
tableData: [
{
event: '执行成功',
receiver: '',
email: '',
operation: 1
}, {
event: '执行成功',
receiver: '',
email: '',
operation: 2
}
],
email: "",
enable: true,
activeName: 'first',
rules: {
cronValue :[{required: true, validator: validateCron, trigger: 'blur'}],
cronValue: [{required: true, validator: validateCron, trigger: 'blur'}],
}
}
},
methods: {
handleClick() {
},
open() {
this.dialogVisible = true;
this.form.cronValue = this.schedule.value;
@ -92,7 +184,7 @@
showCronDialog() {
this.showCron = true;
},
saveCron () {
saveCron() {
this.$refs['from'].validate((valid) => {
if (valid) {
this.intervalShortValidate();
@ -113,7 +205,7 @@
removeGoBackListener(this.close);
},
intervalShortValidate() {
if (this.getIntervalTime() < 3*60*1000) {
if (this.getIntervalTime() < 3 * 60 * 1000) {
// return false;
this.$info(this.$t('schedule.cron_expression_interval_short_error'));
}

View File

@ -6,8 +6,9 @@
<template v-slot:dropdown>
<el-dropdown-menu>
<el-dropdown-item command="personal">{{$t('commons.personal_information')}}</el-dropdown-item>
<el-dropdown-item command="logout">{{$t('commons.exit_system')}}</el-dropdown-item>
<el-dropdown-item command="about">{{$t('commons.about_us')}} <i class="el-icon-info"/></el-dropdown-item>
<el-dropdown-item command="help">{{$t('commons.help_documentation')}}</el-dropdown-item>
<el-dropdown-item command="logout">{{$t('commons.exit_system')}}</el-dropdown-item>
</el-dropdown-menu>
</template>
@ -54,6 +55,9 @@
case "about":
this.$refs.aboutUs.open();
break;
case "help":
window.location.href = "https://metersphere.io/docs/index.html";
break;
default:
break;
}

View File

@ -109,9 +109,9 @@
</template>
<script>
import MsTableOperatorButton from "../../../common/components/MsTableOperatorButton";
import MsTableOperatorButton from "../../../common/components/MsTableOperatorButton";
export default {
export default {
name: "PerformanceAdvancedConfig",
components: {MsTableOperatorButton},
data() {
@ -242,36 +242,36 @@ export default {
};
},
}
}
}
</script>
<style scoped>
.el-row {
.el-row {
margin-bottom: 10px;
}
}
.edit-input {
.edit-input {
padding-right: 0px;
}
}
.tb-edit .el-textarea {
.tb-edit .el-textarea {
display: none;
}
}
.tb-edit .current-row .el-textarea {
.tb-edit .current-row .el-textarea {
display: block;
}
}
.tb-edit .current-row .el-textarea + span {
.tb-edit .current-row .el-textarea + span {
display: none;
}
}
.el-col {
.el-col {
text-align: left;
}
}
.el-col .el-table {
.el-col .el-table {
align: center;
}
}
</style>

View File

@ -1,5 +1,6 @@
export default {
commons: {
help_documentation: 'Help documentation',
delete_cancelled: 'Delete cancelled',
workspace: 'Workspace',
organization: 'Organization',
@ -805,6 +806,12 @@ export default {
mapping_cannot_be_empty: 'LDAP mapping cannot be empty',
},
schedule: {
input_email: "Please input email account",
event: "event",
receiving_mode: "Receiving mode",
receiver: "Receiver",
operation: "operation",
task_notification: "Task notification",
not_set: "Not Set",
next_execution_time: "Next Execution Time",
edit_timer_task: "Edit Timer Task",

View File

@ -1,5 +1,6 @@
export default {
commons: {
help_documentation: '帮助文档',
delete_cancelled: '已取消删除',
workspace: '工作空间',
organization: '组织',
@ -807,6 +808,12 @@ export default {
password_cannot_be_empty: 'LDAP 密码不能为空',
},
schedule: {
input_email: "请输入邮箱账号",
event: "事件",
receiving_mode: "接收方式",
receiver: "接收人",
operation: "操作",
task_notification: "任务通知",
not_set: "未设置",
test_name: '测试名称',
running_rule: '运行规则',

View File

@ -1,5 +1,6 @@
export default {
commons: {
help_documentation: '幫助文檔',
delete_cancelled: '已取消删除',
workspace: '工作空間',
organization: '組織',
@ -804,6 +805,12 @@ export default {
mapping_cannot_be_empty: 'LDAP 用戶屬性映射不能為空',
},
schedule: {
input_email: "請輸入郵箱帳號",
event: "事件",
receiving_mode: "接收管道",
receiver: "接收人",
operation: "操作",
task_notification: "任務通知",
not_set: "未設置",
next_execution_time: "下次執行時間",
edit_timer_task: "編輯定時任務",