update point rule groovy script

This commit is contained in:
Timi
2026-09-09 01:24:42 +08:00
parent 74127fc20f
commit 07205f869b
8 changed files with 281 additions and 138 deletions
+8 -1
View File
@@ -6,7 +6,8 @@ import type {
PointAdjustRequest,
PointLedger,
PointLedgerPage,
PointRule
PointRule,
GroovyScript
} from "@/types/Point";
import { getCurrentStoreId, withCurrentStoreId, withCurrentStorePage } from "@/utils/store";
@@ -94,6 +95,11 @@ async function ruleDetail(id: string): Promise<PointRule> {
});
}
/** 查询积分规则可选的 Groovy 脚本。 */
async function ruleScriptList(): Promise<GroovyScript[]> {
return await axios.post(`${BASE_URI}/rule/script/list`);
}
async function ruleCreate(rule: PointRule): Promise<string> {
return await axios.post(`${BASE_URI}/rule/create`, withCurrentStoreId(rule));
}
@@ -120,6 +126,7 @@ export default {
adjust,
ruleList,
ruleDetail,
ruleScriptList,
ruleCreate,
ruleUpdate,
ruleSort,