Explorar el Código

修复运行逻辑

pull/2/head
lcr hace 5 meses
padre
commit
76d2c779a6
Se han modificado 1 ficheros con 87 adiciones y 17 borrados
  1. +87
    -17
      src/views/business/ctApplyPlan/index.vue

+ 87
- 17
src/views/business/ctApplyPlan/index.vue Ver fichero

@@ -50,7 +50,7 @@
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="计划名称" align="center" prop="planName" width="100" />
<el-table-column label="计划名称" align="center" prop="planName" width="150" />
<el-table-column label="应用名称" align="center" prop="appName" width="250" />
<el-table-column label="调度方式" align="center" prop="planType" width="100">
<template slot-scope="scope">
@@ -61,7 +61,16 @@
<el-table-column label="应用类型名称" align="center" prop="appTypeName" width="100" />
<el-table-column label="appid" align="center" prop="appId" width="300" />
<el-table-column label="应用类型枚举" align="center" prop="appType" width="100" />
<el-table-column label="计划参数" align="center" prop="planParams" width="100" />
<el-table-column label="计划参数" align="center" prop="planParams" width="100">
<template slot-scope="scope">
<el-popover trigger="hover" placement="top">
<p> {{ scope.row.planParams }}</p>
<div slot="reference" class="name-wrapper">
<el-tag size="medium">显示参数</el-tag>
</div>
</el-popover>
</template>
</el-table-column>
<el-table-column label="等待超时时间" align="center" prop="waitTimeout" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.wait_timeout" :value="scope.row.waitTimeout" />
@@ -80,6 +89,8 @@
<dict-tag :options="dict.type.plan_run_status" :value="scope.row.taskStatus" />
</template>
</el-table-column>
<el-table-column label="上次执行时间" align="center" prop="lastExecTime" width="170" />
<el-table-column label="下次执行时间" align="center" prop="nextExecTime" width="170" />
<el-table-column label="任务运行uuid" align="center" prop="taskUuid" width="300" />
<el-table-column label="开始时间" align="center" fixed="right" prop="startTime" width="100" />
<el-table-column label="结束时间" align="center" fixed="right" prop="endTime" width="100" />
@@ -105,7 +116,7 @@
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" width="150" fixed="right" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" width="200" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" v-if="scope.row.taskStatus == 'await_create' && scope.row.supportParam != 0"
type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
@@ -186,8 +197,15 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="form.excType == 2" label="执行表达式" prop="cronExpression">
<el-input v-model="form.cronExpression" placeholder="请输入执行表达式" />
<el-form-item v-if="form.excType == 2" label="cron表达式" prop="cronExpression">
<el-input v-model="form.cronExpression" placeholder="请输入cron执行表达式">
<template slot="append">
<el-button type="primary" @click="handleShowCron">
生成表达式
<i class="el-icon-time el-icon--right"></i>
</el-button>
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
@@ -200,8 +218,9 @@
</el-col>
<el-col :span="4">
<el-row :gutter="24">
<el-col style="margin-bottom: 10px;" :span="24"><el-button type="primary" size="mini" @click="addParamVisible = true">添加参数</el-button></el-col>
<el-col :span="24"><el-button type="primary" size="mini" @click="form.planParams = ''">清空参数</el-button></el-col>
<el-col style="margin-bottom: 10px;" :span="24"><el-button type="primary" size="mini"
@click="showAddParam">添加参数</el-button></el-col>
<el-col :span="24"><el-button type="primary" size="mini" @click="clearAddParam">清空参数</el-button></el-col>
</el-row>
</el-col>
</el-row>
@@ -219,18 +238,21 @@
</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>

<!-- 添加参数 -->
<el-dialog title="添加参数" :visible.sync="addParamVisible" width="800px" append-to-body>
<!-- 添加参数 -->
<el-dialog title="添加参数" :visible.sync="addParamVisible" width="1000px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="参数类型" prop="type">
<el-select v-model="param.type" placeholder="请选择参数类型">
<el-option v-for="dict in dict.type.app_param_type" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
:value="dict.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
@@ -238,11 +260,32 @@
<el-input v-model="param.name" type="text" placeholder="请输入内容" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col v-if="param.type == null || param.type == 'str'" :span="8">
<el-form-item label="参数值" prop="value">
<el-input v-model="param.value" type="text" placeholder="请输入参数值" />
</el-form-item>
</el-col>
<el-col v-if="param.type == 'int'" :span="8">
<el-form-item label="参数值" prop="value">
<el-input-number v-model="param.value" :precision="0" placeholder="请输入参数值"></el-input-number>
</el-form-item>
</el-col>
<el-col v-if="param.type == 'float'" :span="8">
<el-form-item label="参数值" prop="value">
<el-input-number v-model="param.value" :precision="2" placeholder="请输入参数值"></el-input-number>
</el-form-item>
</el-col>
<el-col v-if="param.type == 'bool'" :span="8">
<el-form-item label="参数值" prop="value">
<el-switch v-model="param.value" active-text="真" inactive-text="假" active-value="true"
inactive-value="false" />
</el-form-item>
</el-col>
<el-col v-if="param.type == 'file'" :span="8">
<el-form-item label="参数值" prop="value">
<file-upload v-model="param.value" />
</el-form-item>
</el-col>
</el-row>

</el-form>
@@ -258,12 +301,19 @@
import { listCtApplyPlan, getCtApplyPlan, delCtApplyPlan, addCtApplyPlan, updateCtApplyPlan } from "@/api/business/ctApplyPlan";
import { listRebotAll } from "@/api/business/ctRebot";
import { listApplyAll } from "@/api/business/ctApply";
import Crontab from '@/components/Crontab'


export default {
components: { Crontab },
name: "CtApplyPlan",
dicts: ['plan_type', 'wait_timeout', , 'exc_type', 'plan_run_status','app_param_type'],
dicts: ['plan_type', 'wait_timeout', , 'exc_type', 'plan_run_status', 'app_param_type'],
data() {
return {
// 是否显示Cron表达式弹出层
openCron: false,
// 传入的表达式
expression: "",
// 添加参数
addParamVisible: false,
// 遮罩层
@@ -310,9 +360,9 @@ export default {
// 应用列表
applyList: [],
// 参数集
params:[],
params: [],
// 单个参数对象
param:{},
param: {},
};
},
created() {
@@ -320,11 +370,22 @@ export default {
},
methods: {
// 添加参数
addParam(){
addParam() {
this.params.push(this.param);
this.form.planParams = JSON.stringify(this.params);
this.addParamVisible = false;
},
// 清空参数
clearAddParam() {
this.form.planParams = ''
this.params = [];
this.param = {};
},
// 打开添加参数
showAddParam() {
this.addParamVisible = true;
this.param = {};
},
/** 查询应用执行计划管理列表 */
getList() {
this.loading = true;
@@ -476,7 +537,16 @@ export default {
});

return sums;
}
},
/** cron表达式按钮操作 */
handleShowCron() {
this.expression = this.form.cronExpression;
this.openCron = true;
},
/** 确定后回传值 */
crontabFill(value) {
this.form.cronExpression = value;
},
}
};
</script>

Cargando…
Cancelar
Guardar