xyvcard-goods 0.0.22 → 0.0.24

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 (38) hide show
  1. package/dist/{edit-Nuaz9WSB.mjs → edit-9jPSycsG.mjs} +185 -165
  2. package/dist/{edit-exVf8d8b.mjs → edit-CJpoa4Ck.mjs} +69 -68
  3. package/dist/{edit-DxnsmaXV.mjs → edit-CWQMgvVP.mjs} +38 -38
  4. package/dist/{edit-Byv9oYAC.mjs → edit-DU-BEAcq.mjs} +1 -1
  5. package/dist/{edit-BcokSKfN.mjs → edit-Ziwv43v0.mjs} +27 -27
  6. package/dist/{edit.vue_vue_type_script_setup_true_lang-DuSBj1Mm.mjs → edit.vue_vue_type_script_setup_true_lang-BP0C4d2-.mjs} +8 -7
  7. package/dist/{goodsList-CZUqc4nm.mjs → goodsList-2AwsJVoO.mjs} +1 -1
  8. package/dist/{goodsList-IWDAvKOx.mjs → goodsList-CyWliLjg.mjs} +1 -1
  9. package/dist/{goodsList.vue_vue_type_script_setup_true_lang-CuzIDtTN.mjs → goodsList.vue_vue_type_script_setup_true_lang-Bq06GIMe.mjs} +2 -2
  10. package/dist/{goodsList.vue_vue_type_script_setup_true_lang-BhJn02Ym.mjs → goodsList.vue_vue_type_script_setup_true_lang-DjKzEAB7.mjs} +136 -147
  11. package/dist/{index-4i7TnWvV.mjs → index-8E7BciYp.mjs} +7 -6
  12. package/dist/{index-BVGn6Q_T.mjs → index-B1H5hqEi.mjs} +2 -2
  13. package/dist/{index-B_U2s9fI.mjs → index-B88acg0Q.mjs} +2 -2
  14. package/dist/{index-_xxSoBUe.mjs → index-BdP_dXBK.mjs} +3 -3
  15. package/dist/index-C7oatDPl.mjs +4432 -0
  16. package/dist/{index-CQIttgns.mjs → index-DPjR32Kv.mjs} +3 -3
  17. package/dist/{index-r0u-27m7.mjs → index-DR3Gk44r.mjs} +1 -1
  18. package/dist/index-jCpYt-EU.mjs +221 -0
  19. package/dist/index.mjs +6 -2875
  20. package/dist/info-BEMxnD6-.mjs +325 -0
  21. package/dist/{info-BQaaTFry.mjs → info-DFIeVs66.mjs} +3 -3
  22. package/dist/{skuForm-CgjMd46J.mjs → skuForm-BhAbf2AG.mjs} +16 -16
  23. package/dist/skuForm-C2aQcL90.mjs +314 -0
  24. package/dist/{skuTable-CyGQuTvR.mjs → skuTable-9JJqGeRx.mjs} +255 -208
  25. package/dist/style.css +1 -1
  26. package/dts/api/goods-category/types.d.ts +2 -0
  27. package/dts/api/goods-spu/index.d.ts +3 -1
  28. package/dts/api/goods-spu/types.d.ts +12 -1
  29. package/dts/index.d.ts +4 -0
  30. package/dts/router/index.d.ts +1 -0
  31. package/package.json +1 -1
  32. package/dist/index-DR7GlHNd.mjs +0 -1288
  33. package/dist/index-Dvaotk7B.mjs +0 -325
  34. package/dist/index-jTDhsbYM.mjs +0 -141
  35. package/dist/info-BH4MW3Sw.mjs +0 -365
  36. package/dist/sku-B-IzfYLq.mjs +0 -52
  37. package/dist/skuForm-AMIoZkH-.mjs +0 -287
  38. package/dist/skuTable-DDWSmvoz.mjs +0 -592
@@ -0,0 +1,325 @@
1
+ import { defineComponent as M, ref as v, resolveComponent as f, openBlock as _, createElementBlock as k, createVNode as o, withCtx as l, createTextVNode as r, toDisplayString as u, createElementVNode as p, Fragment as V, renderList as E, createBlock as D, unref as m } from "vue";
2
+ import { fileApi as P, routerUtil as R } from "jmash-core";
3
+ import { useRouter as j, useRoute as G } from "vue-router";
4
+ import { D as y, C as S } from "./index-jCpYt-EU.mjs";
5
+ import { a as L } from "./index-C7oatDPl.mjs";
6
+ import { specValueApi as H } from "xyvcard-shop";
7
+ const J = { class: "app-container" }, K = { class: "cell-item" }, Q = { class: "cell-item" }, W = { class: "cell-item" }, X = { class: "cell-item" }, Z = { class: "cell-item" }, w = { class: "cell-item" }, x = { class: "cell-item" }, ee = { class: "cell-item" }, se = { class: "cell-item" }, le = { key: 0 }, te = { key: 1 }, pe = /* @__PURE__ */ M({
8
+ __name: "info",
9
+ setup(ae) {
10
+ const O = j(), b = G(), d = v({}), $ = v([]), B = v({}), N = v([]);
11
+ y.goodsCategoryListBizLayDict.useValues(), y.labelListBizDict.useValues(), y.goodsSpuBizDict.useValues();
12
+ const U = v([
13
+ {
14
+ salePrice: 0,
15
+ skuId: "",
16
+ spuId: "",
17
+ specInfo: "",
18
+ saleNum: 0,
19
+ picUrl: "",
20
+ specType: "",
21
+ skuOptions: []
22
+ }
23
+ ]);
24
+ b.query.spuId && (L.findById({ spuId: b.query.spuId }).then(({ data: s }) => {
25
+ var e;
26
+ d.value = Object.assign(d, s), $.value = (e = s.picUrls) == null ? void 0 : e.split(",");
27
+ }), L.findGroupList({ goodsId: b.query.spuId }).then(({ data: s }) => {
28
+ if (s && s.results.length > 0) {
29
+ U.value = [];
30
+ const e = s.results.map(async (t) => {
31
+ const i = {
32
+ salePrice: t.salePrice || 0,
33
+ skuId: t.skuId || "",
34
+ spuId: t.spuId || "",
35
+ saleNum: t.saleNum || 0,
36
+ picUrl: t.picUrl || "",
37
+ specType: "",
38
+ skuOptions: []
39
+ };
40
+ return await A(t.spuId, i), i.specType === S.SPEC_TYPE.MULTI_SPEC && t.skuId && (i.skuId = t.skuId || "", i.salePrice = t.salePrice || 0, i.saleNum = t.saleNum || 0, i.picUrl = t.picUrl || "", z(t.skuId)), i;
41
+ });
42
+ Promise.all(e).then((t) => {
43
+ U.value = t;
44
+ });
45
+ }
46
+ }));
47
+ async function A(s, e) {
48
+ var t, i, h;
49
+ if (e.skuId = "", e.skuOptions = [], e.picUrl = "", e.salePrice = 0, e.saleNum = 0, !s) {
50
+ e.skuId = "", e.picUrl = "", e.salePrice = 0, e.saleNum = 0, e.skuOptions = [];
51
+ return;
52
+ }
53
+ try {
54
+ const { data: c } = await L.findById({ spuId: s });
55
+ if (e.specType = c.specType, e.specType === S.SPEC_TYPE.UNIFIED_SPEC && (e.picUrl = c.picUrls ? c.picUrls.split(",")[0] : "", e.salePrice = (t = c.skuList) == null ? void 0 : t.results[0].salePrice, e.saleNum = (i = c.skuList) == null ? void 0 : i.results[0].stock, e.skuId = (h = c.skuList) == null ? void 0 : h.results[0].skuId), e.specType === S.SPEC_TYPE.MULTI_SPEC && c.skuList) {
56
+ const I = c.skuList.results, g = I.map((n) => n.specValues && Array.isArray(n.specValues) ? n.specValues.map(
57
+ (a) => a.specValueId
58
+ ) : []), C = g.flat().map((n) => Y(n));
59
+ await Promise.all(C);
60
+ const T = g.map(
61
+ (n) => n.map((a) => N.value[a] || a)
62
+ );
63
+ e.skuOptions = I.map((n, a) => ({
64
+ key: n.skuId,
65
+ value: T[a].join(" "),
66
+ picUrl: n.picUrl || (c.picUrls ? c.picUrls.split(",")[0] : ""),
67
+ salePrice: n.salePrice,
68
+ stock: n.stock
69
+ })), I.forEach((n) => {
70
+ n.skuId && (B.value[n.skuId] = {
71
+ ...n,
72
+ spuPicUrls: c.picUrls
73
+ });
74
+ });
75
+ }
76
+ } catch {
77
+ }
78
+ }
79
+ function z(s) {
80
+ const e = U.value.find((t) => t.skuId === s);
81
+ if (e && s) {
82
+ const t = B.value[s];
83
+ if (t) {
84
+ const i = t.spuPicUrls ? t.spuPicUrls.split(",")[0] : "";
85
+ e.picUrl = t.picUrl || i, e.salePrice = t.salePrice, e.saleNum = t.stock;
86
+ }
87
+ }
88
+ }
89
+ async function Y(s) {
90
+ if (!N.value[s])
91
+ try {
92
+ const { data: e } = await H.findById({
93
+ specValueId: s
94
+ });
95
+ return N.value[s] = e.valueName, e.valueName;
96
+ } catch {
97
+ }
98
+ }
99
+ function q(s) {
100
+ if (!s.skuId || !s.skuOptions || s.skuOptions.length === 0)
101
+ return "";
102
+ const e = s.skuOptions.find(
103
+ (t) => t.key === s.skuId
104
+ );
105
+ return e ? e.value : "";
106
+ }
107
+ function F() {
108
+ R.closeTagView(b.fullPath, O, !1);
109
+ }
110
+ return (s, e) => {
111
+ const t = f("el-button"), i = f("el-descriptions-item"), h = f("el-tag"), c = f("el-image"), I = f("el-descriptions"), g = f("el-table-column"), C = f("el-table"), T = f("el-row"), n = f("el-card");
112
+ return _(), k("div", J, [
113
+ o(n, { shadow: "never" }, {
114
+ header: l(() => [
115
+ o(t, {
116
+ type: "primary",
117
+ onClick: F
118
+ }, {
119
+ default: l(() => [
120
+ r(u(s.$t("common.back")), 1)
121
+ ]),
122
+ _: 1
123
+ })
124
+ ]),
125
+ default: l(() => [
126
+ e[0] || (e[0] = p("div", { class: "title-content" }, "基本信息", -1)),
127
+ o(I, {
128
+ class: "margin-top",
129
+ column: 2,
130
+ border: ""
131
+ }, {
132
+ default: l(() => [
133
+ o(i, null, {
134
+ label: l(() => [
135
+ p("div", K, u(s.$t("goodsSpu.spuName")), 1)
136
+ ]),
137
+ default: l(() => [
138
+ r(" " + u(d.value.spuName), 1)
139
+ ]),
140
+ _: 1
141
+ }),
142
+ o(i, null, {
143
+ label: l(() => [
144
+ p("div", Q, u(s.$t("goodsSpu.spuCode")), 1)
145
+ ]),
146
+ default: l(() => [
147
+ r(" " + u(d.value.spuCode), 1)
148
+ ]),
149
+ _: 1
150
+ }),
151
+ o(i, null, {
152
+ label: l(() => [
153
+ p("div", W, u(s.$t("goodsSpu.categoryId")), 1)
154
+ ]),
155
+ default: l(() => [
156
+ (_(!0), k(V, null, E(d.value.categoryIds, (a) => (_(), D(h, {
157
+ type: "info",
158
+ key: a,
159
+ style: { "margin-right": "8px", "margin-bottom": "4px" }
160
+ }, {
161
+ default: l(() => [
162
+ r(u(m(y).goodsCategoryListBizLayDict.getValue(a) || a), 1)
163
+ ]),
164
+ _: 2
165
+ }, 1024))), 128))
166
+ ]),
167
+ _: 1
168
+ }),
169
+ o(i, null, {
170
+ label: l(() => [
171
+ p("div", X, u(s.$t("goodsSpu.labelIds")), 1)
172
+ ]),
173
+ default: l(() => [
174
+ (_(!0), k(V, null, E(d.value.labelIds, (a) => (_(), D(h, {
175
+ type: "info",
176
+ key: a,
177
+ style: { "margin-right": "8px", "margin-bottom": "4px" }
178
+ }, {
179
+ default: l(() => [
180
+ r(u(m(y).labelListBizDict.getValue(a) || a), 1)
181
+ ]),
182
+ _: 2
183
+ }, 1024))), 128))
184
+ ]),
185
+ _: 1
186
+ }),
187
+ o(i, null, {
188
+ label: l(() => [
189
+ p("div", Z, u(s.$t("goodsSpu.picUrls")), 1)
190
+ ]),
191
+ default: l(() => [
192
+ (_(!0), k(V, null, E($.value, (a) => (_(), D(c, {
193
+ key: a,
194
+ src: m(P).imageUrl(a, 80, 80),
195
+ "preview-src-list": [m(P).imageUrl(a)],
196
+ "preview-teleported": "",
197
+ "hide-on-click-modal": "",
198
+ fit: "contain"
199
+ }, null, 8, ["src", "preview-src-list"]))), 128))
200
+ ]),
201
+ _: 1
202
+ }),
203
+ o(i, null, {
204
+ label: l(() => [
205
+ p("div", w, u(s.$t("goodsSpu.freightType")), 1)
206
+ ]),
207
+ default: l(() => [
208
+ r(" " + u(m(y).freightTypeEnum.getEnumValue(
209
+ d.value.freightType
210
+ )), 1)
211
+ ]),
212
+ _: 1
213
+ }),
214
+ o(i, null, {
215
+ label: l(() => [
216
+ p("div", x, u(s.$t("goodsSpu.freightAmount")), 1)
217
+ ]),
218
+ default: l(() => [
219
+ r(" " + u(d.value.freightAmount), 1)
220
+ ]),
221
+ _: 1
222
+ }),
223
+ o(i, null, {
224
+ label: l(() => [
225
+ p("div", ee, u(s.$t("goodsSpu.shelf")), 1)
226
+ ]),
227
+ default: l(() => [
228
+ r(" " + u(m(y).shelfDict.getValue(d.value.shelf)), 1)
229
+ ]),
230
+ _: 1
231
+ }),
232
+ o(i, null, {
233
+ label: l(() => [
234
+ p("div", se, u(s.$t("goodsSpu.saleNum")), 1)
235
+ ]),
236
+ default: l(() => [
237
+ r(" " + u(d.value.saleNum), 1)
238
+ ]),
239
+ _: 1
240
+ })
241
+ ]),
242
+ _: 1
243
+ }),
244
+ e[1] || (e[1] = p("div", { class: "title-content" }, "套装商品", -1)),
245
+ o(T, null, {
246
+ default: l(() => [
247
+ o(C, {
248
+ data: U.value,
249
+ border: "",
250
+ style: { width: "100%" }
251
+ }, {
252
+ default: l(() => [
253
+ o(g, {
254
+ label: s.$t("goodsSpu.spuName"),
255
+ prop: "spuId",
256
+ "header-align": "center"
257
+ }, {
258
+ default: l(({ row: a }) => [
259
+ r(u(m(y).goodsSpuBizDict.getValue(a.spuId)), 1)
260
+ ]),
261
+ _: 1
262
+ }, 8, ["label"]),
263
+ o(g, {
264
+ label: s.$t("goodsSpu.specType"),
265
+ "header-align": "center"
266
+ }, {
267
+ default: l(({ row: a }) => [
268
+ a.specType === m(S).SPEC_TYPE.UNIFIED_SPEC ? (_(), k("span", le, " 统一规格 ")) : (_(), k("span", te, u(q(a)), 1))
269
+ ]),
270
+ _: 1
271
+ }, 8, ["label"]),
272
+ o(g, {
273
+ label: s.$t("goodsSpu.picUrls"),
274
+ prop: "picUrl",
275
+ width: "105",
276
+ "header-align": "center"
277
+ }, {
278
+ default: l(({ row: a }) => [
279
+ o(c, {
280
+ src: m(P).imageUrl(a.picUrl, 80, 80),
281
+ "preview-src-list": [m(P).imageUrl(a.picUrl)],
282
+ "preview-teleported": "",
283
+ "hide-on-click-modal": "",
284
+ fit: "contain"
285
+ }, null, 8, ["src", "preview-src-list"])
286
+ ]),
287
+ _: 1
288
+ }, 8, ["label"]),
289
+ o(g, {
290
+ label: s.$t("goodsSpu.salePriceV1"),
291
+ prop: "salePrice",
292
+ "header-align": "center"
293
+ }, {
294
+ default: l(({ row: a }) => [
295
+ r(u(a.salePrice), 1)
296
+ ]),
297
+ _: 1
298
+ }, 8, ["label"]),
299
+ o(g, {
300
+ label: s.$t("goodsSpu.saleNums"),
301
+ prop: "saleNum",
302
+ "header-align": "center"
303
+ }, {
304
+ default: l(({ row: a }) => [
305
+ r(u(a.saleNum), 1)
306
+ ]),
307
+ _: 1
308
+ }, 8, ["label"])
309
+ ]),
310
+ _: 1
311
+ }, 8, ["data"])
312
+ ]),
313
+ _: 1
314
+ })
315
+ ]),
316
+ _: 1,
317
+ __: [0, 1]
318
+ })
319
+ ]);
320
+ };
321
+ }
322
+ });
323
+ export {
324
+ pe as default
325
+ };
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as M, ref as y, computed as q, watch as j, resolveComponent as b, openBlock as r, createElementBlock as k, createVNode as i, withCtx as e, createTextVNode as n, toDisplayString as s, createElementVNode as a, Fragment as L, renderList as I, createBlock as S, unref as _, createCommentVNode as B } from "vue";
2
2
  import { fileApi as w, routerUtil as F } from "jmash-core";
3
3
  import { useRouter as H, useRoute as O } from "vue-router";
4
- import { D as d, C as N, S as R } from "./index-Dvaotk7B.mjs";
5
- import Y from "./skuTable-DDWSmvoz.mjs";
6
- import { goodsSpuApi as G } from "./index.mjs";
4
+ import { D as d, C as N, S as R } from "./index-jCpYt-EU.mjs";
5
+ import Y from "./skuTable-9JJqGeRx.mjs";
6
+ import { a as G } from "./index-C7oatDPl.mjs";
7
7
  import { g as J } from "./index-BHmGYIuc.mjs";
8
8
  const K = { class: "app-container" }, Q = { class: "cell-item" }, W = { class: "cell-item" }, X = { class: "cell-item" }, Z = { class: "cell-item" }, x = { class: "cell-item" }, ee = { class: "cell-item" }, le = { class: "cell-item" }, se = { class: "cell-item" }, te = { class: "cell-item" }, oe = { class: "cell-item" }, ue = { class: "cell-item" }, ae = { class: "cell-item" }, ie = { class: "title-content" }, ne = { class: "cell-item" }, ce = { class: "cell-item" }, de = { class: "cell-item" }, re = { class: "cell-item" }, pe = { class: "cell-item" }, me = { class: "cell-item" }, _e = { class: "cell-item" }, fe = { class: "cell-item" }, ge = ["innerHTML"], Ie = /* @__PURE__ */ M({
9
9
  __name: "info",
@@ -1,6 +1,6 @@
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-Dvaotk7B.mjs";
3
- import re from "./skuTable-CyGQuTvR.mjs";
1
+ import { defineComponent as te, ref as S, computed as se, watch as $, resolveComponent as i, openBlock as m, createElementBlock as g, Fragment as b, unref as M, createVNode as o, withCtx as a, createCommentVNode as I, renderList as P, createElementVNode as k, 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-jCpYt-EU.mjs";
3
+ import re from "./skuTable-9JJqGeRx.mjs";
4
4
  import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
5
5
  const pe = { key: 0 }, ce = {
6
6
  key: 1,
@@ -105,7 +105,7 @@ const pe = { key: 0 }, ce = {
105
105
  u.value[e].specValueList.splice(l, 1);
106
106
  }
107
107
  function X() {
108
- h.value = new ne({ shopId: v.form.shopId }), console.log("handleSpecShow", h.value), h.value.useValues().then((e) => {
108
+ h.value = new ne({ shopId: v.form.shopId }), h.value.useValues().then((e) => {
109
109
  e.forEach((l) => {
110
110
  Array.isArray(u.value) && u.value.length > 0 && u.value.forEach((t) => {
111
111
  l.key === t.id && (l.disabled = !0);
@@ -145,7 +145,7 @@ const pe = { key: 0 }, ce = {
145
145
  }
146
146
  return (e, l) => {
147
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, [
148
+ return m(), g(b, null, [
149
149
  v.specType == M(D).SPEC_TYPE.UNIFIED_SPEC ? (m(), g("div", pe, [
150
150
  o(p, null, {
151
151
  default: a(() => [
@@ -337,13 +337,13 @@ const pe = { key: 0 }, ce = {
337
337
  default: a(() => [
338
338
  o(B, { label: "商品规格" }, {
339
339
  default: a(() => [
340
- (m(!0), g(k, null, P(u.value, (s, V) => (m(), g("div", {
340
+ (m(!0), g(b, null, P(u.value, (s, V) => (m(), g("div", {
341
341
  class: "goods-spec",
342
342
  key: V
343
343
  }, [
344
- b("div", ie, [
345
- b("span", null, O(s.name), 1),
346
- b("span", {
344
+ k("div", ie, [
345
+ k("span", null, O(s.name), 1),
346
+ k("span", {
347
347
  class: "goods-delete",
348
348
  onClick: (c) => Q(V)
349
349
  }, [
@@ -356,9 +356,9 @@ const pe = { key: 0 }, ce = {
356
356
  l[9] || (l[9] = y("移除 "))
357
357
  ], 8, me)
358
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, {
359
+ k("div", fe, [
360
+ k("div", ve, [
361
+ (m(!0), g(b, null, P(u.value[V].specValueList, (c, ae) => (m(), w(oe, {
362
362
  key: c,
363
363
  closable: "",
364
364
  type: "info",
@@ -394,7 +394,7 @@ const pe = { key: 0 }, ce = {
394
394
  onChange: (c) => x(c, V)
395
395
  }, {
396
396
  default: a(() => [
397
- (m(!0), g(k, null, P(_.value.values, (c) => (m(), w(N, {
397
+ (m(!0), g(b, null, P(_.value.values, (c) => (m(), w(N, {
398
398
  key: c.key,
399
399
  label: c.value,
400
400
  value: c.key,
@@ -431,7 +431,7 @@ const pe = { key: 0 }, ce = {
431
431
  onChange: Z
432
432
  }, {
433
433
  default: a(() => [
434
- (m(!0), g(k, null, P(h.value.values, (s) => (m(), w(N, {
434
+ (m(!0), g(b, null, P(h.value.values, (s) => (m(), w(N, {
435
435
  key: s.key,
436
436
  label: s.value,
437
437
  value: s.key,
@@ -469,7 +469,7 @@ const pe = { key: 0 }, ce = {
469
469
  ], 64);
470
470
  };
471
471
  }
472
- }), be = /* @__PURE__ */ de(Ve, [["__scopeId", "data-v-761a6cc9"]]);
472
+ }), he = /* @__PURE__ */ de(Ve, [["__scopeId", "data-v-e6aa4b01"]]);
473
473
  export {
474
- be as default
474
+ he as default
475
475
  };