@bytenew/bn-bus-ui 1.1.520 → 1.1.522

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-De3GIwgm.js → assocTableSearch-BP7qFwIu.js} +1 -1
  2. package/dist/bn-bus-ui.es.js +43 -41
  3. package/dist/bn-bus-ui.umd.js +10 -10
  4. package/dist/{chooseIPaasData-BCkiWPbm.js → chooseIPaasData-CaWywJNL.js} +1 -1
  5. package/dist/{defaultSet-DlXoeeX3.js → defaultSet-1DJxDqby.js} +1 -1
  6. package/dist/{formItemFooter-DUNYcNhM.js → formItemFooter-Du9aUuyO.js} +1 -1
  7. package/dist/{funcExprDialog-yKVy5emy.js → funcExprDialog-C9gl_sFw.js} +1 -1
  8. package/dist/{goodCardStyle-Dlby3beV.js → goodCardStyle-C-1GkN6L.js} +1 -1
  9. package/dist/{index-Ci0TjQDu.js → index--a6vS_5I.js} +3 -3
  10. package/dist/{index-BebP6EE1.js → index-BCnRjoB6.js} +2 -2
  11. package/dist/{index-CKvqwhwh.js → index-BZdvkv4R.js} +2 -2
  12. package/dist/{index-B6i2_pVq.js → index-B_IfQEeb.js} +2 -2
  13. package/dist/{index-DXQIlbnO.js → index-BgIqcxyp.js} +2 -2
  14. package/dist/{index-CFZ--Wvh.js → index-Bo1MrIDw.js} +2 -2
  15. package/dist/{index-w4UcUvDF.js → index-C9ow94Kt.js} +3 -3
  16. package/dist/{index-B711BHVU.js → index-CLCCfSA9.js} +2 -2
  17. package/dist/{index-CEAQCvL0.js → index-COM9_-oh.js} +1 -1
  18. package/dist/{index-gc24807s.js → index-Cc9sW46k.js} +1 -1
  19. package/dist/{index-Z_5B-PzI.js → index-D370Ggr4.js} +1 -1
  20. package/dist/{index-DhsjDSKR.js → index-DHUoIuO3.js} +2 -2
  21. package/dist/{index-Cwci1hKS.js → index-DJax0wL7.js} +2 -2
  22. package/dist/{index-z9wdynj8.js → index-DLgOKVdW.js} +2 -2
  23. package/dist/{index-BuW7qkSJ.js → index-ZVo3t_nv.js} +2 -2
  24. package/dist/{index-D0cSkd2P.js → index-bHYCNvDe.js} +2 -2
  25. package/dist/{index-CSJX4vJG.js → index-nmbZstRx.js} +3 -3
  26. package/dist/{install-BFmb0BMv.js → install-DnwVVKyb.js} +5278 -3724
  27. package/dist/install.css +1 -1
  28. package/dist/setOption-D4JKlh4h.js +341 -0
  29. package/dist/setOption.css +1 -1
  30. package/dist/{setRelationOption-XziYZx-F.js → setRelationOption-CJxE3RF8.js} +1 -1
  31. package/package.json +1 -1
  32. package/dist/setOption-DdMnEd1P.js +0 -329
@@ -1,329 +0,0 @@
1
- import { cloneDeep as _ } from "lodash";
2
- import { resolveComponent as p, openBlock as u, createElementBlock as c, createElementVNode as s, toDisplayString as V, createVNode as d, withCtx as r, createTextVNode as h, createCommentVNode as w, withKeys as k, normalizeClass as g } from "vue";
3
- import { _ as I } from "./install-BFmb0BMv.js";
4
- const F = {
5
- name: "setOption",
6
- props: {
7
- columnData: {
8
- type: Object,
9
- default: () => ({})
10
- },
11
- openDataField: Boolean,
12
- // 是否支持数据字典配置
13
- postFunc: Function,
14
- // API请求函数
15
- extendPost: Object
16
- // 额外的请求参数
17
- },
18
- data() {
19
- return {
20
- addOptionText: "",
21
- // 批量添加输入框内容
22
- showBatchAdd: !1,
23
- // 是否显示批量添加区域
24
- newOptions: [],
25
- // 新增选项名称数组(用于橘黄色高亮)
26
- oldTitle: "",
27
- // 记录修改前的标题(用于更新newOptions)
28
- componentWidth: 0,
29
- // 组件宽度
30
- filedType: ""
31
- //是否选择数据字典 option选项 DataFields数据字典
32
- };
33
- },
34
- mounted() {
35
- var e;
36
- this.filedType = ((e = this.columnData.insideDataSourceInfo) == null ? void 0 : e.type) || "", this.calculateWidth();
37
- },
38
- methods: {
39
- /**
40
- * 计算组件宽度
41
- */
42
- calculateWidth() {
43
- this.$nextTick(() => {
44
- const e = this.$el;
45
- e && (this.componentWidth = e.offsetWidth);
46
- });
47
- },
48
- /**
49
- * 切换字典还是选项
50
- */
51
- changeFiledType() {
52
- this.columnData.moduleDefinition = [], this.columnData.defaultInfo = {}, this.columnData.insideDataSourceInfo = {}, this.filedType == "DataFields" && (this.columnData.insideDataSourceInfo = { type: "DataFields", table: "", field: "" });
53
- },
54
- /**
55
- * 判断是否为新增选项(用于橘黄色高亮)
56
- */
57
- isNewOption(e) {
58
- return this.newOptions.includes(e);
59
- },
60
- /**
61
- * 更新选项标题
62
- * 当用户修改输入框内容时,同步更新newOptions数组
63
- */
64
- updateOptionTitle(e) {
65
- if (this.oldTitle === e) return;
66
- const t = this.newOptions.indexOf(this.oldTitle);
67
- t > -1 && this.newOptions.splice(t, 1, e), this.oldTitle = "";
68
- },
69
- /**
70
- * 解析批量输入文本
71
- * 支持换行、中英文逗号、空格分隔,自动去重,最多100个
72
- */
73
- parseBatchText(e) {
74
- return e.split(/[\n,,\s]+/).map((t) => t.trim()).filter(Boolean).slice(0, 100);
75
- },
76
- /**
77
- * 过滤已存在的选项
78
- * 返回需要真正新增的选项列表
79
- */
80
- filterExistingOptions(e) {
81
- const t = this.columnData.moduleDefinition.map((i) => i.title);
82
- return e.filter((i) => !t.includes(i));
83
- },
84
- /**
85
- * 构造选项对象
86
- */
87
- buildOptions(e, t) {
88
- const i = this.columnData.moduleDefinition.length + 1;
89
- return e.map((f, n) => ({
90
- sequence: i + n,
91
- code: t[n],
92
- columnStatus: 1,
93
- id: t[n],
94
- title: f
95
- }));
96
- },
97
- /**
98
- * 滚动到列表底部
99
- */
100
- scrollToBottom() {
101
- this.$nextTick(() => {
102
- const e = this.$refs.optionList;
103
- if (e && e.$el) {
104
- const t = e.$el.querySelector(".el-scrollbar__wrap");
105
- t && (t.scrollTop = t.scrollHeight);
106
- }
107
- });
108
- },
109
- /**
110
- * 添加选项
111
- * @param {String} type - 操作类型:'add'追加、'cover'覆盖、undefined单个添加
112
- */
113
- async addOption(e) {
114
- var n;
115
- let t = [];
116
- if (e) {
117
- if (t = [...new Set(this.parseBatchText(this.addOptionText))], this.newOptions.push(...t), t = this.filterExistingOptions(t), t.length === 0) return;
118
- } else {
119
- const a = `选项${this.newOptions.length + 1}`;
120
- t = [a], this.newOptions.push(a);
121
- }
122
- const i = ((n = this.extendPost) == null ? void 0 : n.appId) || "noApp", f = await this.postFunc(
123
- `/v2/projects/customId/${t.length}/${i}`,
124
- null,
125
- "get"
126
- );
127
- if (!f.code) {
128
- const l = this.buildOptions(t, f.data);
129
- this.columnData.moduleDefinition = e === "cover" ? _(l) : [...this.columnData.moduleDefinition, ...l], this.scrollToBottom();
130
- }
131
- },
132
- /**
133
- * 删除选项
134
- */
135
- deleteOption(e, t) {
136
- this.columnData.moduleDefinition.splice(e, 1);
137
- const i = this.newOptions.indexOf(t);
138
- i > -1 && this.newOptions.splice(i, 1);
139
- }
140
- }
141
- }, B = { class: "setOpt" }, U = { class: "setOpt-top w-flex-center w-flex-between" }, S = { class: "w-flex-center" }, C = { class: "w-color-orange" }, A = {
142
- key: 0,
143
- class: "w-margin-left8"
144
- }, N = {
145
- key: 0,
146
- class: "w-flex-center"
147
- }, W = { class: "setOpt-filedType" }, E = {
148
- key: 0,
149
- class: "setOpt-batch"
150
- }, j = { class: "w-flex-right w-margin-top8" }, q = { key: 1 }, z = ["onClick"], L = {
151
- key: 0,
152
- class: "w-empty"
153
- }, K = {
154
- key: 2,
155
- class: "w-margin-top8"
156
- };
157
- function P(e, t, i, f, n, l) {
158
- const a = p("el-button"), D = p("el-segmented"), O = p("el-input"), v = p("el-switch"), y = p("draggable"), T = p("el-scrollbar"), b = p("BnSelect");
159
- return u(), c("div", B, [
160
- s("div", U, [
161
- s("div", S, [
162
- t[12] || (t[12] = s("div", { class: "setOpt-top-title" }, "选项配置", -1)),
163
- s("div", C, " (共" + V(i.columnData.moduleDefinition.length) + "个选项) ", 1),
164
- n.filedType != "DataFields" ? (u(), c("div", A, [
165
- d(a, {
166
- link: "",
167
- type: "primary",
168
- onClick: t[0] || (t[0] = (o) => {
169
- n.showBatchAdd = !n.showBatchAdd, n.addOptionText = "";
170
- }),
171
- class: "w-padding0"
172
- }, {
173
- default: r(() => [...t[10] || (t[10] = [
174
- s("span", { class: "bnUIcon bnUIcon-batchAdd w-padding-right2 w-font14" }, null, -1),
175
- h(" 批量 ", -1)
176
- ])]),
177
- _: 1
178
- }),
179
- d(a, {
180
- link: "",
181
- type: "primary",
182
- onClick: t[1] || (t[1] = (o) => l.addOption()),
183
- class: "w-padding0"
184
- }, {
185
- default: r(() => [...t[11] || (t[11] = [
186
- s("span", { class: "bnUIcon bnUIcon-addFile w-padding-right2 w-font14" }, null, -1),
187
- h("添加 ", -1)
188
- ])]),
189
- _: 1
190
- })
191
- ])) : w("", !0)
192
- ]),
193
- i.openDataField ? (u(), c("div", N, [
194
- s("div", W, [
195
- d(D, {
196
- modelValue: n.filedType,
197
- "onUpdate:modelValue": t[2] || (t[2] = (o) => n.filedType = o),
198
- props: { value: "id", label: "title" },
199
- onChange: l.changeFiledType,
200
- options: [{ id: "", title: "选项" }, { id: "DataFields", title: "数据字典" }]
201
- }, null, 8, ["modelValue", "onChange"])
202
- ])
203
- ])) : w("", !0)
204
- ]),
205
- n.showBatchAdd && n.filedType != "DataFields" ? (u(), c("div", E, [
206
- d(O, {
207
- modelValue: n.addOptionText,
208
- "onUpdate:modelValue": t[3] || (t[3] = (o) => n.addOptionText = o),
209
- type: "textarea",
210
- clearable: "",
211
- rows: 4,
212
- resize: "none",
213
- onKeydown: t[4] || (t[4] = k((o) => l.addOption("add"), ["enter"])),
214
- placeholder: "支持换行、逗号、空格分隔,自动去重,最多添加100个,手动按回车键自动进行追加操作"
215
- }, null, 8, ["modelValue"]),
216
- s("div", j, [
217
- d(a, {
218
- link: "",
219
- type: "warning",
220
- onClick: t[5] || (t[5] = (o) => {
221
- n.showBatchAdd = !1, n.addOptionText = "";
222
- })
223
- }, {
224
- default: r(() => [...t[13] || (t[13] = [
225
- h("收起", -1)
226
- ])]),
227
- _: 1
228
- }),
229
- d(a, {
230
- link: "",
231
- type: "primary",
232
- onClick: t[6] || (t[6] = (o) => l.addOption("add"))
233
- }, {
234
- default: r(() => [...t[14] || (t[14] = [
235
- h("追加", -1)
236
- ])]),
237
- _: 1
238
- }),
239
- d(a, {
240
- link: "",
241
- type: "primary",
242
- onClick: t[7] || (t[7] = (o) => l.addOption("cover"))
243
- }, {
244
- default: r(() => [...t[15] || (t[15] = [
245
- h("覆盖", -1)
246
- ])]),
247
- _: 1
248
- })
249
- ])
250
- ])) : w("", !0),
251
- n.filedType != "DataFields" ? (u(), c("div", q, [
252
- d(T, {
253
- "max-height": "260px",
254
- class: "setOpt-list",
255
- ref: "optionList"
256
- }, {
257
- default: r(() => [
258
- d(y, {
259
- modelValue: i.columnData.moduleDefinition,
260
- "onUpdate:modelValue": t[8] || (t[8] = (o) => i.columnData.moduleDefinition = o),
261
- "item-key": "id",
262
- handle: ".setOpt-list-item-drag",
263
- "ghost-class": "ghost-item",
264
- "chosen-class": "chosen-item",
265
- animation: "300",
266
- tag: "div"
267
- }, {
268
- item: r(({ element: o, index: x }) => [
269
- s("div", {
270
- class: g(["setOpt-list-item", [n.componentWidth > 400 ? "two" : "one"]])
271
- }, [
272
- t[16] || (t[16] = s("div", { class: "setOpt-list-item-drag w-default-hover" }, [
273
- s("span", { class: "bnUIcon bnUIcon-move" })
274
- ], -1)),
275
- d(O, {
276
- modelValue: o.title,
277
- "onUpdate:modelValue": (m) => o.title = m,
278
- modelModifiers: { trim: !0 },
279
- clearable: "",
280
- class: g({ "is-new-option": l.isNewOption(o.title) }),
281
- onFocus: (m) => n.oldTitle = o.title,
282
- maxlength: "100",
283
- "show-word-limit": "",
284
- onBlur: (m) => l.updateOptionTitle(o.title)
285
- }, null, 8, ["modelValue", "onUpdate:modelValue", "class", "onFocus", "onBlur"]),
286
- d(v, {
287
- modelValue: o.columnStatus,
288
- "onUpdate:modelValue": (m) => o.columnStatus = m,
289
- "active-value": 1,
290
- "inactive-value": 0,
291
- class: "w-padding-lr6"
292
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
293
- s("span", {
294
- class: "bnUIcon bnUIcon-delete",
295
- onClick: (m) => l.deleteOption(x, o.title)
296
- }, null, 8, z)
297
- ], 2)
298
- ]),
299
- _: 1
300
- }, 8, ["modelValue"])
301
- ]),
302
- _: 1
303
- }, 512),
304
- !i.columnData.moduleDefinition || i.columnData.moduleDefinition.length == 0 ? (u(), c("div", L, "暂无选项数据")) : w("", !0)
305
- ])) : (u(), c("div", K, [
306
- d(b, {
307
- modelValue: i.columnData.insideDataSourceInfo.field,
308
- "onUpdate:modelValue": t[9] || (t[9] = (o) => i.columnData.insideDataSourceInfo.field = o),
309
- clearable: "",
310
- filterable: "",
311
- labelInValue: !1,
312
- placeholder: "请选择你的数据字典",
313
- pathUrl: "/ipaas/web/enum/userList",
314
- "post-data": {
315
- pageSize: 1e3,
316
- pageNum: 1,
317
- data: {
318
- type: 1
319
- }
320
- },
321
- postFunc: i.postFunc
322
- }, null, 8, ["modelValue", "postFunc"])
323
- ]))
324
- ]);
325
- }
326
- const J = /* @__PURE__ */ I(F, [["render", P], ["__scopeId", "data-v-0ee05550"]]);
327
- export {
328
- J as default
329
- };