xyvcard-goods 0.0.18 → 0.0.19

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.
@@ -0,0 +1,465 @@
1
+ import { defineComponent as O, mergeModels as $, ref as U, reactive as k, useModel as x, resolveComponent as I, openBlock as K, createBlock as A, withCtx as l, createElementVNode as R, createVNode as o, createTextVNode as N, toDisplayString as q, unref as u } from "vue";
2
+ import { ElMessage as M } from "element-plus";
3
+ import { useI18n as z } from "vue-i18n";
4
+ import { useUserStore as i, clearEmpty as p, request as g } from "jmash-core";
5
+ import { q as C } from "./index-DR7GlHNd.mjs";
6
+ import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
7
+ class L {
8
+ getKey(e) {
9
+ return {
10
+ brandId: e.brandId
11
+ };
12
+ }
13
+ // 查询翻页信息品牌管理
14
+ findPage(e) {
15
+ const t = i().user.tenant;
16
+ return p(e), g({
17
+ url: "/v1/goods/goods_brand_info/page/" + t,
18
+ method: "get",
19
+ params: e
20
+ });
21
+ }
22
+ // 查询列表信息品牌管理
23
+ findList(e) {
24
+ const t = i().user.tenant;
25
+ return p(e), g({
26
+ url: "/v1/goods/goods_brand_info/list/" + t,
27
+ method: "get",
28
+ params: e
29
+ });
30
+ }
31
+ // 查询品牌管理
32
+ findById(e) {
33
+ const t = i().user.tenant;
34
+ return p(e), g({
35
+ url: "/v1/goods/goods_brand_info/id/" + t + "/" + e.brandId,
36
+ method: "get"
37
+ });
38
+ }
39
+ // 创建实体品牌管理
40
+ create(e) {
41
+ return e.tenant = i().user.tenant, p(e), g({
42
+ url: "/v1/goods/goods_brand_info",
43
+ method: "post",
44
+ data: e
45
+ });
46
+ }
47
+ // 修改实体品牌管理
48
+ update(e) {
49
+ return e.tenant = i().user.tenant, p(e), g({
50
+ url: "/v1/goods/goods_brand_info",
51
+ method: "patch",
52
+ data: e
53
+ });
54
+ }
55
+ // 上移下移
56
+ move(e, t) {
57
+ const r = { ...e };
58
+ return r.tenant = i().user.tenant, r.up = t, p(r), g({
59
+ url: "/v1/goods/goods_brand_info/move",
60
+ method: "put",
61
+ data: r
62
+ });
63
+ }
64
+ // 启用/禁用
65
+ enable(e, t) {
66
+ const r = { ...e };
67
+ return r.tenant = i().user.tenant, r.enable = t, p(r), g({
68
+ url: "/v1/goods/goods_brand_info/enable",
69
+ method: "put",
70
+ data: r
71
+ });
72
+ }
73
+ // 删除品牌管理
74
+ delete(e) {
75
+ return e.tenant = i().user.tenant, p(e), g({
76
+ url: "/v1/goods/goods_brand_info/id",
77
+ method: "delete",
78
+ params: e
79
+ });
80
+ }
81
+ // 批量删除品牌管理
82
+ batchDelete(e) {
83
+ const t = e.map((a) => a.brandId), r = {
84
+ tenant: i().user.tenant,
85
+ brandId: t
86
+ };
87
+ return p(r), g({
88
+ url: "/v1/goods/goods_brand_info/batch",
89
+ method: "put",
90
+ data: r
91
+ });
92
+ }
93
+ // 下载导入模板品牌管理
94
+ downloadTemplate() {
95
+ const e = i().user.tenant;
96
+ return g({
97
+ url: "/v1/goods/goods_brand_info/" + e + "/template.xlsx",
98
+ method: "get",
99
+ responseType: "blob",
100
+ params: {
101
+ tenant: i().user.tenant
102
+ }
103
+ });
104
+ }
105
+ // 导入品牌管理
106
+ importExcel(e) {
107
+ return e.tenant = i().user.tenant, p(e), g({
108
+ url: "/v1/goods/goods_brand_info/import",
109
+ method: "patch",
110
+ data: e
111
+ });
112
+ }
113
+ // 导出品牌管理Excel文件
114
+ exportExcel(e) {
115
+ const t = i().user.tenant;
116
+ p(e);
117
+ const r = C.stringify(e, {
118
+ arrayFormat: "brackets",
119
+ allowDots: !0
120
+ });
121
+ return g({
122
+ url: "/v1/goods/goods_brand_info/" + t + "/goods_brand_infos.xlsx?" + r,
123
+ method: "get",
124
+ responseType: "blob"
125
+ });
126
+ }
127
+ // 打印品牌管理PDF文件
128
+ exportPdf(e) {
129
+ const t = i().user.tenant;
130
+ p(e);
131
+ const r = C.stringify(e, {
132
+ arrayFormat: "brackets",
133
+ allowDots: !0
134
+ });
135
+ return g({
136
+ url: "/v1/goods/goods_brand_info/" + t + "/goods_brand_infos.pdf?" + r,
137
+ method: "get",
138
+ responseType: "blob"
139
+ });
140
+ }
141
+ }
142
+ const _ = new L(), P = { class: "dialog-footer" }, H = /* @__PURE__ */ O({
143
+ __name: "edit",
144
+ props: /* @__PURE__ */ $({
145
+ entityKey: {
146
+ type: Object,
147
+ default: () => {
148
+ }
149
+ }
150
+ }, {
151
+ modelValue: { type: Boolean },
152
+ modelModifiers: {}
153
+ }),
154
+ emits: /* @__PURE__ */ $(["refresh"], ["update:modelValue"]),
155
+ setup(h, { emit: e }) {
156
+ const { t } = z(), r = U();
157
+ let a = k({
158
+ requestId: Math.random() * 10 + "",
159
+ updateMask: ""
160
+ });
161
+ const E = k({
162
+ tenantId: [
163
+ {
164
+ required: !0,
165
+ message: t("goodsBrandInfo.tenantId"),
166
+ trigger: "change"
167
+ }
168
+ ],
169
+ brandId: [
170
+ {
171
+ required: !0,
172
+ message: t("goodsBrandInfo.brandId"),
173
+ trigger: "change"
174
+ }
175
+ ],
176
+ shopId: [
177
+ {
178
+ required: !0,
179
+ message: t("goodsBrandInfo.shopId"),
180
+ trigger: "change"
181
+ }
182
+ ],
183
+ brandName: [
184
+ {
185
+ required: !0,
186
+ message: t("goodsBrandInfo.brandName"),
187
+ trigger: "change"
188
+ }
189
+ ],
190
+ logoUrl: [
191
+ {
192
+ required: !0,
193
+ message: t("goodsBrandInfo.logoUrl"),
194
+ trigger: "change"
195
+ }
196
+ ],
197
+ description: [
198
+ {
199
+ required: !0,
200
+ message: t("goodsBrandInfo.description"),
201
+ trigger: "change"
202
+ }
203
+ ],
204
+ orderBy: [
205
+ {
206
+ required: !0,
207
+ message: t("goodsBrandInfo.orderBy"),
208
+ trigger: "change"
209
+ }
210
+ ],
211
+ status: [
212
+ {
213
+ required: !0,
214
+ message: t("goodsBrandInfo.status"),
215
+ trigger: "change"
216
+ }
217
+ ]
218
+ }), f = x(h, "modelValue"), B = h, V = e, S = Object.keys(B.entityKey), v = U(S.length >= 1);
219
+ v.value && _.findById(B.entityKey).then(({ data: n }) => {
220
+ Object.assign(a, n);
221
+ });
222
+ const T = async () => {
223
+ var n;
224
+ await ((n = r.value) == null ? void 0 : n.validate((d) => {
225
+ d && (v.value ? _.update(a).then((m) => {
226
+ console.log(m), m.status === 200 && (M({
227
+ message: t("common.submitSuccess"),
228
+ type: "success"
229
+ }), f.value && (f.value = !1), V("refresh", m.status === 200));
230
+ }) : _.create(a).then((m) => {
231
+ console.log(m), m.status === 200 && (M({
232
+ message: t("common.submitSuccess"),
233
+ type: "success"
234
+ }), f.value && (f.value = !1), V("refresh", m.status === 200));
235
+ }));
236
+ }));
237
+ };
238
+ function y() {
239
+ f.value && (f.value = !1);
240
+ }
241
+ return (n, d) => {
242
+ const m = I("el-input"), b = I("el-form-item"), c = I("el-col"), j = I("el-row"), D = I("el-form"), w = I("el-button"), F = I("el-dialog");
243
+ return K(), A(F, {
244
+ modelValue: f.value,
245
+ "onUpdate:modelValue": d[8] || (d[8] = (s) => f.value = s),
246
+ onClose: y
247
+ }, {
248
+ footer: l(() => [
249
+ R("div", P, [
250
+ o(w, { onClick: y }, {
251
+ default: l(() => [
252
+ N(q(n.$t("common.cancel")), 1)
253
+ ]),
254
+ _: 1
255
+ }),
256
+ o(w, {
257
+ type: "primary",
258
+ onClick: T
259
+ }, {
260
+ default: l(() => [
261
+ N(q(n.$t("common.confirm")), 1)
262
+ ]),
263
+ _: 1
264
+ })
265
+ ])
266
+ ]),
267
+ default: l(() => [
268
+ o(D, {
269
+ ref_key: "goodsBrandInfoFormRef",
270
+ ref: r,
271
+ model: u(a),
272
+ "label-width": "120px",
273
+ rules: E
274
+ }, {
275
+ default: l(() => [
276
+ o(j, null, {
277
+ default: l(() => [
278
+ o(c, { span: 12 }, {
279
+ default: l(() => [
280
+ o(b, {
281
+ label: n.$t("goodsBrandInfo.tenantId"),
282
+ prop: "tenantId"
283
+ }, {
284
+ default: l(() => [
285
+ o(m, {
286
+ modelValue: u(a).tenantId,
287
+ "onUpdate:modelValue": d[0] || (d[0] = (s) => u(a).tenantId = s),
288
+ placeholder: n.$t("goodsBrandInfo.tenantId"),
289
+ maxlength: "16",
290
+ "show-word-limit": "",
291
+ clearable: ""
292
+ }, null, 8, ["modelValue", "placeholder"])
293
+ ]),
294
+ _: 1
295
+ }, 8, ["label"])
296
+ ]),
297
+ _: 1
298
+ }),
299
+ o(c, { span: 12 }, {
300
+ default: l(() => [
301
+ o(b, {
302
+ label: n.$t("goodsBrandInfo.brandId"),
303
+ prop: "brandId"
304
+ }, {
305
+ default: l(() => [
306
+ o(m, {
307
+ modelValue: u(a).brandId,
308
+ "onUpdate:modelValue": d[1] || (d[1] = (s) => u(a).brandId = s),
309
+ placeholder: n.$t("goodsBrandInfo.brandId"),
310
+ maxlength: "8",
311
+ "show-word-limit": "",
312
+ clearable: ""
313
+ }, null, 8, ["modelValue", "placeholder"])
314
+ ]),
315
+ _: 1
316
+ }, 8, ["label"])
317
+ ]),
318
+ _: 1
319
+ }),
320
+ o(c, { span: 12 }, {
321
+ default: l(() => [
322
+ o(b, {
323
+ label: n.$t("goodsBrandInfo.shopId"),
324
+ prop: "shopId"
325
+ }, {
326
+ default: l(() => [
327
+ o(m, {
328
+ modelValue: u(a).shopId,
329
+ "onUpdate:modelValue": d[2] || (d[2] = (s) => u(a).shopId = s),
330
+ placeholder: n.$t("goodsBrandInfo.shopId"),
331
+ maxlength: "8",
332
+ "show-word-limit": "",
333
+ clearable: ""
334
+ }, null, 8, ["modelValue", "placeholder"])
335
+ ]),
336
+ _: 1
337
+ }, 8, ["label"])
338
+ ]),
339
+ _: 1
340
+ }),
341
+ o(c, { span: 12 }, {
342
+ default: l(() => [
343
+ o(b, {
344
+ label: n.$t("goodsBrandInfo.brandName"),
345
+ prop: "brandName"
346
+ }, {
347
+ default: l(() => [
348
+ o(m, {
349
+ modelValue: u(a).brandName,
350
+ "onUpdate:modelValue": d[3] || (d[3] = (s) => u(a).brandName = s),
351
+ placeholder: n.$t("goodsBrandInfo.brandName"),
352
+ maxlength: "30",
353
+ "show-word-limit": "",
354
+ clearable: ""
355
+ }, null, 8, ["modelValue", "placeholder"])
356
+ ]),
357
+ _: 1
358
+ }, 8, ["label"])
359
+ ]),
360
+ _: 1
361
+ }),
362
+ o(c, { span: 12 }, {
363
+ default: l(() => [
364
+ o(b, {
365
+ label: n.$t("goodsBrandInfo.logoUrl"),
366
+ prop: "logoUrl"
367
+ }, {
368
+ default: l(() => [
369
+ o(m, {
370
+ modelValue: u(a).logoUrl,
371
+ "onUpdate:modelValue": d[4] || (d[4] = (s) => u(a).logoUrl = s),
372
+ placeholder: n.$t("goodsBrandInfo.logoUrl"),
373
+ maxlength: "120",
374
+ "show-word-limit": "",
375
+ clearable: ""
376
+ }, null, 8, ["modelValue", "placeholder"])
377
+ ]),
378
+ _: 1
379
+ }, 8, ["label"])
380
+ ]),
381
+ _: 1
382
+ }),
383
+ o(c, { span: 12 }, {
384
+ default: l(() => [
385
+ o(b, {
386
+ label: n.$t("goodsBrandInfo.description"),
387
+ prop: "description"
388
+ }, {
389
+ default: l(() => [
390
+ o(m, {
391
+ modelValue: u(a).description,
392
+ "onUpdate:modelValue": d[5] || (d[5] = (s) => u(a).description = s),
393
+ placeholder: n.$t("goodsBrandInfo.description"),
394
+ maxlength: "120",
395
+ "show-word-limit": "",
396
+ clearable: ""
397
+ }, null, 8, ["modelValue", "placeholder"])
398
+ ]),
399
+ _: 1
400
+ }, 8, ["label"])
401
+ ]),
402
+ _: 1
403
+ }),
404
+ o(c, { span: 12 }, {
405
+ default: l(() => [
406
+ o(b, {
407
+ label: n.$t("goodsBrandInfo.orderBy"),
408
+ prop: "orderBy"
409
+ }, {
410
+ default: l(() => [
411
+ o(m, {
412
+ modelValue: u(a).orderBy,
413
+ "onUpdate:modelValue": d[6] || (d[6] = (s) => u(a).orderBy = s),
414
+ placeholder: n.$t("goodsBrandInfo.orderBy"),
415
+ maxlength: "5",
416
+ "show-word-limit": "",
417
+ clearable: ""
418
+ }, null, 8, ["modelValue", "placeholder"])
419
+ ]),
420
+ _: 1
421
+ }, 8, ["label"])
422
+ ]),
423
+ _: 1
424
+ }),
425
+ o(c, { span: 12 }, {
426
+ default: l(() => [
427
+ o(b, {
428
+ label: n.$t("goodsBrandInfo.status"),
429
+ prop: "status"
430
+ }, {
431
+ default: l(() => [
432
+ o(m, {
433
+ modelValue: u(a).status,
434
+ "onUpdate:modelValue": d[7] || (d[7] = (s) => u(a).status = s),
435
+ placeholder: n.$t("goodsBrandInfo.status"),
436
+ maxlength: "1",
437
+ "show-word-limit": "",
438
+ clearable: ""
439
+ }, null, 8, ["modelValue", "placeholder"])
440
+ ]),
441
+ _: 1
442
+ }, 8, ["label"])
443
+ ]),
444
+ _: 1
445
+ })
446
+ ]),
447
+ _: 1
448
+ })
449
+ ]),
450
+ _: 1
451
+ }, 8, ["model", "rules"])
452
+ ]),
453
+ _: 1
454
+ }, 8, ["modelValue"]);
455
+ };
456
+ }
457
+ }), J = /* @__PURE__ */ G(H, [["__scopeId", "data-v-375e37af"]]), oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
458
+ __proto__: null,
459
+ default: J
460
+ }, Symbol.toStringTag, { value: "Module" }));
461
+ export {
462
+ J as a,
463
+ oe as e,
464
+ _ as g
465
+ };