xyvcard-goods 0.0.27 → 0.0.29

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 (34) hide show
  1. package/dist/{ImageUpload-BMw9FVJL.mjs → ImageUpload-Dk6GY6PA.mjs} +2 -2
  2. package/dist/{edit-C6CESv8X.mjs → edit-1TXe_HC2.mjs} +24 -31
  3. package/dist/{edit-DmT9V-gh.mjs → edit-BDHYnZTL.mjs} +1 -1
  4. package/dist/{edit-CvY-V0N5.mjs → edit-Br1EAlBd.mjs} +86 -83
  5. package/dist/{edit-CwYGsVHI.mjs → edit-BzOoP1MM.mjs} +6 -6
  6. package/dist/{edit-CuYE3fHS.mjs → edit-C0U9Ge6U.mjs} +10 -10
  7. package/dist/{edit.vue_vue_type_script_setup_true_lang-DfFKgB6q.mjs → edit.vue_vue_type_script_setup_true_lang-BmH1D2Ce.mjs} +75 -77
  8. package/dist/index-BreCG7fL.mjs +562 -0
  9. package/dist/{index-szFiZJnI.mjs → index-ClnNQkIp.mjs} +1 -1
  10. package/dist/{index-D7Zknkay.mjs → index-D3Q39K5l.mjs} +63 -65
  11. package/dist/{index-0g53MREL.mjs → index-DYo45BS3.mjs} +35 -40
  12. package/dist/index-DwDXNfWH.mjs +644 -0
  13. package/dist/{index-CXtRrzoC.mjs → index-GWE4OrXj.mjs} +1882 -2005
  14. package/dist/{index-CXEbqy-N.mjs → index-RBIPJ3PM.mjs} +90 -95
  15. package/dist/{index-B0qodJxZ.mjs → index-rRbEKDlL.mjs} +53 -46
  16. package/dist/index.mjs +1 -1
  17. package/dist/info-DjDT9TId.mjs +349 -0
  18. package/dist/{info-Bn5lfzNP.mjs → info-Dji-jSuw.mjs} +4 -4
  19. package/dist/{skuForm-DF02pgox.mjs → skuForm-9X82lvcF.mjs} +65 -67
  20. package/dist/{skuForm-EQVH7pCG.mjs → skuForm-BzxL1_v6.mjs} +6 -6
  21. package/dist/{skuTable-DWpm1OMq.mjs → skuTable-RIQUU_Bl.mjs} +4 -4
  22. package/dist/style.css +1 -1
  23. package/dts/api/goods-spu/types.d.ts +3 -0
  24. package/dts/api/index.d.ts +1 -0
  25. package/dts/constant.d.ts +10 -0
  26. package/dts/views/goods/goods-combination/skuTable.vue.d.ts +40 -0
  27. package/package.json +62 -62
  28. package/dist/goodsList-Bj9pZI5X.mjs +0 -4
  29. package/dist/goodsList-v98w-P_d.mjs +0 -4
  30. package/dist/goodsList.vue_vue_type_script_setup_true_lang-BsItIhFh.mjs +0 -714
  31. package/dist/goodsList.vue_vue_type_script_setup_true_lang-QHlAuCT3.mjs +0 -565
  32. package/dist/index-BrR_OdFN.mjs +0 -55
  33. package/dist/index-DWtdS9Gu.mjs +0 -53
  34. package/dist/info-PRjY0AD1.mjs +0 -331
@@ -0,0 +1,349 @@
1
+ import { defineComponent as M, ref as P, resolveComponent as f, openBlock as _, createElementBlock as v, createVNode as o, withCtx as s, createTextVNode as p, toDisplayString as u, createElementVNode as d, Fragment as C, renderList as V, createBlock as D, unref as m } from "vue";
2
+ import { fileApi as S, routerUtil as R } from "jmash-core";
3
+ import { useRouter as j, useRoute as G } from "vue-router";
4
+ import { D as y, C as b } from "./index-rRbEKDlL.mjs";
5
+ import { a as L } from "./index-GWE4OrXj.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" }, le = { class: "cell-item" }, se = { class: "cell-item" }, te = { class: "cell-item" }, ae = { key: 0 }, ie = { key: 1 }, me = /* @__PURE__ */ M({
8
+ __name: "info",
9
+ setup(ue) {
10
+ const O = j(), U = G(), r = P({}), $ = P([]), B = P({}), N = P([]);
11
+ y.goodsCategoryListBizLayDict.useValues(), y.labelListBizDict.useValues(), y.goodsSpuBizDict.useValues();
12
+ const h = P([
13
+ {
14
+ salePrice: 0,
15
+ skuId: "",
16
+ spuId: "",
17
+ specInfo: "",
18
+ saleNum: 0,
19
+ picUrl: "",
20
+ specType: "",
21
+ skuOptions: []
22
+ }
23
+ ]);
24
+ U.query.spuId && (L.findById({ spuId: U.query.spuId }).then(({ data: e }) => {
25
+ var l;
26
+ r.value = Object.assign(r, e), $.value = (l = e.picUrls) == null ? void 0 : l.split(",");
27
+ }), L.findGroupList({ goodsId: U.query.spuId }).then(({ data: e }) => {
28
+ if (r.value.specType === b.SPEC_TYPE.UNIFIED_SPEC) {
29
+ e.results.forEach((l) => {
30
+ l.specType = r.value.specType;
31
+ }), h.value = e.results;
32
+ return;
33
+ }
34
+ if (e && e.results.length > 0) {
35
+ h.value = [];
36
+ const l = e.results.map(async (t) => {
37
+ const i = {
38
+ salePrice: t.salePrice || 0,
39
+ skuId: t.skuId || "",
40
+ spuId: t.spuId || "",
41
+ saleNum: t.saleNum || 0,
42
+ picUrl: t.picUrl || "",
43
+ specType: "",
44
+ skuOptions: []
45
+ };
46
+ return await A(t.spuId, i), i.saleNum = t.saleNum || 0, i.salePrice = t.salePrice || 0, i.specType === b.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;
47
+ });
48
+ Promise.all(l).then((t) => {
49
+ console.log(t), h.value = t;
50
+ });
51
+ }
52
+ }));
53
+ async function A(e, l) {
54
+ var t, i, k;
55
+ if (l.skuId = "", l.skuOptions = [], l.picUrl = "", l.salePrice = 0, l.saleNum = 0, !e) {
56
+ l.skuId = "", l.picUrl = "", l.salePrice = 0, l.saleNum = 0, l.skuOptions = [];
57
+ return;
58
+ }
59
+ try {
60
+ const { data: n } = await L.findById({ spuId: e });
61
+ if (l.specType = n.specType, l.specType === b.SPEC_TYPE.UNIFIED_SPEC && (l.picUrl = n.picUrls ? n.picUrls.split(",")[0] : "", l.salePrice = (t = n.skuList) == null ? void 0 : t.results[0].salePrice, l.saleNum = (i = n.skuList) == null ? void 0 : i.results[0].stock, l.skuId = (k = n.skuList) == null ? void 0 : k.results[0].skuId), l.specType === b.SPEC_TYPE.MULTI_SPEC && n.skuList) {
62
+ const I = n.skuList.results, g = I.map((c) => c.specValues && Array.isArray(c.specValues) ? c.specValues.map(
63
+ (a) => a.specValueId
64
+ ) : []), E = g.flat().map((c) => Y(c));
65
+ await Promise.all(E);
66
+ const T = g.map(
67
+ (c) => c.map((a) => N.value[a] || a)
68
+ );
69
+ l.skuOptions = I.map((c, a) => ({
70
+ key: c.skuId,
71
+ value: T[a].join(" "),
72
+ picUrl: c.picUrl || (n.picUrls ? n.picUrls.split(",")[0] : ""),
73
+ salePrice: c.salePrice,
74
+ stock: c.stock
75
+ })), I.forEach((c) => {
76
+ c.skuId && (B.value[c.skuId] = {
77
+ ...c,
78
+ spuPicUrls: n.picUrls
79
+ });
80
+ });
81
+ }
82
+ } catch {
83
+ }
84
+ }
85
+ function z(e) {
86
+ const l = h.value.find((t) => t.skuId === e);
87
+ if (l && e) {
88
+ const t = B.value[e];
89
+ if (t) {
90
+ const i = t.spuPicUrls ? t.spuPicUrls.split(",")[0] : "";
91
+ l.picUrl = t.picUrl || i, l.salePrice = t.salePrice, l.saleNum = t.stock;
92
+ }
93
+ }
94
+ }
95
+ async function Y(e) {
96
+ if (!N.value[e])
97
+ try {
98
+ const { data: l } = await H.findById({
99
+ specValueId: e
100
+ });
101
+ return N.value[e] = l.valueName, l.valueName;
102
+ } catch {
103
+ }
104
+ }
105
+ function F(e) {
106
+ if (!e.skuId || !e.skuOptions || e.skuOptions.length === 0)
107
+ return "";
108
+ const l = e.skuOptions.find(
109
+ (t) => t.key === e.skuId
110
+ );
111
+ return l ? l.value : "";
112
+ }
113
+ function q() {
114
+ R.closeTagView(U.fullPath, O, !1);
115
+ }
116
+ return (e, l) => {
117
+ const t = f("el-button"), i = f("el-descriptions-item"), k = f("el-tag"), n = f("el-image"), I = f("el-descriptions"), g = f("el-table-column"), E = f("el-table"), T = f("el-row"), c = f("el-card");
118
+ return _(), v("div", J, [
119
+ o(c, { shadow: "never" }, {
120
+ header: s(() => [
121
+ o(t, {
122
+ type: "primary",
123
+ onClick: q
124
+ }, {
125
+ default: s(() => [
126
+ p(u(e.$t("common.back")), 1)
127
+ ]),
128
+ _: 1
129
+ })
130
+ ]),
131
+ default: s(() => [
132
+ l[0] || (l[0] = d("div", { class: "title-content" }, "基本信息", -1)),
133
+ o(I, {
134
+ class: "margin-top",
135
+ column: 2,
136
+ border: ""
137
+ }, {
138
+ default: s(() => [
139
+ o(i, null, {
140
+ label: s(() => [
141
+ d("div", K, u(e.$t("goodsSpu.spuName")), 1)
142
+ ]),
143
+ default: s(() => [
144
+ p(" " + u(r.value.spuName), 1)
145
+ ]),
146
+ _: 1
147
+ }),
148
+ o(i, null, {
149
+ label: s(() => [
150
+ d("div", Q, u(e.$t("goodsSpu.spuCode")), 1)
151
+ ]),
152
+ default: s(() => [
153
+ p(" " + u(r.value.spuCode), 1)
154
+ ]),
155
+ _: 1
156
+ }),
157
+ o(i, null, {
158
+ label: s(() => [
159
+ d("div", W, u(e.$t("goodsSpu.categoryId")), 1)
160
+ ]),
161
+ default: s(() => [
162
+ (_(!0), v(C, null, V(r.value.categoryIds, (a) => (_(), D(k, {
163
+ type: "info",
164
+ key: a,
165
+ style: { "margin-right": "8px", "margin-bottom": "4px" }
166
+ }, {
167
+ default: s(() => [
168
+ p(u(m(y).goodsCategoryListBizLayDict.getValue(a)), 1)
169
+ ]),
170
+ _: 2
171
+ }, 1024))), 128))
172
+ ]),
173
+ _: 1
174
+ }),
175
+ o(i, null, {
176
+ label: s(() => [
177
+ d("div", X, u(e.$t("goodsSpu.saleNum")), 1)
178
+ ]),
179
+ default: s(() => [
180
+ p(" " + u(r.value.saleNum), 1)
181
+ ]),
182
+ _: 1
183
+ }),
184
+ o(i, null, {
185
+ label: s(() => [
186
+ d("div", Z, u(e.$t("goodsSpu.freightType")), 1)
187
+ ]),
188
+ default: s(() => [
189
+ p(" " + u(m(y).freightTypeEnum.getEnumValue(
190
+ r.value.freightType
191
+ )), 1)
192
+ ]),
193
+ _: 1
194
+ }),
195
+ o(i, null, {
196
+ label: s(() => [
197
+ d("div", w, u(e.$t("goodsSpu.freightAmount")), 1)
198
+ ]),
199
+ default: s(() => [
200
+ p(" " + u(r.value.freightAmount), 1)
201
+ ]),
202
+ _: 1
203
+ }),
204
+ o(i, null, {
205
+ label: s(() => [
206
+ d("div", x, u(e.$t("goodsSpu.minPrice")), 1)
207
+ ]),
208
+ default: s(() => [
209
+ p(" " + u(r.value.minPrice), 1)
210
+ ]),
211
+ _: 1
212
+ }),
213
+ o(i, null, {
214
+ label: s(() => [
215
+ d("div", ee, u(e.$t("goodsSpu.maxPrice")), 1)
216
+ ]),
217
+ default: s(() => [
218
+ p(" " + u(r.value.maxPrice), 1)
219
+ ]),
220
+ _: 1
221
+ }),
222
+ o(i, null, {
223
+ label: s(() => [
224
+ d("div", le, u(e.$t("goodsSpu.picUrls")), 1)
225
+ ]),
226
+ default: s(() => [
227
+ (_(!0), v(C, null, V($.value, (a) => (_(), D(n, {
228
+ key: a,
229
+ src: m(S).imageUrl(a, 80, 80),
230
+ "preview-src-list": [m(S).imageUrl(a)],
231
+ "preview-teleported": "",
232
+ "hide-on-click-modal": "",
233
+ fit: "contain"
234
+ }, null, 8, ["src", "preview-src-list"]))), 128))
235
+ ]),
236
+ _: 1
237
+ }),
238
+ o(i, null, {
239
+ label: s(() => [
240
+ d("div", se, u(e.$t("goodsSpu.shelf")), 1)
241
+ ]),
242
+ default: s(() => [
243
+ p(" " + u(m(y).shelfDict.getValue(r.value.shelf)), 1)
244
+ ]),
245
+ _: 1
246
+ }),
247
+ o(i, null, {
248
+ label: s(() => [
249
+ d("div", te, u(e.$t("goodsSpu.labelIds")), 1)
250
+ ]),
251
+ default: s(() => [
252
+ (_(!0), v(C, null, V(r.value.labelIds, (a) => (_(), D(k, {
253
+ type: "info",
254
+ key: a,
255
+ style: { "margin-right": "8px", "margin-bottom": "4px" }
256
+ }, {
257
+ default: s(() => [
258
+ p(u(m(y).labelListBizDict.getValue(a)), 1)
259
+ ]),
260
+ _: 2
261
+ }, 1024))), 128))
262
+ ]),
263
+ _: 1
264
+ })
265
+ ]),
266
+ _: 1
267
+ }),
268
+ l[1] || (l[1] = d("div", { class: "title-content" }, "套装商品", -1)),
269
+ o(T, null, {
270
+ default: s(() => [
271
+ o(E, {
272
+ data: h.value,
273
+ border: "",
274
+ style: { width: "100%" }
275
+ }, {
276
+ default: s(() => [
277
+ o(g, {
278
+ label: e.$t("goodsSpu.spuName"),
279
+ prop: "spuId",
280
+ "header-align": "center"
281
+ }, {
282
+ default: s(({ row: a }) => [
283
+ p(u(m(y).goodsSpuBizDict.getValue(a.spuId)), 1)
284
+ ]),
285
+ _: 1
286
+ }, 8, ["label"]),
287
+ o(g, {
288
+ label: e.$t("goodsSpu.specType"),
289
+ "header-align": "center"
290
+ }, {
291
+ default: s(({ row: a }) => [
292
+ a.specType === m(b).SPEC_TYPE.UNIFIED_SPEC ? (_(), v("span", ae, " 统一规格 ")) : (_(), v("span", ie, u(F(a)), 1))
293
+ ]),
294
+ _: 1
295
+ }, 8, ["label"]),
296
+ o(g, {
297
+ label: e.$t("goodsSpu.picUrls"),
298
+ prop: "picUrl",
299
+ width: "105",
300
+ "header-align": "center"
301
+ }, {
302
+ default: s(({ row: a }) => [
303
+ o(n, {
304
+ src: m(S).imageUrl(a.picUrl, 80, 80),
305
+ "preview-src-list": [m(S).imageUrl(a.picUrl)],
306
+ "preview-teleported": "",
307
+ "hide-on-click-modal": "",
308
+ fit: "contain"
309
+ }, null, 8, ["src", "preview-src-list"])
310
+ ]),
311
+ _: 1
312
+ }, 8, ["label"]),
313
+ o(g, {
314
+ label: e.$t("goodsSpu.salePriceV1"),
315
+ prop: "salePrice",
316
+ "header-align": "center"
317
+ }, {
318
+ default: s(({ row: a }) => [
319
+ p(u(a.salePrice), 1)
320
+ ]),
321
+ _: 1
322
+ }, 8, ["label"]),
323
+ o(g, {
324
+ label: e.$t("goodsSpu.saleNums"),
325
+ prop: "saleNum",
326
+ "header-align": "center"
327
+ }, {
328
+ default: s(({ row: a }) => [
329
+ p(u(a.saleNum), 1)
330
+ ]),
331
+ _: 1
332
+ }, 8, ["label"])
333
+ ]),
334
+ _: 1
335
+ }, 8, ["data"])
336
+ ]),
337
+ _: 1
338
+ })
339
+ ]),
340
+ _: 1,
341
+ __: [0, 1]
342
+ })
343
+ ]);
344
+ };
345
+ }
346
+ });
347
+ export {
348
+ me as default
349
+ };
@@ -1,9 +1,9 @@
1
- import { defineComponent as M, ref as y, computed as q, watch as j, resolveComponent as b, createElementBlock as k, openBlock as r, createVNode as i, withCtx as e, createElementVNode as a, createBlock as S, createCommentVNode as B, createTextVNode as n, toDisplayString as s, Fragment as L, renderList as I, unref as _ } from "vue";
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-B0qodJxZ.mjs";
5
- import Y from "./skuTable-DWpm1OMq.mjs";
6
- import { a as G } from "./index-CXtRrzoC.mjs";
4
+ import { D as d, C as N, S as R } from "./index-rRbEKDlL.mjs";
5
+ import Y from "./skuTable-RIQUU_Bl.mjs";
6
+ import { a as G } from "./index-GWE4OrXj.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",