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,507 +0,0 @@
1
- import { defineComponent as K, ref as v, reactive as T, resolveComponent as n, openBlock as f, createElementBlock as h, createElementVNode as c, createVNode as e, unref as t, withCtx as s, Fragment as R, renderList as w, createBlock as _, createTextVNode as U, toDisplayString as Q, createCommentVNode as X } from "vue";
2
- import { ElMessage as C } from "element-plus";
3
- import { useRouter as Y, useRoute as Z } from "vue-router";
4
- import { routerUtil as E } from "jmash-core";
5
- import { useI18n as x } from "vue-i18n";
6
- import { D as p, C as ee } from "./index-CqOoZ5xQ.mjs";
7
- import { goodsSpuApi as V } from "./index.mjs";
8
- import { g as le } from "./index-BHmGYIuc.mjs";
9
- import { WangEditor as oe } from "xyvcard-cms";
10
- import te from "./skuForm-D2n8sQJo.mjs";
11
- const se = { class: "app-container" }, ae = { class: "search-container" }, ue = { class: "image-card" }, he = /* @__PURE__ */ K({
12
- __name: "edit",
13
- setup(re) {
14
- const { t: m } = x();
15
- p.brandListBizDict.useValues(), console.log(p.brandListBizDict.values, "=> brandListBizDict");
16
- const S = Y(), g = Z(), I = v();
17
- p.shopInfoBizDict.useValues(), p.goodsCategoryListBizLayDict.useValues(), p.labelListBizDict.useValues(), console.log(
18
- p.goodsCategoryListBizLayDict.values,
19
- "=>goodsCategoryListBizLayDict "
20
- );
21
- let l = T({
22
- requestId: Math.random() * 10 + "",
23
- updateMask: "labelIds,brandId,spuName,categoryIds,spuCode,freightType,freightAmount,picUrls,shelf,saleNum,sellPoint,specType,description",
24
- skuSpecValues: [],
25
- freightType: p.freightTypeEnum.values[0].key,
26
- freightAmount: 0,
27
- shelf: p.shelfDict.values[0].key,
28
- specType: p.specTypeEnum.values[0].key
29
- });
30
- const D = (a, o, i) => {
31
- var d;
32
- const r = (d = l.picUrls) == null ? void 0 : d.split(",").filter(Boolean);
33
- if (r != null && r.length) {
34
- if ((r == null ? void 0 : r.length) < 1)
35
- return i(new Error(m("goodsSpu.imageListsError")));
36
- i();
37
- } else return i(new Error(m("goodsSpu.picUrlsRequired")));
38
- }, $ = T({
39
- brandId: [
40
- {
41
- required: !0,
42
- message: m("goodsSpu.brandIdRequired"),
43
- trigger: "change"
44
- }
45
- ],
46
- spuName: [
47
- {
48
- required: !0,
49
- message: m("goodsSpu.spuNameRequired"),
50
- trigger: "blur"
51
- }
52
- ],
53
- categoryIds: [
54
- {
55
- required: !0,
56
- message: m("goodsSpu.categoryIdRequired"),
57
- trigger: "change"
58
- }
59
- ],
60
- spuCode: [
61
- {
62
- required: !0,
63
- message: m("goodsSpu.spuCodeRequired"),
64
- trigger: "change"
65
- }
66
- ],
67
- freightType: [
68
- {
69
- required: !0,
70
- message: m("goodsSpu.freightTypeRequired"),
71
- trigger: "change"
72
- }
73
- ],
74
- freightAmount: [
75
- {
76
- required: !0,
77
- message: m("goodsSpu.freightAmountRequired"),
78
- trigger: "blur"
79
- }
80
- ],
81
- picUrls: [
82
- {
83
- validator: D,
84
- trigger: "change"
85
- }
86
- ],
87
- shelf: [
88
- {
89
- required: !0,
90
- message: m("goodsSpu.shelfRequired"),
91
- trigger: "change"
92
- }
93
- ],
94
- specType: [
95
- {
96
- required: !0,
97
- message: m("goodsSpu.specTypeRequired"),
98
- trigger: "change"
99
- }
100
- ]
101
- }), k = v(!1);
102
- function N(a) {
103
- l.skuSpecValues.push(a), l.skuSpecValues = l.skuSpecValues.slice(-1);
104
- }
105
- function B(a) {
106
- a.forEach((o) => {
107
- var i;
108
- l.specId = (i = o.specValues) == null ? void 0 : i.map((r) => r.specId), l.skuSpecValues.push(o);
109
- }), l.skuSpecValues = l.skuSpecValues.slice(-a.length);
110
- }
111
- g.query.spuId && V.findById({ spuId: g.query.spuId }).then(({ data: a }) => {
112
- Object.assign(l, a), k.value = !0, le.findById({ spuId: g.query.spuId }).then(({ data: o }) => {
113
- l.ensureIds = o.ensures;
114
- });
115
- });
116
- const L = async () => {
117
- var a;
118
- await ((a = I.value) == null ? void 0 : a.validate((o) => {
119
- o && (g.query.spuId ? V.update(l).then((i) => {
120
- i.status === 200 && (C({
121
- message: m("common.submitSuccess"),
122
- type: "success"
123
- }), E.closeTagView(g.fullPath, S, !1));
124
- }) : V.create(l).then((i) => {
125
- i.status === 200 && (C({
126
- message: m("common.submitSuccess"),
127
- type: "success"
128
- }), E.closeTagView(g.fullPath, S, !1));
129
- }));
130
- }));
131
- };
132
- function z(a) {
133
- a === "FREIGHT_FREE" && (l.freightAmount = 0);
134
- }
135
- function F(a) {
136
- l.picUrls = a;
137
- }
138
- return (a, o) => {
139
- const i = n("el-input"), r = n("el-form-item"), d = n("el-col"), A = n("el-option"), P = n("el-select"), j = n("el-tree-select"), b = n("jmash-enum-radio"), q = n("el-input-number"), G = n("jmash-single-image-upload"), M = n("jmash-dict-checkbox"), O = n("el-checkbox"), H = n("el-checkbox-group"), y = n("el-row"), W = n("el-button"), J = n("el-form");
140
- return f(), h("div", se, [
141
- c("div", ae, [
142
- e(J, {
143
- ref_key: "goodsSpuFormRef",
144
- ref: I,
145
- model: t(l),
146
- "label-width": "120px",
147
- rules: $
148
- }, {
149
- default: s(() => [
150
- o[14] || (o[14] = c("div", { class: "title-content" }, "基本信息", -1)),
151
- e(y, null, {
152
- default: s(() => [
153
- e(d, { span: 12 }, {
154
- default: s(() => [
155
- e(r, {
156
- label: a.$t("goodsSpu.spuName"),
157
- prop: "spuName"
158
- }, {
159
- default: s(() => [
160
- e(i, {
161
- modelValue: t(l).spuName,
162
- "onUpdate:modelValue": o[0] || (o[0] = (u) => t(l).spuName = u),
163
- placeholder: a.$t("goodsSpu.spuNameRequired"),
164
- maxlength: "60",
165
- "show-word-limit": "",
166
- clearable: ""
167
- }, null, 8, ["modelValue", "placeholder"])
168
- ]),
169
- _: 1
170
- }, 8, ["label"])
171
- ]),
172
- _: 1
173
- }),
174
- e(d, { span: 12 }, {
175
- default: s(() => [
176
- e(r, {
177
- label: a.$t("goodsSpu.spuCode"),
178
- prop: "spuCode"
179
- }, {
180
- default: s(() => [
181
- e(i, {
182
- modelValue: t(l).spuCode,
183
- "onUpdate:modelValue": o[1] || (o[1] = (u) => t(l).spuCode = u),
184
- placeholder: a.$t("goodsSpu.spuCodeRequired"),
185
- maxlength: "15",
186
- "show-word-limit": "",
187
- clearable: ""
188
- }, null, 8, ["modelValue", "placeholder"])
189
- ]),
190
- _: 1
191
- }, 8, ["label"])
192
- ]),
193
- _: 1
194
- }),
195
- e(d, { span: 12 }, {
196
- default: s(() => [
197
- e(r, {
198
- label: a.$t("goodsSpu.brandId"),
199
- prop: "brandId"
200
- }, {
201
- default: s(() => [
202
- e(P, {
203
- modelValue: t(l).brandId,
204
- "onUpdate:modelValue": o[2] || (o[2] = (u) => t(l).brandId = u),
205
- data: t(p).brandListBizDict.values,
206
- placeholder: a.$t("goodsSpu.brandIdRequired"),
207
- class: "w-full"
208
- }, {
209
- default: s(() => [
210
- (f(!0), h(R, null, w(t(p).brandListBizDict.values, (u) => (f(), _(A, {
211
- key: u.key,
212
- label: u.value,
213
- value: u.key
214
- }, null, 8, ["label", "value"]))), 128))
215
- ]),
216
- _: 1
217
- }, 8, ["modelValue", "data", "placeholder"])
218
- ]),
219
- _: 1
220
- }, 8, ["label"])
221
- ]),
222
- _: 1
223
- }),
224
- e(d, { span: 12 }, {
225
- default: s(() => [
226
- e(r, {
227
- label: a.$t("goodsSpu.categoryId"),
228
- prop: "categoryIds"
229
- }, {
230
- default: s(() => [
231
- e(j, {
232
- modelValue: t(l).categoryIds,
233
- "onUpdate:modelValue": o[3] || (o[3] = (u) => t(l).categoryIds = u),
234
- data: t(p).goodsCategoryListBizLayDict.values,
235
- multiple: "",
236
- "render-after-expand": !1,
237
- "show-checkbox": "",
238
- placeholder: a.$t("goodsSpu.categoryIdRequired"),
239
- class: "w-full"
240
- }, null, 8, ["modelValue", "data", "placeholder"])
241
- ]),
242
- _: 1
243
- }, 8, ["label"])
244
- ]),
245
- _: 1
246
- }),
247
- e(d, { span: 12 }, {
248
- default: s(() => [
249
- e(r, {
250
- label: a.$t("goodsSpu.freightType"),
251
- prop: "freightType"
252
- }, {
253
- default: s(() => [
254
- e(b, {
255
- modelValue: t(l).freightType,
256
- "onUpdate:modelValue": o[4] || (o[4] = (u) => t(l).freightType = u),
257
- data: t(p).freightTypeEnum.values,
258
- onChange: z
259
- }, null, 8, ["modelValue", "data"])
260
- ]),
261
- _: 1
262
- }, 8, ["label"])
263
- ]),
264
- _: 1
265
- }),
266
- e(d, { span: 12 }, {
267
- default: s(() => [
268
- e(r, {
269
- label: a.$t("goodsSpu.freightAmount"),
270
- prop: "freightAmount"
271
- }, {
272
- default: s(() => [
273
- e(q, {
274
- modelValue: t(l).freightAmount,
275
- "onUpdate:modelValue": o[5] || (o[5] = (u) => t(l).freightAmount = u),
276
- readonly: t(l).freightType === "FREIGHT_FREE",
277
- precision: 2,
278
- step: 0.1,
279
- controls: !1,
280
- min: 0,
281
- placeholder: a.$t("goodsSpu.freightAmountRequired"),
282
- class: "w-full"
283
- }, null, 8, ["modelValue", "readonly", "placeholder"])
284
- ]),
285
- _: 1
286
- }, 8, ["label"])
287
- ]),
288
- _: 1
289
- }),
290
- e(d, { span: 24 }, {
291
- default: s(() => [
292
- e(r, {
293
- label: a.$t("goodsSpu.picUrls"),
294
- prop: "picUrls"
295
- }, {
296
- default: s(() => [
297
- c("div", ue, [
298
- e(G, {
299
- "picture-url": t(l).picUrls,
300
- onImageSrc: F,
301
- width: 80,
302
- type: "trans"
303
- }, null, 8, ["picture-url"])
304
- ])
305
- ]),
306
- _: 1
307
- }, 8, ["label"])
308
- ]),
309
- _: 1
310
- }),
311
- e(d, { span: 12 }, {
312
- default: s(() => [
313
- e(r, {
314
- label: a.$t("goodsSpu.shelf"),
315
- prop: "shelf"
316
- }, {
317
- default: s(() => [
318
- e(b, {
319
- modelValue: t(l).shelf,
320
- "onUpdate:modelValue": o[6] || (o[6] = (u) => t(l).shelf = u),
321
- data: t(p).shelfDict.values
322
- }, null, 8, ["modelValue", "data"])
323
- ]),
324
- _: 1
325
- }, 8, ["label"])
326
- ]),
327
- _: 1
328
- }),
329
- e(d, { span: 12 }, {
330
- default: s(() => [
331
- e(r, {
332
- label: a.$t("goodsSpu.saleNum"),
333
- prop: "saleNum"
334
- }, {
335
- default: s(() => [
336
- e(q, {
337
- modelValue: t(l).saleNum,
338
- "onUpdate:modelValue": o[7] || (o[7] = (u) => t(l).saleNum = u),
339
- placeholder: a.$t("goodsSpu.saleNumRequired"),
340
- class: "w-full",
341
- min: 0,
342
- controls: !1,
343
- precision: 0
344
- }, null, 8, ["modelValue", "placeholder"])
345
- ]),
346
- _: 1
347
- }, 8, ["label"])
348
- ]),
349
- _: 1
350
- }),
351
- e(d, { span: 24 }, {
352
- default: s(() => [
353
- e(r, {
354
- label: a.$t("goodsSpu.sellPoint"),
355
- prop: "sellPoint"
356
- }, {
357
- default: s(() => [
358
- e(i, {
359
- modelValue: t(l).sellPoint,
360
- "onUpdate:modelValue": o[8] || (o[8] = (u) => t(l).sellPoint = u),
361
- placeholder: a.$t("goodsSpu.sellPointRequired"),
362
- maxlength: "250",
363
- "show-word-limit": "",
364
- clearable: "",
365
- rows: 4,
366
- type: "textarea"
367
- }, null, 8, ["modelValue", "placeholder"])
368
- ]),
369
- _: 1
370
- }, 8, ["label"])
371
- ]),
372
- _: 1
373
- }),
374
- e(d, { span: 24 }, {
375
- default: s(() => [
376
- e(r, {
377
- label: a.$t("goodsSpu.ensureIds"),
378
- prop: "ensureIds"
379
- }, {
380
- default: s(() => [
381
- e(M, {
382
- modelValue: t(l).ensureIds,
383
- "onUpdate:modelValue": o[9] || (o[9] = (u) => t(l).ensureIds = u),
384
- "type-code": t(ee).DICT_GOODS_ENSURE
385
- }, null, 8, ["modelValue", "type-code"])
386
- ]),
387
- _: 1
388
- }, 8, ["label"])
389
- ]),
390
- _: 1
391
- }),
392
- e(d, { span: 24 }, {
393
- default: s(() => [
394
- e(r, {
395
- label: a.$t("goodsSpu.labelIds"),
396
- prop: "labelIds"
397
- }, {
398
- default: s(() => [
399
- e(H, {
400
- modelValue: t(l).labelIds,
401
- "onUpdate:modelValue": o[10] || (o[10] = (u) => t(l).labelIds = u),
402
- class: "w-full"
403
- }, {
404
- default: s(() => [
405
- (f(!0), h(R, null, w(t(p).labelListBizDict.values, (u) => (f(), _(O, {
406
- key: u.key,
407
- label: u.key
408
- }, {
409
- default: s(() => [
410
- U(Q(u.value), 1)
411
- ]),
412
- _: 2
413
- }, 1032, ["label"]))), 128))
414
- ]),
415
- _: 1
416
- }, 8, ["modelValue"])
417
- ]),
418
- _: 1
419
- }, 8, ["label"])
420
- ]),
421
- _: 1
422
- })
423
- ]),
424
- _: 1
425
- }),
426
- o[15] || (o[15] = c("div", { class: "title-content" }, "商品规格", -1)),
427
- e(y, null, {
428
- default: s(() => [
429
- e(d, { span: 24 }, {
430
- default: s(() => [
431
- e(r, {
432
- label: a.$t("goodsSpu.specType"),
433
- prop: "specType"
434
- }, {
435
- default: s(() => [
436
- e(b, {
437
- modelValue: t(l).specType,
438
- "onUpdate:modelValue": o[11] || (o[11] = (u) => t(l).specType = u),
439
- data: t(p).specTypeEnum.values
440
- }, null, 8, ["modelValue", "data"])
441
- ]),
442
- _: 1
443
- }, 8, ["label"])
444
- ]),
445
- _: 1
446
- }),
447
- !t(g).query.spuId || k.value ? (f(), _(te, {
448
- key: 0,
449
- "spec-type": t(l).specType,
450
- form: t(l),
451
- onGetGoodsSku: N,
452
- onGetFormData: B
453
- }, null, 8, ["spec-type", "form"])) : X("", !0)
454
- ]),
455
- _: 1
456
- }),
457
- o[16] || (o[16] = c("div", { class: "title-content" }, "商品详情", -1)),
458
- e(y, null, {
459
- default: s(() => [
460
- e(d, { span: 24 }, {
461
- default: s(() => [
462
- e(r, {
463
- label: a.$t("goodsSpu.description"),
464
- prop: "description"
465
- }, {
466
- default: s(() => [
467
- e(t(oe), {
468
- modelValue: t(l).description,
469
- "onUpdate:modelValue": o[12] || (o[12] = (u) => t(l).description = u),
470
- style: { width: "100%" }
471
- }, null, 8, ["modelValue"])
472
- ]),
473
- _: 1
474
- }, 8, ["label"])
475
- ]),
476
- _: 1
477
- }),
478
- e(r, null, {
479
- default: s(() => [
480
- e(W, {
481
- type: "primary",
482
- onClick: L
483
- }, {
484
- default: s(() => o[13] || (o[13] = [
485
- U("保存")
486
- ])),
487
- _: 1,
488
- __: [13]
489
- })
490
- ]),
491
- _: 1
492
- })
493
- ]),
494
- _: 1
495
- })
496
- ]),
497
- _: 1,
498
- __: [14, 15, 16]
499
- }, 8, ["model", "rules"])
500
- ])
501
- ]);
502
- };
503
- }
504
- });
505
- export {
506
- he as default
507
- };