@bytenew/bn-bus-ui 1.1.500 → 1.1.501

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 (32) hide show
  1. package/dist/{assocTableSearch-BmKfO30j.js → assocTableSearch-BCxMMvAj.js} +1 -1
  2. package/dist/bn-bus-ui.es.js +1 -1
  3. package/dist/bn-bus-ui.umd.js +3 -3
  4. package/dist/{chooseIPaasData-DbXFGmDp.js → chooseIPaasData-RbK6dZwy.js} +1 -1
  5. package/dist/{defaultSet-axsB6M39.js → defaultSet-B_uWCmA5.js} +1 -1
  6. package/dist/{formItemFooter-DU5t2yPc.js → formItemFooter-BOYl5_l1.js} +1 -1
  7. package/dist/{funcExprDialog-Cxu_A7lQ.js → funcExprDialog-BbN43AjY.js} +1 -1
  8. package/dist/goodCardStyle-CHF1nZjQ.js +368 -0
  9. package/dist/goodCardStyle.css +1 -1
  10. package/dist/{index-D_eN5ep4.js → index-BFkyrcCi.js} +2 -2
  11. package/dist/{index-x6bkPiOZ.js → index-BNsbXIrX.js} +1 -1
  12. package/dist/{index-VQiyw27l.js → index-BZQR3Cu9.js} +3 -3
  13. package/dist/{index-CjSYwokp.js → index-Bkra3fmj.js} +2 -2
  14. package/dist/{index-GAGFw811.js → index-CCCroXsg.js} +2 -2
  15. package/dist/{index-Cv2ZVij7.js → index-CIoBNHrs.js} +2 -2
  16. package/dist/{index-gtwI5ZmG.js → index-CUngeu7r.js} +3 -3
  17. package/dist/{index-CHtUxdec.js → index-CdCUXYce.js} +3 -3
  18. package/dist/{index-CzU2hlYh.js → index-D4NCn8JZ.js} +1 -1
  19. package/dist/{index-DatPtNHo.js → index-DF5APBPI.js} +2 -2
  20. package/dist/{index-DTu8a23B.js → index-DZFg1RwK.js} +2 -2
  21. package/dist/{index-Bm9E5GG6.js → index-DcVz_Qsn.js} +2 -2
  22. package/dist/{index-DVWt5Fw7.js → index-DvLE1Wrv.js} +1 -1
  23. package/dist/{index-C1k2UAEn.js → index-Vq1edznh.js} +2 -2
  24. package/dist/{index-B7UXY795.js → index-jYZlPScJ.js} +2 -2
  25. package/dist/{index-B6F1NFoj.js → index-l2_sYuvC.js} +2 -2
  26. package/dist/{index-UbFwCc9c.js → index-u1apePBY.js} +2 -2
  27. package/dist/{install-Bz_yfXDQ.js → install-CUFQIUMs.js} +51 -45
  28. package/dist/install.css +1 -1
  29. package/dist/{setOption-Dbyo0rsA.js → setOption-DGCscc6R.js} +1 -1
  30. package/dist/{setRelationOption-BSo2Lnsn.js → setRelationOption-DXfdqfZP.js} +1 -1
  31. package/package.json +1 -1
  32. package/dist/goodCardStyle-DNVkD29o.js +0 -358
@@ -1,358 +0,0 @@
1
- import { resolveComponent as f, openBlock as o, createBlock as c, withCtx as n, createElementVNode as s, createTextVNode as u, createVNode as v, createElementBlock as d, Fragment as m, renderList as g, toDisplayString as h, createCommentVNode as w } from "vue";
2
- import { _ as P } from "./install-Bz_yfXDQ.js";
3
- const T = {
4
- image: "https://banniu-work.oss-cn-zhangjiakou.aliyuncs.com/125_10030158_c216400ec482bbfc44c2ea13584508bd.png"
5
- };
6
- function _(t) {
7
- return t ? {
8
- id: t.id,
9
- title: t.name || "",
10
- behaviorType: t.behaviorType,
11
- columnCode: t.columnCode || t.key || t.insideDataSourceInfo && t.insideDataSourceInfo.field || ""
12
- } : { id: "", title: "", behaviorType: "", columnCode: "" };
13
- }
14
- function V(t) {
15
- if (!t || t.goodCardStyle == null || t.goodCardStyle === "")
16
- return null;
17
- try {
18
- const e = typeof t.goodCardStyle == "string" ? JSON.parse(t.goodCardStyle) : t.goodCardStyle;
19
- if (e && typeof e == "object" && !Array.isArray(e))
20
- return e;
21
- } catch {
22
- return null;
23
- }
24
- return null;
25
- }
26
- const D = {
27
- name: "goodCardStyle",
28
- props: {
29
- visible: {
30
- type: Boolean,
31
- default: !1
32
- },
33
- sourceData: {
34
- type: Object,
35
- default() {
36
- return { extraInfo: {}, style: {}, moduleDefinition: [] };
37
- }
38
- }
39
- },
40
- data() {
41
- return {
42
- form: {
43
- goodPicId: "",
44
- goodTitleId: "",
45
- previewIds: []
46
- },
47
- extraOpen: !1
48
- };
49
- },
50
- computed: {
51
- dialogVisible: {
52
- get() {
53
- return this.visible;
54
- },
55
- set(t) {
56
- this.$emit("update:visible", t);
57
- }
58
- },
59
- moduleList() {
60
- const t = this.sourceData && this.sourceData.moduleDefinition;
61
- return Array.isArray(t) ? t : [];
62
- },
63
- imageColumns() {
64
- return this.moduleList.filter((t) => t.behaviorType == 10);
65
- },
66
- textColumns() {
67
- return this.moduleList.filter((t) => [1, 2, 3, 4, 5, 6, 7].includes(Number(t.behaviorType)));
68
- },
69
- previewTags() {
70
- return this.form.previewIds.map((t) => this.moduleList.find((e) => e.id == t)).filter(Boolean);
71
- },
72
- hasAnyConfig() {
73
- return !!(this.form.goodPicId || this.form.goodTitleId || this.form.previewIds.length);
74
- },
75
- previewImage() {
76
- return this.form.goodPicId ? T.image : "";
77
- },
78
- previewTitle() {
79
- if (!this.form.goodTitleId) return "";
80
- const t = this.moduleList.find((e) => e.id == this.form.goodTitleId);
81
- return t && t.name || "—";
82
- },
83
- previewOnlyIds() {
84
- return (this.form.previewIds || []).filter((t) => t != this.form.goodTitleId && t != this.form.goodPicId);
85
- },
86
- shownPreviewRows() {
87
- return this.previewOnlyIds.map((t) => this.formatPreviewRow(t));
88
- },
89
- extraPreviewRows() {
90
- return this.textColumns.filter((e) => e.id != this.form.goodTitleId && !this.previewOnlyIds.includes(e.id)).map((e) => e.id).map((e) => this.formatPreviewRow(e));
91
- }
92
- },
93
- watch: {
94
- visible(t) {
95
- t && this.initForm();
96
- }
97
- },
98
- methods: {
99
- initForm() {
100
- const t = V(this.sourceData.style), e = t && t.goodPic && t.goodPic.id, a = t && t.goodTitle && t.goodTitle.id, C = t && Array.isArray(t.previews) ? t.previews.map((r) => r && r.id).filter(Boolean) : [];
101
- this.form = {
102
- goodPicId: this.stillExists(e, this.imageColumns) ? e : "",
103
- goodTitleId: this.stillExists(a, this.textColumns) ? a : "",
104
- previewIds: C.filter((r) => this.stillExists(r, this.textColumns))
105
- }, this.extraOpen = !1;
106
- },
107
- stillExists(t, e) {
108
- return t != null && t !== "" && e.some((a) => a.id == t);
109
- },
110
- formatPreviewRow(t) {
111
- const e = this.moduleList.find((a) => a.id == t);
112
- return e ? `${e.name}:-` : "";
113
- },
114
- removePreview(t) {
115
- this.form.previewIds = this.form.previewIds.filter((e) => e != t);
116
- },
117
- findColumn(t) {
118
- return this.moduleList.find((e) => e.id == t);
119
- },
120
- handleCancel() {
121
- this.dialogVisible = !1;
122
- },
123
- handleSave() {
124
- if (!this.form.goodPicId) {
125
- this.$message.warning("请配置商品图片");
126
- return;
127
- }
128
- if (!this.form.goodTitleId) {
129
- this.$message.warning("请配置标题字段");
130
- return;
131
- }
132
- if (!this.form.previewIds.length) {
133
- this.$message.warning("请至少选择一个预览字段");
134
- return;
135
- }
136
- this.sourceData.style || (this.sourceData.style = {});
137
- const t = {
138
- goodPic: _(this.findColumn(this.form.goodPicId)),
139
- goodTitle: _(this.findColumn(this.form.goodTitleId)),
140
- previews: this.form.previewIds.map((e) => _(this.findColumn(e))).filter((e) => e.id !== "")
141
- };
142
- this.sourceData.style = {
143
- ...this.sourceData.style,
144
- goodCardStyle: t
145
- }, this.$message.success("商品卡片配置已保存"), this.dialogVisible = !1;
146
- }
147
- }
148
- }, S = { class: "gcs-hd" }, L = { class: "gcs-bd" }, O = { class: "gcs-left" }, R = { class: "gcs-item" }, A = { class: "gcs-item" }, E = { class: "gcs-item" }, N = {
149
- key: 0,
150
- class: "gcs-tags"
151
- }, U = ["onClick"], B = { class: "gcs-right" }, j = {
152
- key: 0,
153
- class: "gcs-empty"
154
- }, F = {
155
- key: 1,
156
- class: "gcs-preview-box"
157
- }, G = { class: "goods-card" }, z = { class: "goods-img" }, H = ["src"], J = { key: 1 }, M = { class: "goods-meta" }, W = { class: "goods-title" }, Y = { class: "meta-grid" }, q = { class: "meta-row" }, K = {
158
- key: 1,
159
- class: "extra-fields meta-grid"
160
- }, Q = { class: "meta-row" }, X = { class: "gcs-ft" };
161
- function Z(t, e, a, C, r, l) {
162
- const y = f("el-option"), I = f("el-select"), b = f("el-tooltip"), k = f("el-button"), x = f("el-dialog");
163
- return o(), c(x, {
164
- modelValue: l.dialogVisible,
165
- "onUpdate:modelValue": e[5] || (e[5] = (i) => l.dialogVisible = i),
166
- class: "goods-card-style-dialog",
167
- "append-to-body": !0,
168
- "close-on-click-modal": !1,
169
- "show-close": !1,
170
- width: "880px",
171
- top: "8vh",
172
- "destroy-on-close": ""
173
- }, {
174
- default: n(() => [
175
- s("div", S, [
176
- e[6] || (e[6] = s("div", null, [
177
- s("div", { class: "gcs-hd-title" }, "商品卡片配置"),
178
- s("div", { class: "gcs-hd-sub" }, "PLUGIN DISPLAY / CARD"),
179
- s("div", { class: "gcs-hd-desc" }, "以下配置将用于插件端筛选、添加时的默认商品卡片展示")
180
- ], -1)),
181
- s("span", {
182
- class: "bnUIcon bnUIcon-close gcs-hd-close",
183
- onClick: e[0] || (e[0] = (...i) => l.handleCancel && l.handleCancel(...i))
184
- })
185
- ]),
186
- s("div", L, [
187
- s("div", O, [
188
- s("div", R, [
189
- e[7] || (e[7] = s("div", { class: "gcs-lab" }, [
190
- u(" 商品图片 "),
191
- s("span", { class: "gcs-chip red" }, "只能选择1个")
192
- ], -1)),
193
- e[8] || (e[8] = s("div", { class: "gcs-hint" }, "选择卡片左侧展示的商品图片字段", -1)),
194
- v(I, {
195
- modelValue: r.form.goodPicId,
196
- "onUpdate:modelValue": e[1] || (e[1] = (i) => r.form.goodPicId = i),
197
- filterable: "",
198
- clearable: "",
199
- placeholder: "请选择一个图片字段",
200
- style: { width: "100%" }
201
- }, {
202
- default: n(() => [
203
- (o(!0), d(m, null, g(l.imageColumns, (i) => (o(), c(y, {
204
- key: i.id,
205
- label: i.name,
206
- value: i.id
207
- }, null, 8, ["label", "value"]))), 128))
208
- ]),
209
- _: 1
210
- }, 8, ["modelValue"])
211
- ]),
212
- s("div", A, [
213
- e[9] || (e[9] = s("div", { class: "gcs-lab" }, [
214
- u(" 标题字段 "),
215
- s("span", { class: "gcs-chip red" }, "只能选择1个")
216
- ], -1)),
217
- e[10] || (e[10] = s("div", { class: "gcs-hint" }, "展示在图片右侧第一行,加粗显示,不展示组件名称", -1)),
218
- v(I, {
219
- modelValue: r.form.goodTitleId,
220
- "onUpdate:modelValue": e[2] || (e[2] = (i) => r.form.goodTitleId = i),
221
- filterable: "",
222
- clearable: "",
223
- placeholder: "请选择一个标题字段",
224
- style: { width: "100%" }
225
- }, {
226
- default: n(() => [
227
- (o(!0), d(m, null, g(l.textColumns, (i) => (o(), c(y, {
228
- key: i.id,
229
- label: i.name,
230
- value: i.id
231
- }, null, 8, ["label", "value"]))), 128))
232
- ]),
233
- _: 1
234
- }, 8, ["modelValue"])
235
- ]),
236
- s("div", E, [
237
- e[11] || (e[11] = s("div", { class: "gcs-lab" }, [
238
- u(" 预览字段 "),
239
- s("span", { class: "gcs-chip blue" }, "多选")
240
- ], -1)),
241
- e[12] || (e[12] = s("div", { class: "gcs-hint" }, "卡片默认展示全部已选字段,每行展示两个字段", -1)),
242
- v(I, {
243
- modelValue: r.form.previewIds,
244
- "onUpdate:modelValue": e[3] || (e[3] = (i) => r.form.previewIds = i),
245
- multiple: "",
246
- filterable: "",
247
- "collapse-tags": "",
248
- "collapse-tags-tooltip": "",
249
- placeholder: "请选择预览字段(可多选)",
250
- style: { width: "100%" }
251
- }, {
252
- default: n(() => [
253
- (o(!0), d(m, null, g(l.textColumns, (i) => (o(), c(y, {
254
- key: i.id,
255
- label: i.name,
256
- value: i.id
257
- }, null, 8, ["label", "value"]))), 128))
258
- ]),
259
- _: 1
260
- }, 8, ["modelValue"]),
261
- l.previewTags.length ? (o(), d("div", N, [
262
- (o(!0), d(m, null, g(l.previewTags, (i) => (o(), d("span", {
263
- key: i.id,
264
- class: "gcs-tag"
265
- }, [
266
- u(h(i.name) + " ", 1),
267
- s("i", {
268
- class: "gcs-tag-rm",
269
- onClick: (p) => l.removePreview(i.id)
270
- }, "×", 8, U)
271
- ]))), 128))
272
- ])) : w("", !0)
273
- ])
274
- ]),
275
- s("div", B, [
276
- e[13] || (e[13] = s("div", { class: "gcs-right-title" }, "效果预览", -1)),
277
- e[14] || (e[14] = s("div", { class: "gcs-right-sub" }, "插件端筛选卡片", -1)),
278
- l.hasAnyConfig ? (o(), d("div", F, [
279
- s("div", G, [
280
- s("div", z, [
281
- l.previewImage ? (o(), d("img", {
282
- key: 0,
283
- src: l.previewImage,
284
- alt: ""
285
- }, null, 8, H)) : (o(), d("span", J, "未配置主图"))
286
- ]),
287
- s("div", M, [
288
- l.previewTitle ? (o(), c(b, {
289
- key: 0,
290
- content: l.previewTitle,
291
- placement: "top"
292
- }, {
293
- default: n(() => [
294
- s("div", W, h(l.previewTitle), 1)
295
- ]),
296
- _: 1
297
- }, 8, ["content"])) : w("", !0),
298
- s("div", Y, [
299
- (o(!0), d(m, null, g(l.shownPreviewRows, (i, p) => (o(), c(b, {
300
- key: p,
301
- content: i,
302
- placement: "top"
303
- }, {
304
- default: n(() => [
305
- s("div", q, h(i), 1)
306
- ]),
307
- _: 2
308
- }, 1032, ["content"]))), 128))
309
- ]),
310
- l.extraPreviewRows.length && r.extraOpen ? (o(), d("div", K, [
311
- (o(!0), d(m, null, g(l.extraPreviewRows, (i, p) => (o(), c(b, {
312
- key: "e" + p,
313
- content: i,
314
- placement: "top"
315
- }, {
316
- default: n(() => [
317
- s("div", Q, h(i), 1)
318
- ]),
319
- _: 2
320
- }, 1032, ["content"]))), 128))
321
- ])) : w("", !0)
322
- ]),
323
- l.extraPreviewRows.length ? (o(), d("span", {
324
- key: 0,
325
- class: "more-link",
326
- onClick: e[4] || (e[4] = (i) => r.extraOpen = !r.extraOpen)
327
- }, h(r.extraOpen ? "收起" : "更多 >"), 1)) : w("", !0)
328
- ])
329
- ])) : (o(), d("div", j, "请先选择商品图片、标题字段和预览字段")),
330
- e[15] || (e[15] = s("div", { class: "gcs-right-tip" }, "配置字段变化后,卡片会自动更新", -1))
331
- ])
332
- ]),
333
- s("div", X, [
334
- v(k, { onClick: l.handleCancel }, {
335
- default: n(() => [...e[16] || (e[16] = [
336
- u("取 消", -1)
337
- ])]),
338
- _: 1
339
- }, 8, ["onClick"]),
340
- v(k, {
341
- type: "primary",
342
- class: "gcs-save",
343
- onClick: l.handleSave
344
- }, {
345
- default: n(() => [...e[17] || (e[17] = [
346
- u("保存配置", -1)
347
- ])]),
348
- _: 1
349
- }, 8, ["onClick"])
350
- ])
351
- ]),
352
- _: 1
353
- }, 8, ["modelValue"]);
354
- }
355
- const te = /* @__PURE__ */ P(D, [["render", Z], ["__scopeId", "data-v-7ff0ede5"]]);
356
- export {
357
- te as default
358
- };