hy-dispatch-ui-v3 0.1.3 → 0.1.4

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/dist/tailwind.css CHANGED
@@ -724,6 +724,14 @@ video {
724
724
  height: 0px;
725
725
  }
726
726
 
727
+ .h-\[12px\] {
728
+ height: 12px;
729
+ }
730
+
731
+ .h-\[32px\] {
732
+ height: 32px;
733
+ }
734
+
727
735
  .h-\[364px\] {
728
736
  height: 364px;
729
737
  }
@@ -768,6 +776,10 @@ video {
768
776
  width: 1.25rem;
769
777
  }
770
778
 
779
+ .w-\[12px\] {
780
+ width: 12px;
781
+ }
782
+
771
783
  .w-\[160px\] {
772
784
  width: 160px;
773
785
  }
@@ -1,4 +1,4 @@
1
- import { defineComponent, useTemplateRef, openBlock, createElementBlock, createCommentVNode, createElementVNode, createBlock, unref, createVNode, withCtx, toDisplayString, withKeys, renderSlot, normalizeClass, createSlots, renderList, normalizeProps, guardReactiveProps, mergeProps, Fragment, withModifiers } from 'vue';
1
+ import { defineComponent, useTemplateRef, resolveComponent, openBlock, createElementBlock, createCommentVNode, createElementVNode, createBlock, unref, createVNode, withCtx, toDisplayString, withKeys, renderSlot, normalizeClass, createSlots, renderList, normalizeProps, guardReactiveProps, mergeProps, Fragment, withModifiers } from 'vue';
2
2
  import { ElIcon, ElInput, ElButton, ElTable, ElTableColumn, ElDropdown, ElDropdownMenu, ElDropdownItem, ElPagination } from 'element-plus';
3
3
  import { Filter, Search } from '@element-plus/icons-vue';
4
4
  import { AppTooltip } from '../appTooltip/index.mjs';
@@ -6,6 +6,7 @@ import { operatorFilterHandler, operatorClickHandler, operatorDisabledHandler, o
6
6
  import { useAppTableSearch } from './js/search.mjs';
7
7
  import _sfc_main$1 from './cpns/columnSelect.vue.mjs';
8
8
  import { useMixins } from '../../hooks/useMixins.mjs';
9
+ import { AppButton } from '../appButton/index.mjs';
9
10
  import { AppSearch } from '../appSearch/index.mjs';
10
11
  import { parseRem } from '../../utils/adaptive.mjs';
11
12
  import { AppIconBox } from '../appIconBox/index.mjs';
@@ -89,6 +90,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
89
90
  default: "",
90
91
  required: false
91
92
  },
93
+ filterModel: {
94
+ type: Object,
95
+ default: () => ({})
96
+ },
92
97
  filterColumns: {
93
98
  // 表格筛选配置
94
99
  type: Array,
@@ -177,8 +182,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
177
182
  onTableSelectHandler,
178
183
  // useAppTableSearch
179
184
  // 表单查询
180
- formModel,
181
- formColumns,
182
185
  totalElements,
183
186
  showFilter,
184
187
  getData,
@@ -216,6 +219,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
216
219
  clearSelectedList
217
220
  });
218
221
  return (_ctx, _cache) => {
222
+ const _component_AppIcon = resolveComponent("AppIcon");
219
223
  return openBlock(), createElementBlock(
220
224
  "div",
221
225
  {
@@ -234,9 +238,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
234
238
  "origin-columns": props.tableColumns,
235
239
  onConfirm: unref(onTableColumnsSelectHandler)
236
240
  }, null, 8, ["columns", "columns-editable", "origin-columns", "onConfirm"])) : createCommentVNode("v-if", true),
237
- unref(formColumns).length > 0 ? (openBlock(), createElementBlock("div", {
241
+ __props.filterColumns.length > 0 ? (openBlock(), createElementBlock("div", {
238
242
  key: 1,
239
- class: "flex items-center gap-[10px] clickBox px-3 select-none rounded hover:bg-background-2",
243
+ class: "h-[32px] flex items-center gap-[10px] clickBox px-3 select-none rounded hover:bg-background-2",
240
244
  onClick: unref(switchShowFilter)
241
245
  }, [
242
246
  createVNode(unref(ElIcon), { size: "12" }, {
@@ -256,8 +260,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
256
260
  ], 8, ["onClick"])) : createCommentVNode("v-if", true),
257
261
  unref(searchPlaceholder) ? (openBlock(), createBlock(unref(ElInput), {
258
262
  key: 2,
259
- modelValue: unref(formModel).query,
260
- "onUpdate:modelValue": ($event) => unref(formModel).query = $event,
263
+ modelValue: __props.filterModel.query,
264
+ "onUpdate:modelValue": ($event) => __props.filterModel.query = $event,
261
265
  class: "w-[160px]",
262
266
  placeholder: unref(t)("table.searchFor", [unref(searchPlaceholder)]),
263
267
  onKeydown: withKeys(unref(onSearchQueryHandler), ["enter"])
@@ -270,7 +274,21 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
270
274
  ]),
271
275
  _: 1
272
276
  /* STABLE */
273
- }, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onKeydown"])) : createCommentVNode("v-if", true)
277
+ }, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onKeydown"])) : (openBlock(), createBlock(unref(AppButton), {
278
+ key: 3,
279
+ type: "primary",
280
+ onClick: ($event) => unref(getData)()
281
+ }, {
282
+ default: withCtx(() => [
283
+ createVNode(_component_AppIcon, {
284
+ class: "w-[12px] h-[12px]",
285
+ "svg-name": "refres"
286
+ })
287
+ ]),
288
+ _: 1
289
+ /* STABLE */
290
+ }, 8, ["onClick"])),
291
+ renderSlot(_ctx.$slots, "operator-right-box")
274
292
  ]),
275
293
  _ctx.$slots["operator-left-box"] ? (openBlock(), createElementBlock("div", {
276
294
  key: 0,
@@ -280,12 +298,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
280
298
  ])) : createCommentVNode("v-if", true)
281
299
  ]),
282
300
  createCommentVNode(" \u67E5\u8BE2\u8FC7\u6EE4 "),
283
- unref(formColumns).length > 0 ? (openBlock(), createBlock(unref(AppSearch), {
301
+ __props.filterColumns.length > 0 ? (openBlock(), createBlock(unref(AppSearch), {
284
302
  key: 0,
285
303
  ref_key: "appSearchRef",
286
304
  ref: appSearchRef,
287
- model: unref(formModel),
288
- columns: unref(formColumns),
305
+ model: __props.filterModel,
306
+ columns: __props.filterColumns,
289
307
  hidden: !unref(showFilter),
290
308
  class: normalizeClass({ "mb-4": unref(showFilter) }),
291
309
  onSearch: ($event) => unref(getData)(1)
@@ -523,10 +541,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
523
541
  /* TEXT */
524
542
  ),
525
543
  createVNode(unref(ElPagination), {
526
- "current-page": unref(formModel).page,
527
- "onUpdate:currentPage": ($event) => unref(formModel).page = $event,
528
- "page-size": unref(formModel).size,
529
- "onUpdate:pageSize": ($event) => unref(formModel).size = $event,
544
+ "current-page": __props.filterModel.page,
545
+ "onUpdate:currentPage": ($event) => __props.filterModel.page = $event,
546
+ "page-size": __props.filterModel.size,
547
+ "onUpdate:pageSize": ($event) => __props.filterModel.size = $event,
530
548
  total: unref(totalElements),
531
549
  "pager-count": __props.pagerCount,
532
550
  "page-sizes": [10, 15, 30, 50, 100],
@@ -1,5 +1,4 @@
1
1
  import { ref, nextTick, unref } from 'vue';
2
- import { useAppSearch } from '../../appSearch/js/useAppSearch.mjs';
3
2
  import { useApi } from '../../../hooks/useApi.mjs';
4
3
  import { isEmpty, isNumber, isString } from '../../../utils/is.mjs';
5
4
 
@@ -14,12 +13,6 @@ function useAppTableSearch(hy) {
14
13
  clearSelection
15
14
  } = hy;
16
15
  const { api } = useApi();
17
- const { formModel, formColumns } = useAppSearch(props.filterColumns, {
18
- page: 1,
19
- // 当前分页数
20
- size: 15
21
- // 每页数量
22
- });
23
16
  const totalElements = ref(0);
24
17
  const showFilter = ref(true);
25
18
  function switchShowFilter() {
@@ -31,7 +24,7 @@ function useAppTableSearch(hy) {
31
24
  return new Promise((resolve, reject) => {
32
25
  if (!isEmpty(page)) {
33
26
  if (isNumber(page) || isString(page)) {
34
- formModel.value.page = page;
27
+ props.filterModel.page = page;
35
28
  }
36
29
  }
37
30
  const params = getParametersFn();
@@ -53,7 +46,7 @@ function useAppTableSearch(hy) {
53
46
  });
54
47
  function successFun(res) {
55
48
  var _a;
56
- if (!((_a = res.data.content) == null ? void 0 : _a.length) && formModel.value.page !== 1) {
49
+ if (!((_a = res.data.content) == null ? void 0 : _a.length) && props.filterModel.page !== 1) {
57
50
  getData(1);
58
51
  return;
59
52
  }
@@ -70,14 +63,14 @@ function useAppTableSearch(hy) {
70
63
  async function resetFn() {
71
64
  await nextTick();
72
65
  appSearchRef.value.resetFields();
73
- formModel.value.query = null;
66
+ props.filterModel.query = null;
74
67
  getData(1);
75
68
  }
76
69
  function getParametersFn() {
77
70
  return Object.assign(
78
71
  {
79
- ...unref(formModel),
80
- page: unref(formModel).page - 1
72
+ ...props.filterModel,
73
+ page: props.filterModel.page - 1
81
74
  },
82
75
  unref(props.requestParams)
83
76
  );
@@ -93,22 +86,20 @@ function useAppTableSearch(hy) {
93
86
  closeAppTableLoading();
94
87
  }
95
88
  function onSizeChangeHandler(val) {
96
- formModel.value.page = 1;
97
- formModel.value.size = val;
89
+ props.filterModel.page = 1;
90
+ props.filterModel.size = val;
98
91
  getData();
99
92
  }
100
93
  function onCurrentChangeHandler(val) {
101
- formModel.value.page = val;
94
+ props.filterModel.page = val;
102
95
  getData();
103
96
  }
104
97
  let oldQueryValue;
105
98
  function onSearchQueryHandler() {
106
- const isReset = !(isEmpty(oldQueryValue) && isEmpty(formModel.value.query) || oldQueryValue === formModel.value.query);
99
+ const isReset = !(isEmpty(oldQueryValue) && isEmpty(props.filterModel.query) || oldQueryValue === props.filterModel.query);
107
100
  getData(isReset ? 1 : null);
108
101
  }
109
102
  return {
110
- formModel,
111
- formColumns,
112
103
  totalElements,
113
104
  showFilter,
114
105
  getData,
@@ -1,4 +1,5 @@
1
1
  import { toRef } from 'vue';
2
+ import { useAppSearch } from '../../appSearch/js/useAppSearch.mjs';
2
3
  import { isEmpty, isBoolean } from '../../../utils/is.mjs';
3
4
  import { useLocale } from '../../../hooks/useLocale.mjs';
4
5
 
@@ -73,9 +74,17 @@ const useAppTable = (config = {}) => {
73
74
  } catch (err) {
74
75
  console.error(err);
75
76
  }
77
+ const appSearchForm = useAppSearch(filterColumns, {
78
+ page: 1,
79
+ // 当前分页数
80
+ size: 15
81
+ // 每页数量
82
+ });
83
+ console.log("appSearchFormappSearchFormappSearchForm", appSearchForm);
76
84
  return {
77
85
  tableColumns: toRef(tableColumns),
78
- filterColumns: toRef(filterColumns)
86
+ filterModel: appSearchForm.formModel,
87
+ filterColumns: appSearchForm.formColumns
79
88
  };
80
89
  };
81
90
 
package/es/version.mjs CHANGED
@@ -1,3 +1,3 @@
1
- const version = "0.1.3";
1
+ const version = "0.1.4";
2
2
 
3
3
  export { version };
@@ -5,14 +5,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var vue = require('vue');
6
6
  var elementPlus = require('element-plus');
7
7
  var iconsVue = require('@element-plus/icons-vue');
8
- var index$3 = require('../appTooltip/index.js');
9
- var index$1 = require('./js/index.js');
8
+ var index$4 = require('../appTooltip/index.js');
9
+ var index$2 = require('./js/index.js');
10
10
  var search = require('./js/search.js');
11
11
  var columnSelect = require('./cpns/columnSelect.vue.js');
12
12
  var useMixins = require('../../hooks/useMixins.js');
13
- var index = require('../appSearch/index.js');
13
+ var index = require('../appButton/index.js');
14
+ var index$1 = require('../appSearch/index.js');
14
15
  var adaptive = require('../../utils/adaptive.js');
15
- var index$2 = require('../appIconBox/index.js');
16
+ var index$3 = require('../appIconBox/index.js');
16
17
  var useLocale = require('../../hooks/useLocale.js');
17
18
  var is = require('../../utils/is.js');
18
19
 
@@ -93,6 +94,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
93
94
  default: "",
94
95
  required: false
95
96
  },
97
+ filterModel: {
98
+ type: Object,
99
+ default: () => ({})
100
+ },
96
101
  filterColumns: {
97
102
  // 表格筛选配置
98
103
  type: Array,
@@ -181,8 +186,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
181
186
  onTableSelectHandler,
182
187
  // useAppTableSearch
183
188
  // 表单查询
184
- formModel,
185
- formColumns,
186
189
  totalElements,
187
190
  showFilter,
188
191
  getData,
@@ -204,7 +207,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
204
207
  operatorDropdownRef,
205
208
  appSearchRef
206
209
  },
207
- [index$1.useAppTableWrapper, search.useAppTableSearch]
210
+ [index$2.useAppTableWrapper, search.useAppTableSearch]
208
211
  );
209
212
  if (props.defaultGetData) {
210
213
  getData(1);
@@ -220,6 +223,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
220
223
  clearSelectedList
221
224
  });
222
225
  return (_ctx, _cache) => {
226
+ const _component_AppIcon = vue.resolveComponent("AppIcon");
223
227
  return vue.openBlock(), vue.createElementBlock(
224
228
  "div",
225
229
  {
@@ -238,9 +242,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
238
242
  "origin-columns": props.tableColumns,
239
243
  onConfirm: vue.unref(onTableColumnsSelectHandler)
240
244
  }, null, 8, ["columns", "columns-editable", "origin-columns", "onConfirm"])) : vue.createCommentVNode("v-if", true),
241
- vue.unref(formColumns).length > 0 ? (vue.openBlock(), vue.createElementBlock("div", {
245
+ __props.filterColumns.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", {
242
246
  key: 1,
243
- class: "flex items-center gap-[10px] clickBox px-3 select-none rounded hover:bg-background-2",
247
+ class: "h-[32px] flex items-center gap-[10px] clickBox px-3 select-none rounded hover:bg-background-2",
244
248
  onClick: vue.unref(switchShowFilter)
245
249
  }, [
246
250
  vue.createVNode(vue.unref(elementPlus.ElIcon), { size: "12" }, {
@@ -260,8 +264,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
260
264
  ], 8, ["onClick"])) : vue.createCommentVNode("v-if", true),
261
265
  vue.unref(searchPlaceholder) ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElInput), {
262
266
  key: 2,
263
- modelValue: vue.unref(formModel).query,
264
- "onUpdate:modelValue": ($event) => vue.unref(formModel).query = $event,
267
+ modelValue: __props.filterModel.query,
268
+ "onUpdate:modelValue": ($event) => __props.filterModel.query = $event,
265
269
  class: "w-[160px]",
266
270
  placeholder: vue.unref(t)("table.searchFor", [vue.unref(searchPlaceholder)]),
267
271
  onKeydown: vue.withKeys(vue.unref(onSearchQueryHandler), ["enter"])
@@ -274,7 +278,21 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
274
278
  ]),
275
279
  _: 1
276
280
  /* STABLE */
277
- }, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onKeydown"])) : vue.createCommentVNode("v-if", true)
281
+ }, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onKeydown"])) : (vue.openBlock(), vue.createBlock(vue.unref(index.AppButton), {
282
+ key: 3,
283
+ type: "primary",
284
+ onClick: ($event) => vue.unref(getData)()
285
+ }, {
286
+ default: vue.withCtx(() => [
287
+ vue.createVNode(_component_AppIcon, {
288
+ class: "w-[12px] h-[12px]",
289
+ "svg-name": "refres"
290
+ })
291
+ ]),
292
+ _: 1
293
+ /* STABLE */
294
+ }, 8, ["onClick"])),
295
+ vue.renderSlot(_ctx.$slots, "operator-right-box")
278
296
  ]),
279
297
  _ctx.$slots["operator-left-box"] ? (vue.openBlock(), vue.createElementBlock("div", {
280
298
  key: 0,
@@ -284,12 +302,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
284
302
  ])) : vue.createCommentVNode("v-if", true)
285
303
  ]),
286
304
  vue.createCommentVNode(" \u67E5\u8BE2\u8FC7\u6EE4 "),
287
- vue.unref(formColumns).length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(index.AppSearch), {
305
+ __props.filterColumns.length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.AppSearch), {
288
306
  key: 0,
289
307
  ref_key: "appSearchRef",
290
308
  ref: appSearchRef,
291
- model: vue.unref(formModel),
292
- columns: vue.unref(formColumns),
309
+ model: __props.filterModel,
310
+ columns: __props.filterColumns,
293
311
  hidden: !vue.unref(showFilter),
294
312
  class: vue.normalizeClass({ "mb-4": vue.unref(showFilter) }),
295
313
  onSearch: ($event) => vue.unref(getData)(1)
@@ -360,7 +378,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
360
378
  vue.renderSlot(_ctx.$slots, column.headerSlot, vue.mergeProps({ ref_for: true }, scope), () => {
361
379
  var _a2, _b;
362
380
  return [
363
- !vue.unref(is.isEmpty)((_a2 = scope.column) == null ? void 0 : _a2.label) ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.AppTooltip), {
381
+ !vue.unref(is.isEmpty)((_a2 = scope.column) == null ? void 0 : _a2.label) ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.AppTooltip), {
364
382
  key: 0,
365
383
  "over-line": 1,
366
384
  content: (_b = scope.column) == null ? void 0 : _b.label
@@ -381,22 +399,22 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
381
399
  (vue.openBlock(true), vue.createElementBlock(
382
400
  vue.Fragment,
383
401
  null,
384
- vue.renderList(vue.unref(index$1.operatorFilterHandler)(
402
+ vue.renderList(vue.unref(index$2.operatorFilterHandler)(
385
403
  column,
386
404
  scope,
387
405
  "default"
388
406
  ), (citem, cindex) => {
389
- return vue.openBlock(), vue.createBlock(vue.unref(index$2.AppIconBox), {
407
+ return vue.openBlock(), vue.createBlock(vue.unref(index$3.AppIconBox), {
390
408
  key: cindex,
391
409
  "svg-name": citem.svgName,
392
410
  altText: citem.label,
393
- onClick: vue.withModifiers(($event) => vue.unref(index$1.operatorClickHandler)(cindex, column, scope, "default"), ["stop"])
411
+ onClick: vue.withModifiers(($event) => vue.unref(index$2.operatorClickHandler)(cindex, column, scope, "default"), ["stop"])
394
412
  }, null, 8, ["svg-name", "altText", "onClick"]);
395
413
  }),
396
414
  128
397
415
  /* KEYED_FRAGMENT */
398
416
  )),
399
- ((_a2 = vue.unref(index$1.operatorFilterHandler)(column, scope, "more")) == null ? void 0 : _a2.length) ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElDropdown), {
417
+ ((_a2 = vue.unref(index$2.operatorFilterHandler)(column, scope, "more")) == null ? void 0 : _a2.length) ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElDropdown), {
400
418
  key: 0,
401
419
  ref_for: true,
402
420
  ref_key: "operatorDropdownRef",
@@ -405,7 +423,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
405
423
  class: "ml-3",
406
424
  "popper-style": "min-width: 150px",
407
425
  placement: "bottom",
408
- onCommand: ($event) => vue.unref(index$1.operatorClickHandler)($event, column, scope, "more")
426
+ onCommand: ($event) => vue.unref(index$2.operatorClickHandler)($event, column, scope, "more")
409
427
  }, {
410
428
  dropdown: vue.withCtx(() => [
411
429
  vue.createVNode(
@@ -416,7 +434,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
416
434
  (vue.openBlock(true), vue.createElementBlock(
417
435
  vue.Fragment,
418
436
  null,
419
- vue.renderList(vue.unref(index$1.operatorFilterHandler)(
437
+ vue.renderList(vue.unref(index$2.operatorFilterHandler)(
420
438
  column,
421
439
  scope,
422
440
  "more"
@@ -424,7 +442,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
424
442
  return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElDropdownItem), {
425
443
  key: cindex,
426
444
  command: cindex,
427
- disabled: vue.unref(index$1.operatorDisabledHandler)(citem, scope)
445
+ disabled: vue.unref(index$2.operatorDisabledHandler)(citem, scope)
428
446
  }, {
429
447
  default: vue.withCtx(() => [
430
448
  vue.createElementVNode("span", null, [
@@ -435,13 +453,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
435
453
  1
436
454
  /* TEXT */
437
455
  ),
438
- vue.unref(index$1.operatorDisabledHandler)(citem, scope) ? (vue.openBlock(), vue.createElementBlock(
456
+ vue.unref(index$2.operatorDisabledHandler)(citem, scope) ? (vue.openBlock(), vue.createElementBlock(
439
457
  "span",
440
458
  {
441
459
  key: 0,
442
460
  class: "text-xs leading-1"
443
461
  },
444
- "\uFF08" + vue.toDisplayString(vue.unref(index$1.operatorDisableTextdHandler)(citem, scope)) + "\uFF09",
462
+ "\uFF08" + vue.toDisplayString(vue.unref(index$2.operatorDisableTextdHandler)(citem, scope)) + "\uFF09",
445
463
  1
446
464
  /* TEXT */
447
465
  )) : vue.createCommentVNode("v-if", true)
@@ -463,7 +481,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
463
481
  )
464
482
  ]),
465
483
  default: vue.withCtx(() => [
466
- vue.createVNode(vue.unref(index$2.AppIconBox), {
484
+ vue.createVNode(vue.unref(index$3.AppIconBox), {
467
485
  key: "more",
468
486
  "svg-name": "system-burst_analysis_select_option",
469
487
  altText: vue.unref(t)("table.moreOperations"),
@@ -481,7 +499,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
481
499
  vue.Fragment,
482
500
  { key: 2 },
483
501
  [
484
- !vue.unref(is.isEmpty)(scope.row[scope.column.property]) ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.AppTooltip), {
502
+ !vue.unref(is.isEmpty)(scope.row[scope.column.property]) ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.AppTooltip), {
485
503
  key: 0,
486
504
  "over-line": 2,
487
505
  content: scope.row[scope.column.property]
@@ -527,10 +545,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
527
545
  /* TEXT */
528
546
  ),
529
547
  vue.createVNode(vue.unref(elementPlus.ElPagination), {
530
- "current-page": vue.unref(formModel).page,
531
- "onUpdate:currentPage": ($event) => vue.unref(formModel).page = $event,
532
- "page-size": vue.unref(formModel).size,
533
- "onUpdate:pageSize": ($event) => vue.unref(formModel).size = $event,
548
+ "current-page": __props.filterModel.page,
549
+ "onUpdate:currentPage": ($event) => __props.filterModel.page = $event,
550
+ "page-size": __props.filterModel.size,
551
+ "onUpdate:pageSize": ($event) => __props.filterModel.size = $event,
534
552
  total: vue.unref(totalElements),
535
553
  "pager-count": __props.pagerCount,
536
554
  "page-sizes": [10, 15, 30, 50, 100],
@@ -556,7 +574,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
556
574
  "virtual-triggering": "",
557
575
  trigger: "contextmenu",
558
576
  placement: "bottom",
559
- onCommand: ($event) => vue.unref(index$1.operatorClickHandler)(
577
+ onCommand: ($event) => vue.unref(index$2.operatorClickHandler)(
560
578
  $event,
561
579
  vue.unref(tableTriggerRef).column,
562
580
  vue.unref(tableTriggerRef).scope
@@ -568,14 +586,14 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
568
586
  (vue.openBlock(true), vue.createElementBlock(
569
587
  vue.Fragment,
570
588
  null,
571
- vue.renderList(vue.unref(index$1.operatorFilterHandler)(
589
+ vue.renderList(vue.unref(index$2.operatorFilterHandler)(
572
590
  vue.unref(tableTriggerRef).column,
573
591
  vue.unref(tableTriggerRef).scope
574
592
  ), (citem, cindex) => {
575
593
  return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElDropdownItem), {
576
594
  key: cindex,
577
595
  command: cindex,
578
- disabled: vue.unref(index$1.operatorDisabledHandler)(citem, vue.unref(tableTriggerRef).scope)
596
+ disabled: vue.unref(index$2.operatorDisabledHandler)(citem, vue.unref(tableTriggerRef).scope)
579
597
  }, {
580
598
  default: vue.withCtx(() => [
581
599
  vue.createElementVNode("span", null, [
@@ -586,13 +604,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
586
604
  1
587
605
  /* TEXT */
588
606
  ),
589
- vue.unref(index$1.operatorDisabledHandler)(citem, vue.unref(tableTriggerRef).scope) ? (vue.openBlock(), vue.createElementBlock(
607
+ vue.unref(index$2.operatorDisabledHandler)(citem, vue.unref(tableTriggerRef).scope) ? (vue.openBlock(), vue.createElementBlock(
590
608
  "span",
591
609
  {
592
610
  key: 0,
593
611
  class: "text-xs leading-1"
594
612
  },
595
- "\uFF08" + vue.toDisplayString(vue.unref(index$1.operatorDisableTextdHandler)(citem, vue.unref(tableTriggerRef).scope)) + "\uFF09",
613
+ "\uFF08" + vue.toDisplayString(vue.unref(index$2.operatorDisableTextdHandler)(citem, vue.unref(tableTriggerRef).scope)) + "\uFF09",
596
614
  1
597
615
  /* TEXT */
598
616
  )) : vue.createCommentVNode("v-if", true)
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var vue = require('vue');
4
- var useAppSearch = require('../../appSearch/js/useAppSearch.js');
5
4
  var useApi = require('../../../hooks/useApi.js');
6
5
  var is = require('../../../utils/is.js');
7
6
 
@@ -16,12 +15,6 @@ function useAppTableSearch(hy) {
16
15
  clearSelection
17
16
  } = hy;
18
17
  const { api } = useApi.useApi();
19
- const { formModel, formColumns } = useAppSearch.useAppSearch(props.filterColumns, {
20
- page: 1,
21
- // 当前分页数
22
- size: 15
23
- // 每页数量
24
- });
25
18
  const totalElements = vue.ref(0);
26
19
  const showFilter = vue.ref(true);
27
20
  function switchShowFilter() {
@@ -33,7 +26,7 @@ function useAppTableSearch(hy) {
33
26
  return new Promise((resolve, reject) => {
34
27
  if (!is.isEmpty(page)) {
35
28
  if (is.isNumber(page) || is.isString(page)) {
36
- formModel.value.page = page;
29
+ props.filterModel.page = page;
37
30
  }
38
31
  }
39
32
  const params = getParametersFn();
@@ -55,7 +48,7 @@ function useAppTableSearch(hy) {
55
48
  });
56
49
  function successFun(res) {
57
50
  var _a;
58
- if (!((_a = res.data.content) == null ? void 0 : _a.length) && formModel.value.page !== 1) {
51
+ if (!((_a = res.data.content) == null ? void 0 : _a.length) && props.filterModel.page !== 1) {
59
52
  getData(1);
60
53
  return;
61
54
  }
@@ -72,14 +65,14 @@ function useAppTableSearch(hy) {
72
65
  async function resetFn() {
73
66
  await vue.nextTick();
74
67
  appSearchRef.value.resetFields();
75
- formModel.value.query = null;
68
+ props.filterModel.query = null;
76
69
  getData(1);
77
70
  }
78
71
  function getParametersFn() {
79
72
  return Object.assign(
80
73
  {
81
- ...vue.unref(formModel),
82
- page: vue.unref(formModel).page - 1
74
+ ...props.filterModel,
75
+ page: props.filterModel.page - 1
83
76
  },
84
77
  vue.unref(props.requestParams)
85
78
  );
@@ -95,22 +88,20 @@ function useAppTableSearch(hy) {
95
88
  closeAppTableLoading();
96
89
  }
97
90
  function onSizeChangeHandler(val) {
98
- formModel.value.page = 1;
99
- formModel.value.size = val;
91
+ props.filterModel.page = 1;
92
+ props.filterModel.size = val;
100
93
  getData();
101
94
  }
102
95
  function onCurrentChangeHandler(val) {
103
- formModel.value.page = val;
96
+ props.filterModel.page = val;
104
97
  getData();
105
98
  }
106
99
  let oldQueryValue;
107
100
  function onSearchQueryHandler() {
108
- const isReset = !(is.isEmpty(oldQueryValue) && is.isEmpty(formModel.value.query) || oldQueryValue === formModel.value.query);
101
+ const isReset = !(is.isEmpty(oldQueryValue) && is.isEmpty(props.filterModel.query) || oldQueryValue === props.filterModel.query);
109
102
  getData(isReset ? 1 : null);
110
103
  }
111
104
  return {
112
- formModel,
113
- formColumns,
114
105
  totalElements,
115
106
  showFilter,
116
107
  getData,
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var vue = require('vue');
4
+ var useAppSearch = require('../../appSearch/js/useAppSearch.js');
4
5
  var is = require('../../../utils/is.js');
5
6
  var useLocale = require('../../../hooks/useLocale.js');
6
7
 
@@ -75,9 +76,17 @@ const useAppTable = (config = {}) => {
75
76
  } catch (err) {
76
77
  console.error(err);
77
78
  }
79
+ const appSearchForm = useAppSearch.useAppSearch(filterColumns, {
80
+ page: 1,
81
+ // 当前分页数
82
+ size: 15
83
+ // 每页数量
84
+ });
85
+ console.log("appSearchFormappSearchFormappSearchForm", appSearchForm);
78
86
  return {
79
87
  tableColumns: vue.toRef(tableColumns),
80
- filterColumns: vue.toRef(filterColumns)
88
+ filterModel: appSearchForm.formModel,
89
+ filterColumns: appSearchForm.formColumns
81
90
  };
82
91
  };
83
92
 
package/lib/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "0.1.3";
3
+ const version = "0.1.4";
4
4
 
5
5
  exports.version = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hy-dispatch-ui-v3",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "scripts": {