xyvcard-goods 0.0.7 → 0.0.9

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