@feedmepos/mf-connect 0.0.5-beta.20 → 0.0.5-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Analytic-DUWe-WYz.js → Analytic-CVpCpEBl.js} +12 -13
- package/dist/{Broadcast-CAmI-dS9.js → Broadcast-C0SHdFpT.js} +11 -12
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CQbePPyW.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B94-nKP4.js} +8 -8
- package/dist/Card-C5yXOEhK.js +827 -0
- package/dist/Collections-Ka_q_V3S.js +424 -0
- package/dist/{Credit-CxyIk-mH.js → Credit-CmTa3hjm.js} +11 -12
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-AGQwe70B.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CNSfNMA_.js} +23 -24
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-y263YYGy.js → EffectSheet.vue_vue_type_style_index_0_lang-BLfzJ46z.js} +5 -5
- package/dist/{Experience-DH6nbWal.js → Experience-yd4ZPBXy.js} +11 -12
- package/dist/{Game-BGMGl6Uw.js → Game-DYTplwOh.js} +22 -23
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rs3BEnpo.js → ImageInput.vue_vue_type_script_setup_true_lang-BuuYdlE4.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BIwBZ7FH.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BfWuKa1w.js} +1 -1
- package/dist/{MainLayout-CjvNB4RK.js → MainLayout-8tc3ZtLI.js} +2 -2
- package/dist/{Marketing-BLbR9_KN.js → Marketing-D5Le-SWn.js} +19 -20
- package/dist/{Member-BqPHWUos.js → Member-CzY5Um_y.js} +2 -2
- package/dist/{MemberList-DoBv4aBY.js → MemberList-DpFa2ttF.js} +20 -21
- package/dist/{MemberTransactions-Cri3UCrX.js → MemberTransactions-CDKkRdfp.js} +4 -4
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang--qiv_ZUS.js → MessageInput.vue_vue_type_script_setup_true_lang-BD27S5wB.js} +4 -4
- package/dist/{Mission-BXRMH__V.js → Mission-9BmMMzyr.js} +25 -26
- package/dist/{Point-MS30HaX7.js → Point-IiWgZIyI.js} +11 -12
- package/dist/{Promotion-BuOELg3x.js → Promotion-BmEQ28sH.js} +42 -44
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CAnO-3XN.js → RuleGroup.vue_vue_type_script_setup_true_lang-BhOoz0HL.js} +12 -12
- package/dist/{Segment-C9s9hDBX.js → Segment-D1ID4Rmt.js} +39 -40
- package/dist/{Setting-CHk3QEsN.js → Setting-B3WeabHJ.js} +17 -18
- package/dist/{Store-CQWAs4Ew.js → Store-CKFLaYKH.js} +18 -19
- package/dist/{StoreRewards-DJkh42Es.js → StoreRewards-DIQL173Q.js} +27 -28
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B2kjcViv.js +794 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CEBqSaBp.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C1QmPELI.js} +1 -1
- package/dist/{Tier-3zGwCsja.js → Tier-BvE47ciZ.js} +43 -43
- package/dist/{Title-TotAXw2n.js → Title-DfcczCHg.js} +42 -42
- package/dist/Transaction-CF0f3QCU.js +36 -0
- package/dist/Voucher-CCOZjT6k.js +481 -0
- package/dist/{app--rCS8dWb.js → app-B4oDOeXm.js} +1456 -1456
- package/dist/app.js +1 -1
- package/dist/{campaign-BPWXzTLO.js → campaign-BWwTQs_d.js} +2 -2
- package/dist/{collection.fn-NFB67-6j.js → collection.fn-C5XN0PPR.js} +2 -2
- package/dist/{dto-ChVvY7GG.js → dto-Ktuw3JiD.js} +138 -139
- package/dist/{effect-CbwZuhWY.js → effect-BM2dJl1a.js} +1 -1
- package/dist/export-LApNX--r.js +97 -0
- package/dist/{helper-D16-sxkv.js → helper-BUC1dAUX.js} +1 -1
- package/dist/{index-EmqFPQGb.js → index-B6GvsaDA.js} +1 -1
- package/dist/{index-DlqRXSLU.js → index-BZMMIcyM.js} +1 -1
- package/dist/{index-Blbjd5Y9.js → index-Bc-r4pik.js} +5 -5
- package/dist/{index-CGTaSvN6.js → index-Bt_xFt9g.js} +1 -1
- package/dist/{index-D-bPAs1d.js → index-C7qI5flU.js} +2 -2
- package/dist/{index-Dh6x04Wk.js → index-C86T8VON.js} +2 -2
- package/dist/{index-C7SZ9gvu.js → index-CvZ_MhCE.js} +7 -7
- package/dist/{index-vsgk07Y2.js → index-CzVShOLS.js} +1 -1
- package/dist/{index-BGAWJ6-h.js → index-DSUUVWFu.js} +3 -3
- package/dist/{index--VC0kdJZ.js → index-DVJQt0_Q.js} +2 -2
- package/dist/{plugins-Ccv9TIl4.js → loading-CM3ZyteE.js} +8204 -8108
- package/dist/{lodash-7Fz14kKI.js → lodash-DYMRs712.js} +1 -1
- package/dist/{membership-ByQds6Nb.js → membership-D0Z9EBWi.js} +3 -3
- package/dist/{money-DsiT1-aV.js → money-Cyt6uuok.js} +1 -1
- package/dist/{number-D4SI_vwy.js → number-CSBV_14_.js} +1 -1
- package/dist/{rule-NzJI8lrC.js → rule-C4ovkUox.js} +2 -2
- package/dist/{rule-builder-CNz0WgMq.js → rule-builder-DxDhft7B.js} +1 -1
- package/dist/{template-9wDwTGR-.js → template-Dd9xYS-m.js} +6 -6
- package/dist/{usePagination-CsZrmXsU.js → usePagination-cObe7G1g.js} +1 -1
- package/dist/{xlsx-CUa5ix7U.js → xlsx--baqnGDY.js} +1 -1
- package/package.json +1 -1
- package/dist/Card-DhgETjhz.js +0 -914
- package/dist/Collections-9fPXIR34.js +0 -424
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-1GgzlIRZ.js +0 -693
- package/dist/Transaction-gV9vaJCR.js +0 -34
- package/dist/Voucher-BJ-pXo7Y.js +0 -449
- package/dist/loading-B5tUSWjN.js +0 -100
|
@@ -1,424 +0,0 @@
|
|
|
1
|
-
var Z = Object.defineProperty;
|
|
2
|
-
var ee = (h, r, p) => r in h ? Z(h, r, { enumerable: !0, configurable: !0, writable: !0, value: p }) : h[r] = p;
|
|
3
|
-
var T = (h, r, p) => ee(h, typeof r != "symbol" ? r + "" : r, p);
|
|
4
|
-
import { defineComponent as $, ref as g, computed as Y, watch as z, resolveComponent as m, openBlock as v, createBlock as L, unref as e, isRef as D, withCtx as I, createElementVNode as C, createVNode as i, createElementBlock as S, Fragment as U, renderList as oe, createCommentVNode as _ } from "vue";
|
|
5
|
-
import { h as M } from "./moment-BWErdI6_.js";
|
|
6
|
-
import { u as te, b as ae } from "./app--rCS8dWb.js";
|
|
7
|
-
import "./plugins-Ccv9TIl4.js";
|
|
8
|
-
import { u as O } from "./loading-B5tUSWjN.js";
|
|
9
|
-
import { useRoute as j } from "vue-router";
|
|
10
|
-
import { c as N } from "./index-DlqRXSLU.js";
|
|
11
|
-
import { l as le } from "./lodash-7Fz14kKI.js";
|
|
12
|
-
import { u as q, w as ne } from "./xlsx-CUa5ix7U.js";
|
|
13
|
-
import { g as se } from "./user-Bm4KttFq.js";
|
|
14
|
-
import { m as re } from "./index-EmqFPQGb.js";
|
|
15
|
-
import { o as ie } from "./objectId-dwaoBfJX.js";
|
|
16
|
-
const ue = /* @__PURE__ */ C("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1), de = { class: "space-y-16" }, ce = /* @__PURE__ */ C("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1), me = { class: "gap-16 grid grid-cols-2" }, pe = { class: "flex items-center gap-8" }, fe = /* @__PURE__ */ $({
|
|
17
|
-
__name: "CreateCollectionSheet",
|
|
18
|
-
emits: ["success"],
|
|
19
|
-
setup(h, { expose: r, emit: p }) {
|
|
20
|
-
const { minor: V } = O, k = j(), B = g(), w = g(!1), R = p, n = g(!1);
|
|
21
|
-
function y(c) {
|
|
22
|
-
n.value = c, c && (a.value = {
|
|
23
|
-
quantity: 1,
|
|
24
|
-
code: "",
|
|
25
|
-
codeConfig: {
|
|
26
|
-
length: 8,
|
|
27
|
-
charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
28
|
-
prefix: "",
|
|
29
|
-
suffix: "",
|
|
30
|
-
pattern: "########"
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
const a = g({
|
|
35
|
-
quantity: 1,
|
|
36
|
-
code: "",
|
|
37
|
-
codeConfig: {
|
|
38
|
-
length: 8,
|
|
39
|
-
charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
40
|
-
prefix: "",
|
|
41
|
-
suffix: "",
|
|
42
|
-
pattern: "########"
|
|
43
|
-
}
|
|
44
|
-
}), P = [
|
|
45
|
-
{
|
|
46
|
-
label: "Bulk codes",
|
|
47
|
-
value: "bulk",
|
|
48
|
-
sublabel: "Bulk generate unique codes"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
label: "Custom code",
|
|
52
|
-
value: "single",
|
|
53
|
-
sublabel: "Enter your own custom codes"
|
|
54
|
-
}
|
|
55
|
-
], l = [
|
|
56
|
-
{
|
|
57
|
-
label: "Alphanumeric",
|
|
58
|
-
value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
label: "Alphabetic",
|
|
62
|
-
value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
63
|
-
},
|
|
64
|
-
{ label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
|
|
65
|
-
{ label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
|
|
66
|
-
{ label: "Numbers", value: "0123456789" },
|
|
67
|
-
{ label: "Custom", value: "" }
|
|
68
|
-
], s = g(l[0].value), d = g("bulk"), u = g(!1), x = Y(() => k.params.id);
|
|
69
|
-
async function f(c) {
|
|
70
|
-
var o;
|
|
71
|
-
await ((o = B.value) == null ? void 0 : o.validateInputs()), w.value && await V(
|
|
72
|
-
async () => {
|
|
73
|
-
await N.createCollectionByCampaignId(x.value, c), await R("success");
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
message: "Creating claim(s)",
|
|
77
|
-
successMessage: "Claim(s) created"
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
return r({
|
|
82
|
-
showSheet: y
|
|
83
|
-
}), z(
|
|
84
|
-
() => a.value.codeConfig.length,
|
|
85
|
-
(c, o) => {
|
|
86
|
-
c != o && (a.value.codeConfig.pattern = "#".repeat(Number(c)));
|
|
87
|
-
}
|
|
88
|
-
), (c, o) => {
|
|
89
|
-
const E = m("FmRadio"), G = m("FmRadioGroup"), H = m("FmSwitch"), K = m("FmStepperField"), Q = m("FmSelect"), F = m("FmTextField"), W = m("FmTextarea"), J = m("FmForm"), A = m("FmButton"), X = m("FmSideSheet");
|
|
90
|
-
return v(), L(X, {
|
|
91
|
-
"max-width": 560,
|
|
92
|
-
"dismiss-away": !0,
|
|
93
|
-
header: "Create collection",
|
|
94
|
-
modelValue: e(n),
|
|
95
|
-
"onUpdate:modelValue": [
|
|
96
|
-
o[14] || (o[14] = (t) => D(n) ? n.value = t : null),
|
|
97
|
-
o[15] || (o[15] = (t) => n.value = t)
|
|
98
|
-
]
|
|
99
|
-
}, {
|
|
100
|
-
"side-sheet-footer": I(() => [
|
|
101
|
-
C("div", pe, [
|
|
102
|
-
i(A, {
|
|
103
|
-
label: "Save",
|
|
104
|
-
onClick: o[12] || (o[12] = (t) => f(e(a))),
|
|
105
|
-
loading: e(te)().isLoading
|
|
106
|
-
}, null, 8, ["loading"]),
|
|
107
|
-
i(A, {
|
|
108
|
-
label: "Cancel",
|
|
109
|
-
type: "button",
|
|
110
|
-
variant: "tertiary",
|
|
111
|
-
onClick: o[13] || (o[13] = (t) => n.value = !1)
|
|
112
|
-
})
|
|
113
|
-
])
|
|
114
|
-
]),
|
|
115
|
-
default: I(() => [
|
|
116
|
-
i(J, {
|
|
117
|
-
ref_key: "form",
|
|
118
|
-
ref: B,
|
|
119
|
-
class: "space-y-40",
|
|
120
|
-
onValidationSuccess: o[10] || (o[10] = (t) => w.value = !0),
|
|
121
|
-
onValidationFailed: o[11] || (o[11] = (t) => w.value = !1)
|
|
122
|
-
}, {
|
|
123
|
-
default: I(() => [
|
|
124
|
-
C("div", null, [
|
|
125
|
-
ue,
|
|
126
|
-
i(G, {
|
|
127
|
-
modelValue: e(d),
|
|
128
|
-
"onUpdate:modelValue": o[0] || (o[0] = (t) => D(d) ? d.value = t : null),
|
|
129
|
-
inline: !1
|
|
130
|
-
}, {
|
|
131
|
-
default: I(() => [
|
|
132
|
-
(v(), S(U, null, oe(P, (t) => i(E, {
|
|
133
|
-
key: t.value,
|
|
134
|
-
value: t.value,
|
|
135
|
-
label: t.label,
|
|
136
|
-
sublabel: t.sublabel
|
|
137
|
-
}, null, 8, ["value", "label", "sublabel"])), 64))
|
|
138
|
-
]),
|
|
139
|
-
_: 1
|
|
140
|
-
}, 8, ["modelValue"])
|
|
141
|
-
]),
|
|
142
|
-
C("div", de, [
|
|
143
|
-
ce,
|
|
144
|
-
e(d) === "bulk" ? (v(), S(U, { key: 0 }, [
|
|
145
|
-
i(H, {
|
|
146
|
-
"model-value": e(u),
|
|
147
|
-
"label-placement": "right",
|
|
148
|
-
value: "true",
|
|
149
|
-
label: "Advance code setting",
|
|
150
|
-
required: !0,
|
|
151
|
-
"onUpdate:modelValue": o[1] || (o[1] = () => u.value = !e(u))
|
|
152
|
-
}, null, 8, ["model-value"]),
|
|
153
|
-
e(u) ? (v(), S(U, { key: 0 }, [
|
|
154
|
-
i(K, {
|
|
155
|
-
modelValue: e(a).codeConfig.length,
|
|
156
|
-
"onUpdate:modelValue": o[2] || (o[2] = (t) => e(a).codeConfig.length = t),
|
|
157
|
-
label: "Code length",
|
|
158
|
-
rules: [(t) => Number(t) >= 1 || "Code length must at least 1"],
|
|
159
|
-
required: !0
|
|
160
|
-
}, null, 8, ["modelValue", "rules"]),
|
|
161
|
-
i(Q, {
|
|
162
|
-
label: "Charset",
|
|
163
|
-
"model-value": e(s),
|
|
164
|
-
items: l,
|
|
165
|
-
"helper-text": e(a).codeConfig.charset.length > 62 ? `${e(a).codeConfig.charset.substring(0, 62)}...` : e(a).codeConfig.charset,
|
|
166
|
-
"onUpdate:modelValue": o[3] || (o[3] = (t) => {
|
|
167
|
-
s.value = t, e(a).codeConfig.charset = t;
|
|
168
|
-
})
|
|
169
|
-
}, null, 8, ["model-value", "helper-text"]),
|
|
170
|
-
e(s) === "" ? (v(), L(F, {
|
|
171
|
-
key: 0,
|
|
172
|
-
modelValue: e(a).codeConfig.charset,
|
|
173
|
-
"onUpdate:modelValue": o[4] || (o[4] = (t) => e(a).codeConfig.charset = t),
|
|
174
|
-
label: "Custom Charset",
|
|
175
|
-
required: ""
|
|
176
|
-
}, null, 8, ["modelValue"])) : _("", !0),
|
|
177
|
-
C("div", me, [
|
|
178
|
-
i(F, {
|
|
179
|
-
modelValue: e(a).codeConfig.prefix,
|
|
180
|
-
"onUpdate:modelValue": o[5] || (o[5] = (t) => e(a).codeConfig.prefix = t),
|
|
181
|
-
label: "Prefix (Optional)"
|
|
182
|
-
}, null, 8, ["modelValue"]),
|
|
183
|
-
i(F, {
|
|
184
|
-
modelValue: e(a).codeConfig.suffix,
|
|
185
|
-
"onUpdate:modelValue": o[6] || (o[6] = (t) => e(a).codeConfig.suffix = t),
|
|
186
|
-
label: "Suffix (Optional)"
|
|
187
|
-
}, null, 8, ["modelValue"])
|
|
188
|
-
]),
|
|
189
|
-
i(F, {
|
|
190
|
-
modelValue: e(a).codeConfig.pattern,
|
|
191
|
-
"onUpdate:modelValue": o[7] || (o[7] = (t) => e(a).codeConfig.pattern = t),
|
|
192
|
-
label: "Pattern",
|
|
193
|
-
required: !0
|
|
194
|
-
}, null, 8, ["modelValue"])
|
|
195
|
-
], 64)) : _("", !0),
|
|
196
|
-
i(F, {
|
|
197
|
-
modelValue: e(a).quantity,
|
|
198
|
-
"onUpdate:modelValue": o[8] || (o[8] = (t) => e(a).quantity = t),
|
|
199
|
-
label: "Number of code",
|
|
200
|
-
rules: [
|
|
201
|
-
(t) => t >= 1 || "Quantity cannot be less than 1",
|
|
202
|
-
(t) => t <= 1e4 || "Quantity cannot more than 10,000"
|
|
203
|
-
],
|
|
204
|
-
required: !0,
|
|
205
|
-
"helper-text": `${e(a).quantity} claim will be created`
|
|
206
|
-
}, null, 8, ["modelValue", "rules", "helper-text"])
|
|
207
|
-
], 64)) : _("", !0),
|
|
208
|
-
e(d) !== "bulk" ? (v(), L(W, {
|
|
209
|
-
key: 1,
|
|
210
|
-
modelValue: e(a).code,
|
|
211
|
-
"onUpdate:modelValue": o[9] || (o[9] = (t) => e(a).code = t),
|
|
212
|
-
label: "Custom Code",
|
|
213
|
-
rules: [(t) => e(d) != "single" || !!t || "Custom code is required"],
|
|
214
|
-
placeholder: "(For multiple codes, please enter in the new row.)"
|
|
215
|
-
}, null, 8, ["modelValue", "rules"])) : _("", !0)
|
|
216
|
-
])
|
|
217
|
-
]),
|
|
218
|
-
_: 1
|
|
219
|
-
}, 512)
|
|
220
|
-
]),
|
|
221
|
-
_: 1
|
|
222
|
-
}, 8, ["modelValue"]);
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
class ge {
|
|
227
|
-
constructor() {
|
|
228
|
-
T(this, "data", []);
|
|
229
|
-
}
|
|
230
|
-
addRecord(r) {
|
|
231
|
-
this.data.push(r);
|
|
232
|
-
}
|
|
233
|
-
buildExcel() {
|
|
234
|
-
const r = q.book_new(), p = q.json_to_sheet(this.data);
|
|
235
|
-
return q.book_append_sheet(r, p, "Collection"), r;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
const b = {
|
|
239
|
-
sortBy: "_id",
|
|
240
|
-
descending: !1,
|
|
241
|
-
rowsPerPage: 1e3,
|
|
242
|
-
page: 1,
|
|
243
|
-
rowsNumber: 0
|
|
244
|
-
}, be = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Ce = { class: "flex items-center justify-end py-4 xs:hidden" }, he = {
|
|
245
|
-
key: 0,
|
|
246
|
-
class: "w-full flex flex-col gap-16 items-center pt-16"
|
|
247
|
-
}, ve = /* @__PURE__ */ C("div", { class: "fm-typo-en-body-lg-600" }, "No data found", -1), ye = /* @__PURE__ */ C("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " No data to show at the current moment. ", -1), xe = [
|
|
248
|
-
ve,
|
|
249
|
-
ye
|
|
250
|
-
], Le = /* @__PURE__ */ $({
|
|
251
|
-
__name: "Collections",
|
|
252
|
-
setup(h) {
|
|
253
|
-
const r = j(), p = g(), V = Y(() => r.params.id), k = g(!1), { custom: B } = O, w = [
|
|
254
|
-
{
|
|
255
|
-
header: "ID/Code",
|
|
256
|
-
accessorFn: (l) => l.code || l._id
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
header: "User",
|
|
260
|
-
accessorKey: "user",
|
|
261
|
-
enableSorting: !1,
|
|
262
|
-
cell(l) {
|
|
263
|
-
const s = l.row.original.pf_user;
|
|
264
|
-
return se(s);
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
header: "Phone",
|
|
269
|
-
accessorFn: (l) => {
|
|
270
|
-
var s;
|
|
271
|
-
return ((s = l.pf_user) == null ? void 0 : s.phoneNumber) || "-";
|
|
272
|
-
}
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
header: "Balance",
|
|
276
|
-
accessorKey: "balance"
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
header: "Created at",
|
|
280
|
-
accessorKey: "_id",
|
|
281
|
-
accessorFn: (l) => M(ie(l._id.toString())).format("DD MMM YYYY")
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
header: "Nearest expired at",
|
|
285
|
-
accessorFn: (l) => {
|
|
286
|
-
var s;
|
|
287
|
-
return l.expiryBalance && l.expiryBalance.length ? M((s = l.expiryBalance) == null ? void 0 : s[0].expiredAt).format("DD MMM YYYY") : "Never expires";
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
], R = async (l) => {
|
|
291
|
-
y.value = [], n.value.isLoading = !0;
|
|
292
|
-
const d = {
|
|
293
|
-
"$connect-STORE_REWARD_COLLECTIONS": re.readCollectionsByRewardId,
|
|
294
|
-
"$connect-CAMPAIGN_VOUCHER_COLLECTIONS": N.readCollectionsByCampaignId
|
|
295
|
-
}[r.name], u = await d(V.value, {
|
|
296
|
-
limit: l.pageSize,
|
|
297
|
-
skip: l.pageIndex ?? 0,
|
|
298
|
-
sortBy: "_id",
|
|
299
|
-
search: n.value.searchValue,
|
|
300
|
-
descending: !0
|
|
301
|
-
});
|
|
302
|
-
y.value = u.resources, n.value.totalRows = u.meta.totalResources ?? 0, n.value.pageCount = u.meta.totalPages ?? 0, n.value.isLoading = !1;
|
|
303
|
-
}, n = g({
|
|
304
|
-
searchValue: "",
|
|
305
|
-
pageSize: 10,
|
|
306
|
-
pageCount: 0,
|
|
307
|
-
pageIndex: 0,
|
|
308
|
-
totalRows: 0,
|
|
309
|
-
isLoading: !1
|
|
310
|
-
}), y = g([]);
|
|
311
|
-
async function a() {
|
|
312
|
-
var l;
|
|
313
|
-
await R({ pageSize: 10, pageIndex: 0 }), (l = p.value) == null || l.showSheet(!1);
|
|
314
|
-
}
|
|
315
|
-
async function P() {
|
|
316
|
-
k.value || B(
|
|
317
|
-
async () => {
|
|
318
|
-
var u;
|
|
319
|
-
const l = new ge(), s = (await N.readCollectionsByCampaignId(V.value, {
|
|
320
|
-
limit: 1,
|
|
321
|
-
skip: 0,
|
|
322
|
-
sortBy: b.sortBy,
|
|
323
|
-
descending: b.descending
|
|
324
|
-
})).meta.totalResources ?? 0, d = b.rowsPerPage;
|
|
325
|
-
for (let x = 0; x < s; x += d) {
|
|
326
|
-
const f = {
|
|
327
|
-
...b,
|
|
328
|
-
limit: d,
|
|
329
|
-
skip: (b.page - 1) * b.rowsPerPage,
|
|
330
|
-
sortBy: b.sortBy,
|
|
331
|
-
descending: b.descending
|
|
332
|
-
}, c = await N.readCollectionsByCampaignId(
|
|
333
|
-
V.value,
|
|
334
|
-
f
|
|
335
|
-
);
|
|
336
|
-
for await (const o of c.resources) {
|
|
337
|
-
const E = {
|
|
338
|
-
Id: (o == null ? void 0 : o.code) || ((u = o._id) == null ? void 0 : u.toString()) || ""
|
|
339
|
-
};
|
|
340
|
-
l.addRecord(E);
|
|
341
|
-
}
|
|
342
|
-
b.page++;
|
|
343
|
-
}
|
|
344
|
-
await ne(
|
|
345
|
-
l.buildExcel(),
|
|
346
|
-
`members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
347
|
-
{
|
|
348
|
-
bookType: "xlsx",
|
|
349
|
-
bookSST: !1,
|
|
350
|
-
type: "array"
|
|
351
|
-
}
|
|
352
|
-
), b.page = 1;
|
|
353
|
-
},
|
|
354
|
-
{
|
|
355
|
-
isLoading: k
|
|
356
|
-
}
|
|
357
|
-
);
|
|
358
|
-
}
|
|
359
|
-
return z(
|
|
360
|
-
() => n.value.searchValue,
|
|
361
|
-
le.debounce(async () => {
|
|
362
|
-
await a();
|
|
363
|
-
}, 500)
|
|
364
|
-
), (l, s) => {
|
|
365
|
-
const d = m("FmPageHead"), u = m("FmSearch"), x = m("FmTable");
|
|
366
|
-
return v(), S(U, null, [
|
|
367
|
-
i(d, {
|
|
368
|
-
title: "Collections",
|
|
369
|
-
"back-button": !0,
|
|
370
|
-
actions: [
|
|
371
|
-
{ label: "Export", value: "export", isPrimary: !1 },
|
|
372
|
-
{
|
|
373
|
-
label: "Create collection",
|
|
374
|
-
value: "create",
|
|
375
|
-
isPrimary: !0
|
|
376
|
-
}
|
|
377
|
-
],
|
|
378
|
-
"onClick:back": s[0] || (s[0] = (f) => e(ae).back()),
|
|
379
|
-
"onClick:action": s[1] || (s[1] = (f) => {
|
|
380
|
-
var c;
|
|
381
|
-
f === "create" && ((c = e(p)) == null || c.showSheet(!0)), f === "export" && P();
|
|
382
|
-
})
|
|
383
|
-
}),
|
|
384
|
-
C("div", be, [
|
|
385
|
-
i(u, {
|
|
386
|
-
class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
|
|
387
|
-
modelValue: e(n).searchValue,
|
|
388
|
-
"onUpdate:modelValue": s[2] || (s[2] = (f) => e(n).searchValue = f),
|
|
389
|
-
placeholder: "Search",
|
|
390
|
-
collapsible: ""
|
|
391
|
-
}, null, 8, ["modelValue"]),
|
|
392
|
-
C("div", Ce, [
|
|
393
|
-
i(u, {
|
|
394
|
-
modelValue: e(n).searchValue,
|
|
395
|
-
"onUpdate:modelValue": s[3] || (s[3] = (f) => e(n).searchValue = f),
|
|
396
|
-
placeholder: "Search",
|
|
397
|
-
collapsible: ""
|
|
398
|
-
}, null, 8, ["modelValue"])
|
|
399
|
-
]),
|
|
400
|
-
i(x, {
|
|
401
|
-
loading: e(n).isLoading,
|
|
402
|
-
"row-data": e(y),
|
|
403
|
-
"column-defs": w,
|
|
404
|
-
"row-count": e(n).totalRows,
|
|
405
|
-
"page-count": e(n).pageCount,
|
|
406
|
-
"hide-footer": e(n).totalRows < 10,
|
|
407
|
-
"fetch-fn": R,
|
|
408
|
-
"shrink-at": !1,
|
|
409
|
-
"page-size": e(n).pageSize
|
|
410
|
-
}, null, 8, ["loading", "row-data", "row-count", "page-count", "hide-footer", "page-size"]),
|
|
411
|
-
e(y).length == 0 && e(n).isLoading == !1 ? (v(), S("div", he, xe)) : _("", !0),
|
|
412
|
-
i(fe, {
|
|
413
|
-
ref_key: "sheetRef",
|
|
414
|
-
ref: p,
|
|
415
|
-
onSuccess: a
|
|
416
|
-
}, null, 512)
|
|
417
|
-
])
|
|
418
|
-
], 64);
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
export {
|
|
423
|
-
Le as default
|
|
424
|
-
};
|