@bytenew/bn-bus-ui 1.1.399

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 (46) hide show
  1. package/README.md +637 -0
  2. package/common.scss +715 -0
  3. package/dist/assocTableSearch-C9KUFIpd.js +349 -0
  4. package/dist/assocTableSearch.css +1 -0
  5. package/dist/bn-bus-ui.es.js +58 -0
  6. package/dist/bn-bus-ui.umd.js +42 -0
  7. package/dist/chooseIPaasData-Bfm58C-0.js +391 -0
  8. package/dist/chooseIPaasData.css +1 -0
  9. package/dist/defaultSet-BA11k622.js +322 -0
  10. package/dist/defaultSet.css +1 -0
  11. package/dist/fileFormData-D_Q1vylE.js +53 -0
  12. package/dist/formItemFooter-B3nlSwnS.js +108 -0
  13. package/dist/formItemFooter.css +1 -0
  14. package/dist/funcExprDialog-DeHPFa-L.js +139 -0
  15. package/dist/funcExprDialog.css +1 -0
  16. package/dist/index-B8KbssVN.js +45 -0
  17. package/dist/index-CTZ-0Tyh.js +45 -0
  18. package/dist/index-CZOFm8wK.js +135 -0
  19. package/dist/index-C_ix9-hS.js +44 -0
  20. package/dist/index-Cov88CtD.js +221 -0
  21. package/dist/index-DAtLc2a1.js +89 -0
  22. package/dist/index-DCbIfKgk.js +66 -0
  23. package/dist/index-DDy1d3BS.js +178 -0
  24. package/dist/index-DJ15iYPg.js +89 -0
  25. package/dist/index-DNHXG3dr.js +62 -0
  26. package/dist/index-Dg5V1uNO.js +740 -0
  27. package/dist/index-Dme97Hra.js +118 -0
  28. package/dist/index-DnzoAsk8.js +109 -0
  29. package/dist/index-DrngruPb.js +64 -0
  30. package/dist/index-Q08paoUN.js +51 -0
  31. package/dist/index-VbL1cqCu.js +58 -0
  32. package/dist/index-aooX1QXm.js +183 -0
  33. package/dist/index.css +1 -0
  34. package/dist/index2.css +1 -0
  35. package/dist/index3.css +1 -0
  36. package/dist/index4.css +1 -0
  37. package/dist/index5.css +1 -0
  38. package/dist/index6.css +1 -0
  39. package/dist/index7.css +1 -0
  40. package/dist/install-DSQCBsd_.js +19155 -0
  41. package/dist/install.css +1 -0
  42. package/dist/setOption-BOD7nAuG.js +329 -0
  43. package/dist/setOption.css +1 -0
  44. package/dist/setRelationOption-D7FqiLWj.js +5217 -0
  45. package/dist/setRelationOption.css +1 -0
  46. package/package.json +57 -0
@@ -0,0 +1,391 @@
1
+ import { cloneDeep as w } from "lodash";
2
+ import { _, g as N, a as E } from "./install-DSQCBsd_.js";
3
+ import { withDirectives as k, openBlock as u, createElementBlock as v, withModifiers as L, normalizeStyle as z, vShow as B, resolveComponent as d, resolveDirective as U, createBlock as C, withCtx as a, createVNode as r, createElementVNode as c, Fragment as D, renderList as P, createTextVNode as f, toDisplayString as x } from "vue";
4
+ const A = {
5
+ name: "WorksheetCopy",
6
+ data() {
7
+ return {
8
+ isMouseIn: !1,
9
+ visiable: !1,
10
+ params: {},
11
+ style: {}
12
+ };
13
+ },
14
+ methods: {
15
+ /**
16
+ * 鼠标移入移出
17
+ * @param {Event} e 事件对象
18
+ */
19
+ onMouseEvent(s) {
20
+ this.isMouseIn = s.type !== "mouseleave";
21
+ },
22
+ /**
23
+ * 初始化
24
+ * @param {Object} params {column:组件信息,row:行数据}
25
+ */
26
+ onShow(s, e) {
27
+ try {
28
+ const { right: n, top: o } = s.getBoundingClientRect();
29
+ this.style = {
30
+ left: `${n - 34}px`,
31
+ top: `${o}px`
32
+ }, this.params = e, this.visiable = !0;
33
+ } catch {
34
+ console.log("显示复制按钮失败");
35
+ }
36
+ },
37
+ onHide() {
38
+ this.visiable = !1;
39
+ },
40
+ /**
41
+ * 复制文本
42
+ */
43
+ copyText() {
44
+ const { column: s, row: e } = this.params;
45
+ let n = e[s.columnCode] || "";
46
+ if (n) {
47
+ const o = document.createElement("textarea");
48
+ o.value = n, document.body.appendChild(o), o.select(), document.execCommand("copy"), document.body.removeChild(o), this.$message.success("复制成功");
49
+ } else
50
+ this.$message.warning("无内容可复制");
51
+ }
52
+ }
53
+ };
54
+ function H(s, e, n, o, t, l) {
55
+ return k((u(), v("div", {
56
+ class: "worksheetCopy",
57
+ style: z(t.style),
58
+ onMouseover: e[0] || (e[0] = (...h) => l.onMouseEvent && l.onMouseEvent(...h)),
59
+ onMouseleave: e[1] || (e[1] = (...h) => l.onMouseEvent && l.onMouseEvent(...h)),
60
+ onClick: e[2] || (e[2] = L((...h) => l.copyText && l.copyText(...h), ["stop"]))
61
+ }, "复制 ", 36)), [
62
+ [B, t.visiable || t.isMouseIn]
63
+ ]);
64
+ }
65
+ const O = /* @__PURE__ */ _(A, [["render", H], ["__scopeId", "data-v-684f7285"]]), j = {
66
+ name: "chooseIPaasData",
67
+ components: { tableCellCopy: O },
68
+ props: {
69
+ // 接口请求外部转发
70
+ postFunc: Function,
71
+ // 扩展参数
72
+ extendPost: Object
73
+ },
74
+ data() {
75
+ return {
76
+ show: !1,
77
+ loading: !1,
78
+ // 子表单信息
79
+ columnData: {},
80
+ // 支持筛选的组件
81
+ searchColumns: [],
82
+ // 对筛选组件进行处理,尽量少的传一些字段
83
+ conditions: [],
84
+ // 最大高度
85
+ tableMaxHeight: 400,
86
+ // 选中数据
87
+ selectData: [],
88
+ // 高级筛选
89
+ searchPost: {
90
+ pageSize: 20,
91
+ pageNum: 1,
92
+ total: 0,
93
+ conditions: [],
94
+ taskContent: ""
95
+ },
96
+ // 表格数据
97
+ orderList: [],
98
+ // 快捷筛选项
99
+ searchList: []
100
+ };
101
+ },
102
+ methods: {
103
+ /**
104
+ * 打开选择弹框,处理数据回显
105
+ * */
106
+ open(s, e) {
107
+ this.columnData = w(s), this.orderList = [], this.searchPost.pageNum = 1, this.searchPost.taskContent = JSON.stringify(e), this.searchColumns = [];
108
+ try {
109
+ let n = [];
110
+ s.moduleDefinition.forEach((o) => {
111
+ let t = o.outDataSourceInfo[0] || {}, l = t.extend ? JSON.parse(t.extend) : {};
112
+ t.platform == "relation_ipaas" && l.io == "in" && n.push(o);
113
+ }), this.searchColumns = E(n, this.extendPost.appId, this.extendPost.projectId), this.conditions = this.searchColumns.map((o) => ({
114
+ id: o.id,
115
+ name: o.name,
116
+ behaviorType: o.behaviorType,
117
+ columnCode: o.columnCode,
118
+ searchType: o.searchType,
119
+ value: o.value
120
+ }));
121
+ } catch (n) {
122
+ console.log("格式化关联表筛选组件" + n);
123
+ }
124
+ this.tableMaxHeight = window.innerHeight - 360, this.postFunc(`/v2/client/cache/get/${this.extendPost.projectId}_${this.columnData.id}_${this.extendPost.userId || ""}_assocTable`, {}, "get").then((n) => {
125
+ if (!n.code && n.data) {
126
+ const o = JSON.parse(n.data);
127
+ o.conditions ? this.searchPost.conditions = o.conditions : this.searchColumns.length > 0 && (this.searchPost.conditions = [w(this.searchColumns[0])]);
128
+ }
129
+ this.search();
130
+ }), this.show = !0;
131
+ },
132
+ /**
133
+ * 选中任务
134
+ * */
135
+ checkChange({ checked: s, row: e }) {
136
+ this.$refs.assocTable.setCheckboxRow(e, s), s ? this.selectData.includes(e.id) || this.selectData.push(e.id) : this.selectData.includes(e.id) && this.selectData.splice(this.selectData.indexOf(e.id), 1);
137
+ },
138
+ /**
139
+ * 全选任务
140
+ * */
141
+ checkAllTask({ records: s }) {
142
+ s.length != 0 ? s.map((e) => {
143
+ this.selectData.includes(e.id) || this.selectData.push(e.id);
144
+ }) : this.selectData = [];
145
+ },
146
+ /**
147
+ * 筛选数据
148
+ * */
149
+ search(s) {
150
+ var n;
151
+ this.searchPost = { ...this.searchPost, ...s }, this.postFunc("/v2/client/cache/save", {
152
+ key: `${this.extendPost.projectId}_${this.columnData.id}_${this.extendPost.userId || ""}_assocTable`,
153
+ value: this.searchPost
154
+ });
155
+ let e = {
156
+ ...this.searchPost,
157
+ conditions: JSON.stringify(this.searchPost.conditions),
158
+ originId: this.extendPost.projectId,
159
+ subFormId: this.columnData.id
160
+ };
161
+ this.selectData = [], (n = this.$refs.assocTable) == null || n.clearCheckboxRow(), this.loading = !0, this.postFunc("/biztable/content/queryChildTask", e).then((o) => {
162
+ this.loading = !1, o.code ? (this.orderList = [], this.searchPost.total = 0, this.searchPost.pageNum = 1) : (this.orderList = o.data.results, this.searchPost.total = parseInt(o.data.total), this.searchPost.pageNum = o.data.pageNum);
163
+ });
164
+ },
165
+ /**
166
+ * 鼠标移入移出单元格,展示隐藏复制按钮
167
+ * @param {Event} e 事件对象
168
+ */
169
+ onMouseEvent(s) {
170
+ var n, o, t;
171
+ if (s.$event.type === "mouseleave")
172
+ (n = this.$refs.childTableCopy) == null || n.onHide();
173
+ else {
174
+ let l = {
175
+ column: { columnCode: (o = this.headerColumns[s.columnIndex - 2]) == null ? void 0 : o.columnCode },
176
+ row: s.row
177
+ };
178
+ l.row[l.column.columnCode] && ((t = this.$refs.childTableCopy) == null || t.onShow(s.cell, l));
179
+ }
180
+ },
181
+ /**
182
+ * 转义title
183
+ * */
184
+ getTitle(s, e) {
185
+ return N(s, !0, e);
186
+ },
187
+ /**
188
+ * 确认
189
+ * */
190
+ sure(s) {
191
+ let e = this.orderList.reduce((n, o) => (this.selectData.includes(o.id) && n.push(o), n), []);
192
+ setTimeout(() => {
193
+ this.$emit("setChildrenForm", e, s, this.columnData.columnCode);
194
+ }, 200), this.show = !1;
195
+ }
196
+ }
197
+ }, J = { class: "chooseIPaasData" }, R = { class: "chooseIPaasData-search w-margin-bottom10" }, q = { class: "w-flex-between w-margin-bottom10" }, K = { class: "w-flex-center" }, W = { class: "w-flex-center" }, G = { class: "w-flex-right w-flex-center" }, Q = { class: "w-font13 w-color-gray w-margin-right8" };
198
+ function X(s, e, n, o, t, l) {
199
+ const h = d("tableCellCopy"), I = d("BnAdvancedFilter"), m = d("el-button"), T = d("BnDrop"), b = d("vxe-column"), M = d("vxe-table"), S = d("el-pagination"), y = d("el-popover"), F = d("el-dialog"), V = U("loading");
200
+ return u(), C(F, {
201
+ modelValue: t.show,
202
+ "onUpdate:modelValue": e[7] || (e[7] = (i) => t.show = i),
203
+ title: `请选择${t.columnData.name}`,
204
+ top: "18px",
205
+ width: "70%",
206
+ "destroy-on-close": "",
207
+ style: { "margin-bottom": "0" }
208
+ }, {
209
+ footer: a(() => [
210
+ c("div", G, [
211
+ c("span", Q, "已选择(" + x(t.selectData.length) + "/" + x(t.orderList.length) + ")条", 1),
212
+ r(S, {
213
+ class: "w-margin-right8",
214
+ background: "",
215
+ "current-page": t.searchPost.pageNum,
216
+ "onUpdate:currentPage": e[2] || (e[2] = (i) => t.searchPost.pageNum = i),
217
+ "page-size": t.searchPost.pageSize,
218
+ "onUpdate:pageSize": e[3] || (e[3] = (i) => t.searchPost.pageSize = i),
219
+ layout: "prev, pager, next",
220
+ onCurrentChange: l.search,
221
+ total: t.searchPost.total
222
+ }, null, 8, ["current-page", "page-size", "onCurrentChange", "total"]),
223
+ r(m, {
224
+ onClick: e[4] || (e[4] = (i) => t.show = !1)
225
+ }, {
226
+ default: a(() => [...e[11] || (e[11] = [
227
+ f("取消", -1)
228
+ ])]),
229
+ _: 1
230
+ }),
231
+ r(y, {
232
+ placement: "top-start",
233
+ width: 298,
234
+ trigger: "hover"
235
+ }, {
236
+ reference: a(() => [
237
+ r(m, {
238
+ type: "primary",
239
+ onClick: e[5] || (e[5] = (i) => l.sure("add")),
240
+ disabled: t.selectData.length == 0
241
+ }, {
242
+ default: a(() => [...e[12] || (e[12] = [
243
+ f("确认追加", -1)
244
+ ])]),
245
+ _: 1
246
+ }, 8, ["disabled"])
247
+ ]),
248
+ default: a(() => [
249
+ e[13] || (e[13] = c("div", { class: "BnSmartForm-title-tip" }, "在原有的子表单值的基础上追加选中的数据", -1))
250
+ ]),
251
+ _: 1
252
+ }),
253
+ r(y, {
254
+ placement: "top-start",
255
+ width: 290,
256
+ trigger: "hover"
257
+ }, {
258
+ reference: a(() => [
259
+ r(m, {
260
+ type: "primary",
261
+ onClick: e[6] || (e[6] = (i) => l.sure("cover")),
262
+ disabled: t.selectData.length == 0
263
+ }, {
264
+ default: a(() => [...e[14] || (e[14] = [
265
+ f("确认覆盖", -1)
266
+ ])]),
267
+ _: 1
268
+ }, 8, ["disabled"])
269
+ ]),
270
+ default: a(() => [
271
+ e[15] || (e[15] = c("div", { class: "BnSmartForm-title-tip" }, "用选中的数据直接覆盖子表单的原有的值", -1))
272
+ ]),
273
+ _: 1
274
+ })
275
+ ])
276
+ ]),
277
+ default: a(() => [
278
+ r(h, { ref: "childTableCopy" }, null, 512),
279
+ c("div", J, [
280
+ c("div", R, [
281
+ (u(!0), v(D, null, P(t.searchPost.conditions, (i, p) => (u(), v("div", {
282
+ key: p,
283
+ class: "chooseIPaasData-search-item"
284
+ }, [
285
+ r(I, {
286
+ modelValue: t.searchPost.conditions[p],
287
+ "onUpdate:modelValue": (g) => t.searchPost.conditions[p] = g,
288
+ columnList: t.searchColumns,
289
+ onValueChange: e[0] || (e[0] = (g) => l.search()),
290
+ allowSearchType: !1,
291
+ allowDel: "",
292
+ onDel: (g) => t.searchPost.conditions.splice(p, 1),
293
+ postFunc: n.postFunc,
294
+ pathUrl: i.pathUrl,
295
+ postData: i.postData
296
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "columnList", "onDel", "postFunc", "pathUrl", "postData"])
297
+ ]))), 128))
298
+ ]),
299
+ c("div", q, [
300
+ c("div", K, [
301
+ r(T, {
302
+ modelValue: t.searchPost.conditions,
303
+ "onUpdate:modelValue": e[1] || (e[1] = (i) => t.searchPost.conditions = i),
304
+ options: t.conditions,
305
+ multiple: "",
306
+ optionProps: { value: "columnCode", label: "name" }
307
+ }, {
308
+ default: a(() => [
309
+ r(m, {
310
+ type: "primary",
311
+ link: ""
312
+ }, {
313
+ default: a(() => [...e[8] || (e[8] = [
314
+ f(" + 添加筛选条件", -1)
315
+ ])]),
316
+ _: 1
317
+ })
318
+ ]),
319
+ _: 1
320
+ }, 8, ["modelValue", "options"])
321
+ ]),
322
+ c("div", W, [
323
+ r(m, {
324
+ type: "primary",
325
+ onClick: l.search
326
+ }, {
327
+ default: a(() => [...e[9] || (e[9] = [
328
+ f("筛选", -1)
329
+ ])]),
330
+ _: 1
331
+ }, 8, ["onClick"])
332
+ ])
333
+ ]),
334
+ k((u(), C(M, {
335
+ ref: "assocTable",
336
+ border: "",
337
+ size: "small",
338
+ data: t.orderList,
339
+ class: "chooseIPaasData-out",
340
+ "tooltip-config": {},
341
+ "row-config": { keyField: "id", isCurrent: !0, isHover: !0 },
342
+ "max-height": t.tableMaxHeight,
343
+ "min-height": "50",
344
+ "expand-config": { expandAll: !0 },
345
+ "column-config": { resizable: !0 },
346
+ "checkbox-config": { checkRowKeys: t.selectData },
347
+ "scroll-x": { enabled: !0, gt: 8 },
348
+ "scroll-y": { enabled: !0, gt: 15 },
349
+ onCheckboxChange: l.checkChange,
350
+ onCellMouseenter: l.onMouseEvent,
351
+ onCellMouseleave: l.onMouseEvent,
352
+ onCheckboxAll: l.checkAllTask
353
+ }, {
354
+ empty: a(() => [...e[10] || (e[10] = [
355
+ c("span", null, "暂无数据", -1)
356
+ ])]),
357
+ default: a(() => [
358
+ r(b, {
359
+ type: "checkbox",
360
+ width: "32",
361
+ fixed: "left"
362
+ }),
363
+ (u(!0), v(D, null, P(t.columnData.moduleDefinition, (i, p) => (u(), C(b, {
364
+ visible: i.extraInfo.isAddable == 1,
365
+ title: i.name,
366
+ field: i.columnCode,
367
+ "min-width": "160",
368
+ key: p,
369
+ "show-header-overflow": "title",
370
+ "show-overflow": "title",
371
+ "show-footer-overflow": ""
372
+ }, {
373
+ default: a((g) => [
374
+ c("span", null, x(l.getTitle(i, g.row[i.columnCode])), 1)
375
+ ]),
376
+ _: 2
377
+ }, 1032, ["visible", "title", "field"]))), 128))
378
+ ]),
379
+ _: 1
380
+ }, 8, ["data", "max-height", "checkbox-config", "onCheckboxChange", "onCellMouseenter", "onCellMouseleave", "onCheckboxAll"])), [
381
+ [V, t.loading]
382
+ ])
383
+ ])
384
+ ]),
385
+ _: 1
386
+ }, 8, ["modelValue", "title"]);
387
+ }
388
+ const ee = /* @__PURE__ */ _(j, [["render", X], ["__scopeId", "data-v-1c870df6"]]);
389
+ export {
390
+ ee as default
391
+ };
@@ -0,0 +1 @@
1
+ .worksheetCopy[data-v-684f7285]{position:fixed;width:34px;height:22px;line-height:22px;text-align:center;background-color:#3333334d;color:#fff;font-size:12px;z-index:999999}.worksheetCopy[data-v-684f7285]:hover{background-color:#65acff;cursor:pointer}.chooseIPaasData[data-v-1c870df6]{height:100%;overflow:hidden}.chooseIPaasData-search[data-v-1c870df6]{display:flex;flex-wrap:wrap;max-height:142px;overflow-y:auto;gap:10px 18px}.chooseIPaasData-search-item[data-v-1c870df6]{width:calc(33.33% - 18px);flex-grow:0}.chooseIPaasData-out[data-v-1c870df6] .vxe-table--header .vxe-header--row{background-color:#ecf5ff}