From 82f1f5d0cf1b51a5d81915e842e01760f404fa74 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期三, 20 十月 2021 13:07:16 +0800
Subject: [PATCH] update 优化xxl-job-admin相关pr代码 增加格式化日志输出与docker镜像

---
 ruoyi-ui/src/views/monitor/job/index.vue |  105 +++++++++++++++++++++-------------------------------
 1 files changed, 42 insertions(+), 63 deletions(-)

diff --git a/ruoyi-ui/src/views/monitor/job/index.vue b/ruoyi-ui/src/views/monitor/job/index.vue
index 03425f7..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>
 
@@ -301,6 +301,7 @@
 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,20 +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() {
-      this.downLoadExcel('/monitor/job/export', this.queryParams);
+      this.$download.excel('/monitor/job/export', this.queryParams);
     }
   }
 };

--
Gitblit v1.9.3