修正规则目标文件夹名称和删除成功中文提示
Some checks are pending
Security Checks / security (push) Waiting to run

This commit is contained in:
smail 2026-09-27 19:50:52 +08:00
parent 1cb7ef98b9
commit 92a86d6139
2 changed files with 11 additions and 3 deletions

View File

@ -55,6 +55,12 @@ export function usePage() {
}
reflushGroupInfos()
const formatRuleParams = (row) => {
if (Number(row.action) !== MOVE) return row.params
const target = groupData.list.find(group => String(group.id) === String(row.params))
return target?.name || row.params
}
const newRuleForm = () => ({
"id": 0,
@ -78,7 +84,7 @@ export function usePage() {
http.post("/api/v1/rule/del", {"id": id}).then((res) => {
ElNotification({
title: res.errorNo === 0 ? lang.succ : lang.fail,
message: res.data,
message: res.errorNo === 0 ? lang.deleted_successfully : res.data,
type: res.errorNo === 0 ? 'success' : 'error',
})
init()
@ -148,6 +154,7 @@ export function usePage() {
ActionName,
init,
groupData,
formatRuleParams,
reflushGroupInfos,
addRuleForm,
delRule,

View File

@ -20,7 +20,7 @@
<el-tag size="small" effect="plain" class="action-tag">{{ ActionName[scope.row.action] }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="params" :label="lang.rule_params" min-width="150" show-overflow-tooltip/>
<el-table-column prop="params" :label="lang.rule_params" :formatter="formatRuleParams" min-width="150" show-overflow-tooltip/>
<el-table-column prop="sort" :label="lang.rule_priority" width="100"/>
<el-table-column width="100" align="right">
<template #default="scope">
@ -29,7 +29,7 @@
<el-popconfirm confirm-button-text="确认" cancel-button-text="取消" :icon="InfoFilled"
@confirm="delRule(scope.row.id)" icon-color="#ef4444" :title="lang.del_rule_confirm">
<template #reference>
<el-button size="small" type="danger" :icon="Delete" circle text/>
<el-button size="small" type="danger" :icon="Delete" :aria-label="lang.delete" circle text/>
</template>
</el-popconfirm>
</div>
@ -147,6 +147,7 @@ const {
FORWARD,
reflushGroupInfos,
groupData,
formatRuleParams,
canReadGlobalPolicy
} = usePage()
const { currentPage, pageCount, pageItems } = usePagination(data, 6)