fix(ui): 统一三中心表格交互并优化企业及配套页面
- 公共表格:统一分组标签、状态开关和危险操作确认,支持防重复提交和失败重试,修复浮层触发组件的 ref 转发。 - 控制台:统一用户和渠道编辑抽屉,修正分组回填与提交格式,对齐系统设置操作区和预约列表。 - 企业中心:调整技能中心页签和窄屏布局,优化质量监控提示栏、效能分析及成本对账,统一消耗明细和审计日志筛选。 - 用户中心及公共页面:优化密钥和消费记录展示,对齐模型超市筛选,统一公开与内嵌客户端下载页。 - 同步多语言文案、组件规范与移动端视口要求。
This commit is contained in:
@@ -119,34 +119,36 @@ export const useUsersData = () => {
|
||||
const manageUser = async (userId, action, record) => {
|
||||
// Trigger loading state to force table re-render
|
||||
setLoading(true);
|
||||
|
||||
const res = await API.post('/api/user/manage', {
|
||||
id: userId,
|
||||
action,
|
||||
});
|
||||
|
||||
const { success, message } = res.data;
|
||||
if (success) {
|
||||
showSuccess(t('操作成功完成!'));
|
||||
const user = res.data.data;
|
||||
|
||||
// Create a new array and new object to ensure React detects changes
|
||||
const newUsers = users.map((u) => {
|
||||
if (u.id === userId) {
|
||||
if (action === 'delete') {
|
||||
return { ...u, DeletedAt: new Date() };
|
||||
}
|
||||
return { ...u, status: user.status, role: user.role };
|
||||
}
|
||||
return u;
|
||||
try {
|
||||
const res = await API.post('/api/user/manage', {
|
||||
id: userId,
|
||||
action,
|
||||
});
|
||||
|
||||
setUsers(newUsers);
|
||||
} else {
|
||||
showError(message);
|
||||
}
|
||||
const { success, message } = res.data;
|
||||
if (success) {
|
||||
showSuccess(t('操作成功完成!'));
|
||||
const user = res.data.data;
|
||||
|
||||
setLoading(false);
|
||||
// Create a new array and new object to ensure React detects changes
|
||||
const newUsers = users.map((u) => {
|
||||
if (u.id === userId) {
|
||||
if (action === 'delete') {
|
||||
return { ...u, DeletedAt: new Date() };
|
||||
}
|
||||
return { ...u, status: user.status, role: user.role };
|
||||
}
|
||||
return u;
|
||||
});
|
||||
|
||||
setUsers(newUsers);
|
||||
} else {
|
||||
showError(message);
|
||||
}
|
||||
return success;
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const resetUserPasskey = async (user) => {
|
||||
@@ -246,10 +248,8 @@ export const useUsersData = () => {
|
||||
};
|
||||
|
||||
const closeEditUser = () => {
|
||||
// The drawer still renders the selected user during its exit animation.
|
||||
setShowEditUser(false);
|
||||
setEditingUser({
|
||||
id: undefined,
|
||||
});
|
||||
};
|
||||
|
||||
// Initialize data on component mount
|
||||
|
||||
Reference in New Issue
Block a user