Parcourir la source

完善代码

pull/2/head
lcr il y a 3 mois
Parent
révision
2533b53a51
6 fichiers modifiés avec 71 ajouts et 27 suppressions
  1. +19
    -0
      src/api/business/ctApplyPlan.js
  2. +1
    -1
      src/components/FileUpload/index.vue
  3. +4
    -3
      src/views/business/ctApply/index.vue
  4. +35
    -6
      src/views/business/ctApplyPlan/index.vue
  5. +2
    -1
      src/views/business/ctRebot/index.vue
  6. +10
    -16
      src/views/business/ctResourceLibrary/index.vue

+ 19
- 0
src/api/business/ctApplyPlan.js Voir le fichier

@@ -1,5 +1,24 @@
import request from '@/utils/request'


// 重新运行计划
export function appRetry(jobUuid) {
return request({
url: '/business/ctApplyPlan/appRetry',
method: 'post',
data: {jobUuid}
})
}

// 停止运行计划
export function stopRun(jobUuid) {
return request({
url: '/business/ctApplyPlan/stopRun',
method: 'post',
data: {jobUuid}
})
}

// 查询应用执行计划管理列表
export function listCtApplyPlan(query) {
return request({


+ 1
- 1
src/components/FileUpload/index.vue Voir le fichier

@@ -60,7 +60,7 @@ export default {
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["doc", "xls", "xlsx", "ppt", "txt", "pdf"],
default: () => ["doc", "docx","xls", "xlsx"],
},
// 是否显示提示
isShowTip: {


+ 4
- 3
src/views/business/ctApply/index.vue Voir le fichier

@@ -34,6 +34,7 @@
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleSyn"
v-hasPermi="['business:ctApply:syn']">同步应用数据</el-button>
<span style="color: red;"> 提示:搜索更新并非实时数据,同步为最新数据</span>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@@ -90,9 +91,9 @@
<el-table-column label="应用创建时间" align="center" prop="appCreateTime" width="100" />
<el-table-column label="应用修改时间" align="center" prop="appUpdateTime" width="100" />
<el-table-column label="应用所有者名称" align="center" prop="ownerName" width="120" />
<el-table-column label="应用所有者账号" align="center" prop="ownerAccount" width="200" />
<!-- <el-table-column label="应用所有者账号" align="center" prop="ownerAccount" width="200" />
<el-table-column label="所有者id" align="center" prop="ownerId" width="300" />
<el-table-column label="appid" align="center" prop="appId" width="300" />
<el-table-column label="appid" align="center" prop="appId" width="300" /> -->
<!-- <el-table-column label="部门id" align="center" prop="deptId" width="100" /> -->
<el-table-column label="创建者" align="center" fixed="right" prop="createBy" width="100" />
@@ -107,7 +108,7 @@
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="备注" align="center" prop="remark" width="100" />
<el-table-column label="操作" align="center" width="200" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-if="scope.row.version != '未发版'" size="mini" type="text" icon="el-icon-edit" @click="showConfigTime(scope.row)"


+ 35
- 6
src/views/business/ctApplyPlan/index.vue Voir le fichier

@@ -36,7 +36,7 @@

<el-table v-loading="loading" :data="ctApplyPlanList" @selection-change="handleSelectionChange">
<!-- :summary-method="getSummaries" show-summary -->
<el-table-column type="selection" width="55" align="center" fixed="left" />
<!-- <el-table-column type="selection" width="55" align="center" fixed="left" /> -->
<el-table-column label="序号" width="55" align="center" fixed="left">
<template slot-scope="scope">
{{ scope.$index + 1 }}
@@ -103,7 +103,7 @@
<el-table-column label="结束时间" align="center" fixed="right" prop="endTime" width="100" />
<el-table-column label="人工耗时" align="center" fixed="right" prop="manualTime" width="100">
<template slot-scope="scope">
<span>{{ scope.row.manualTime }} 分钟</span>
<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">
@@ -126,9 +126,13 @@
<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">
<el-button size="mini" v-if="scope.row.taskStatus == 'await_create'" type="text" icon="el-icon-edit"
<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>
<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)"
@@ -237,7 +241,7 @@
</template>

<script>
import { listCtApplyPlan, getCtApplyPlan, delCtApplyPlan, addCtApplyPlan, updateCtApplyPlan } from "@/api/business/ctApplyPlan";
import { listCtApplyPlan, getCtApplyPlan, delCtApplyPlan, addCtApplyPlan, updateCtApplyPlan,stopRun,appRetry } from "@/api/business/ctApplyPlan";
import { listRebotAll } from "@/api/business/ctRebot";
import { listApplyAll } from "@/api/business/ctApply";
import Crontab from '@/components/Crontab'
@@ -249,6 +253,7 @@ export default {
dicts: ['plan_type', 'wait_timeout', , 'exc_type', 'plan_run_status', 'app_param_type'],
data() {
return {
baseUrl: process.env.VUE_APP_BASE_API,
// 是否显示Cron表达式弹出层
openCron: false,
// 传入的表达式
@@ -324,6 +329,20 @@ export default {
this.getList();
},
methods: {
/** 停止运行 */
stopRun(row) {
stopRun(row.taskUuid).then(res => {
this.$modal.msgSuccess("操作成功");
this.getList();
});
},
/** 重新运行 */
appRetry(row) {
appRetry(row.taskUuid).then(res => {
this.$modal.msgSuccess("操作成功");
this.getList();
});
},
/** 查询应用执行计划管理列表 */
getList() {
this.loading = true;
@@ -420,13 +439,13 @@ export default {
if (valid) {
if (this.form.id != null) {
updateCtApplyPlan(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.$modal.msgSuccess("修改计划成功");
this.open = false;
this.getList();
});
} else {
addCtApplyPlan(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.$modal.msgSuccess("创建计划成功");
this.open = false;
this.getList();
});
@@ -468,6 +487,7 @@ export default {
return prev;
}
}, 0);
console.log("column",column);
sums[index] += ' 分钟';
} else {
sums[index] = '';
@@ -485,6 +505,15 @@ export default {
crontabFill(value) {
this.form.cronExpression = value;
},
/**下载文件 */
downloadUrl(url) {
let link = document.createElement("a");
link.style.display = "none";
link.href = this.baseUrl + url;
link.setAttribute("download", name);
document.body.appendChild(link);
link.click();
}
}
};
</script>

+ 2
- 1
src/views/business/ctRebot/index.vue Voir le fichier

@@ -20,6 +20,7 @@
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleSyn"
v-hasPermi="['business:ctRebot:syn']">同步机器人信息</el-button>
<span style="color: red;"> 提示:搜索更新并非实时数据,同步为最新数据</span>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@@ -54,7 +55,7 @@
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark"/>
<!-- <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" type="text" icon="el-icon-edit" @click="handleSyn(scope.row)"


+ 10
- 16
src/views/business/ctResourceLibrary/index.vue Voir le fichier

@@ -2,7 +2,7 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="所属应用名称" prop="appName">
<el-select v-model="form.appId" filterable placeholder="请选择应用">
<el-select v-model="queryParams.appId" filterable placeholder="请选择应用">
<el-option v-for="apply in applyList" :key="apply.appId" :label="apply.appName"
@keyup.enter.native="handleQuery" :value="apply.appId"></el-option>
</el-select>
@@ -20,19 +20,12 @@
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['business:ctResourceLibrary:add']">新增</el-button>
<span style="color: red;"> 提示:该参数跟随计划,修改内容不会影响已经创建的计划</span>
</el-col>
<!-- <el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
v-hasPermi="['business:ctResourceLibrary:edit']">修改</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['business:ctResourceLibrary:remove']">删除</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['business:ctResourceLibrary:export']">导出</el-button>
</el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>

@@ -43,6 +36,12 @@
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="所属应用名称" align="center" prop="appName" width="150" />
<el-table-column label="资源类型" align="center" prop="resourceType" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.app_param_type" :value="scope.row.resourceType" />
</template>
</el-table-column>
<el-table-column label="资源描述" align="center" prop="resource" width="100" />
<el-table-column label="资源内容" align="center" prop="resourceValue" width="100">
<template slot-scope="scope">
@@ -52,13 +51,7 @@
</template>
.xlsx
</el-table-column>
<el-table-column label="资源类型" align="center" prop="resourceType" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.app_param_type" :value="scope.row.resourceType" />
</template>
</el-table-column>
<el-table-column label="资源键" align="center" prop="resourceName" width="100" />
<el-table-column label="所属应用名称" align="center" prop="appName" 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" fixed="right" prop="createBy" width="100" />
@@ -165,6 +158,7 @@ export default {
dicts: ['app_param_type'],
data() {
return {
baseUrl: process.env.VUE_APP_BASE_API,
// 遮罩层
loading: true,
// 选中数组
@@ -336,7 +330,7 @@ export default {
downloadUrl(url) {
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.href = this.baseUrl + url;
link.setAttribute("download", name);
document.body.appendChild(link);
link.click();


Chargement…
Annuler
Enregistrer