xyvcard-goods 0.0.8 → 0.0.10

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