|
@@ -30,7 +30,9 @@
|
|
|
{{ props.row.startTime }}~{{ props.row.endTime }}
|
|
|
</template>
|
|
|
</el-table-column> -->
|
|
|
- <el-table-column align="center" min-width="150px" label="cron执行表达式" prop="cronExpression"/>
|
|
|
+ <el-table-column align="center" min-width="150px" label="开始日期cron执行表达式" prop="startCron"/>
|
|
|
+ <el-table-column align="center" min-width="150px" label="结束日期cron执行表达式" prop="endCron"/>
|
|
|
+
|
|
|
<el-table-column align="center" min-width="80px" label="创建人" prop="creater">
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" min-width="150px" label="创建时间" prop="createTime">
|
|
@@ -82,10 +84,20 @@
|
|
|
<el-date-picker value-format="yyyy-MM-dd" :picker-options="setDisabled" v-model="dataForm.endTime" type="date" placeholder="请选择结束时间" style="width: 350px">
|
|
|
</el-date-picker>
|
|
|
</el-form-item> -->
|
|
|
- <el-form-item label="cron表达式" prop="cronExpression">
|
|
|
- <el-input v-model="dataForm.cronExpression" placeholder="请输入cron执行表达式" style="width: 350px">
|
|
|
+ <el-form-item label="开始日期" prop="startCron">
|
|
|
+ <el-input v-model="dataForm.startCron" placeholder="请输入cron执行表达式" style="width: 350px">
|
|
|
<template slot="append">
|
|
|
- <el-button type="primary" @click="handleShowCron">
|
|
|
+ <el-button type="primary" @click="handleShowCronStart">
|
|
|
+ 生成表达式
|
|
|
+ <i class="el-icon-time el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="结束日期" prop="endCron">
|
|
|
+ <el-input v-model="dataForm.endCron" placeholder="请输入cron执行表达式" style="width: 350px">
|
|
|
+ <template slot="append">
|
|
|
+ <el-button type="primary" @click="handleShowCronEnd">
|
|
|
生成表达式
|
|
|
<i class="el-icon-time el-icon--right"></i>
|
|
|
</el-button>
|
|
@@ -108,8 +120,11 @@
|
|
|
<el-button v-else type="primary" @click="updateData">确定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <el-dialog title="Cron表达式生成器" :visible.sync="openCron" append-to-body destroy-on-close class="scrollbar">
|
|
|
- <crontab @hide="openCron=false" @fill="crontabFill" :expression="expression"></crontab>
|
|
|
+ <el-dialog title="开始日期Cron表达式生成器" :visible.sync="openCronStart" append-to-body destroy-on-close class="scrollbar">
|
|
|
+ <crontab @hide="openCronStart=false" @fill="crontabFillStart" :expression="expressionStart"></crontab>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog title="结束日期Cron表达式生成器" :visible.sync="openCronEnd" append-to-body destroy-on-close class="scrollbar">
|
|
|
+ <crontab @hide="openCronEnd=false" @fill="crontabFillEnd" :expression="expressionEnd"></crontab>
|
|
|
</el-dialog>
|
|
|
|
|
|
</div>
|
|
@@ -144,9 +159,11 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
// 是否显示Cron表达式弹出层
|
|
|
- openCron: false,
|
|
|
+ openCronStart: false,
|
|
|
+ openCronEnd: false,
|
|
|
// 传入的表达式
|
|
|
- expression: "",
|
|
|
+ expressionStart: "",
|
|
|
+ expressionEnd: "",
|
|
|
setDisabled: {
|
|
|
disabledDate(time) {
|
|
|
// return time.getTime() > Date.now(); // 可选历史天、可选当前天、不可选未来天
|
|
@@ -169,9 +186,8 @@ export default {
|
|
|
title: '',
|
|
|
imgUrl: '',
|
|
|
activityUrl: '',
|
|
|
- startTime: '',
|
|
|
- endTime: '',
|
|
|
- cronExpression:'',
|
|
|
+ startCron: '',
|
|
|
+ endCron: '',
|
|
|
participants: [],
|
|
|
content: '',
|
|
|
images: [],
|
|
@@ -194,7 +210,10 @@ export default {
|
|
|
{ validator: this.checkEndTime, trigger: 'change' }
|
|
|
],
|
|
|
content: [{ required: true, message: "内容不能为空", trigger: "blur" }],
|
|
|
- cronExpression: [
|
|
|
+ startCron: [
|
|
|
+ { required: true, message: "cron执行表达式不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ endCron: [
|
|
|
{ required: true, message: "cron执行表达式不能为空", trigger: "blur" }
|
|
|
]
|
|
|
},
|
|
@@ -207,13 +226,20 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
/** cron表达式按钮操作 */
|
|
|
- handleShowCron() {
|
|
|
- this.expression = this.dataForm.cronExpression;
|
|
|
- this.openCron = true;
|
|
|
+ handleShowCronStart() {
|
|
|
+ this.expressionStart = this.dataForm.startCron;
|
|
|
+ this.openCronStart = true;
|
|
|
+ },
|
|
|
+ handleShowCronEnd() {
|
|
|
+ this.expressionEnd = this.dataForm.endCron;
|
|
|
+ this.openCronEnd = true;
|
|
|
},
|
|
|
/** 确定后回传值 */
|
|
|
- crontabFill(value) {
|
|
|
- this.dataForm.cronExpression = value;
|
|
|
+ crontabFillStart(value) {
|
|
|
+ this.dataForm.startCron = value;
|
|
|
+ },
|
|
|
+ crontabFillEnd(value) {
|
|
|
+ this.dataForm.endCron = value;
|
|
|
},
|
|
|
//校验开始时间
|
|
|
checkStartTime(rule, value, callback) {
|
|
@@ -287,9 +313,8 @@ export default {
|
|
|
title: '',
|
|
|
imgUrl: '',
|
|
|
activityUrl: '',
|
|
|
- startTime: '',
|
|
|
- endTime: '',
|
|
|
- cronExpression:'',
|
|
|
+ startCron: '',
|
|
|
+ endCron: '',
|
|
|
participants: undefined,
|
|
|
content: '',
|
|
|
images: [],
|