|
@@ -5,20 +5,16 @@
|
|
class="dialog"
|
|
class="dialog"
|
|
title="修改任务内容"
|
|
title="修改任务内容"
|
|
:visible.sync="dialogVisible"
|
|
:visible.sync="dialogVisible"
|
|
- width="470px"
|
|
|
|
|
|
+ width="480px"
|
|
|
|
+ height="400px"
|
|
|
|
+ left
|
|
>
|
|
>
|
|
<el-divider></el-divider>
|
|
<el-divider></el-divider>
|
|
- <el-form
|
|
|
|
- ref="form"
|
|
|
|
- :model="form"
|
|
|
|
- label-position="left"
|
|
|
|
- label-width="75px"
|
|
|
|
- >
|
|
|
|
- <el-form-item label="任务名称:" prop="name">
|
|
|
|
|
|
+ <el-form ref="form" label-position="left" label-width="75px">
|
|
|
|
+ <el-form-item label="任务名称:">
|
|
<el-input v-model="form.name"></el-input>
|
|
<el-input v-model="form.name"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="任务组名:" prop="groupName">
|
|
|
|
- <!-- <el-input v-model="form.groupName"></el-input> -->
|
|
|
|
|
|
+ <el-form-item label="任务组名:">
|
|
<el-select v-model="form.groupName" placeholder="请输入任务组名">
|
|
<el-select v-model="form.groupName" placeholder="请输入任务组名">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in taskGroupOptions"
|
|
v-for="item in taskGroupOptions"
|
|
@@ -28,7 +24,7 @@
|
|
></el-option>
|
|
></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="调用方法:" prop="method">
|
|
|
|
|
|
+ <el-form-item label="调用方法:">
|
|
<div style="display: flex">
|
|
<div style="display: flex">
|
|
<el-tooltip effect="light" content="提示信息" placement="top-start">
|
|
<el-tooltip effect="light" content="提示信息" placement="top-start">
|
|
<i class="el-icon-question" style="padding: 13px 5px 0 0"></i>
|
|
<i class="el-icon-question" style="padding: 13px 5px 0 0"></i>
|
|
@@ -36,11 +32,7 @@
|
|
<el-input class="method" v-model="form.method"></el-input>
|
|
<el-input class="method" v-model="form.method"></el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item
|
|
|
|
- label-width="90px"
|
|
|
|
- label="cron表达式:"
|
|
|
|
- prop="cron_expression"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-form-item label-width="100px" label="cron表达式:">
|
|
<el-input
|
|
<el-input
|
|
class="cron_xepression"
|
|
class="cron_xepression"
|
|
v-model="form.cron_expression"
|
|
v-model="form.cron_expression"
|
|
@@ -49,12 +41,14 @@
|
|
<el-button
|
|
<el-button
|
|
type="text"
|
|
type="text"
|
|
style="margin: 0px 0 0 330px; color: #2ea8e6"
|
|
style="margin: 0px 0 0 330px; color: #2ea8e6"
|
|
- @click="innerVisible = true"
|
|
|
|
|
|
+ @click="showDialog"
|
|
>生成表达式</el-button
|
|
>生成表达式</el-button
|
|
>
|
|
>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer">
|
|
<div slot="footer">
|
|
- <el-button @click="resetForm('form')">重置</el-button>
|
|
|
|
|
|
+ <el-button style="background: #2ea8e6" @click="resetForm('form')"
|
|
|
|
+ >重置</el-button
|
|
|
|
+ >
|
|
<el-button
|
|
<el-button
|
|
style="background: #2ea8e6"
|
|
style="background: #2ea8e6"
|
|
type="primary"
|
|
type="primary"
|
|
@@ -66,86 +60,17 @@
|
|
v-dialog-drag
|
|
v-dialog-drag
|
|
class="innerDialog"
|
|
class="innerDialog"
|
|
title="cron 表达式生成器"
|
|
title="cron 表达式生成器"
|
|
- :visible.sync="innerVisible"
|
|
|
|
- width="600px"
|
|
|
|
|
|
+ :visible.sync="showCron"
|
|
|
|
+ width="30%"
|
|
append-to-body
|
|
append-to-body
|
|
>
|
|
>
|
|
<el-divider></el-divider>
|
|
<el-divider></el-divider>
|
|
- <div style="width: 95%; margin: 20px 0 0 2.5%">
|
|
|
|
- <el-tabs v-model="activeName" type="border-card">
|
|
|
|
- <el-tab-pane label="秒"></el-tab-pane>
|
|
|
|
- <el-tab-pane label="分钟" name="min">
|
|
|
|
- <el-form ref="innerForm1" :model="innerForm1">
|
|
|
|
- <el-form-item>
|
|
|
|
- <el-radio-group v-model="radio">
|
|
|
|
- <el-radio :label="1">秒,允许的通配符[,...*/]</el-radio>
|
|
|
|
- <el-radio :label="2">
|
|
|
|
- 周期从
|
|
|
|
- <span slot="num1"
|
|
|
|
- ><el-input-number
|
|
|
|
- v-model="num1"
|
|
|
|
- :min="1"
|
|
|
|
- :max="59"
|
|
|
|
- ></el-input-number
|
|
|
|
- ></span>
|
|
|
|
- <span>至</span>
|
|
|
|
- <span slot="num2"
|
|
|
|
- ><el-input-number
|
|
|
|
- v-model="num2"
|
|
|
|
- :min="1"
|
|
|
|
- :max="59"
|
|
|
|
- ></el-input-number
|
|
|
|
- ></span>
|
|
|
|
- <span>秒</span>
|
|
|
|
- </el-radio>
|
|
|
|
- <el-radio :label="3">
|
|
|
|
- 从
|
|
|
|
- <span slot="num1"
|
|
|
|
- ><el-input-number
|
|
|
|
- v-model="num1"
|
|
|
|
- :min="1"
|
|
|
|
- :max="59"
|
|
|
|
- ></el-input-number
|
|
|
|
- ></span>
|
|
|
|
- <span>秒开始,每</span>
|
|
|
|
- <span slot="num2"
|
|
|
|
- ><el-input-number
|
|
|
|
- v-model="num2"
|
|
|
|
- :min="1"
|
|
|
|
- :max="59"
|
|
|
|
- ></el-input-number
|
|
|
|
- ></span>
|
|
|
|
- <span>秒执行一次</span>
|
|
|
|
- </el-radio>
|
|
|
|
- <el-radio :label="4">
|
|
|
|
- 指定
|
|
|
|
- <span>
|
|
|
|
- <el-select placeholder="请选择">
|
|
|
|
- <el-option> </el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </span>
|
|
|
|
- </el-radio>
|
|
|
|
- </el-radio-group>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- </el-tab-pane>
|
|
|
|
- <el-tab-pane label="小时"></el-tab-pane>
|
|
|
|
- <el-tab-pane label="日"></el-tab-pane>
|
|
|
|
- <el-tab-pane label="周"></el-tab-pane>
|
|
|
|
- <el-tab-pane label="月"></el-tab-pane>
|
|
|
|
- <el-tab-pane label="年"></el-tab-pane>
|
|
|
|
- </el-tabs>
|
|
|
|
- </div>
|
|
|
|
- <el-form ref="innerForm2" :model="innerForm2"> </el-form>
|
|
|
|
- <div>
|
|
|
|
- <el-scrollbar style="height: 100%">
|
|
|
|
- <el-form ref="innerForm3" :model="innerForm3"> </el-form>
|
|
|
|
- </el-scrollbar>
|
|
|
|
- </div>
|
|
|
|
- <div slot="footer">
|
|
|
|
- <el-button @click="resetForm('form')">重置</el-button>
|
|
|
|
- <el-button @click="innerVisible = false">取消</el-button>
|
|
|
|
- <el-button type="primary" @click="submitForm('form')">确认</el-button>
|
|
|
|
|
|
+ <div style="width: 100%; height: 100%; overflow-y: auto">
|
|
|
|
+ <vabCron
|
|
|
|
+ @hide="showCron = false"
|
|
|
|
+ @fill="crontabFill"
|
|
|
|
+ :expression="expression"
|
|
|
|
+ ></vabCron>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -153,47 +78,72 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import vabCron from "vab-cron";
|
|
export default {
|
|
export default {
|
|
|
|
+ components: { vabCron },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ expression: "",
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
- innerVisible: false,
|
|
|
|
|
|
+ showCron: false,
|
|
activeName: "min",
|
|
activeName: "min",
|
|
radio: 2,
|
|
radio: 2,
|
|
num1: 1,
|
|
num1: 1,
|
|
num2: 1,
|
|
num2: 1,
|
|
form: {
|
|
form: {
|
|
name: "",
|
|
name: "",
|
|
- groupName: "",
|
|
|
|
|
|
+ groupName: 0,
|
|
method: "",
|
|
method: "",
|
|
cron_expression: "",
|
|
cron_expression: "",
|
|
|
|
+ assignValue: "",
|
|
|
|
+ minitesValue: 1,
|
|
},
|
|
},
|
|
innerForm1: {},
|
|
innerForm1: {},
|
|
innerForm2: {},
|
|
innerForm2: {},
|
|
innerForm3: {},
|
|
innerForm3: {},
|
|
|
|
+ minitesOptions: [],
|
|
|
|
+ secondsOptions: [],
|
|
|
|
+ hoursOptions: [],
|
|
taskGroupOptions: [
|
|
taskGroupOptions: [
|
|
{
|
|
{
|
|
- value: "0",
|
|
|
|
|
|
+ value: 0,
|
|
label: "全部",
|
|
label: "全部",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- value: "1",
|
|
|
|
|
|
+ value: 1,
|
|
label: "系统",
|
|
label: "系统",
|
|
},
|
|
},
|
|
- {
|
|
|
|
- value: "2",
|
|
|
|
- label: "默认",
|
|
|
|
- },
|
|
|
|
],
|
|
],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ mounted() {
|
|
|
|
+ this.initData();
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ crontabFill(value) {
|
|
|
|
+ this.form.cron_expression = value;
|
|
|
|
+ this.showCron = false;
|
|
|
|
+ },
|
|
|
|
+ showDialog() {
|
|
|
|
+ this.expression = this.form.cron_expression;
|
|
|
|
+ this.showCron = true;
|
|
|
|
+ },
|
|
|
|
+ initData() {
|
|
|
|
+ this.minitesOptions = [];
|
|
|
|
+ for (let i = 1; i < 60; i++) {
|
|
|
|
+ this.minitesOptions.push({
|
|
|
|
+ value: i,
|
|
|
|
+ label: i < 10 ? "0" + i : i,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
handleNodeClick() {},
|
|
handleNodeClick() {},
|
|
cronExpression() {
|
|
cronExpression() {
|
|
this.$refs.cron_expression.dialogVisible = true;
|
|
this.$refs.cron_expression.dialogVisible = true;
|
|
},
|
|
},
|
|
resetForm(formName) {
|
|
resetForm(formName) {
|
|
- this.$refs[formName].resetFields();
|
|
|
|
|
|
+ this.form.cron_expression = "";
|
|
|
|
+ this.form.groupName = 0;
|
|
},
|
|
},
|
|
submitForm(formName) {
|
|
submitForm(formName) {
|
|
this.$refs[formName].validate((valid) => {
|
|
this.$refs[formName].validate((valid) => {
|
|
@@ -207,7 +157,7 @@ export default {
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
/deep/.el-dialog {
|
|
/deep/.el-dialog {
|
|
- height: 500px !important;
|
|
|
|
|
|
+ // height: 480px !important;
|
|
}
|
|
}
|
|
|
|
|
|
.el-radio {
|
|
.el-radio {
|
|
@@ -251,17 +201,15 @@ export default {
|
|
|
|
|
|
.cron_xepression {
|
|
.cron_xepression {
|
|
/deep/.el-input__inner {
|
|
/deep/.el-input__inner {
|
|
- width: 285px !important;
|
|
|
|
|
|
+ width: 275px !important;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-/deep/.el-dialog {
|
|
|
|
- height: 30vh;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/deep/.el-dialog__header {
|
|
/deep/.el-dialog__header {
|
|
|
|
+ padding-bottom: 0;
|
|
|
|
+ color: #333333;
|
|
text-align: left;
|
|
text-align: left;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -286,7 +234,6 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
/deep/.el-dialog__footer {
|
|
/deep/.el-dialog__footer {
|
|
- margin-top: 60px;
|
|
|
|
text-align: center;
|
|
text-align: center;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -297,12 +244,12 @@ export default {
|
|
margin: 30px;
|
|
margin: 30px;
|
|
padding: 5px;
|
|
padding: 5px;
|
|
&:nth-child(1) {
|
|
&:nth-child(1) {
|
|
- background: #b3b3b3;
|
|
|
|
|
|
+ background: #2ea8e6;
|
|
color: #fff;
|
|
color: #fff;
|
|
}
|
|
}
|
|
&:nth-child(2) {
|
|
&:nth-child(2) {
|
|
color: #fff;
|
|
color: #fff;
|
|
- background: #b3b3b3;
|
|
|
|
|
|
+ background: #2ea8e6;
|
|
}
|
|
}
|
|
&:nth-child(3) {
|
|
&:nth-child(3) {
|
|
background: #2ea8e6;
|
|
background: #2ea8e6;
|