From bfee44c01a3f5f6de96c9dfa1e12cef4700eaf5b Mon Sep 17 00:00:00 2001
From: shikeying <pxzsky@163.com>
Date: 星期二, 11 四月 2023 20:18:12 +0800
Subject: [PATCH] 测试引入的组件列表,修改响应参数

---
 src/views/system/config/index.vue |  138 ++++++++++++++++++++++++++++++----------------
 1 files changed, 90 insertions(+), 48 deletions(-)

diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue
index fcc7efd..07646b4 100644
--- a/src/views/system/config/index.vue
+++ b/src/views/system/config/index.vue
@@ -13,7 +13,7 @@
       <el-form-item label="鍙傛暟閿悕" prop="configKey">
         <el-input
           v-model="queryParams.configKey"
-          placeholder="璇疯緭鍏ュ弬鏁伴敭鍚�"
+          placeholder="璇疯緭鍏ュ弬鏁� KEY"
           clearable
           style="width: 240px"
           @keyup.enter.native="handleQuery"
@@ -102,50 +102,8 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-<!--      <el-table-column label="鍙傛暟涓婚敭" align="center" prop="configId" />-->
-      <el-table-column label="KEY" align="left" prop="config_key" :show-overflow-tooltip="true" />
-      <el-table-column label="VALUE" align="left" prop="config_value" />
-      <el-table-column label="鎻忚堪" align="left" prop="config_name" :show-overflow-tooltip="true" />
-      <el-table-column label="鍐呯疆" align="center" prop="config_type">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.config_type"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="澶囨敞" align="left" prop="remark" :show-overflow-tooltip="true" />
-      <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="create_time" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.create_time) }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:config:edit']"
-          >淇敼</el-button>
-<!--          <el-button-->
-<!--            size="mini"-->
-<!--            type="text"-->
-<!--            icon="el-icon-delete"-->
-<!--            @click="handleDelete(scope.row)"-->
-<!--            v-hasPermi="['system:config:remove']"-->
-<!--          >鍒犻櫎</el-button>-->
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
+    <!--鍒楄〃-->
+    <my-table-v3 ref="myTable" :filter="filterFrom" :table="table" />
 
     <!-- 娣诲姞鎴栦慨鏀瑰弬鏁伴厤缃璇濇 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
@@ -181,9 +139,11 @@
 </template>
 
 <script>
-import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config";
+  import {addConfig, delConfig, getConfig, listConfig, refreshCache, updateConfig} from "@/api/system/config";
+  import myTableV3 from '@/views/components/myTableV3';
 
-export default {
+  export default {
+  components: {myTableV3},
   name: "Config",
   dicts: ['sys_yes_no'],
   data() {
@@ -229,13 +189,90 @@
         config_value: [
           { required: true, message: "鍙傛暟閿�间笉鑳戒负绌�", trigger: "blur" }
         ]
+      },
+
+      /** 鎼滅储鏉′欢*/
+      filterFrom: {
+        title: null
+      },
+
+      table: {
+        showIndex: true, // 鏄惁鏄剧ず搴忓彿
+        expand: false, // 鏄惁鏄剧ず璇︽儏鏁版嵁
+        checkBox: false, // 鏄惁鏄剧ず澶嶉�夋
+        url: globalConf.baseUrl + '/system/config/list', // 璇锋眰鍦板潃
+        // 宸ュ叿鏉�
+        tools: {
+          columnsCtrl: {// 鍒楁帶鍒舵寜閽�
+            show: false
+          },
+          generalExport: {// 閫氱敤瀵煎嚭鎸夐挳
+            show: false
+          },
+          custom: [ // 鑷畾涔夊伐鍏锋潯鎸夐挳
+          ]
+        },
+        columns: [
+          { title: 'KEY', field: 'config_key', align: 'left', width: 190 },
+          { title: 'VALUE', field: 'config_value', align: 'left', width: 200 },
+          { title: '鎻忚堪', field: 'config_name', align: 'left', width: 240 },
+          { title: '鍐呯疆', field: 'config_type', align: 'left', width: 60, formatter: row => {
+              let title = '';
+              switch (row.config_type) {
+                case 'Y':
+                  title = '鏄�'
+                  break
+                case 'N':
+                  title = '鍚�'
+                  break
+              }
+              return { value: title }
+            }
+          },
+          { title: '鍒涘缓鏃堕棿', field: 'create_time', align: 'left', width: 170 },
+          { title: '澶囨敞', field: 'remark', align: 'left', width: 260 }
+        ],
+        // 鎿嶄綔淇℃伅
+        operation: {
+          show: true, // 鏄剧ず鎿嶄綔鍒�
+          width: '100', // 鍒楀
+          attr: [
+            {
+              title: '缂栬緫',
+              checkPermission: 'system:config:edit',
+              events: row => {
+                this.handleUpdate(row)
+              }
+            }
+          ]
+        },
+        paging: {
+          show: true, // 鏄剧ず鍒嗛〉
+          // 鍒嗛〉淇℃伅
+          page: {
+            small: false,
+            pageNum: 1,
+            pageSize: platformPageSize,
+            total: 0
+          }
+        }
       }
     };
   },
+
   created() {
-    this.getList();
+    // this.getList();
   },
   methods: {
+    // 鏌ヨtable鍒楄〃
+    search(pageNum) {
+      if (pageNum != undefined) {
+        this.$refs.myTable.search({ pageNum: pageNum })
+      } else {
+        this.$refs.myTable.search()
+      }
+    },
+
     /** 鏌ヨ鍙傛暟鍒楄〃 */
     getList() {
       this.loading = true;
@@ -337,6 +374,11 @@
       refreshCache().then(() => {
         this.$modal.msgSuccess("鍒锋柊鎴愬姛");
       });
+    },
+
+    /** 鏄剧ず閰嶇疆璇︽儏 */
+    showDetail(row){
+
     }
   }
 };

--
Gitblit v1.9.1