From a209b39552d0a360bd5b29af6b6cb58265f9669b Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期四, 10 六月 2021 22:29:13 +0800
Subject: [PATCH] 分页组件新增pagerCount属性

---
 ruoyi-ui/src/views/monitor/job/index.vue |   57 +++++++++++++++++++++++++++++++--------------------------
 1 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/ruoyi-ui/src/views/monitor/job/index.vue b/ruoyi-ui/src/views/monitor/job/index.vue
index 7c01fd7..c8fcd6d 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,12 +83,14 @@
       <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">
@@ -110,7 +117,7 @@
             type="text"
             icon="el-icon-caret-right"
             @click="handleRun(scope.row)"
-            v-hasPermi="['monitor:job:edit']"
+            v-hasPermi="['monitor:job:changeStatus']"
           >执行一次</el-button>
           <el-button
             size="mini"
@@ -132,8 +139,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="700px" 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">
@@ -210,7 +217,7 @@
     </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 +245,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">
@@ -268,12 +275,16 @@
     return {
       // 遮罩层
       loading: true,
+      // 导出遮罩层
+      exportLoading: false,
       // 选中数组
       ids: [],
       // 非单个禁用
       single: true,
       // 非多个禁用
       multiple: true,
+      // 显示搜索条件
+      showSearch: true,
       // 总条数
       total: 0,
       // 定时任务表格数据
@@ -397,9 +408,9 @@
           type: "warning"
         }).then(function() {
           return runJob(row.jobId, row.jobGroup);
-        }).then(function() {
+        }).then(() => {
           this.msgSuccess("执行成功");
-        }).catch(function() {});
+        }).catch(() => {});
     },
     /** 任务详细信息 */
     handleView(row) {
@@ -434,23 +445,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();
             });
           }
         }
@@ -468,7 +471,7 @@
         }).then(() => {
           this.getList();
           this.msgSuccess("删除成功");
-        }).catch(function() {});
+        }).catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
@@ -477,11 +480,13 @@
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"
-        }).then(function() {
+        }).then(() => {
+          this.exportLoading = true;
           return exportJob(queryParams);
         }).then(response => {
           this.download(response.msg);
-        }).catch(function() {});
+          this.exportLoading = false;
+        }).catch(() => {});
     }
   }
 };

--
Gitblit v1.9.2