From c9274307f2037d9e5b8d0ba56f5ce7de8909d617 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期四, 21 十月 2021 15:38:26 +0800
Subject: [PATCH] !104 修复在swagger配置类中无法读取到satoken配置文件的问题 Merge pull request !104 from 大灰灰大/satoken
---
ruoyi-ui/src/views/monitor/job/index.vue | 118 +++++++++++++++++++++-------------------------------------
1 files changed, 43 insertions(+), 75 deletions(-)
diff --git a/ruoyi-ui/src/views/monitor/job/index.vue b/ruoyi-ui/src/views/monitor/job/index.vue
index 8924226..a97477b 100644
--- a/ruoyi-ui/src/views/monitor/job/index.vue
+++ b/ruoyi-ui/src/views/monitor/job/index.vue
@@ -13,20 +13,20 @@
<el-form-item label="浠诲姟缁勫悕" prop="jobGroup">
<el-select v-model="queryParams.jobGroup" placeholder="璇烽�夋嫨浠诲姟缁勫悕" clearable size="small">
<el-option
- v-for="dict in jobGroupOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
+ v-for="dict in dict.type.sys_job_group"
+ :key="dict.value"
+ :label="dict.label"
+ :value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="浠诲姟鐘舵��" prop="status">
<el-select v-model="queryParams.status" placeholder="璇烽�夋嫨浠诲姟鐘舵��" clearable size="small">
<el-option
- v-for="dict in statusOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
+ v-for="dict in dict.type.sys_job_status"
+ :key="dict.value"
+ :label="dict.label"
+ :value="dict.value"
/>
</el-select>
</el-form-item>
@@ -95,11 +95,11 @@
<el-table v-loading="loading" :data="jobList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
- <el-table-column label="浠诲姟缂栧彿" align="center" prop="jobId" />
+ <el-table-column label="浠诲姟缂栧彿" width="100" align="center" prop="jobId" />
<el-table-column label="浠诲姟鍚嶇О" align="center" prop="jobName" :show-overflow-tooltip="true" />
<el-table-column label="浠诲姟缁勫悕" align="center" prop="jobGroup">
<template slot-scope="scope">
- <dict-tag :options="jobGroupOptions" :value="scope.row.jobGroup"/>
+ <dict-tag :options="dict.type.sys_job_group" :value="scope.row.jobGroup"/>
</template>
</el-table-column>
<el-table-column label="璋冪敤鐩爣瀛楃涓�" align="center" prop="invokeTarget" :show-overflow-tooltip="true" />
@@ -168,10 +168,10 @@
<el-form-item label="浠诲姟鍒嗙粍" prop="jobGroup">
<el-select v-model="form.jobGroup" placeholder="璇烽�夋嫨">
<el-option
- v-for="dict in jobGroupOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
+ v-for="dict in dict.type.sys_job_group"
+ :key="dict.value"
+ :label="dict.label"
+ :value="dict.value"
></el-option>
</el-select>
</el-form-item>
@@ -225,10 +225,10 @@
<el-form-item label="鐘舵��">
<el-radio-group v-model="form.status">
<el-radio
- v-for="dict in statusOptions"
- :key="dict.dictValue"
- :label="dict.dictValue"
- >{{dict.dictLabel}}</el-radio>
+ v-for="dict in dict.type.sys_job_status"
+ :key="dict.value"
+ :label="dict.value"
+ >{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@@ -240,7 +240,7 @@
</div>
</el-dialog>
- <el-dialog title="Cron琛ㄨ揪寮忕敓鎴愬櫒" :visible.sync="openCron">
+ <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>
@@ -295,12 +295,13 @@
</template>
<script>
-import { listJob, getJob, delJob, addJob, updateJob, exportJob, runJob, changeJobStatus } from "@/api/monitor/job";
+import { listJob, getJob, delJob, addJob, updateJob, runJob, changeJobStatus } from "@/api/monitor/job";
import Crontab from '@/components/Crontab'
export default {
components: { Crontab },
name: "Job",
+ dicts: ['sys_job_group', 'sys_job_status'],
data() {
return {
// 閬僵灞�
@@ -329,10 +330,6 @@
openCron: false,
// 浼犲叆鐨勮〃杈惧紡
expression: "",
- // 浠诲姟缁勫悕瀛楀吀
- jobGroupOptions: [],
- // 鐘舵�佸瓧鍏�
- statusOptions: [],
// 鏌ヨ鍙傛暟
queryParams: {
pageNum: 1,
@@ -359,12 +356,6 @@
},
created() {
this.getList();
- this.getDicts("sys_job_group").then(response => {
- this.jobGroupOptions = response.data;
- });
- this.getDicts("sys_job_status").then(response => {
- this.statusOptions = response.data;
- });
},
methods: {
/** 鏌ヨ瀹氭椂浠诲姟鍒楄〃 */
@@ -378,7 +369,7 @@
},
// 浠诲姟缁勫悕瀛楀吀缈昏瘧
jobGroupFormat(row, column) {
- return this.selectDictLabel(this.jobGroupOptions, row.jobGroup);
+ return this.selectDictLabel(this.dict.type.sys_job_group, row.jobGroup);
},
// 鍙栨秷鎸夐挳
cancel() {
@@ -434,29 +425,21 @@
// 浠诲姟鐘舵�佷慨鏀�
handleStatusChange(row) {
let text = row.status === "0" ? "鍚敤" : "鍋滅敤";
- this.$confirm('纭瑕�"' + text + '""' + row.jobName + '"浠诲姟鍚�?', "璀﹀憡", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }).then(function() {
- return changeJobStatus(row.jobId, row.status);
- }).then(() => {
- this.msgSuccess(text + "鎴愬姛");
- }).catch(function() {
- row.status = row.status === "0" ? "1" : "0";
- });
+ this.$modal.confirm('纭瑕�"' + text + '""' + row.jobName + '"浠诲姟鍚楋紵').then(function() {
+ return changeJobStatus(row.jobId, row.status);
+ }).then(() => {
+ this.$modal.msgSuccess(text + "鎴愬姛");
+ }).catch(function() {
+ row.status = row.status === "0" ? "1" : "0";
+ });
},
/* 绔嬪嵆鎵ц涓�娆� */
handleRun(row) {
- this.$confirm('纭瑕佺珛鍗虫墽琛屼竴娆�"' + row.jobName + '"浠诲姟鍚�?', "璀﹀憡", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }).then(function() {
- return runJob(row.jobId, row.jobGroup);
- }).then(() => {
- this.msgSuccess("鎵ц鎴愬姛");
- }).catch(() => {});
+ this.$modal.confirm('纭瑕佺珛鍗虫墽琛屼竴娆�"' + row.jobName + '"浠诲姟鍚楋紵').then(function() {
+ return runJob(row.jobId, row.jobGroup);
+ }).then(() => {
+ this.$modal.msgSuccess("鎵ц鎴愬姛");
+ }).catch(() => {});
},
/** 浠诲姟璇︾粏淇℃伅 */
handleView(row) {
@@ -501,13 +484,13 @@
if (valid) {
if (this.form.jobId != undefined) {
updateJob(this.form).then(response => {
- this.msgSuccess("淇敼鎴愬姛");
+ this.$modal.msgSuccess("淇敼鎴愬姛");
this.open = false;
this.getList();
});
} else {
addJob(this.form).then(response => {
- this.msgSuccess("鏂板鎴愬姛");
+ this.$modal.msgSuccess("鏂板鎴愬姛");
this.open = false;
this.getList();
});
@@ -518,31 +501,16 @@
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
handleDelete(row) {
const jobIds = row.jobId || this.ids;
- this.$confirm('鏄惁纭鍒犻櫎瀹氭椂浠诲姟缂栧彿涓�"' + jobIds + '"鐨勬暟鎹」?', "璀﹀憡", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }).then(function() {
- return delJob(jobIds);
- }).then(() => {
- this.getList();
- this.msgSuccess("鍒犻櫎鎴愬姛");
- }).catch(() => {});
+ this.$modal.confirm('鏄惁纭鍒犻櫎瀹氭椂浠诲姟缂栧彿涓�"' + jobIds + '"鐨勬暟鎹」锛�').then(function() {
+ return delJob(jobIds);
+ }).then(() => {
+ this.getList();
+ this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ }).catch(() => {});
},
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
handleExport() {
- const queryParams = this.queryParams;
- this.$confirm("鏄惁纭瀵煎嚭鎵�鏈夊畾鏃朵换鍔℃暟鎹」?", "璀﹀憡", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- }).then(() => {
- this.exportLoading = true;
- return exportJob(queryParams);
- }).then(response => {
- this.download(response.msg);
- this.exportLoading = false;
- }).catch(() => {});
+ this.$download.excel('/monitor/job/export', this.queryParams);
}
}
};
--
Gitblit v1.9.3