From 70ae62203ab8ed2f4e6f0389c3ff5211f967fd2d Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Wed, 28 Jan 2026 11:32:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BC=98=E6=83=A0=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/act/act-coupon.ts | 40 +++++ src/hooks/dict.ts | 32 ++-- src/utils/other.ts | 2 +- src/views/act/act-coupon/form.vue | 244 +++++++++++++++++++++++++++++ src/views/act/act-coupon/index.vue | 229 +++++++++++++++++++++++++++ src/views/hard/hard-sh/index.vue | 8 +- 6 files changed, 540 insertions(+), 15 deletions(-) create mode 100644 src/api/act/act-coupon.ts create mode 100644 src/views/act/act-coupon/form.vue create mode 100644 src/views/act/act-coupon/index.vue diff --git a/src/api/act/act-coupon.ts b/src/api/act/act-coupon.ts new file mode 100644 index 0000000..6b76ccf --- /dev/null +++ b/src/api/act/act-coupon.ts @@ -0,0 +1,40 @@ +import request from "/@/utils/request" + +export function fetchList(query?: Object) { + return request({ + url: "/wallet/act-coupon/page", + method: "get", + params: query, + }) +} + +export function addObj(obj?: Object) { + return request({ + url: "/wallet/act-coupon", + method: "post", + data: obj, + }) +} + +export function getObj(id?: string) { + return request({ + url: "/wallet/act-coupon/" + id, + method: "get", + }) +} + +export function delObjs(ids?: Object) { + return request({ + url: "/wallet/act-coupon", + method: "delete", + data: ids, + }) +} + +export function putObj(obj?: Object) { + return request({ + url: "/wallet/act-coupon", + method: "put", + data: obj, + }) +} diff --git a/src/hooks/dict.ts b/src/hooks/dict.ts index a7f4c9a..420a538 100644 --- a/src/hooks/dict.ts +++ b/src/hooks/dict.ts @@ -1,29 +1,35 @@ -import { dict } from '/@/stores/dict'; -import { getDicts } from '/@/api/admin/dict'; -import { ref, toRefs } from 'vue'; +import { dict } from "/@/stores/dict" +import { getDicts } from "/@/api/admin/dict" +import { ref, toRefs } from "vue" /** * 获取字典数据 */ export function useDict(...args: any): any { - const res = ref({}); + const res = ref({}) return (() => { args.forEach((dictType: String) => { // @ts-ignore - res.value[dictType] = []; - const dicts = dict().getDict(dictType); + res.value[dictType] = [] + const dicts = dict().getDict(dictType) if (dicts) { // @ts-ignore - res.value[dictType] = dicts; + res.value[dictType] = dicts } else { getDicts(dictType).then((resp) => { // @ts-ignore - res.value[dictType] = resp.data.map((p: any) => ({ label: p.label, value: p.value, elTagType: p.listClass, elTagClass: p.cssClass })); + res.value[dictType] = resp.data.map((p: any) => ({ + label: p.label, + value: p.value, + elTagType: p.listClass, + elTagClass: p.cssClass, + remarks: p.remarks, + })) // @ts-ignore - dict().setDict(dictType, res.value[dictType]); - }); + dict().setDict(dictType, res.value[dictType]) + }) } - }); - return toRefs(res.value); - })(); + }) + return toRefs(res.value) + })() } diff --git a/src/utils/other.ts b/src/utils/other.ts index 908cccb..7c0068e 100644 --- a/src/utils/other.ts +++ b/src/utils/other.ts @@ -390,7 +390,7 @@ export function handleBlobFile(response: any, fileName: string) { } } if (typeof (blob as any).text === "function") { - ;(blob as any).text().then((t: string) => handleText(t)) + (blob as any).text().then((t: string) => handleText(t)) } else { const reader = new FileReader() reader.onload = () => handleText(String(reader.result || "")) diff --git a/src/views/act/act-coupon/form.vue b/src/views/act/act-coupon/form.vue new file mode 100644 index 0000000..77362b2 --- /dev/null +++ b/src/views/act/act-coupon/form.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/act/act-coupon/index.vue b/src/views/act/act-coupon/index.vue new file mode 100644 index 0000000..2296c48 --- /dev/null +++ b/src/views/act/act-coupon/index.vue @@ -0,0 +1,229 @@ + + + diff --git a/src/views/hard/hard-sh/index.vue b/src/views/hard/hard-sh/index.vue index 718ca31..da92a6f 100644 --- a/src/views/hard/hard-sh/index.vue +++ b/src/views/hard/hard-sh/index.vue @@ -21,10 +21,16 @@ - + + + + {{ $t("common.queryBtn") }}