feat(优化):年培训计划:已确认行的删除按钮、勾选框、批量删除均仅超级管理员可见/可用;提示文案随角色变化
deploy-hxtesting / build-and-deploy (push) Successful in 1m14s

课程管理:canDeleteCourse 超管不限状态/部门(已审核/已发布行可删,确认弹窗文案区分);批量删除按钮超管可见
月培训计划:已发布行的「删除」仅超管可见(普通维护角色仍只能删未发布计划),行内确认弹窗替代原 window.confirm,失败时透出后端文案
Training.vue:canManageTabs 加入 super_admin,纯超管(未兼其他角色)也能进入这三个页面执行删除
This commit is contained in:
runny committed 2026-11-26 17:06:37 +08:00
1 parent a448598df5
commit 2f1cda34da
19 files changed
+589 -278

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
// 校验课程权限 SQL 常量括号配平与占位符数量(2026-11-26 复测根因定位辅助)
const fs = require('fs')
const src = fs.readFileSync('internal/application/repository/training_library.go', 'utf8')
const start = src.indexOf('const courseLibraryPermissionMatchSQL')
const end = src.indexOf('// courseLibraryPermissionCond 组装')
const block = src.slice(start, end)
const parts = []
let i = 0
while (true) {
const q1 = block.indexOf('"', i)
if (q1 < 0) break
let j = q1 + 1
let out = ''
while (j < block.length) {
if (block[j] === '\\') {
out += block[j + 1]
j += 2
continue
}
if (block[j] === '"') break
out += block[j]
j += 1
}
parts.push(out)
i = j + 1
}
const sql = parts.join('')
const opens = (sql.match(/\(/g) || []).length
const closes = (sql.match(/\)/g) || []).length
const qs = (sql.match(/\?/g) || []).length
console.log('opens=', opens, 'closes=', closes, 'placeholders=', qs, 'BALANCED=', opens === closes)
// 括号深度轨迹:定位未闭合位置(深度未回 0 即缺失右括号)
let depth = 0
for (let k = 0; k < sql.length; k++) {
if (sql[k] === '(') depth += 1
if (sql[k] === ')') depth -= 1
}
console.log('final depth =', depth, '(>0 表示缺少右括号)')
// 输出最后 120 个字符,便于人工核对末尾闭合
console.log('--- tail ---')
console.log(sql.slice(-120))
console.log('--- SQL ---')
console.log(sql)