feat(app): 基石应用删除解禁——MyConfirm 同步 projman 删除模(输名确认+红色确认键),删除一律危险确认;基石模块/推送仍置灰
build / build (push) Successful in 3m47s

This commit is contained in:
chenxing
2026-09-29 15:26:25 +08:00
parent e034b947e5
commit ec53c34b9c
4 changed files with 57 additions and 16 deletions
+13 -6
View File
@@ -181,13 +181,14 @@ const columns = [
width: 280,
render: (h: any, { row }: any) => {
// SCHOOL 模式:仅编辑(名称/描述/图标,写学校覆盖表);模块管理/推送设置/删除全部隐藏。
// 基石应用(app_nature=BASE)只做身份注册:模块/推送/删除置灰,「编辑」保持可用(密钥轮换入口)
// 基石应用(app_nature=BASE)只做身份注册:模块/推送置灰;删除允许——基石也可下线,
// 但走「输名确认」删除模(危险确认,与 projman 应用删除同款)。
const base = row.appNature === "BASE";
const actions = [$utils.operatingTextHandle(h, '编辑', '', () => handleEdit(row))];
if (!isSchoolMode.value) {
actions.push($utils.operatingTextHandle(h, '模块管理', '', () => goModuleManage(row), base));
actions.push($utils.operatingTextHandle(h, '推送设置', '', () => openPushSetting(row), base));
actions.push($utils.operatingTextHandle(h, '删除', 'text-error', () => handleDelete(row), base));
actions.push($utils.operatingTextHandle(h, '删除', 'text-error', () => handleDelete(row)));
}
return actions;
}
@@ -239,18 +240,24 @@ function openSortModal() {
sortModalVisible.value = true;
}
/* ---------------- 删除应用 ---------------- */
/* ---------------- 删除应用(删除模:输名确认 + 红色确认键,对齐 projman;基石应用同样可删) ---------------- */
async function handleDelete(row: any) {
const name = row.name || String(row.id);
await MyConfirm({
msg: `确定删除应用「${row.name || row.id}」吗?`,
info: "删除后不可恢复!",
title: "删除应用",
msg: `确定删除应用「${name}」吗?`,
info: "删除后不可恢复,关联就绪资源需手动清理!"
+ (row.appNature === "BASE" ? "(基石应用:请先确认无平台组件仍依赖其 appKey 签名身份)" : ""),
confirmName: name,
danger: true,
confirmText: "删除",
async onOk() {
try {
await Apis.AppSettings.deleteApp({ pathParams: { id: row.id } });
Message.success('删除成功!');
tableRef.value?.reloadData(OperatorEnum.del);
} catch (e: any) {
console.warn(e?.message || '删除失败');
Message.error(e?.message || '删除失败');
}
},
});