hy-dispatch-ui-v3 0.1.3 → 0.1.5
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 +12 -0
- package/es/components/appSearch/appSearch.vue.mjs +4 -8
- package/es/components/appTable/appTable.vue.mjs +32 -14
- package/es/components/appTable/js/search.mjs +9 -18
- package/es/components/appTable/js/useAppTable.mjs +12 -2
- package/es/version.mjs +1 -1
- package/lib/components/appSearch/appSearch.vue.js +4 -8
- package/lib/components/appTable/appTable.vue.js +54 -36
- package/lib/components/appTable/js/search.js +9 -18
- package/lib/components/appTable/js/useAppTable.js +12 -2
- package/lib/version.js +1 -1
- package/package.json +1 -1
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
|
}
|
|
@@ -90,10 +90,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
90
90
|
shrinkDestroy();
|
|
91
91
|
});
|
|
92
92
|
function onChangeHandler(value, column) {
|
|
93
|
-
var _a;
|
|
94
|
-
if ((_a = column.attrs) == null ? void 0 : _a.onChange) {
|
|
95
|
-
column.attrs.onChange(value);
|
|
96
|
-
}
|
|
97
93
|
emits("search");
|
|
98
94
|
}
|
|
99
95
|
function onKeydownEnterHander(e) {
|
|
@@ -281,7 +277,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
281
277
|
}, { ref_for: true }, column.attrs, {
|
|
282
278
|
disabled: unref(isDisabled)(props, column),
|
|
283
279
|
onKeydown: withKeys(($event) => onKeydownEnterHander(), ["enter"]),
|
|
284
|
-
onChange: ($event) => onChangeHandler(
|
|
280
|
+
onChange: ($event) => onChangeHandler()
|
|
285
281
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "onKeydown", "onChange"])
|
|
286
282
|
],
|
|
287
283
|
2112
|
|
@@ -296,7 +292,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
296
292
|
"onUpdate:modelValue": ($event) => __props.model[column.field] = $event
|
|
297
293
|
}, { ref_for: true }, column.attrs, {
|
|
298
294
|
disabled: unref(isDisabled)(props, column),
|
|
299
|
-
onChange: ($event) => onChangeHandler(
|
|
295
|
+
onChange: ($event) => onChangeHandler()
|
|
300
296
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "onChange"])
|
|
301
297
|
],
|
|
302
298
|
2112
|
|
@@ -322,7 +318,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
322
318
|
}, { ref_for: true }, column.attrs, {
|
|
323
319
|
disabled: unref(isDisabled)(props, column),
|
|
324
320
|
timeRangeFill: column.timeRangeFill,
|
|
325
|
-
onChange: ($event) => onChangeHandler(
|
|
321
|
+
onChange: ($event) => onChangeHandler()
|
|
326
322
|
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled", "timeRangeFill", "onChange"])) : (openBlock(), createBlock(unref(AppDatePicker), mergeProps({
|
|
327
323
|
key: 1,
|
|
328
324
|
modelValue: __props.model[column.field],
|
|
@@ -332,7 +328,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
332
328
|
}, { ref_for: true }, column.attrs, {
|
|
333
329
|
disabled: unref(isDisabled)(props, column),
|
|
334
330
|
timeRangeFill: column.timeRangeFill,
|
|
335
|
-
onChange: ($event) => onChangeHandler(
|
|
331
|
+
onChange: ($event) => onChangeHandler()
|
|
336
332
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "timeRangeFill", "onChange"]))
|
|
337
333
|
],
|
|
338
334
|
64
|
|
@@ -6,6 +6,8 @@ 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';
|
|
10
|
+
import { AppIcon } from '../appIcon/index.mjs';
|
|
9
11
|
import { AppSearch } from '../appSearch/index.mjs';
|
|
10
12
|
import { parseRem } from '../../utils/adaptive.mjs';
|
|
11
13
|
import { AppIconBox } from '../appIconBox/index.mjs';
|
|
@@ -89,6 +91,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
89
91
|
default: "",
|
|
90
92
|
required: false
|
|
91
93
|
},
|
|
94
|
+
filterModel: {
|
|
95
|
+
type: Object,
|
|
96
|
+
default: () => ({})
|
|
97
|
+
},
|
|
92
98
|
filterColumns: {
|
|
93
99
|
// 表格筛选配置
|
|
94
100
|
type: Array,
|
|
@@ -177,8 +183,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
177
183
|
onTableSelectHandler,
|
|
178
184
|
// useAppTableSearch
|
|
179
185
|
// 表单查询
|
|
180
|
-
formModel,
|
|
181
|
-
formColumns,
|
|
182
186
|
totalElements,
|
|
183
187
|
showFilter,
|
|
184
188
|
getData,
|
|
@@ -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
|
-
|
|
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:
|
|
260
|
-
"onUpdate:modelValue": ($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"])) :
|
|
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(unref(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
|
-
|
|
301
|
+
__props.filterColumns.length > 0 ? (openBlock(), createBlock(unref(AppSearch), {
|
|
284
302
|
key: 0,
|
|
285
303
|
ref_key: "appSearchRef",
|
|
286
304
|
ref: appSearchRef,
|
|
287
|
-
model:
|
|
288
|
-
columns:
|
|
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":
|
|
527
|
-
"onUpdate:currentPage": ($event) =>
|
|
528
|
-
"page-size":
|
|
529
|
-
"onUpdate:pageSize": ($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
|
-
|
|
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) &&
|
|
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
|
-
|
|
66
|
+
props.filterModel.query = null;
|
|
74
67
|
getData(1);
|
|
75
68
|
}
|
|
76
69
|
function getParametersFn() {
|
|
77
70
|
return Object.assign(
|
|
78
71
|
{
|
|
79
|
-
...
|
|
80
|
-
page:
|
|
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
|
-
|
|
97
|
-
|
|
89
|
+
props.filterModel.page = 1;
|
|
90
|
+
props.filterModel.size = val;
|
|
98
91
|
getData();
|
|
99
92
|
}
|
|
100
93
|
function onCurrentChangeHandler(val) {
|
|
101
|
-
|
|
94
|
+
props.filterModel.page = val;
|
|
102
95
|
getData();
|
|
103
96
|
}
|
|
104
97
|
let oldQueryValue;
|
|
105
98
|
function onSearchQueryHandler() {
|
|
106
|
-
const isReset = !(isEmpty(oldQueryValue) && isEmpty(
|
|
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
|
|
|
@@ -53,7 +54,7 @@ function getColumnsEditable(column, index) {
|
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
56
|
const useAppTable = (config = {}) => {
|
|
56
|
-
const { columns, filterColumns } = config || {};
|
|
57
|
+
const { columns, filterModel, filterColumns } = config || {};
|
|
57
58
|
const tableColumns = [];
|
|
58
59
|
try {
|
|
59
60
|
for (let i = 0; i < (columns == null ? void 0 : columns.length); i++) {
|
|
@@ -73,9 +74,18 @@ const useAppTable = (config = {}) => {
|
|
|
73
74
|
} catch (err) {
|
|
74
75
|
console.error(err);
|
|
75
76
|
}
|
|
77
|
+
const appSearchForm = useAppSearch(filterColumns, {
|
|
78
|
+
query: null,
|
|
79
|
+
page: 1,
|
|
80
|
+
// 当前分页数
|
|
81
|
+
size: 15,
|
|
82
|
+
// 每页数量
|
|
83
|
+
...filterModel
|
|
84
|
+
});
|
|
76
85
|
return {
|
|
77
86
|
tableColumns: toRef(tableColumns),
|
|
78
|
-
|
|
87
|
+
filterModel: appSearchForm.formModel,
|
|
88
|
+
filterColumns: appSearchForm.formColumns
|
|
79
89
|
};
|
|
80
90
|
};
|
|
81
91
|
|
package/es/version.mjs
CHANGED
|
@@ -94,10 +94,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
94
94
|
shrinkDestroy();
|
|
95
95
|
});
|
|
96
96
|
function onChangeHandler(value, column) {
|
|
97
|
-
var _a;
|
|
98
|
-
if ((_a = column.attrs) == null ? void 0 : _a.onChange) {
|
|
99
|
-
column.attrs.onChange(value);
|
|
100
|
-
}
|
|
101
97
|
emits("search");
|
|
102
98
|
}
|
|
103
99
|
function onKeydownEnterHander(e) {
|
|
@@ -285,7 +281,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
285
281
|
}, { ref_for: true }, column.attrs, {
|
|
286
282
|
disabled: vue.unref(index.isDisabled)(props, column),
|
|
287
283
|
onKeydown: vue.withKeys(($event) => onKeydownEnterHander(), ["enter"]),
|
|
288
|
-
onChange: ($event) => onChangeHandler(
|
|
284
|
+
onChange: ($event) => onChangeHandler()
|
|
289
285
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "onKeydown", "onChange"])
|
|
290
286
|
],
|
|
291
287
|
2112
|
|
@@ -300,7 +296,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
300
296
|
"onUpdate:modelValue": ($event) => __props.model[column.field] = $event
|
|
301
297
|
}, { ref_for: true }, column.attrs, {
|
|
302
298
|
disabled: vue.unref(index.isDisabled)(props, column),
|
|
303
|
-
onChange: ($event) => onChangeHandler(
|
|
299
|
+
onChange: ($event) => onChangeHandler()
|
|
304
300
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "onChange"])
|
|
305
301
|
],
|
|
306
302
|
2112
|
|
@@ -326,7 +322,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
326
322
|
}, { ref_for: true }, column.attrs, {
|
|
327
323
|
disabled: vue.unref(index.isDisabled)(props, column),
|
|
328
324
|
timeRangeFill: column.timeRangeFill,
|
|
329
|
-
onChange: ($event) => onChangeHandler(
|
|
325
|
+
onChange: ($event) => onChangeHandler()
|
|
330
326
|
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled", "timeRangeFill", "onChange"])) : (vue.openBlock(), vue.createBlock(vue.unref(index$1.AppDatePicker), vue.mergeProps({
|
|
331
327
|
key: 1,
|
|
332
328
|
modelValue: __props.model[column.field],
|
|
@@ -336,7 +332,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
336
332
|
}, { ref_for: true }, column.attrs, {
|
|
337
333
|
disabled: vue.unref(index.isDisabled)(props, column),
|
|
338
334
|
timeRangeFill: column.timeRangeFill,
|
|
339
|
-
onChange: ($event) => onChangeHandler(
|
|
335
|
+
onChange: ($event) => onChangeHandler()
|
|
340
336
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "timeRangeFill", "onChange"]))
|
|
341
337
|
],
|
|
342
338
|
64
|
|
@@ -5,14 +5,16 @@ 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$
|
|
9
|
-
var index$
|
|
8
|
+
var index$5 = require('../appTooltip/index.js');
|
|
9
|
+
var index$3 = 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('../
|
|
13
|
+
var index = require('../appButton/index.js');
|
|
14
|
+
var index$1 = require('../appIcon/index.js');
|
|
15
|
+
var index$2 = require('../appSearch/index.js');
|
|
14
16
|
var adaptive = require('../../utils/adaptive.js');
|
|
15
|
-
var index$
|
|
17
|
+
var index$4 = require('../appIconBox/index.js');
|
|
16
18
|
var useLocale = require('../../hooks/useLocale.js');
|
|
17
19
|
var is = require('../../utils/is.js');
|
|
18
20
|
|
|
@@ -93,6 +95,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
93
95
|
default: "",
|
|
94
96
|
required: false
|
|
95
97
|
},
|
|
98
|
+
filterModel: {
|
|
99
|
+
type: Object,
|
|
100
|
+
default: () => ({})
|
|
101
|
+
},
|
|
96
102
|
filterColumns: {
|
|
97
103
|
// 表格筛选配置
|
|
98
104
|
type: Array,
|
|
@@ -181,8 +187,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
181
187
|
onTableSelectHandler,
|
|
182
188
|
// useAppTableSearch
|
|
183
189
|
// 表单查询
|
|
184
|
-
formModel,
|
|
185
|
-
formColumns,
|
|
186
190
|
totalElements,
|
|
187
191
|
showFilter,
|
|
188
192
|
getData,
|
|
@@ -204,7 +208,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
204
208
|
operatorDropdownRef,
|
|
205
209
|
appSearchRef
|
|
206
210
|
},
|
|
207
|
-
[index$
|
|
211
|
+
[index$3.useAppTableWrapper, search.useAppTableSearch]
|
|
208
212
|
);
|
|
209
213
|
if (props.defaultGetData) {
|
|
210
214
|
getData(1);
|
|
@@ -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
|
-
|
|
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:
|
|
264
|
-
"onUpdate:modelValue": ($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.
|
|
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(vue.unref(index$1.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
|
-
|
|
305
|
+
__props.filterColumns.length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.AppSearch), {
|
|
288
306
|
key: 0,
|
|
289
307
|
ref_key: "appSearchRef",
|
|
290
308
|
ref: appSearchRef,
|
|
291
|
-
model:
|
|
292
|
-
columns:
|
|
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$
|
|
381
|
+
!vue.unref(is.isEmpty)((_a2 = scope.column) == null ? void 0 : _a2.label) ? (vue.openBlock(), vue.createBlock(vue.unref(index$5.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$
|
|
402
|
+
vue.renderList(vue.unref(index$3.operatorFilterHandler)(
|
|
385
403
|
column,
|
|
386
404
|
scope,
|
|
387
405
|
"default"
|
|
388
406
|
), (citem, cindex) => {
|
|
389
|
-
return vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
407
|
+
return vue.openBlock(), vue.createBlock(vue.unref(index$4.AppIconBox), {
|
|
390
408
|
key: cindex,
|
|
391
409
|
"svg-name": citem.svgName,
|
|
392
410
|
altText: citem.label,
|
|
393
|
-
onClick: vue.withModifiers(($event) => vue.unref(index$
|
|
411
|
+
onClick: vue.withModifiers(($event) => vue.unref(index$3.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$
|
|
417
|
+
((_a2 = vue.unref(index$3.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$
|
|
426
|
+
onCommand: ($event) => vue.unref(index$3.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$
|
|
437
|
+
vue.renderList(vue.unref(index$3.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$
|
|
445
|
+
disabled: vue.unref(index$3.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$
|
|
456
|
+
vue.unref(index$3.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$
|
|
462
|
+
"\uFF08" + vue.toDisplayString(vue.unref(index$3.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$
|
|
484
|
+
vue.createVNode(vue.unref(index$4.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$
|
|
502
|
+
!vue.unref(is.isEmpty)(scope.row[scope.column.property]) ? (vue.openBlock(), vue.createBlock(vue.unref(index$5.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":
|
|
531
|
-
"onUpdate:currentPage": ($event) =>
|
|
532
|
-
"page-size":
|
|
533
|
-
"onUpdate:pageSize": ($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$
|
|
577
|
+
onCommand: ($event) => vue.unref(index$3.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$
|
|
589
|
+
vue.renderList(vue.unref(index$3.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$
|
|
596
|
+
disabled: vue.unref(index$3.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$
|
|
607
|
+
vue.unref(index$3.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$
|
|
613
|
+
"\uFF08" + vue.toDisplayString(vue.unref(index$3.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
|
-
|
|
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) &&
|
|
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
|
-
|
|
68
|
+
props.filterModel.query = null;
|
|
76
69
|
getData(1);
|
|
77
70
|
}
|
|
78
71
|
function getParametersFn() {
|
|
79
72
|
return Object.assign(
|
|
80
73
|
{
|
|
81
|
-
...
|
|
82
|
-
page:
|
|
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
|
-
|
|
99
|
-
|
|
91
|
+
props.filterModel.page = 1;
|
|
92
|
+
props.filterModel.size = val;
|
|
100
93
|
getData();
|
|
101
94
|
}
|
|
102
95
|
function onCurrentChangeHandler(val) {
|
|
103
|
-
|
|
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(
|
|
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
|
|
|
@@ -55,7 +56,7 @@ function getColumnsEditable(column, index) {
|
|
|
55
56
|
};
|
|
56
57
|
}
|
|
57
58
|
const useAppTable = (config = {}) => {
|
|
58
|
-
const { columns, filterColumns } = config || {};
|
|
59
|
+
const { columns, filterModel, filterColumns } = config || {};
|
|
59
60
|
const tableColumns = [];
|
|
60
61
|
try {
|
|
61
62
|
for (let i = 0; i < (columns == null ? void 0 : columns.length); i++) {
|
|
@@ -75,9 +76,18 @@ const useAppTable = (config = {}) => {
|
|
|
75
76
|
} catch (err) {
|
|
76
77
|
console.error(err);
|
|
77
78
|
}
|
|
79
|
+
const appSearchForm = useAppSearch.useAppSearch(filterColumns, {
|
|
80
|
+
query: null,
|
|
81
|
+
page: 1,
|
|
82
|
+
// 当前分页数
|
|
83
|
+
size: 15,
|
|
84
|
+
// 每页数量
|
|
85
|
+
...filterModel
|
|
86
|
+
});
|
|
78
87
|
return {
|
|
79
88
|
tableColumns: vue.toRef(tableColumns),
|
|
80
|
-
|
|
89
|
+
filterModel: appSearchForm.formModel,
|
|
90
|
+
filterColumns: appSearchForm.formColumns
|
|
81
91
|
};
|
|
82
92
|
};
|
|
83
93
|
|
package/lib/version.js
CHANGED