xyvcard-goods 0.0.22 → 0.0.23

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