xyvcard-goods 0.0.18 → 0.0.20

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