From 5306a45093bd7549dcd864c58bebd8f53b5fe279 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期一, 20 九月 2021 17:53:25 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev --- ruoyi-ui/src/views/monitor/job/index.vue | 64 +++++++++++--------------------- 1 files changed, 22 insertions(+), 42 deletions(-) diff --git a/ruoyi-ui/src/views/monitor/job/index.vue b/ruoyi-ui/src/views/monitor/job/index.vue index 753309e..a3738d6 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> @@ -99,7 +99,7 @@ <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" append-to-body class="scrollbar"> + <el-dialog title="Cron琛ㄨ揪寮忕敓鎴愬櫒" :visible.sync="openCron" append-to-body class="scrollbar" destroy-on-close > <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() { @@ -531,18 +522,7 @@ }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ 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.downLoadExcel('/monitor/job/export', this.queryParams); } } }; -- Gitblit v1.9.3