3h1-ui 2.9.5 → 2.9.7

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.
package/es/index.js CHANGED
@@ -5590,7 +5590,7 @@ const _sfc_main$V = defineComponent({
5590
5590
  }
5591
5591
  });
5592
5592
  const _hoisted_1$m = { key: "component" };
5593
- const _hoisted_2$a = { key: "skeleton" };
5593
+ const _hoisted_2$9 = { key: "skeleton" };
5594
5594
  function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
5595
5595
  const _component_Skeleton = resolveComponent("Skeleton");
5596
5596
  return openBlock(), createBlock(TransitionGroup, mergeProps({ class: "h-full w-full" }, _ctx.$attrs, {
@@ -5602,7 +5602,7 @@ function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
5602
5602
  default: withCtx(() => [
5603
5603
  _ctx.isInit ? (openBlock(), createElementBlock("div", _hoisted_1$m, [
5604
5604
  renderSlot(_ctx.$slots, "default", { loading: _ctx.loading })
5605
- ])) : (openBlock(), createElementBlock("div", _hoisted_2$a, [
5605
+ ])) : (openBlock(), createElementBlock("div", _hoisted_2$9, [
5606
5606
  _ctx.$slots.skeleton ? renderSlot(_ctx.$slots, "skeleton", { key: 0 }) : (openBlock(), createBlock(_component_Skeleton, { key: 1 }))
5607
5607
  ]))
5608
5608
  ]),
@@ -6956,14 +6956,14 @@ function useTransition(source, options = {}) {
6956
6956
  });
6957
6957
  }
6958
6958
  const _hoisted_1$l = { class: "flex justify-between" };
6959
- const _hoisted_2$9 = { key: 0 };
6959
+ const _hoisted_2$8 = { key: 0 };
6960
6960
  const _hoisted_3$5 = { class: "flex flex-wrap px-2" };
6961
6961
  const _hoisted_4$3 = ["onClick", "title"];
6962
6962
  const _hoisted_5$2 = {
6963
6963
  key: 0,
6964
6964
  class: "flex py-2 items-center justify-center"
6965
6965
  };
6966
- const _hoisted_6$2 = {
6966
+ const _hoisted_6$1 = {
6967
6967
  key: 1,
6968
6968
  class: "p-5"
6969
6969
  };
@@ -7072,7 +7072,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
7072
7072
  ])
7073
7073
  ]),
7074
7074
  content: withCtx(() => [
7075
- unref(getPaginationList).length ? (openBlock(), createElementBlock("div", _hoisted_2$9, [
7075
+ unref(getPaginationList).length ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
7076
7076
  createVNode(unref(ScrollContainer$1), { class: "border border-solid border-t-0" }, {
7077
7077
  default: withCtx(() => [
7078
7078
  createElementVNode("ul", _hoisted_3$5, [
@@ -7105,7 +7105,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
7105
7105
  onChange: handlePageChange
7106
7106
  }, null, 8, ["pageSize", "total"])
7107
7107
  ])) : createCommentVNode("", true)
7108
- ])) : (openBlock(), createElementBlock("div", _hoisted_6$2, [
7108
+ ])) : (openBlock(), createElementBlock("div", _hoisted_6$1, [
7109
7109
  createVNode(unref(AEmpty))
7110
7110
  ]))
7111
7111
  ]),
@@ -7273,7 +7273,7 @@ function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
7273
7273
  }
7274
7274
  const CountdownInput = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["render", _sfc_render$y]]);
7275
7275
  const _hoisted_1$k = { key: 0 };
7276
- const _hoisted_2$8 = {
7276
+ const _hoisted_2$7 = {
7277
7277
  key: 1,
7278
7278
  class: "delete-wrapper"
7279
7279
  };
@@ -7408,7 +7408,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
7408
7408
  }, 1032, ["rules", "name"])
7409
7409
  ]),
7410
7410
  _: 2
7411
- }, 1032, ["model"])) : (openBlock(), createElementBlock("div", _hoisted_2$8, [
7411
+ }, 1032, ["model"])) : (openBlock(), createElementBlock("div", _hoisted_2$7, [
7412
7412
  createElementVNode("span", _hoisted_3$4, toDisplayString(index2 + 1), 1),
7413
7413
  createElementVNode("div", {
7414
7414
  class: "delete-item",
@@ -7835,9 +7835,8 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
7835
7835
  ...on2,
7836
7836
  ...bindValue
7837
7837
  };
7838
- console.log(compAttr);
7839
7838
  const handleInput = (e) => {
7840
- compAttr.onInputEvent(e);
7839
+ (compAttr == null ? void 0 : compAttr.onInputEvent) && compAttr.onInputEvent(e);
7841
7840
  };
7842
7841
  if (!renderComponentContent) {
7843
7842
  return createVNode(Comp, mergeProps(compAttr, {
@@ -14297,14 +14296,16 @@ const _sfc_main$q = defineComponent({
14297
14296
  setup() {
14298
14297
  const { isVisibleAdvancedSearch, closeGlobalSearch } = useTableContext();
14299
14298
  const handleIconClick = () => {
14300
- isVisibleAdvancedSearch.value = !isVisibleAdvancedSearch.value;
14301
- closeGlobalSearch();
14299
+ nextTick(() => {
14300
+ isVisibleAdvancedSearch.value = !isVisibleAdvancedSearch.value;
14301
+ closeGlobalSearch();
14302
+ });
14302
14303
  };
14303
14304
  return { isVisibleAdvancedSearch, handleIconClick };
14304
14305
  }
14305
14306
  });
14306
- const AdvancedSearchSetting_vue_vue_type_style_index_0_scoped_851e809a_lang = "";
14307
- const _withScopeId$1 = (n) => (pushScopeId("data-v-851e809a"), n = n(), popScopeId(), n);
14307
+ const AdvancedSearchSetting_vue_vue_type_style_index_0_scoped_f74ee46a_lang = "";
14308
+ const _withScopeId$1 = (n) => (pushScopeId("data-v-f74ee46a"), n = n(), popScopeId(), n);
14308
14309
  const _hoisted_1$f = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("span", null, "高级搜索", -1));
14309
14310
  function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
14310
14311
  const _component_FilterOutlined = resolveComponent("FilterOutlined");
@@ -14322,7 +14323,7 @@ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
14322
14323
  _: 1
14323
14324
  });
14324
14325
  }
14325
- const AdvancedSearchSetting = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$h], ["__scopeId", "data-v-851e809a"]]);
14326
+ const AdvancedSearchSetting = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$h], ["__scopeId", "data-v-f74ee46a"]]);
14326
14327
  const index$2 = "";
14327
14328
  const searchType = [
14328
14329
  {
@@ -14403,25 +14404,25 @@ const searchTypeSelect = [{ label: "等于", value: "eq" }];
14403
14404
  const getGlobalAdvancedType = (fieldList, value) => {
14404
14405
  const temp = {};
14405
14406
  fieldList.forEach((field) => {
14406
- temp[`${field}-op`] = "ct";
14407
- temp[field] = value;
14407
+ temp[`${field}.${field}-op`] = "ct";
14408
+ temp[`${field}.${field}`] = value;
14408
14409
  });
14410
+ temp.gexpr = fieldList.join("|");
14409
14411
  return temp;
14410
14412
  };
14411
- const _hoisted_1$e = { class: "shy-ui-advanced-search" };
14412
- const _hoisted_2$7 = { class: "shy-ui-advanced-search-add" };
14413
- const _hoisted_3$3 = { class: "shy-ui-advanced-search-item-wrapper" };
14414
- const _hoisted_4$1 = {
14413
+ const _hoisted_1$e = { class: "shy-ui-advanced-search-add" };
14414
+ const _hoisted_2$6 = { class: "shy-ui-advanced-search-item-wrapper" };
14415
+ const _hoisted_3$3 = {
14415
14416
  key: 0,
14416
14417
  class: "shy-ui-advanced-search-item-value-range"
14417
14418
  };
14418
- const _hoisted_5$1 = /* @__PURE__ */ createElementVNode("div", { style: { "flex": "0", "width": "40px", "margin-right": "8px" } }, " 至 ", -1);
14419
- const _hoisted_6$1 = {
14419
+ const _hoisted_4$1 = /* @__PURE__ */ createElementVNode("div", { style: { "flex": "0", "width": "40px", "margin-right": "8px" } }, " 至 ", -1);
14420
+ const _hoisted_5$1 = {
14420
14421
  key: 0,
14421
14422
  class: "shy-ui-advanced-search-item-value-range"
14422
14423
  };
14423
- const _hoisted_7 = /* @__PURE__ */ createElementVNode("div", { style: { "flex": "0", "width": "40px", "margin-right": "8px" } }, " 至 ", -1);
14424
- const _hoisted_8 = ["onClick"];
14424
+ const _hoisted_6 = /* @__PURE__ */ createElementVNode("div", { style: { "flex": "0", "width": "40px", "margin-right": "8px" } }, " 至 ", -1);
14425
+ const _hoisted_7 = ["onClick"];
14425
14426
  const _sfc_main$p = /* @__PURE__ */ defineComponent({
14426
14427
  __name: "AdvancedSearch",
14427
14428
  props: {
@@ -14443,6 +14444,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
14443
14444
  setup(__props, { expose }) {
14444
14445
  const props2 = __props;
14445
14446
  reactive({});
14447
+ const advancedSearchRef = ref();
14446
14448
  const formRef = ref();
14447
14449
  const schemasCurrent = reactive([]);
14448
14450
  if (props2.schemas.length !== 0)
@@ -14537,11 +14539,16 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
14537
14539
  };
14538
14540
  expose({
14539
14541
  getSearchFrom,
14540
- resetFields
14542
+ resetFields,
14543
+ advancedSearchRef
14541
14544
  });
14542
14545
  return (_ctx, _cache) => {
14543
- return openBlock(), createElementBlock("div", _hoisted_1$e, [
14544
- createElementVNode("div", _hoisted_2$7, [
14546
+ return openBlock(), createElementBlock("div", {
14547
+ class: "shy-ui-advanced-search",
14548
+ ref_key: "advancedSearchRef",
14549
+ ref: advancedSearchRef
14550
+ }, [
14551
+ createElementVNode("div", _hoisted_1$e, [
14545
14552
  createVNode(unref(PlusCircleOutlined$1)),
14546
14553
  createElementVNode("div", {
14547
14554
  style: { "margin-left": "8px" },
@@ -14559,7 +14566,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
14559
14566
  (openBlock(true), createElementBlock(Fragment, null, renderList(schemasCurrent, (schema, index2) => {
14560
14567
  return openBlock(), createBlock(unref(Col), normalizeProps(mergeProps({ key: index2 }, (schema == null ? void 0 : schema.colProps) || { span: 24 })), {
14561
14568
  default: withCtx(() => [
14562
- createElementVNode("div", _hoisted_3$3, [
14569
+ createElementVNode("div", _hoisted_2$6, [
14563
14570
  createVNode(unref(FormItem), {
14564
14571
  class: "shy-ui-advanced-search-item-op",
14565
14572
  name: `${schema.field}-op`
@@ -14596,7 +14603,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
14596
14603
  createVNode(unref(FormItem), { class: "shy-ui-advanced-search-item-value" }, {
14597
14604
  default: withCtx(() => [
14598
14605
  getTypeByField(schema == null ? void 0 : schema.field) === "number" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
14599
- schema.op === "bt" ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
14606
+ schema.op === "bt" ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
14600
14607
  createVNode(unref(FormItem), null, {
14601
14608
  default: withCtx(() => [
14602
14609
  createVNode(unref(InputNumber), {
@@ -14607,7 +14614,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
14607
14614
  ]),
14608
14615
  _: 2
14609
14616
  }, 1024),
14610
- _hoisted_5$1,
14617
+ _hoisted_4$1,
14611
14618
  createVNode(unref(FormItem), null, {
14612
14619
  default: withCtx(() => [
14613
14620
  createVNode(unref(InputNumber), {
@@ -14626,7 +14633,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
14626
14633
  valueModifiers: { number: true }
14627
14634
  }, null, 8, ["value", "onUpdate:value"]))
14628
14635
  ], 64)) : getTypeByField(schema == null ? void 0 : schema.field) === "date" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
14629
- schema.op === "bt" ? (openBlock(), createElementBlock("div", _hoisted_6$1, [
14636
+ schema.op === "bt" ? (openBlock(), createElementBlock("div", _hoisted_5$1, [
14630
14637
  createVNode(unref(FormItem), null, {
14631
14638
  default: withCtx(() => [
14632
14639
  createVNode(unref(DatePicker), {
@@ -14638,7 +14645,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
14638
14645
  ]),
14639
14646
  _: 2
14640
14647
  }, 1024),
14641
- _hoisted_7,
14648
+ _hoisted_6,
14642
14649
  createVNode(unref(FormItem), null, {
14643
14650
  default: withCtx(() => [
14644
14651
  createVNode(unref(DatePicker), {
@@ -14685,7 +14692,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
14685
14692
  onClick: ($event) => handleMinus(index2)
14686
14693
  }, [
14687
14694
  createVNode(unref(MinusCircleTwoTone$1))
14688
- ], 8, _hoisted_8)) : createCommentVNode("", true)
14695
+ ], 8, _hoisted_7)) : createCommentVNode("", true)
14689
14696
  ])
14690
14697
  ]),
14691
14698
  _: 2
@@ -14697,7 +14704,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
14697
14704
  ]),
14698
14705
  _: 1
14699
14706
  }, 8, ["model"])
14700
- ]);
14707
+ ], 512);
14701
14708
  };
14702
14709
  }
14703
14710
  });
@@ -14874,7 +14881,7 @@ const _sfc_main$m = defineComponent({
14874
14881
  });
14875
14882
  const TableHeader_vue_vue_type_style_index_0_lang = "";
14876
14883
  const _hoisted_1$c = { style: { "width": "100%" } };
14877
- const _hoisted_2$6 = {
14884
+ const _hoisted_2$5 = {
14878
14885
  key: 0,
14879
14886
  style: { "margin": "5px" }
14880
14887
  };
@@ -14882,7 +14889,7 @@ const _hoisted_3$2 = { class: "flex items-center" };
14882
14889
  function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
14883
14890
  const _component_TableSetting = resolveComponent("TableSetting");
14884
14891
  return openBlock(), createElementBlock("div", _hoisted_1$c, [
14885
- _ctx.$slots.headerTop ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
14892
+ _ctx.$slots.headerTop ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
14886
14893
  renderSlot(_ctx.$slots, "headerTop")
14887
14894
  ])) : createCommentVNode("", true),
14888
14895
  createElementVNode("div", _hoisted_3$2, [
@@ -15108,10 +15115,30 @@ function useTableFooter(propsRef, scrollRef, tableElRef, getDataSourceRef) {
15108
15115
  }
15109
15116
  return { getFooterProps };
15110
15117
  }
15118
+ function deepCopy(obj) {
15119
+ if (typeof obj !== "object" || obj === null) {
15120
+ return obj;
15121
+ }
15122
+ let copy;
15123
+ if (Array.isArray(obj)) {
15124
+ copy = [];
15125
+ for (let i = 0; i < obj.length; i++) {
15126
+ copy[i] = deepCopy(obj[i]);
15127
+ }
15128
+ } else {
15129
+ copy = {};
15130
+ for (let key2 in obj) {
15131
+ if (Object.prototype.hasOwnProperty.call(obj, key2)) {
15132
+ copy[key2] = deepCopy(obj[key2]);
15133
+ }
15134
+ }
15135
+ }
15136
+ return copy;
15137
+ }
15111
15138
  function useTableForm(propsRef, slots, fetch, getLoading) {
15112
15139
  const getFormConfig = computed(() => {
15113
15140
  const { formConfig } = unref(propsRef);
15114
- const temp = JSON.parse(JSON.stringify(formConfig));
15141
+ const temp = deepCopy(formConfig);
15115
15142
  temp == null ? void 0 : temp.schemas.forEach((item) => {
15116
15143
  if (item.component === "Input") {
15117
15144
  item.componentProps = {
@@ -15396,6 +15423,15 @@ const _sfc_main$k = defineComponent({
15396
15423
  emits: ["ensure"],
15397
15424
  setup(props2, { emit }) {
15398
15425
  const advancedSearchRef = ref();
15426
+ const table2 = useTableContext();
15427
+ const setStyle2 = () => {
15428
+ const dom = document.querySelector(".table-settings");
15429
+ if (dom) {
15430
+ return { left: `${dom.offsetLeft - 370}px` };
15431
+ } else {
15432
+ return {};
15433
+ }
15434
+ };
15399
15435
  const handleEnsure = () => {
15400
15436
  const form = advancedSearchRef.value.getSearchFrom();
15401
15437
  emit("ensure", form);
@@ -15403,21 +15439,44 @@ const _sfc_main$k = defineComponent({
15403
15439
  const handleReset = () => {
15404
15440
  advancedSearchRef.value.resetFields();
15405
15441
  };
15406
- return { handleEnsure, handleReset, advancedSearchRef };
15442
+ const tableAdvancedSearchWrapperRef = ref();
15443
+ const clickOutside = (e) => {
15444
+ if (document.querySelector(".table-settings").contains(e.target))
15445
+ return;
15446
+ if (tableAdvancedSearchWrapperRef.value.contains(e.target))
15447
+ return;
15448
+ table2.closeAdvancedSearch();
15449
+ };
15450
+ onMounted(() => {
15451
+ document.addEventListener("click", clickOutside);
15452
+ });
15453
+ onUnmounted(() => {
15454
+ document.removeEventListener("click", clickOutside);
15455
+ });
15456
+ return {
15457
+ handleEnsure,
15458
+ handleReset,
15459
+ advancedSearchRef,
15460
+ setStyle: setStyle2,
15461
+ tableAdvancedSearchWrapperRef
15462
+ };
15407
15463
  }
15408
15464
  });
15409
- const _hoisted_1$b = { class: "shy-basic-table-advanced-search" };
15410
- const _hoisted_2$5 = { class: "shy-basic-table-advanced-search-footer" };
15465
+ const _hoisted_1$b = { class: "shy-basic-table-advanced-search-footer" };
15411
15466
  function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
15412
15467
  const _component_AdvancedSearch = resolveComponent("AdvancedSearch");
15413
15468
  const _component_BasicButton = resolveComponent("BasicButton");
15414
15469
  const _component_Space = resolveComponent("Space");
15415
- return openBlock(), createElementBlock("div", _hoisted_1$b, [
15470
+ return openBlock(), createElementBlock("div", {
15471
+ class: "shy-basic-table-advanced-search",
15472
+ ref: "tableAdvancedSearchWrapperRef",
15473
+ style: normalizeStyle(_ctx.setStyle())
15474
+ }, [
15416
15475
  createVNode(_component_AdvancedSearch, {
15417
15476
  ref: "advancedSearchRef",
15418
15477
  schemas: _ctx.schemasAdvancedSearch
15419
15478
  }, null, 8, ["schemas"]),
15420
- createElementVNode("div", _hoisted_2$5, [
15479
+ createElementVNode("div", _hoisted_1$b, [
15421
15480
  createVNode(_component_Space, null, {
15422
15481
  default: withCtx(() => [
15423
15482
  createVNode(_component_BasicButton, {
@@ -15439,7 +15498,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
15439
15498
  _: 1
15440
15499
  })
15441
15500
  ])
15442
- ]);
15501
+ ], 4);
15443
15502
  }
15444
15503
  const TableAdvancedSearch = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$d]]);
15445
15504
  const _sfc_main$j = defineComponent({
@@ -15504,45 +15563,72 @@ const _sfc_main$j = defineComponent({
15504
15563
  const handleReset = () => {
15505
15564
  advancedSearchRef.value.resetFields();
15506
15565
  };
15566
+ const setStyle2 = () => {
15567
+ const dom = document.querySelector(".table-settings");
15568
+ if (dom) {
15569
+ return { left: `${dom.offsetLeft}px` };
15570
+ } else {
15571
+ return {};
15572
+ }
15573
+ };
15574
+ const globalSearchWrapperRef = ref();
15575
+ const clickOutside = (e) => {
15576
+ if (document.querySelector(".table-settings").contains(e.target))
15577
+ return;
15578
+ if (globalSearchWrapperRef.value.contains(e.target))
15579
+ return;
15580
+ table2.closeGlobalSearch();
15581
+ };
15582
+ onMounted(() => {
15583
+ document.addEventListener("click", clickOutside);
15584
+ });
15585
+ onUnmounted(() => {
15586
+ document.removeEventListener("click", clickOutside);
15587
+ });
15507
15588
  return {
15508
15589
  handleReset,
15509
15590
  advancedSearchRef,
15510
15591
  fieldList,
15511
15592
  curSelected,
15512
15593
  handleSelectedClick,
15513
- handleCheckboxChange
15594
+ handleCheckboxChange,
15595
+ setStyle: setStyle2,
15596
+ globalSearchWrapperRef
15514
15597
  };
15515
15598
  }
15516
15599
  });
15517
- const TableGlobalSearch_vue_vue_type_style_index_0_scoped_fa3d98b2_lang = "";
15518
- const _withScopeId = (n) => (pushScopeId("data-v-fa3d98b2"), n = n(), popScopeId(), n);
15519
- const _hoisted_1$a = { class: "shy-basic-table-global-search" };
15520
- const _hoisted_2$4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, "搜索全部", -1));
15521
- const _hoisted_3$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, "搜索特定字段", -1));
15522
- const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, null, -1));
15523
- const _hoisted_5 = { class: "shy-basic-table-global-search-checkbox-wrapper" };
15524
- const _hoisted_6 = { style: { "color": "#131415", "font-size": "12px" } };
15600
+ const TableGlobalSearch_vue_vue_type_style_index_0_scoped_46f4dcdc_lang = "";
15601
+ const _withScopeId = (n) => (pushScopeId("data-v-46f4dcdc"), n = n(), popScopeId(), n);
15602
+ const _hoisted_1$a = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, "搜索全部", -1));
15603
+ const _hoisted_2$4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, "搜索特定字段", -1));
15604
+ const _hoisted_3$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, null, -1));
15605
+ const _hoisted_4 = { class: "shy-basic-table-global-search-checkbox-wrapper" };
15606
+ const _hoisted_5 = { style: { "color": "#131415", "font-size": "12px" } };
15525
15607
  function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
15526
15608
  const _component_CheckOutlined = resolveComponent("CheckOutlined");
15527
15609
  const _component_Checkbox = resolveComponent("Checkbox");
15528
15610
  const _component_CheckboxGroup = resolveComponent("CheckboxGroup");
15529
- return openBlock(), createElementBlock("div", _hoisted_1$a, [
15611
+ return openBlock(), createElementBlock("div", {
15612
+ class: "shy-basic-table-global-search",
15613
+ style: normalizeStyle(_ctx.setStyle()),
15614
+ ref: "globalSearchWrapperRef"
15615
+ }, [
15530
15616
  createElementVNode("div", {
15531
15617
  class: normalizeClass(["shy-basic-table-global-search-item-global", { "selected-bg": _ctx.curSelected === 1 }]),
15532
15618
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handleSelectedClick(1))
15533
15619
  }, [
15534
- _hoisted_2$4,
15620
+ _hoisted_1$a,
15535
15621
  _ctx.curSelected === 1 ? (openBlock(), createBlock(_component_CheckOutlined, { key: 0 })) : createCommentVNode("", true)
15536
15622
  ], 2),
15537
15623
  createElementVNode("div", {
15538
15624
  class: normalizeClass(["shy-basic-table-global-search-item-special", { "selected-bg": _ctx.curSelected === 2 }]),
15539
15625
  onClick: _cache[1] || (_cache[1] = ($event) => _ctx.handleSelectedClick(2))
15540
15626
  }, [
15541
- _hoisted_3$1,
15627
+ _hoisted_2$4,
15542
15628
  _ctx.curSelected === 2 ? (openBlock(), createBlock(_component_CheckOutlined, { key: 0 })) : createCommentVNode("", true)
15543
15629
  ], 2),
15544
- _hoisted_4,
15545
- createElementVNode("div", _hoisted_5, [
15630
+ _hoisted_3$1,
15631
+ createElementVNode("div", _hoisted_4, [
15546
15632
  createVNode(_component_CheckboxGroup, {
15547
15633
  value: _ctx.fieldList,
15548
15634
  "onUpdate:value": _cache[2] || (_cache[2] = ($event) => _ctx.fieldList = $event),
@@ -15558,7 +15644,7 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
15558
15644
  value: item.field
15559
15645
  }, {
15560
15646
  default: withCtx(() => [
15561
- createElementVNode("span", _hoisted_6, toDisplayString(item.label), 1)
15647
+ createElementVNode("span", _hoisted_5, toDisplayString(item.label), 1)
15562
15648
  ]),
15563
15649
  _: 2
15564
15650
  }, 1032, ["value"])
@@ -15568,9 +15654,9 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
15568
15654
  _: 1
15569
15655
  }, 8, ["value", "onChange"])
15570
15656
  ])
15571
- ]);
15657
+ ], 4);
15572
15658
  }
15573
- const TableGlobalSearch = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$c], ["__scopeId", "data-v-fa3d98b2"]]);
15659
+ const TableGlobalSearch = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$c], ["__scopeId", "data-v-46f4dcdc"]]);
15574
15660
  const _sfc_main$i = defineComponent({
15575
15661
  components: {
15576
15662
  TableAdvancedSearch,
package/es/style.css CHANGED
@@ -25412,7 +25412,7 @@ span.iconify {
25412
25412
  }
25413
25413
  .shy-basic-column-setting__cloumn-list .scrollbar {
25414
25414
  height: 220px;
25415
- }.icon-selected[data-v-851e809a] {
25415
+ }.icon-selected[data-v-f74ee46a] {
25416
25416
  color: #498bf8;
25417
25417
  }.shy-ui-advanced-search .ant-form-item {
25418
25418
  margin-bottom: 0;
@@ -25482,7 +25482,7 @@ span.iconify {
25482
25482
  }
25483
25483
  .shy-basic-table-header__toolbar > * {
25484
25484
  margin-right: 8px;
25485
- }.shy-basic-table-global-search[data-v-fa3d98b2] {
25485
+ }.shy-basic-table-global-search[data-v-46f4dcdc] {
25486
25486
  position: absolute;
25487
25487
  top: 40px;
25488
25488
  right: 131px;
@@ -25494,7 +25494,7 @@ span.iconify {
25494
25494
  border: 1px solid #ebebeb;
25495
25495
  padding: 10px;
25496
25496
  }
25497
- .shy-basic-table-global-search-item-global[data-v-fa3d98b2] {
25497
+ .shy-basic-table-global-search-item-global[data-v-46f4dcdc] {
25498
25498
  height: 32px;
25499
25499
  line-height: 32px;
25500
25500
  font-size: 14px;
@@ -25505,7 +25505,7 @@ span.iconify {
25505
25505
  align-items: center;
25506
25506
  justify-content: space-between;
25507
25507
  }
25508
- .shy-basic-table-global-search-item-special[data-v-fa3d98b2] {
25508
+ .shy-basic-table-global-search-item-special[data-v-46f4dcdc] {
25509
25509
  height: 32px;
25510
25510
  line-height: 32px;
25511
25511
  font-size: 14px;
@@ -25516,10 +25516,10 @@ span.iconify {
25516
25516
  align-items: center;
25517
25517
  justify-content: space-between;
25518
25518
  }
25519
- .shy-basic-table-global-search-checkbox-wrapper[data-v-fa3d98b2] {
25519
+ .shy-basic-table-global-search-checkbox-wrapper[data-v-46f4dcdc] {
25520
25520
  padding: 0 8px;
25521
25521
  }
25522
- .shy-basic-table-global-search .selected-bg[data-v-fa3d98b2] {
25522
+ .shy-basic-table-global-search .selected-bg[data-v-46f4dcdc] {
25523
25523
  background-color: #ebf1ff;
25524
25524
  }.shy-basic-table-action {
25525
25525
  display: flex;
@@ -25583,16 +25583,18 @@ span.iconify {
25583
25583
  }
25584
25584
  .shy-basic-table-advanced-search {
25585
25585
  position: absolute;
25586
- top: 30px;
25587
- right: 100px;
25586
+ top: 40px;
25587
+ right: 106px;
25588
25588
  width: 600px;
25589
- max-height: 800px;
25590
- overflow: auto;
25591
25589
  z-index: 100;
25592
25590
  background-color: #fff;
25593
25591
  border: 1px solid #ebebeb;
25594
25592
  padding: 10px 10px 42px 10px;
25595
25593
  }
25594
+ .shy-basic-table-advanced-search .shy-ui-advanced-search {
25595
+ max-height: 500px;
25596
+ overflow: auto;
25597
+ }
25596
25598
  .shy-basic-table-advanced-search-footer {
25597
25599
  position: absolute;
25598
25600
  left: 10px;
@@ -7,6 +7,12 @@ declare const _sfc_main: import("vue").DefineComponent<{
7
7
  handleEnsure: () => void;
8
8
  handleReset: () => void;
9
9
  advancedSearchRef: import("vue").Ref<any>;
10
+ setStyle: () => {
11
+ left: string;
12
+ } | {
13
+ left?: undefined;
14
+ };
15
+ tableAdvancedSearchWrapperRef: import("vue").Ref<any>;
10
16
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "ensure"[], "ensure", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
11
17
  schemasAdvancedSearch: {
12
18
  default: () => any[];
package/lib/index.js CHANGED
@@ -5592,7 +5592,7 @@ const _sfc_main$V = vue.defineComponent({
5592
5592
  }
5593
5593
  });
5594
5594
  const _hoisted_1$m = { key: "component" };
5595
- const _hoisted_2$a = { key: "skeleton" };
5595
+ const _hoisted_2$9 = { key: "skeleton" };
5596
5596
  function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
5597
5597
  const _component_Skeleton = vue.resolveComponent("Skeleton");
5598
5598
  return vue.openBlock(), vue.createBlock(vue.TransitionGroup, vue.mergeProps({ class: "h-full w-full" }, _ctx.$attrs, {
@@ -5604,7 +5604,7 @@ function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
5604
5604
  default: vue.withCtx(() => [
5605
5605
  _ctx.isInit ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
5606
5606
  vue.renderSlot(_ctx.$slots, "default", { loading: _ctx.loading })
5607
- ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$a, [
5607
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$9, [
5608
5608
  _ctx.$slots.skeleton ? vue.renderSlot(_ctx.$slots, "skeleton", { key: 0 }) : (vue.openBlock(), vue.createBlock(_component_Skeleton, { key: 1 }))
5609
5609
  ]))
5610
5610
  ]),
@@ -6958,14 +6958,14 @@ function useTransition(source, options = {}) {
6958
6958
  });
6959
6959
  }
6960
6960
  const _hoisted_1$l = { class: "flex justify-between" };
6961
- const _hoisted_2$9 = { key: 0 };
6961
+ const _hoisted_2$8 = { key: 0 };
6962
6962
  const _hoisted_3$5 = { class: "flex flex-wrap px-2" };
6963
6963
  const _hoisted_4$3 = ["onClick", "title"];
6964
6964
  const _hoisted_5$2 = {
6965
6965
  key: 0,
6966
6966
  class: "flex py-2 items-center justify-center"
6967
6967
  };
6968
- const _hoisted_6$2 = {
6968
+ const _hoisted_6$1 = {
6969
6969
  key: 1,
6970
6970
  class: "p-5"
6971
6971
  };
@@ -7074,7 +7074,7 @@ const _sfc_main$U = /* @__PURE__ */ vue.defineComponent({
7074
7074
  ])
7075
7075
  ]),
7076
7076
  content: vue.withCtx(() => [
7077
- vue.unref(getPaginationList).length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$9, [
7077
+ vue.unref(getPaginationList).length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$8, [
7078
7078
  vue.createVNode(vue.unref(ScrollContainer$1), { class: "border border-solid border-t-0" }, {
7079
7079
  default: vue.withCtx(() => [
7080
7080
  vue.createElementVNode("ul", _hoisted_3$5, [
@@ -7107,7 +7107,7 @@ const _sfc_main$U = /* @__PURE__ */ vue.defineComponent({
7107
7107
  onChange: handlePageChange
7108
7108
  }, null, 8, ["pageSize", "total"])
7109
7109
  ])) : vue.createCommentVNode("", true)
7110
- ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$2, [
7110
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$1, [
7111
7111
  vue.createVNode(vue.unref(AEmpty))
7112
7112
  ]))
7113
7113
  ]),
@@ -7275,7 +7275,7 @@ function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
7275
7275
  }
7276
7276
  const CountdownInput = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["render", _sfc_render$y]]);
7277
7277
  const _hoisted_1$k = { key: 0 };
7278
- const _hoisted_2$8 = {
7278
+ const _hoisted_2$7 = {
7279
7279
  key: 1,
7280
7280
  class: "delete-wrapper"
7281
7281
  };
@@ -7410,7 +7410,7 @@ const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
7410
7410
  }, 1032, ["rules", "name"])
7411
7411
  ]),
7412
7412
  _: 2
7413
- }, 1032, ["model"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$8, [
7413
+ }, 1032, ["model"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$7, [
7414
7414
  vue.createElementVNode("span", _hoisted_3$4, vue.toDisplayString(index2 + 1), 1),
7415
7415
  vue.createElementVNode("div", {
7416
7416
  class: "delete-item",
@@ -7837,9 +7837,8 @@ const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
7837
7837
  ...on,
7838
7838
  ...bindValue
7839
7839
  };
7840
- console.log(compAttr);
7841
7840
  const handleInput = (e) => {
7842
- compAttr.onInputEvent(e);
7841
+ (compAttr == null ? void 0 : compAttr.onInputEvent) && compAttr.onInputEvent(e);
7843
7842
  };
7844
7843
  if (!renderComponentContent) {
7845
7844
  return vue.createVNode(Comp, vue.mergeProps(compAttr, {
@@ -14299,14 +14298,16 @@ const _sfc_main$q = vue.defineComponent({
14299
14298
  setup() {
14300
14299
  const { isVisibleAdvancedSearch, closeGlobalSearch } = useTableContext();
14301
14300
  const handleIconClick = () => {
14302
- isVisibleAdvancedSearch.value = !isVisibleAdvancedSearch.value;
14303
- closeGlobalSearch();
14301
+ vue.nextTick(() => {
14302
+ isVisibleAdvancedSearch.value = !isVisibleAdvancedSearch.value;
14303
+ closeGlobalSearch();
14304
+ });
14304
14305
  };
14305
14306
  return { isVisibleAdvancedSearch, handleIconClick };
14306
14307
  }
14307
14308
  });
14308
- const AdvancedSearchSetting_vue_vue_type_style_index_0_scoped_851e809a_lang = "";
14309
- const _withScopeId$1 = (n) => (vue.pushScopeId("data-v-851e809a"), n = n(), vue.popScopeId(), n);
14309
+ const AdvancedSearchSetting_vue_vue_type_style_index_0_scoped_f74ee46a_lang = "";
14310
+ const _withScopeId$1 = (n) => (vue.pushScopeId("data-v-f74ee46a"), n = n(), vue.popScopeId(), n);
14310
14311
  const _hoisted_1$f = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("span", null, "高级搜索", -1));
14311
14312
  function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
14312
14313
  const _component_FilterOutlined = vue.resolveComponent("FilterOutlined");
@@ -14324,7 +14325,7 @@ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
14324
14325
  _: 1
14325
14326
  });
14326
14327
  }
14327
- const AdvancedSearchSetting = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$h], ["__scopeId", "data-v-851e809a"]]);
14328
+ const AdvancedSearchSetting = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$h], ["__scopeId", "data-v-f74ee46a"]]);
14328
14329
  const index$2 = "";
14329
14330
  const searchType = [
14330
14331
  {
@@ -14405,25 +14406,25 @@ const searchTypeSelect = [{ label: "等于", value: "eq" }];
14405
14406
  const getGlobalAdvancedType = (fieldList, value) => {
14406
14407
  const temp = {};
14407
14408
  fieldList.forEach((field) => {
14408
- temp[`${field}-op`] = "ct";
14409
- temp[field] = value;
14409
+ temp[`${field}.${field}-op`] = "ct";
14410
+ temp[`${field}.${field}`] = value;
14410
14411
  });
14412
+ temp.gexpr = fieldList.join("|");
14411
14413
  return temp;
14412
14414
  };
14413
- const _hoisted_1$e = { class: "shy-ui-advanced-search" };
14414
- const _hoisted_2$7 = { class: "shy-ui-advanced-search-add" };
14415
- const _hoisted_3$3 = { class: "shy-ui-advanced-search-item-wrapper" };
14416
- const _hoisted_4$1 = {
14415
+ const _hoisted_1$e = { class: "shy-ui-advanced-search-add" };
14416
+ const _hoisted_2$6 = { class: "shy-ui-advanced-search-item-wrapper" };
14417
+ const _hoisted_3$3 = {
14417
14418
  key: 0,
14418
14419
  class: "shy-ui-advanced-search-item-value-range"
14419
14420
  };
14420
- const _hoisted_5$1 = /* @__PURE__ */ vue.createElementVNode("div", { style: { "flex": "0", "width": "40px", "margin-right": "8px" } }, " 至 ", -1);
14421
- const _hoisted_6$1 = {
14421
+ const _hoisted_4$1 = /* @__PURE__ */ vue.createElementVNode("div", { style: { "flex": "0", "width": "40px", "margin-right": "8px" } }, " 至 ", -1);
14422
+ const _hoisted_5$1 = {
14422
14423
  key: 0,
14423
14424
  class: "shy-ui-advanced-search-item-value-range"
14424
14425
  };
14425
- const _hoisted_7 = /* @__PURE__ */ vue.createElementVNode("div", { style: { "flex": "0", "width": "40px", "margin-right": "8px" } }, " 至 ", -1);
14426
- const _hoisted_8 = ["onClick"];
14426
+ const _hoisted_6 = /* @__PURE__ */ vue.createElementVNode("div", { style: { "flex": "0", "width": "40px", "margin-right": "8px" } }, " 至 ", -1);
14427
+ const _hoisted_7 = ["onClick"];
14427
14428
  const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
14428
14429
  __name: "AdvancedSearch",
14429
14430
  props: {
@@ -14445,6 +14446,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
14445
14446
  setup(__props, { expose }) {
14446
14447
  const props2 = __props;
14447
14448
  vue.reactive({});
14449
+ const advancedSearchRef = vue.ref();
14448
14450
  const formRef = vue.ref();
14449
14451
  const schemasCurrent = vue.reactive([]);
14450
14452
  if (props2.schemas.length !== 0)
@@ -14539,11 +14541,16 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
14539
14541
  };
14540
14542
  expose({
14541
14543
  getSearchFrom,
14542
- resetFields
14544
+ resetFields,
14545
+ advancedSearchRef
14543
14546
  });
14544
14547
  return (_ctx, _cache) => {
14545
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, [
14546
- vue.createElementVNode("div", _hoisted_2$7, [
14548
+ return vue.openBlock(), vue.createElementBlock("div", {
14549
+ class: "shy-ui-advanced-search",
14550
+ ref_key: "advancedSearchRef",
14551
+ ref: advancedSearchRef
14552
+ }, [
14553
+ vue.createElementVNode("div", _hoisted_1$e, [
14547
14554
  vue.createVNode(vue.unref(PlusCircleOutlined$1)),
14548
14555
  vue.createElementVNode("div", {
14549
14556
  style: { "margin-left": "8px" },
@@ -14561,7 +14568,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
14561
14568
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(schemasCurrent, (schema, index2) => {
14562
14569
  return vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Col), vue.normalizeProps(vue.mergeProps({ key: index2 }, (schema == null ? void 0 : schema.colProps) || { span: 24 })), {
14563
14570
  default: vue.withCtx(() => [
14564
- vue.createElementVNode("div", _hoisted_3$3, [
14571
+ vue.createElementVNode("div", _hoisted_2$6, [
14565
14572
  vue.createVNode(vue.unref(antDesignVue.FormItem), {
14566
14573
  class: "shy-ui-advanced-search-item-op",
14567
14574
  name: `${schema.field}-op`
@@ -14598,7 +14605,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
14598
14605
  vue.createVNode(vue.unref(antDesignVue.FormItem), { class: "shy-ui-advanced-search-item-value" }, {
14599
14606
  default: vue.withCtx(() => [
14600
14607
  getTypeByField(schema == null ? void 0 : schema.field) === "number" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
14601
- schema.op === "bt" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [
14608
+ schema.op === "bt" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, [
14602
14609
  vue.createVNode(vue.unref(antDesignVue.FormItem), null, {
14603
14610
  default: vue.withCtx(() => [
14604
14611
  vue.createVNode(vue.unref(antDesignVue.InputNumber), {
@@ -14609,7 +14616,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
14609
14616
  ]),
14610
14617
  _: 2
14611
14618
  }, 1024),
14612
- _hoisted_5$1,
14619
+ _hoisted_4$1,
14613
14620
  vue.createVNode(vue.unref(antDesignVue.FormItem), null, {
14614
14621
  default: vue.withCtx(() => [
14615
14622
  vue.createVNode(vue.unref(antDesignVue.InputNumber), {
@@ -14628,7 +14635,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
14628
14635
  valueModifiers: { number: true }
14629
14636
  }, null, 8, ["value", "onUpdate:value"]))
14630
14637
  ], 64)) : getTypeByField(schema == null ? void 0 : schema.field) === "date" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
14631
- schema.op === "bt" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$1, [
14638
+ schema.op === "bt" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$1, [
14632
14639
  vue.createVNode(vue.unref(antDesignVue.FormItem), null, {
14633
14640
  default: vue.withCtx(() => [
14634
14641
  vue.createVNode(vue.unref(antDesignVue.DatePicker), {
@@ -14640,7 +14647,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
14640
14647
  ]),
14641
14648
  _: 2
14642
14649
  }, 1024),
14643
- _hoisted_7,
14650
+ _hoisted_6,
14644
14651
  vue.createVNode(vue.unref(antDesignVue.FormItem), null, {
14645
14652
  default: vue.withCtx(() => [
14646
14653
  vue.createVNode(vue.unref(antDesignVue.DatePicker), {
@@ -14687,7 +14694,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
14687
14694
  onClick: ($event) => handleMinus(index2)
14688
14695
  }, [
14689
14696
  vue.createVNode(vue.unref(MinusCircleTwoTone$1))
14690
- ], 8, _hoisted_8)) : vue.createCommentVNode("", true)
14697
+ ], 8, _hoisted_7)) : vue.createCommentVNode("", true)
14691
14698
  ])
14692
14699
  ]),
14693
14700
  _: 2
@@ -14699,7 +14706,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
14699
14706
  ]),
14700
14707
  _: 1
14701
14708
  }, 8, ["model"])
14702
- ]);
14709
+ ], 512);
14703
14710
  };
14704
14711
  }
14705
14712
  });
@@ -14876,7 +14883,7 @@ const _sfc_main$m = vue.defineComponent({
14876
14883
  });
14877
14884
  const TableHeader_vue_vue_type_style_index_0_lang = "";
14878
14885
  const _hoisted_1$c = { style: { "width": "100%" } };
14879
- const _hoisted_2$6 = {
14886
+ const _hoisted_2$5 = {
14880
14887
  key: 0,
14881
14888
  style: { "margin": "5px" }
14882
14889
  };
@@ -14884,7 +14891,7 @@ const _hoisted_3$2 = { class: "flex items-center" };
14884
14891
  function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
14885
14892
  const _component_TableSetting = vue.resolveComponent("TableSetting");
14886
14893
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
14887
- _ctx.$slots.headerTop ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$6, [
14894
+ _ctx.$slots.headerTop ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$5, [
14888
14895
  vue.renderSlot(_ctx.$slots, "headerTop")
14889
14896
  ])) : vue.createCommentVNode("", true),
14890
14897
  vue.createElementVNode("div", _hoisted_3$2, [
@@ -15110,10 +15117,30 @@ function useTableFooter(propsRef, scrollRef, tableElRef, getDataSourceRef) {
15110
15117
  }
15111
15118
  return { getFooterProps };
15112
15119
  }
15120
+ function deepCopy(obj) {
15121
+ if (typeof obj !== "object" || obj === null) {
15122
+ return obj;
15123
+ }
15124
+ let copy;
15125
+ if (Array.isArray(obj)) {
15126
+ copy = [];
15127
+ for (let i = 0; i < obj.length; i++) {
15128
+ copy[i] = deepCopy(obj[i]);
15129
+ }
15130
+ } else {
15131
+ copy = {};
15132
+ for (let key2 in obj) {
15133
+ if (Object.prototype.hasOwnProperty.call(obj, key2)) {
15134
+ copy[key2] = deepCopy(obj[key2]);
15135
+ }
15136
+ }
15137
+ }
15138
+ return copy;
15139
+ }
15113
15140
  function useTableForm(propsRef, slots, fetch, getLoading) {
15114
15141
  const getFormConfig = vue.computed(() => {
15115
15142
  const { formConfig } = vue.unref(propsRef);
15116
- const temp = JSON.parse(JSON.stringify(formConfig));
15143
+ const temp = deepCopy(formConfig);
15117
15144
  temp == null ? void 0 : temp.schemas.forEach((item) => {
15118
15145
  if (item.component === "Input") {
15119
15146
  item.componentProps = {
@@ -15398,6 +15425,15 @@ const _sfc_main$k = vue.defineComponent({
15398
15425
  emits: ["ensure"],
15399
15426
  setup(props2, { emit }) {
15400
15427
  const advancedSearchRef = vue.ref();
15428
+ const table2 = useTableContext();
15429
+ const setStyle2 = () => {
15430
+ const dom = document.querySelector(".table-settings");
15431
+ if (dom) {
15432
+ return { left: `${dom.offsetLeft - 370}px` };
15433
+ } else {
15434
+ return {};
15435
+ }
15436
+ };
15401
15437
  const handleEnsure = () => {
15402
15438
  const form = advancedSearchRef.value.getSearchFrom();
15403
15439
  emit("ensure", form);
@@ -15405,21 +15441,44 @@ const _sfc_main$k = vue.defineComponent({
15405
15441
  const handleReset = () => {
15406
15442
  advancedSearchRef.value.resetFields();
15407
15443
  };
15408
- return { handleEnsure, handleReset, advancedSearchRef };
15444
+ const tableAdvancedSearchWrapperRef = vue.ref();
15445
+ const clickOutside = (e) => {
15446
+ if (document.querySelector(".table-settings").contains(e.target))
15447
+ return;
15448
+ if (tableAdvancedSearchWrapperRef.value.contains(e.target))
15449
+ return;
15450
+ table2.closeAdvancedSearch();
15451
+ };
15452
+ vue.onMounted(() => {
15453
+ document.addEventListener("click", clickOutside);
15454
+ });
15455
+ vue.onUnmounted(() => {
15456
+ document.removeEventListener("click", clickOutside);
15457
+ });
15458
+ return {
15459
+ handleEnsure,
15460
+ handleReset,
15461
+ advancedSearchRef,
15462
+ setStyle: setStyle2,
15463
+ tableAdvancedSearchWrapperRef
15464
+ };
15409
15465
  }
15410
15466
  });
15411
- const _hoisted_1$b = { class: "shy-basic-table-advanced-search" };
15412
- const _hoisted_2$5 = { class: "shy-basic-table-advanced-search-footer" };
15467
+ const _hoisted_1$b = { class: "shy-basic-table-advanced-search-footer" };
15413
15468
  function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
15414
15469
  const _component_AdvancedSearch = vue.resolveComponent("AdvancedSearch");
15415
15470
  const _component_BasicButton = vue.resolveComponent("BasicButton");
15416
15471
  const _component_Space = vue.resolveComponent("Space");
15417
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
15472
+ return vue.openBlock(), vue.createElementBlock("div", {
15473
+ class: "shy-basic-table-advanced-search",
15474
+ ref: "tableAdvancedSearchWrapperRef",
15475
+ style: vue.normalizeStyle(_ctx.setStyle())
15476
+ }, [
15418
15477
  vue.createVNode(_component_AdvancedSearch, {
15419
15478
  ref: "advancedSearchRef",
15420
15479
  schemas: _ctx.schemasAdvancedSearch
15421
15480
  }, null, 8, ["schemas"]),
15422
- vue.createElementVNode("div", _hoisted_2$5, [
15481
+ vue.createElementVNode("div", _hoisted_1$b, [
15423
15482
  vue.createVNode(_component_Space, null, {
15424
15483
  default: vue.withCtx(() => [
15425
15484
  vue.createVNode(_component_BasicButton, {
@@ -15441,7 +15500,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
15441
15500
  _: 1
15442
15501
  })
15443
15502
  ])
15444
- ]);
15503
+ ], 4);
15445
15504
  }
15446
15505
  const TableAdvancedSearch = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$d]]);
15447
15506
  const _sfc_main$j = vue.defineComponent({
@@ -15506,45 +15565,72 @@ const _sfc_main$j = vue.defineComponent({
15506
15565
  const handleReset = () => {
15507
15566
  advancedSearchRef.value.resetFields();
15508
15567
  };
15568
+ const setStyle2 = () => {
15569
+ const dom = document.querySelector(".table-settings");
15570
+ if (dom) {
15571
+ return { left: `${dom.offsetLeft}px` };
15572
+ } else {
15573
+ return {};
15574
+ }
15575
+ };
15576
+ const globalSearchWrapperRef = vue.ref();
15577
+ const clickOutside = (e) => {
15578
+ if (document.querySelector(".table-settings").contains(e.target))
15579
+ return;
15580
+ if (globalSearchWrapperRef.value.contains(e.target))
15581
+ return;
15582
+ table2.closeGlobalSearch();
15583
+ };
15584
+ vue.onMounted(() => {
15585
+ document.addEventListener("click", clickOutside);
15586
+ });
15587
+ vue.onUnmounted(() => {
15588
+ document.removeEventListener("click", clickOutside);
15589
+ });
15509
15590
  return {
15510
15591
  handleReset,
15511
15592
  advancedSearchRef,
15512
15593
  fieldList,
15513
15594
  curSelected,
15514
15595
  handleSelectedClick,
15515
- handleCheckboxChange
15596
+ handleCheckboxChange,
15597
+ setStyle: setStyle2,
15598
+ globalSearchWrapperRef
15516
15599
  };
15517
15600
  }
15518
15601
  });
15519
- const TableGlobalSearch_vue_vue_type_style_index_0_scoped_fa3d98b2_lang = "";
15520
- const _withScopeId = (n) => (vue.pushScopeId("data-v-fa3d98b2"), n = n(), vue.popScopeId(), n);
15521
- const _hoisted_1$a = { class: "shy-basic-table-global-search" };
15522
- const _hoisted_2$4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", null, "搜索全部", -1));
15523
- const _hoisted_3$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", null, "搜索特定字段", -1));
15524
- const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", null, null, -1));
15525
- const _hoisted_5 = { class: "shy-basic-table-global-search-checkbox-wrapper" };
15526
- const _hoisted_6 = { style: { "color": "#131415", "font-size": "12px" } };
15602
+ const TableGlobalSearch_vue_vue_type_style_index_0_scoped_46f4dcdc_lang = "";
15603
+ const _withScopeId = (n) => (vue.pushScopeId("data-v-46f4dcdc"), n = n(), vue.popScopeId(), n);
15604
+ const _hoisted_1$a = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", null, "搜索全部", -1));
15605
+ const _hoisted_2$4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", null, "搜索特定字段", -1));
15606
+ const _hoisted_3$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", null, null, -1));
15607
+ const _hoisted_4 = { class: "shy-basic-table-global-search-checkbox-wrapper" };
15608
+ const _hoisted_5 = { style: { "color": "#131415", "font-size": "12px" } };
15527
15609
  function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
15528
15610
  const _component_CheckOutlined = vue.resolveComponent("CheckOutlined");
15529
15611
  const _component_Checkbox = vue.resolveComponent("Checkbox");
15530
15612
  const _component_CheckboxGroup = vue.resolveComponent("CheckboxGroup");
15531
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
15613
+ return vue.openBlock(), vue.createElementBlock("div", {
15614
+ class: "shy-basic-table-global-search",
15615
+ style: vue.normalizeStyle(_ctx.setStyle()),
15616
+ ref: "globalSearchWrapperRef"
15617
+ }, [
15532
15618
  vue.createElementVNode("div", {
15533
15619
  class: vue.normalizeClass(["shy-basic-table-global-search-item-global", { "selected-bg": _ctx.curSelected === 1 }]),
15534
15620
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handleSelectedClick(1))
15535
15621
  }, [
15536
- _hoisted_2$4,
15622
+ _hoisted_1$a,
15537
15623
  _ctx.curSelected === 1 ? (vue.openBlock(), vue.createBlock(_component_CheckOutlined, { key: 0 })) : vue.createCommentVNode("", true)
15538
15624
  ], 2),
15539
15625
  vue.createElementVNode("div", {
15540
15626
  class: vue.normalizeClass(["shy-basic-table-global-search-item-special", { "selected-bg": _ctx.curSelected === 2 }]),
15541
15627
  onClick: _cache[1] || (_cache[1] = ($event) => _ctx.handleSelectedClick(2))
15542
15628
  }, [
15543
- _hoisted_3$1,
15629
+ _hoisted_2$4,
15544
15630
  _ctx.curSelected === 2 ? (vue.openBlock(), vue.createBlock(_component_CheckOutlined, { key: 0 })) : vue.createCommentVNode("", true)
15545
15631
  ], 2),
15546
- _hoisted_4,
15547
- vue.createElementVNode("div", _hoisted_5, [
15632
+ _hoisted_3$1,
15633
+ vue.createElementVNode("div", _hoisted_4, [
15548
15634
  vue.createVNode(_component_CheckboxGroup, {
15549
15635
  value: _ctx.fieldList,
15550
15636
  "onUpdate:value": _cache[2] || (_cache[2] = ($event) => _ctx.fieldList = $event),
@@ -15560,7 +15646,7 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
15560
15646
  value: item.field
15561
15647
  }, {
15562
15648
  default: vue.withCtx(() => [
15563
- vue.createElementVNode("span", _hoisted_6, vue.toDisplayString(item.label), 1)
15649
+ vue.createElementVNode("span", _hoisted_5, vue.toDisplayString(item.label), 1)
15564
15650
  ]),
15565
15651
  _: 2
15566
15652
  }, 1032, ["value"])
@@ -15570,9 +15656,9 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
15570
15656
  _: 1
15571
15657
  }, 8, ["value", "onChange"])
15572
15658
  ])
15573
- ]);
15659
+ ], 4);
15574
15660
  }
15575
- const TableGlobalSearch = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$c], ["__scopeId", "data-v-fa3d98b2"]]);
15661
+ const TableGlobalSearch = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$c], ["__scopeId", "data-v-46f4dcdc"]]);
15576
15662
  const _sfc_main$i = vue.defineComponent({
15577
15663
  components: {
15578
15664
  TableAdvancedSearch,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "3h1-ui",
3
- "version": "2.9.5",
3
+ "version": "2.9.7",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",