|
|
@@ -46,31 +46,33 @@ |
|
|
|
<el-table-column label="应用名称" align="center" prop="appName" width="250" /> |
|
|
|
<el-table-column label="输出内容" align="center" prop="outParam" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-tag v-if="scope.row.outParam != null && scope.row.outParam.includes('.xlsx')" |
|
|
|
@click="downloadUrl(scope.row.outParam)">下载</el-tag> |
|
|
|
<el-tag v-if="scope.row.outParam != null && scope.row.outParam.includes('.xlsx')" style='cursor:pointer;' |
|
|
|
@click="downloadUrl(scope.row.outParam)">点击下载</el-tag> |
|
|
|
<span v-if="scope.row.outParam != null && !scope.row.outParam.includes('.xlsx')">{{ scope.row.outParam |
|
|
|
}}</span> |
|
|
|
<span v-if="scope.row.outParam == null"> 没有文件</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="调度方式" align="center" prop="planType" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<dict-tag :options="dict.type.plan_type" :value="scope.row.planType" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="机器人名称" align="center" prop="robotName" width="150" /> |
|
|
|
<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"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-popover trigger="hover" placement="top"> |
|
|
|
<el-popover v-if="scope.row.planParams != null" trigger="hover" placement="top"> |
|
|
|
<p> {{ scope.row.planParams }}</p> |
|
|
|
<div slot="reference" class="name-wrapper"> |
|
|
|
<el-tag size="medium">显示参数</el-tag> |
|
|
|
</div> |
|
|
|
</el-popover> |
|
|
|
<span v-if="scope.row.planParams == null">没有参数</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="调度方式" align="center" prop="planType" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<dict-tag :options="dict.type.plan_type" :value="scope.row.planType" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="机器人名称" align="center" prop="robotName" width="150" /> |
|
|
|
<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="waitTimeout" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
@@ -83,7 +85,7 @@ |
|
|
|
<dict-tag :options="dict.type.exc_type" :value="scope.row.excType" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="执行时间" align="center" prop="excTime" width="100" /> |
|
|
|
<el-table-column label="执行时间" align="center" prop="excTime" width="160" /> |
|
|
|
<el-table-column label="执行表达式" align="center" prop="cronExpression" width="100" /> |
|
|
|
<el-table-column label="任务执行状态" align="center" fixed="right" prop="taskStatus" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
@@ -93,20 +95,21 @@ |
|
|
|
<dict-tag :options="dict.type.plan_run_status" :value="scope.row.taskStatus" /> |
|
|
|
</div> |
|
|
|
</el-popover> |
|
|
|
<dict-tag v-if="scope.row.taskStatus != 'error'" :options="dict.type.plan_run_status" :value="scope.row.taskStatus" /> |
|
|
|
<dict-tag v-if="scope.row.taskStatus != 'error'" :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="上次执行时间" align="center" prop="lastExecTime" width="200" /> |
|
|
|
<el-table-column label="下次执行时间" align="center" prop="nextExecTime" width="200" /> |
|
|
|
<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" /> |
|
|
|
<el-table-column label="人工耗时" align="center" fixed="right" prop="manualTime" width="100"> |
|
|
|
<el-table-column label="开始时间" align="center" fixed="right" prop="startTime" width="200" /> |
|
|
|
<el-table-column label="结束时间" align="center" fixed="right" prop="endTime" width="200" /> |
|
|
|
<el-table-column label="人工耗时" align="center" prop="manualTime" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.manualTime != null">{{ scope.row.manualTime }} 分钟</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="实际耗时" align="center" fixed="right" prop="planTime" width="100"> |
|
|
|
<el-table-column label="实际耗时" align="center" prop="planTime" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.planTime != null">{{ scope.row.planTime }} 分钟</span> |
|
|
|
</template> |
|
|
@@ -125,14 +128,17 @@ |
|
|
|
<!-- <el-table-column label="备注" align="center" prop="remark" /> --> |
|
|
|
<el-table-column label="操作" align="center" width="250" fixed="right" class-name="small-padding fixed-width"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<router-link to="/rpa/ctResourceLibrary"> |
|
|
|
<!-- <router-link to="/rpa/ctResourceLibrary"> |
|
|
|
<el-button size="mini" v-if="scope.row.taskStatus == 'await_create'" type="text" icon="el-icon-setting" |
|
|
|
v-hasPermi="['business:ctApplyPlan:edit']">设置参数</el-button> |
|
|
|
</router-link> |
|
|
|
<el-button size="mini" v-if="scope.row.taskStatus == 'stopped' || scope.row.taskStatus == 'error' || scope.row.taskStatus == 'cancel'" type="text" icon="el-icon-refresh" |
|
|
|
@click="appRetry(scope.row)" v-hasPermi="['business:ctApplyPlan:appRetry']">重新运行</el-button> |
|
|
|
<el-button size="mini" v-if="scope.row.taskStatus == 'running'" type="text" icon="el-icon-video-pause" |
|
|
|
@click="stopRun(scope.row)" v-hasPermi="['business:ctApplyPlan:stopRun']">停止运行</el-button> |
|
|
|
</router-link> --> |
|
|
|
<el-button size="mini" |
|
|
|
v-if="scope.row.taskStatus == 'stopped' || scope.row.taskStatus == 'error' || scope.row.taskStatus == 'cancel'" |
|
|
|
type="text" icon="el-icon-refresh" @click="appRetry(scope.row)" |
|
|
|
v-hasPermi="['business:ctApplyPlan:appRetry']">重新运行</el-button> |
|
|
|
<el-button size="mini" v-if="scope.row.taskStatus == 'running' || scope.row.taskStatus == 'waiting'" |
|
|
|
type="text" icon="el-icon-video-pause" @click="stopRun(scope.row)" |
|
|
|
v-hasPermi="['business:ctApplyPlan:stopRun']">停止运行</el-button> |
|
|
|
<el-button size="mini" v-if="scope.row.taskStatus == 'await_create'" type="text" icon="el-icon-edit" |
|
|
|
@click="handleUpdate(scope.row)" v-hasPermi="['business:ctApplyPlan:edit']">修改</el-button> |
|
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" |
|
|
@@ -153,54 +159,27 @@ |
|
|
|
<el-input v-model="form.planName" placeholder="请输入计划名称" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="调度方式" prop="planType"> |
|
|
|
<el-select v-model="form.planType" placeholder="请选择调度方式"> |
|
|
|
<el-option v-for="dict in dict.type.plan_type" :key="dict.value" :label="dict.label" |
|
|
|
:disabled="dict.value == 0" :value="dict.value"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row :gutter="24"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="应用名称" prop="appId"> |
|
|
|
<el-select v-model="form.appId" multiple filterable collapse-tags style="margin-left: 20px;" |
|
|
|
placeholder="请选择机器人"> |
|
|
|
<el-select v-model="form.appId" filterable collapse-tags style="margin-left: 20px;" placeholder="请选择机器人" |
|
|
|
@change="changeApp"> |
|
|
|
<el-option v-for="apply in applyList" :key="apply.appId" :label="apply.appName" :value="apply.appId"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="等待超时时间" prop="waitTimeout"> |
|
|
|
<el-select v-model="form.waitTimeout" placeholder="请选择等待超时时间"> |
|
|
|
<el-option v-for="dict in dict.type.wait_timeout" :key="dict.value" :label="dict.label" |
|
|
|
:value="dict.value"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row :gutter="24"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="优先级" prop="priority"> |
|
|
|
<el-input-number v-model="form.priority" label="请输入预计人工用时"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="执行类型" prop="excType"> |
|
|
|
<el-select v-model="form.excType" placeholder="请选择执行类型"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="如何执行" prop="excType"> |
|
|
|
<el-select v-model="form.excType" placeholder="请选择执行方式"> |
|
|
|
<el-option v-for="dict in dict.type.exc_type" :key="dict.value" :label="dict.label" |
|
|
|
:value="dict.value"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row :gutter="24"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="16"> |
|
|
|
<el-form-item v-if="form.excType == 1" label="执行时间" prop="excTime"> |
|
|
|
<el-date-picker clearable v-model="form.excTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
format="yyyy-MM-dd HH:mm:ss" placeholder="请选择执行时间"> |
|
|
@@ -209,22 +188,44 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<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-input v-model="form.cronExpression" placeholder="请输入cron执行表达式"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col v-if="form.excType == 2" :span="4"> |
|
|
|
<a style="color: royalblue;" href="https://www.pppet.net/" target="_blank">表达式生成地址</a> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="24"> |
|
|
|
<!-- 参数列表 --> |
|
|
|
<el-row :gutter="24" v-if="isParam"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="备注" prop="remark"> |
|
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> |
|
|
|
</el-form-item> |
|
|
|
<el-card class="box-card"> |
|
|
|
<div slot="header" class="clearfix"> |
|
|
|
<span>执行应用需要填写以下内容</span> |
|
|
|
</div> |
|
|
|
<div class="text item"> |
|
|
|
<el-table :data="resourceLibrarieList" style="width: 100%"> |
|
|
|
<el-table-column prop="resource" label="文件描述" /> |
|
|
|
<el-table-column prop="resourceValue" label="文件内容"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<file-upload v-model="scope.row.resourceValue" v-if="scope.row.resourceType == 'file'" /> |
|
|
|
|
|
|
|
<el-input v-if="scope.row.resourceType == null || scope.row.resourceType == 'str'" |
|
|
|
v-model="scope.row.resourceValue" type="text" placeholder="请输入资源内容" /> |
|
|
|
|
|
|
|
<el-input-number v-model="scope.row.resourceValue" :precision="0" |
|
|
|
v-if="scope.row.resourceType == 'int'" placeholder="请输入资源内容"></el-input-number> |
|
|
|
|
|
|
|
<el-input-number v-model="form.resourceValue" :precision="2" |
|
|
|
v-if="scope.row.resourceType == 'float'" placeholder="请输入资源内容"></el-input-number> |
|
|
|
|
|
|
|
<el-switch v-model="scope.row.resourceValue" active-text="真" inactive-text="假" active-value="true" |
|
|
|
v-if="scope.row.resourceType == 'bool'" inactive-value="false" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
@@ -241,7 +242,8 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { listCtApplyPlan, getCtApplyPlan, delCtApplyPlan, addCtApplyPlan, updateCtApplyPlan,stopRun,appRetry } from "@/api/business/ctApplyPlan"; |
|
|
|
import { listCtApplyPlan, getCtApplyPlan, delCtApplyPlan, addCtApplyPlan, updateCtApplyPlan, stopRun, appRetry } from "@/api/business/ctApplyPlan"; |
|
|
|
import { listByAppId } from "@/api/business/ctResourceLibrary"; |
|
|
|
import { listRebotAll } from "@/api/business/ctRebot"; |
|
|
|
import { listApplyAll } from "@/api/business/ctApply"; |
|
|
|
import Crontab from '@/components/Crontab' |
|
|
@@ -293,24 +295,13 @@ export default { |
|
|
|
priority: null, |
|
|
|
}, |
|
|
|
// 表单参数 |
|
|
|
form: {}, |
|
|
|
form: { |
|
|
|
}, |
|
|
|
// 表单校验 |
|
|
|
rules: { |
|
|
|
planName: [ |
|
|
|
{ required: true, message: "计划名称不能为空", trigger: "blur" } |
|
|
|
], |
|
|
|
planType: [ |
|
|
|
{ required: true, message: "执行类型不能为空", trigger: "change" } |
|
|
|
], |
|
|
|
appId: [ |
|
|
|
{ required: true, message: "请选择一个应用", trigger: "change" } |
|
|
|
], |
|
|
|
waitTimeout: [ |
|
|
|
{ required: true, message: "等待超时时间不能为空", trigger: "blur" } |
|
|
|
], |
|
|
|
priority: [ |
|
|
|
{ required: true, message: "优先级不能为空", trigger: "blur" } |
|
|
|
], |
|
|
|
excType: [ |
|
|
|
{ required: true, message: "执行类型不能为空", trigger: "change" } |
|
|
|
], |
|
|
@@ -319,16 +310,30 @@ export default { |
|
|
|
rebotList: [], |
|
|
|
// 应用列表 |
|
|
|
applyList: [], |
|
|
|
// 参数集 |
|
|
|
params: [], |
|
|
|
// 单个参数对象 |
|
|
|
param: {}, |
|
|
|
applyIsParam: false, |
|
|
|
resourceLibrarieList: [], |
|
|
|
// 应用是否需要参数 |
|
|
|
isParam: false, |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
/** 新增计划时选中app */ |
|
|
|
changeApp(newValue) { |
|
|
|
this.isParam = false; |
|
|
|
this.applyList.forEach(e => { |
|
|
|
if (e.appId == newValue && e.supportParam == 1) { |
|
|
|
this.isParam = true; |
|
|
|
listByAppId(newValue).then(res => { |
|
|
|
console.log("res.data", res.data); |
|
|
|
this.resourceLibrarieList = res.data; |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log("this.resourceLibrarieList", this.resourceLibrarieList); |
|
|
|
}, |
|
|
|
/** 停止运行 */ |
|
|
|
stopRun(row) { |
|
|
|
stopRun(row.taskUuid).then(res => { |
|
|
@@ -420,6 +425,7 @@ export default { |
|
|
|
this.reset(); |
|
|
|
this.listAll(); |
|
|
|
this.open = true; |
|
|
|
this.isParam = false; |
|
|
|
this.title = "添加应用执行计划"; |
|
|
|
}, |
|
|
|
/** 修改按钮操作 */ |
|
|
@@ -435,8 +441,17 @@ export default { |
|
|
|
}, |
|
|
|
/** 提交按钮 */ |
|
|
|
submitForm() { |
|
|
|
if (this.form.excType == 1 && this.form.excTime == null) { |
|
|
|
this.$modal.msgError("指定时间执行时间不能为空"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (this.form.excType == 2 && this.form.cronExpression == null) { |
|
|
|
this.$modal.msgError("周期执行表达式不能为空"); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.$refs["form"].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
this.form.resourceLibrarieList = this.resourceLibrarieList; |
|
|
|
if (this.form.id != null) { |
|
|
|
updateCtApplyPlan(this.form).then(response => { |
|
|
|
this.$modal.msgSuccess("修改计划成功"); |
|
|
@@ -487,7 +502,7 @@ export default { |
|
|
|
return prev; |
|
|
|
} |
|
|
|
}, 0); |
|
|
|
console.log("column",column); |
|
|
|
console.log("column", column); |
|
|
|
sums[index] += ' 分钟'; |
|
|
|
} else { |
|
|
|
sums[index] = ''; |
|
|
@@ -513,6 +528,10 @@ export default { |
|
|
|
link.setAttribute("download", name); |
|
|
|
document.body.appendChild(link); |
|
|
|
link.click(); |
|
|
|
}, |
|
|
|
getFileName(fileName) { |
|
|
|
// return fileName.substring(fileName.lastIndexOf("/") +1,fileName.lastIndexOf(".")) |
|
|
|
return fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length) |
|
|
|
} |
|
|
|
} |
|
|
|
}; |