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/system/post/index.vue |   72 ++++++++++++++---------------------
 1 files changed, 29 insertions(+), 43 deletions(-)

diff --git a/ruoyi-ui/src/views/system/post/index.vue b/ruoyi-ui/src/views/system/post/index.vue
index 6532355..8f823f3 100644
--- a/ruoyi-ui/src/views/system/post/index.vue
+++ b/ruoyi-ui/src/views/system/post/index.vue
@@ -22,10 +22,10 @@
       <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_normal_disable"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
           />
         </el-select>
       </el-form-item>
@@ -74,6 +74,7 @@
           plain
           icon="el-icon-download"
           size="mini"
+          :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['system:post:export']"
         >瀵煎嚭</el-button>
@@ -87,7 +88,11 @@
       <el-table-column label="宀椾綅缂栫爜" align="center" prop="postCode" />
       <el-table-column label="宀椾綅鍚嶇О" align="center" prop="postName" />
       <el-table-column label="宀椾綅鎺掑簭" align="center" prop="postSort" />
-      <el-table-column label="鐘舵��" align="center" prop="status" :formatter="statusFormat" />
+      <el-table-column label="鐘舵��" align="center" prop="status">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
+        </template>
+      </el-table-column>
       <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.createTime) }}</span>
@@ -112,7 +117,7 @@
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -136,10 +141,10 @@
         <el-form-item label="宀椾綅鐘舵��" prop="status">
           <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_normal_disable"
+              :key="dict.value"
+              :label="dict.value"
+            >{{dict.label}}</el-radio>
           </el-radio-group>
         </el-form-item>
         <el-form-item label="澶囨敞" prop="remark">
@@ -155,14 +160,17 @@
 </template>
 
 <script>
-import { listPost, getPost, delPost, addPost, updatePost, exportPost } from "@/api/system/post";
+import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post";
 
 export default {
   name: "Post",
+  dicts: ['sys_normal_disable'],
   data() {
     return {
       // 閬僵灞�
       loading: true,
+      // 瀵煎嚭閬僵灞�
+      exportLoading: false,
       // 閫変腑鏁扮粍
       ids: [],
       // 闈炲崟涓鐢�
@@ -179,8 +187,6 @@
       title: "",
       // 鏄惁鏄剧ず寮瑰嚭灞�
       open: false,
-      // 鐘舵�佹暟鎹瓧鍏�
-      statusOptions: [],
       // 鏌ヨ鍙傛暟
       queryParams: {
         pageNum: 1,
@@ -207,9 +213,6 @@
   },
   created() {
     this.getList();
-    this.getDicts("sys_normal_disable").then(response => {
-      this.statusOptions = response.data;
-    });
   },
   methods: {
     /** 鏌ヨ宀椾綅鍒楄〃 */
@@ -220,10 +223,6 @@
         this.total = response.total;
         this.loading = false;
       });
-    },
-    // 宀椾綅鐘舵�佸瓧鍏哥炕璇�
-    statusFormat(row, column) {
-      return this.selectDictLabel(this.statusOptions, row.status);
     },
     // 鍙栨秷鎸夐挳
     cancel() {
@@ -280,13 +279,13 @@
         if (valid) {
           if (this.form.postId != undefined) {
             updatePost(this.form).then(response => {
-              this.msgSuccess("淇敼鎴愬姛");
+              this.$modal.msgSuccess("淇敼鎴愬姛");
               this.open = false;
               this.getList();
             });
           } else {
             addPost(this.form).then(response => {
-              this.msgSuccess("鏂板鎴愬姛");
+              this.$modal.msgSuccess("鏂板鎴愬姛");
               this.open = false;
               this.getList();
             });
@@ -297,30 +296,17 @@
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
     handleDelete(row) {
       const postIds = row.postId || this.ids;
-      this.$confirm('鏄惁纭鍒犻櫎宀椾綅缂栧彿涓�"' + postIds + '"鐨勬暟鎹」?', "璀﹀憡", {
-          confirmButtonText: "纭畾",
-          cancelButtonText: "鍙栨秷",
-          type: "warning"
-        }).then(function() {
-          return delPost(postIds);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("鍒犻櫎鎴愬姛");
-        })
+      this.$modal.confirm('鏄惁纭鍒犻櫎宀椾綅缂栧彿涓�"' + postIds + '"鐨勬暟鎹」锛�').then(function() {
+        return delPost(postIds);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+      }).catch(() => {});
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('鏄惁纭瀵煎嚭鎵�鏈夊矖浣嶆暟鎹」?', "璀﹀憡", {
-          confirmButtonText: "纭畾",
-          cancelButtonText: "鍙栨秷",
-          type: "warning"
-        }).then(function() {
-          return exportPost(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-        })
+      this.$download.excel('/system/post/export', this.queryParams);
     }
   }
 };
-</script>
\ No newline at end of file
+</script>

--
Gitblit v1.9.3