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,594 +0,0 @@
1
- import { defineComponent as A, ref as _, watchEffect as J, computed as K, resolveComponent as i, openBlock as v, createElementBlock as P, Fragment as L, createVNode as l, unref as t, isRef as Q, withCtx as a, createElementVNode as b, mergeModels as X, useModel as Y, createBlock as B, renderList as x, createTextVNode as z, toDisplayString as ee, reactive as j, watch as le, createCommentVNode as oe } from "vue";
2
- import { ElMessageBox as te, ElMessage as M } from "element-plus";
3
- import { fileApi as $, routerUtil as G } from "jmash-core";
4
- import { useI18n as O } from "vue-i18n";
5
- import { _ as se } from "./skuTable-Cg06m_5i.mjs";
6
- import { useRouter as ae, useRoute as ue } from "vue-router";
7
- import { D as c, C as re } from "./index-AZ4TxL-_.mjs";
8
- import { goodsSpuApi as F } from "./index.mjs";
9
- import { g as de } from "./index-BHmGYIuc.mjs";
10
- import { WangEditor as ne } from "xyvcard-cms";
11
- import pe from "./skuForm-DdiMztDh.mjs";
12
- const ie = ["src"], me = /* @__PURE__ */ A({
13
- __name: "ImageUpload",
14
- props: {
15
- modelValue: {
16
- type: String,
17
- default: () => ""
18
- },
19
- listType: {
20
- type: String,
21
- default: "picture"
22
- },
23
- limit: {
24
- type: Number,
25
- default: 1e3
26
- }
27
- },
28
- setup(V, { emit: n }) {
29
- const { t: y } = O(), m = _($.uploadUrl()), T = _($.authHeader()), e = _(), S = _(!1), I = _(""), f = V, g = _([]);
30
- J(() => {
31
- g.value = f.modelValue.split(",").filter(Boolean);
32
- });
33
- const U = K(
34
- () => g.value.map((u) => ({ url: $.imageUrl(u), status: "success", uid: u }))
35
- ), C = (u) => {
36
- I.value = u.url, S.value = !0;
37
- }, N = (u) => {
38
- const r = u.size / 1024 / 1024 < 2;
39
- ["image/jpeg", "image/png", "image/gif", "image/jpg"].includes(u.type) && !r && te.confirm(
40
- y("unionFiles.imageLtRequired"),
41
- y("unionFiles.warning"),
42
- {
43
- confirmButtonText: y("common.confirm"),
44
- cancelButtonText: y("common.cancel"),
45
- type: "warning"
46
- }
47
- ).then(async () => {
48
- }).catch(() => (g.value.splice(-1, 1), p(), !1));
49
- }, w = (u, r) => {
50
- g.value = g.value.filter((h) => $.imageUrl(h) !== u.url), p();
51
- }, s = (u, r) => {
52
- g.value.push(u.fileSrc), p();
53
- }, o = n, p = () => {
54
- o("update:modelValue", g.value.join(","));
55
- };
56
- return (u, r) => {
57
- const h = i("Plus"), k = i("el-icon"), q = i("el-upload"), E = i("el-dialog");
58
- return v(), P(L, null, [
59
- l(q, {
60
- ref_key: "uploadImageRef",
61
- ref: e,
62
- "file-list": t(U),
63
- "onUpdate:fileList": r[0] || (r[0] = (R) => Q(U) ? U.value = R : null),
64
- action: m.value,
65
- headers: T.value,
66
- limit: V.limit,
67
- "list-type": V.listType,
68
- "on-preview": C,
69
- "before-upload": N,
70
- "on-success": s,
71
- "on-remove": w
72
- }, {
73
- default: a(() => [
74
- l(k, null, {
75
- default: a(() => [
76
- l(h)
77
- ]),
78
- _: 1
79
- })
80
- ]),
81
- _: 1
82
- }, 8, ["file-list", "action", "headers", "limit", "list-type"]),
83
- l(E, {
84
- modelValue: S.value,
85
- "onUpdate:modelValue": r[1] || (r[1] = (R) => S.value = R),
86
- fullscreen: !0
87
- }, {
88
- default: a(() => [
89
- b("img", {
90
- src: I.value,
91
- alt: ""
92
- }, null, 8, ie)
93
- ]),
94
- _: 1
95
- }, 8, ["modelValue"])
96
- ], 64);
97
- };
98
- }
99
- }), ce = /* @__PURE__ */ se(me, [["__scopeId", "data-v-e7a4c473"]]), fe = /* @__PURE__ */ A({
100
- __name: "index",
101
- props: /* @__PURE__ */ X({
102
- data: {
103
- type: Object,
104
- default: function() {
105
- }
106
- }
107
- }, {
108
- modelValue: { type: [String, Boolean] },
109
- modelModifiers: {}
110
- }),
111
- emits: ["update:modelValue"],
112
- setup(V) {
113
- const n = Y(V, "modelValue"), m = V.data;
114
- return (T, e) => {
115
- const S = i("el-radio"), I = i("el-radio-group");
116
- return v(), B(I, {
117
- modelValue: n.value,
118
- "onUpdate:modelValue": e[0] || (e[0] = (f) => n.value = f)
119
- }, {
120
- default: a(() => [
121
- (v(!0), P(L, null, x(t(m), (f) => (v(), B(S, {
122
- key: f.key,
123
- value: f.key
124
- }, {
125
- default: a(() => [
126
- z(ee(f.value), 1)
127
- ]),
128
- _: 2
129
- }, 1032, ["value"]))), 128))
130
- ]),
131
- _: 1
132
- }, 8, ["modelValue"]);
133
- };
134
- }
135
- }), ge = { class: "app-container" }, ye = { class: "search-container" }, he = { class: "image-card" }, ke = /* @__PURE__ */ A({
136
- __name: "edit",
137
- setup(V) {
138
- var w;
139
- const { t: n } = O(), y = ae(), m = ue(), T = _();
140
- c.shopInfoBizDict.useValues(), c.goodsCategoryDict.useValues();
141
- let e = j({
142
- requestId: Math.random() * 10 + "",
143
- updateMask: "shopId,spuName,categoryId,spuCode,freightType,freightAmount,picUrls,shelf,saleNum,sellPoint,specType,description",
144
- skuSpecValues: [],
145
- freightType: c.freightTypeEnum.values[0].key,
146
- freightAmount: 0,
147
- shelf: c.shelfDict.values[0].key,
148
- specType: c.specTypeEnum.values[0].key,
149
- shopId: (w = c.shopInfoBizDict.values[0]) == null ? void 0 : w.key
150
- });
151
- const S = (s, o, p) => {
152
- var r;
153
- const u = (r = e.picUrls) == null ? void 0 : r.split(",").filter(Boolean);
154
- if (u != null && u.length) {
155
- if ((u == null ? void 0 : u.length) < 3)
156
- return p(new Error(n("goodsSpu.imageListsError")));
157
- p();
158
- } else return p(new Error(n("goodsSpu.picUrlsRequired")));
159
- }, I = j({
160
- shopId: [
161
- {
162
- required: !0,
163
- message: n("goodsSpu.shopIdRequired"),
164
- trigger: "change"
165
- }
166
- ],
167
- spuName: [
168
- {
169
- required: !0,
170
- message: n("goodsSpu.spuNameRequired"),
171
- trigger: "blur"
172
- }
173
- ],
174
- categoryId: [
175
- {
176
- required: !0,
177
- message: n("goodsSpu.categoryIdRequired"),
178
- trigger: "change"
179
- }
180
- ],
181
- spuCode: [
182
- {
183
- required: !0,
184
- message: n("goodsSpu.spuCodeRequired"),
185
- trigger: "change"
186
- }
187
- ],
188
- freightType: [
189
- {
190
- required: !0,
191
- message: n("goodsSpu.freightTypeRequired"),
192
- trigger: "change"
193
- }
194
- ],
195
- freightAmount: [
196
- {
197
- required: !0,
198
- message: n("goodsSpu.freightAmountRequired"),
199
- trigger: "blur"
200
- }
201
- ],
202
- picUrls: [
203
- {
204
- validator: S,
205
- trigger: "change"
206
- }
207
- ],
208
- shelf: [
209
- {
210
- required: !0,
211
- message: n("goodsSpu.shelfRequired"),
212
- trigger: "change"
213
- }
214
- ],
215
- specType: [
216
- {
217
- required: !0,
218
- message: n("goodsSpu.specTypeRequired"),
219
- trigger: "change"
220
- }
221
- ]
222
- }), f = _(!1);
223
- le(
224
- () => e.shopId,
225
- (s) => s,
226
- {
227
- deep: !0,
228
- immediate: !0
229
- }
230
- );
231
- function g(s) {
232
- e.skuSpecValues.push(s), e.skuSpecValues = e.skuSpecValues.slice(-1);
233
- }
234
- function U(s) {
235
- console.log(s, "=> skuDataArray"), s.forEach((o) => {
236
- var p;
237
- e.specId = (p = o.specValues) == null ? void 0 : p.map((u) => u.specId), e.skuSpecValues.push(o);
238
- }), e.skuSpecValues = e.skuSpecValues.slice(-s.length);
239
- }
240
- m.query.spuId && F.findById({ spuId: m.query.spuId }).then(({ data: s }) => {
241
- Object.assign(e, s), f.value = !0, de.findById({ spuId: m.query.spuId }).then(({ data: o }) => {
242
- e.ensureIds = o.ensures;
243
- });
244
- });
245
- const C = async () => {
246
- var s;
247
- await ((s = T.value) == null ? void 0 : s.validate((o) => {
248
- o && (m.query.spuId ? F.update(e).then((p) => {
249
- p.status === 200 && (M({
250
- message: n("common.submitSuccess"),
251
- type: "success"
252
- }), G.closeTagView(m.fullPath, y, !1));
253
- }) : F.create(e).then((p) => {
254
- p.status === 200 && (M({
255
- message: n("common.submitSuccess"),
256
- type: "success"
257
- }), G.closeTagView(m.fullPath, y, !1));
258
- }));
259
- }));
260
- };
261
- function N(s) {
262
- s === "FREIGHT_FREE" && (e.freightAmount = 0);
263
- }
264
- return (s, o) => {
265
- const p = i("jmash-select"), u = i("el-form-item"), r = i("el-col"), h = i("el-input"), k = i("el-tree-select"), q = fe, E = i("el-input-number"), R = ce, H = i("jmash-dict-checkbox"), D = i("el-row"), W = i("el-button"), Z = i("el-form");
266
- return v(), P("div", ge, [
267
- b("div", ye, [
268
- l(Z, {
269
- ref_key: "goodsSpuFormRef",
270
- ref: T,
271
- model: t(e),
272
- "label-width": "120px",
273
- rules: I
274
- }, {
275
- default: a(() => [
276
- o[15] || (o[15] = b("div", { class: "title-content" }, "基本信息", -1)),
277
- l(D, null, {
278
- default: a(() => [
279
- l(r, { span: 12 }, {
280
- default: a(() => [
281
- l(u, {
282
- label: s.$t("goodsSpu.shopId"),
283
- prop: "shopId"
284
- }, {
285
- default: a(() => [
286
- l(p, {
287
- modelValue: t(e).shopId,
288
- "onUpdate:modelValue": o[0] || (o[0] = (d) => t(e).shopId = d),
289
- placeholder: s.$t("goodsSpu.shopIdRequired"),
290
- data: t(c).shopInfoBizDict.values,
291
- filterable: "",
292
- class: "w-full"
293
- }, null, 8, ["modelValue", "placeholder", "data"])
294
- ]),
295
- _: 1
296
- }, 8, ["label"])
297
- ]),
298
- _: 1
299
- }),
300
- l(r, { span: 12 }, {
301
- default: a(() => [
302
- l(u, {
303
- label: s.$t("goodsSpu.spuName"),
304
- prop: "spuName"
305
- }, {
306
- default: a(() => [
307
- l(h, {
308
- modelValue: t(e).spuName,
309
- "onUpdate:modelValue": o[1] || (o[1] = (d) => t(e).spuName = d),
310
- placeholder: s.$t("goodsSpu.spuNameRequired"),
311
- maxlength: "60",
312
- "show-word-limit": "",
313
- clearable: ""
314
- }, null, 8, ["modelValue", "placeholder"])
315
- ]),
316
- _: 1
317
- }, 8, ["label"])
318
- ]),
319
- _: 1
320
- }),
321
- l(r, { span: 12 }, {
322
- default: a(() => [
323
- l(u, {
324
- label: s.$t("goodsSpu.categoryId"),
325
- prop: "categoryId"
326
- }, {
327
- default: a(() => [
328
- l(k, {
329
- modelValue: t(e).categoryId,
330
- "onUpdate:modelValue": o[2] || (o[2] = (d) => t(e).categoryId = d),
331
- data: t(c).goodsCategoryDict.values,
332
- filterable: "",
333
- clearable: "",
334
- "check-strictly": "",
335
- "render-after-expand": !1,
336
- placeholder: s.$t("goodsSpu.categoryIdRequired"),
337
- class: "w-full"
338
- }, null, 8, ["modelValue", "data", "placeholder"])
339
- ]),
340
- _: 1
341
- }, 8, ["label"])
342
- ]),
343
- _: 1
344
- }),
345
- l(r, { span: 12 }, {
346
- default: a(() => [
347
- l(u, {
348
- label: s.$t("goodsSpu.spuCode"),
349
- prop: "spuCode"
350
- }, {
351
- default: a(() => [
352
- l(h, {
353
- modelValue: t(e).spuCode,
354
- "onUpdate:modelValue": o[3] || (o[3] = (d) => t(e).spuCode = d),
355
- placeholder: s.$t("goodsSpu.spuCodeRequired"),
356
- maxlength: "15",
357
- "show-word-limit": "",
358
- clearable: ""
359
- }, null, 8, ["modelValue", "placeholder"])
360
- ]),
361
- _: 1
362
- }, 8, ["label"])
363
- ]),
364
- _: 1
365
- }),
366
- l(r, { span: 12 }, {
367
- default: a(() => [
368
- l(u, {
369
- label: s.$t("goodsSpu.freightType"),
370
- prop: "freightType"
371
- }, {
372
- default: a(() => [
373
- l(q, {
374
- modelValue: t(e).freightType,
375
- "onUpdate:modelValue": o[4] || (o[4] = (d) => t(e).freightType = d),
376
- data: t(c).freightTypeEnum.values,
377
- onChange: N
378
- }, null, 8, ["modelValue", "data"])
379
- ]),
380
- _: 1
381
- }, 8, ["label"])
382
- ]),
383
- _: 1
384
- }),
385
- l(r, { span: 12 }, {
386
- default: a(() => [
387
- l(u, {
388
- label: s.$t("goodsSpu.freightAmount"),
389
- prop: "freightAmount"
390
- }, {
391
- default: a(() => [
392
- l(E, {
393
- modelValue: t(e).freightAmount,
394
- "onUpdate:modelValue": o[5] || (o[5] = (d) => t(e).freightAmount = d),
395
- readonly: t(e).freightType === "FREIGHT_FREE",
396
- precision: 2,
397
- step: 0.1,
398
- controls: !1,
399
- placeholder: s.$t("goodsSpu.freightAmountRequired"),
400
- class: "w-full"
401
- }, null, 8, ["modelValue", "readonly", "placeholder"])
402
- ]),
403
- _: 1
404
- }, 8, ["label"])
405
- ]),
406
- _: 1
407
- }),
408
- l(r, { span: 24 }, {
409
- default: a(() => [
410
- l(u, {
411
- label: s.$t("goodsSpu.picUrls"),
412
- prop: "picUrls"
413
- }, {
414
- default: a(() => [
415
- b("div", he, [
416
- l(R, {
417
- modelValue: t(e).picUrls,
418
- "onUpdate:modelValue": o[6] || (o[6] = (d) => t(e).picUrls = d),
419
- limit: 6,
420
- "list-type": "picture-card"
421
- }, null, 8, ["modelValue"]),
422
- o[13] || (o[13] = b("div", { class: "red-color" }, " 推荐尺寸:100*100或同比例图片,最少可上传3张 ", -1))
423
- ])
424
- ]),
425
- _: 1
426
- }, 8, ["label"])
427
- ]),
428
- _: 1
429
- }),
430
- l(r, { span: 12 }, {
431
- default: a(() => [
432
- l(u, {
433
- label: s.$t("goodsSpu.shelf"),
434
- prop: "shelf"
435
- }, {
436
- default: a(() => [
437
- l(q, {
438
- modelValue: t(e).shelf,
439
- "onUpdate:modelValue": o[7] || (o[7] = (d) => t(e).shelf = d),
440
- data: t(c).shelfDict.values
441
- }, null, 8, ["modelValue", "data"])
442
- ]),
443
- _: 1
444
- }, 8, ["label"])
445
- ]),
446
- _: 1
447
- }),
448
- l(r, { span: 12 }, {
449
- default: a(() => [
450
- l(u, {
451
- label: s.$t("goodsSpu.saleNum"),
452
- prop: "saleNum"
453
- }, {
454
- default: a(() => [
455
- l(E, {
456
- modelValue: t(e).saleNum,
457
- "onUpdate:modelValue": o[8] || (o[8] = (d) => t(e).saleNum = d),
458
- placeholder: s.$t("goodsSpu.saleNumRequired"),
459
- class: "w-full",
460
- min: 0,
461
- controls: !1,
462
- precision: 0
463
- }, null, 8, ["modelValue", "placeholder"])
464
- ]),
465
- _: 1
466
- }, 8, ["label"])
467
- ]),
468
- _: 1
469
- }),
470
- l(r, { span: 24 }, {
471
- default: a(() => [
472
- l(u, {
473
- label: s.$t("goodsSpu.sellPoint"),
474
- prop: "sellPoint"
475
- }, {
476
- default: a(() => [
477
- l(h, {
478
- modelValue: t(e).sellPoint,
479
- "onUpdate:modelValue": o[9] || (o[9] = (d) => t(e).sellPoint = d),
480
- placeholder: s.$t("goodsSpu.sellPointRequired"),
481
- maxlength: "250",
482
- "show-word-limit": "",
483
- clearable: "",
484
- rows: 4,
485
- type: "textarea"
486
- }, null, 8, ["modelValue", "placeholder"])
487
- ]),
488
- _: 1
489
- }, 8, ["label"])
490
- ]),
491
- _: 1
492
- }),
493
- l(r, { span: 24 }, {
494
- default: a(() => [
495
- l(u, {
496
- label: s.$t("goodsSpu.ensureIds"),
497
- prop: "ensureIds"
498
- }, {
499
- default: a(() => [
500
- l(H, {
501
- modelValue: t(e).ensureIds,
502
- "onUpdate:modelValue": o[10] || (o[10] = (d) => t(e).ensureIds = d),
503
- "type-code": t(re).DICT_GOODS_ENSURE
504
- }, null, 8, ["modelValue", "type-code"])
505
- ]),
506
- _: 1
507
- }, 8, ["label"])
508
- ]),
509
- _: 1
510
- })
511
- ]),
512
- _: 1
513
- }),
514
- o[16] || (o[16] = b("div", { class: "title-content" }, "商品规格", -1)),
515
- l(D, null, {
516
- default: a(() => [
517
- l(r, { span: 24 }, {
518
- default: a(() => [
519
- l(u, {
520
- label: s.$t("goodsSpu.specType"),
521
- prop: "specType"
522
- }, {
523
- default: a(() => [
524
- l(q, {
525
- modelValue: t(e).specType,
526
- "onUpdate:modelValue": o[11] || (o[11] = (d) => t(e).specType = d),
527
- data: t(c).specTypeEnum.values
528
- }, null, 8, ["modelValue", "data"])
529
- ]),
530
- _: 1
531
- }, 8, ["label"])
532
- ]),
533
- _: 1
534
- }),
535
- !t(m).query.spuId || f.value ? (v(), B(pe, {
536
- key: 0,
537
- "spec-type": t(e).specType,
538
- form: t(e),
539
- isDisabled: !t(e).shopId,
540
- onGetGoodsSku: g,
541
- onGetFormData: U
542
- }, null, 8, ["spec-type", "form", "isDisabled"])) : oe("", !0)
543
- ]),
544
- _: 1
545
- }),
546
- o[17] || (o[17] = b("div", { class: "title-content" }, "商品详情", -1)),
547
- l(D, null, {
548
- default: a(() => [
549
- l(r, { span: 24 }, {
550
- default: a(() => [
551
- l(u, {
552
- label: s.$t("goodsSpu.description"),
553
- prop: "description"
554
- }, {
555
- default: a(() => [
556
- l(t(ne), {
557
- modelValue: t(e).description,
558
- "onUpdate:modelValue": o[12] || (o[12] = (d) => t(e).description = d),
559
- style: { width: "100%" }
560
- }, null, 8, ["modelValue"])
561
- ]),
562
- _: 1
563
- }, 8, ["label"])
564
- ]),
565
- _: 1
566
- }),
567
- l(u, null, {
568
- default: a(() => [
569
- l(W, {
570
- type: "primary",
571
- onClick: C
572
- }, {
573
- default: a(() => o[14] || (o[14] = [
574
- z("保存")
575
- ])),
576
- _: 1
577
- })
578
- ]),
579
- _: 1
580
- })
581
- ]),
582
- _: 1
583
- })
584
- ]),
585
- _: 1
586
- }, 8, ["model", "rules"])
587
- ])
588
- ]);
589
- };
590
- }
591
- });
592
- export {
593
- ke as default
594
- };