xyvcard-goods 0.0.21 → 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 (44) hide show
  1. package/dist/ImageUpload-Dk6GY6PA.mjs +93 -0
  2. package/dist/{edit-DFc_TNP3.mjs → edit-9jPSycsG.mjs} +148 -212
  3. package/dist/edit-CJpoa4Ck.mjs +368 -0
  4. package/dist/{edit-DxnsmaXV.mjs → edit-CWQMgvVP.mjs} +38 -38
  5. package/dist/{edit-CkR-I5aJ.mjs → edit-DU-BEAcq.mjs} +1 -1
  6. package/dist/{edit-BcokSKfN.mjs → edit-Ziwv43v0.mjs} +27 -27
  7. package/dist/edit.vue_vue_type_script_setup_true_lang-BP0C4d2-.mjs +24173 -0
  8. package/dist/{goodsList-HmPAwD_C.mjs → goodsList-2AwsJVoO.mjs} +1 -1
  9. package/dist/{goodsList-TX2ZnRR9.mjs → goodsList-CyWliLjg.mjs} +1 -1
  10. package/dist/{goodsList.vue_vue_type_script_setup_true_lang-CGV1dm3W.mjs → goodsList.vue_vue_type_script_setup_true_lang-Bq06GIMe.mjs} +2 -2
  11. package/dist/{goodsList.vue_vue_type_script_setup_true_lang-f1Fc6pbd.mjs → goodsList.vue_vue_type_script_setup_true_lang-DjKzEAB7.mjs} +136 -147
  12. package/dist/{index-B0SXNsHW.mjs → index-8E7BciYp.mjs} +7 -7
  13. package/dist/{index-Dt3PP8dN.mjs → index-B1H5hqEi.mjs} +2 -2
  14. package/dist/{index-BZw9XfQo.mjs → index-B88acg0Q.mjs} +2 -2
  15. package/dist/{index-VFsDup14.mjs → index-BdP_dXBK.mjs} +3 -3
  16. package/dist/index-C7oatDPl.mjs +4432 -0
  17. package/dist/{index-Ctva-XF0.mjs → index-DPjR32Kv.mjs} +3 -3
  18. package/dist/{index-r0u-27m7.mjs → index-DR3Gk44r.mjs} +1 -1
  19. package/dist/index-jCpYt-EU.mjs +221 -0
  20. package/dist/index.mjs +6 -2864
  21. package/dist/info-BEMxnD6-.mjs +325 -0
  22. package/dist/{info-BTKv0IRt.mjs → info-DFIeVs66.mjs} +3 -3
  23. package/dist/{skuForm-C7rF2noo.mjs → skuForm-BhAbf2AG.mjs} +2 -2
  24. package/dist/skuForm-C2aQcL90.mjs +314 -0
  25. package/dist/{skuTable-CEwT-I1Q.mjs → skuTable-9JJqGeRx.mjs} +255 -208
  26. package/dist/style.css +1 -1
  27. package/dts/api/dict.d.ts +3 -0
  28. package/dts/api/goods-spu/index.d.ts +4 -1
  29. package/dts/api/goods-spu/types.d.ts +28 -0
  30. package/dts/api/index.d.ts +2 -1
  31. package/dts/index.d.ts +4 -0
  32. package/dts/lang/goods/zh-cn.d.ts +5 -1
  33. package/dts/router/index.d.ts +1 -0
  34. package/dts/views/goods/goods-combination/skuForm.vue.d.ts +0 -9
  35. package/package.json +3 -2
  36. package/dist/edit-tCGa_9Kt.mjs +0 -507
  37. package/dist/edit.vue_vue_type_script_setup_true_lang-BlNwikUO.mjs +0 -234
  38. package/dist/index-CqOoZ5xQ.mjs +0 -305
  39. package/dist/index-DR7GlHNd.mjs +0 -1288
  40. package/dist/index-jTDhsbYM.mjs +0 -141
  41. package/dist/info-CrghLmS4.mjs +0 -365
  42. package/dist/sku-B-IzfYLq.mjs +0 -52
  43. package/dist/skuForm-D2n8sQJo.mjs +0 -475
  44. package/dist/skuTable-D-awlXgj.mjs +0 -592
@@ -1,475 +0,0 @@
1
- import { defineComponent as te, ref as S, computed as se, watch as $, resolveComponent as i, openBlock as m, createElementBlock as g, Fragment as k, unref as M, createVNode as o, withCtx as a, createCommentVNode as I, renderList as P, createElementVNode as b, toDisplayString as O, createTextVNode as y, createBlock as w } from "vue";
2
- import { C as D, D as ue, S as Y, a as ne } from "./index-CqOoZ5xQ.mjs";
3
- import re from "./skuTable-D-awlXgj.mjs";
4
- import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
5
- const pe = { key: 0 }, ce = {
6
- key: 1,
7
- class: "w-full"
8
- }, ie = { class: "goods-title" }, me = ["onClick"], fe = { class: "goods-content" }, ve = { class: "goods-tag" }, Ve = /* @__PURE__ */ te({
9
- __name: "skuForm",
10
- props: {
11
- // 规格类型
12
- specType: {
13
- type: String,
14
- default: () => ""
15
- },
16
- form: {
17
- type: Object,
18
- default: () => {
19
- }
20
- }
21
- },
22
- emits: ["getGoodsSku", "getFormData"],
23
- setup(H, { emit: J }) {
24
- var F, q, T;
25
- const r = S({
26
- picUrl: "",
27
- salePrice: 0,
28
- salePriceV2: 0,
29
- salePriceV3: 0,
30
- marketPrice: 0,
31
- costPrice: 0,
32
- weight: 0,
33
- volume: 0,
34
- stock: 0,
35
- skuCode: ""
36
- }), u = S([]), C = S(), _ = S([]), h = S([]), E = S([]), v = H, L = J, U = se(() => u.value.filter(
37
- (e) => e.name && e.specValueList != null && e.specValueList.length
38
- ));
39
- $(
40
- v.form,
41
- (e) => e,
42
- {
43
- deep: !0,
44
- immediate: !0
45
- }
46
- ), $(
47
- r,
48
- (e) => {
49
- L("getGoodsSku", e);
50
- },
51
- {
52
- deep: !0,
53
- immediate: !0
54
- }
55
- ), $(
56
- U,
57
- (e) => e,
58
- {
59
- deep: !0,
60
- immediate: !0
61
- }
62
- ), v.form.spuId && (v.form.specType === D.SPEC_TYPE.UNIFIED_SPEC ? r.value = (F = v.form.skuList) == null ? void 0 : F.results[0] : (E.value = (q = v.form.skuList) == null ? void 0 : q.results, (T = v.form.skuList) == null || T.results.forEach((e) => {
63
- var l;
64
- (l = e.specValues) == null || l.map((t) => {
65
- ue.specInfoDict.useValues().then((n) => {
66
- const d = n.find((f) => t.specId === f.key);
67
- if (d) {
68
- let f = {
69
- id: t.specId,
70
- name: d.value,
71
- specValueList: []
72
- };
73
- u.value.push(f);
74
- }
75
- const p = /* @__PURE__ */ new Map();
76
- u.value = u.value.filter(
77
- (f) => !p.has(f.id) && p.set(f.id, f)
78
- ), K(t.specValueId);
79
- });
80
- });
81
- })));
82
- function K(e) {
83
- u.value.forEach((l) => {
84
- _.value = new Y({ specId: l.id }), _.value.useValues().then((t) => {
85
- t.forEach((n) => {
86
- if (n.key === e) {
87
- let p = {
88
- id: e,
89
- name: n.value
90
- };
91
- l.specValueList.push(p);
92
- }
93
- const d = /* @__PURE__ */ new Map();
94
- l.specValueList = l.specValueList.filter(
95
- (p) => !d.has(p.id) && d.set(p.id, p)
96
- );
97
- });
98
- });
99
- });
100
- }
101
- function Q(e) {
102
- u.value.splice(e, 1);
103
- }
104
- function W(e, l) {
105
- u.value[e].specValueList.splice(l, 1);
106
- }
107
- function X() {
108
- h.value = new ne({ shopId: v.form.shopId }), h.value.useValues().then((e) => {
109
- e.forEach((l) => {
110
- Array.isArray(u.value) && u.value.length > 0 && u.value.forEach((t) => {
111
- l.key === t.id && (l.disabled = !0);
112
- });
113
- });
114
- });
115
- }
116
- function Z(e) {
117
- let l = h.value.values.filter((n) => n.key === e), t = {
118
- id: l[0].key,
119
- name: l[0].value,
120
- specValueList: []
121
- };
122
- u.value.push(t), C.value = "";
123
- }
124
- function z(e) {
125
- _.value = new Y({
126
- specId: u.value[e].id
127
- }), _.value.useValues().then((l) => {
128
- l.map((t) => {
129
- Array.isArray(u.value[e].specValueList) && u.value[e].specValueList.length > 0 && u.value[e].specValueList.forEach((n) => {
130
- t.key === n.id && (t.disabled = !0);
131
- });
132
- });
133
- });
134
- }
135
- function x(e, l) {
136
- var d, p;
137
- let t = _.value.values.filter((f) => f.key === e), n = {
138
- id: t[0].key,
139
- name: t[0].value
140
- };
141
- (p = (d = u.value[l]) == null ? void 0 : d.specValueList) == null || p.push(n), u.value[l].specValueId = "";
142
- }
143
- function ee(e) {
144
- L("getFormData", e);
145
- }
146
- return (e, l) => {
147
- const t = i("el-input-number"), n = i("el-form-item"), d = i("el-col"), p = i("el-row"), f = i("Delete"), le = i("el-icon"), oe = i("el-tag"), R = i("el-button"), N = i("el-option"), j = i("el-select"), A = i("el-popover"), B = i("el-tab-pane"), G = i("el-tabs");
148
- return m(), g(k, null, [
149
- v.specType == M(D).SPEC_TYPE.UNIFIED_SPEC ? (m(), g("div", pe, [
150
- o(p, null, {
151
- default: a(() => [
152
- o(d, { span: 6 }, {
153
- default: a(() => [
154
- o(n, {
155
- label: e.$t("goodsSpu.salePrice"),
156
- prop: "salePrice"
157
- }, {
158
- default: a(() => [
159
- o(t, {
160
- modelValue: r.value.salePrice,
161
- "onUpdate:modelValue": l[0] || (l[0] = (s) => r.value.salePrice = s),
162
- precision: 2,
163
- step: 0,
164
- min: 0.01,
165
- placeholder: e.$t("goodsSpu.salePriceRequired"),
166
- class: "w-full",
167
- controls: !1
168
- }, null, 8, ["modelValue", "placeholder"])
169
- ]),
170
- _: 1
171
- }, 8, ["label"])
172
- ]),
173
- _: 1
174
- }),
175
- o(d, { span: 6 }, {
176
- default: a(() => [
177
- o(n, {
178
- label: e.$t("goodsSpu.salePriceV2"),
179
- prop: "salePriceV2"
180
- }, {
181
- default: a(() => [
182
- o(t, {
183
- modelValue: r.value.salePriceV2,
184
- "onUpdate:modelValue": l[1] || (l[1] = (s) => r.value.salePriceV2 = s),
185
- precision: 2,
186
- step: 0,
187
- min: 0.01,
188
- placeholder: e.$t("goodsSpu.salePriceV2Required"),
189
- class: "w-full",
190
- controls: !1
191
- }, null, 8, ["modelValue", "placeholder"])
192
- ]),
193
- _: 1
194
- }, 8, ["label"])
195
- ]),
196
- _: 1
197
- }),
198
- o(d, { span: 6 }, {
199
- default: a(() => [
200
- o(n, {
201
- label: e.$t("goodsSpu.salePriceV3"),
202
- prop: "salePriceV3"
203
- }, {
204
- default: a(() => [
205
- o(t, {
206
- modelValue: r.value.salePriceV3,
207
- "onUpdate:modelValue": l[2] || (l[2] = (s) => r.value.salePriceV3 = s),
208
- precision: 2,
209
- step: 0,
210
- min: 0.01,
211
- placeholder: e.$t("goodsSpu.salePriceV3Required"),
212
- class: "w-full",
213
- controls: !1
214
- }, null, 8, ["modelValue", "placeholder"])
215
- ]),
216
- _: 1
217
- }, 8, ["label"])
218
- ]),
219
- _: 1
220
- }),
221
- o(d, { span: 6 }, {
222
- default: a(() => [
223
- o(n, {
224
- label: e.$t("goodsSpu.marketPrice"),
225
- prop: "marketPrice"
226
- }, {
227
- default: a(() => [
228
- o(t, {
229
- modelValue: r.value.marketPrice,
230
- "onUpdate:modelValue": l[3] || (l[3] = (s) => r.value.marketPrice = s),
231
- precision: 2,
232
- step: 0,
233
- min: 0.01,
234
- placeholder: e.$t("goodsSpu.marketPriceRequired"),
235
- class: "w-full",
236
- controls: !1
237
- }, null, 8, ["modelValue", "placeholder"])
238
- ]),
239
- _: 1
240
- }, 8, ["label"])
241
- ]),
242
- _: 1
243
- }),
244
- o(d, { span: 6 }, {
245
- default: a(() => [
246
- o(n, {
247
- label: e.$t("goodsSpu.costPrice"),
248
- prop: "costPrice"
249
- }, {
250
- default: a(() => [
251
- o(t, {
252
- modelValue: r.value.costPrice,
253
- "onUpdate:modelValue": l[4] || (l[4] = (s) => r.value.costPrice = s),
254
- precision: 2,
255
- step: 0,
256
- min: 0.01,
257
- placeholder: e.$t("goodsSpu.costPriceRequired"),
258
- class: "w-full",
259
- controls: !1
260
- }, null, 8, ["modelValue", "placeholder"])
261
- ]),
262
- _: 1
263
- }, 8, ["label"])
264
- ]),
265
- _: 1
266
- }),
267
- o(d, { span: 6 }, {
268
- default: a(() => [
269
- o(n, {
270
- label: e.$t("goodsSpu.stock"),
271
- prop: "stock"
272
- }, {
273
- default: a(() => [
274
- o(t, {
275
- modelValue: r.value.stock,
276
- "onUpdate:modelValue": l[5] || (l[5] = (s) => r.value.stock = s),
277
- placeholder: e.$t("goodsSpu.stockRequired"),
278
- class: "w-full",
279
- controls: !1,
280
- precision: 0,
281
- min: 0
282
- }, null, 8, ["modelValue", "placeholder"])
283
- ]),
284
- _: 1
285
- }, 8, ["label"])
286
- ]),
287
- _: 1
288
- }),
289
- o(d, { span: 6 }, {
290
- default: a(() => [
291
- o(n, {
292
- label: e.$t("goodsSpu.weight"),
293
- prop: "weight"
294
- }, {
295
- default: a(() => [
296
- o(t, {
297
- modelValue: r.value.weight,
298
- "onUpdate:modelValue": l[6] || (l[6] = (s) => r.value.weight = s),
299
- placeholder: e.$t("goodsSpu.weightRequired"),
300
- class: "w-full",
301
- controls: !1,
302
- min: 0
303
- }, null, 8, ["modelValue", "placeholder"])
304
- ]),
305
- _: 1
306
- }, 8, ["label"])
307
- ]),
308
- _: 1
309
- }),
310
- o(d, { span: 6 }, {
311
- default: a(() => [
312
- o(n, {
313
- label: e.$t("goodsSpu.volume"),
314
- prop: "volume"
315
- }, {
316
- default: a(() => [
317
- o(t, {
318
- modelValue: r.value.volume,
319
- "onUpdate:modelValue": l[7] || (l[7] = (s) => r.value.volume = s),
320
- controls: !1,
321
- placeholder: e.$t("goodsSpu.volumeRequired"),
322
- class: "w-full",
323
- min: 0
324
- }, null, 8, ["modelValue", "placeholder"])
325
- ]),
326
- _: 1
327
- }, 8, ["label"])
328
- ]),
329
- _: 1
330
- })
331
- ]),
332
- _: 1
333
- })
334
- ])) : I("", !0),
335
- v.specType == M(D).SPEC_TYPE.MULTI_SPEC ? (m(), g("div", ce, [
336
- o(G, { type: "border-card" }, {
337
- default: a(() => [
338
- o(B, { label: "商品规格" }, {
339
- default: a(() => [
340
- (m(!0), g(k, null, P(u.value, (s, V) => (m(), g("div", {
341
- class: "goods-spec",
342
- key: V
343
- }, [
344
- b("div", ie, [
345
- b("span", null, O(s.name), 1),
346
- b("span", {
347
- class: "goods-delete",
348
- onClick: (c) => Q(V)
349
- }, [
350
- o(le, null, {
351
- default: a(() => [
352
- o(f)
353
- ]),
354
- _: 1
355
- }),
356
- l[9] || (l[9] = y("移除 "))
357
- ], 8, me)
358
- ]),
359
- b("div", fe, [
360
- b("div", ve, [
361
- (m(!0), g(k, null, P(u.value[V].specValueList, (c, ae) => (m(), w(oe, {
362
- key: c,
363
- closable: "",
364
- type: "info",
365
- class: "right-dis",
366
- onClose: (ge) => W(V, ae)
367
- }, {
368
- default: a(() => [
369
- y(O(c.name), 1)
370
- ]),
371
- _: 2
372
- }, 1032, ["onClose"]))), 128))
373
- ]),
374
- o(A, {
375
- placement: "bottom",
376
- width: 200,
377
- trigger: "click",
378
- onShow: (c) => z(V)
379
- }, {
380
- reference: a(() => [
381
- o(R, { class: "m-2" }, {
382
- default: a(() => l[10] || (l[10] = [
383
- y("添加规格值")
384
- ])),
385
- _: 1,
386
- __: [10]
387
- })
388
- ]),
389
- default: a(() => [
390
- o(j, {
391
- modelValue: u.value[V].specValueId,
392
- "onUpdate:modelValue": (c) => u.value[V].specValueId = c,
393
- placeholder: e.$t("goodsSpu.specValueRequired"),
394
- onChange: (c) => x(c, V)
395
- }, {
396
- default: a(() => [
397
- (m(!0), g(k, null, P(_.value.values, (c) => (m(), w(N, {
398
- key: c.key,
399
- label: c.value,
400
- value: c.key,
401
- disabled: c.disabled
402
- }, null, 8, ["label", "value", "disabled"]))), 128))
403
- ]),
404
- _: 2
405
- }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange"])
406
- ]),
407
- _: 2
408
- }, 1032, ["onShow"])
409
- ])
410
- ]))), 128)),
411
- o(A, {
412
- placement: "bottom",
413
- width: 200,
414
- trigger: "click",
415
- onShow: X
416
- }, {
417
- reference: a(() => [
418
- o(R, { class: "m-2" }, {
419
- default: a(() => l[11] || (l[11] = [
420
- y("添加规格")
421
- ])),
422
- _: 1,
423
- __: [11]
424
- })
425
- ]),
426
- default: a(() => [
427
- o(j, {
428
- modelValue: C.value,
429
- "onUpdate:modelValue": l[8] || (l[8] = (s) => C.value = s),
430
- placeholder: e.$t("goodsSpu.specRequired"),
431
- onChange: Z
432
- }, {
433
- default: a(() => [
434
- (m(!0), g(k, null, P(h.value.values, (s) => (m(), w(N, {
435
- key: s.key,
436
- label: s.value,
437
- value: s.key,
438
- disabled: s.disabled
439
- }, null, 8, ["label", "value", "disabled"]))), 128))
440
- ]),
441
- _: 1
442
- }, 8, ["modelValue", "placeholder"])
443
- ]),
444
- _: 1
445
- })
446
- ]),
447
- _: 1
448
- })
449
- ]),
450
- _: 1
451
- }),
452
- o(G, { type: "border-card" }, {
453
- default: a(() => [
454
- o(B, { label: "规格售价与库存" }, {
455
- default: a(() => [
456
- u.value.length > 0 ? (m(), w(re, {
457
- key: 0,
458
- specData: U.value,
459
- goodsSku: E.value,
460
- onGetFormData: ee
461
- }, null, 8, ["specData", "goodsSku"])) : I("", !0)
462
- ]),
463
- _: 1
464
- })
465
- ]),
466
- _: 1
467
- })
468
- ])) : I("", !0)
469
- ], 64);
470
- };
471
- }
472
- }), he = /* @__PURE__ */ de(Ve, [["__scopeId", "data-v-c88d5f27"]]);
473
- export {
474
- he as default
475
- };