后端新增: - 新增 LogModule 枚举类,统一管理操作日志模块 - 新增 LogOperationType 枚举类,统一管理操作类型 - 修改 @Log 注解,module 参数改为 LogModule 枚举类型 - 修改 LogAspect 切面,将枚举转换为字符串存储 - 新增 GET /api/v1/school/operation-logs/modules 接口 前端修改: - 新增 logOperationType.ts 常量文件 - 修改 OperationLogView.vue,通过 API 动态获取模块列表 - 修改 school.ts,新增 getOperationLogModules API 数据库修改: - OperationLog 实体新增 requestParams 字段,用于记录请求参数 - 新增 V48 迁移脚本,添加 request_params 字段 重构: - 所有 Controller 中的 @Log 注解改为使用 LogModule 枚举 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
76 lines
2.1 KiB
Python
76 lines
2.1 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
with open('TenantListView.vue', 'r', encoding='utf-8') as f:
|
|
content = f.read()
|
|
|
|
# 找到 handleModalOk 函数中的 catch 块并修改
|
|
old_catch = ''' } catch (error: any) {
|
|
message.error(error.response?.data?.message || '操作失败');
|
|
} finally {
|
|
modalLoading.value = false;
|
|
}
|
|
};'''
|
|
|
|
new_catch = ''' } catch (error: any) {
|
|
// 处理错误码 3102 - 套餐下有排课计划
|
|
if (error.response?.data?.code === 3102) {
|
|
const warnings = error.response.data.data as Array<{
|
|
collectionId: number;
|
|
collectionName: string;
|
|
scheduleCount: number;
|
|
}>;
|
|
// 保存当前表单数据
|
|
pendingFormData.value = {
|
|
...formData,
|
|
startDate,
|
|
expireDate,
|
|
};
|
|
// 显示强制移除确认弹窗
|
|
forceRemoveWarnings.value = warnings;
|
|
forceRemoveModalVisible.value = true;
|
|
modalLoading.value = false;
|
|
return;
|
|
}
|
|
message.error(error.response?.data?.message || '操作失败');
|
|
} finally {
|
|
modalLoading.value = false;
|
|
}
|
|
};
|
|
|
|
// 强制移除确认弹窗 - 确认
|
|
const handleForceRemoveConfirm = async () => {
|
|
if (!pendingFormData.value || !editingId.value) {
|
|
return;
|
|
}
|
|
|
|
modalLoading.value = true;
|
|
try {
|
|
// 传递 forceRemove: true 重新调用更新接口
|
|
await updateTenant(editingId.value, { ...pendingFormData.value, forceRemove: true } as UpdateTenantDto);
|
|
message.success('更新成功');
|
|
modalVisible.value = false;
|
|
forceRemoveModalVisible.value = false;
|
|
pendingFormData.value = null;
|
|
loadData();
|
|
} catch (error: any) {
|
|
message.error(error.response?.data?.message || '操作失败');
|
|
} finally {
|
|
modalLoading.value = false;
|
|
}
|
|
};
|
|
|
|
// 强制移除确认弹窗 - 取消
|
|
const handleForceRemoveCancel = () => {
|
|
forceRemoveModalVisible.value = false;
|
|
pendingFormData.value = null;
|
|
forceRemoveWarnings.value = [];
|
|
};'''
|
|
|
|
content = content.replace(old_catch, new_catch)
|
|
|
|
with open('TenantListView.vue', 'w', encoding='utf-8') as f:
|
|
f.write(content)
|
|
|
|
print('修改成功')
|