xyvcard-goods 0.0.18 → 0.0.20

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.
Files changed (40) hide show
  1. package/dist/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  2. package/dist/edit-Bb2XgE0h.mjs +590 -0
  3. package/dist/edit-BcokSKfN.mjs +183 -0
  4. package/dist/{edit-E57LIt5x.mjs → edit-Cj13W2TC.mjs} +1 -1
  5. package/dist/edit-DxnsmaXV.mjs +186 -0
  6. package/dist/{edit.vue_vue_type_script_setup_true_lang-BHplO2tN.mjs → edit.vue_vue_type_script_setup_true_lang-D2w1583D.mjs} +1 -1
  7. package/dist/{goodsList-0TMcPn_Q.mjs → goodsList-DOXK1EwK.mjs} +1 -1
  8. package/dist/goodsList.vue_vue_type_script_setup_true_lang-COJVlEjX.mjs +713 -0
  9. package/dist/index-BmOxm1P2.mjs +324 -0
  10. package/dist/index-C3FT_Oe7.mjs +318 -0
  11. package/dist/{index-CnyW3rxw.mjs → index-CGAoZY87.mjs} +2 -2
  12. package/dist/index-D3w33Nba.mjs +301 -0
  13. package/dist/{index-nSAowuoJ.mjs → index-DAJiqOCh.mjs} +2 -2
  14. package/dist/index-DR7GlHNd.mjs +1288 -0
  15. package/dist/index-jTDhsbYM.mjs +141 -0
  16. package/dist/index-r0u-27m7.mjs +141 -0
  17. package/dist/index.mjs +321 -284
  18. package/dist/info-DImlMNq0.mjs +365 -0
  19. package/dist/{skuForm-H9IDa7ys.mjs → skuForm-Bt3arW0s.mjs} +157 -108
  20. package/dist/skuTable-Ahc3WlPp.mjs +639 -0
  21. package/dist/style.css +1 -1
  22. package/dts/api/dict.d.ts +6 -0
  23. package/dts/api/goods-brand-info/index.d.ts +20 -0
  24. package/dts/api/goods-brand-info/types.d.ts +73 -0
  25. package/dts/api/goods-label-info/index.d.ts +20 -0
  26. package/dts/api/goods-label-info/types.d.ts +70 -0
  27. package/dts/api/goods-sku/types.d.ts +2 -0
  28. package/dts/api/goods-spu/types.d.ts +13 -0
  29. package/dts/api/index.d.ts +3 -1
  30. package/dts/lang/goods/zh-cn.d.ts +35 -0
  31. package/dts/views/goods/goods-brand-info/edit.vue.d.ts +22 -0
  32. package/dts/views/goods/goods-brand-info/index.vue.d.ts +2 -0
  33. package/dts/views/goods/goods-label-info/edit.vue.d.ts +22 -0
  34. package/dts/views/goods/goods-label-info/index.vue.d.ts +2 -0
  35. package/package.json +2 -2
  36. package/dist/edit-CYk6B5NG.mjs +0 -529
  37. package/dist/goodsList.vue_vue_type_script_setup_true_lang-Cd7-ryQA.mjs +0 -626
  38. package/dist/index-CmKF2zdn.mjs +0 -272
  39. package/dist/info-D6MWRZ1y.mjs +0 -306
  40. package/dist/skuTable-DbNThlFG.mjs +0 -553
@@ -1,553 +0,0 @@
1
- import { defineComponent as O, ref as C, computed as q, watch as $, resolveComponent as v, openBlock as _, createElementBlock as U, createElementVNode as g, createVNode as n, withCtx as d, createTextVNode as S, createCommentVNode as F, Fragment as M, renderList as G, createBlock as x, toDisplayString as D, unref as z } from "vue";
2
- import { D as K } from "./index-CmKF2zdn.mjs";
3
- import { fileApi as E } from "jmash-core";
4
- const H = (a, h) => {
5
- const s = a.__vccOpts || a;
6
- for (const [u, w] of h)
7
- s[u] = w;
8
- return s;
9
- };
10
- function J(a, h = [], s) {
11
- const { optionValue: u = "id", optionText: w = "name" } = s || {}, k = [];
12
- let b = 0;
13
- const I = {}, y = Q(a);
14
- if (a.length === 0) return k;
15
- a.forEach((V) => {
16
- const { specValueList: o } = V;
17
- if (!o || o.length === 0) return !0;
18
- b = (b || 1) * o.length;
19
- }), h.forEach((V) => {
20
- const { specs: o, ...t } = V;
21
- I[o.map((i) => `${i.specId}_${i.specValueId}`).join("|")] = t;
22
- });
23
- for (let V = 0; V < b; V++) {
24
- const o = [], t = [];
25
- a.forEach((r, c) => {
26
- const { specValueList: e } = r;
27
- let m = {};
28
- if (!e || e.length === 0) return !0;
29
- if (e.length > 1) {
30
- const f = Math.floor(V / y[c]) % e.length;
31
- m = a[c].specValueList[f];
32
- } else
33
- m = a[c].specValueList[0];
34
- !r[u] || !m[u] || (t.push(`${r[u]}_${m[u]}`), o.push({
35
- specId: r[u],
36
- specName: r[w],
37
- specValueId: m[u],
38
- specValueName: m[w]
39
- }));
40
- });
41
- const { ...i } = I[t.join("|")] || {};
42
- k.push({ ...i, specs: o });
43
- }
44
- return k;
45
- }
46
- function Q(a) {
47
- const h = [];
48
- for (let s = a.length - 1; s >= 0; s--)
49
- a[s + 1] && a[s + 1].specValueList ? h[s] = a[s + 1].specValueList.length * h[s + 1] || 1 : h[s] = 1;
50
- return h;
51
- }
52
- function L(a) {
53
- return Array.from(new Set(a));
54
- }
55
- function R(a, h) {
56
- return a = L(a), h = L(h), a.concat(h).filter((s) => !(a.includes(s) && h.includes(s)));
57
- }
58
- const W = { key: 0 }, X = { class: "title-set" }, Y = { class: "right-dis" }, Z = { class: "right-dis" }, ee = { class: "right-dis" }, le = { class: "right-dis" }, te = { class: "right-dis" }, oe = { class: "right-dis" }, se = { key: 0 }, ae = { key: 1 }, ne = /* @__PURE__ */ O({
59
- __name: "skuTable",
60
- props: {
61
- specData: {
62
- type: Array,
63
- default() {
64
- return [];
65
- }
66
- },
67
- goodsSku: {
68
- type: Array,
69
- default() {
70
- return [];
71
- }
72
- },
73
- // 是否显示批量设置,主要是用于详情展示
74
- isSettingShow: {
75
- type: Boolean,
76
- default: !0
77
- }
78
- },
79
- emits: ["getGoodsSku", "getFormData"],
80
- setup(a, { emit: h }) {
81
- const s = C({
82
- salePrice: 0,
83
- marketPrice: 0,
84
- costPrice: 0,
85
- weight: 0,
86
- volume: 0,
87
- stock: 0
88
- }), u = C([]), w = h, k = a, b = q(() => {
89
- let o = J(k.specData, [], {}).map((i) => ({
90
- specValues: i.specs,
91
- specIds: i.specs.reduce(
92
- (r, c, e) => `${r}${c.specId}-${c.specValueId}${e === i.specs.length - 1 ? "" : "_"}`,
93
- ""
94
- )
95
- })), t = k.goodsSku.map((i) => {
96
- var r;
97
- return {
98
- ...i,
99
- specIds: (r = i.specValues) == null ? void 0 : r.reduce(
100
- (c, e, m) => `${c}${e.specId}-${e.specValueId}${m === i.specValues.length - 1 ? "" : "_"}`,
101
- ""
102
- )
103
- };
104
- });
105
- return o.forEach((i) => {
106
- t.forEach((r) => {
107
- let c = i.specIds.split("_"), e = r.specIds.split("_"), m = !0;
108
- c.forEach((f) => {
109
- e.find((P) => P == f) || (m = !1);
110
- }), m && (i.picUrl = r.picUrl ? r.picUrl : "", i.skuCode = r.skuCode ? r.skuCode : void 0, i.skuId = r.skuId ? r.skuId : void 0, i.salePrice = r.salePrice, i.marketPrice = r.marketPrice, i.costPrice = r.costPrice, i.stock = r.stock, i.weight = r.weight, i.volume = r.volume, i.status = r.status);
111
- });
112
- }), o;
113
- });
114
- $(
115
- b,
116
- (o, t) => {
117
- var r, c;
118
- if (!o || !o.length) return u.value = [];
119
- if (!t || !t.length)
120
- return;
121
- if (((r = o[0].specValues) == null ? void 0 : r.length) !== ((c = t[0].specValues) == null ? void 0 : c.length))
122
- return u.value = o.map((e) => ({
123
- ...e,
124
- picUrl: "",
125
- skuCode: void 0,
126
- salePrice: 0,
127
- marketPrice: void 0,
128
- costPrice: void 0,
129
- stock: 0,
130
- weight: void 0,
131
- volume: void 0,
132
- status: !0
133
- }));
134
- if (o.length === t.length)
135
- return u.value = o.map((e, m) => ({
136
- ...u.value[m],
137
- ...e
138
- }));
139
- const i = I(o, t);
140
- if (o.length > t.length) {
141
- let e = [];
142
- o.forEach((m) => {
143
- const f = u.value.find(
144
- (P) => P.specIds === m.specIds
145
- );
146
- f ? e.push(f) : e.push({
147
- ...m,
148
- picUrl: "",
149
- skuCode: void 0,
150
- salePrice: 0,
151
- marketPrice: void 0,
152
- costPrice: void 0,
153
- stock: 0,
154
- weight: void 0,
155
- volume: void 0,
156
- status: !0
157
- });
158
- }), u.value = e;
159
- } else
160
- u.value = u.value.filter(
161
- (e) => !i.includes(e.specIds)
162
- );
163
- u.value = o.map((e) => ({
164
- ...e,
165
- picUrl: e.picUrl ? e.picUrl : "",
166
- skuCode: e.skuCode ? e.skuCode : void 0,
167
- salePrice: e.salePrice ? e.salePrice : 0,
168
- marketPrice: e.marketPrice ? e.marketPrice : void 0,
169
- costPrice: e.costPrice ? e.costPrice : void 0,
170
- stock: e.stock ? e.stock : 0,
171
- weight: e.weight ? e.weight : void 0,
172
- volume: e.volume ? e.volume : void 0,
173
- status: e.status ? e.status : !0
174
- }));
175
- },
176
- {
177
- deep: !0,
178
- immediate: !0
179
- }
180
- ), $(
181
- u,
182
- (o) => {
183
- w("getFormData", o);
184
- },
185
- {
186
- deep: !0,
187
- immediate: !0
188
- }
189
- );
190
- function I(o, t) {
191
- return o = o.map((i) => i.specIds), t = t.map((i) => i.specIds), R(o, t);
192
- }
193
- function y() {
194
- u.value.forEach((o) => {
195
- o.salePrice = s.value.salePrice, o.marketPrice = s.value.marketPrice, o.costPrice = s.value.costPrice, o.weight = s.value.weight, o.volume = s.value.volume, o.stock = s.value.stock;
196
- });
197
- }
198
- function V(o, t) {
199
- t.picUrl = o;
200
- }
201
- return (o, t) => {
202
- const i = v("Setting"), r = v("el-icon"), c = v("el-input-number"), e = v("el-tooltip"), m = v("el-button"), f = v("el-table-column"), P = v("jmash-single-image-upload"), j = v("el-image"), A = v("el-input"), N = v("el-switch"), T = v("el-table");
203
- return _(), U("div", null, [
204
- a.isSettingShow ? (_(), U("div", W, [
205
- g("div", X, [
206
- n(r, null, {
207
- default: d(() => [
208
- n(i)
209
- ]),
210
- _: 1
211
- }),
212
- t[6] || (t[6] = S(" 批量设置 "))
213
- ]),
214
- g("span", Y, [
215
- n(e, {
216
- class: "box-item",
217
- effect: "dark",
218
- content: "销售价(元)",
219
- placement: "top-start"
220
- }, {
221
- default: d(() => [
222
- n(c, {
223
- modelValue: s.value.salePrice,
224
- "onUpdate:modelValue": t[0] || (t[0] = (l) => s.value.salePrice = l),
225
- precision: 2,
226
- size: "small",
227
- placeholder: "销售价(元)",
228
- "controls-position": "right"
229
- }, null, 8, ["modelValue"])
230
- ]),
231
- _: 1
232
- })
233
- ]),
234
- g("span", Z, [
235
- n(e, {
236
- class: "box-item",
237
- effect: "dark",
238
- content: "市场价(元)",
239
- placement: "top-start"
240
- }, {
241
- default: d(() => [
242
- n(c, {
243
- modelValue: s.value.marketPrice,
244
- "onUpdate:modelValue": t[1] || (t[1] = (l) => s.value.marketPrice = l),
245
- precision: 2,
246
- size: "small",
247
- placeholder: "市场价(元)",
248
- "controls-position": "right"
249
- }, null, 8, ["modelValue"])
250
- ]),
251
- _: 1
252
- })
253
- ]),
254
- g("span", ee, [
255
- n(e, {
256
- class: "box-item",
257
- effect: "dark",
258
- content: "成本价(元)",
259
- placement: "top-start"
260
- }, {
261
- default: d(() => [
262
- n(c, {
263
- modelValue: s.value.costPrice,
264
- "onUpdate:modelValue": t[2] || (t[2] = (l) => s.value.costPrice = l),
265
- precision: 2,
266
- size: "small",
267
- placeholder: "成本价(元)",
268
- "controls-position": "right"
269
- }, null, 8, ["modelValue"])
270
- ]),
271
- _: 1
272
- })
273
- ]),
274
- g("span", le, [
275
- n(e, {
276
- class: "box-item",
277
- effect: "dark",
278
- content: "重量(kg)",
279
- placement: "top-start"
280
- }, {
281
- default: d(() => [
282
- n(c, {
283
- modelValue: s.value.weight,
284
- "onUpdate:modelValue": t[3] || (t[3] = (l) => s.value.weight = l),
285
- precision: 2,
286
- size: "small",
287
- placeholder: "重量(kg)",
288
- "controls-position": "right"
289
- }, null, 8, ["modelValue"])
290
- ]),
291
- _: 1
292
- })
293
- ]),
294
- g("span", te, [
295
- n(e, {
296
- class: "box-item",
297
- effect: "dark",
298
- content: "体积(m³)",
299
- placement: "top-start"
300
- }, {
301
- default: d(() => [
302
- n(c, {
303
- modelValue: s.value.volume,
304
- "onUpdate:modelValue": t[4] || (t[4] = (l) => s.value.volume = l),
305
- precision: 2,
306
- size: "small",
307
- placeholder: "体积(m³)",
308
- "controls-position": "right"
309
- }, null, 8, ["modelValue"])
310
- ]),
311
- _: 1
312
- })
313
- ]),
314
- g("span", oe, [
315
- n(e, {
316
- class: "box-item",
317
- effect: "dark",
318
- content: "库存",
319
- placement: "top-start"
320
- }, {
321
- default: d(() => [
322
- n(c, {
323
- modelValue: s.value.stock,
324
- "onUpdate:modelValue": t[5] || (t[5] = (l) => s.value.stock = l),
325
- precision: 0,
326
- size: "small",
327
- placeholder: "库存",
328
- "controls-position": "right"
329
- }, null, 8, ["modelValue"])
330
- ]),
331
- _: 1
332
- })
333
- ]),
334
- n(m, {
335
- type: "primary",
336
- size: "small",
337
- onClick: y
338
- }, {
339
- default: d(() => t[7] || (t[7] = [
340
- S("设置")
341
- ])),
342
- _: 1,
343
- __: [7]
344
- })
345
- ])) : F("", !0),
346
- n(T, {
347
- data: u.value,
348
- class: "w-full top-dis"
349
- }, {
350
- default: d(() => [
351
- n(f, { type: "index" }),
352
- (_(!0), U(M, null, G(a.specData, (l, p) => (_(), x(f, {
353
- key: l.id,
354
- prop: l.id,
355
- label: l.name
356
- }, {
357
- default: d((B) => [
358
- S(D(B.row.specValues[p].specValueName), 1)
359
- ]),
360
- _: 2
361
- }, 1032, ["prop", "label"]))), 128)),
362
- n(f, {
363
- prop: "picUrl",
364
- label: "图片"
365
- }, {
366
- default: d((l) => [
367
- a.isSettingShow ? (_(), x(P, {
368
- key: 0,
369
- "picture-url": l.row.picUrl,
370
- onImageSrc: (p) => V(p, l.row)
371
- }, null, 8, ["picture-url", "onImageSrc"])) : (_(), x(j, {
372
- key: 1,
373
- "preview-teleported": "",
374
- style: { width: "80px", height: "80px" },
375
- src: z(E).imageUrl(l.row.picUrl, 80, 80),
376
- "zoom-rate": 1.2,
377
- "max-scale": 7,
378
- "min-scale": 0.2,
379
- "preview-src-list": [z(E).imageUrl(l.row.picUrl)],
380
- fit: "cover"
381
- }, null, 8, ["src", "preview-src-list"]))
382
- ]),
383
- _: 1
384
- }),
385
- n(f, {
386
- prop: "salePrice",
387
- label: "销售价(元)",
388
- width: "150"
389
- }, {
390
- header: d(() => t[8] || (t[8] = [
391
- g("span", { class: "required_red" }, "*", -1),
392
- g("span", null, "销售价(元)", -1)
393
- ])),
394
- default: d((l) => [
395
- g("span", null, [
396
- n(c, {
397
- modelValue: l.row.salePrice,
398
- "onUpdate:modelValue": (p) => l.row.salePrice = p,
399
- precision: 2,
400
- size: "small",
401
- controls: !1,
402
- class: "w-full",
403
- disabled: !a.isSettingShow
404
- }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
405
- ])
406
- ]),
407
- _: 1
408
- }),
409
- n(f, {
410
- prop: "marketPrice",
411
- label: "市场价(元)"
412
- }, {
413
- default: d((l) => [
414
- g("span", null, [
415
- n(c, {
416
- modelValue: l.row.marketPrice,
417
- "onUpdate:modelValue": (p) => l.row.marketPrice = p,
418
- precision: 2,
419
- size: "small",
420
- controls: !1,
421
- class: "w-full",
422
- disabled: !a.isSettingShow
423
- }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
424
- ])
425
- ]),
426
- _: 1
427
- }),
428
- n(f, {
429
- prop: "costPrice",
430
- label: "成本价(元)"
431
- }, {
432
- default: d((l) => [
433
- g("span", null, [
434
- n(c, {
435
- modelValue: l.row.costPrice,
436
- "onUpdate:modelValue": (p) => l.row.costPrice = p,
437
- precision: 2,
438
- size: "small",
439
- controls: !1,
440
- class: "w-full",
441
- disabled: !a.isSettingShow
442
- }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
443
- ])
444
- ]),
445
- _: 1
446
- }),
447
- n(f, {
448
- prop: "weight",
449
- label: "重量(kg)"
450
- }, {
451
- default: d((l) => [
452
- g("span", null, [
453
- n(c, {
454
- modelValue: l.row.weight,
455
- "onUpdate:modelValue": (p) => l.row.weight = p,
456
- precision: 2,
457
- size: "small",
458
- controls: !1,
459
- class: "w-full",
460
- disabled: !a.isSettingShow
461
- }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
462
- ])
463
- ]),
464
- _: 1
465
- }),
466
- n(f, {
467
- prop: "volume",
468
- label: "体积(m³)"
469
- }, {
470
- default: d((l) => [
471
- g("span", null, [
472
- n(c, {
473
- modelValue: l.row.volume,
474
- "onUpdate:modelValue": (p) => l.row.volume = p,
475
- precision: 2,
476
- size: "small",
477
- controls: !1,
478
- class: "w-full",
479
- disabled: !a.isSettingShow
480
- }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
481
- ])
482
- ]),
483
- _: 1
484
- }),
485
- n(f, {
486
- prop: "stock",
487
- label: "库存"
488
- }, {
489
- header: d(() => t[9] || (t[9] = [
490
- g("span", { class: "required_red" }, "*", -1),
491
- g("span", null, "库存", -1)
492
- ])),
493
- default: d((l) => [
494
- g("span", null, [
495
- n(c, {
496
- modelValue: l.row.stock,
497
- "onUpdate:modelValue": (p) => l.row.stock = p,
498
- precision: 2,
499
- size: "small",
500
- controls: !1,
501
- class: "w-full",
502
- disabled: !a.isSettingShow
503
- }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
504
- ])
505
- ]),
506
- _: 1
507
- }),
508
- n(f, {
509
- prop: "skuCode",
510
- label: "sku编码"
511
- }, {
512
- default: d((l) => [
513
- g("span", null, [
514
- n(A, {
515
- modelValue: l.row.skuCode,
516
- "onUpdate:modelValue": (p) => l.row.skuCode = p,
517
- size: "small",
518
- disabled: !a.isSettingShow
519
- }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
520
- ])
521
- ]),
522
- _: 1
523
- }),
524
- n(f, {
525
- prop: "status",
526
- label: "是否上架",
527
- width: "80"
528
- }, {
529
- default: d((l) => [
530
- a.isSettingShow ? (_(), U("span", se, [
531
- n(N, {
532
- modelValue: l.row.status,
533
- "onUpdate:modelValue": (p) => l.row.status = p
534
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
535
- ])) : (_(), U("span", ae, D(z(K).shelfDict.getValue(l.row.status)), 1))
536
- ]),
537
- _: 1
538
- })
539
- ]),
540
- _: 1
541
- }, 8, ["data"])
542
- ]);
543
- };
544
- }
545
- }), ie = /* @__PURE__ */ H(ne, [["__scopeId", "data-v-84542ec3"]]), de = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
546
- __proto__: null,
547
- default: ie
548
- }, Symbol.toStringTag, { value: "Module" }));
549
- export {
550
- H as _,
551
- de as a,
552
- ie as s
553
- };