- 启停后改走 syncTreeData():只替换 fullTree 数据源,不调用 refreshTree (树只渲染到学校层,部门节点不在树上,整树重建只会白丢展开态与滚动位置) - 删掉 .usage-note 上的 background/border/color !important 覆盖,外观交回 iView Alert 组件, 页面只保留 margin-bottom 间距
This commit is contained in:
@@ -195,7 +195,7 @@ async function doDisable(dept: any) {
|
||||
try {
|
||||
await Apis.SysGroup.disable({ pathParams: { id: dept.id } });
|
||||
Message.success("已停用");
|
||||
await reloadData();
|
||||
await syncTreeData();
|
||||
} catch (e: any) {
|
||||
console.warn(e?.message || "停用失败");
|
||||
}
|
||||
@@ -205,18 +205,18 @@ async function doEnable(dept: any) {
|
||||
try {
|
||||
await Apis.SysGroup.enable({ pathParams: { id: dept.id } });
|
||||
Message.success("已启用");
|
||||
await reloadData();
|
||||
await syncTreeData();
|
||||
} catch (e: any) {
|
||||
console.warn(e?.message || "启用失败");
|
||||
}
|
||||
}
|
||||
|
||||
/** 重新取数:有树走树刷新(treeApi 内同步 fullTree),无树自行取 */
|
||||
async function reloadData() {
|
||||
if (showTree.value) {
|
||||
await refTreePanel.value?.refreshTree();
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* 静默同步组树数据:只替换右侧数据源,**不重建左侧 zTree**。<br>
|
||||
* 启停改的是部门自身状态,而树只渲染到学校层,部门节点根本不在树上——
|
||||
* 走 refreshTree 会让整棵树重绘、展开态与滚动位置一起丢失。
|
||||
*/
|
||||
async function syncTreeData() {
|
||||
const full: any[] = (await Apis.SysGroup.getTree()) || [];
|
||||
fullTree.value = cloneDeep(full);
|
||||
}
|
||||
@@ -285,18 +285,9 @@ async function loadSchoolScope() {
|
||||
}
|
||||
}
|
||||
|
||||
/* 面板内顶部的设置说明条:
|
||||
iView 的 type="success" 在当前主题下渲染成灰绿(#D3E0D8),故显式改取主题绿色令牌 */
|
||||
/* 面板内顶部说明条的间距(外观完全交给 iView Alert 自身,不覆写配色) */
|
||||
.usage-note {
|
||||
margin-bottom: 14px;
|
||||
background-color: var(--green-soft, #e9f7ef) !important;
|
||||
border-color: transparent !important;
|
||||
color: var(--text-2, #5a6478) !important;
|
||||
|
||||
:deep(.ivu-alert-icon) {
|
||||
color: var(--green, #20a162);
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 空态 / 无权限等临时提示 */
|
||||
|
||||
Reference in New Issue
Block a user