3h1-ui 2.12.0-beta.2 → 2.12.0-beta.3

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
@@ -4000,10 +4000,10 @@ const _sfc_main$1f = defineComponent({
4000
4000
  emitData.value = args;
4001
4001
  }
4002
4002
  const filterOption = (input, option) => {
4003
- var _a2, _b;
4003
+ var _a2, _b, _c;
4004
4004
  const label = ((_b = (_a2 = attrs.value) == null ? void 0 : _a2.fieldNames) == null ? void 0 : _b.label) || "label";
4005
- console.log("label", label);
4006
- return option[label].toLowerCase().indexOf(input.toLowerCase()) >= 0;
4005
+ if (typeof option[label] === "string")
4006
+ return ((_c = option[label]) == null ? void 0 : _c.toLowerCase().indexOf(input.toLowerCase())) >= 0;
4007
4007
  };
4008
4008
  return {
4009
4009
  state,
@@ -14501,15 +14501,16 @@ const searchType = [
14501
14501
  }
14502
14502
  ];
14503
14503
  const searchTypeNumber = searchType.filter((item) => {
14504
- return ["eq", "gt", "ge", "lt", "le", "bt"].includes(item.value);
14504
+ return ["eq", "gt", "ge", "lt", "le", "bt", "nl"].includes(item.value);
14505
14505
  });
14506
14506
  const searchTypeString = searchType.filter((item) => {
14507
- return ["eq", "ct", "sw", "ew"].includes(item.value);
14507
+ return ["eq", "ct", "sw", "ew", "nl"].includes(item.value);
14508
14508
  });
14509
14509
  const searchTypeDate = searchType.filter((item) => {
14510
- return ["eq", "gt", "ge", "lt", "le", "bt"].includes(item.value);
14510
+ return ["eq", "gt", "ge", "lt", "le", "bt", "nl"].includes(item.value);
14511
14511
  });
14512
14512
  const searchTypeSelect = [{ label: "等于", value: "eq" }];
14513
+ const stringSearchTypeSelect = [{ label: "包含", value: "ct" }];
14513
14514
  const getGlobalAdvancedType = (fieldList, value) => {
14514
14515
  const temp = {};
14515
14516
  fieldList.forEach((field) => {
@@ -14532,7 +14533,7 @@ const _hoisted_5$1 = {
14532
14533
  };
14533
14534
  const _hoisted_6 = /* @__PURE__ */ createElementVNode("div", { style: { "flex": "0", "width": "40px", "margin-right": "8px" } }, " 至 ", -1);
14534
14535
  const _hoisted_7 = {
14535
- key: 0,
14536
+ key: 1,
14536
14537
  style: { "margin-left": "8px", "cursor": "pointer", "position": "relative" },
14537
14538
  class: "shy-ui-advanced-minus-icon"
14538
14539
  };
@@ -14540,48 +14541,57 @@ const _hoisted_8 = ["onClick"];
14540
14541
  const _sfc_main$v = /* @__PURE__ */ defineComponent({
14541
14542
  __name: "AdvancedSearch",
14542
14543
  props: {
14543
- schemas: {
14544
- default: () => [
14545
- {
14546
- label: "姓名",
14547
- field: "name"
14548
- },
14549
- {
14550
- label: "年龄",
14551
- field: "age",
14552
- type: "number"
14553
- },
14554
- { label: "生日", field: "birth", type: "date" }
14555
- ]
14556
- }
14544
+ schemas: { default: () => [
14545
+ {
14546
+ label: "姓名",
14547
+ field: "name",
14548
+ advancedShow: false
14549
+ },
14550
+ {
14551
+ label: "年龄",
14552
+ field: "age",
14553
+ type: "number"
14554
+ },
14555
+ { label: "生日", field: "birth", type: "date" }
14556
+ ] }
14557
14557
  },
14558
14558
  setup(__props, { expose }) {
14559
14559
  const props2 = __props;
14560
- reactive({});
14561
14560
  const advancedSearchRef = ref();
14562
14561
  const formRef = ref();
14563
14562
  const schemasCurrent = reactive([]);
14564
- if (props2.schemas.length !== 0)
14565
- schemasCurrent.push({ field: props2.schemas[0].field, op: "eq" });
14566
14563
  const dicColumn = computed(() => {
14567
14564
  const temp = [];
14568
14565
  props2.schemas.forEach((schama) => {
14566
+ if (!schama.advancedShow)
14567
+ return;
14569
14568
  const flag = schemasCurrent.find((item) => {
14570
14569
  return item.field === schama.field;
14571
14570
  });
14572
14571
  temp.push({
14573
14572
  label: schama.label,
14574
14573
  value: schama.field,
14575
- disabled: !!flag
14574
+ disabled: !!flag,
14575
+ type: schama.type,
14576
+ component: schama.component
14576
14577
  });
14577
14578
  });
14578
14579
  return temp;
14579
14580
  });
14581
+ if (props2.schemas.length !== 0) {
14582
+ const firstSchema = dicColumn.value[0];
14583
+ const op = firstSchema.type === "string" && /select/i.test(firstSchema.component) ? "ct" : "eq";
14584
+ schemasCurrent.push({ field: firstSchema.value, op });
14585
+ }
14580
14586
  const handleAdd = () => {
14581
14587
  const item = dicColumn.value.find((item2) => {
14582
14588
  return item2.disabled === false;
14583
14589
  });
14584
- schemasCurrent.push({ field: (item == null ? void 0 : item.value) || "", op: "eq" });
14590
+ const column = props2.schemas.find((schema) => {
14591
+ return schema.field === item.value;
14592
+ });
14593
+ const op = column.type === "string" && /select/i.test(column.component) ? "ct" : "eq";
14594
+ schemasCurrent.push({ field: (item == null ? void 0 : item.value) || "", op });
14585
14595
  };
14586
14596
  const handleMinus = (index2) => {
14587
14597
  schemasCurrent.splice(index2, 1);
@@ -14594,6 +14604,11 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
14594
14604
  });
14595
14605
  schema.op = "eq";
14596
14606
  };
14607
+ const handlSetValNull = (schema) => {
14608
+ if (schema.op === "nl") {
14609
+ schema[schema.field] = "";
14610
+ }
14611
+ };
14597
14612
  const getSearchType = (field) => {
14598
14613
  const type = getTypeByField(field);
14599
14614
  switch (type) {
@@ -14605,6 +14620,8 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
14605
14620
  return searchTypeDate;
14606
14621
  case "select":
14607
14622
  return searchTypeSelect;
14623
+ case "stringSelect":
14624
+ return stringSearchTypeSelect;
14608
14625
  }
14609
14626
  };
14610
14627
  const getComponent = (field) => {
@@ -14617,8 +14634,9 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
14617
14634
  const column = props2.schemas.find((schema) => {
14618
14635
  return schema.field === field;
14619
14636
  });
14637
+ const stringSelect = column.type === "string" && /select/i.test(column.component);
14620
14638
  const type = (column == null ? void 0 : column.type) || "string";
14621
- return type;
14639
+ return stringSelect ? "stringSelect" : type;
14622
14640
  };
14623
14641
  const getComponentPropsByField = (field) => {
14624
14642
  const column = props2.schemas.find((schema) => {
@@ -14627,7 +14645,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
14627
14645
  return (column == null ? void 0 : column.componentProps) || {};
14628
14646
  };
14629
14647
  const getSearchFrom = () => {
14630
- let form2 = {};
14648
+ let form = {};
14631
14649
  schemasCurrent.forEach((item) => {
14632
14650
  let temp = {};
14633
14651
  if (item.op === "bt") {
@@ -14642,13 +14660,13 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
14642
14660
  [`${item.field}-op`]: item.op
14643
14661
  };
14644
14662
  }
14645
- form2 = { ...form2, ...temp };
14663
+ form = { ...form, ...temp };
14646
14664
  });
14647
- return form2;
14665
+ return form;
14648
14666
  };
14649
14667
  const resetFields = () => {
14650
14668
  schemasCurrent.splice(0, schemasCurrent.length);
14651
- schemasCurrent.push({ field: props2.schemas[0].field });
14669
+ schemasCurrent.push({ field: dicColumn.value[0].field });
14652
14670
  formRef.value.resetFields();
14653
14671
  };
14654
14672
  expose({
@@ -14708,13 +14726,17 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
14708
14726
  "onUpdate:value": ($event) => schema.op = $event,
14709
14727
  style: { "width": "120px" },
14710
14728
  options: getSearchType(schema == null ? void 0 : schema.field),
14711
- defaultValue: ((_a2 = getSearchType(schema == null ? void 0 : schema.field)[0]) == null ? void 0 : _a2.value) || ""
14712
- }, null, 8, ["value", "onUpdate:value", "options", "defaultValue"])
14729
+ defaultValue: ((_a2 = getSearchType(schema == null ? void 0 : schema.field)[0]) == null ? void 0 : _a2.value) || "",
14730
+ onChange: ($event) => handlSetValNull(schema)
14731
+ }, null, 8, ["value", "onUpdate:value", "options", "defaultValue", "onChange"])
14713
14732
  ];
14714
14733
  }),
14715
14734
  _: 2
14716
14735
  }, 1032, ["name"]),
14717
- createVNode(unref(FormItem), { class: "shy-ui-advanced-search-item-value" }, {
14736
+ schema.op !== "nl" ? (openBlock(), createBlock(unref(FormItem), {
14737
+ key: 0,
14738
+ class: "shy-ui-advanced-search-item-value"
14739
+ }, {
14718
14740
  default: withCtx(() => [
14719
14741
  getTypeByField(schema == null ? void 0 : schema.field) === "number" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
14720
14742
  schema.op === "bt" ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
@@ -14779,11 +14801,17 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
14779
14801
  }, null, 8, ["value", "onUpdate:value"]))
14780
14802
  ], 64)) : getTypeByField(schema == null ? void 0 : schema.field) === "select" ? (openBlock(), createBlock(unref(FormItem), { key: 2 }, {
14781
14803
  default: withCtx(() => [
14782
- createVNode(unref(Select), mergeProps({
14804
+ getComponent(schema.field) === "ApiSelect" ? (openBlock(), createBlock(ApiSelect, mergeProps({
14805
+ key: 0,
14806
+ value: schema[`${schema.field}`],
14807
+ "onUpdate:value": ($event) => schema[`${schema.field}`] = $event,
14808
+ valueModifiers: { number: true }
14809
+ }, getComponentPropsByField(schema.field)), null, 16, ["value", "onUpdate:value"])) : (openBlock(), createBlock(unref(Select), mergeProps({
14810
+ key: 1,
14783
14811
  value: schema[`${schema.field}`],
14784
14812
  "onUpdate:value": ($event) => schema[`${schema.field}`] = $event,
14785
14813
  valueModifiers: { number: true }
14786
- }, getComponentPropsByField(schema.field)), null, 16, ["value", "onUpdate:value"])
14814
+ }, getComponentPropsByField(schema.field)), null, 16, ["value", "onUpdate:value"]))
14787
14815
  ]),
14788
14816
  _: 2
14789
14817
  }, 1024)) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [
@@ -14791,15 +14819,20 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
14791
14819
  key: 0,
14792
14820
  value: schema[schema.field],
14793
14821
  "onUpdate:value": ($event) => schema[schema.field] = $event
14794
- }, getComponentPropsByField(schema.field)), null, 16, ["value", "onUpdate:value"])) : (openBlock(), createBlock(unref(Select), mergeProps({
14822
+ }, getComponentPropsByField(schema.field)), null, 16, ["value", "onUpdate:value"])) : getComponent(schema.field) === "ApiSelect" ? (openBlock(), createBlock(ApiSelect, mergeProps({
14795
14823
  key: 1,
14824
+ value: schema[`${schema.field}`],
14825
+ "onUpdate:value": ($event) => schema[`${schema.field}`] = $event,
14826
+ valueModifiers: { number: true }
14827
+ }, getComponentPropsByField(schema.field)), null, 16, ["value", "onUpdate:value"])) : (openBlock(), createBlock(unref(Select), mergeProps({
14828
+ key: 2,
14796
14829
  value: schema[schema.field],
14797
14830
  "onUpdate:value": ($event) => schema[schema.field] = $event
14798
14831
  }, getComponentPropsByField(schema.field)), null, 16, ["value", "onUpdate:value"]))
14799
14832
  ], 64))
14800
14833
  ]),
14801
14834
  _: 2
14802
- }, 1024),
14835
+ }, 1024)) : createCommentVNode("", true),
14803
14836
  schemasCurrent.length !== 1 ? (openBlock(), createElementBlock("div", _hoisted_7, [
14804
14837
  createElementVNode("div", {
14805
14838
  style: { "position": "absolute", "width": "14px", "height": "14px", "left": "0", "right": "0", "top": "0", "bottom": "0" },
@@ -15547,7 +15580,7 @@ const _sfc_main$q = defineComponent({
15547
15580
  AdvancedSearch: _sfc_main$v
15548
15581
  },
15549
15582
  emits: ["ensure"],
15550
- setup(props2, { emit }) {
15583
+ setup(_, { emit }) {
15551
15584
  const advancedSearchRef = ref();
15552
15585
  const table2 = useTableContext();
15553
15586
  const setStyle2 = () => {
@@ -15733,8 +15766,8 @@ const _sfc_main$p = defineComponent({
15733
15766
  };
15734
15767
  }
15735
15768
  });
15736
- const TableGlobalSearch_vue_vue_type_style_index_0_scoped_25de0cfe_lang = "";
15737
- const _withScopeId = (n) => (pushScopeId("data-v-25de0cfe"), n = n(), popScopeId(), n);
15769
+ const TableGlobalSearch_vue_vue_type_style_index_0_scoped_bf2b3580_lang = "";
15770
+ const _withScopeId = (n) => (pushScopeId("data-v-bf2b3580"), n = n(), popScopeId(), n);
15738
15771
  const _hoisted_1$e = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, "搜索全部", -1));
15739
15772
  const _hoisted_2$4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, "搜索特定字段", -1));
15740
15773
  const _hoisted_3$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, null, -1));
@@ -15792,7 +15825,7 @@ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
15792
15825
  ])
15793
15826
  ], 4);
15794
15827
  }
15795
- const TableGlobalSearch = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$h], ["__scopeId", "data-v-25de0cfe"]]);
15828
+ const TableGlobalSearch = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$h], ["__scopeId", "data-v-bf2b3580"]]);
15796
15829
  const _sfc_main$o = defineComponent({
15797
15830
  components: {
15798
15831
  TableAdvancedSearch,
@@ -16304,12 +16337,12 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
16304
16337
  const _sfc_main$m = defineComponent({
16305
16338
  name: "TableAction",
16306
16339
  components: {
16307
- MoreOutlined: MoreOutlined$1,
16308
16340
  Icon: Icon2,
16309
16341
  PopConfirmButton: _sfc_main$U,
16310
16342
  Divider: Divider$1,
16311
16343
  Dropdown: _sfc_main$n,
16312
- Tooltip
16344
+ Tooltip,
16345
+ MoreOutlined: MoreOutlined$1
16313
16346
  },
16314
16347
  props: {
16315
16348
  actions: {
@@ -16418,7 +16451,8 @@ const _sfc_main$m = defineComponent({
16418
16451
  getDropdownList,
16419
16452
  getAlign,
16420
16453
  onCellClick,
16421
- getTooltip
16454
+ getTooltip,
16455
+ MoreOutlined: MoreOutlined$1
16422
16456
  };
16423
16457
  }
16424
16458
  });
@@ -22529,6 +22563,7 @@ export {
22529
22563
  searchTypeNumber,
22530
22564
  searchTypeSelect,
22531
22565
  searchTypeString,
22566
+ stringSearchTypeSelect,
22532
22567
  treeEmits,
22533
22568
  treeProps,
22534
22569
  useColumns,
package/es/style.css CHANGED
@@ -25486,7 +25486,7 @@ span.iconify {
25486
25486
  }
25487
25487
  .shy-basic-table-header__toolbar > * {
25488
25488
  margin-right: 8px;
25489
- }.shy-basic-table-global-search[data-v-25de0cfe] {
25489
+ }.shy-basic-table-global-search[data-v-bf2b3580] {
25490
25490
  position: absolute;
25491
25491
  top: 40px;
25492
25492
  right: 131px;
@@ -25498,7 +25498,7 @@ span.iconify {
25498
25498
  border: 1px solid #ebebeb;
25499
25499
  padding: 10px;
25500
25500
  }
25501
- .shy-basic-table-global-search-item-global[data-v-25de0cfe] {
25501
+ .shy-basic-table-global-search-item-global[data-v-bf2b3580] {
25502
25502
  height: 32px;
25503
25503
  line-height: 32px;
25504
25504
  font-size: 14px;
@@ -25509,7 +25509,7 @@ span.iconify {
25509
25509
  align-items: center;
25510
25510
  justify-content: space-between;
25511
25511
  }
25512
- .shy-basic-table-global-search-item-special[data-v-25de0cfe] {
25512
+ .shy-basic-table-global-search-item-special[data-v-bf2b3580] {
25513
25513
  height: 32px;
25514
25514
  line-height: 32px;
25515
25515
  font-size: 14px;
@@ -25520,10 +25520,10 @@ span.iconify {
25520
25520
  align-items: center;
25521
25521
  justify-content: space-between;
25522
25522
  }
25523
- .shy-basic-table-global-search-checkbox-wrapper[data-v-25de0cfe] {
25523
+ .shy-basic-table-global-search-checkbox-wrapper[data-v-bf2b3580] {
25524
25524
  padding: 0 8px;
25525
25525
  }
25526
- .shy-basic-table-global-search .selected-bg[data-v-25de0cfe] {
25526
+ .shy-basic-table-global-search .selected-bg[data-v-bf2b3580] {
25527
25527
  background-color: #ebf1ff;
25528
25528
  }.shy-basic-table-action {
25529
25529
  display: flex;
@@ -18,4 +18,10 @@ export declare const searchTypeSelect: {
18
18
  label: string;
19
19
  value: string;
20
20
  }[];
21
- export declare const getGlobalAdvancedType: (fieldList: any, value: any) => {};
21
+ export declare const stringSearchTypeSelect: {
22
+ label: string;
23
+ value: string;
24
+ }[];
25
+ export declare const getGlobalAdvancedType: (fieldList: any, value: any) => {
26
+ [key: string]: unknown;
27
+ };
@@ -125,13 +125,13 @@ declare const _sfc_main: import("vue").DefineComponent<{
125
125
  prefix: string;
126
126
  transition: string;
127
127
  duration: number;
128
+ decimal: string;
128
129
  startVal: number;
129
130
  endVal: number;
130
131
  autoplay: boolean;
131
132
  decimals: number;
132
133
  suffix: string;
133
134
  separator: string;
134
- decimal: string;
135
135
  useEasing: boolean;
136
136
  }>;
137
137
  export default _sfc_main;
@@ -1,7 +1,8 @@
1
+ import { schemasAdvancedSearch } from '../types/table';
1
2
  declare const _sfc_main: import("vue").DefineComponent<{
2
3
  schemasAdvancedSearch: {
3
4
  default: () => any[];
4
- type: ArrayConstructor;
5
+ type: PropType<schemasAdvancedSearch[]>;
5
6
  };
6
7
  }, {
7
8
  handleEnsure: () => void;
@@ -16,11 +17,11 @@ declare const _sfc_main: import("vue").DefineComponent<{
16
17
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "ensure"[], "ensure", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
17
18
  schemasAdvancedSearch: {
18
19
  default: () => any[];
19
- type: ArrayConstructor;
20
+ type: PropType<schemasAdvancedSearch[]>;
20
21
  };
21
22
  }>> & {
22
23
  onEnsure?: (...args: any[]) => any;
23
24
  }, {
24
- schemasAdvancedSearch: unknown[];
25
+ schemasAdvancedSearch: schemasAdvancedSearch[];
25
26
  }>;
26
27
  export default _sfc_main;
@@ -1,3 +1,4 @@
1
+ import type { schemasAdvancedSearch } from '../types/table';
1
2
  export declare enum OperatorEnum {
2
3
  'eq' = "\u7B49\u4E8E",
3
4
  'ne' = "\u4E0D\u7B49\u4E8E",
@@ -15,7 +16,7 @@ export declare const useAdvancedSearch: ({ getProps, reload }: {
15
16
  reload: any;
16
17
  }) => {
17
18
  isVisibleAdvancedSearch: import("vue").Ref<boolean>;
18
- schemasAdvancedSearch: import("vue").ComputedRef<any>;
19
+ schemasAdvancedSearch: import("vue").ComputedRef<schemasAdvancedSearch[]>;
19
20
  openAdvancedSearch: () => void;
20
21
  closeAdvancedSearch: () => void;
21
22
  handleAdvancedEnsure: (form: any) => void;
@@ -31,8 +32,8 @@ export declare const useAdvancedSearch: ({ getProps, reload }: {
31
32
  getGlobalSearchValue: () => string;
32
33
  setCurSearchParams: (value: any) => void;
33
34
  getCurSearchParams: () => {};
34
- schemasAdvancedSearchString: import("vue").ComputedRef<any>;
35
- schemasAdvancedSearchGlobal: import("vue").ComputedRef<any>;
35
+ schemasAdvancedSearchString: import("vue").ComputedRef<schemasAdvancedSearch[]>;
36
+ schemasAdvancedSearchGlobal: import("vue").ComputedRef<schemasAdvancedSearch[]>;
36
37
  };
37
38
  export declare const useAdvancedSearchKv: () => {
38
39
  getKvOperator: () => {
@@ -388,3 +388,13 @@ export declare type ColumnChangeParam = {
388
388
  export interface InnerHandlers {
389
389
  onColumnsChange: (data: ColumnChangeParam[]) => void;
390
390
  }
391
+ export declare type schemasAdvancedSearch = {
392
+ label: string;
393
+ field: number | string;
394
+ type?: 'number' | 'string' | 'date' | 'select';
395
+ component?: ComponentType;
396
+ componentProps?: object;
397
+ sortShow?: boolean;
398
+ globalShow?: boolean;
399
+ advancedShow?: boolean;
400
+ };
@@ -69,11 +69,11 @@ declare const _sfc_main: import("vue").DefineComponent<{
69
69
  search: boolean;
70
70
  toolbar: boolean;
71
71
  loading: import("@shy-plugins/utils").BuildPropType<BooleanConstructor, unknown, unknown>;
72
+ fieldNames: undefined;
73
+ searchValue: string;
72
74
  helpMessage: import("@shy-plugins/utils").BuildPropType<PropType<string | string[]>, unknown, unknown>;
73
75
  selectedKeys: KeyType[];
74
76
  filterFn: (searchValue: any, node: TreeItem, fieldNames: FieldNames) => boolean;
75
- fieldNames: undefined;
76
- searchValue: string;
77
77
  treeData: import("ant-design-vue/es/tree").DataNode[];
78
78
  renderIcon: (params: Recordable<any>) => string;
79
79
  checkStrictly: boolean;
package/lib/index.js CHANGED
@@ -4002,10 +4002,10 @@ const _sfc_main$1f = vue.defineComponent({
4002
4002
  emitData.value = args;
4003
4003
  }
4004
4004
  const filterOption = (input, option) => {
4005
- var _a2, _b;
4005
+ var _a2, _b, _c;
4006
4006
  const label = ((_b = (_a2 = attrs.value) == null ? void 0 : _a2.fieldNames) == null ? void 0 : _b.label) || "label";
4007
- console.log("label", label);
4008
- return option[label].toLowerCase().indexOf(input.toLowerCase()) >= 0;
4007
+ if (typeof option[label] === "string")
4008
+ return ((_c = option[label]) == null ? void 0 : _c.toLowerCase().indexOf(input.toLowerCase())) >= 0;
4009
4009
  };
4010
4010
  return {
4011
4011
  state,
@@ -14503,15 +14503,16 @@ const searchType = [
14503
14503
  }
14504
14504
  ];
14505
14505
  const searchTypeNumber = searchType.filter((item) => {
14506
- return ["eq", "gt", "ge", "lt", "le", "bt"].includes(item.value);
14506
+ return ["eq", "gt", "ge", "lt", "le", "bt", "nl"].includes(item.value);
14507
14507
  });
14508
14508
  const searchTypeString = searchType.filter((item) => {
14509
- return ["eq", "ct", "sw", "ew"].includes(item.value);
14509
+ return ["eq", "ct", "sw", "ew", "nl"].includes(item.value);
14510
14510
  });
14511
14511
  const searchTypeDate = searchType.filter((item) => {
14512
- return ["eq", "gt", "ge", "lt", "le", "bt"].includes(item.value);
14512
+ return ["eq", "gt", "ge", "lt", "le", "bt", "nl"].includes(item.value);
14513
14513
  });
14514
14514
  const searchTypeSelect = [{ label: "等于", value: "eq" }];
14515
+ const stringSearchTypeSelect = [{ label: "包含", value: "ct" }];
14515
14516
  const getGlobalAdvancedType = (fieldList, value) => {
14516
14517
  const temp = {};
14517
14518
  fieldList.forEach((field) => {
@@ -14534,7 +14535,7 @@ const _hoisted_5$1 = {
14534
14535
  };
14535
14536
  const _hoisted_6 = /* @__PURE__ */ vue.createElementVNode("div", { style: { "flex": "0", "width": "40px", "margin-right": "8px" } }, " 至 ", -1);
14536
14537
  const _hoisted_7 = {
14537
- key: 0,
14538
+ key: 1,
14538
14539
  style: { "margin-left": "8px", "cursor": "pointer", "position": "relative" },
14539
14540
  class: "shy-ui-advanced-minus-icon"
14540
14541
  };
@@ -14542,48 +14543,57 @@ const _hoisted_8 = ["onClick"];
14542
14543
  const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
14543
14544
  __name: "AdvancedSearch",
14544
14545
  props: {
14545
- schemas: {
14546
- default: () => [
14547
- {
14548
- label: "姓名",
14549
- field: "name"
14550
- },
14551
- {
14552
- label: "年龄",
14553
- field: "age",
14554
- type: "number"
14555
- },
14556
- { label: "生日", field: "birth", type: "date" }
14557
- ]
14558
- }
14546
+ schemas: { default: () => [
14547
+ {
14548
+ label: "姓名",
14549
+ field: "name",
14550
+ advancedShow: false
14551
+ },
14552
+ {
14553
+ label: "年龄",
14554
+ field: "age",
14555
+ type: "number"
14556
+ },
14557
+ { label: "生日", field: "birth", type: "date" }
14558
+ ] }
14559
14559
  },
14560
14560
  setup(__props, { expose }) {
14561
14561
  const props2 = __props;
14562
- vue.reactive({});
14563
14562
  const advancedSearchRef = vue.ref();
14564
14563
  const formRef = vue.ref();
14565
14564
  const schemasCurrent = vue.reactive([]);
14566
- if (props2.schemas.length !== 0)
14567
- schemasCurrent.push({ field: props2.schemas[0].field, op: "eq" });
14568
14565
  const dicColumn = vue.computed(() => {
14569
14566
  const temp = [];
14570
14567
  props2.schemas.forEach((schama) => {
14568
+ if (!schama.advancedShow)
14569
+ return;
14571
14570
  const flag = schemasCurrent.find((item) => {
14572
14571
  return item.field === schama.field;
14573
14572
  });
14574
14573
  temp.push({
14575
14574
  label: schama.label,
14576
14575
  value: schama.field,
14577
- disabled: !!flag
14576
+ disabled: !!flag,
14577
+ type: schama.type,
14578
+ component: schama.component
14578
14579
  });
14579
14580
  });
14580
14581
  return temp;
14581
14582
  });
14583
+ if (props2.schemas.length !== 0) {
14584
+ const firstSchema = dicColumn.value[0];
14585
+ const op = firstSchema.type === "string" && /select/i.test(firstSchema.component) ? "ct" : "eq";
14586
+ schemasCurrent.push({ field: firstSchema.value, op });
14587
+ }
14582
14588
  const handleAdd = () => {
14583
14589
  const item = dicColumn.value.find((item2) => {
14584
14590
  return item2.disabled === false;
14585
14591
  });
14586
- schemasCurrent.push({ field: (item == null ? void 0 : item.value) || "", op: "eq" });
14592
+ const column = props2.schemas.find((schema) => {
14593
+ return schema.field === item.value;
14594
+ });
14595
+ const op = column.type === "string" && /select/i.test(column.component) ? "ct" : "eq";
14596
+ schemasCurrent.push({ field: (item == null ? void 0 : item.value) || "", op });
14587
14597
  };
14588
14598
  const handleMinus = (index2) => {
14589
14599
  schemasCurrent.splice(index2, 1);
@@ -14596,6 +14606,11 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
14596
14606
  });
14597
14607
  schema.op = "eq";
14598
14608
  };
14609
+ const handlSetValNull = (schema) => {
14610
+ if (schema.op === "nl") {
14611
+ schema[schema.field] = "";
14612
+ }
14613
+ };
14599
14614
  const getSearchType = (field) => {
14600
14615
  const type = getTypeByField(field);
14601
14616
  switch (type) {
@@ -14607,6 +14622,8 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
14607
14622
  return searchTypeDate;
14608
14623
  case "select":
14609
14624
  return searchTypeSelect;
14625
+ case "stringSelect":
14626
+ return stringSearchTypeSelect;
14610
14627
  }
14611
14628
  };
14612
14629
  const getComponent = (field) => {
@@ -14619,8 +14636,9 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
14619
14636
  const column = props2.schemas.find((schema) => {
14620
14637
  return schema.field === field;
14621
14638
  });
14639
+ const stringSelect = column.type === "string" && /select/i.test(column.component);
14622
14640
  const type = (column == null ? void 0 : column.type) || "string";
14623
- return type;
14641
+ return stringSelect ? "stringSelect" : type;
14624
14642
  };
14625
14643
  const getComponentPropsByField = (field) => {
14626
14644
  const column = props2.schemas.find((schema) => {
@@ -14629,7 +14647,7 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
14629
14647
  return (column == null ? void 0 : column.componentProps) || {};
14630
14648
  };
14631
14649
  const getSearchFrom = () => {
14632
- let form2 = {};
14650
+ let form = {};
14633
14651
  schemasCurrent.forEach((item) => {
14634
14652
  let temp = {};
14635
14653
  if (item.op === "bt") {
@@ -14644,13 +14662,13 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
14644
14662
  [`${item.field}-op`]: item.op
14645
14663
  };
14646
14664
  }
14647
- form2 = { ...form2, ...temp };
14665
+ form = { ...form, ...temp };
14648
14666
  });
14649
- return form2;
14667
+ return form;
14650
14668
  };
14651
14669
  const resetFields = () => {
14652
14670
  schemasCurrent.splice(0, schemasCurrent.length);
14653
- schemasCurrent.push({ field: props2.schemas[0].field });
14671
+ schemasCurrent.push({ field: dicColumn.value[0].field });
14654
14672
  formRef.value.resetFields();
14655
14673
  };
14656
14674
  expose({
@@ -14710,13 +14728,17 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
14710
14728
  "onUpdate:value": ($event) => schema.op = $event,
14711
14729
  style: { "width": "120px" },
14712
14730
  options: getSearchType(schema == null ? void 0 : schema.field),
14713
- defaultValue: ((_a2 = getSearchType(schema == null ? void 0 : schema.field)[0]) == null ? void 0 : _a2.value) || ""
14714
- }, null, 8, ["value", "onUpdate:value", "options", "defaultValue"])
14731
+ defaultValue: ((_a2 = getSearchType(schema == null ? void 0 : schema.field)[0]) == null ? void 0 : _a2.value) || "",
14732
+ onChange: ($event) => handlSetValNull(schema)
14733
+ }, null, 8, ["value", "onUpdate:value", "options", "defaultValue", "onChange"])
14715
14734
  ];
14716
14735
  }),
14717
14736
  _: 2
14718
14737
  }, 1032, ["name"]),
14719
- vue.createVNode(vue.unref(antDesignVue.FormItem), { class: "shy-ui-advanced-search-item-value" }, {
14738
+ schema.op !== "nl" ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.FormItem), {
14739
+ key: 0,
14740
+ class: "shy-ui-advanced-search-item-value"
14741
+ }, {
14720
14742
  default: vue.withCtx(() => [
14721
14743
  getTypeByField(schema == null ? void 0 : schema.field) === "number" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
14722
14744
  schema.op === "bt" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, [
@@ -14781,11 +14803,17 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
14781
14803
  }, null, 8, ["value", "onUpdate:value"]))
14782
14804
  ], 64)) : getTypeByField(schema == null ? void 0 : schema.field) === "select" ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.FormItem), { key: 2 }, {
14783
14805
  default: vue.withCtx(() => [
14784
- vue.createVNode(vue.unref(antDesignVue.Select), vue.mergeProps({
14806
+ getComponent(schema.field) === "ApiSelect" ? (vue.openBlock(), vue.createBlock(ApiSelect, vue.mergeProps({
14807
+ key: 0,
14808
+ value: schema[`${schema.field}`],
14809
+ "onUpdate:value": ($event) => schema[`${schema.field}`] = $event,
14810
+ valueModifiers: { number: true }
14811
+ }, getComponentPropsByField(schema.field)), null, 16, ["value", "onUpdate:value"])) : (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Select), vue.mergeProps({
14812
+ key: 1,
14785
14813
  value: schema[`${schema.field}`],
14786
14814
  "onUpdate:value": ($event) => schema[`${schema.field}`] = $event,
14787
14815
  valueModifiers: { number: true }
14788
- }, getComponentPropsByField(schema.field)), null, 16, ["value", "onUpdate:value"])
14816
+ }, getComponentPropsByField(schema.field)), null, 16, ["value", "onUpdate:value"]))
14789
14817
  ]),
14790
14818
  _: 2
14791
14819
  }, 1024)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
@@ -14793,15 +14821,20 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
14793
14821
  key: 0,
14794
14822
  value: schema[schema.field],
14795
14823
  "onUpdate:value": ($event) => schema[schema.field] = $event
14796
- }, getComponentPropsByField(schema.field)), null, 16, ["value", "onUpdate:value"])) : (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Select), vue.mergeProps({
14824
+ }, getComponentPropsByField(schema.field)), null, 16, ["value", "onUpdate:value"])) : getComponent(schema.field) === "ApiSelect" ? (vue.openBlock(), vue.createBlock(ApiSelect, vue.mergeProps({
14797
14825
  key: 1,
14826
+ value: schema[`${schema.field}`],
14827
+ "onUpdate:value": ($event) => schema[`${schema.field}`] = $event,
14828
+ valueModifiers: { number: true }
14829
+ }, getComponentPropsByField(schema.field)), null, 16, ["value", "onUpdate:value"])) : (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Select), vue.mergeProps({
14830
+ key: 2,
14798
14831
  value: schema[schema.field],
14799
14832
  "onUpdate:value": ($event) => schema[schema.field] = $event
14800
14833
  }, getComponentPropsByField(schema.field)), null, 16, ["value", "onUpdate:value"]))
14801
14834
  ], 64))
14802
14835
  ]),
14803
14836
  _: 2
14804
- }, 1024),
14837
+ }, 1024)) : vue.createCommentVNode("", true),
14805
14838
  schemasCurrent.length !== 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
14806
14839
  vue.createElementVNode("div", {
14807
14840
  style: { "position": "absolute", "width": "14px", "height": "14px", "left": "0", "right": "0", "top": "0", "bottom": "0" },
@@ -15549,7 +15582,7 @@ const _sfc_main$q = vue.defineComponent({
15549
15582
  AdvancedSearch: _sfc_main$v
15550
15583
  },
15551
15584
  emits: ["ensure"],
15552
- setup(props2, { emit }) {
15585
+ setup(_, { emit }) {
15553
15586
  const advancedSearchRef = vue.ref();
15554
15587
  const table2 = useTableContext();
15555
15588
  const setStyle2 = () => {
@@ -15735,8 +15768,8 @@ const _sfc_main$p = vue.defineComponent({
15735
15768
  };
15736
15769
  }
15737
15770
  });
15738
- const TableGlobalSearch_vue_vue_type_style_index_0_scoped_25de0cfe_lang = "";
15739
- const _withScopeId = (n) => (vue.pushScopeId("data-v-25de0cfe"), n = n(), vue.popScopeId(), n);
15771
+ const TableGlobalSearch_vue_vue_type_style_index_0_scoped_bf2b3580_lang = "";
15772
+ const _withScopeId = (n) => (vue.pushScopeId("data-v-bf2b3580"), n = n(), vue.popScopeId(), n);
15740
15773
  const _hoisted_1$e = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", null, "搜索全部", -1));
15741
15774
  const _hoisted_2$4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", null, "搜索特定字段", -1));
15742
15775
  const _hoisted_3$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", null, null, -1));
@@ -15794,7 +15827,7 @@ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
15794
15827
  ])
15795
15828
  ], 4);
15796
15829
  }
15797
- const TableGlobalSearch = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$h], ["__scopeId", "data-v-25de0cfe"]]);
15830
+ const TableGlobalSearch = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$h], ["__scopeId", "data-v-bf2b3580"]]);
15798
15831
  const _sfc_main$o = vue.defineComponent({
15799
15832
  components: {
15800
15833
  TableAdvancedSearch,
@@ -16306,12 +16339,12 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
16306
16339
  const _sfc_main$m = vue.defineComponent({
16307
16340
  name: "TableAction",
16308
16341
  components: {
16309
- MoreOutlined: MoreOutlined$1,
16310
16342
  Icon: Icon2,
16311
16343
  PopConfirmButton: _sfc_main$U,
16312
16344
  Divider: antDesignVue.Divider,
16313
16345
  Dropdown: _sfc_main$n,
16314
- Tooltip: antDesignVue.Tooltip
16346
+ Tooltip: antDesignVue.Tooltip,
16347
+ MoreOutlined: MoreOutlined$1
16315
16348
  },
16316
16349
  props: {
16317
16350
  actions: {
@@ -16420,7 +16453,8 @@ const _sfc_main$m = vue.defineComponent({
16420
16453
  getDropdownList,
16421
16454
  getAlign,
16422
16455
  onCellClick,
16423
- getTooltip
16456
+ getTooltip,
16457
+ MoreOutlined: MoreOutlined$1
16424
16458
  };
16425
16459
  }
16426
16460
  });
@@ -22530,6 +22564,7 @@ exports.searchTypeDate = searchTypeDate;
22530
22564
  exports.searchTypeNumber = searchTypeNumber;
22531
22565
  exports.searchTypeSelect = searchTypeSelect;
22532
22566
  exports.searchTypeString = searchTypeString;
22567
+ exports.stringSearchTypeSelect = stringSearchTypeSelect;
22533
22568
  exports.treeEmits = treeEmits;
22534
22569
  exports.treeProps = treeProps;
22535
22570
  exports.useColumns = useColumns;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "3h1-ui",
3
- "version": "2.12.0-beta.2",
3
+ "version": "2.12.0-beta.3",
4
4
  "description": "",
5
5
  "module": "",
6
6
  "main": "index.ts",