From c8df3f7110ecb3d26078c8499cd8364b4419cd06 Mon Sep 17 00:00:00 2001
From: 李喆(开发组) <lzhe@yxqiche.com>
Date: 星期四, 10 七月 2025 10:57:35 +0800
Subject: [PATCH] 1
---
src/views/wel/index.vue | 50 ++++----------------------------------------------
1 files changed, 4 insertions(+), 46 deletions(-)
diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue
index 0267292..21d7d98 100644
--- a/src/views/wel/index.vue
+++ b/src/views/wel/index.vue
@@ -13,9 +13,6 @@
@refresh-change="refreshChange"
@on-load="onLoad"
@tree-load="treeLoad"
- @row-del="rowDel"
- @row-save="rowSave"
- @row-update="rowUpdate"
@row-click="rowClick"
>
<template #menu-left>
@@ -455,15 +452,6 @@
}
);
},
- rowDel(row, index, done) {
- done(row);
- },
- rowSave (row, done) {
- done(row);
- },
- rowUpdate (row, index, done) {
- done(row);
- },
showEdit(row,done) {
this.modalTitle = "淇敼";
this.modalBox = true;
@@ -484,7 +472,9 @@
}).then(
res => {
this.loading = false;
- this.$refs.crud.rowDel(row);
+ var nodeArr = this.$refs.crud.$refs.table.store.states.lazyTreeNodeMap.value[row.parentId];
+ var arr = nodeArr.filter(item => item.id !== row.id);
+ this.$refs.crud.$refs.table.store.states.lazyTreeNodeMap.value[row.parentId] = arr;
}
);
})
@@ -552,42 +542,10 @@
}).then(
res => {
var children = res.data.data || [];
- this.updateParentNodeChildren(parentId, children);
+ this.$refs.crud.$refs.table.store.states.lazyTreeNodeMap.value[parentId] = [...children];
this.loading = false;
}
);
- },
- updateParentNodeChildren(parentId, newChildren) { //鏂板鐨勬柟娉�
- const updateTree = (nodes) => {
- for (let i = 0; i < nodes.length; i++) {
- if (nodes[i].id === parentId) {
- // 鏇存柊鑺傜偣鏁版嵁
- nodes[i].children = [...newChildren];
- this.data = [...this.data]; // 鏇挎崲椤跺眰寮曠敤
- return true;
- }
- if (Array.isArray(nodes[i].children) && nodes[i].children.length > 0) {
- if (updateTree(nodes[i].children)) {
- return true;
- }
- }
- }
- return false;
- };
- updateTree(this.data);
- // this.upData = JSON.parse(JSON.stringify(this.data));
- // this.data = [];
- // 寮哄埗鍒锋柊
- this.$nextTick(() => {
- this.$refs.crud?.refreshTable();
- // this.data = this.upData;
- // this.option.defaultExpandAll = true;
- });
- // setTimeout(()=> {
- // this.data = this.upData;
- // this.option.defaultExpandAll = true;
- // console.log(this.data,222)
- // },3000)
},
updateLocalTreeNode(nodeData) { //淇敼鐨勬柟娉�
const updateNode = (nodes) => {
--
Gitblit v1.9.3