@ctzy-web-client/plugin-component-vue 1.0.30 → 1.0.31

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.
@@ -0,0 +1 @@
1
+ .letter-circle[data-v-4c0fde1d]{align-items:center;border-radius:50%;color:#fff;display:flex;font-size:14px;height:24px;justify-content:center;margin-right:8px;width:24px}@keyframes blink-ca1affd9{0%,to{opacity:1}50%{opacity:0}}.cursor-blink[data-v-ca1affd9]{animation:blink-ca1affd9 1s infinite;background-color:#333;display:inline-block;height:16px;width:1px}
@@ -1,10 +1,11 @@
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';
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';
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';
6
6
  import BwaAdvanceSelect from '../../advance-select/advance-select.mjs';
7
7
  import BwaAdvanceOption from '../../advance-select/advance-option.mjs';
8
+ import './pct-multiple-menu-condition.vue_vue_type_style_index_0_scoped_ca1affd9_lang.mjs';
8
9
  import _export_sfc from '../../_virtual/_plugin-vue_export-helper.mjs';
9
10
 
10
11
  // Inject __name helper
@@ -16,7 +17,51 @@ if (typeof __name === 'undefined') {
16
17
  });
17
18
  }
18
19
  }
19
- const _hoisted_1 = { key: 0 };
20
+ const _hoisted_1 = {
21
+ key: 0,
22
+ style: { "display": "flex", "align-items": "center", "flex-wrap": "wrap", "gap": "4px" }
23
+ };
24
+ const _hoisted_2 = {
25
+ key: 0,
26
+ style: { "flex": "1", "min-width": "80px", "position": "relative" }
27
+ };
28
+ const _hoisted_3 = {
29
+ key: 0,
30
+ style: { "color": "#999", "cursor": "text" }
31
+ };
32
+ const _hoisted_4 = {
33
+ key: 1,
34
+ style: { "color": "#333" }
35
+ };
36
+ const _hoisted_5 = {
37
+ key: 2,
38
+ class: "cursor-blink"
39
+ };
40
+ const _hoisted_6 = {
41
+ key: 1,
42
+ style: { "display": "flex", "align-items": "center", "justify-content": "space-between", "width": "100%" }
43
+ };
44
+ const _hoisted_7 = {
45
+ key: 1,
46
+ style: { "color": "#333" }
47
+ };
48
+ const _hoisted_8 = {
49
+ key: 2,
50
+ class: "cursor-blink"
51
+ };
52
+ const _hoisted_9 = { style: { "flex": "1", "position": "relative", "cursor": "text" } };
53
+ const _hoisted_10 = {
54
+ key: 1,
55
+ style: { "display": "flex", "align-items": "center", "width": "100%" }
56
+ };
57
+ const _hoisted_11 = {
58
+ key: 1,
59
+ style: { "color": "#333" }
60
+ };
61
+ const _hoisted_12 = {
62
+ key: 2,
63
+ class: "cursor-blink"
64
+ };
20
65
  const __default__ = defineComponent({
21
66
  name: "BwaPctMultipleMenuCondition",
22
67
  __conditionTitle__: "\u591A\u9009\u5217\u8868",
@@ -96,6 +141,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
96
141
  const ns = useNamespace("pctfilterpanel-item");
97
142
  const isShowPopper = ref(false);
98
143
  const isHoverIcon = ref(false);
144
+ const isSearchActive = ref(false);
145
+ const inputRef = ref(null);
99
146
  const attrs = useAttrs();
100
147
  const showTitle = computed(() => attrs.showTitle);
101
148
  const data = ref([]);
@@ -146,6 +193,32 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
146
193
  }
147
194
  isShowPopper.value = !isShowPopper.value;
148
195
  };
196
+ const handleContentClick = (event) => {
197
+ var _a2, _b;
198
+ event.stopPropagation();
199
+ isShowPopper.value = true;
200
+ if (props.showSearch && !((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.options)) {
201
+ nextTick(() => {
202
+ if (inputRef.value) {
203
+ inputRef.value.focus();
204
+ isSearchActive.value = true;
205
+ }
206
+ });
207
+ }
208
+ };
209
+ const handleInputFocus = () => {
210
+ isSearchActive.value = true;
211
+ isShowPopper.value = true;
212
+ };
213
+ const handleInputBlur = (event) => {
214
+ const target = event.relatedTarget;
215
+ if (target && target.closest(".bwa-advance-select__popper")) {
216
+ return;
217
+ }
218
+ setTimeout(() => {
219
+ isSearchActive.value = false;
220
+ }, 200);
221
+ };
149
222
  const getData = async (query) => {
150
223
  var _a2;
151
224
  loading.value = true;
@@ -179,8 +252,21 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
179
252
  }
180
253
  };
181
254
  const search = ref("");
255
+ let searchTimeout = null;
182
256
  watch(() => search.value, (val) => {
183
257
  handleFieldSearch(val);
258
+ if (searchTimeout) {
259
+ clearTimeout(searchTimeout);
260
+ }
261
+ searchTimeout = setTimeout(() => {
262
+ var _a2, _b;
263
+ if (val && props.showSearch && !((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.options)) {
264
+ isShowPopper.value = true;
265
+ if (column.value.componentProps) {
266
+ getData(val);
267
+ }
268
+ }
269
+ }, 500);
184
270
  });
185
271
  const modelValue = computed({
186
272
  get: () => {
@@ -214,7 +300,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
214
300
  showLetterAvatar: showLetterAvatarStatus.value,
215
301
  multiple: __props.multiple,
216
302
  modelValue: modelValue.value,
217
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => modelValue.value = $event),
303
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => modelValue.value = $event),
218
304
  onSearch: handleFieldSearch,
219
305
  class: normalizeClass(unref(ns).e("options")),
220
306
  onVisibleChange: visibleChange,
@@ -228,142 +314,197 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
228
314
  ref_key: "advanceSelectRef",
229
315
  ref: advanceSelectRef
230
316
  }, {
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"
317
+ "reference-content": withCtx(({ selected }) => {
318
+ var _a2, _b, _c, _d;
319
+ return [
320
+ createCommentVNode(" \u591A\u9009\u6A21\u5F0F "),
321
+ __props.multiple ? (openBlock(), createElementBlock("div", {
322
+ key: 0,
323
+ class: normalizeClass(unref(ns).e("content")),
324
+ onClick: handleContentClick
325
+ }, [
326
+ selected && selected.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1, [
327
+ createVNode(unref(ElTooltip), {
328
+ content: selected[0].label,
329
+ placement: "top",
330
+ effect: "light",
331
+ "append-to": ".bwa-application"
332
+ }, {
333
+ default: withCtx(() => [
334
+ createVNode(unref(ElTag), {
335
+ class: normalizeClass(unref(ns).e("tag")),
336
+ closable: "",
337
+ onClose: ($event) => handleClose(selected[0]),
338
+ type: "info"
339
+ }, {
340
+ default: withCtx(() => [
341
+ createTextVNode(toDisplayString(selected[0].label), 1)
342
+ ]),
343
+ _: 2
344
+ }, 1032, ["class", "onClose"])
345
+ ]),
346
+ _: 2
347
+ }, 1032, ["content"]),
348
+ createVNode(unref(ElTooltip), {
349
+ content: "Bottom center",
350
+ placement: "top",
351
+ effect: "light",
352
+ "append-to": ".bwa-application"
353
+ }, {
354
+ content: withCtx(() => [
355
+ createElementVNode("div", {
356
+ class: normalizeClass(unref(ns).e("tag_box"))
357
+ }, [
358
+ (openBlock(true), createElementBlock(Fragment, null, renderList(selected, (item, index) => {
359
+ return openBlock(), createElementBlock(Fragment, null, [
360
+ index !== 0 ? (openBlock(), createBlock(unref(ElTag), {
361
+ key: 0,
362
+ class: normalizeClass(unref(ns).e("tag_details")),
363
+ type: "info",
364
+ closable: "",
365
+ onClose: ($event) => handleClose(item)
366
+ }, {
367
+ default: withCtx(() => [
368
+ createTextVNode(toDisplayString(item.label), 1)
369
+ ]),
370
+ _: 2
371
+ }, 1032, ["class", "onClose"])) : createCommentVNode("v-if", true)
372
+ ], 64);
373
+ }), 256))
374
+ ], 2)
375
+ ]),
376
+ default: withCtx(() => [
377
+ selected.length > 1 ? (openBlock(), createBlock(unref(ElTag), {
378
+ key: 0,
379
+ class: normalizeClass(unref(ns).e("tag")),
380
+ type: "info"
381
+ }, {
382
+ default: withCtx(() => [
383
+ createTextVNode("+" + toDisplayString(selected.length - 1), 1)
384
+ ]),
385
+ _: 2
386
+ }, 1032, ["class"])) : createCommentVNode("v-if", true)
387
+ ]),
388
+ _: 2
389
+ }, 1024),
390
+ createCommentVNode(" \u641C\u7D22\u8F93\u5165\u533A\u57DF "),
391
+ props.showSearch && !((_a2 = column.value.componentProps) == null ? void 0 : _a2.options) ? (openBlock(), createElementBlock("div", _hoisted_2, [
392
+ !isSearchActive.value && !search.value ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(searchPlaceholderStr.value || "\u641C\u7D22"), 1)) : (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(search.value), 1)),
393
+ createCommentVNode(" \u95EA\u70C1\u5149\u6807 "),
394
+ isSearchActive.value ? (openBlock(), createElementBlock("span", _hoisted_5)) : createCommentVNode("v-if", true),
395
+ createCommentVNode(" \u9690\u85CF\u7684\u8F93\u5165\u6846 "),
396
+ props.showSearch && !((_b = column.value.componentProps) == null ? void 0 : _b.options) ? withDirectives((openBlock(), createElementBlock("input", {
397
+ key: 3,
398
+ ref_key: "inputRef",
399
+ ref: inputRef,
400
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
401
+ type: "text",
402
+ style: { "position": "absolute", "top": "0", "left": "0", "width": "100%", "height": "100%", "opacity": "0", "cursor": "text" },
403
+ onFocus: handleInputFocus,
404
+ onBlur: handleInputBlur,
405
+ onClick: _cache[1] || (_cache[1] = withModifiers(() => {
406
+ }, ["stop"]))
407
+ }, null, 544)), [
408
+ [vModelText, search.value]
409
+ ]) : createCommentVNode("v-if", true)
410
+ ])) : createCommentVNode("v-if", true)
411
+ ])) : (openBlock(), createElementBlock("div", _hoisted_6, [
412
+ createElementVNode("div", {
413
+ style: { "flex": "1", "position": "relative", "cursor": "text" },
414
+ onClick: handleContentClick
415
+ }, [
416
+ !isSearchActive.value && !search.value ? (openBlock(), createElementBlock("span", {
417
+ key: 0,
418
+ class: normalizeClass(unref(ns).e("contentBox_placeholder"))
419
+ }, toDisplayString(placeholderStr.value), 3)) : (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(search.value), 1)),
420
+ createCommentVNode(" \u95EA\u70C1\u5149\u6807 "),
421
+ isSearchActive.value ? (openBlock(), createElementBlock("span", _hoisted_8)) : createCommentVNode("v-if", true),
422
+ createCommentVNode(" \u9690\u85CF\u7684\u8F93\u5165\u6846 "),
423
+ props.showSearch && !((_c = column.value.componentProps) == null ? void 0 : _c.options) ? withDirectives((openBlock(), createElementBlock("input", {
424
+ key: 3,
425
+ ref_key: "inputRef",
426
+ ref: inputRef,
427
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => search.value = $event),
428
+ type: "text",
429
+ style: { "position": "absolute", "top": "0", "left": "0", "width": "100%", "height": "100%", "opacity": "0", "cursor": "text" },
430
+ onFocus: handleInputFocus,
431
+ onBlur: handleInputBlur,
432
+ onClick: _cache[3] || (_cache[3] = withModifiers(() => {
433
+ }, ["stop"]))
434
+ }, null, 544)), [
435
+ [vModelText, search.value]
436
+ ]) : createCommentVNode("v-if", true)
437
+ ])
438
+ ])),
439
+ createVNode(unref(ElIcon), {
440
+ onMouseenter: _cache[4] || (_cache[4] = ($event) => isHoverIcon.value = true),
441
+ onMouseleave: _cache[5] || (_cache[5] = ($event) => isHoverIcon.value = false),
442
+ onClick: withModifiers(handleIconClick, ["stop"]),
443
+ class: normalizeClass(unref(ns).be("option", "selected"))
242
444
  }, {
243
445
  default: withCtx(() => [
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"])
446
+ isHoverIcon.value && selected.length > 0 ? (openBlock(), createBlock(_component_CircleClose, {
447
+ key: 0,
448
+ class: "delete-icon"
449
+ })) : isShowPopper.value ? (openBlock(), createBlock(unref(ArrowUp), { key: 1 })) : (openBlock(), createBlock(unref(ArrowDown), { key: 2 }))
255
450
  ]),
256
451
  _: 2
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"
452
+ }, 1032, ["class"])
453
+ ], 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
454
+ createCommentVNode(" \u5355\u9009\u6A21\u5F0F "),
455
+ createElementVNode("div", {
456
+ class: normalizeClass(unref(ns).e("content")),
457
+ onClick: handleContentClick
458
+ }, [
459
+ createElementVNode("div", _hoisted_9, [
460
+ createVNode(unref(ElTooltip), {
461
+ disabled: !selected.label,
462
+ content: selected.label,
463
+ placement: "top",
464
+ effect: "light",
465
+ "append-to": ".bwa-application"
291
466
  }, {
292
467
  default: withCtx(() => [
293
- createTextVNode("+" + toDisplayString(selected.length - 1), 1)
468
+ selected.label ? (openBlock(), createElementBlock("div", {
469
+ key: 0,
470
+ class: normalizeClass([unref(ns).e("contentBox"), unref(ns).e("contentBox_label")])
471
+ }, toDisplayString(selected.label || placeholderStr.value), 3)) : (openBlock(), createElementBlock("div", _hoisted_10, [
472
+ !isSearchActive.value && !search.value ? (openBlock(), createElementBlock("span", {
473
+ key: 0,
474
+ class: normalizeClass(unref(ns).e("contentBox_placeholder"))
475
+ }, toDisplayString(placeholderStr.value), 3)) : (openBlock(), createElementBlock("span", _hoisted_11, toDisplayString(search.value), 1)),
476
+ createCommentVNode(" \u95EA\u70C1\u5149\u6807 "),
477
+ isSearchActive.value ? (openBlock(), createElementBlock("span", _hoisted_12)) : createCommentVNode("v-if", true)
478
+ ]))
294
479
  ]),
295
480
  _: 2
296
- }, 1032, ["class"])) : createCommentVNode("v-if", true)
481
+ }, 1032, ["disabled", "content"]),
482
+ createCommentVNode(" \u9690\u85CF\u7684\u8F93\u5165\u6846 "),
483
+ props.showSearch && !((_d = column.value.componentProps) == null ? void 0 : _d.options) ? withDirectives((openBlock(), createElementBlock("input", {
484
+ key: 0,
485
+ ref_key: "inputRef",
486
+ ref: inputRef,
487
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => search.value = $event),
488
+ type: "text",
489
+ style: { "position": "absolute", "top": "0", "left": "0", "width": "100%", "height": "100%", "opacity": "0", "cursor": "text" },
490
+ onFocus: handleInputFocus,
491
+ onBlur: handleInputBlur,
492
+ onClick: _cache[7] || (_cache[7] = withModifiers(() => {
493
+ }, ["stop"]))
494
+ }, null, 544)), [
495
+ [vModelText, search.value]
496
+ ]) : createCommentVNode("v-if", true)
297
497
  ]),
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)
498
+ createVNode(unref(ElIcon), {
499
+ class: normalizeClass(unref(ns).be("option", "selected"))
500
+ }, {
501
+ default: withCtx(() => [
502
+ isShowPopper.value ? (openBlock(), createBlock(unref(ArrowUp), { key: 0 })) : (openBlock(), createBlock(unref(ArrowDown), { key: 1 }))
503
+ ]),
504
+ _: 1
505
+ }, 8, ["class"])
506
+ ], 2)
507
+ ], 2112))
367
508
  ];
368
509
  }),
369
510
  contentBottom: withCtx(() => [
@@ -383,7 +524,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
383
524
  class: normalizeClass(unref(ns).be("filter", "option"))
384
525
  }, null, 8, ["value", "label", "showLetterAvatar", "class"]);
385
526
  }), 128))
386
- ])
527
+ ], true)
387
528
  ]),
388
529
  _: 3
389
530
  }, 8, ["showLetterAvatar", "multiple", "modelValue", "class", "showSelectIcon", "loading", "width"])
@@ -391,6 +532,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
391
532
  };
392
533
  }
393
534
  });
394
- var PctMultipleMenuCondition = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "pct-multiple-menu-condition.vue"]]);
535
+ var PctMultipleMenuCondition = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ca1affd9"], ["__file", "pct-multiple-menu-condition.vue"]]);
395
536
 
396
537
  export { PctMultipleMenuCondition as default };
@@ -0,0 +1,13 @@
1
+ // Inject __name helper
2
+ if (typeof __name === 'undefined') {
3
+ function __name(obj, name) {
4
+ Object.defineProperty(obj, "name", {
5
+ value: name,
6
+ configurable: true
7
+ });
8
+ }
9
+ }
10
+
11
+ var undefined$1 = undefined;
12
+
13
+ export { undefined$1 as default };
@@ -0,0 +1 @@
1
+ .letter-circle[data-v-4c0fde1d]{align-items:center;border-radius:50%;color:#fff;display:flex;font-size:14px;height:24px;justify-content:center;margin-right:8px;width:24px}@keyframes blink-ca1affd9{0%,to{opacity:1}50%{opacity:0}}.cursor-blink[data-v-ca1affd9]{animation:blink-ca1affd9 1s infinite;background-color:#333;display:inline-block;height:16px;width:1px}
@@ -9,6 +9,7 @@ var webBaseClientVue = require('@ctzy-web-client/web-base-client-vue');
9
9
  var index = require('../../hooks/use-data/index.js');
10
10
  var advanceSelect = require('../../advance-select/advance-select.js');
11
11
  var advanceOption = require('../../advance-select/advance-option.js');
12
+ require('./pct-multiple-menu-condition.vue_vue_type_style_index_0_scoped_ca1affd9_lang.js');
12
13
  var _pluginVue_exportHelper = require('../../_virtual/_plugin-vue_export-helper.js');
13
14
 
14
15
  // Inject __name helper
@@ -20,7 +21,51 @@ if (typeof __name === 'undefined') {
20
21
  });
21
22
  }
22
23
  }
23
- const _hoisted_1 = { key: 0 };
24
+ const _hoisted_1 = {
25
+ key: 0,
26
+ style: { "display": "flex", "align-items": "center", "flex-wrap": "wrap", "gap": "4px" }
27
+ };
28
+ const _hoisted_2 = {
29
+ key: 0,
30
+ style: { "flex": "1", "min-width": "80px", "position": "relative" }
31
+ };
32
+ const _hoisted_3 = {
33
+ key: 0,
34
+ style: { "color": "#999", "cursor": "text" }
35
+ };
36
+ const _hoisted_4 = {
37
+ key: 1,
38
+ style: { "color": "#333" }
39
+ };
40
+ const _hoisted_5 = {
41
+ key: 2,
42
+ class: "cursor-blink"
43
+ };
44
+ const _hoisted_6 = {
45
+ key: 1,
46
+ style: { "display": "flex", "align-items": "center", "justify-content": "space-between", "width": "100%" }
47
+ };
48
+ const _hoisted_7 = {
49
+ key: 1,
50
+ style: { "color": "#333" }
51
+ };
52
+ const _hoisted_8 = {
53
+ key: 2,
54
+ class: "cursor-blink"
55
+ };
56
+ const _hoisted_9 = { style: { "flex": "1", "position": "relative", "cursor": "text" } };
57
+ const _hoisted_10 = {
58
+ key: 1,
59
+ style: { "display": "flex", "align-items": "center", "width": "100%" }
60
+ };
61
+ const _hoisted_11 = {
62
+ key: 1,
63
+ style: { "color": "#333" }
64
+ };
65
+ const _hoisted_12 = {
66
+ key: 2,
67
+ class: "cursor-blink"
68
+ };
24
69
  const __default__ = vue.defineComponent({
25
70
  name: "BwaPctMultipleMenuCondition",
26
71
  __conditionTitle__: "\u591A\u9009\u5217\u8868",
@@ -100,6 +145,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
100
145
  const ns = webBaseClientVue.useNamespace("pctfilterpanel-item");
101
146
  const isShowPopper = vue.ref(false);
102
147
  const isHoverIcon = vue.ref(false);
148
+ const isSearchActive = vue.ref(false);
149
+ const inputRef = vue.ref(null);
103
150
  const attrs = vue.useAttrs();
104
151
  const showTitle = vue.computed(() => attrs.showTitle);
105
152
  const data = vue.ref([]);
@@ -150,6 +197,32 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
150
197
  }
151
198
  isShowPopper.value = !isShowPopper.value;
152
199
  };
200
+ const handleContentClick = (event) => {
201
+ var _a2, _b;
202
+ event.stopPropagation();
203
+ isShowPopper.value = true;
204
+ if (props.showSearch && !((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.options)) {
205
+ vue.nextTick(() => {
206
+ if (inputRef.value) {
207
+ inputRef.value.focus();
208
+ isSearchActive.value = true;
209
+ }
210
+ });
211
+ }
212
+ };
213
+ const handleInputFocus = () => {
214
+ isSearchActive.value = true;
215
+ isShowPopper.value = true;
216
+ };
217
+ const handleInputBlur = (event) => {
218
+ const target = event.relatedTarget;
219
+ if (target && target.closest(".bwa-advance-select__popper")) {
220
+ return;
221
+ }
222
+ setTimeout(() => {
223
+ isSearchActive.value = false;
224
+ }, 200);
225
+ };
153
226
  const getData = async (query) => {
154
227
  var _a2;
155
228
  loading.value = true;
@@ -183,8 +256,21 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
183
256
  }
184
257
  };
185
258
  const search = vue.ref("");
259
+ let searchTimeout = null;
186
260
  vue.watch(() => search.value, (val) => {
187
261
  handleFieldSearch(val);
262
+ if (searchTimeout) {
263
+ clearTimeout(searchTimeout);
264
+ }
265
+ searchTimeout = setTimeout(() => {
266
+ var _a2, _b;
267
+ if (val && props.showSearch && !((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.options)) {
268
+ isShowPopper.value = true;
269
+ if (column.value.componentProps) {
270
+ getData(val);
271
+ }
272
+ }
273
+ }, 500);
188
274
  });
189
275
  const modelValue = vue.computed({
190
276
  get: () => {
@@ -218,7 +304,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
218
304
  showLetterAvatar: showLetterAvatarStatus.value,
219
305
  multiple: __props.multiple,
220
306
  modelValue: modelValue.value,
221
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => modelValue.value = $event),
307
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => modelValue.value = $event),
222
308
  onSearch: handleFieldSearch,
223
309
  class: vue.normalizeClass(vue.unref(ns).e("options")),
224
310
  onVisibleChange: visibleChange,
@@ -232,142 +318,197 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
232
318
  ref_key: "advanceSelectRef",
233
319
  ref: advanceSelectRef
234
320
  }, {
235
- "reference-content": vue.withCtx(({ selected }) => [
236
- __props.multiple ? (vue.openBlock(), vue.createElementBlock("div", {
237
- key: 0,
238
- class: vue.normalizeClass(vue.unref(ns).e("content"))
239
- }, [
240
- selected && selected.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
241
- vue.createVNode(vue.unref(ElementPlus.ElTooltip), {
242
- content: selected[0].label,
243
- placement: "top",
244
- effect: "light",
245
- "append-to": ".bwa-application"
321
+ "reference-content": vue.withCtx(({ selected }) => {
322
+ var _a2, _b, _c, _d;
323
+ return [
324
+ vue.createCommentVNode(" \u591A\u9009\u6A21\u5F0F "),
325
+ __props.multiple ? (vue.openBlock(), vue.createElementBlock("div", {
326
+ key: 0,
327
+ class: vue.normalizeClass(vue.unref(ns).e("content")),
328
+ onClick: handleContentClick
329
+ }, [
330
+ selected && selected.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
331
+ vue.createVNode(vue.unref(ElementPlus.ElTooltip), {
332
+ content: selected[0].label,
333
+ placement: "top",
334
+ effect: "light",
335
+ "append-to": ".bwa-application"
336
+ }, {
337
+ default: vue.withCtx(() => [
338
+ vue.createVNode(vue.unref(ElementPlus.ElTag), {
339
+ class: vue.normalizeClass(vue.unref(ns).e("tag")),
340
+ closable: "",
341
+ onClose: ($event) => handleClose(selected[0]),
342
+ type: "info"
343
+ }, {
344
+ default: vue.withCtx(() => [
345
+ vue.createTextVNode(vue.toDisplayString(selected[0].label), 1)
346
+ ]),
347
+ _: 2
348
+ }, 1032, ["class", "onClose"])
349
+ ]),
350
+ _: 2
351
+ }, 1032, ["content"]),
352
+ vue.createVNode(vue.unref(ElementPlus.ElTooltip), {
353
+ content: "Bottom center",
354
+ placement: "top",
355
+ effect: "light",
356
+ "append-to": ".bwa-application"
357
+ }, {
358
+ content: vue.withCtx(() => [
359
+ vue.createElementVNode("div", {
360
+ class: vue.normalizeClass(vue.unref(ns).e("tag_box"))
361
+ }, [
362
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(selected, (item, index) => {
363
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
364
+ index !== 0 ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElTag), {
365
+ key: 0,
366
+ class: vue.normalizeClass(vue.unref(ns).e("tag_details")),
367
+ type: "info",
368
+ closable: "",
369
+ onClose: ($event) => handleClose(item)
370
+ }, {
371
+ default: vue.withCtx(() => [
372
+ vue.createTextVNode(vue.toDisplayString(item.label), 1)
373
+ ]),
374
+ _: 2
375
+ }, 1032, ["class", "onClose"])) : vue.createCommentVNode("v-if", true)
376
+ ], 64);
377
+ }), 256))
378
+ ], 2)
379
+ ]),
380
+ default: vue.withCtx(() => [
381
+ selected.length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElTag), {
382
+ key: 0,
383
+ class: vue.normalizeClass(vue.unref(ns).e("tag")),
384
+ type: "info"
385
+ }, {
386
+ default: vue.withCtx(() => [
387
+ vue.createTextVNode("+" + vue.toDisplayString(selected.length - 1), 1)
388
+ ]),
389
+ _: 2
390
+ }, 1032, ["class"])) : vue.createCommentVNode("v-if", true)
391
+ ]),
392
+ _: 2
393
+ }, 1024),
394
+ vue.createCommentVNode(" \u641C\u7D22\u8F93\u5165\u533A\u57DF "),
395
+ props.showSearch && !((_a2 = column.value.componentProps) == null ? void 0 : _a2.options) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
396
+ !isSearchActive.value && !search.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3, vue.toDisplayString(searchPlaceholderStr.value || "\u641C\u7D22"), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4, vue.toDisplayString(search.value), 1)),
397
+ vue.createCommentVNode(" \u95EA\u70C1\u5149\u6807 "),
398
+ isSearchActive.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5)) : vue.createCommentVNode("v-if", true),
399
+ vue.createCommentVNode(" \u9690\u85CF\u7684\u8F93\u5165\u6846 "),
400
+ props.showSearch && !((_b = column.value.componentProps) == null ? void 0 : _b.options) ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
401
+ key: 3,
402
+ ref_key: "inputRef",
403
+ ref: inputRef,
404
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
405
+ type: "text",
406
+ style: { "position": "absolute", "top": "0", "left": "0", "width": "100%", "height": "100%", "opacity": "0", "cursor": "text" },
407
+ onFocus: handleInputFocus,
408
+ onBlur: handleInputBlur,
409
+ onClick: _cache[1] || (_cache[1] = vue.withModifiers(() => {
410
+ }, ["stop"]))
411
+ }, null, 544)), [
412
+ [vue.vModelText, search.value]
413
+ ]) : vue.createCommentVNode("v-if", true)
414
+ ])) : vue.createCommentVNode("v-if", true)
415
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
416
+ vue.createElementVNode("div", {
417
+ style: { "flex": "1", "position": "relative", "cursor": "text" },
418
+ onClick: handleContentClick
419
+ }, [
420
+ !isSearchActive.value && !search.value ? (vue.openBlock(), vue.createElementBlock("span", {
421
+ key: 0,
422
+ class: vue.normalizeClass(vue.unref(ns).e("contentBox_placeholder"))
423
+ }, vue.toDisplayString(placeholderStr.value), 3)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_7, vue.toDisplayString(search.value), 1)),
424
+ vue.createCommentVNode(" \u95EA\u70C1\u5149\u6807 "),
425
+ isSearchActive.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8)) : vue.createCommentVNode("v-if", true),
426
+ vue.createCommentVNode(" \u9690\u85CF\u7684\u8F93\u5165\u6846 "),
427
+ props.showSearch && !((_c = column.value.componentProps) == null ? void 0 : _c.options) ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
428
+ key: 3,
429
+ ref_key: "inputRef",
430
+ ref: inputRef,
431
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => search.value = $event),
432
+ type: "text",
433
+ style: { "position": "absolute", "top": "0", "left": "0", "width": "100%", "height": "100%", "opacity": "0", "cursor": "text" },
434
+ onFocus: handleInputFocus,
435
+ onBlur: handleInputBlur,
436
+ onClick: _cache[3] || (_cache[3] = vue.withModifiers(() => {
437
+ }, ["stop"]))
438
+ }, null, 544)), [
439
+ [vue.vModelText, search.value]
440
+ ]) : vue.createCommentVNode("v-if", true)
441
+ ])
442
+ ])),
443
+ vue.createVNode(vue.unref(ElementPlus.ElIcon), {
444
+ onMouseenter: _cache[4] || (_cache[4] = ($event) => isHoverIcon.value = true),
445
+ onMouseleave: _cache[5] || (_cache[5] = ($event) => isHoverIcon.value = false),
446
+ onClick: vue.withModifiers(handleIconClick, ["stop"]),
447
+ class: vue.normalizeClass(vue.unref(ns).be("option", "selected"))
246
448
  }, {
247
449
  default: vue.withCtx(() => [
248
- vue.createVNode(vue.unref(ElementPlus.ElTag), {
249
- class: vue.normalizeClass(vue.unref(ns).e("tag")),
250
- closable: "",
251
- onClose: ($event) => handleClose(selected[0]),
252
- type: "info"
253
- }, {
254
- default: vue.withCtx(() => [
255
- vue.createTextVNode(vue.toDisplayString(selected[0].label), 1)
256
- ]),
257
- _: 2
258
- }, 1032, ["class", "onClose"])
450
+ isHoverIcon.value && selected.length > 0 ? (vue.openBlock(), vue.createBlock(_component_CircleClose, {
451
+ key: 0,
452
+ class: "delete-icon"
453
+ })) : isShowPopper.value ? (vue.openBlock(), vue.createBlock(vue.unref(icons.ArrowUp), { key: 1 })) : (vue.openBlock(), vue.createBlock(vue.unref(icons.ArrowDown), { key: 2 }))
259
454
  ]),
260
455
  _: 2
261
- }, 1032, ["content"]),
262
- vue.createVNode(vue.unref(ElementPlus.ElTooltip), {
263
- content: "Bottom center",
264
- placement: "top",
265
- effect: "light",
266
- "append-to": ".bwa-application"
267
- }, {
268
- content: vue.withCtx(() => [
269
- vue.createElementVNode("div", {
270
- class: vue.normalizeClass(vue.unref(ns).e("tag_box"))
271
- }, [
272
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(selected, (item, index) => {
273
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
274
- index !== 0 ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElTag), {
275
- key: 0,
276
- class: vue.normalizeClass(vue.unref(ns).e("tag_details")),
277
- type: "info",
278
- closable: "",
279
- onClose: ($event) => handleClose(item)
280
- }, {
281
- default: vue.withCtx(() => [
282
- vue.createTextVNode(vue.toDisplayString(item.label), 1)
283
- ]),
284
- _: 2
285
- }, 1032, ["class", "onClose"])) : vue.createCommentVNode("v-if", true)
286
- ], 64);
287
- }), 256))
288
- ], 2)
289
- ]),
290
- default: vue.withCtx(() => [
291
- selected.length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElTag), {
292
- key: 0,
293
- class: vue.normalizeClass(vue.unref(ns).e("tag")),
294
- type: "info"
456
+ }, 1032, ["class"])
457
+ ], 2)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
458
+ vue.createCommentVNode(" \u5355\u9009\u6A21\u5F0F "),
459
+ vue.createElementVNode("div", {
460
+ class: vue.normalizeClass(vue.unref(ns).e("content")),
461
+ onClick: handleContentClick
462
+ }, [
463
+ vue.createElementVNode("div", _hoisted_9, [
464
+ vue.createVNode(vue.unref(ElementPlus.ElTooltip), {
465
+ disabled: !selected.label,
466
+ content: selected.label,
467
+ placement: "top",
468
+ effect: "light",
469
+ "append-to": ".bwa-application"
295
470
  }, {
296
471
  default: vue.withCtx(() => [
297
- vue.createTextVNode("+" + vue.toDisplayString(selected.length - 1), 1)
472
+ selected.label ? (vue.openBlock(), vue.createElementBlock("div", {
473
+ key: 0,
474
+ class: vue.normalizeClass([vue.unref(ns).e("contentBox"), vue.unref(ns).e("contentBox_label")])
475
+ }, vue.toDisplayString(selected.label || placeholderStr.value), 3)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
476
+ !isSearchActive.value && !search.value ? (vue.openBlock(), vue.createElementBlock("span", {
477
+ key: 0,
478
+ class: vue.normalizeClass(vue.unref(ns).e("contentBox_placeholder"))
479
+ }, vue.toDisplayString(placeholderStr.value), 3)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_11, vue.toDisplayString(search.value), 1)),
480
+ vue.createCommentVNode(" \u95EA\u70C1\u5149\u6807 "),
481
+ isSearchActive.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_12)) : vue.createCommentVNode("v-if", true)
482
+ ]))
298
483
  ]),
299
484
  _: 2
300
- }, 1032, ["class"])) : vue.createCommentVNode("v-if", true)
485
+ }, 1032, ["disabled", "content"]),
486
+ vue.createCommentVNode(" \u9690\u85CF\u7684\u8F93\u5165\u6846 "),
487
+ props.showSearch && !((_d = column.value.componentProps) == null ? void 0 : _d.options) ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
488
+ key: 0,
489
+ ref_key: "inputRef",
490
+ ref: inputRef,
491
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => search.value = $event),
492
+ type: "text",
493
+ style: { "position": "absolute", "top": "0", "left": "0", "width": "100%", "height": "100%", "opacity": "0", "cursor": "text" },
494
+ onFocus: handleInputFocus,
495
+ onBlur: handleInputBlur,
496
+ onClick: _cache[7] || (_cache[7] = vue.withModifiers(() => {
497
+ }, ["stop"]))
498
+ }, null, 544)), [
499
+ [vue.vModelText, search.value]
500
+ ]) : vue.createCommentVNode("v-if", true)
301
501
  ]),
302
- _: 2
303
- }, 1024)
304
- ])) : (vue.openBlock(), vue.createElementBlock("div", {
305
- key: 1,
306
- class: vue.normalizeClass(vue.unref(ns).e("contentBox_placeholder"))
307
- }, vue.toDisplayString(placeholderStr.value), 3)),
308
- vue.createVNode(vue.unref(ElementPlus.ElIcon), {
309
- onMouseenter: _cache[0] || (_cache[0] = ($event) => isHoverIcon.value = true),
310
- onMouseleave: _cache[1] || (_cache[1] = ($event) => isHoverIcon.value = false),
311
- onClick: vue.withModifiers(handleIconClick, ["stop"]),
312
- class: vue.normalizeClass(vue.unref(ns).be("option", "selected"))
313
- }, {
314
- default: vue.withCtx(() => [
315
- isHoverIcon.value && selected.length > 0 ? (vue.openBlock(), vue.createBlock(_component_CircleClose, {
316
- key: 0,
317
- class: "delete-icon"
318
- })) : isShowPopper.value ? (vue.openBlock(), vue.createBlock(vue.unref(icons.ArrowUp), { key: 1 })) : (vue.openBlock(), vue.createBlock(vue.unref(icons.ArrowDown), { key: 2 }))
319
- ]),
320
- _: 2
321
- }, 1032, ["class"])
322
- ], 2)) : (vue.openBlock(), vue.createElementBlock("div", {
323
- key: 1,
324
- class: vue.normalizeClass(vue.unref(ns).e("content"))
325
- }, [
326
- vue.createVNode(vue.unref(ElementPlus.ElTooltip), {
327
- disabled: !selected.label,
328
- content: selected.label,
329
- placement: "top",
330
- effect: "light",
331
- "append-to": ".bwa-application"
332
- }, {
333
- default: vue.withCtx(() => [
334
- selected.label ? (vue.openBlock(), vue.createElementBlock("div", {
335
- key: 0,
336
- class: vue.normalizeClass([vue.unref(ns).e("contentBox"), vue.unref(ns).e("contentBox_label")])
337
- }, vue.toDisplayString(selected.label || placeholderStr.value), 3)) : (vue.openBlock(), vue.createElementBlock("div", {
338
- key: 1,
339
- class: vue.normalizeClass([vue.unref(ns).e("contentBox"), vue.unref(ns).e("contentBox_placeholder")])
340
- }, vue.toDisplayString(placeholderStr.value), 3))
341
- ]),
342
- _: 2
343
- }, 1032, ["disabled", "content"]),
344
- vue.createVNode(vue.unref(ElementPlus.ElIcon), {
345
- class: vue.normalizeClass(vue.unref(ns).be("option", "selected"))
346
- }, {
347
- default: vue.withCtx(() => [
348
- isShowPopper.value ? (vue.openBlock(), vue.createBlock(vue.unref(icons.ArrowUp), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(icons.ArrowDown), { key: 1 }))
349
- ]),
350
- _: 1
351
- }, 8, ["class"])
352
- ], 2))
353
- ]),
354
- contentTop: vue.withCtx(() => {
355
- var _a2;
356
- return [
357
- __props.showSearch && !((_a2 = column.value.componentProps) == null ? void 0 : _a2.options) ? (vue.openBlock(), vue.createElementBlock("div", {
358
- key: 0,
359
- class: vue.normalizeClass(vue.unref(ns).e("contentTop"))
360
- }, [
361
- vue.createVNode(vue.unref(ElementPlus.ElInput), {
362
- modelValue: search.value,
363
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => search.value = $event),
364
- class: vue.normalizeClass(vue.unref(ns).e("select")),
365
- placeholder: searchPlaceholderStr.value,
366
- type: "text",
367
- "prefix-icon": "Search",
368
- clearable: ""
369
- }, null, 8, ["modelValue", "class", "placeholder"])
370
- ], 2)) : vue.createCommentVNode("v-if", true)
502
+ vue.createVNode(vue.unref(ElementPlus.ElIcon), {
503
+ class: vue.normalizeClass(vue.unref(ns).be("option", "selected"))
504
+ }, {
505
+ default: vue.withCtx(() => [
506
+ isShowPopper.value ? (vue.openBlock(), vue.createBlock(vue.unref(icons.ArrowUp), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(icons.ArrowDown), { key: 1 }))
507
+ ]),
508
+ _: 1
509
+ }, 8, ["class"])
510
+ ], 2)
511
+ ], 2112))
371
512
  ];
372
513
  }),
373
514
  contentBottom: vue.withCtx(() => [
@@ -387,7 +528,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
387
528
  class: vue.normalizeClass(vue.unref(ns).be("filter", "option"))
388
529
  }, null, 8, ["value", "label", "showLetterAvatar", "class"]);
389
530
  }), 128))
390
- ])
531
+ ], true)
391
532
  ]),
392
533
  _: 3
393
534
  }, 8, ["showLetterAvatar", "multiple", "modelValue", "class", "showSelectIcon", "loading", "width"])
@@ -395,6 +536,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
395
536
  };
396
537
  }
397
538
  });
398
- var PctMultipleMenuCondition = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__file", "pct-multiple-menu-condition.vue"]]);
539
+ var PctMultipleMenuCondition = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__scopeId", "data-v-ca1affd9"], ["__file", "pct-multiple-menu-condition.vue"]]);
399
540
 
400
541
  exports["default"] = PctMultipleMenuCondition;
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ // Inject __name helper
6
+ if (typeof __name === 'undefined') {
7
+ function __name(obj, name) {
8
+ Object.defineProperty(obj, "name", {
9
+ value: name,
10
+ configurable: true
11
+ });
12
+ }
13
+ }
14
+
15
+ var undefined$1 = undefined;
16
+
17
+ exports["default"] = undefined$1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctzy-web-client/plugin-component-vue",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "exports": {
@@ -18,8 +18,9 @@
18
18
  ref="advanceSelectRef"
19
19
  >
20
20
  <template #reference-content="{ selected }">
21
- <div :class="ns.e('content')" v-if="multiple">
22
- <div v-if="selected && selected.length > 0">
21
+ <!-- 多选模式 -->
22
+ <div v-if="multiple" :class="ns.e('content')" @click="handleContentClick">
23
+ <div v-if="selected && selected.length > 0" style="display: flex; align-items: center; flex-wrap: wrap; gap: 4px;">
23
24
  <ElTooltip :content="selected[0].label" placement="top" effect="light" append-to=".bwa-application">
24
25
  <el-tag :class="ns.e('tag')" closable @close="handleClose(selected[0])" type="info">{{selected[0].label}}
25
26
  </el-tag>
@@ -38,13 +39,47 @@
38
39
  </el-tag>
39
40
  </template>
40
41
  </div>
41
-
42
42
  </template>
43
43
  <el-tag :class="ns.e('tag')" type="info" v-if="selected.length > 1">+{{selected.length - 1}}</el-tag>
44
44
  </ElTooltip>
45
-
45
+ <!-- 搜索输入区域 -->
46
+ <div v-if="props.showSearch && !column.componentProps?.options" style="flex: 1; min-width: 80px; position: relative;">
47
+ <span v-if="!isSearchActive && !search" style="color: #999; cursor: text;">{{searchPlaceholderStr || '搜索'}}</span>
48
+ <span v-else style="color: #333;">{{search}}</span>
49
+ <!-- 闪烁光标 -->
50
+ <span v-if="isSearchActive" class="cursor-blink"></span>
51
+ <!-- 隐藏的输入框 -->
52
+ <input
53
+ v-if="props.showSearch && !column.componentProps?.options"
54
+ ref="inputRef"
55
+ v-model="search"
56
+ type="text"
57
+ style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: text;"
58
+ @focus="handleInputFocus"
59
+ @blur="handleInputBlur"
60
+ @click.stop
61
+ />
62
+ </div>
63
+ </div>
64
+ <div v-else style="display: flex; align-items: center; justify-content: space-between; width: 100%;">
65
+ <div style="flex: 1; position: relative; cursor: text;" @click="handleContentClick">
66
+ <span v-if="!isSearchActive && !search" :class="ns.e('contentBox_placeholder')">{{placeholderStr}}</span>
67
+ <span v-else style="color: #333;">{{search}}</span>
68
+ <!-- 闪烁光标 -->
69
+ <span v-if="isSearchActive" class="cursor-blink"></span>
70
+ <!-- 隐藏的输入框 -->
71
+ <input
72
+ v-if="props.showSearch && !column.componentProps?.options"
73
+ ref="inputRef"
74
+ v-model="search"
75
+ type="text"
76
+ style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: text;"
77
+ @focus="handleInputFocus"
78
+ @blur="handleInputBlur"
79
+ @click.stop
80
+ />
81
+ </div>
46
82
  </div>
47
- <div v-else :class="ns.e('contentBox_placeholder')">{{placeholderStr}}</div>
48
83
  <ElIcon
49
84
  @mouseenter="isHoverIcon = true"
50
85
  @mouseleave="isHoverIcon = false"
@@ -59,11 +94,30 @@
59
94
  <ArrowDown v-else />
60
95
  </ElIcon>
61
96
  </div>
62
- <div v-else :class="ns.e('content')">
63
- <ElTooltip :disabled="!selected.label" :content="selected.label" placement="top" effect="light" append-to=".bwa-application">
64
- <div :class="[ns.e('contentBox'), ns.e('contentBox_label')]" v-if="selected.label">{{selected.label || placeholderStr}}</div>
65
- <div :class="[ns.e('contentBox'), ns.e('contentBox_placeholder')]" v-else>{{placeholderStr}}</div>
66
- </ElTooltip>
97
+ <!-- 单选模式 -->
98
+ <div v-else :class="ns.e('content')" @click="handleContentClick">
99
+ <div style="flex: 1; position: relative; cursor: text;">
100
+ <ElTooltip :disabled="!selected.label" :content="selected.label" placement="top" effect="light" append-to=".bwa-application">
101
+ <div v-if="selected.label" :class="[ns.e('contentBox'), ns.e('contentBox_label')]">{{selected.label || placeholderStr}}</div>
102
+ <div v-else style="display: flex; align-items: center; width: 100%;">
103
+ <span v-if="!isSearchActive && !search" :class="ns.e('contentBox_placeholder')">{{placeholderStr}}</span>
104
+ <span v-else style="color: #333;">{{search}}</span>
105
+ <!-- 闪烁光标 -->
106
+ <span v-if="isSearchActive" class="cursor-blink"></span>
107
+ </div>
108
+ </ElTooltip>
109
+ <!-- 隐藏的输入框 -->
110
+ <input
111
+ v-if="props.showSearch && !column.componentProps?.options"
112
+ ref="inputRef"
113
+ v-model="search"
114
+ type="text"
115
+ style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: text;"
116
+ @focus="handleInputFocus"
117
+ @blur="handleInputBlur"
118
+ @click.stop
119
+ />
120
+ </div>
67
121
  <ElIcon
68
122
  :class="ns.be('option', 'selected')"
69
123
  >
@@ -72,19 +126,6 @@
72
126
  </ElIcon>
73
127
  </div>
74
128
  </template>
75
-
76
- <template #contentTop>
77
- <div :class="ns.e('contentTop')" v-if="showSearch && !column.componentProps?.options">
78
- <ElInput
79
- v-model="search"
80
- :class="ns.e('select')"
81
- :placeholder="searchPlaceholderStr"
82
- type="text"
83
- prefix-icon="Search"
84
- clearable
85
- />
86
- </div>
87
- </template>
88
129
  <slot>
89
130
  <BwaAdvanceOption
90
131
  v-for="item in data"
@@ -192,6 +233,8 @@ onMounted(() => {
192
233
  const ns = useNamespace('pctfilterpanel-item');
193
234
  const isShowPopper = ref(false)
194
235
  const isHoverIcon = ref(false)
236
+ const isSearchActive = ref(false)
237
+ const inputRef = ref(null)
195
238
 
196
239
  const attrs = useAttrs();
197
240
  const showTitle = computed(() => attrs.showTitle)
@@ -244,6 +287,44 @@ modelValue.value = currentModelValue.filter(item =>
244
287
  // 原有逻辑:切换下拉显隐
245
288
  isShowPopper.value = !isShowPopper.value;
246
289
  };
290
+
291
+ // 处理选择框点击事件
292
+ const handleContentClick = (event) => {
293
+ event.stopPropagation();
294
+ // 显示下拉菜单
295
+ isShowPopper.value = true;
296
+ // 如果支持搜索,聚焦输入框
297
+ if (props.showSearch && !column.value?.componentProps?.options) {
298
+ nextTick(() => {
299
+ if (inputRef.value) {
300
+ inputRef.value.focus();
301
+ isSearchActive.value = true;
302
+ }
303
+ });
304
+ }
305
+ };
306
+
307
+ // 处理输入框聚焦事件
308
+ const handleInputFocus = () => {
309
+ isSearchActive.value = true;
310
+ // 确保下拉菜单显示
311
+ isShowPopper.value = true;
312
+ };
313
+
314
+ // 处理输入框失焦事件
315
+ const handleInputBlur = (event) => {
316
+ // 检查是否点击了下拉菜单内部
317
+ const target = event.relatedTarget;
318
+ if (target && target.closest('.bwa-advance-select__popper')) {
319
+ // 点击了下拉菜单内部,保持搜索状态
320
+ return;
321
+ }
322
+ // 延迟处理,以便点击标签等操作能够正常执行
323
+ setTimeout(() => {
324
+ isSearchActive.value = false;
325
+ // 不清空搜索内容,保持用户输入
326
+ }, 200);
327
+ };
247
328
  const getData = async (query) => {
248
329
  loading.value = true
249
330
  const { itfInfo, searchAttr } = column.value.componentProps
@@ -278,8 +359,22 @@ const handleFieldSearch = (query) => {
278
359
  }
279
360
 
280
361
  const search = ref('')
362
+ let searchTimeout = null
281
363
  watch(() => search.value, val => {
282
364
  handleFieldSearch(val)
365
+ // 清除之前的定时器
366
+ if (searchTimeout) {
367
+ clearTimeout(searchTimeout)
368
+ }
369
+ // 设置新的定时器,0.5秒后唤起下拉菜单并获取数据
370
+ searchTimeout = setTimeout(() => {
371
+ if (val && props.showSearch && !column.value?.componentProps?.options) {
372
+ isShowPopper.value = true
373
+ if (column.value.componentProps) {
374
+ getData(val)
375
+ }
376
+ }
377
+ }, 500)
283
378
  })
284
379
 
285
380
  const modelValue = computed({
@@ -308,4 +403,23 @@ const handleClearClick = () => {
308
403
  defineExpose({
309
404
  data
310
405
  })
311
- </script>
406
+ </script>
407
+
408
+ <style scoped>
409
+ @keyframes blink {
410
+ 0%, 100% {
411
+ opacity: 1;
412
+ }
413
+ 50% {
414
+ opacity: 0;
415
+ }
416
+ }
417
+
418
+ .cursor-blink {
419
+ display: inline-block;
420
+ width: 1px;
421
+ height: 16px;
422
+ background-color: #333;
423
+ animation: blink 1s infinite;
424
+ }
425
+ </style>
package/es/utils.css DELETED
@@ -1 +0,0 @@
1
- .letter-circle[data-v-4c0fde1d]{align-items:center;border-radius:50%;color:#fff;display:flex;font-size:14px;height:24px;justify-content:center;margin-right:8px;width:24px}
package/lib/utils.css DELETED
@@ -1 +0,0 @@
1
- .letter-circle[data-v-4c0fde1d]{align-items:center;border-radius:50%;color:#fff;display:flex;font-size:14px;height:24px;justify-content:center;margin-right:8px;width:24px}