Parcourir la source

增加参数

pull/2/head
lcr il y a 5 mois
Parent
révision
96e06f2d5d
2 fichiers modifiés avec 81 ajouts et 74 suppressions
  1. +9
    -13
      src/views/business/ctApply/index.vue
  2. +72
    -61
      src/views/business/ctApplyPlan/index.vue

+ 9
- 13
src/views/business/ctApply/index.vue Voir le fichier

@@ -22,12 +22,7 @@
</el-select>
</el-form-item>
<el-form-item label="部门名称" prop="deptName">
<el-input
v-model="queryParams.deptName"
placeholder="请输入部门名称"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.deptName" placeholder="请输入部门名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -70,18 +65,19 @@
<el-table-column label="版本" align="center" prop="version" width="100" />
<el-table-column label="是否支持应用参数" align="center" prop="supportParam" width="200">
<template slot-scope="scope">
<span v-if="scope.row.supportParam">
</span>
<span v-if="scope.row.supportParam == 0">
</span>
<span v-if="scope.row.supportParam == 1">
</span>
</template>
</el-table-column>
<!-- <el-table-column label="icon图下载地址" align="center" prop="icon" width="200" /> -->
<el-table-column label="预计人工耗时(分钟)" align="center" prop="manualTime" width="100" />
<el-table-column label="部门id" align="center" prop="deptId" width="100"/>
<el-table-column label="部门名称" align="center" prop="deptName" width="100"/>
<el-table-column label="参数" align="center" prop="param" width="150" />
<el-table-column label="预计人工耗时(分钟)" align="center" prop="manualTime" width="150" />
<el-table-column label="部门id" align="center" prop="deptId" width="100" />
<el-table-column label="部门名称" align="center" prop="deptName" width="100" />
<el-table-column label="创建者" align="center" fixed="right" prop="createBy" width="100" />
<el-table-column label="创建时间" align="center" fixed="right" prop="createTime" width="100">
<template slot-scope="scope">
@@ -95,7 +91,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" type="text" icon="el-icon-edit" @click="showConfigTime(scope.row)"
v-hasPermi="['business:ctApply:edit']">设置时间</el-button>


+ 72
- 61
src/views/business/ctApplyPlan/index.vue Voir le fichier

@@ -4,33 +4,18 @@
<el-form-item label="计划名称" prop="planName">
<el-input v-model="queryParams.planName" placeholder="请输入计划名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="执行类型" prop="planType">
<el-select v-model="queryParams.planType" placeholder="请选择执行类型" clearable>
<el-option v-for="dict in dict.type.plan_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="机器人名称" prop="robotName">
<el-input v-model="queryParams.robotName" placeholder="请输入计划执行的机器人名称" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="应用类型名称" prop="appTypeName">
<el-input v-model="queryParams.appTypeName" placeholder="请输入应用类型名称" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="应用名称" prop="appName">
<el-input v-model="queryParams.appName" placeholder="请输入应用名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="appid" prop="appId">
<el-input v-model="queryParams.appId" placeholder="请输入appid" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="执行类型" prop="excType">
<el-select v-model="queryParams.excType" placeholder="请选择执行类型" clearable>
<el-option v-for="dict in dict.type.exc_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="优先级" prop="priority">
<el-input v-model="queryParams.priority" placeholder="请输入优先级" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -67,7 +52,7 @@
</el-table-column>
<el-table-column label="计划名称" align="center" prop="planName" width="100" />
<el-table-column label="应用名称" align="center" prop="appName" width="250" />
<el-table-column label="执行类型" align="center" prop="planType" width="100">
<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>
@@ -83,7 +68,7 @@
</template>
</el-table-column>
<el-table-column label="优先级" align="center" prop="priority" width="100" />
<el-table-column label="执行类型" align="center" prop="excType" width="100">
<el-table-column label="执行类型" align="center" prop="excType" width="200">
<template slot-scope="scope">
<dict-tag :options="dict.type.exc_type" :value="scope.row.excType" />
</template>
@@ -122,6 +107,9 @@
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" width="150" 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)"
v-hasPermi="['business:ctApplyPlan:edit']">设置参数</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)"
@@ -143,8 +131,8 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="执行类型" prop="planType">
<el-select v-model="form.planType" placeholder="请选择执行类型">
<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>
@@ -152,19 +140,7 @@
</el-col>
</el-row>


<el-row :gutter="24">
<!-- <el-col :span="12">
<el-form-item v-if="form.planType == 0" label="机器人名称" prop="robotName">
<el-select v-model="form.robotName" multiple collapse-tags style="margin-left: 20px;"
placeholder="请选择机器人">
<el-option v-for="rebot in rebotList" :key="rebot.robotClientName" :label="rebot.robotClientName"
:value="rebot.robotClientName">
</el-option>
</el-select>
<el-input v-model="form.robotName" placeholder="请输入机器人名称" />
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item label="应用名称" prop="appName">
<el-select v-model="form.appId" multiple filterable collapse-tags style="margin-left: 20px;"
@@ -184,20 +160,6 @@
</el-col>
</el-row>

<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="计划参数" prop="planParams">
<el-input v-model="form.planParams" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>


<el-row :gutter="24">
<el-col :span="12">
@@ -218,8 +180,8 @@
<el-row :gutter="24">
<el-col :span="12">
<el-form-item v-if="form.excType == 1" label="执行时间" prop="excTime">
<el-date-picker clearable v-model="form.excTime" type="date" value-format="yyyy-MM-dd"
placeholder="请选择执行时间">
<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="请选择执行时间">
</el-date-picker>
</el-form-item>
</el-col>
@@ -230,26 +192,63 @@
</el-col>
</el-row>


<!-- <el-row :gutter="24">
<el-col :span="12">

<el-row :gutter="24">
<el-col :span="20">
<el-form-item label="计划参数" prop="planParams">
<el-input v-model="form.planParams" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-col>
<el-col :span="12">

<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-row>
</el-col>
</el-row>
-->



<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>


<!-- 添加参数 -->
<el-dialog title="添加参数" :visible.sync="addParamVisible" width="800px" 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>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="参数键" prop="name">
<el-input v-model="param.name" type="text" placeholder="请输入内容" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="参数值" prop="value">
<el-input v-model="param.value" type="text" placeholder="请输入参数值" />
</el-form-item>
</el-col>
</el-row>

</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" @click="addParam">确 定</el-button>
<el-button @click="addParamVisible = false">取 消</el-button>
</div>
</el-dialog>
</div>
@@ -262,9 +261,11 @@ import { listApplyAll } from "@/api/business/ctApply";

export default {
name: "CtApplyPlan",
dicts: ['plan_type', 'wait_timeout', , 'exc_type', 'plan_run_status'],
dicts: ['plan_type', 'wait_timeout', , 'exc_type', 'plan_run_status','app_param_type'],
data() {
return {
// 添加参数
addParamVisible: false,
// 遮罩层
loading: true,
// 选中数组
@@ -307,13 +308,23 @@ export default {
// 机器人列表
rebotList: [],
// 应用列表
applyList: []
applyList: [],
// 参数集
params:[],
// 单个参数对象
param:{},
};
},
created() {
this.getList();
},
methods: {
// 添加参数
addParam(){
this.params.push(this.param);
this.form.planParams = JSON.stringify(this.params);
this.addParamVisible = false;
},
/** 查询应用执行计划管理列表 */
getList() {
this.loading = true;


Chargement…
Annuler
Enregistrer