From c1c6c1cf3076d0e6dae9f15cc77ece4f42add618 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期五, 10 九月 2021 10:51:40 +0800
Subject: [PATCH] update 将所有 云存储字样 改为 对象存储 避免误解

---
 ruoyi-ui/src/views/monitor/job/index.vue |  171 ++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 110 insertions(+), 61 deletions(-)

diff --git a/ruoyi-ui/src/views/monitor/job/index.vue b/ruoyi-ui/src/views/monitor/job/index.vue
index 01b90c5..73bb375 100644
--- a/ruoyi-ui/src/views/monitor/job/index.vue
+++ b/ruoyi-ui/src/views/monitor/job/index.vue
@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="浠诲姟鍚嶇О" prop="jobName">
         <el-input
           v-model="queryParams.jobName"
@@ -40,6 +40,7 @@
       <el-col :span="1.5">
         <el-button
           type="primary"
+          plain
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
@@ -49,6 +50,7 @@
       <el-col :span="1.5">
         <el-button
           type="success"
+          plain
           icon="el-icon-edit"
           size="mini"
           :disabled="single"
@@ -59,6 +61,7 @@
       <el-col :span="1.5">
         <el-button
           type="danger"
+          plain
           icon="el-icon-delete"
           size="mini"
           :disabled="multiple"
@@ -69,8 +72,10 @@
       <el-col :span="1.5">
         <el-button
           type="warning"
+          plain
           icon="el-icon-download"
           size="mini"
+          :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['monitor:job:export']"
         >瀵煎嚭</el-button>
@@ -78,19 +83,25 @@
       <el-col :span="1.5">
         <el-button
           type="info"
+          plain
           icon="el-icon-s-operation"
           size="mini"
           @click="handleJobLog"
           v-hasPermi="['monitor:job:query']"
         >鏃ュ織</el-button>
       </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <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" :formatter="jobGroupFormat" />
+      <el-table-column label="浠诲姟缁勫悕" align="center" prop="jobGroup">
+        <template slot-scope="scope">
+          <dict-tag :options="jobGroupOptions" :value="scope.row.jobGroup"/>
+        </template>
+      </el-table-column>
       <el-table-column label="璋冪敤鐩爣瀛楃涓�" align="center" prop="invokeTarget" :show-overflow-tooltip="true" />
       <el-table-column label="cron鎵ц琛ㄨ揪寮�" align="center" prop="cronExpression" :show-overflow-tooltip="true" />
       <el-table-column label="鐘舵��" align="center">
@@ -108,17 +119,30 @@
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-caret-right"
-            @click="handleRun(scope.row)"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
             v-hasPermi="['monitor:job:edit']"
-          >鎵ц涓�娆�</el-button>
+          >淇敼</el-button>
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-view"
-            @click="handleView(scope.row)"
-            v-hasPermi="['monitor:job:query']"
-          >璇︾粏</el-button>
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['monitor:job:remove']"
+          >鍒犻櫎</el-button>
+          <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['monitor:job:changeStatus', 'monitor:job:query']">
+            <span class="el-dropdown-link">
+              <i class="el-icon-d-arrow-right el-icon--right"></i>鏇村
+            </span>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item command="handleRun" icon="el-icon-caret-right"
+                v-hasPermi="['monitor:job:changeStatus']">鎵ц涓�娆�</el-dropdown-item>
+              <el-dropdown-item command="handleView" icon="el-icon-view"
+                v-hasPermi="['monitor:job:query']">浠诲姟璇︾粏</el-dropdown-item>
+              <el-dropdown-item command="handleJobLog" icon="el-icon-s-operation"
+                v-hasPermi="['monitor:job:query']">璋冨害鏃ュ織</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
         </template>
       </el-table-column>
     </el-table>
@@ -132,8 +156,8 @@
     />
 
     <!-- 娣诲姞鎴栦慨鏀瑰畾鏃朵换鍔″璇濇 -->
-    <el-dialog :title="title" :visible.sync="open" width="700px">
-      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
         <el-row>
           <el-col :span="12">
             <el-form-item label="浠诲姟鍚嶇О" prop="jobName">
@@ -168,17 +192,16 @@
               <el-input v-model="form.invokeTarget" placeholder="璇疯緭鍏ヨ皟鐢ㄧ洰鏍囧瓧绗︿覆" />
             </el-form-item>
           </el-col>
-          <el-col :span="12">
+          <el-col :span="24">
             <el-form-item label="cron琛ㄨ揪寮�" prop="cronExpression">
-              <el-input v-model="form.cronExpression" placeholder="璇疯緭鍏ron鎵ц琛ㄨ揪寮�" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="鏄惁骞跺彂" prop="concurrent">
-              <el-radio-group v-model="form.concurrent" size="small">
-                <el-radio-button label="0">鍏佽</el-radio-button>
-                <el-radio-button label="1">绂佹</el-radio-button>
-              </el-radio-group>
+              <el-input v-model="form.cronExpression" placeholder="璇疯緭鍏ron鎵ц琛ㄨ揪寮�">
+                <template slot="append">
+                  <el-button type="primary" @click="handleShowCron">
+                    鐢熸垚琛ㄨ揪寮�
+                    <i class="el-icon-time el-icon--right"></i>
+                  </el-button>
+                </template>
+              </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="24">
@@ -190,7 +213,15 @@
               </el-radio-group>
             </el-form-item>
           </el-col>
-          <el-col :span="24">
+          <el-col :span="12">
+            <el-form-item label="鏄惁骞跺彂" prop="concurrent">
+              <el-radio-group v-model="form.concurrent" size="small">
+                <el-radio-button label="0">鍏佽</el-radio-button>
+                <el-radio-button label="1">绂佹</el-radio-button>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
             <el-form-item label="鐘舵��">
               <el-radio-group v-model="form.status">
                 <el-radio
@@ -209,8 +240,12 @@
       </div>
     </el-dialog>
 
+    <el-dialog title="Cron琛ㄨ揪寮忕敓鎴愬櫒" :visible.sync="openCron" append-to-body class="scrollbar">
+      <crontab @hide="openCron=false" @fill="crontabFill" :expression="expression"></crontab>
+    </el-dialog>
+
     <!-- 浠诲姟鏃ュ織璇︾粏 -->
-    <el-dialog title="浠诲姟璇︾粏" :visible.sync="openView" width="700px">
+    <el-dialog title="浠诲姟璇︾粏" :visible.sync="openView" width="700px" append-to-body>
       <el-form ref="form" :model="form" label-width="120px" size="mini">
         <el-row>
           <el-col :span="12">
@@ -238,8 +273,8 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="鏄惁骞跺彂锛�">
-              <div v-if="form.status == 0">鍏佽</div>
-              <div v-else-if="form.status == 1">绂佹</div>
+              <div v-if="form.concurrent == 0">鍏佽</div>
+              <div v-else-if="form.concurrent == 1">绂佹</div>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -259,22 +294,27 @@
   </div>
 </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",
   data() {
     return {
       // 閬僵灞�
       loading: true,
+      // 瀵煎嚭閬僵灞�
+      exportLoading: false,
       // 閫変腑鏁扮粍
       ids: [],
       // 闈炲崟涓鐢�
       single: true,
       // 闈炲涓鐢�
       multiple: true,
+      // 鏄剧ず鎼滅储鏉′欢
+      showSearch: true,
       // 鎬绘潯鏁�
       total: 0,
       // 瀹氭椂浠诲姟琛ㄦ牸鏁版嵁
@@ -285,6 +325,10 @@
       open: false,
       // 鏄惁鏄剧ず璇︾粏寮瑰嚭灞�
       openView: false,
+      // 鏄惁鏄剧ずCron琛ㄨ揪寮忓脊鍑哄眰
+      openCron: false,
+      // 浼犲叆鐨勮〃杈惧紡
+      expression: "",
       // 浠诲姟缁勫悕瀛楀吀
       jobGroupOptions: [],
       // 鐘舵�佸瓧鍏�
@@ -336,10 +380,6 @@
     jobGroupFormat(row, column) {
       return this.selectDictLabel(this.jobGroupOptions, row.jobGroup);
     },
-    // 鐘舵�佸瓧鍏哥炕璇�
-    statusFormat(row, column) {
-      return this.selectDictLabel(this.statusOptions, row.status);
-    },
     // 鍙栨秷鎸夐挳
     cancel() {
       this.open = false;
@@ -375,6 +415,22 @@
       this.single = selection.length != 1;
       this.multiple = !selection.length;
     },
+    // 鏇村鎿嶄綔瑙﹀彂
+    handleCommand(command, row) {
+      switch (command) {
+        case "handleRun":
+          this.handleRun(row);
+          break;
+        case "handleView":
+          this.handleView(row);
+          break;
+        case "handleJobLog":
+          this.handleJobLog(row);
+          break;
+        default:
+          break;
+      }
+    },
     // 浠诲姟鐘舵�佷慨鏀�
     handleStatusChange(row) {
       let text = row.status === "0" ? "鍚敤" : "鍋滅敤";
@@ -398,9 +454,9 @@
           type: "warning"
         }).then(function() {
           return runJob(row.jobId, row.jobGroup);
-        }).then(function() {
+        }).then(() => {
           this.msgSuccess("鎵ц鎴愬姛");
-        }).catch(function() {});
+        }).catch(() => {});
     },
     /** 浠诲姟璇︾粏淇℃伅 */
     handleView(row) {
@@ -409,9 +465,19 @@
         this.openView = true;
       });
     },
+    /** cron琛ㄨ揪寮忔寜閽搷浣� */
+    handleShowCron() {
+      this.expression = this.form.cronExpression;
+      this.openCron = true;
+    },
+    /** 纭畾鍚庡洖浼犲�� */
+    crontabFill(value) {
+      this.form.cronExpression = value;
+    },
     /** 浠诲姟鏃ュ織鍒楄〃鏌ヨ */
-    handleJobLog() {
-      this.$router.push("/job/log");
+    handleJobLog(row) {
+      const jobId = row.jobId || 0;
+      this.$router.push({ path: '/monitor/job-log/index', query: { jobId: jobId } })
     },
     /** 鏂板鎸夐挳鎿嶄綔 */
     handleAdd() {
@@ -435,23 +501,15 @@
         if (valid) {
           if (this.form.jobId != undefined) {
             updateJob(this.form).then(response => {
-              if (response.code === 200) {
-                this.msgSuccess("淇敼鎴愬姛");
-                this.open = false;
-                this.getList();
-              } else {
-                this.msgError(response.msg);
-              }
+              this.msgSuccess("淇敼鎴愬姛");
+              this.open = false;
+              this.getList();
             });
           } else {
             addJob(this.form).then(response => {
-              if (response.code === 200) {
-                this.msgSuccess("鏂板鎴愬姛");
-                this.open = false;
-                this.getList();
-              } else {
-                this.msgError(response.msg);
-              }
+              this.msgSuccess("鏂板鎴愬姛");
+              this.open = false;
+              this.getList();
             });
           }
         }
@@ -469,20 +527,11 @@
         }).then(() => {
           this.getList();
           this.msgSuccess("鍒犻櫎鎴愬姛");
-        }).catch(function() {});
+        }).catch(() => {});
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("鏄惁纭瀵煎嚭鎵�鏈夊畾鏃朵换鍔℃暟鎹」?", "璀﹀憡", {
-          confirmButtonText: "纭畾",
-          cancelButtonText: "鍙栨秷",
-          type: "warning"
-        }).then(function() {
-          return exportJob(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-        }).catch(function() {});
+      this.downLoadExcel('/monitor/job/export', this.queryParams);
     }
   }
 };

--
Gitblit v1.9.3