xyvcard-goods 0.0.27 → 0.0.28

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 (30) hide show
  1. package/dist/{ImageUpload-BMw9FVJL.mjs → ImageUpload-Dk6GY6PA.mjs} +2 -2
  2. package/dist/{edit-CwYGsVHI.mjs → edit-CYekSxUa.mjs} +6 -6
  3. package/dist/{edit-CuYE3fHS.mjs → edit-C_XCVJwM.mjs} +3 -3
  4. package/dist/{edit-CvY-V0N5.mjs → edit-CquWa3hI.mjs} +86 -83
  5. package/dist/{edit-DmT9V-gh.mjs → edit-CuZnQH9w.mjs} +1 -1
  6. package/dist/{edit-C6CESv8X.mjs → edit-D1FAN3TA.mjs} +3 -3
  7. package/dist/{edit.vue_vue_type_script_setup_true_lang-DfFKgB6q.mjs → edit.vue_vue_type_script_setup_true_lang-BSxqVyG4.mjs} +74 -76
  8. package/dist/{goodsList-Bj9pZI5X.mjs → goodsList-DZlaY5k0.mjs} +1 -1
  9. package/dist/{goodsList-v98w-P_d.mjs → goodsList-wpPEPZqs.mjs} +1 -1
  10. package/dist/{goodsList.vue_vue_type_script_setup_true_lang-QHlAuCT3.mjs → goodsList.vue_vue_type_script_setup_true_lang-BFXFifWr.mjs} +3 -3
  11. package/dist/{goodsList.vue_vue_type_script_setup_true_lang-BsItIhFh.mjs → goodsList.vue_vue_type_script_setup_true_lang-iXycU5oS.mjs} +3 -3
  12. package/dist/{index-CXtRrzoC.mjs → index-B27GuULR.mjs} +1875 -1998
  13. package/dist/{index-D7Zknkay.mjs → index-B3vvD7JH.mjs} +14 -14
  14. package/dist/{index-B0qodJxZ.mjs → index-COXyxAor.mjs} +2 -2
  15. package/dist/{index-BrR_OdFN.mjs → index-DFxg3rmo.mjs} +3 -3
  16. package/dist/{index-0g53MREL.mjs → index-Dd1dJx7i.mjs} +14 -14
  17. package/dist/{index-DWtdS9Gu.mjs → index-Dy5JznUz.mjs} +3 -3
  18. package/dist/{index-CXEbqy-N.mjs → index-nCeCw43N.mjs} +14 -14
  19. package/dist/{index-szFiZJnI.mjs → index-wH3Sgvus.mjs} +1 -1
  20. package/dist/index.mjs +1 -1
  21. package/dist/{info-Bn5lfzNP.mjs → info-0Pf9u0GJ.mjs} +4 -4
  22. package/dist/info-NBnTd9fK.mjs +349 -0
  23. package/dist/{skuForm-DF02pgox.mjs → skuForm-BsvKk2kD.mjs} +65 -67
  24. package/dist/{skuForm-EQVH7pCG.mjs → skuForm-CU0a2ltJ.mjs} +6 -6
  25. package/dist/{skuTable-DWpm1OMq.mjs → skuTable-DgDGWX-n.mjs} +4 -4
  26. package/dist/style.css +1 -1
  27. package/dts/api/goods-spu/types.d.ts +3 -0
  28. package/dts/views/goods/goods-combination/skuTable.vue.d.ts +40 -0
  29. package/package.json +62 -62
  30. 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-COXyxAor.mjs";
5
+ import { a as L } from "./index-B27GuULR.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,15 +1,15 @@
1
- import { defineComponent as j, createElementBlock as v, openBlock as m, createElementVNode as M, ref as V, watch as B, resolveComponent as i, createBlock as g, withCtx as r, createVNode as c, unref as h, Fragment as Y, renderList as G, createCommentVNode as H, createTextVNode as x, toDisplayString as J } from "vue";
1
+ import { defineComponent as j, openBlock as m, createElementBlock as S, createElementVNode as M, ref as v, watch as B, resolveComponent as r, createBlock as h, withCtx as i, createVNode as c, unref as g, Fragment as Y, renderList as G, createCommentVNode as H, createTextVNode as x, toDisplayString as J } from "vue";
2
2
  import { useI18n as K } from "vue-i18n";
3
- import { D as S, C as U } from "./index-B0qodJxZ.mjs";
4
- import { a as O } from "./index-CXtRrzoC.mjs";
3
+ import { D as V, C as P } from "./index-COXyxAor.mjs";
4
+ import { a as O } from "./index-B27GuULR.mjs";
5
5
  import { specValueApi as Q } from "xyvcard-shop";
6
6
  import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
7
- /*! Element Plus Icons Vue v2.3.2 */
7
+ /*! Element Plus Icons Vue v2.3.1 */
8
8
  var X = /* @__PURE__ */ j({
9
9
  name: "Plus",
10
10
  __name: "plus",
11
11
  setup(b) {
12
- return (C, E) => (m(), v("svg", {
12
+ return (C, E) => (m(), S("svg", {
13
13
  xmlns: "http://www.w3.org/2000/svg",
14
14
  viewBox: "0 0 1024 1024"
15
15
  }, [
@@ -31,7 +31,7 @@ const w = { key: 0 }, ee = /* @__PURE__ */ j({
31
31
  },
32
32
  emits: ["getGoodsSku", "getFormData"],
33
33
  setup(b, { emit: C }) {
34
- const { t: E } = K(), P = V([]), d = V([
34
+ const { t: E } = K(), U = v([]), d = v([
35
35
  {
36
36
  salePrice: 0,
37
37
  skuId: "",
@@ -43,25 +43,24 @@ const w = { key: 0 }, ee = /* @__PURE__ */ j({
43
43
  skuOptions: []
44
44
  }
45
45
  ]);
46
- S.goodsSpuBizDict.useValues();
46
+ V.goodsSpuBizDict.useValues();
47
47
  const F = C;
48
48
  function L(s, l) {
49
49
  s.picUrl = l;
50
50
  }
51
- const N = b;
51
+ const y = b;
52
52
  B(
53
- N.form,
53
+ y.form,
54
54
  (s) => s,
55
55
  {
56
56
  deep: !0,
57
57
  immediate: !0
58
58
  }
59
- ), N.form.spuId && O.findGroupList({ goodsId: N.form.spuId }).then(({ data: s }) => {
60
- if (console.log("....", s), s && s.results.length > 0) {
59
+ ), y.form.spuId && O.findGroupList({ goodsId: y.form.spuId }).then(({ data: s }) => {
60
+ if (s && s.results.length > 0) {
61
61
  d.value = [];
62
62
  const l = s.results.map(async (e) => {
63
- console.log("item", e);
64
- const o = {
63
+ const t = {
65
64
  salePrice: e.salePrice || 0,
66
65
  skuId: e.skuId || "",
67
66
  spuId: e.spuId || "",
@@ -71,7 +70,7 @@ const w = { key: 0 }, ee = /* @__PURE__ */ j({
71
70
  specType: "",
72
71
  skuOptions: []
73
72
  };
74
- return await D(e.spuId, o), o.saleNum = e.saleNum || 0, o.specType === U.SPEC_TYPE.MULTI_SPEC && e.skuId && (o.skuId = e.skuId || "", o.salePrice = e.salePrice || 0, o.saleNum = e.saleNum || 0, o.picUrl = e.picUrl || "", $(e.skuId)), o;
73
+ return await D(e.spuId, t), t.saleNum = e.saleNum || 0, t.salePrice = e.salePrice || 0, t.specType === P.SPEC_TYPE.MULTI_SPEC && e.skuId && (t.skuId = e.skuId || "", t.salePrice = e.salePrice || 0, t.saleNum = e.saleNum || 0, t.picUrl = e.picUrl || "", $(e.skuId)), t;
75
74
  });
76
75
  Promise.all(l).then((e) => {
77
76
  d.value = e;
@@ -94,45 +93,45 @@ const w = { key: 0 }, ee = /* @__PURE__ */ j({
94
93
  skuOptions: []
95
94
  });
96
95
  }
97
- const T = V({});
96
+ const T = v({});
98
97
  async function z(s) {
99
- if (!P.value[s])
98
+ if (!U.value[s])
100
99
  try {
101
100
  const { data: l } = await Q.findById({
102
101
  specValueId: s
103
102
  });
104
- return P.value[s] = l.valueName, l.valueName;
103
+ return U.value[s] = l.valueName, l.valueName;
105
104
  } catch {
106
105
  }
107
106
  }
108
107
  async function D(s, l) {
109
- var e, o, k;
110
- if (console.log(l), l.skuId = "", l.skuOptions = [], l.picUrl = "", l.salePrice = 0, l.saleNum = 0, l.skuName = "", !s) {
111
- l.skuId = "", l.picUrl = "", l.salePrice = 0, l.saleNum = 0, l.skuName = ((e = S.goodsSpuBizDict.values.find((u) => u.key === s)) == null ? void 0 : e.value) ?? "", l.skuOptions = [];
108
+ var e, t, k;
109
+ if (l.skuId = "", l.skuOptions = [], l.picUrl = "", l.salePrice = 0, l.saleNum = 0, l.skuName = "", !s) {
110
+ l.skuId = "", l.picUrl = "", l.salePrice = 0, l.saleNum = 0, l.skuName = ((e = V.goodsSpuBizDict.values.find((o) => o.key === s)) == null ? void 0 : e.value) ?? "", l.skuOptions = [];
112
111
  return;
113
112
  }
114
113
  try {
115
- const { data: u } = await O.findById({ spuId: s });
116
- if (console.log(u), l.specType = u.specType, l.specType === U.SPEC_TYPE.UNIFIED_SPEC && (l.picUrl = u.picUrls ? u.picUrls.split(",")[0] : "", l.salePrice = (o = u.skuList) == null ? void 0 : o.results[0].salePrice, l.skuId = (k = u.skuList) == null ? void 0 : k.results[0].skuId, l.skuName = u.spuName, console.log("///")), l.specType === U.SPEC_TYPE.MULTI_SPEC && u.skuList) {
117
- const f = u.skuList.results, _ = f.map((t) => t.specValues && Array.isArray(t.specValues) ? t.specValues.map(
114
+ const { data: o } = await O.findById({ spuId: s });
115
+ if (l.specType = o.specType, l.specType === P.SPEC_TYPE.UNIFIED_SPEC && (l.picUrl = o.picUrls ? o.picUrls.split(",")[0] : "", l.salePrice = (t = o.skuList) == null ? void 0 : t.results[0].salePrice, l.skuId = (k = o.skuList) == null ? void 0 : k.results[0].skuId, l.skuName = o.spuName), l.specType === P.SPEC_TYPE.MULTI_SPEC && o.skuList) {
116
+ const f = o.skuList.results, _ = f.map((u) => u.specValues && Array.isArray(u.specValues) ? u.specValues.map(
118
117
  (p) => p.specValueId
119
- ) : []), y = _.flat().map((t) => z(t));
120
- await Promise.all(y);
118
+ ) : []), N = _.flat().map((u) => z(u));
119
+ await Promise.all(N);
121
120
  const I = _.map(
122
- (t) => t.map((p) => P.value[p] || p)
121
+ (u) => u.map((p) => U.value[p] || p)
123
122
  );
124
- l.skuOptions = f.map((t, p) => ({
125
- key: t.skuId,
123
+ l.skuOptions = f.map((u, p) => ({
124
+ key: u.skuId,
126
125
  value: I[p].join(" "),
127
126
  specInfo: I[p].join(" "),
128
- picUrl: t.picUrl || (u.picUrls ? u.picUrls.split(",")[0] : ""),
129
- salePrice: t.salePrice,
130
- stock: t.stock
131
- })), f.forEach((t, p) => {
132
- t.skuId && (T.value[t.skuId] = {
133
- ...t,
127
+ picUrl: u.picUrl || (o.picUrls ? o.picUrls.split(",")[0] : ""),
128
+ salePrice: u.salePrice,
129
+ stock: u.stock
130
+ })), f.forEach((u, p) => {
131
+ u.skuId && (T.value[u.skuId] = {
132
+ ...u,
134
133
  specInfo: I[p].join(" "),
135
- spuPicUrls: u.picUrls
134
+ spuPicUrls: o.picUrls
136
135
  });
137
136
  });
138
137
  }
@@ -144,15 +143,14 @@ const w = { key: 0 }, ee = /* @__PURE__ */ j({
144
143
  if (l && s) {
145
144
  const e = T.value[s];
146
145
  if (e) {
147
- const o = e.spuPicUrls ? e.spuPicUrls.split(",")[0] : "";
148
- l.picUrl = e.picUrl || o, l.salePrice = e.salePrice, l.specInfo = e.specInfo;
146
+ const t = e.spuPicUrls ? e.spuPicUrls.split(",")[0] : "";
147
+ l.picUrl = e.picUrl || t, l.salePrice = e.salePrice, l.specInfo = e.specInfo;
149
148
  }
150
149
  }
151
150
  }
152
151
  return B(
153
152
  d,
154
153
  (s) => {
155
- console.log("tableData", s);
156
154
  const l = s.filter((e) => e.spuId && e.skuId).map((e) => ({
157
155
  salePrice: e.salePrice,
158
156
  skuId: e.skuId,
@@ -162,32 +160,32 @@ const w = { key: 0 }, ee = /* @__PURE__ */ j({
162
160
  picUrl: e.picUrl,
163
161
  skuName: e.skuName
164
162
  }));
165
- F("getGoodsSku", l), console.log("filteredValue", l);
163
+ F("getGoodsSku", l);
166
164
  },
167
165
  {
168
166
  deep: !0,
169
167
  immediate: !0
170
168
  }
171
169
  ), (s, l) => {
172
- const e = i("jmash-select"), o = i("el-table-column"), k = i("el-option"), u = i("el-select"), f = i("jmash-single-image-upload"), _ = i("el-input-number"), y = i("DeleteFilled"), I = i("el-icon"), t = i("el-table"), p = i("el-button"), q = i("el-row");
173
- return m(), g(q, null, {
174
- default: r(() => [
175
- c(t, {
170
+ const e = r("jmash-select"), t = r("el-table-column"), k = r("el-option"), o = r("el-select"), f = r("jmash-single-image-upload"), _ = r("el-input-number"), N = r("DeleteFilled"), I = r("el-icon"), u = r("el-table"), p = r("el-button"), q = r("el-row");
171
+ return m(), h(q, null, {
172
+ default: i(() => [
173
+ c(u, {
176
174
  data: d.value,
177
175
  border: "",
178
176
  style: { width: "100%" }
179
177
  }, {
180
- default: r(() => [
181
- c(o, {
178
+ default: i(() => [
179
+ c(t, {
182
180
  label: s.$t("goodsSpu.spuName"),
183
181
  prop: "spuId",
184
182
  "header-align": "center"
185
183
  }, {
186
- default: r(({ row: a }) => [
184
+ default: i(({ row: a }) => [
187
185
  c(e, {
188
186
  modelValue: a.spuId,
189
187
  "onUpdate:modelValue": (n) => a.spuId = n,
190
- data: h(S).goodsSpuBizDict.values,
188
+ data: g(V).goodsSpuBizDict.values,
191
189
  filterable: "",
192
190
  clearable: "",
193
191
  placeholder: s.$t("goodsSpu.spuNameRequireds"),
@@ -197,20 +195,20 @@ const w = { key: 0 }, ee = /* @__PURE__ */ j({
197
195
  ]),
198
196
  _: 1
199
197
  }, 8, ["label"]),
200
- c(o, {
198
+ c(t, {
201
199
  label: s.$t("goodsSpu.specType"),
202
200
  "header-align": "center"
203
201
  }, {
204
- default: r(({ row: a }) => [
205
- a.specType === h(U).SPEC_TYPE.UNIFIED_SPEC ? (m(), v("span", w, " 统一规格 ")) : (m(), g(u, {
202
+ default: i(({ row: a }) => [
203
+ a.specType === g(P).SPEC_TYPE.UNIFIED_SPEC ? (m(), S("span", w, " 统一规格 ")) : (m(), h(o, {
206
204
  key: 1,
207
205
  modelValue: a.skuId,
208
206
  "onUpdate:modelValue": (n) => a.skuId = n,
209
207
  placeholder: s.$t("goodsSpu.specTypeRequired"),
210
208
  onChange: (n) => $(a.skuId)
211
209
  }, {
212
- default: r(() => [
213
- (m(!0), v(Y, null, G(a.skuOptions, (n) => (m(), g(k, {
210
+ default: i(() => [
211
+ (m(!0), S(Y, null, G(a.skuOptions, (n) => (m(), h(k, {
214
212
  key: n.key,
215
213
  label: n.value,
216
214
  value: n.key
@@ -221,13 +219,13 @@ const w = { key: 0 }, ee = /* @__PURE__ */ j({
221
219
  ]),
222
220
  _: 1
223
221
  }, 8, ["label"]),
224
- c(o, {
222
+ c(t, {
225
223
  label: s.$t("goodsSpu.picUrls"),
226
224
  prop: "picUrl",
227
225
  width: "105",
228
226
  "header-align": "center"
229
227
  }, {
230
- default: r(({ row: a }) => [
228
+ default: i(({ row: a }) => [
231
229
  c(f, {
232
230
  "picture-url": a.picUrl,
233
231
  onImageSrc: (n) => L(a, n),
@@ -237,12 +235,12 @@ const w = { key: 0 }, ee = /* @__PURE__ */ j({
237
235
  ]),
238
236
  _: 1
239
237
  }, 8, ["label"]),
240
- c(o, {
238
+ c(t, {
241
239
  label: s.$t("goodsSpu.salePriceV1"),
242
240
  prop: "salePrice",
243
241
  "header-align": "center"
244
242
  }, {
245
- default: r(({ row: a }) => [
243
+ default: i(({ row: a }) => [
246
244
  c(_, {
247
245
  modelValue: a.salePrice,
248
246
  "onUpdate:modelValue": (n) => a.salePrice = n,
@@ -255,12 +253,12 @@ const w = { key: 0 }, ee = /* @__PURE__ */ j({
255
253
  ]),
256
254
  _: 1
257
255
  }, 8, ["label"]),
258
- c(o, {
256
+ c(t, {
259
257
  label: s.$t("goodsSpu.saleNums"),
260
258
  prop: "saleNum",
261
259
  "header-align": "center"
262
260
  }, {
263
- default: r(({ row: a }) => [
261
+ default: i(({ row: a }) => [
264
262
  c(_, {
265
263
  modelValue: a.saleNum,
266
264
  "onUpdate:modelValue": (n) => a.saleNum = n,
@@ -273,21 +271,21 @@ const w = { key: 0 }, ee = /* @__PURE__ */ j({
273
271
  ]),
274
272
  _: 1
275
273
  }, 8, ["label"]),
276
- c(o, {
274
+ c(t, {
277
275
  label: s.$t("common.operate"),
278
276
  width: "60",
279
277
  align: "center"
280
278
  }, {
281
- default: r((a) => [
282
- a.$index !== 0 ? (m(), g(I, {
279
+ default: i((a) => [
280
+ a.$index !== 0 ? (m(), h(I, {
283
281
  key: 0,
284
282
  onClick: (n) => A(a),
285
283
  size: "18",
286
284
  style: { cursor: "pointer", color: "inherit" },
287
285
  class: "hover-blue"
288
286
  }, {
289
- default: r(() => [
290
- c(y)
287
+ default: i(() => [
288
+ c(N)
291
289
  ]),
292
290
  _: 2
293
291
  }, 1032, ["onClick"])) : H("", !0)
@@ -298,12 +296,12 @@ const w = { key: 0 }, ee = /* @__PURE__ */ j({
298
296
  _: 1
299
297
  }, 8, ["data"]),
300
298
  c(p, {
301
- icon: h(Z),
299
+ icon: g(Z),
302
300
  class: "addButton",
303
301
  onClick: R
304
302
  }, {
305
- default: r(() => [
306
- x(J(h(E)("common.add")), 1)
303
+ default: i(() => [
304
+ x(J(g(E)("common.add")), 1)
307
305
  ]),
308
306
  _: 1
309
307
  }, 8, ["icon"])
@@ -312,7 +310,7 @@ const w = { key: 0 }, ee = /* @__PURE__ */ j({
312
310
  });
313
311
  };
314
312
  }
315
- }), ne = /* @__PURE__ */ W(ee, [["__scopeId", "data-v-3217d67c"]]);
313
+ }), ne = /* @__PURE__ */ W(ee, [["__scopeId", "data-v-dc82ad15"]]);
316
314
  export {
317
315
  ne as default
318
316
  };