@ctzy-web-client/plugin-component-vue 1.0.32 → 1.0.33

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.
@@ -106,8 +106,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
106
106
  const resetColumns = () => {
107
107
  const _dataTable = props.dataTable;
108
108
  _dataTable.resetColumnSort();
109
- const tableColumns = [...displaySearchedColumns.value, ...hiddenSearchedColumns.value];
110
- emit("column-visible-change", tableColumns);
109
+ emit("reset-columns");
111
110
  };
112
111
  const allSearchedColumns = computed(() => {
113
112
  const _search = unref(search);
@@ -1,5 +1,5 @@
1
- import { defineComponent, ref, onMounted, nextTick, useAttrs, computed, inject, unref, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createVNode, withCtx, createTextVNode, createElementVNode, Fragment, renderList, createBlock, withDirectives, withModifiers, vModelText, renderSlot } from 'vue';
2
- import { ElTooltip, ElTag, ElIcon } from 'element-plus';
1
+ import { defineComponent, ref, onMounted, nextTick, useAttrs, computed, inject, unref, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createVNode, withCtx, createTextVNode, createElementVNode, Fragment, renderList, createBlock, withModifiers, renderSlot } from 'vue';
2
+ import { ElTooltip, ElTag, ElIcon, ElInput } from 'element-plus';
3
3
  import { ArrowUp, ArrowDown } from '@element-plus/icons';
4
4
  import { useService, HttpRequest, useNamespace, filterPanelItemKey } from '@ctzy-web-client/web-base-client-vue';
5
5
  import { dataProps } from '../../hooks/use-data/index.mjs';
@@ -16,51 +16,7 @@ if (typeof __name === 'undefined') {
16
16
  });
17
17
  }
18
18
  }
19
- const _hoisted_1 = {
20
- key: 0,
21
- style: { "display": "flex", "align-items": "center", "flex-wrap": "wrap", "gap": "4px" }
22
- };
23
- const _hoisted_2 = {
24
- key: 0,
25
- style: { "flex": "1", "min-width": "80px", "position": "relative" }
26
- };
27
- const _hoisted_3 = {
28
- key: 0,
29
- style: { "color": "#999", "cursor": "text" }
30
- };
31
- const _hoisted_4 = {
32
- key: 1,
33
- style: { "color": "#333" }
34
- };
35
- const _hoisted_5 = {
36
- key: 2,
37
- class: "cursor-blink"
38
- };
39
- const _hoisted_6 = {
40
- key: 1,
41
- style: { "display": "flex", "align-items": "center", "justify-content": "space-between", "width": "100%" }
42
- };
43
- const _hoisted_7 = {
44
- key: 1,
45
- style: { "color": "#333" }
46
- };
47
- const _hoisted_8 = {
48
- key: 2,
49
- class: "cursor-blink"
50
- };
51
- const _hoisted_9 = { style: { "flex": "1", "position": "relative", "cursor": "text" } };
52
- const _hoisted_10 = {
53
- key: 1,
54
- style: { "display": "flex", "align-items": "center", "width": "100%" }
55
- };
56
- const _hoisted_11 = {
57
- key: 1,
58
- style: { "color": "#333" }
59
- };
60
- const _hoisted_12 = {
61
- key: 2,
62
- class: "cursor-blink"
63
- };
19
+ const _hoisted_1 = { key: 0 };
64
20
  const __default__ = defineComponent({
65
21
  name: "BwaPctMultipleMenuCondition",
66
22
  __conditionTitle__: "\u591A\u9009\u5217\u8868",
@@ -140,8 +96,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
140
96
  const ns = useNamespace("pctfilterpanel-item");
141
97
  const isShowPopper = ref(false);
142
98
  const isHoverIcon = ref(false);
143
- const isSearchActive = ref(false);
144
- const inputRef = ref(null);
145
99
  const attrs = useAttrs();
146
100
  const showTitle = computed(() => attrs.showTitle);
147
101
  const data = ref([]);
@@ -192,32 +146,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
192
146
  }
193
147
  isShowPopper.value = !isShowPopper.value;
194
148
  };
195
- const handleContentClick = (event) => {
196
- var _a2, _b;
197
- event.stopPropagation();
198
- isShowPopper.value = true;
199
- if (props.showSearch && !((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.options)) {
200
- nextTick(() => {
201
- if (inputRef.value) {
202
- inputRef.value.focus();
203
- isSearchActive.value = true;
204
- }
205
- });
206
- }
207
- };
208
- const handleInputFocus = () => {
209
- isSearchActive.value = true;
210
- isShowPopper.value = true;
211
- };
212
- const handleInputBlur = (event) => {
213
- const target = event.relatedTarget;
214
- if (target && target.closest(".bwa-advance-select__popper")) {
215
- return;
216
- }
217
- setTimeout(() => {
218
- isSearchActive.value = false;
219
- }, 200);
220
- };
221
149
  const getData = async (query) => {
222
150
  var _a2;
223
151
  loading.value = true;
@@ -251,21 +179,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
251
179
  }
252
180
  };
253
181
  const search = ref("");
254
- let searchTimeout = null;
255
182
  watch(() => search.value, (val) => {
256
183
  handleFieldSearch(val);
257
- if (searchTimeout) {
258
- clearTimeout(searchTimeout);
259
- }
260
- searchTimeout = setTimeout(() => {
261
- var _a2, _b;
262
- if (val && props.showSearch && !((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.options)) {
263
- isShowPopper.value = true;
264
- if (column.value.componentProps) {
265
- getData(val);
266
- }
267
- }
268
- }, 500);
269
184
  });
270
185
  const modelValue = computed({
271
186
  get: () => {
@@ -299,7 +214,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
299
214
  showLetterAvatar: showLetterAvatarStatus.value,
300
215
  multiple: __props.multiple,
301
216
  modelValue: modelValue.value,
302
- "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => modelValue.value = $event),
217
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => modelValue.value = $event),
303
218
  onSearch: handleFieldSearch,
304
219
  class: normalizeClass(unref(ns).e("options")),
305
220
  onVisibleChange: visibleChange,
@@ -313,197 +228,142 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
313
228
  ref_key: "advanceSelectRef",
314
229
  ref: advanceSelectRef
315
230
  }, {
316
- "reference-content": withCtx(({ selected }) => {
317
- var _a2, _b, _c, _d;
318
- return [
319
- createCommentVNode(" \u591A\u9009\u6A21\u5F0F "),
320
- __props.multiple ? (openBlock(), createElementBlock("div", {
321
- key: 0,
322
- class: normalizeClass(unref(ns).e("content")),
323
- onClick: handleContentClick
324
- }, [
325
- selected && selected.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1, [
326
- createVNode(unref(ElTooltip), {
327
- content: selected[0].label,
328
- placement: "top",
329
- effect: "light",
330
- "append-to": ".bwa-application"
331
- }, {
332
- default: withCtx(() => [
333
- createVNode(unref(ElTag), {
334
- class: normalizeClass(unref(ns).e("tag")),
335
- closable: "",
336
- onClose: ($event) => handleClose(selected[0]),
337
- type: "info"
338
- }, {
339
- default: withCtx(() => [
340
- createTextVNode(toDisplayString(selected[0].label), 1)
341
- ]),
342
- _: 2
343
- }, 1032, ["class", "onClose"])
344
- ]),
345
- _: 2
346
- }, 1032, ["content"]),
347
- createVNode(unref(ElTooltip), {
348
- content: "Bottom center",
349
- placement: "top",
350
- effect: "light",
351
- "append-to": ".bwa-application"
352
- }, {
353
- content: withCtx(() => [
354
- createElementVNode("div", {
355
- class: normalizeClass(unref(ns).e("tag_box"))
356
- }, [
357
- (openBlock(true), createElementBlock(Fragment, null, renderList(selected, (item, index) => {
358
- return openBlock(), createElementBlock(Fragment, null, [
359
- index !== 0 ? (openBlock(), createBlock(unref(ElTag), {
360
- key: 0,
361
- class: normalizeClass(unref(ns).e("tag_details")),
362
- type: "info",
363
- closable: "",
364
- onClose: ($event) => handleClose(item)
365
- }, {
366
- default: withCtx(() => [
367
- createTextVNode(toDisplayString(item.label), 1)
368
- ]),
369
- _: 2
370
- }, 1032, ["class", "onClose"])) : createCommentVNode("v-if", true)
371
- ], 64);
372
- }), 256))
373
- ], 2)
374
- ]),
375
- default: withCtx(() => [
376
- selected.length > 1 ? (openBlock(), createBlock(unref(ElTag), {
377
- key: 0,
378
- class: normalizeClass(unref(ns).e("tag")),
379
- type: "info"
380
- }, {
381
- default: withCtx(() => [
382
- createTextVNode("+" + toDisplayString(selected.length - 1), 1)
383
- ]),
384
- _: 2
385
- }, 1032, ["class"])) : createCommentVNode("v-if", true)
386
- ]),
387
- _: 2
388
- }, 1024),
389
- createCommentVNode(" \u641C\u7D22\u8F93\u5165\u533A\u57DF "),
390
- props.showSearch && !((_a2 = column.value.componentProps) == null ? void 0 : _a2.options) ? (openBlock(), createElementBlock("div", _hoisted_2, [
391
- !isSearchActive.value && !search.value ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(searchPlaceholderStr.value || "\u641C\u7D22"), 1)) : (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(search.value), 1)),
392
- createCommentVNode(" \u95EA\u70C1\u5149\u6807 "),
393
- isSearchActive.value ? (openBlock(), createElementBlock("span", _hoisted_5)) : createCommentVNode("v-if", true),
394
- createCommentVNode(" \u9690\u85CF\u7684\u8F93\u5165\u6846 "),
395
- props.showSearch && !((_b = column.value.componentProps) == null ? void 0 : _b.options) ? withDirectives((openBlock(), createElementBlock("input", {
396
- key: 3,
397
- ref_key: "inputRef",
398
- ref: inputRef,
399
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
400
- type: "text",
401
- style: { "position": "absolute", "top": "0", "left": "0", "width": "100%", "height": "100%", "opacity": "0", "cursor": "text" },
402
- onFocus: handleInputFocus,
403
- onBlur: handleInputBlur,
404
- onClick: _cache[1] || (_cache[1] = withModifiers(() => {
405
- }, ["stop"]))
406
- }, null, 544)), [
407
- [vModelText, search.value]
408
- ]) : createCommentVNode("v-if", true)
409
- ])) : createCommentVNode("v-if", true)
410
- ])) : (openBlock(), createElementBlock("div", _hoisted_6, [
411
- createElementVNode("div", {
412
- style: { "flex": "1", "position": "relative", "cursor": "text" },
413
- onClick: handleContentClick
414
- }, [
415
- !isSearchActive.value && !search.value ? (openBlock(), createElementBlock("span", {
416
- key: 0,
417
- class: normalizeClass(unref(ns).e("contentBox_placeholder"))
418
- }, toDisplayString(placeholderStr.value), 3)) : (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(search.value), 1)),
419
- createCommentVNode(" \u95EA\u70C1\u5149\u6807 "),
420
- isSearchActive.value ? (openBlock(), createElementBlock("span", _hoisted_8)) : createCommentVNode("v-if", true),
421
- createCommentVNode(" \u9690\u85CF\u7684\u8F93\u5165\u6846 "),
422
- props.showSearch && !((_c = column.value.componentProps) == null ? void 0 : _c.options) ? withDirectives((openBlock(), createElementBlock("input", {
423
- key: 3,
424
- ref_key: "inputRef",
425
- ref: inputRef,
426
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => search.value = $event),
427
- type: "text",
428
- style: { "position": "absolute", "top": "0", "left": "0", "width": "100%", "height": "100%", "opacity": "0", "cursor": "text" },
429
- onFocus: handleInputFocus,
430
- onBlur: handleInputBlur,
431
- onClick: _cache[3] || (_cache[3] = withModifiers(() => {
432
- }, ["stop"]))
433
- }, null, 544)), [
434
- [vModelText, search.value]
435
- ]) : createCommentVNode("v-if", true)
436
- ])
437
- ])),
438
- createVNode(unref(ElIcon), {
439
- onMouseenter: _cache[4] || (_cache[4] = ($event) => isHoverIcon.value = true),
440
- onMouseleave: _cache[5] || (_cache[5] = ($event) => isHoverIcon.value = false),
441
- onClick: withModifiers(handleIconClick, ["stop"]),
442
- class: normalizeClass(unref(ns).be("option", "selected"))
231
+ "reference-content": withCtx(({ selected }) => [
232
+ __props.multiple ? (openBlock(), createElementBlock("div", {
233
+ key: 0,
234
+ class: normalizeClass(unref(ns).e("content"))
235
+ }, [
236
+ selected && selected.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1, [
237
+ createVNode(unref(ElTooltip), {
238
+ content: selected[0].label,
239
+ placement: "top",
240
+ effect: "light",
241
+ "append-to": ".bwa-application"
443
242
  }, {
444
243
  default: withCtx(() => [
445
- isHoverIcon.value && selected.length > 0 ? (openBlock(), createBlock(_component_CircleClose, {
446
- key: 0,
447
- class: "delete-icon"
448
- })) : isShowPopper.value ? (openBlock(), createBlock(unref(ArrowUp), { key: 1 })) : (openBlock(), createBlock(unref(ArrowDown), { key: 2 }))
244
+ createVNode(unref(ElTag), {
245
+ class: normalizeClass(unref(ns).e("tag")),
246
+ closable: "",
247
+ onClose: ($event) => handleClose(selected[0]),
248
+ type: "info"
249
+ }, {
250
+ default: withCtx(() => [
251
+ createTextVNode(toDisplayString(selected[0].label), 1)
252
+ ]),
253
+ _: 2
254
+ }, 1032, ["class", "onClose"])
449
255
  ]),
450
256
  _: 2
451
- }, 1032, ["class"])
452
- ], 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
453
- createCommentVNode(" \u5355\u9009\u6A21\u5F0F "),
454
- createElementVNode("div", {
455
- class: normalizeClass(unref(ns).e("content")),
456
- onClick: handleContentClick
457
- }, [
458
- createElementVNode("div", _hoisted_9, [
459
- createVNode(unref(ElTooltip), {
460
- disabled: !selected.label,
461
- content: selected.label,
462
- placement: "top",
463
- effect: "light",
464
- "append-to": ".bwa-application"
257
+ }, 1032, ["content"]),
258
+ createVNode(unref(ElTooltip), {
259
+ content: "Bottom center",
260
+ placement: "top",
261
+ effect: "light",
262
+ "append-to": ".bwa-application"
263
+ }, {
264
+ content: withCtx(() => [
265
+ createElementVNode("div", {
266
+ class: normalizeClass(unref(ns).e("tag_box"))
267
+ }, [
268
+ (openBlock(true), createElementBlock(Fragment, null, renderList(selected, (item, index) => {
269
+ return openBlock(), createElementBlock(Fragment, null, [
270
+ index !== 0 ? (openBlock(), createBlock(unref(ElTag), {
271
+ key: 0,
272
+ class: normalizeClass(unref(ns).e("tag_details")),
273
+ type: "info",
274
+ closable: "",
275
+ onClose: ($event) => handleClose(item)
276
+ }, {
277
+ default: withCtx(() => [
278
+ createTextVNode(toDisplayString(item.label), 1)
279
+ ]),
280
+ _: 2
281
+ }, 1032, ["class", "onClose"])) : createCommentVNode("v-if", true)
282
+ ], 64);
283
+ }), 256))
284
+ ], 2)
285
+ ]),
286
+ default: withCtx(() => [
287
+ selected.length > 1 ? (openBlock(), createBlock(unref(ElTag), {
288
+ key: 0,
289
+ class: normalizeClass(unref(ns).e("tag")),
290
+ type: "info"
465
291
  }, {
466
292
  default: withCtx(() => [
467
- selected.label ? (openBlock(), createElementBlock("div", {
468
- key: 0,
469
- class: normalizeClass([unref(ns).e("contentBox"), unref(ns).e("contentBox_label")])
470
- }, toDisplayString(selected.label || placeholderStr.value), 3)) : (openBlock(), createElementBlock("div", _hoisted_10, [
471
- !isSearchActive.value && !search.value ? (openBlock(), createElementBlock("span", {
472
- key: 0,
473
- class: normalizeClass(unref(ns).e("contentBox_placeholder"))
474
- }, toDisplayString(placeholderStr.value), 3)) : (openBlock(), createElementBlock("span", _hoisted_11, toDisplayString(search.value), 1)),
475
- createCommentVNode(" \u95EA\u70C1\u5149\u6807 "),
476
- isSearchActive.value ? (openBlock(), createElementBlock("span", _hoisted_12)) : createCommentVNode("v-if", true)
477
- ]))
293
+ createTextVNode("+" + toDisplayString(selected.length - 1), 1)
478
294
  ]),
479
295
  _: 2
480
- }, 1032, ["disabled", "content"]),
481
- createCommentVNode(" \u9690\u85CF\u7684\u8F93\u5165\u6846 "),
482
- props.showSearch && !((_d = column.value.componentProps) == null ? void 0 : _d.options) ? withDirectives((openBlock(), createElementBlock("input", {
483
- key: 0,
484
- ref_key: "inputRef",
485
- ref: inputRef,
486
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => search.value = $event),
487
- type: "text",
488
- style: { "position": "absolute", "top": "0", "left": "0", "width": "100%", "height": "100%", "opacity": "0", "cursor": "text" },
489
- onFocus: handleInputFocus,
490
- onBlur: handleInputBlur,
491
- onClick: _cache[7] || (_cache[7] = withModifiers(() => {
492
- }, ["stop"]))
493
- }, null, 544)), [
494
- [vModelText, search.value]
495
- ]) : createCommentVNode("v-if", true)
296
+ }, 1032, ["class"])) : createCommentVNode("v-if", true)
496
297
  ]),
497
- createVNode(unref(ElIcon), {
498
- class: normalizeClass(unref(ns).be("option", "selected"))
499
- }, {
500
- default: withCtx(() => [
501
- isShowPopper.value ? (openBlock(), createBlock(unref(ArrowUp), { key: 0 })) : (openBlock(), createBlock(unref(ArrowDown), { key: 1 }))
502
- ]),
503
- _: 1
504
- }, 8, ["class"])
505
- ], 2)
506
- ], 2112))
298
+ _: 2
299
+ }, 1024)
300
+ ])) : (openBlock(), createElementBlock("div", {
301
+ key: 1,
302
+ class: normalizeClass(unref(ns).e("contentBox_placeholder"))
303
+ }, toDisplayString(placeholderStr.value), 3)),
304
+ createVNode(unref(ElIcon), {
305
+ onMouseenter: _cache[0] || (_cache[0] = ($event) => isHoverIcon.value = true),
306
+ onMouseleave: _cache[1] || (_cache[1] = ($event) => isHoverIcon.value = false),
307
+ onClick: withModifiers(handleIconClick, ["stop"]),
308
+ class: normalizeClass(unref(ns).be("option", "selected"))
309
+ }, {
310
+ default: withCtx(() => [
311
+ isHoverIcon.value && selected.length > 0 ? (openBlock(), createBlock(_component_CircleClose, {
312
+ key: 0,
313
+ class: "delete-icon"
314
+ })) : isShowPopper.value ? (openBlock(), createBlock(unref(ArrowUp), { key: 1 })) : (openBlock(), createBlock(unref(ArrowDown), { key: 2 }))
315
+ ]),
316
+ _: 2
317
+ }, 1032, ["class"])
318
+ ], 2)) : (openBlock(), createElementBlock("div", {
319
+ key: 1,
320
+ class: normalizeClass(unref(ns).e("content"))
321
+ }, [
322
+ createVNode(unref(ElTooltip), {
323
+ disabled: !selected.label,
324
+ content: selected.label,
325
+ placement: "top",
326
+ effect: "light",
327
+ "append-to": ".bwa-application"
328
+ }, {
329
+ default: withCtx(() => [
330
+ selected.label ? (openBlock(), createElementBlock("div", {
331
+ key: 0,
332
+ class: normalizeClass([unref(ns).e("contentBox"), unref(ns).e("contentBox_label")])
333
+ }, toDisplayString(selected.label || placeholderStr.value), 3)) : (openBlock(), createElementBlock("div", {
334
+ key: 1,
335
+ class: normalizeClass([unref(ns).e("contentBox"), unref(ns).e("contentBox_placeholder")])
336
+ }, toDisplayString(placeholderStr.value), 3))
337
+ ]),
338
+ _: 2
339
+ }, 1032, ["disabled", "content"]),
340
+ createVNode(unref(ElIcon), {
341
+ class: normalizeClass(unref(ns).be("option", "selected"))
342
+ }, {
343
+ default: withCtx(() => [
344
+ isShowPopper.value ? (openBlock(), createBlock(unref(ArrowUp), { key: 0 })) : (openBlock(), createBlock(unref(ArrowDown), { key: 1 }))
345
+ ]),
346
+ _: 1
347
+ }, 8, ["class"])
348
+ ], 2))
349
+ ]),
350
+ contentTop: withCtx(() => {
351
+ var _a2;
352
+ return [
353
+ __props.showSearch && !((_a2 = column.value.componentProps) == null ? void 0 : _a2.options) ? (openBlock(), createElementBlock("div", {
354
+ key: 0,
355
+ class: normalizeClass(unref(ns).e("contentTop"))
356
+ }, [
357
+ createVNode(unref(ElInput), {
358
+ modelValue: search.value,
359
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => search.value = $event),
360
+ class: normalizeClass(unref(ns).e("select")),
361
+ placeholder: searchPlaceholderStr.value,
362
+ type: "text",
363
+ "prefix-icon": "Search",
364
+ clearable: ""
365
+ }, null, 8, ["modelValue", "class", "placeholder"])
366
+ ], 2)) : createCommentVNode("v-if", true)
507
367
  ];
508
368
  }),
509
369
  contentBottom: withCtx(() => [
@@ -110,8 +110,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
110
110
  const resetColumns = () => {
111
111
  const _dataTable = props.dataTable;
112
112
  _dataTable.resetColumnSort();
113
- const tableColumns = [...displaySearchedColumns.value, ...hiddenSearchedColumns.value];
114
- emit("column-visible-change", tableColumns);
113
+ emit("reset-columns");
115
114
  };
116
115
  const allSearchedColumns = vue.computed(() => {
117
116
  const _search = vue.unref(search);