From 3605994af488c6b7189f35410be8d8998a37696b Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期三, 10 四月 2024 17:09:46 +0800
Subject: [PATCH] 1
---
src/views/console/system/component-classification.vue | 26 +++++++++++++++-----------
1 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/src/views/console/system/component-classification.vue b/src/views/console/system/component-classification.vue
index 19889d3..ed142b3 100644
--- a/src/views/console/system/component-classification.vue
+++ b/src/views/console/system/component-classification.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-04-09 22:18:47
* @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-04-10 10:26:42
+ * @LastEditTime: 2024-04-10 17:07:52
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/system/component-classification.vue
* 鍒嗙被缁存姢
-->
@@ -12,7 +12,7 @@
<el-button @click="del" plain type="danger" :disabled="selection.length == 0">鍒犻櫎</el-button>
</el-header>
<el-main>
- <el-table :data="tableData" style="width: 100%;margin-bottom: 20px;" row-key="id" border default-expand-all lazy :load="tableLoad">
+ <el-table :data="tableData" style="width: 100%;margin-bottom: 20px;" row-key="id" border default-expand-all>
<el-table-column type="selection" width="55" />
<el-table-column prop="name" label="鍒嗙被鍚嶇О" />
<el-table-column prop="icon" label="鍒嗙被鍥炬爣">
@@ -54,8 +54,18 @@
this.queryList()
},
methods: {
- tableLoad(row,treeNode,resolve) {
- resolve(row.children);
+ removeHasChildren(arr) {
+ return arr.map(item => {
+ // 鍒涘缓涓�涓笉鍖呭惈hasChildren鐨勬柊瀵硅薄
+ const newItem = { ...item };
+ delete newItem.hasChildren; // 鍒犻櫎hasChildren瀛楁
+ // 濡傛灉children瀛楁瀛樺湪涓旀槸鏁扮粍锛屽垯閫掑綊澶勭悊children
+ if (Array.isArray(newItem.children)) {
+ newItem.children = this.removeHasChildren(newItem.children);
+ }
+
+ return newItem;
+ });
},
add () {
alert(2)
@@ -65,14 +75,8 @@
},
queryList () {
this.$API.setting.getList.get().then(res => {
- this.tableData = res.data;
- console.log(this.tableData,222)
+ this.tableData = this.removeHasChildren(res.data);
})
- // this.$HTTP.get("/api/blade-system/menu/lazy-list",this.searchData).then(res=> {
- // if(res.code == 200) {
- // this.tableData = res.data;
- // }
- // })
},
table_edit() {
--
Gitblit v1.9.3