tabula-vue 1.0.0 → 1.0.2
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/component.mjs +4 -0
- package/es/components/dialog/index.d.ts +30 -30
- package/es/components/dialog/src/index.vue.d.ts +2 -2
- package/es/components/dialog-form/index.d.ts +2 -2
- package/es/components/dialog-form/src/index.vue.d.ts +2 -2
- package/es/components/display-item/index.d.ts +25 -25
- package/es/components/display-item/src/index.vue.d.ts +7 -7
- package/es/components/drawer-form/index.d.ts +50 -50
- package/es/components/drawer-form/src/index.vue.d.ts +10 -10
- package/es/components/form/index.d.ts +99 -99
- package/es/components/form/src/form-content.vue.d.ts +12 -12
- package/es/components/form/src/index.vue.d.ts +11 -11
- package/es/components/form-item/index.d.ts +80 -80
- package/es/components/form-item/src/index.vue.d.ts +9 -9
- package/es/components/index.d.ts +2 -0
- package/es/components/index.mjs +6 -0
- package/es/components/input-tag/index.d.ts +6 -6
- package/es/components/input-tag/src/index.vue.d.ts +6 -6
- package/es/components/layout/index.d.ts +30 -30
- package/es/components/layout/src/index.vue.d.ts +10 -10
- package/es/components/page/index.d.ts +9087 -4864
- package/es/components/page/src/index.vue.d.ts +1903 -513
- package/es/components/page/src/index.vue2.mjs +43 -12
- package/es/components/popover/index.d.ts +49 -49
- package/es/components/popover/src/index.vue.d.ts +3 -3
- package/es/components/render/index.d.ts +14 -14
- package/es/components/render/src/index.vue.d.ts +1 -1
- package/es/components/search/index.d.ts +298 -298
- package/es/components/search/src/index.vue.d.ts +84 -84
- package/es/components/sidebar/index.d.ts +31 -31
- package/es/components/sidebar/src/index.vue.d.ts +5 -5
- package/es/components/table/index.d.ts +165 -180
- package/es/components/table/index.mjs +3 -0
- package/es/components/table/src/index.vue.d.ts +12 -21
- package/es/components/table/src/index.vue2.mjs +11 -34
- package/es/components/table/src/table-action-bar-content.vue.d.ts +78 -0
- package/es/components/table/src/table-action-bar-content.vue.mjs +6 -0
- package/es/components/table/src/table-action-bar-content.vue2.mjs +395 -0
- package/es/components/table/src/table-action-bar.vue.d.ts +4 -4
- package/es/components/table/src/table-action-bar.vue2.mjs +30 -353
- package/es/components/table/src/table-column-drag-sort.vue.d.ts +1 -1
- package/es/components/table/src/table-column-index.vue.d.ts +1 -1
- package/es/components/table/src/table-column.vue.d.ts +22 -29
- package/es/components/table/src/table-column.vue2.mjs +4 -57
- package/es/components/table/src/table-title-bar.vue.d.ts +2 -2
- package/es/components/table/src/type.d.ts +0 -11
- package/es/components/table/src/use-columns.d.ts +26 -0
- package/es/components/table/src/use-columns.mjs +40 -0
- package/es/components/table-lite/index.d.ts +1783 -0
- package/es/components/table-lite/index.mjs +6 -0
- package/es/components/table-lite/src/index.vue.d.ts +672 -0
- package/es/components/table-lite/src/index.vue.mjs +6 -0
- package/es/components/table-lite/src/index.vue2.mjs +681 -0
- package/es/components/table-lite/src/type.d.ts +91 -0
- package/es/components/table-lite/src/type.mjs +1 -0
- package/es/components/table-lite/style/css.d.ts +16 -0
- package/es/components/table-lite/style/css.mjs +16 -0
- package/es/components/table-lite/style/index.d.ts +16 -0
- package/es/components/table-lite/style/index.mjs +16 -0
- package/es/components/table-v2/index.d.ts +174 -0
- package/es/components/table-v2/index.mjs +7 -0
- package/es/components/table-v2/src/column-converter.d.ts +27 -0
- package/es/components/table-v2/src/column-converter.mjs +42 -0
- package/es/components/table-v2/src/index.vue.d.ts +157 -0
- package/es/components/table-v2/src/index.vue.mjs +6 -0
- package/es/components/table-v2/src/index.vue2.mjs +491 -0
- package/es/components/table-v2/src/special-columns.d.ts +61 -0
- package/es/components/table-v2/src/special-columns.mjs +76 -0
- package/es/components/table-v2/src/table-v2-cell.d.ts +104 -0
- package/es/components/table-v2/src/table-v2-cell.mjs +139 -0
- package/es/components/table-v2/src/table-v2-header-cell.vue.d.ts +61 -0
- package/es/components/table-v2/src/table-v2-header-cell.vue.mjs +6 -0
- package/es/components/table-v2/src/table-v2-header-cell.vue2.mjs +92 -0
- package/es/components/table-v2/src/type.d.ts +95 -0
- package/es/components/table-v2/src/type.mjs +1 -0
- package/es/components/table-v2/src/use-table-v2-columns.d.ts +43 -0
- package/es/components/table-v2/src/use-table-v2-columns.mjs +47 -0
- package/es/components/table-v2/style/css.d.ts +17 -0
- package/es/components/table-v2/style/css.mjs +17 -0
- package/es/components/table-v2/style/index.d.ts +17 -0
- package/es/components/table-v2/style/index.mjs +17 -0
- package/es/index.mjs +6 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/index.css +1 -1
- package/index.js +1850 -279
- package/index.min.js +9 -6
- package/index.min.mjs +9 -6
- package/index.mjs +1813 -248
- package/lib/component.js +42 -38
- package/lib/components/dialog/index.d.ts +30 -30
- package/lib/components/dialog/src/index.vue.d.ts +2 -2
- package/lib/components/dialog-form/index.d.ts +2 -2
- package/lib/components/dialog-form/src/index.vue.d.ts +2 -2
- package/lib/components/display-item/index.d.ts +25 -25
- package/lib/components/display-item/src/index.vue.d.ts +7 -7
- package/lib/components/drawer-form/index.d.ts +50 -50
- package/lib/components/drawer-form/src/index.vue.d.ts +10 -10
- package/lib/components/form/index.d.ts +99 -99
- package/lib/components/form/src/form-content.vue.d.ts +12 -12
- package/lib/components/form/src/index.vue.d.ts +11 -11
- package/lib/components/form-item/index.d.ts +80 -80
- package/lib/components/form-item/src/index.vue.d.ts +9 -9
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +51 -39
- package/lib/components/input-tag/index.d.ts +6 -6
- package/lib/components/input-tag/src/index.vue.d.ts +6 -6
- package/lib/components/layout/index.d.ts +30 -30
- package/lib/components/layout/src/index.vue.d.ts +10 -10
- package/lib/components/page/index.d.ts +9087 -4864
- package/lib/components/page/src/index.vue.d.ts +1903 -513
- package/lib/components/page/src/index.vue2.js +46 -15
- package/lib/components/popover/index.d.ts +49 -49
- package/lib/components/popover/src/index.vue.d.ts +3 -3
- package/lib/components/render/index.d.ts +14 -14
- package/lib/components/render/src/index.vue.d.ts +1 -1
- package/lib/components/search/index.d.ts +298 -298
- package/lib/components/search/src/index.vue.d.ts +84 -84
- package/lib/components/sidebar/index.d.ts +31 -31
- package/lib/components/sidebar/src/index.vue.d.ts +5 -5
- package/lib/components/table/index.d.ts +165 -180
- package/lib/components/table/index.js +6 -0
- package/lib/components/table/src/index.vue.d.ts +12 -21
- package/lib/components/table/src/index.vue2.js +10 -33
- package/lib/components/table/src/table-action-bar-content.vue.d.ts +78 -0
- package/lib/components/table/src/table-action-bar-content.vue.js +10 -0
- package/lib/components/table/src/table-action-bar-content.vue2.js +399 -0
- package/lib/components/table/src/table-action-bar.vue.d.ts +4 -4
- package/lib/components/table/src/table-action-bar.vue2.js +28 -351
- package/lib/components/table/src/table-column-drag-sort.vue.d.ts +1 -1
- package/lib/components/table/src/table-column-index.vue.d.ts +1 -1
- package/lib/components/table/src/table-column.vue.d.ts +22 -29
- package/lib/components/table/src/table-column.vue2.js +2 -55
- package/lib/components/table/src/table-title-bar.vue.d.ts +2 -2
- package/lib/components/table/src/type.d.ts +0 -11
- package/lib/components/table/src/use-columns.d.ts +26 -0
- package/lib/components/table/src/use-columns.js +42 -0
- package/lib/components/table-lite/index.d.ts +1783 -0
- package/lib/components/table-lite/index.js +8 -0
- package/lib/components/table-lite/src/index.vue.d.ts +672 -0
- package/lib/components/table-lite/src/index.vue.js +10 -0
- package/lib/components/table-lite/src/index.vue2.js +685 -0
- package/lib/components/table-lite/src/type.d.ts +91 -0
- package/lib/components/table-lite/src/type.js +2 -0
- package/lib/components/table-lite/style/css.d.ts +16 -0
- package/lib/components/table-lite/style/css.js +19 -0
- package/lib/components/table-lite/style/index.d.ts +16 -0
- package/lib/components/table-lite/style/index.js +19 -0
- package/lib/components/table-v2/index.d.ts +174 -0
- package/lib/components/table-v2/index.js +10 -0
- package/lib/components/table-v2/src/column-converter.d.ts +27 -0
- package/lib/components/table-v2/src/column-converter.js +44 -0
- package/lib/components/table-v2/src/index.vue.d.ts +157 -0
- package/lib/components/table-v2/src/index.vue.js +10 -0
- package/lib/components/table-v2/src/index.vue2.js +495 -0
- package/lib/components/table-v2/src/special-columns.d.ts +61 -0
- package/lib/components/table-v2/src/special-columns.js +80 -0
- package/lib/components/table-v2/src/table-v2-cell.d.ts +104 -0
- package/lib/components/table-v2/src/table-v2-cell.js +143 -0
- package/lib/components/table-v2/src/table-v2-header-cell.vue.d.ts +61 -0
- package/lib/components/table-v2/src/table-v2-header-cell.vue.js +10 -0
- package/lib/components/table-v2/src/table-v2-header-cell.vue2.js +96 -0
- package/lib/components/table-v2/src/type.d.ts +95 -0
- package/lib/components/table-v2/src/type.js +2 -0
- package/lib/components/table-v2/src/use-table-v2-columns.d.ts +43 -0
- package/lib/components/table-v2/src/use-table-v2-columns.js +51 -0
- package/lib/components/table-v2/style/css.d.ts +17 -0
- package/lib/components/table-v2/style/css.js +20 -0
- package/lib/components/table-v2/style/index.d.ts +17 -0
- package/lib/components/table-v2/style/index.js +20 -0
- package/lib/index.js +51 -39
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/ja.js +1 -1
- package/locale/ja.min.js +1 -1
- package/locale/ja.min.mjs +1 -1
- package/locale/ja.mjs +1 -1
- package/locale/ko.js +1 -1
- package/locale/ko.min.js +1 -1
- package/locale/ko.min.mjs +1 -1
- package/locale/ko.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/locale/zh-hk.js +1 -1
- package/locale/zh-hk.min.js +1 -1
- package/locale/zh-hk.min.mjs +1 -1
- package/locale/zh-hk.mjs +1 -1
- package/locale/zh-tw.js +1 -1
- package/locale/zh-tw.min.js +1 -1
- package/locale/zh-tw.min.mjs +1 -1
- package/locale/zh-tw.mjs +1 -1
- package/package.json +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/plus-table-lite.css +1 -0
- package/theme-chalk/plus-table-v2.css +1 -0
- package/theme-chalk/src/index.scss +2 -0
- package/theme-chalk/src/table-lite.scss +53 -0
- package/theme-chalk/src/table-v2.scss +71 -0
package/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! tabula-vue v1.0.
|
|
2
|
-
import { unref, isRef, ref, isReactive, watch, computed, inject, shallowRef, defineComponent, watchEffect, openBlock, createBlock, mergeProps, createSlots, withCtx, createElementVNode, renderSlot, normalizeStyle, createVNode, createTextVNode, toDisplayString, createElementBlock, normalizeClass, createCommentVNode, reactive, useAttrs, Fragment, renderList, resolveDynamicComponent, normalizeProps, guardReactiveProps, h, withDirectives, isVNode, withKeys, withModifiers, TransitionGroup, toHandlers, toRaw, provide,
|
|
3
|
-
import { dayjs, localeContextKey, ElDialog, ElButton, ElPagination, ElRadioGroup, ElRadio,
|
|
1
|
+
/*! tabula-vue v1.0.2 */
|
|
2
|
+
import { unref, isRef, ref, isReactive, watch, computed, inject, shallowRef, defineComponent, watchEffect, openBlock, createBlock, mergeProps, createSlots, withCtx, createElementVNode, renderSlot, normalizeStyle, createVNode, createTextVNode, toDisplayString, createElementBlock, normalizeClass, createCommentVNode, reactive, useAttrs, Fragment, renderList, resolveDynamicComponent, normalizeProps, guardReactiveProps, h, withDirectives, isVNode, withKeys, withModifiers, TransitionGroup, toHandlers, toRaw, provide, getCurrentInstance, resolveComponent, onMounted, onBeforeUnmount, toRefs, nextTick, useSlots } from 'vue';
|
|
3
|
+
import { dayjs, localeContextKey, ElDialog, ElButton, ElPagination, ElRadioGroup, ElRadio, ElDropdown, ElDropdownMenu, ElDropdownItem, ElIcon, ElTooltip, ElPopconfirm, ElLink, ElMessageBox, ElTableColumn, useFormDisabled, ElDatePicker, ClickOutside, ElTag, ElInput, ElAutocomplete, ElCascader, ElCheckboxGroup, ElCheckbox, ElColorPicker, ElInputNumber, ElRadioButton, ElRate, ElSelect, ElOption, ElSlider, ElSwitch, ElTimePicker, ElTimeSelect, ElTransfer, ElTreeSelect, ElSelectV2, ElText, ElDivider, ElFormItem, ElOptionGroup, ElRow, ElCol, ElForm, ElCard, ElMessage, ElImage, ElProgress, ElAvatar, ElPopover, ElTable, vLoading, TableV2FixedDir, ElAutoResizer, ElTableV2, ElEmpty, ElDescriptions, ElDescriptionsItem, ElDrawer, ElSteps, ElStep, ElBreadcrumb, ElBreadcrumbItem, ElMenuItem, ElSubMenu, ElMenu, ElScrollbar, ElHeader, ElContainer, ElMain, ElBacktop } from 'element-plus';
|
|
4
4
|
|
|
5
5
|
const makeInstaller = (components = []) => {
|
|
6
6
|
const install = (app) => {
|
|
@@ -347,7 +347,7 @@ var freeParseInt = parseInt;
|
|
|
347
347
|
* _.toNumber('3.2');
|
|
348
348
|
* // => 3.2
|
|
349
349
|
*/
|
|
350
|
-
function toNumber(value) {
|
|
350
|
+
function toNumber$1(value) {
|
|
351
351
|
if (typeof value == 'number') {
|
|
352
352
|
return value;
|
|
353
353
|
}
|
|
@@ -1543,7 +1543,7 @@ ListCache.prototype.has = listCacheHas;
|
|
|
1543
1543
|
ListCache.prototype.set = listCacheSet;
|
|
1544
1544
|
|
|
1545
1545
|
/* Built-in method references that are verified to be native. */
|
|
1546
|
-
var Map = getNative(root$1, 'Map');
|
|
1546
|
+
var Map$1 = getNative(root$1, 'Map');
|
|
1547
1547
|
|
|
1548
1548
|
/**
|
|
1549
1549
|
* Removes all key-value entries from the map.
|
|
@@ -1556,7 +1556,7 @@ function mapCacheClear() {
|
|
|
1556
1556
|
this.size = 0;
|
|
1557
1557
|
this.__data__ = {
|
|
1558
1558
|
'hash': new Hash,
|
|
1559
|
-
'map': new (Map || ListCache),
|
|
1559
|
+
'map': new (Map$1 || ListCache),
|
|
1560
1560
|
'string': new Hash
|
|
1561
1561
|
};
|
|
1562
1562
|
}
|
|
@@ -1994,7 +1994,7 @@ function stackSet(key, value) {
|
|
|
1994
1994
|
var data = this.__data__;
|
|
1995
1995
|
if (data instanceof ListCache) {
|
|
1996
1996
|
var pairs = data.__data__;
|
|
1997
|
-
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
|
1997
|
+
if (!Map$1 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
|
1998
1998
|
pairs.push([key, value]);
|
|
1999
1999
|
this.size = ++data.size;
|
|
2000
2000
|
return this;
|
|
@@ -2257,7 +2257,7 @@ var dataViewTag$3 = '[object DataView]';
|
|
|
2257
2257
|
|
|
2258
2258
|
/** Used to detect maps, sets, and weakmaps. */
|
|
2259
2259
|
var dataViewCtorString = toSource(DataView),
|
|
2260
|
-
mapCtorString = toSource(Map),
|
|
2260
|
+
mapCtorString = toSource(Map$1),
|
|
2261
2261
|
promiseCtorString = toSource(Promise$1),
|
|
2262
2262
|
setCtorString = toSource(Set$1),
|
|
2263
2263
|
weakMapCtorString = toSource(WeakMap);
|
|
@@ -2273,7 +2273,7 @@ var getTag = baseGetTag;
|
|
|
2273
2273
|
|
|
2274
2274
|
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
|
2275
2275
|
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$3) ||
|
|
2276
|
-
(Map && getTag(new Map) != mapTag$4) ||
|
|
2276
|
+
(Map$1 && getTag(new Map$1) != mapTag$4) ||
|
|
2277
2277
|
(Promise$1 && getTag(Promise$1.resolve()) != promiseTag) ||
|
|
2278
2278
|
(Set$1 && getTag(new Set$1) != setTag$4) ||
|
|
2279
2279
|
(WeakMap && getTag(new WeakMap) != weakMapTag$1)) {
|
|
@@ -3689,11 +3689,11 @@ function debounce(func, wait, options) {
|
|
|
3689
3689
|
if (typeof func != 'function') {
|
|
3690
3690
|
throw new TypeError(FUNC_ERROR_TEXT);
|
|
3691
3691
|
}
|
|
3692
|
-
wait = toNumber(wait) || 0;
|
|
3692
|
+
wait = toNumber$1(wait) || 0;
|
|
3693
3693
|
if (isObject$1(options)) {
|
|
3694
3694
|
leading = !!options.leading;
|
|
3695
3695
|
maxing = 'maxWait' in options;
|
|
3696
|
-
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
3696
|
+
maxWait = maxing ? nativeMax(toNumber$1(options.maxWait) || 0, wait) : maxWait;
|
|
3697
3697
|
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
3698
3698
|
}
|
|
3699
3699
|
|
|
@@ -4478,8 +4478,8 @@ function useTable(_pageInfo) {
|
|
|
4478
4478
|
};
|
|
4479
4479
|
}
|
|
4480
4480
|
|
|
4481
|
-
const _hoisted_1$
|
|
4482
|
-
var _sfc_main$
|
|
4481
|
+
const _hoisted_1$l = { class: "plus-dialog-body" };
|
|
4482
|
+
var _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
4483
4483
|
...{
|
|
4484
4484
|
name: "PlusDialog",
|
|
4485
4485
|
inheritAttrs: false
|
|
@@ -4529,7 +4529,7 @@ var _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
4529
4529
|
class: "plus-dialog"
|
|
4530
4530
|
}, _ctx.$attrs), createSlots({
|
|
4531
4531
|
default: withCtx(() => [
|
|
4532
|
-
createElementVNode("div", _hoisted_1$
|
|
4532
|
+
createElementVNode("div", _hoisted_1$l, [
|
|
4533
4533
|
renderSlot(_ctx.$slots, "default")
|
|
4534
4534
|
])
|
|
4535
4535
|
]),
|
|
@@ -4601,11 +4601,11 @@ var _export_sfc = (sfc, props) => {
|
|
|
4601
4601
|
return target;
|
|
4602
4602
|
};
|
|
4603
4603
|
|
|
4604
|
-
var Dialog = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4604
|
+
var Dialog = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__file", "index.vue"]]);
|
|
4605
4605
|
|
|
4606
4606
|
const PlusDialog = Dialog;
|
|
4607
4607
|
|
|
4608
|
-
const _hoisted_1$
|
|
4608
|
+
const _hoisted_1$k = /* @__PURE__ */ createElementVNode(
|
|
4609
4609
|
"span",
|
|
4610
4610
|
null,
|
|
4611
4611
|
null,
|
|
@@ -4619,7 +4619,7 @@ const _hoisted_2$a = /* @__PURE__ */ createElementVNode(
|
|
|
4619
4619
|
-1
|
|
4620
4620
|
/* HOISTED */
|
|
4621
4621
|
);
|
|
4622
|
-
var _sfc_main$
|
|
4622
|
+
var _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
4623
4623
|
...{
|
|
4624
4624
|
name: "PlusPagination"
|
|
4625
4625
|
},
|
|
@@ -4661,7 +4661,7 @@ var _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
4661
4661
|
},
|
|
4662
4662
|
[
|
|
4663
4663
|
_ctx.align === "right" || _ctx.align === "center" ? renderSlot(_ctx.$slots, "pagination-left", { key: 0 }, () => [
|
|
4664
|
-
_hoisted_1$
|
|
4664
|
+
_hoisted_1$k
|
|
4665
4665
|
]) : createCommentVNode("v-if", true),
|
|
4666
4666
|
createVNode(unref(ElPagination), mergeProps({
|
|
4667
4667
|
layout: "total, sizes, prev, pager, next, jumper",
|
|
@@ -4685,11 +4685,11 @@ var _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
4685
4685
|
}
|
|
4686
4686
|
});
|
|
4687
4687
|
|
|
4688
|
-
var Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4688
|
+
var Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__file", "index.vue"]]);
|
|
4689
4689
|
|
|
4690
4690
|
const PlusPagination = Pagination;
|
|
4691
4691
|
|
|
4692
|
-
var _sfc_main$
|
|
4692
|
+
var _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
4693
4693
|
...{
|
|
4694
4694
|
name: "PlusRadio"
|
|
4695
4695
|
},
|
|
@@ -4874,7 +4874,7 @@ var _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
4874
4874
|
}
|
|
4875
4875
|
});
|
|
4876
4876
|
|
|
4877
|
-
var Radio = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4877
|
+
var Radio = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__file", "index.vue"]]);
|
|
4878
4878
|
|
|
4879
4879
|
const PlusRadio = Radio;
|
|
4880
4880
|
|
|
@@ -5115,26 +5115,25 @@ var user_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
5115
5115
|
// src/components/user.vue
|
|
5116
5116
|
var user_default = user_vue_vue_type_script_setup_true_lang_default;
|
|
5117
5117
|
|
|
5118
|
-
const _hoisted_1$
|
|
5118
|
+
const _hoisted_1$j = {
|
|
5119
5119
|
key: 0,
|
|
5120
5120
|
class: "plus-table-action-bar__dropdown__link"
|
|
5121
5121
|
};
|
|
5122
5122
|
const _hoisted_2$9 = { class: "plus-table-action-bar__dropdown__link" };
|
|
5123
5123
|
const _hoisted_3$4 = { class: "plus-table-action-bar__more-text" };
|
|
5124
|
-
var _sfc_main$
|
|
5124
|
+
var _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
5125
5125
|
...{
|
|
5126
|
-
name: "
|
|
5126
|
+
name: "PlusTableActionBarContent"
|
|
5127
5127
|
},
|
|
5128
|
-
__name: "table-action-bar",
|
|
5128
|
+
__name: "table-action-bar-content",
|
|
5129
5129
|
props: {
|
|
5130
|
-
|
|
5131
|
-
|
|
5130
|
+
row: {},
|
|
5131
|
+
index: {},
|
|
5132
|
+
rest: { default: () => ({}) },
|
|
5132
5133
|
showNumber: { type: [Number, Function], default: 3 },
|
|
5133
5134
|
showLimitIncludeMore: { type: Boolean, default: false },
|
|
5134
5135
|
type: { default: "link" },
|
|
5135
5136
|
buttons: { default: () => [] },
|
|
5136
|
-
width: { default: 200 },
|
|
5137
|
-
actionBarTableColumnProps: { default: () => ({}) },
|
|
5138
5137
|
confirmType: { default: "messageBox" },
|
|
5139
5138
|
moreType: { default: "text" }
|
|
5140
5139
|
},
|
|
@@ -5181,20 +5180,23 @@ var _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
5181
5180
|
nextButtons: data.slice(showNumber)
|
|
5182
5181
|
};
|
|
5183
5182
|
};
|
|
5184
|
-
const createCallbackParams = (params, e) =>
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5183
|
+
const createCallbackParams = (params, e) => {
|
|
5184
|
+
var _a;
|
|
5185
|
+
return {
|
|
5186
|
+
/**
|
|
5187
|
+
* 解析后的按钮数据中的text
|
|
5188
|
+
* @version v0.1.17
|
|
5189
|
+
*/
|
|
5190
|
+
text: params.text,
|
|
5191
|
+
row: params.row,
|
|
5192
|
+
buttonRow: params.buttonRow,
|
|
5193
|
+
index: params.index,
|
|
5194
|
+
rowIndex: params.index,
|
|
5195
|
+
e,
|
|
5196
|
+
formRefs: (_a = formRefs == null ? void 0 : formRefs.value) == null ? void 0 : _a[params.index],
|
|
5197
|
+
...params.rest
|
|
5198
|
+
};
|
|
5199
|
+
};
|
|
5198
5200
|
const getConfirmMsg = (buttonRow, callbackParams) => {
|
|
5199
5201
|
var _a, _b;
|
|
5200
5202
|
let message = t("plus.table.confirmToPerformThisOperation");
|
|
@@ -5367,30 +5369,28 @@ var _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
5367
5369
|
}
|
|
5368
5370
|
};
|
|
5369
5371
|
return (_ctx, _cache) => {
|
|
5370
|
-
return openBlock(),
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
width: _ctx.width || 200
|
|
5376
|
-
}, _ctx.actionBarTableColumnProps), {
|
|
5377
|
-
default: withCtx(({ row, $index, ...rest }) => [
|
|
5378
|
-
createCommentVNode("\n \u7528\u5355\u5143\u7D20\u6570\u7EC4\u8BA9 getSubButtons \u6BCF\u884C\u53EA\u6267\u884C\u4E00\u6B21\uFF1A\n \u539F\u5148 preButtons / showMore / nextButtons \u5404\u8C03\u7528\u4E00\u6B21\uFF0C\n 500 \u884C \xD7 11 \u4E2A\u6309\u94AE \u2248 \u4E0A\u4E07\u6B21 show()\uFF08\u542B\u6743\u9650\u5224\u65AD\uFF09\u3002\n "),
|
|
5372
|
+
return openBlock(), createElementBlock(
|
|
5373
|
+
Fragment,
|
|
5374
|
+
null,
|
|
5375
|
+
[
|
|
5376
|
+
createCommentVNode("\n \u7528\u5355\u5143\u7D20\u6570\u7EC4\u8BA9 getSubButtons \u6BCF\u884C\u53EA\u6267\u884C\u4E00\u6B21\uFF1A\n preButtons / showMore / nextButtons \u5171\u7528\u540C\u4E00\u4EFD\u8BA1\u7B97\u7ED3\u679C\n "),
|
|
5379
5377
|
(openBlock(true), createElementBlock(
|
|
5380
5378
|
Fragment,
|
|
5381
5379
|
null,
|
|
5382
|
-
renderList([getSubButtons(row,
|
|
5380
|
+
renderList([getSubButtons(_ctx.row, _ctx.index)], (cell) => {
|
|
5383
5381
|
return openBlock(), createElementBlock(
|
|
5384
5382
|
Fragment,
|
|
5385
|
-
{
|
|
5383
|
+
{
|
|
5384
|
+
key: cell.preButtons.length
|
|
5385
|
+
},
|
|
5386
5386
|
[
|
|
5387
5387
|
createCommentVNode(" \u663E\u793A\u51FA\u6765\u7684\u6309\u94AE "),
|
|
5388
5388
|
(openBlock(true), createElementBlock(
|
|
5389
5389
|
Fragment,
|
|
5390
5390
|
null,
|
|
5391
5391
|
renderList(cell.preButtons, (buttonRow) => {
|
|
5392
|
-
return openBlock(), createBlock(resolveDynamicComponent(render(row, buttonRow,
|
|
5393
|
-
key: getButtonKey(buttonRow, row,
|
|
5392
|
+
return openBlock(), createBlock(resolveDynamicComponent(render(_ctx.row, buttonRow, _ctx.index, _ctx.rest)), {
|
|
5393
|
+
key: getButtonKey(buttonRow, _ctx.row, _ctx.index)
|
|
5394
5394
|
});
|
|
5395
5395
|
}),
|
|
5396
5396
|
128
|
|
@@ -5417,11 +5417,11 @@ var _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
5417
5417
|
return openBlock(), createBlock(
|
|
5418
5418
|
unref(ElDropdownItem),
|
|
5419
5419
|
{
|
|
5420
|
-
key: getButtonKey(buttonRow, row,
|
|
5420
|
+
key: getButtonKey(buttonRow, _ctx.row, _ctx.index)
|
|
5421
5421
|
},
|
|
5422
5422
|
{
|
|
5423
5423
|
default: withCtx(() => [
|
|
5424
|
-
(openBlock(), createBlock(resolveDynamicComponent(render(row, buttonRow,
|
|
5424
|
+
(openBlock(), createBlock(resolveDynamicComponent(render(_ctx.row, buttonRow, _ctx.index, _ctx.rest))))
|
|
5425
5425
|
]),
|
|
5426
5426
|
_: 2
|
|
5427
5427
|
/* DYNAMIC */
|
|
@@ -5442,7 +5442,7 @@ var _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
5442
5442
|
)
|
|
5443
5443
|
]),
|
|
5444
5444
|
default: withCtx(() => [
|
|
5445
|
-
_ctx.moreType === "icon" ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
5445
|
+
_ctx.moreType === "icon" ? (openBlock(), createElementBlock("span", _hoisted_1$j, [
|
|
5446
5446
|
renderSlot(_ctx.$slots, "action-bar-more-icon", {}, () => [
|
|
5447
5447
|
createVNode(unref(ElIcon), null, {
|
|
5448
5448
|
default: withCtx(() => [
|
|
@@ -5491,6 +5491,73 @@ var _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
5491
5491
|
128
|
|
5492
5492
|
/* KEYED_FRAGMENT */
|
|
5493
5493
|
))
|
|
5494
|
+
],
|
|
5495
|
+
2112
|
|
5496
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
5497
|
+
);
|
|
5498
|
+
};
|
|
5499
|
+
}
|
|
5500
|
+
});
|
|
5501
|
+
|
|
5502
|
+
var PlusTableActionBarContent = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__file", "table-action-bar-content.vue"]]);
|
|
5503
|
+
|
|
5504
|
+
var _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
5505
|
+
...{
|
|
5506
|
+
name: "PlusTableActionBar"
|
|
5507
|
+
},
|
|
5508
|
+
__name: "table-action-bar",
|
|
5509
|
+
props: {
|
|
5510
|
+
label: { default: "" },
|
|
5511
|
+
fixed: { default: "right" },
|
|
5512
|
+
showNumber: { type: [Number, Function], default: 3 },
|
|
5513
|
+
showLimitIncludeMore: { type: Boolean, default: false },
|
|
5514
|
+
type: { default: "link" },
|
|
5515
|
+
buttons: { default: () => [] },
|
|
5516
|
+
width: { default: 200 },
|
|
5517
|
+
actionBarTableColumnProps: { default: () => ({}) },
|
|
5518
|
+
confirmType: { default: "messageBox" },
|
|
5519
|
+
moreType: { default: "text" }
|
|
5520
|
+
},
|
|
5521
|
+
emits: ["clickAction", "clickActionConfirmCancel"],
|
|
5522
|
+
setup(__props, { emit: __emit }) {
|
|
5523
|
+
const emit = __emit;
|
|
5524
|
+
const { t } = useLocale();
|
|
5525
|
+
const handleClickAction = (data) => emit("clickAction", data);
|
|
5526
|
+
const handleClickActionConfirmCancel = (data) => emit("clickActionConfirmCancel", data);
|
|
5527
|
+
return (_ctx, _cache) => {
|
|
5528
|
+
return openBlock(), createBlock(unref(ElTableColumn), mergeProps({
|
|
5529
|
+
key: "actionBar",
|
|
5530
|
+
"class-name": "plus-table-action-bar",
|
|
5531
|
+
label: unref(_ctx.label) || unref(t)("plus.table.action"),
|
|
5532
|
+
fixed: _ctx.fixed || "right",
|
|
5533
|
+
width: _ctx.width || 200
|
|
5534
|
+
}, _ctx.actionBarTableColumnProps), {
|
|
5535
|
+
default: withCtx(({ row, $index, ...rest }) => [
|
|
5536
|
+
createCommentVNode(" \u6309\u94AE\u5185\u5BB9\u903B\u8F91\u4E0E PlusTableV2 \u5171\u7528 "),
|
|
5537
|
+
createVNode(PlusTableActionBarContent, {
|
|
5538
|
+
row,
|
|
5539
|
+
index: $index,
|
|
5540
|
+
rest,
|
|
5541
|
+
type: _ctx.type,
|
|
5542
|
+
buttons: _ctx.buttons,
|
|
5543
|
+
"show-number": _ctx.showNumber,
|
|
5544
|
+
"show-limit-include-more": _ctx.showLimitIncludeMore,
|
|
5545
|
+
"confirm-type": _ctx.confirmType,
|
|
5546
|
+
"more-type": _ctx.moreType,
|
|
5547
|
+
onClickAction: handleClickAction,
|
|
5548
|
+
onClickActionConfirmCancel: handleClickActionConfirmCancel
|
|
5549
|
+
}, createSlots({
|
|
5550
|
+
_: 2
|
|
5551
|
+
/* DYNAMIC */
|
|
5552
|
+
}, [
|
|
5553
|
+
_ctx.$slots["action-bar-more-icon"] ? {
|
|
5554
|
+
name: "action-bar-more-icon",
|
|
5555
|
+
fn: withCtx(() => [
|
|
5556
|
+
renderSlot(_ctx.$slots, "action-bar-more-icon")
|
|
5557
|
+
]),
|
|
5558
|
+
key: "0"
|
|
5559
|
+
} : void 0
|
|
5560
|
+
]), 1032, ["row", "index", "rest", "type", "buttons", "show-number", "show-limit-include-more", "confirm-type", "more-type"])
|
|
5494
5561
|
]),
|
|
5495
5562
|
_: 3
|
|
5496
5563
|
/* FORWARDED */
|
|
@@ -5499,9 +5566,9 @@ var _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
5499
5566
|
}
|
|
5500
5567
|
});
|
|
5501
5568
|
|
|
5502
|
-
var PlusTableActionBar = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5569
|
+
var PlusTableActionBar = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__file", "table-action-bar.vue"]]);
|
|
5503
5570
|
|
|
5504
|
-
var _sfc_main$
|
|
5571
|
+
var _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
5505
5572
|
...{
|
|
5506
5573
|
name: "PlusRender"
|
|
5507
5574
|
},
|
|
@@ -5571,12 +5638,12 @@ var _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
5571
5638
|
}
|
|
5572
5639
|
});
|
|
5573
5640
|
|
|
5574
|
-
var Render = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5641
|
+
var Render = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__file", "index.vue"]]);
|
|
5575
5642
|
|
|
5576
5643
|
const PlusRender = Render;
|
|
5577
5644
|
|
|
5578
|
-
const _hoisted_1$
|
|
5579
|
-
var _sfc_main$
|
|
5645
|
+
const _hoisted_1$i = { class: "plus-date-picker__middle" };
|
|
5646
|
+
var _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
5580
5647
|
...{
|
|
5581
5648
|
name: "PlusDatePicker"
|
|
5582
5649
|
},
|
|
@@ -5681,7 +5748,7 @@ var _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
5681
5748
|
}), null, 16, ["modelValue", "type", "value-format", "placeholder", "disabled"]),
|
|
5682
5749
|
createElementVNode(
|
|
5683
5750
|
"span",
|
|
5684
|
-
_hoisted_1$
|
|
5751
|
+
_hoisted_1$i,
|
|
5685
5752
|
toDisplayString(_ctx.rangeSeparator),
|
|
5686
5753
|
1
|
|
5687
5754
|
/* TEXT */
|
|
@@ -5712,11 +5779,11 @@ var _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
5712
5779
|
}
|
|
5713
5780
|
});
|
|
5714
5781
|
|
|
5715
|
-
var DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5782
|
+
var DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__file", "index.vue"]]);
|
|
5716
5783
|
|
|
5717
5784
|
const PlusDatePicker = DatePicker;
|
|
5718
5785
|
|
|
5719
|
-
var _sfc_main$
|
|
5786
|
+
var _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
5720
5787
|
...{
|
|
5721
5788
|
name: "PlusInputTag"
|
|
5722
5789
|
},
|
|
@@ -5853,7 +5920,7 @@ var _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
5853
5920
|
}
|
|
5854
5921
|
});
|
|
5855
5922
|
|
|
5856
|
-
var InputTag = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5923
|
+
var InputTag = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__file", "index.vue"]]);
|
|
5857
5924
|
|
|
5858
5925
|
const PlusInputTag = InputTag;
|
|
5859
5926
|
|
|
@@ -5950,9 +6017,9 @@ const hasFieldComponent = (valueType) => Object.keys(FieldComponentMap).includes
|
|
|
5950
6017
|
);
|
|
5951
6018
|
const getFieldComponent = (valueType) => Reflect.get(FieldComponentMap, valueType) || {};
|
|
5952
6019
|
|
|
5953
|
-
const _hoisted_1$
|
|
6020
|
+
const _hoisted_1$h = { class: "el-form-item__error" };
|
|
5954
6021
|
const _hoisted_2$8 = { class: "plus-form-item__label" };
|
|
5955
|
-
var _sfc_main$
|
|
6022
|
+
var _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
5956
6023
|
...{
|
|
5957
6024
|
name: "PlusFormItem"
|
|
5958
6025
|
},
|
|
@@ -6507,7 +6574,7 @@ var _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
6507
6574
|
unref(isFunction)(_ctx.renderErrorMessage) ? {
|
|
6508
6575
|
name: "error",
|
|
6509
6576
|
fn: withCtx(({ error }) => [
|
|
6510
|
-
createElementVNode("div", _hoisted_1$
|
|
6577
|
+
createElementVNode("div", _hoisted_1$h, [
|
|
6511
6578
|
(openBlock(), createBlock(resolveDynamicComponent(_ctx.renderErrorMessage), mergeProps(props, {
|
|
6512
6579
|
value: state.value,
|
|
6513
6580
|
error,
|
|
@@ -6578,11 +6645,11 @@ var _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
6578
6645
|
}
|
|
6579
6646
|
});
|
|
6580
6647
|
|
|
6581
|
-
var FormItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6648
|
+
var FormItem = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__file", "index.vue"]]);
|
|
6582
6649
|
|
|
6583
6650
|
const PlusFormItem = FormItem;
|
|
6584
6651
|
|
|
6585
|
-
var _sfc_main$
|
|
6652
|
+
var _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
6586
6653
|
...{
|
|
6587
6654
|
name: "PlusCollapseTransition"
|
|
6588
6655
|
},
|
|
@@ -6633,9 +6700,9 @@ var _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
6633
6700
|
}
|
|
6634
6701
|
});
|
|
6635
6702
|
|
|
6636
|
-
var PlusCollapseTransition = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6703
|
+
var PlusCollapseTransition = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__file", "collapse-transition.vue"]]);
|
|
6637
6704
|
|
|
6638
|
-
const _hoisted_1$
|
|
6705
|
+
const _hoisted_1$g = {
|
|
6639
6706
|
key: 0,
|
|
6640
6707
|
class: "plus-form-item-previous"
|
|
6641
6708
|
};
|
|
@@ -6643,7 +6710,7 @@ const _hoisted_2$7 = {
|
|
|
6643
6710
|
key: 1,
|
|
6644
6711
|
class: "plus-form-item-extra"
|
|
6645
6712
|
};
|
|
6646
|
-
var _sfc_main$
|
|
6713
|
+
var _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
6647
6714
|
...{
|
|
6648
6715
|
name: "PlusFormContent"
|
|
6649
6716
|
},
|
|
@@ -6708,7 +6775,7 @@ var _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
6708
6775
|
{
|
|
6709
6776
|
default: withCtx(() => [
|
|
6710
6777
|
createCommentVNode(" el-form-item\u4E0A\u4E00\u884C\u7684\u5185\u5BB9 "),
|
|
6711
|
-
item.renderPrevious || _ctx.$slots[unref(getPreviousSlotName)(item.prop)] ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
6778
|
+
item.renderPrevious || _ctx.$slots[unref(getPreviousSlotName)(item.prop)] ? (openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
6712
6779
|
unref(isFunction)(item.renderPrevious) ? (openBlock(), createBlock(
|
|
6713
6780
|
resolveDynamicComponent(item.renderPrevious),
|
|
6714
6781
|
normalizeProps(mergeProps({ key: 0 }, item)),
|
|
@@ -6787,10 +6854,10 @@ var _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
6787
6854
|
}
|
|
6788
6855
|
});
|
|
6789
6856
|
|
|
6790
|
-
var PlusFormContent = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6857
|
+
var PlusFormContent = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__file", "form-content.vue"]]);
|
|
6791
6858
|
|
|
6792
|
-
const _hoisted_1$
|
|
6793
|
-
var _sfc_main$
|
|
6859
|
+
const _hoisted_1$f = { class: "plus-form__group__item__icon" };
|
|
6860
|
+
var _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
6794
6861
|
...{
|
|
6795
6862
|
name: "PlusForm",
|
|
6796
6863
|
inheritAttrs: false
|
|
@@ -6940,7 +7007,7 @@ var _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
6940
7007
|
icon: groupItem.icon,
|
|
6941
7008
|
index
|
|
6942
7009
|
}, () => [
|
|
6943
|
-
createElementVNode("div", _hoisted_1$
|
|
7010
|
+
createElementVNode("div", _hoisted_1$f, [
|
|
6944
7011
|
groupItem.icon ? (openBlock(), createBlock(
|
|
6945
7012
|
unref(ElIcon),
|
|
6946
7013
|
{ key: 0 },
|
|
@@ -7085,7 +7152,7 @@ var _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
7085
7152
|
}
|
|
7086
7153
|
});
|
|
7087
7154
|
|
|
7088
|
-
var Form = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
7155
|
+
var Form = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__file", "index.vue"]]);
|
|
7089
7156
|
|
|
7090
7157
|
const PlusForm = Form;
|
|
7091
7158
|
|
|
@@ -7128,7 +7195,7 @@ const DisplayComponentMap = {
|
|
|
7128
7195
|
const hasDisplayComponent = (valueType) => Object.keys(DisplayComponentMap).includes(valueType);
|
|
7129
7196
|
const getDisplayComponent = (valueType) => Reflect.get(DisplayComponentMap, valueType) || {};
|
|
7130
7197
|
|
|
7131
|
-
const _hoisted_1$
|
|
7198
|
+
const _hoisted_1$e = ["innerHTML"];
|
|
7132
7199
|
const _hoisted_2$6 = { class: "plus-display-item" };
|
|
7133
7200
|
const _hoisted_3$3 = /* @__PURE__ */ createElementVNode(
|
|
7134
7201
|
"svg",
|
|
@@ -7149,7 +7216,7 @@ const _hoisted_3$3 = /* @__PURE__ */ createElementVNode(
|
|
|
7149
7216
|
-1
|
|
7150
7217
|
/* HOISTED */
|
|
7151
7218
|
);
|
|
7152
|
-
var _sfc_main$
|
|
7219
|
+
var _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
7153
7220
|
...{
|
|
7154
7221
|
name: "PlusDisplayItem"
|
|
7155
7222
|
},
|
|
@@ -7520,7 +7587,7 @@ var _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
7520
7587
|
createElementVNode("span", {
|
|
7521
7588
|
class: "plus-display-item",
|
|
7522
7589
|
innerHTML: _ctx.column.renderHTML(displayValue.value, renderParams.value)
|
|
7523
|
-
}, null, 8, _hoisted_1$
|
|
7590
|
+
}, null, 8, _hoisted_1$e)
|
|
7524
7591
|
],
|
|
7525
7592
|
2112
|
|
7526
7593
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
@@ -7787,13 +7854,12 @@ var _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
7787
7854
|
}
|
|
7788
7855
|
});
|
|
7789
7856
|
|
|
7790
|
-
var DisplayItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
7857
|
+
var DisplayItem = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__file", "index.vue"]]);
|
|
7791
7858
|
|
|
7792
7859
|
const PlusDisplayItem = DisplayItem;
|
|
7793
7860
|
|
|
7794
|
-
const _hoisted_1$
|
|
7795
|
-
|
|
7796
|
-
var _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
7861
|
+
const _hoisted_1$d = { class: "plus-table-column__header" };
|
|
7862
|
+
var _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
7797
7863
|
...{
|
|
7798
7864
|
name: "PlusTableColumn"
|
|
7799
7865
|
},
|
|
@@ -7803,14 +7869,12 @@ var _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
7803
7869
|
editable: { type: [Boolean, String], default: false },
|
|
7804
7870
|
tableDataLength: { default: 0 },
|
|
7805
7871
|
subPageInfo: { default: () => ({}) },
|
|
7806
|
-
emptyValue: { default: void 0 }
|
|
7807
|
-
plainTextCell: { type: Boolean, default: false }
|
|
7872
|
+
emptyValue: { default: void 0 }
|
|
7808
7873
|
},
|
|
7809
7874
|
emits: ["formChange"],
|
|
7810
7875
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
7811
7876
|
const props = __props;
|
|
7812
7877
|
const emit = __emit;
|
|
7813
|
-
const slots = useSlots();
|
|
7814
7878
|
const instance = getCurrentInstance();
|
|
7815
7879
|
const store = computed(() => {
|
|
7816
7880
|
var _a;
|
|
@@ -7829,36 +7893,6 @@ var _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
7829
7893
|
);
|
|
7830
7894
|
const plusDisplayItemInstance = ref();
|
|
7831
7895
|
const formRefs = inject(TableFormRefInjectionKey);
|
|
7832
|
-
const PLAIN_VALUE_TYPE_SET = /* @__PURE__ */ new Set([void 0, "", "input"]);
|
|
7833
|
-
const isPlainColumn = (item) => {
|
|
7834
|
-
if (!props.plainTextCell) return false;
|
|
7835
|
-
if (props.editable !== false) return false;
|
|
7836
|
-
if (item.editable === true) return false;
|
|
7837
|
-
if (!PLAIN_VALUE_TYPE_SET.has(item.valueType)) return false;
|
|
7838
|
-
if (item.render || item.renderHTML || item.formatter || item.customGetStatus) return false;
|
|
7839
|
-
if (item.fieldProps !== void 0 && item.fieldProps !== null) return false;
|
|
7840
|
-
if (item.formProps !== void 0 && item.formProps !== null) return false;
|
|
7841
|
-
if (item.fieldSlots && Object.keys(item.fieldSlots).length) return false;
|
|
7842
|
-
if (slots && slots[getTableCellSlotName(item.prop)]) return false;
|
|
7843
|
-
return true;
|
|
7844
|
-
};
|
|
7845
|
-
const plainColumnSet = computed(() => {
|
|
7846
|
-
const set2 = /* @__PURE__ */ new Set();
|
|
7847
|
-
props.columns.forEach((item) => {
|
|
7848
|
-
var _a;
|
|
7849
|
-
if ((_a = item.children) == null ? void 0 : _a.length) return;
|
|
7850
|
-
if (isPlainColumn(item)) set2.add(item);
|
|
7851
|
-
});
|
|
7852
|
-
return set2;
|
|
7853
|
-
});
|
|
7854
|
-
const getPlainValue = (item, row) => {
|
|
7855
|
-
var _a, _b;
|
|
7856
|
-
const value = getValue(row, item.prop);
|
|
7857
|
-
if (value === null || value === void 0 || value === "") {
|
|
7858
|
-
return (_b = (_a = item.emptyValue) != null ? _a : props.emptyValue) != null ? _b : "";
|
|
7859
|
-
}
|
|
7860
|
-
return value;
|
|
7861
|
-
};
|
|
7862
7896
|
const setFormRef = () => {
|
|
7863
7897
|
var _a, _b;
|
|
7864
7898
|
if (!((_a = plusDisplayItemInstance.value) == null ? void 0 : _a.length)) return;
|
|
@@ -7871,11 +7905,7 @@ var _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
7871
7905
|
set(formRefs.value[item.rowIndex], item.cellIndex, item);
|
|
7872
7906
|
}
|
|
7873
7907
|
};
|
|
7874
|
-
const needFormRefs = computed(
|
|
7875
|
-
() => props.editable !== false || !props.plainTextCell || props.columns.some((item) => item.editable === true)
|
|
7876
|
-
);
|
|
7877
7908
|
const cellInstanceSignature = computed(() => {
|
|
7878
|
-
if (!needFormRefs.value) return "";
|
|
7879
7909
|
const list = plusDisplayItemInstance.value;
|
|
7880
7910
|
if (!(list == null ? void 0 : list.length)) return "";
|
|
7881
7911
|
return list.map((item) => {
|
|
@@ -7886,7 +7916,6 @@ var _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
7886
7916
|
watch(
|
|
7887
7917
|
() => [props.tableDataLength, cellInstanceSignature.value, props.subPageInfo],
|
|
7888
7918
|
() => {
|
|
7889
|
-
if (!needFormRefs.value) return;
|
|
7890
7919
|
setFormRef();
|
|
7891
7920
|
},
|
|
7892
7921
|
{
|
|
@@ -7928,7 +7957,7 @@ var _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
7928
7957
|
"min-width": item.minWidth
|
|
7929
7958
|
}), {
|
|
7930
7959
|
header: withCtx((scoped) => [
|
|
7931
|
-
createElementVNode("span", _hoisted_1$
|
|
7960
|
+
createElementVNode("span", _hoisted_1$d, [
|
|
7932
7961
|
item.renderHeader && unref(isFunction)(item.renderHeader) ? (openBlock(), createBlock(unref(PlusRender), {
|
|
7933
7962
|
key: 0,
|
|
7934
7963
|
render: item.renderHeader,
|
|
@@ -8021,23 +8050,8 @@ var _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
8021
8050
|
],
|
|
8022
8051
|
64
|
|
8023
8052
|
/* STABLE_FRAGMENT */
|
|
8024
|
-
)) : plainColumnSet.value.has(item) ? (openBlock(), createElementBlock(
|
|
8025
|
-
Fragment,
|
|
8026
|
-
{ key: 1 },
|
|
8027
|
-
[
|
|
8028
|
-
createCommentVNode(" \u7EAF\u6587\u672C\u5217\u5FEB\u8DEF\u5F84\uFF1A\u4E0D\u521B\u5EFA\u7EC4\u4EF6\u5B9E\u4F8B\u3001\u4E0D\u6CE8\u518C\u4EFB\u4F55 watcher "),
|
|
8029
|
-
createElementVNode(
|
|
8030
|
-
"span",
|
|
8031
|
-
_hoisted_2$5,
|
|
8032
|
-
toDisplayString(getPlainValue(item, row)),
|
|
8033
|
-
1
|
|
8034
|
-
/* TEXT */
|
|
8035
|
-
)
|
|
8036
|
-
],
|
|
8037
|
-
2112
|
|
8038
|
-
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
8039
8053
|
)) : (openBlock(), createBlock(unref(PlusDisplayItem), {
|
|
8040
|
-
key:
|
|
8054
|
+
key: 1,
|
|
8041
8055
|
ref_for: true,
|
|
8042
8056
|
ref_key: "plusDisplayItemInstance",
|
|
8043
8057
|
ref: plusDisplayItemInstance,
|
|
@@ -8074,9 +8088,9 @@ var _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
8074
8088
|
}
|
|
8075
8089
|
});
|
|
8076
8090
|
|
|
8077
|
-
var PlusTableColumn = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
8091
|
+
var PlusTableColumn = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__file", "table-column.vue"]]);
|
|
8078
8092
|
|
|
8079
|
-
var _sfc_main$
|
|
8093
|
+
var _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
8080
8094
|
...{
|
|
8081
8095
|
name: "PlusTableTableColumnIndex"
|
|
8082
8096
|
},
|
|
@@ -8150,7 +8164,7 @@ var _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
8150
8164
|
}
|
|
8151
8165
|
});
|
|
8152
8166
|
|
|
8153
|
-
var PlusTableTableColumnIndex = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
8167
|
+
var PlusTableTableColumnIndex = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__file", "table-column-index.vue"]]);
|
|
8154
8168
|
|
|
8155
8169
|
/**!
|
|
8156
8170
|
* Sortable 1.15.0
|
|
@@ -11172,8 +11186,8 @@ _extends(Remove, {
|
|
|
11172
11186
|
Sortable.mount(new AutoScrollPlugin());
|
|
11173
11187
|
Sortable.mount(Remove, Revert);
|
|
11174
11188
|
|
|
11175
|
-
const _hoisted_1$
|
|
11176
|
-
var _sfc_main$
|
|
11189
|
+
const _hoisted_1$c = { class: "plus-table-column-drag-icon" };
|
|
11190
|
+
var _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
11177
11191
|
...{
|
|
11178
11192
|
name: "PlusTableColumnDragSort"
|
|
11179
11193
|
},
|
|
@@ -11224,7 +11238,7 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
11224
11238
|
"class-name": "plus-table-column-drag-sort"
|
|
11225
11239
|
}, _ctx.dragSortableTableColumnProps), {
|
|
11226
11240
|
default: withCtx(() => [
|
|
11227
|
-
createElementVNode("span", _hoisted_1$
|
|
11241
|
+
createElementVNode("span", _hoisted_1$c, [
|
|
11228
11242
|
renderSlot(_ctx.$slots, "drag-sort-icon", {}, () => [
|
|
11229
11243
|
createTextVNode("\u2637")
|
|
11230
11244
|
])
|
|
@@ -11237,13 +11251,13 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
11237
11251
|
}
|
|
11238
11252
|
});
|
|
11239
11253
|
|
|
11240
|
-
var PlusTableColumnDragSort = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
11254
|
+
var PlusTableColumnDragSort = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__file", "table-column-drag-sort.vue"]]);
|
|
11241
11255
|
|
|
11242
|
-
const _hoisted_1$
|
|
11256
|
+
const _hoisted_1$b = {
|
|
11243
11257
|
key: 0,
|
|
11244
11258
|
style: { "padding-top": "12px" }
|
|
11245
11259
|
};
|
|
11246
|
-
var _sfc_main$
|
|
11260
|
+
var _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
11247
11261
|
...{
|
|
11248
11262
|
name: "PlusPopover"
|
|
11249
11263
|
},
|
|
@@ -11289,7 +11303,7 @@ var _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
11289
11303
|
]),
|
|
11290
11304
|
default: withCtx(() => [
|
|
11291
11305
|
renderSlot(_ctx.$slots, "default"),
|
|
11292
|
-
_ctx.hasShowBottomButton ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
11306
|
+
_ctx.hasShowBottomButton ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
11293
11307
|
createVNode(unref(ElButton), {
|
|
11294
11308
|
size: "small",
|
|
11295
11309
|
plain: "",
|
|
@@ -11330,12 +11344,12 @@ var _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
11330
11344
|
}
|
|
11331
11345
|
});
|
|
11332
11346
|
|
|
11333
|
-
var Popover = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
11347
|
+
var Popover = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__file", "index.vue"]]);
|
|
11334
11348
|
|
|
11335
11349
|
const PlusPopover = Popover;
|
|
11336
11350
|
|
|
11337
|
-
const _hoisted_1$
|
|
11338
|
-
const _hoisted_2$
|
|
11351
|
+
const _hoisted_1$a = { class: "plus-table-title-bar" };
|
|
11352
|
+
const _hoisted_2$5 = { class: "plus-table-title-bar__title" };
|
|
11339
11353
|
const _hoisted_3$2 = { class: "plus-table-title-bar__toolbar" };
|
|
11340
11354
|
const _hoisted_4$2 = { class: "plus-table-title-bar__toolbar__density" };
|
|
11341
11355
|
const _hoisted_5$2 = /* @__PURE__ */ createElementVNode(
|
|
@@ -11360,7 +11374,7 @@ const _hoisted_7$1 = {
|
|
|
11360
11374
|
};
|
|
11361
11375
|
const _hoisted_8$1 = { key: 1 };
|
|
11362
11376
|
const _hoisted_9$1 = { key: 1 };
|
|
11363
|
-
var _sfc_main$
|
|
11377
|
+
var _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
11364
11378
|
...{
|
|
11365
11379
|
name: "PlusTableToolbar"
|
|
11366
11380
|
},
|
|
@@ -11511,8 +11525,8 @@ var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
11511
11525
|
});
|
|
11512
11526
|
return (_ctx, _cache) => {
|
|
11513
11527
|
var _a, _b, _c;
|
|
11514
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
11515
|
-
createElementVNode("div", _hoisted_2$
|
|
11528
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
11529
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
11516
11530
|
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
11517
11531
|
createTextVNode(
|
|
11518
11532
|
toDisplayString(titleBarConfig.value.title),
|
|
@@ -11813,10 +11827,46 @@ var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
11813
11827
|
}
|
|
11814
11828
|
});
|
|
11815
11829
|
|
|
11816
|
-
var PlusTableTitleBar = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
11830
|
+
var PlusTableTitleBar = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__file", "table-title-bar.vue"]]);
|
|
11831
|
+
|
|
11832
|
+
const useTableColumns = ({ columns, skipEqual = true }) => {
|
|
11833
|
+
const filterColumns = shallowRef([]);
|
|
11834
|
+
const subColumns = shallowRef([]);
|
|
11835
|
+
const columnsIsChange = ref(false);
|
|
11836
|
+
const resolveSubColumns = (list) => list.filter((item) => unref(item.hideInTable) !== true && item.headerIsChecked !== false);
|
|
11837
|
+
watch(
|
|
11838
|
+
columns,
|
|
11839
|
+
(val, oldVal) => {
|
|
11840
|
+
if (skipEqual && oldVal && isEqual(val, oldVal)) return;
|
|
11841
|
+
const filterOriginColumns = val.filter((item) => unref(item.hideInTable) !== true);
|
|
11842
|
+
filterColumns.value = filterOriginColumns.map((item) => {
|
|
11843
|
+
var _a;
|
|
11844
|
+
return {
|
|
11845
|
+
...item,
|
|
11846
|
+
headerIsChecked: (_a = item.headerIsChecked) != null ? _a : true
|
|
11847
|
+
};
|
|
11848
|
+
});
|
|
11849
|
+
subColumns.value = filterOriginColumns.filter((item) => unref(item.headerIsChecked) !== false);
|
|
11850
|
+
columnsIsChange.value = !columnsIsChange.value;
|
|
11851
|
+
},
|
|
11852
|
+
{
|
|
11853
|
+
immediate: true
|
|
11854
|
+
}
|
|
11855
|
+
);
|
|
11856
|
+
const setFilterColumns = (_columns) => {
|
|
11857
|
+
filterColumns.value = _columns;
|
|
11858
|
+
subColumns.value = resolveSubColumns(_columns);
|
|
11859
|
+
};
|
|
11860
|
+
return {
|
|
11861
|
+
filterColumns,
|
|
11862
|
+
subColumns,
|
|
11863
|
+
columnsIsChange,
|
|
11864
|
+
setFilterColumns
|
|
11865
|
+
};
|
|
11866
|
+
};
|
|
11817
11867
|
|
|
11818
|
-
const _hoisted_1$
|
|
11819
|
-
var _sfc_main$
|
|
11868
|
+
const _hoisted_1$9 = { class: "plus-table-expand-col" };
|
|
11869
|
+
var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
11820
11870
|
...{
|
|
11821
11871
|
name: "PlusTable",
|
|
11822
11872
|
inheritAttrs: false
|
|
@@ -11857,8 +11907,7 @@ var _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
11857
11907
|
editable: { type: [Boolean, String], default: false },
|
|
11858
11908
|
adaptive: { type: [Boolean, Object], default: false },
|
|
11859
11909
|
filterTableHeaderOverflowLabelLength: {},
|
|
11860
|
-
emptyValue: { default: void 0 }
|
|
11861
|
-
plainTextCell: { type: Boolean, default: false }
|
|
11910
|
+
emptyValue: { default: void 0 }
|
|
11862
11911
|
},
|
|
11863
11912
|
emits: ["paginationChange", "clickAction", "clickActionConfirmCancel", "dragSortEnd", "formChange", "refresh", "edited", "cell-click", "cell-dblclick", "filterTableHeader", "radioChange"],
|
|
11864
11913
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -11866,9 +11915,6 @@ var _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
11866
11915
|
const props = __props;
|
|
11867
11916
|
const emit = __emit;
|
|
11868
11917
|
const radioRow = ref();
|
|
11869
|
-
const subColumns = shallowRef([]);
|
|
11870
|
-
const columnsIsChange = ref(false);
|
|
11871
|
-
const filterColumns = shallowRef([]);
|
|
11872
11918
|
const tableInstance = shallowRef(null);
|
|
11873
11919
|
const tableWrapperInstance = ref(null);
|
|
11874
11920
|
const paginationInstance = ref(null);
|
|
@@ -11911,25 +11957,9 @@ var _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
11911
11957
|
provide(TableFormRefInjectionKey, formRefs);
|
|
11912
11958
|
const formFieldRefs = shallowRef({});
|
|
11913
11959
|
provide(TableFormFieldRefInjectionKey, formFieldRefs);
|
|
11914
|
-
|
|
11915
|
-
() => props.columns
|
|
11916
|
-
|
|
11917
|
-
if (oldVal && isEqual(val, oldVal)) return;
|
|
11918
|
-
const filterOriginColumns = val.filter((item) => unref(item.hideInTable) !== true);
|
|
11919
|
-
filterColumns.value = filterOriginColumns.map((item) => {
|
|
11920
|
-
var _a2;
|
|
11921
|
-
return {
|
|
11922
|
-
...item,
|
|
11923
|
-
headerIsChecked: (_a2 = item.headerIsChecked) != null ? _a2 : true
|
|
11924
|
-
};
|
|
11925
|
-
});
|
|
11926
|
-
subColumns.value = filterOriginColumns.filter((item) => unref(item.headerIsChecked) !== false);
|
|
11927
|
-
columnsIsChange.value = !columnsIsChange.value;
|
|
11928
|
-
},
|
|
11929
|
-
{
|
|
11930
|
-
immediate: true
|
|
11931
|
-
}
|
|
11932
|
-
);
|
|
11960
|
+
const { subColumns, filterColumns, columnsIsChange, setFilterColumns } = useTableColumns({
|
|
11961
|
+
columns: () => props.columns
|
|
11962
|
+
});
|
|
11933
11963
|
watch(
|
|
11934
11964
|
() => props.defaultSelectedRadioRow,
|
|
11935
11965
|
(val) => {
|
|
@@ -11949,11 +11979,8 @@ var _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
11949
11979
|
emit("clickActionConfirmCancel", callbackParams);
|
|
11950
11980
|
};
|
|
11951
11981
|
const handleFilterTableConfirm = (_columns, eventType) => {
|
|
11952
|
-
|
|
11982
|
+
setFilterColumns(_columns);
|
|
11953
11983
|
emit("filterTableHeader", _columns, eventType);
|
|
11954
|
-
subColumns.value = _columns.filter(
|
|
11955
|
-
(item) => unref(item.hideInTable) !== true && item.headerIsChecked !== false
|
|
11956
|
-
);
|
|
11957
11984
|
};
|
|
11958
11985
|
const handleClickDensity = (size2) => {
|
|
11959
11986
|
state.size = size2;
|
|
@@ -12069,9 +12096,9 @@ var _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
12069
12096
|
_ctx.titleBar ? (openBlock(), createBlock(PlusTableTitleBar, {
|
|
12070
12097
|
key: 0,
|
|
12071
12098
|
"origin-columns": _ctx.columns,
|
|
12072
|
-
columns: filterColumns
|
|
12099
|
+
columns: unref(filterColumns),
|
|
12073
12100
|
"default-size": unref(size),
|
|
12074
|
-
"columns-is-change": columnsIsChange
|
|
12101
|
+
"columns-is-change": unref(columnsIsChange),
|
|
12075
12102
|
"title-bar": _ctx.titleBar,
|
|
12076
12103
|
onClickDensity: handleClickDensity,
|
|
12077
12104
|
onFilterTableHeader: handleFilterTableConfirm,
|
|
@@ -12200,7 +12227,7 @@ var _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
12200
12227
|
}, _ctx.expandTableColumnProps),
|
|
12201
12228
|
{
|
|
12202
12229
|
default: withCtx((scoped) => [
|
|
12203
|
-
createElementVNode("div", _hoisted_1$
|
|
12230
|
+
createElementVNode("div", _hoisted_1$9, [
|
|
12204
12231
|
renderSlot(_ctx.$slots, "expand", mergeProps({
|
|
12205
12232
|
index: scoped.$index
|
|
12206
12233
|
}, scoped))
|
|
@@ -12223,12 +12250,11 @@ var _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
12223
12250
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
12224
12251
|
createCommentVNode("\u914D\u7F6E\u6E32\u67D3\u680F "),
|
|
12225
12252
|
createVNode(PlusTableColumn, {
|
|
12226
|
-
columns: subColumns
|
|
12253
|
+
columns: unref(subColumns),
|
|
12227
12254
|
editable: _ctx.editable,
|
|
12228
12255
|
"sub-page-info": unref(subPageInfo),
|
|
12229
12256
|
"table-data-length": tableDataLength.value,
|
|
12230
12257
|
"empty-value": _ctx.emptyValue,
|
|
12231
|
-
"plain-text-cell": _ctx.plainTextCell,
|
|
12232
12258
|
onFormChange: handleFormChange
|
|
12233
12259
|
}, createSlots({
|
|
12234
12260
|
_: 2
|
|
@@ -12242,7 +12268,7 @@ var _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
12242
12268
|
])
|
|
12243
12269
|
};
|
|
12244
12270
|
})
|
|
12245
|
-
]), 1032, ["columns", "editable", "sub-page-info", "table-data-length", "empty-value"
|
|
12271
|
+
]), 1032, ["columns", "editable", "sub-page-info", "table-data-length", "empty-value"])
|
|
12246
12272
|
]),
|
|
12247
12273
|
createCommentVNode(" \u64CD\u4F5C\u680F "),
|
|
12248
12274
|
_ctx.actionBar ? (openBlock(), createBlock(
|
|
@@ -12312,62 +12338,1570 @@ var _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
12312
12338
|
}
|
|
12313
12339
|
});
|
|
12314
12340
|
|
|
12315
|
-
var _Table = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
12341
|
+
var _Table = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__file", "index.vue"]]);
|
|
12316
12342
|
|
|
12317
12343
|
const PlusTable = _Table;
|
|
12318
12344
|
|
|
12319
|
-
|
|
12345
|
+
const _hoisted_1$8 = { class: "plus-table-lite__header" };
|
|
12346
|
+
const _hoisted_2$4 = ["innerHTML"];
|
|
12347
|
+
var _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
12320
12348
|
...{
|
|
12321
|
-
name: "
|
|
12349
|
+
name: "PlusTableLite",
|
|
12350
|
+
inheritAttrs: false
|
|
12322
12351
|
},
|
|
12323
12352
|
__name: "index",
|
|
12324
12353
|
props: {
|
|
12325
|
-
|
|
12354
|
+
tableData: { default: void 0 },
|
|
12355
|
+
data: { default: void 0 },
|
|
12326
12356
|
columns: { default: () => [] },
|
|
12327
|
-
|
|
12328
|
-
|
|
12357
|
+
defaultSize: { default: "default" },
|
|
12358
|
+
pagination: { type: [Boolean, Object], default: false },
|
|
12359
|
+
actionBar: { type: [Boolean, Object], default: false },
|
|
12360
|
+
hasIndexColumn: { type: Boolean, default: false },
|
|
12361
|
+
titleBar: { type: [Boolean, Object], default: true },
|
|
12362
|
+
isSelection: { type: Boolean, default: false },
|
|
12363
|
+
specialColumnsOrder: { default: void 0 },
|
|
12364
|
+
loadingStatus: { type: Boolean, default: false },
|
|
12365
|
+
rowKey: { type: [String, Function], default: "id" },
|
|
12366
|
+
defaultSelectedKeys: { default: () => [] },
|
|
12367
|
+
selectionTableColumnProps: { default: () => ({ width: 40 }) },
|
|
12368
|
+
indexTableColumnProps: { default: () => ({}) },
|
|
12369
|
+
indexContentStyle: { type: [Object, Function], default: () => ({}) },
|
|
12370
|
+
headerCellStyle: { default: () => ({
|
|
12371
|
+
"background-color": "var(--el-fill-color-light)"
|
|
12372
|
+
}) },
|
|
12373
|
+
emptyValue: { default: void 0 },
|
|
12374
|
+
size: {},
|
|
12375
|
+
width: {},
|
|
12376
|
+
height: {},
|
|
12377
|
+
maxHeight: {},
|
|
12378
|
+
fit: { type: Boolean },
|
|
12379
|
+
stripe: { type: Boolean },
|
|
12329
12380
|
border: { type: Boolean, default: true },
|
|
12330
|
-
|
|
12331
|
-
|
|
12332
|
-
|
|
12381
|
+
context: {},
|
|
12382
|
+
showHeader: { type: Boolean },
|
|
12383
|
+
showSummary: { type: Boolean },
|
|
12384
|
+
sumText: {},
|
|
12385
|
+
summaryMethod: {},
|
|
12386
|
+
rowClassName: {},
|
|
12387
|
+
rowStyle: {},
|
|
12388
|
+
cellClassName: {},
|
|
12389
|
+
cellStyle: {},
|
|
12390
|
+
headerRowClassName: {},
|
|
12391
|
+
headerRowStyle: {},
|
|
12392
|
+
headerCellClassName: {},
|
|
12393
|
+
highlightCurrentRow: { type: Boolean },
|
|
12394
|
+
currentRowKey: {},
|
|
12395
|
+
emptyText: {},
|
|
12396
|
+
expandRowKeys: {},
|
|
12397
|
+
defaultExpandAll: { type: Boolean },
|
|
12398
|
+
defaultSort: {},
|
|
12399
|
+
tooltipEffect: {},
|
|
12400
|
+
tooltipOptions: {},
|
|
12401
|
+
spanMethod: {},
|
|
12402
|
+
selectOnIndeterminate: { type: Boolean },
|
|
12403
|
+
indent: {},
|
|
12404
|
+
treeProps: {},
|
|
12405
|
+
lazy: { type: Boolean },
|
|
12406
|
+
load: {},
|
|
12407
|
+
className: {},
|
|
12408
|
+
style: {},
|
|
12409
|
+
tableLayout: {},
|
|
12410
|
+
scrollbarAlwaysOn: { type: Boolean },
|
|
12411
|
+
flexible: { type: Boolean },
|
|
12412
|
+
showOverflowTooltip: { type: [Boolean, Object] }
|
|
12333
12413
|
},
|
|
12334
|
-
emits: ["
|
|
12414
|
+
emits: ["selection-change", "paginationChange", "clickAction", "clickActionConfirmCancel", "refresh", "filterTableHeader"],
|
|
12335
12415
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
12416
|
+
var _a, _b;
|
|
12336
12417
|
const props = __props;
|
|
12337
12418
|
const emit = __emit;
|
|
12338
|
-
const
|
|
12339
|
-
const
|
|
12340
|
-
const
|
|
12341
|
-
const
|
|
12342
|
-
const
|
|
12343
|
-
|
|
12419
|
+
const { t } = useLocale();
|
|
12420
|
+
const tableInstance = shallowRef(null);
|
|
12421
|
+
const wrapperInstance = ref(null);
|
|
12422
|
+
const paginationInstance = ref(null);
|
|
12423
|
+
const state = reactive({
|
|
12424
|
+
size: props.defaultSize,
|
|
12425
|
+
subPageInfo: {
|
|
12426
|
+
...((_a = props.pagination) == null ? void 0 : _a.modelValue) || DefaultPageInfo
|
|
12427
|
+
}
|
|
12428
|
+
});
|
|
12429
|
+
const __tableData = computed(() => {
|
|
12430
|
+
var _a2, _b2;
|
|
12431
|
+
return (_b2 = (_a2 = props.tableData) != null ? _a2 : props.data) != null ? _b2 : [];
|
|
12432
|
+
});
|
|
12433
|
+
const { subColumns, filterColumns, columnsIsChange, setFilterColumns } = useTableColumns({
|
|
12434
|
+
columns: () => props.columns || []
|
|
12435
|
+
});
|
|
12436
|
+
const resolveEmptyText = (column) => {
|
|
12437
|
+
var _a2, _b2;
|
|
12438
|
+
return (_b2 = (_a2 = column.emptyValue) != null ? _a2 : props.emptyValue) != null ? _b2 : "";
|
|
12439
|
+
};
|
|
12440
|
+
const toVNode = (result) => {
|
|
12441
|
+
if (result === null || result === void 0 || result === "") return createTextVNode("");
|
|
12442
|
+
if (isString(result) || typeof result === "number") return createTextVNode(String(result));
|
|
12443
|
+
if (isVNode(result)) return result;
|
|
12444
|
+
return h(result);
|
|
12445
|
+
};
|
|
12446
|
+
const getByPath = (target, path) => {
|
|
12447
|
+
const keys = path.replace(/\[(\w+)\]/g, ".$1").split(".").filter(Boolean);
|
|
12448
|
+
let current = target;
|
|
12449
|
+
for (const key of keys) {
|
|
12450
|
+
if (current === null || current === void 0) return void 0;
|
|
12451
|
+
current = current[key];
|
|
12452
|
+
}
|
|
12453
|
+
return current;
|
|
12454
|
+
};
|
|
12455
|
+
const preparedColumns = computed(
|
|
12456
|
+
() => subColumns.value.map((column) => {
|
|
12457
|
+
const prop = column.prop;
|
|
12458
|
+
const label = getLabel(column.label);
|
|
12459
|
+
const isSimpleProp = !prop.includes(".") && !prop.includes("[");
|
|
12460
|
+
const readValue = isSimpleProp ? (row) => row == null ? void 0 : row[prop] : (row) => getByPath(row, prop);
|
|
12461
|
+
const cellText = (row, index) => {
|
|
12462
|
+
const value = readValue(row);
|
|
12463
|
+
if (isFunction(column.formatter)) {
|
|
12464
|
+
const formatted = column.formatter(value, { row, column, index });
|
|
12465
|
+
return String(
|
|
12466
|
+
formatted === null || formatted === void 0 ? resolveEmptyText(column) : formatted
|
|
12467
|
+
);
|
|
12468
|
+
}
|
|
12469
|
+
return value === null || value === void 0 || value === "" ? String(resolveEmptyText(column)) : String(value);
|
|
12470
|
+
};
|
|
12471
|
+
const prepared = {
|
|
12472
|
+
key: getTableKey(column, true),
|
|
12473
|
+
prop,
|
|
12474
|
+
column,
|
|
12475
|
+
tableColumnProps: column.tableColumnProps || {},
|
|
12476
|
+
label,
|
|
12477
|
+
width: column.width,
|
|
12478
|
+
minWidth: column.minWidth,
|
|
12479
|
+
headerSlotName: getTableHeaderSlotName(prop),
|
|
12480
|
+
cellSlotName: getTableCellSlotName(prop),
|
|
12481
|
+
tooltip: !!column.tooltip,
|
|
12482
|
+
tooltipProps: getTooltip(column.tooltip),
|
|
12483
|
+
readValue,
|
|
12484
|
+
cellText
|
|
12485
|
+
};
|
|
12486
|
+
if (isFunction(column.renderHeader)) {
|
|
12487
|
+
prepared.headerRender = () => {
|
|
12488
|
+
var _a2;
|
|
12489
|
+
return toVNode((_a2 = column.renderHeader) == null ? void 0 : _a2.call(column, label, column));
|
|
12490
|
+
};
|
|
12491
|
+
}
|
|
12492
|
+
if (isFunction(column.render)) {
|
|
12493
|
+
prepared.cellRender = ({ row, index }) => {
|
|
12494
|
+
var _a2;
|
|
12495
|
+
return toVNode((_a2 = column.render) == null ? void 0 : _a2.call(column, readValue(row), { row, column, index }));
|
|
12496
|
+
};
|
|
12497
|
+
} else if (isFunction(column.renderHTML)) {
|
|
12498
|
+
prepared.cellHTML = (row, index) => {
|
|
12499
|
+
var _a2, _b2;
|
|
12500
|
+
return String((_b2 = (_a2 = column.renderHTML) == null ? void 0 : _a2.call(column, readValue(row), { row, column, index })) != null ? _b2 : "");
|
|
12501
|
+
};
|
|
12502
|
+
}
|
|
12503
|
+
return prepared;
|
|
12504
|
+
})
|
|
12344
12505
|
);
|
|
12345
|
-
const
|
|
12346
|
-
|
|
12347
|
-
|
|
12348
|
-
|
|
12349
|
-
|
|
12350
|
-
|
|
12351
|
-
|
|
12352
|
-
|
|
12353
|
-
|
|
12354
|
-
|
|
12355
|
-
|
|
12356
|
-
|
|
12506
|
+
const getRowKeyValue = (row) => {
|
|
12507
|
+
const { rowKey } = props;
|
|
12508
|
+
if (isFunction(rowKey)) return rowKey(row);
|
|
12509
|
+
return row == null ? void 0 : row[rowKey];
|
|
12510
|
+
};
|
|
12511
|
+
const selectedKeys = ref(new Set(props.defaultSelectedKeys));
|
|
12512
|
+
let selectedRowCache = /* @__PURE__ */ new Map();
|
|
12513
|
+
function isRowSelectable(row, index) {
|
|
12514
|
+
var _a2;
|
|
12515
|
+
const selectable = (_a2 = props.selectionTableColumnProps) == null ? void 0 : _a2.selectable;
|
|
12516
|
+
return isFunction(selectable) ? selectable(row, index) !== false : true;
|
|
12517
|
+
}
|
|
12518
|
+
const selectableRows = computed(
|
|
12519
|
+
() => __tableData.value.filter((row, index) => isRowSelectable(row, index))
|
|
12520
|
+
);
|
|
12521
|
+
const isRowSelected = (row) => {
|
|
12522
|
+
const key = getRowKeyValue(row);
|
|
12523
|
+
return key === void 0 ? false : selectedKeys.value.has(key);
|
|
12524
|
+
};
|
|
12525
|
+
const isAllSelected = computed(
|
|
12526
|
+
() => selectableRows.value.length > 0 && selectableRows.value.every((row) => selectedKeys.value.has(getRowKeyValue(row)))
|
|
12527
|
+
);
|
|
12528
|
+
const isIndeterminate = computed(
|
|
12529
|
+
() => !isAllSelected.value && selectableRows.value.some((row) => selectedKeys.value.has(getRowKeyValue(row)))
|
|
12530
|
+
);
|
|
12531
|
+
const getSelectedRows = () => {
|
|
12532
|
+
const rows = [];
|
|
12533
|
+
selectedRowCache.forEach((row, key) => {
|
|
12534
|
+
if (selectedKeys.value.has(key)) rows.push(row);
|
|
12535
|
+
});
|
|
12536
|
+
return rows;
|
|
12537
|
+
};
|
|
12538
|
+
const handleToggleRow = (row, checked) => {
|
|
12539
|
+
const key = getRowKeyValue(row);
|
|
12540
|
+
if (key === void 0) return;
|
|
12541
|
+
if (checked) {
|
|
12542
|
+
selectedKeys.value.add(key);
|
|
12543
|
+
selectedRowCache.set(key, row);
|
|
12544
|
+
} else {
|
|
12545
|
+
selectedKeys.value.delete(key);
|
|
12546
|
+
selectedRowCache.delete(key);
|
|
12547
|
+
}
|
|
12548
|
+
emit("selection-change", getSelectedRows());
|
|
12549
|
+
};
|
|
12550
|
+
const handleToggleAll = () => {
|
|
12551
|
+
const nextAllSelected = !isAllSelected.value;
|
|
12552
|
+
selectableRows.value.forEach((row) => {
|
|
12553
|
+
const key = getRowKeyValue(row);
|
|
12554
|
+
if (key === void 0) return;
|
|
12555
|
+
if (nextAllSelected) {
|
|
12556
|
+
selectedKeys.value.add(key);
|
|
12557
|
+
selectedRowCache.set(key, row);
|
|
12558
|
+
} else {
|
|
12559
|
+
selectedKeys.value.delete(key);
|
|
12560
|
+
selectedRowCache.delete(key);
|
|
12561
|
+
}
|
|
12562
|
+
});
|
|
12563
|
+
emit("selection-change", getSelectedRows());
|
|
12564
|
+
};
|
|
12565
|
+
const clearSelection = () => {
|
|
12566
|
+
selectedKeys.value = /* @__PURE__ */ new Set();
|
|
12567
|
+
selectedRowCache = /* @__PURE__ */ new Map();
|
|
12568
|
+
};
|
|
12569
|
+
const syncSelectedRowCache = (rows) => {
|
|
12570
|
+
if (!selectedKeys.value.size || !(rows == null ? void 0 : rows.length)) return;
|
|
12571
|
+
rows.forEach((row) => {
|
|
12572
|
+
const key = getRowKeyValue(row);
|
|
12573
|
+
if (key !== void 0 && selectedKeys.value.has(key)) {
|
|
12574
|
+
selectedRowCache.set(key, row);
|
|
12575
|
+
}
|
|
12576
|
+
});
|
|
12357
12577
|
};
|
|
12358
12578
|
watch(
|
|
12359
|
-
|
|
12579
|
+
() => __tableData.value,
|
|
12580
|
+
(rows) => syncSelectedRowCache(rows || []),
|
|
12581
|
+
{ immediate: true }
|
|
12582
|
+
);
|
|
12583
|
+
watch(
|
|
12584
|
+
() => props.defaultSelectedKeys,
|
|
12585
|
+
(keys) => {
|
|
12586
|
+
if (!(keys == null ? void 0 : keys.length)) return;
|
|
12587
|
+
keys.forEach((key) => selectedKeys.value.add(key));
|
|
12588
|
+
syncSelectedRowCache(__tableData.value);
|
|
12589
|
+
}
|
|
12590
|
+
);
|
|
12591
|
+
const specialColumns = computed(() => {
|
|
12592
|
+
const active = [];
|
|
12593
|
+
if (props.isSelection) active.push("selection");
|
|
12594
|
+
if (props.hasIndexColumn) active.push("index");
|
|
12595
|
+
const defaultOrder = ["selection", "index"];
|
|
12596
|
+
const order = [...props.specialColumnsOrder || [], ...defaultOrder].filter(
|
|
12597
|
+
(item, index, array) => array.indexOf(item) === index
|
|
12598
|
+
);
|
|
12599
|
+
return order.filter((item) => active.includes(item));
|
|
12600
|
+
});
|
|
12601
|
+
const selectionProps = computed(() => props.selectionTableColumnProps || {});
|
|
12602
|
+
const selectionWidth = computed(() => selectionProps.value.width || 40);
|
|
12603
|
+
const selectionAlign = computed(() => selectionProps.value.align || "center");
|
|
12604
|
+
const selectionFixed = computed(
|
|
12360
12605
|
() => {
|
|
12361
|
-
|
|
12362
|
-
|
|
12363
|
-
{
|
|
12364
|
-
deep: true,
|
|
12365
|
-
flush: "post"
|
|
12606
|
+
var _a2;
|
|
12607
|
+
return (_a2 = selectionProps.value.fixed) != null ? _a2 : "left";
|
|
12366
12608
|
}
|
|
12367
12609
|
);
|
|
12368
|
-
const
|
|
12369
|
-
|
|
12370
|
-
|
|
12610
|
+
const indexProps = computed(() => props.indexTableColumnProps || {});
|
|
12611
|
+
const indexFixed = computed(
|
|
12612
|
+
() => indexProps.value.fixed || "left"
|
|
12613
|
+
);
|
|
12614
|
+
const getIndexValue = (index) => {
|
|
12615
|
+
const customIndex = indexProps.value.index;
|
|
12616
|
+
if (isFunction(customIndex)) return customIndex(index);
|
|
12617
|
+
if (typeof customIndex === "number") return customIndex;
|
|
12618
|
+
const { page, pageSize } = state.subPageInfo;
|
|
12619
|
+
return (page - 1) * pageSize + index + 1;
|
|
12620
|
+
};
|
|
12621
|
+
const getIndexStyle = (row, index) => {
|
|
12622
|
+
const style = props.indexContentStyle;
|
|
12623
|
+
if (isFunction(style)) return style(row, index);
|
|
12624
|
+
if (isPlainObject(style)) return style;
|
|
12625
|
+
return {};
|
|
12626
|
+
};
|
|
12627
|
+
const actionBarLabel = computed(
|
|
12628
|
+
() => props.actionBar ? unref(props.actionBar.label) || t("plus.table.action") : ""
|
|
12629
|
+
);
|
|
12630
|
+
const actionBarFixed = computed(
|
|
12631
|
+
() => (props.actionBar ? props.actionBar.fixed : void 0) || "right"
|
|
12632
|
+
);
|
|
12633
|
+
const handlePaginationChange = () => {
|
|
12634
|
+
emit("paginationChange", { ...state.subPageInfo });
|
|
12635
|
+
};
|
|
12636
|
+
const handleRefresh = () => emit("refresh");
|
|
12637
|
+
const handleClickDensity = (size) => {
|
|
12638
|
+
state.size = size;
|
|
12639
|
+
};
|
|
12640
|
+
const handleFilterTableConfirm = (list, eventType) => {
|
|
12641
|
+
setFilterColumns(list);
|
|
12642
|
+
emit("filterTableHeader", list, eventType);
|
|
12643
|
+
};
|
|
12644
|
+
const adaptiveHeight = ref();
|
|
12645
|
+
const resolvedHeight = computed(() => {
|
|
12646
|
+
const height = props.height;
|
|
12647
|
+
return height !== void 0 ? height : adaptiveHeight.value;
|
|
12648
|
+
});
|
|
12649
|
+
const hasAdaptive = computed(() => props.height === void 0 && !!props.adaptive);
|
|
12650
|
+
const calcAdaptiveHeight = () => {
|
|
12651
|
+
var _a2;
|
|
12652
|
+
if (!wrapperInstance.value) return;
|
|
12653
|
+
let offsetBottom = 20;
|
|
12654
|
+
if (isPlainObject(props.adaptive)) {
|
|
12655
|
+
offsetBottom = (_a2 = props.adaptive.offsetBottom) != null ? _a2 : offsetBottom;
|
|
12656
|
+
}
|
|
12657
|
+
const paginationHeight = paginationInstance.value && props.pagination ? paginationInstance.value.$el.offsetHeight : 0;
|
|
12658
|
+
const top = wrapperInstance.value.getBoundingClientRect().top;
|
|
12659
|
+
adaptiveHeight.value = Math.max(window.innerHeight - top - offsetBottom - paginationHeight, 100);
|
|
12660
|
+
};
|
|
12661
|
+
const debounceCalcAdaptiveHeight = debounce(
|
|
12662
|
+
calcAdaptiveHeight,
|
|
12663
|
+
isPlainObject(props.adaptive) ? (_b = props.adaptive.timeout) != null ? _b : 60 : 60
|
|
12664
|
+
);
|
|
12665
|
+
onMounted(() => {
|
|
12666
|
+
if (hasAdaptive.value) {
|
|
12667
|
+
calcAdaptiveHeight();
|
|
12668
|
+
window.addEventListener("resize", debounceCalcAdaptiveHeight);
|
|
12669
|
+
}
|
|
12670
|
+
});
|
|
12671
|
+
onBeforeUnmount(() => {
|
|
12672
|
+
window.removeEventListener("resize", debounceCalcAdaptiveHeight);
|
|
12673
|
+
});
|
|
12674
|
+
provide(TableFormRefInjectionKey, shallowRef({}));
|
|
12675
|
+
__expose({
|
|
12676
|
+
/** el-table 实例,可用于 doLayout 等 */
|
|
12677
|
+
tableInstance,
|
|
12678
|
+
/** 获取所有已选行(跨页累计) */
|
|
12679
|
+
getSelectedRows,
|
|
12680
|
+
/** 清空所有已选(跨页) */
|
|
12681
|
+
clearSelection,
|
|
12682
|
+
/** 当前已选 rowKey 列表 */
|
|
12683
|
+
getSelectedKeys: () => Array.from(selectedKeys.value)
|
|
12684
|
+
});
|
|
12685
|
+
return (_ctx, _cache) => {
|
|
12686
|
+
return openBlock(), createElementBlock(
|
|
12687
|
+
"div",
|
|
12688
|
+
{
|
|
12689
|
+
ref_key: "wrapperInstance",
|
|
12690
|
+
ref: wrapperInstance,
|
|
12691
|
+
class: "plus-table-lite"
|
|
12692
|
+
},
|
|
12693
|
+
[
|
|
12694
|
+
createCommentVNode(" \u6807\u9898\u680F\uFF1A\u5237\u65B0 / \u5BC6\u5EA6 / \u5217\u8BBE\u7F6E\uFF0C\u4E0E PlusTable \u5171\u7528\u540C\u4E00\u4EFD\u5B9E\u73B0 "),
|
|
12695
|
+
_ctx.titleBar ? (openBlock(), createBlock(unref(PlusTableTitleBar), {
|
|
12696
|
+
key: 0,
|
|
12697
|
+
"origin-columns": _ctx.columns || [],
|
|
12698
|
+
columns: unref(filterColumns),
|
|
12699
|
+
"default-size": state.size,
|
|
12700
|
+
"columns-is-change": unref(columnsIsChange),
|
|
12701
|
+
"title-bar": _ctx.titleBar,
|
|
12702
|
+
onClickDensity: handleClickDensity,
|
|
12703
|
+
onFilterTableHeader: handleFilterTableConfirm,
|
|
12704
|
+
onRefresh: handleRefresh
|
|
12705
|
+
}, createSlots({
|
|
12706
|
+
title: withCtx(() => [
|
|
12707
|
+
renderSlot(_ctx.$slots, "title")
|
|
12708
|
+
]),
|
|
12709
|
+
toolbar: withCtx(() => [
|
|
12710
|
+
renderSlot(_ctx.$slots, "toolbar")
|
|
12711
|
+
]),
|
|
12712
|
+
_: 2
|
|
12713
|
+
/* DYNAMIC */
|
|
12714
|
+
}, [
|
|
12715
|
+
_ctx.$slots["drag-sort-icon"] ? {
|
|
12716
|
+
name: "drag-sort-icon",
|
|
12717
|
+
fn: withCtx(() => [
|
|
12718
|
+
renderSlot(_ctx.$slots, "drag-sort-icon")
|
|
12719
|
+
]),
|
|
12720
|
+
key: "0"
|
|
12721
|
+
} : void 0,
|
|
12722
|
+
_ctx.$slots["column-settings-icon"] ? {
|
|
12723
|
+
name: "column-settings-icon",
|
|
12724
|
+
fn: withCtx(() => [
|
|
12725
|
+
renderSlot(_ctx.$slots, "column-settings-icon")
|
|
12726
|
+
]),
|
|
12727
|
+
key: "1"
|
|
12728
|
+
} : void 0,
|
|
12729
|
+
_ctx.$slots["density-icon"] ? {
|
|
12730
|
+
name: "density-icon",
|
|
12731
|
+
fn: withCtx(() => [
|
|
12732
|
+
renderSlot(_ctx.$slots, "density-icon")
|
|
12733
|
+
]),
|
|
12734
|
+
key: "2"
|
|
12735
|
+
} : void 0
|
|
12736
|
+
]), 1032, ["origin-columns", "columns", "default-size", "columns-is-change", "title-bar"])) : createCommentVNode("v-if", true),
|
|
12737
|
+
withDirectives((openBlock(), createBlock(unref(ElTable), mergeProps({
|
|
12738
|
+
ref_key: "tableInstance",
|
|
12739
|
+
ref: tableInstance,
|
|
12740
|
+
data: __tableData.value,
|
|
12741
|
+
border: _ctx.border,
|
|
12742
|
+
height: resolvedHeight.value,
|
|
12743
|
+
"header-cell-style": _ctx.headerCellStyle,
|
|
12744
|
+
size: state.size,
|
|
12745
|
+
"row-key": _ctx.rowKey
|
|
12746
|
+
}, _ctx.$attrs), {
|
|
12747
|
+
empty: withCtx(() => [
|
|
12748
|
+
renderSlot(_ctx.$slots, "empty")
|
|
12749
|
+
]),
|
|
12750
|
+
default: withCtx(() => [
|
|
12751
|
+
(openBlock(true), createElementBlock(
|
|
12752
|
+
Fragment,
|
|
12753
|
+
null,
|
|
12754
|
+
renderList(specialColumns.value, (type) => {
|
|
12755
|
+
return openBlock(), createElementBlock(
|
|
12756
|
+
Fragment,
|
|
12757
|
+
{ key: type },
|
|
12758
|
+
[
|
|
12759
|
+
createCommentVNode("\n \u591A\u9009\u5217\n \u52FE\u9009\u72B6\u6001\u7531\u7EC4\u4EF6\u81EA\u8EAB\u7684 selectedKeys \u7EF4\u62A4\uFF0C\u56E0\u6B64\u7FFB\u9875\u540E\u4F9D\u7136\u4FDD\u7559\uFF1B\n \u4E0D\u4F7F\u7528 el-table \u5185\u7F6E\u7684 reserve-selection\uFF08\u5176\u884C\u4E3A\u4F9D\u8D56 selection \u5185\u90E8\u72B6\u6001\uFF0C\u8DE8\u9875\u4E0D\u53EF\u9760\uFF09\u3002\n "),
|
|
12760
|
+
type === "selection" ? (openBlock(), createBlock(unref(ElTableColumn), {
|
|
12761
|
+
key: "selection",
|
|
12762
|
+
"class-name": "plus-table-lite-selection",
|
|
12763
|
+
width: selectionWidth.value,
|
|
12764
|
+
align: selectionAlign.value,
|
|
12765
|
+
fixed: selectionFixed.value
|
|
12766
|
+
}, {
|
|
12767
|
+
header: withCtx(() => [
|
|
12768
|
+
createVNode(unref(ElCheckbox), {
|
|
12769
|
+
"model-value": isAllSelected.value,
|
|
12770
|
+
indeterminate: isIndeterminate.value,
|
|
12771
|
+
onChange: handleToggleAll
|
|
12772
|
+
}, null, 8, ["model-value", "indeterminate"])
|
|
12773
|
+
]),
|
|
12774
|
+
default: withCtx(({ row, $index }) => [
|
|
12775
|
+
createVNode(unref(ElCheckbox), {
|
|
12776
|
+
"model-value": isRowSelected(row),
|
|
12777
|
+
disabled: !isRowSelectable(row, $index),
|
|
12778
|
+
onChange: (checked) => handleToggleRow(row, !!checked)
|
|
12779
|
+
}, null, 8, ["model-value", "disabled", "onChange"])
|
|
12780
|
+
]),
|
|
12781
|
+
_: 1
|
|
12782
|
+
/* STABLE */
|
|
12783
|
+
}, 8, ["width", "align", "fixed"])) : (openBlock(), createElementBlock(
|
|
12784
|
+
Fragment,
|
|
12785
|
+
{ key: 1 },
|
|
12786
|
+
[
|
|
12787
|
+
createCommentVNode(" \u5E8F\u53F7\u5217 "),
|
|
12788
|
+
createVNode(unref(ElTableColumn), {
|
|
12789
|
+
key: "index",
|
|
12790
|
+
type: "index",
|
|
12791
|
+
label: "#",
|
|
12792
|
+
"class-name": "plus-table-lite-index",
|
|
12793
|
+
width: indexProps.value.width || 60,
|
|
12794
|
+
fixed: indexFixed.value,
|
|
12795
|
+
align: "center",
|
|
12796
|
+
index: getIndexValue
|
|
12797
|
+
}, {
|
|
12798
|
+
default: withCtx(({ $index }) => [
|
|
12799
|
+
createElementVNode(
|
|
12800
|
+
"div",
|
|
12801
|
+
{
|
|
12802
|
+
class: "plus-table-lite-index__content",
|
|
12803
|
+
style: normalizeStyle(getIndexStyle(__tableData.value[$index], $index))
|
|
12804
|
+
},
|
|
12805
|
+
toDisplayString(getIndexValue($index)),
|
|
12806
|
+
5
|
|
12807
|
+
/* TEXT, STYLE */
|
|
12808
|
+
)
|
|
12809
|
+
]),
|
|
12810
|
+
_: 1
|
|
12811
|
+
/* STABLE */
|
|
12812
|
+
}, 8, ["width", "fixed"])
|
|
12813
|
+
],
|
|
12814
|
+
2112
|
|
12815
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
12816
|
+
))
|
|
12817
|
+
],
|
|
12818
|
+
64
|
|
12819
|
+
/* STABLE_FRAGMENT */
|
|
12820
|
+
);
|
|
12821
|
+
}),
|
|
12822
|
+
128
|
|
12823
|
+
/* KEYED_FRAGMENT */
|
|
12824
|
+
)),
|
|
12825
|
+
(openBlock(true), createElementBlock(
|
|
12826
|
+
Fragment,
|
|
12827
|
+
null,
|
|
12828
|
+
renderList(preparedColumns.value, (col) => {
|
|
12829
|
+
return openBlock(), createBlock(unref(ElTableColumn), mergeProps({
|
|
12830
|
+
key: col.key
|
|
12831
|
+
}, col.tableColumnProps, {
|
|
12832
|
+
prop: col.prop,
|
|
12833
|
+
label: col.label,
|
|
12834
|
+
width: col.width,
|
|
12835
|
+
"min-width": col.minWidth
|
|
12836
|
+
}), {
|
|
12837
|
+
header: withCtx((scoped) => [
|
|
12838
|
+
createElementVNode("span", _hoisted_1$8, [
|
|
12839
|
+
renderSlot(_ctx.$slots, col.headerSlotName, mergeProps(scoped, {
|
|
12840
|
+
prop: col.prop,
|
|
12841
|
+
label: col.label,
|
|
12842
|
+
column: col.column
|
|
12843
|
+
}), () => [
|
|
12844
|
+
col.headerRender ? (openBlock(), createBlock(resolveDynamicComponent(col.headerRender), { key: 0 })) : (openBlock(), createElementBlock(
|
|
12845
|
+
Fragment,
|
|
12846
|
+
{ key: 1 },
|
|
12847
|
+
[
|
|
12848
|
+
createTextVNode(
|
|
12849
|
+
toDisplayString(col.label),
|
|
12850
|
+
1
|
|
12851
|
+
/* TEXT */
|
|
12852
|
+
)
|
|
12853
|
+
],
|
|
12854
|
+
64
|
|
12855
|
+
/* STABLE_FRAGMENT */
|
|
12856
|
+
))
|
|
12857
|
+
]),
|
|
12858
|
+
col.tooltip ? (openBlock(), createBlock(
|
|
12859
|
+
unref(ElTooltip),
|
|
12860
|
+
mergeProps({
|
|
12861
|
+
key: 0,
|
|
12862
|
+
placement: "top"
|
|
12863
|
+
}, col.tooltipProps),
|
|
12864
|
+
{
|
|
12865
|
+
default: withCtx(() => [
|
|
12866
|
+
renderSlot(_ctx.$slots, "tooltip-icon", {}, () => [
|
|
12867
|
+
createVNode(unref(ElIcon), {
|
|
12868
|
+
class: "plus-table-lite__header__icon",
|
|
12869
|
+
size: 16
|
|
12870
|
+
}, {
|
|
12871
|
+
default: withCtx(() => [
|
|
12872
|
+
createVNode(unref(question_filled_default))
|
|
12873
|
+
]),
|
|
12874
|
+
_: 1
|
|
12875
|
+
/* STABLE */
|
|
12876
|
+
})
|
|
12877
|
+
])
|
|
12878
|
+
]),
|
|
12879
|
+
_: 2
|
|
12880
|
+
/* DYNAMIC */
|
|
12881
|
+
},
|
|
12882
|
+
1040
|
|
12883
|
+
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
12884
|
+
)) : createCommentVNode("v-if", true)
|
|
12885
|
+
])
|
|
12886
|
+
]),
|
|
12887
|
+
default: withCtx(({ row, $index }) => [
|
|
12888
|
+
renderSlot(_ctx.$slots, col.cellSlotName, {
|
|
12889
|
+
row,
|
|
12890
|
+
index: $index,
|
|
12891
|
+
value: col.readValue(row),
|
|
12892
|
+
column: col.column
|
|
12893
|
+
}, () => [
|
|
12894
|
+
createCommentVNode(" \u81EA\u5B9A\u4E49 render\uFF1A\u552F\u4E00\u9700\u8981\u7EC4\u4EF6\u7684\u4F4D\u7F6E\uFF0C\u6309\u5217\u521B\u5EFA\u4E00\u6B21 "),
|
|
12895
|
+
col.cellRender ? (openBlock(), createBlock(resolveDynamicComponent(col.cellRender), {
|
|
12896
|
+
key: 0,
|
|
12897
|
+
row,
|
|
12898
|
+
index: $index
|
|
12899
|
+
}, null, 8, ["row", "index"])) : col.cellHTML ? (openBlock(), createElementBlock(
|
|
12900
|
+
Fragment,
|
|
12901
|
+
{ key: 1 },
|
|
12902
|
+
[
|
|
12903
|
+
createCommentVNode(" renderHTML "),
|
|
12904
|
+
createElementVNode("span", {
|
|
12905
|
+
innerHTML: col.cellHTML(row, $index)
|
|
12906
|
+
}, null, 8, _hoisted_2$4)
|
|
12907
|
+
],
|
|
12908
|
+
2112
|
|
12909
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
12910
|
+
)) : (openBlock(), createElementBlock(
|
|
12911
|
+
Fragment,
|
|
12912
|
+
{ key: 2 },
|
|
12913
|
+
[
|
|
12914
|
+
createCommentVNode(" \u7EAF\u6587\u672C\uFF1A\u96F6\u5B9E\u4F8B "),
|
|
12915
|
+
createTextVNode(
|
|
12916
|
+
toDisplayString(col.cellText(row, $index)),
|
|
12917
|
+
1
|
|
12918
|
+
/* TEXT */
|
|
12919
|
+
)
|
|
12920
|
+
],
|
|
12921
|
+
64
|
|
12922
|
+
/* STABLE_FRAGMENT */
|
|
12923
|
+
))
|
|
12924
|
+
])
|
|
12925
|
+
]),
|
|
12926
|
+
_: 2
|
|
12927
|
+
/* DYNAMIC */
|
|
12928
|
+
}, 1040, ["prop", "label", "width", "min-width"]);
|
|
12929
|
+
}),
|
|
12930
|
+
128
|
|
12931
|
+
/* KEYED_FRAGMENT */
|
|
12932
|
+
)),
|
|
12933
|
+
_ctx.actionBar ? (openBlock(), createBlock(unref(ElTableColumn), mergeProps({
|
|
12934
|
+
key: 0,
|
|
12935
|
+
"class-name": "plus-table-action-bar",
|
|
12936
|
+
label: actionBarLabel.value,
|
|
12937
|
+
fixed: actionBarFixed.value,
|
|
12938
|
+
width: _ctx.actionBar.width || 200
|
|
12939
|
+
}, _ctx.actionBar.actionBarTableColumnProps), {
|
|
12940
|
+
default: withCtx(({ row, $index }) => [
|
|
12941
|
+
createVNode(unref(PlusTableActionBarContent), {
|
|
12942
|
+
row,
|
|
12943
|
+
index: $index,
|
|
12944
|
+
type: _ctx.actionBar.type,
|
|
12945
|
+
buttons: _ctx.actionBar.buttons,
|
|
12946
|
+
"show-number": _ctx.actionBar.showNumber,
|
|
12947
|
+
"show-limit-include-more": _ctx.actionBar.showLimitIncludeMore,
|
|
12948
|
+
"confirm-type": _ctx.actionBar.confirmType,
|
|
12949
|
+
"more-type": _ctx.actionBar.moreType,
|
|
12950
|
+
onClickAction: _cache[0] || (_cache[0] = (data) => emit("clickAction", data)),
|
|
12951
|
+
onClickActionConfirmCancel: _cache[1] || (_cache[1] = (data) => emit("clickActionConfirmCancel", data))
|
|
12952
|
+
}, createSlots({
|
|
12953
|
+
_: 2
|
|
12954
|
+
/* DYNAMIC */
|
|
12955
|
+
}, [
|
|
12956
|
+
_ctx.$slots["action-bar-more-icon"] ? {
|
|
12957
|
+
name: "action-bar-more-icon",
|
|
12958
|
+
fn: withCtx(() => [
|
|
12959
|
+
renderSlot(_ctx.$slots, "action-bar-more-icon")
|
|
12960
|
+
]),
|
|
12961
|
+
key: "0"
|
|
12962
|
+
} : void 0
|
|
12963
|
+
]), 1032, ["row", "index", "type", "buttons", "show-number", "show-limit-include-more", "confirm-type", "more-type"])
|
|
12964
|
+
]),
|
|
12965
|
+
_: 3
|
|
12966
|
+
/* FORWARDED */
|
|
12967
|
+
}, 16, ["label", "fixed", "width"])) : createCommentVNode("v-if", true)
|
|
12968
|
+
]),
|
|
12969
|
+
_: 3
|
|
12970
|
+
/* FORWARDED */
|
|
12971
|
+
}, 16, ["data", "border", "height", "header-cell-style", "size", "row-key"])), [
|
|
12972
|
+
[unref(vLoading), _ctx.loadingStatus]
|
|
12973
|
+
]),
|
|
12974
|
+
createCommentVNode(" \u5206\u9875 "),
|
|
12975
|
+
_ctx.pagination ? (openBlock(), createBlock(unref(PlusPagination), mergeProps({
|
|
12976
|
+
key: 1,
|
|
12977
|
+
ref_key: "paginationInstance",
|
|
12978
|
+
ref: paginationInstance,
|
|
12979
|
+
modelValue: state.subPageInfo,
|
|
12980
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => state.subPageInfo = $event)
|
|
12981
|
+
}, _ctx.pagination, { onChange: handlePaginationChange }), createSlots({
|
|
12982
|
+
_: 2
|
|
12983
|
+
/* DYNAMIC */
|
|
12984
|
+
}, [
|
|
12985
|
+
_ctx.$slots["pagination-left"] ? {
|
|
12986
|
+
name: "pagination-left",
|
|
12987
|
+
fn: withCtx(() => [
|
|
12988
|
+
renderSlot(_ctx.$slots, "pagination-left")
|
|
12989
|
+
]),
|
|
12990
|
+
key: "0"
|
|
12991
|
+
} : void 0,
|
|
12992
|
+
_ctx.$slots["pagination-right"] ? {
|
|
12993
|
+
name: "pagination-right",
|
|
12994
|
+
fn: withCtx(() => [
|
|
12995
|
+
renderSlot(_ctx.$slots, "pagination-right")
|
|
12996
|
+
]),
|
|
12997
|
+
key: "1"
|
|
12998
|
+
} : void 0
|
|
12999
|
+
]), 1040, ["modelValue"])) : createCommentVNode("v-if", true)
|
|
13000
|
+
],
|
|
13001
|
+
512
|
|
13002
|
+
/* NEED_PATCH */
|
|
13003
|
+
);
|
|
13004
|
+
};
|
|
13005
|
+
}
|
|
13006
|
+
});
|
|
13007
|
+
|
|
13008
|
+
var TableLite = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__file", "index.vue"]]);
|
|
13009
|
+
|
|
13010
|
+
const PlusTableLite = TableLite;
|
|
13011
|
+
|
|
13012
|
+
const _hoisted_1$7 = { class: "plus-table-v2-header" };
|
|
13013
|
+
var _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
13014
|
+
...{
|
|
13015
|
+
name: "PlusTableV2HeaderCell"
|
|
13016
|
+
},
|
|
13017
|
+
__name: "table-v2-header-cell",
|
|
13018
|
+
props: {
|
|
13019
|
+
column: {},
|
|
13020
|
+
cellIndex: {}
|
|
13021
|
+
},
|
|
13022
|
+
setup(__props) {
|
|
13023
|
+
const props = __props;
|
|
13024
|
+
const labelText = computed(() => getLabel(props.column.label));
|
|
13025
|
+
return (_ctx, _cache) => {
|
|
13026
|
+
return openBlock(), createElementBlock(
|
|
13027
|
+
Fragment,
|
|
13028
|
+
null,
|
|
13029
|
+
[
|
|
13030
|
+
createCommentVNode(" \u8868\u5934\u5355\u5143\u683C\uFF1A\u4E0E el-table \u7248\u672C\u7684 PlusTableColumn header \u903B\u8F91\u4FDD\u6301\u4E00\u81F4 "),
|
|
13031
|
+
createElementVNode("span", _hoisted_1$7, [
|
|
13032
|
+
_ctx.column.renderHeader && unref(isFunction)(_ctx.column.renderHeader) ? (openBlock(), createBlock(unref(PlusRender), {
|
|
13033
|
+
key: 0,
|
|
13034
|
+
render: _ctx.column.renderHeader,
|
|
13035
|
+
params: { column: _ctx.column, cellIndex: _ctx.cellIndex },
|
|
13036
|
+
"callback-value": labelText.value
|
|
13037
|
+
}, null, 8, ["render", "params", "callback-value"])) : (openBlock(), createElementBlock(
|
|
13038
|
+
Fragment,
|
|
13039
|
+
{ key: 1 },
|
|
13040
|
+
[
|
|
13041
|
+
createCommentVNode("\u8868\u683C\u5355\u5143\u683C Header \u7684\u63D2\u69FD "),
|
|
13042
|
+
renderSlot(_ctx.$slots, unref(getTableHeaderSlotName)(_ctx.column.prop), {
|
|
13043
|
+
prop: _ctx.column.prop,
|
|
13044
|
+
label: labelText.value,
|
|
13045
|
+
fieldProps: _ctx.column.fieldProps,
|
|
13046
|
+
valueType: _ctx.column.valueType,
|
|
13047
|
+
cellIndex: _ctx.cellIndex,
|
|
13048
|
+
column: _ctx.column
|
|
13049
|
+
}, () => [
|
|
13050
|
+
createTextVNode(
|
|
13051
|
+
toDisplayString(labelText.value),
|
|
13052
|
+
1
|
|
13053
|
+
/* TEXT */
|
|
13054
|
+
)
|
|
13055
|
+
])
|
|
13056
|
+
],
|
|
13057
|
+
2112
|
|
13058
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
13059
|
+
)),
|
|
13060
|
+
_ctx.column.tooltip ? (openBlock(), createBlock(
|
|
13061
|
+
unref(ElTooltip),
|
|
13062
|
+
mergeProps({
|
|
13063
|
+
key: 2,
|
|
13064
|
+
placement: "top"
|
|
13065
|
+
}, unref(getTooltip)(_ctx.column.tooltip)),
|
|
13066
|
+
{
|
|
13067
|
+
default: withCtx(() => [
|
|
13068
|
+
renderSlot(_ctx.$slots, "tooltip-icon", {}, () => [
|
|
13069
|
+
createVNode(unref(ElIcon), {
|
|
13070
|
+
class: "plus-table-v2-header__icon",
|
|
13071
|
+
size: 16
|
|
13072
|
+
}, {
|
|
13073
|
+
default: withCtx(() => [
|
|
13074
|
+
createVNode(unref(question_filled_default))
|
|
13075
|
+
]),
|
|
13076
|
+
_: 1
|
|
13077
|
+
/* STABLE */
|
|
13078
|
+
})
|
|
13079
|
+
])
|
|
13080
|
+
]),
|
|
13081
|
+
_: 3
|
|
13082
|
+
/* FORWARDED */
|
|
13083
|
+
},
|
|
13084
|
+
16
|
|
13085
|
+
/* FULL_PROPS */
|
|
13086
|
+
)) : createCommentVNode("v-if", true)
|
|
13087
|
+
])
|
|
13088
|
+
],
|
|
13089
|
+
2112
|
|
13090
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
13091
|
+
);
|
|
13092
|
+
};
|
|
13093
|
+
}
|
|
13094
|
+
});
|
|
13095
|
+
|
|
13096
|
+
var TableV2HeaderCell = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__file", "table-v2-header-cell.vue"]]);
|
|
13097
|
+
|
|
13098
|
+
const buildDataColumns = ({
|
|
13099
|
+
columns,
|
|
13100
|
+
renderCell,
|
|
13101
|
+
slots
|
|
13102
|
+
}) => {
|
|
13103
|
+
const headerSlots = {};
|
|
13104
|
+
Object.keys(slots || {}).forEach((key) => {
|
|
13105
|
+
if (key.startsWith("plus-header-") || key === "tooltip-icon") {
|
|
13106
|
+
headerSlots[key] = slots == null ? void 0 : slots[key];
|
|
13107
|
+
}
|
|
13108
|
+
});
|
|
13109
|
+
return columns.filter((col) => {
|
|
13110
|
+
var _a;
|
|
13111
|
+
return !((_a = col.children) == null ? void 0 : _a.length);
|
|
13112
|
+
}).map((col, columnIndex) => {
|
|
13113
|
+
const tableColumnProps = col.tableColumnProps || {};
|
|
13114
|
+
const fixed = tableColumnProps.fixed === true ? "left" : tableColumnProps.fixed;
|
|
13115
|
+
return {
|
|
13116
|
+
key: getTableKey(col, true),
|
|
13117
|
+
dataKey: col.prop,
|
|
13118
|
+
title: getLabel(col.label),
|
|
13119
|
+
width: typeof col.width === "number" ? col.width : Number(col.width) || void 0,
|
|
13120
|
+
minWidth: typeof col.minWidth === "number" ? col.minWidth : Number(col.minWidth) || void 0,
|
|
13121
|
+
fixed,
|
|
13122
|
+
align: tableColumnProps.align,
|
|
13123
|
+
class: tableColumnProps.className,
|
|
13124
|
+
cellRenderer: ({ rowData, rowIndex }) => renderCell({
|
|
13125
|
+
column: col,
|
|
13126
|
+
row: rowData,
|
|
13127
|
+
rowIndex,
|
|
13128
|
+
columnIndex
|
|
13129
|
+
}),
|
|
13130
|
+
headerCellRenderer: () => h(TableV2HeaderCell, { column: col, cellIndex: columnIndex }, headerSlots)
|
|
13131
|
+
};
|
|
13132
|
+
});
|
|
13133
|
+
};
|
|
13134
|
+
|
|
13135
|
+
const toNumber = (value, fallback) => {
|
|
13136
|
+
const num = Number(value);
|
|
13137
|
+
return Number.isFinite(num) && num > 0 ? num : fallback;
|
|
13138
|
+
};
|
|
13139
|
+
const buildIndexColumn = ({
|
|
13140
|
+
pageInfo,
|
|
13141
|
+
indexContentStyle,
|
|
13142
|
+
columnProps = {}
|
|
13143
|
+
}) => {
|
|
13144
|
+
const getIndex = isNumber(columnProps.index) ? () => columnProps.index : isFunction(columnProps.index) ? columnProps.index : (index) => (((pageInfo == null ? void 0 : pageInfo.page) || 1) - 1) * ((pageInfo == null ? void 0 : pageInfo.pageSize) || 10) + index + 1;
|
|
13145
|
+
const resolveStyle = (row, index) => {
|
|
13146
|
+
if (isFunction(indexContentStyle)) return indexContentStyle(row, index);
|
|
13147
|
+
if (isPlainObject(indexContentStyle)) return indexContentStyle;
|
|
13148
|
+
return {};
|
|
13149
|
+
};
|
|
13150
|
+
return {
|
|
13151
|
+
key: "index",
|
|
13152
|
+
title: "#",
|
|
13153
|
+
width: toNumber(columnProps.width, 60),
|
|
13154
|
+
fixed: TableV2FixedDir.LEFT,
|
|
13155
|
+
align: "center",
|
|
13156
|
+
cellRenderer: ({ rowData, rowIndex }) => h("div", { class: "plus-table-v2-index", style: resolveStyle(rowData, rowIndex) }, [
|
|
13157
|
+
String(getIndex(rowIndex))
|
|
13158
|
+
])
|
|
13159
|
+
};
|
|
13160
|
+
};
|
|
13161
|
+
const buildRadioColumn = ({
|
|
13162
|
+
radioRow,
|
|
13163
|
+
onChange,
|
|
13164
|
+
radioProps,
|
|
13165
|
+
columnProps = {}
|
|
13166
|
+
}) => ({
|
|
13167
|
+
key: "radio",
|
|
13168
|
+
title: "",
|
|
13169
|
+
width: toNumber(columnProps.width, 50),
|
|
13170
|
+
fixed: TableV2FixedDir.LEFT,
|
|
13171
|
+
align: "center",
|
|
13172
|
+
cellRenderer: ({ rowData }) => h(PlusRadio, {
|
|
13173
|
+
modelValue: isEqual(radioRow(), rowData),
|
|
13174
|
+
options: [{ value: true }],
|
|
13175
|
+
...radioProps,
|
|
13176
|
+
onChange: (value) => onChange(value, rowData)
|
|
13177
|
+
})
|
|
13178
|
+
});
|
|
13179
|
+
const buildSelectionColumn = ({
|
|
13180
|
+
isSelected,
|
|
13181
|
+
isAllSelected,
|
|
13182
|
+
isIndeterminate,
|
|
13183
|
+
onToggleRow,
|
|
13184
|
+
onToggleAll,
|
|
13185
|
+
columnProps = {}
|
|
13186
|
+
}) => ({
|
|
13187
|
+
key: "selection",
|
|
13188
|
+
title: "",
|
|
13189
|
+
width: toNumber(columnProps.width, 40),
|
|
13190
|
+
fixed: TableV2FixedDir.LEFT,
|
|
13191
|
+
align: "center",
|
|
13192
|
+
headerCellRenderer: () => h(ElCheckbox, {
|
|
13193
|
+
modelValue: isAllSelected(),
|
|
13194
|
+
indeterminate: isIndeterminate(),
|
|
13195
|
+
"onUpdate:modelValue": (checked) => onToggleAll(Boolean(checked))
|
|
13196
|
+
}),
|
|
13197
|
+
cellRenderer: ({ rowData }) => h(ElCheckbox, {
|
|
13198
|
+
modelValue: isSelected(rowData),
|
|
13199
|
+
"onUpdate:modelValue": (checked) => onToggleRow(rowData, Boolean(checked))
|
|
13200
|
+
})
|
|
13201
|
+
});
|
|
13202
|
+
|
|
13203
|
+
const DEFAULT_TABLE_V2_MIN_WIDTH = 100;
|
|
13204
|
+
const toColumnNumber = (value) => {
|
|
13205
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : 0;
|
|
13206
|
+
if (typeof value === "string") return Number.parseFloat(value) || 0;
|
|
13207
|
+
return 0;
|
|
13208
|
+
};
|
|
13209
|
+
const useTableV2Columns = ({
|
|
13210
|
+
columns,
|
|
13211
|
+
containerWidth,
|
|
13212
|
+
excludeKeys = [],
|
|
13213
|
+
defaultMinWidth = DEFAULT_TABLE_V2_MIN_WIDTH
|
|
13214
|
+
}) => {
|
|
13215
|
+
const resolvedColumns = computed(() => {
|
|
13216
|
+
const cols = columns();
|
|
13217
|
+
const floors = cols.map(
|
|
13218
|
+
(col) => toColumnNumber(col.minWidth) || toColumnNumber(col.width) || defaultMinWidth
|
|
13219
|
+
);
|
|
13220
|
+
const sumFloor = floors.reduce((total, item) => total + item, 0);
|
|
13221
|
+
const target = Math.max(sumFloor, containerWidth());
|
|
13222
|
+
const stretchableIndexes = cols.map(
|
|
13223
|
+
(col, index) => col.fixed || col.key !== void 0 && excludeKeys.includes(String(col.key)) ? -1 : index
|
|
13224
|
+
).filter((index) => index >= 0);
|
|
13225
|
+
const extra = target - sumFloor;
|
|
13226
|
+
const stretchCount = stretchableIndexes.length;
|
|
13227
|
+
const base = stretchCount ? Math.floor(extra / stretchCount) : 0;
|
|
13228
|
+
let remainder = stretchCount ? extra % stretchCount : 0;
|
|
13229
|
+
const widths = floors.map((floor, index) => {
|
|
13230
|
+
if (!stretchableIndexes.includes(index)) return floor;
|
|
13231
|
+
let width = floor + base;
|
|
13232
|
+
if (remainder > 0) {
|
|
13233
|
+
width += 1;
|
|
13234
|
+
remainder -= 1;
|
|
13235
|
+
}
|
|
13236
|
+
return width;
|
|
13237
|
+
});
|
|
13238
|
+
return cols.map((col, index) => ({
|
|
13239
|
+
...col,
|
|
13240
|
+
minWidth: floors[index],
|
|
13241
|
+
width: widths[index]
|
|
13242
|
+
}));
|
|
13243
|
+
});
|
|
13244
|
+
return { resolvedColumns };
|
|
13245
|
+
};
|
|
13246
|
+
|
|
13247
|
+
const TableV2Cell = defineComponent({
|
|
13248
|
+
name: "PlusTableV2Cell",
|
|
13249
|
+
props: {
|
|
13250
|
+
/** 列配置 */
|
|
13251
|
+
column: {
|
|
13252
|
+
type: Object,
|
|
13253
|
+
required: true
|
|
13254
|
+
},
|
|
13255
|
+
/** 行数据 */
|
|
13256
|
+
row: {
|
|
13257
|
+
type: Object,
|
|
13258
|
+
required: true
|
|
13259
|
+
},
|
|
13260
|
+
/** 行索引 */
|
|
13261
|
+
index: {
|
|
13262
|
+
type: Number,
|
|
13263
|
+
default: 0
|
|
13264
|
+
},
|
|
13265
|
+
/** 单元格列索引 */
|
|
13266
|
+
cellIndex: {
|
|
13267
|
+
type: Number,
|
|
13268
|
+
default: 0
|
|
13269
|
+
},
|
|
13270
|
+
/** 是否可编辑 */
|
|
13271
|
+
editable: {
|
|
13272
|
+
type: [Boolean, String],
|
|
13273
|
+
default: false
|
|
13274
|
+
},
|
|
13275
|
+
/** 空值默认值 */
|
|
13276
|
+
emptyValue: {
|
|
13277
|
+
type: [String, Number],
|
|
13278
|
+
default: void 0
|
|
13279
|
+
},
|
|
13280
|
+
/** 透传给展示组件的额外参数 */
|
|
13281
|
+
rest: {
|
|
13282
|
+
type: Object,
|
|
13283
|
+
default: () => ({})
|
|
13284
|
+
}
|
|
13285
|
+
},
|
|
13286
|
+
emits: {
|
|
13287
|
+
/** 单元格点击 */
|
|
13288
|
+
cellClick: (_row, _column, _event) => true,
|
|
13289
|
+
/** 单元格双击 */
|
|
13290
|
+
cellDblclick: (_row, _column, _event) => true,
|
|
13291
|
+
/** 表单值变化 */
|
|
13292
|
+
formChange: (_data) => true
|
|
13293
|
+
},
|
|
13294
|
+
setup(props, { emit, slots, expose }) {
|
|
13295
|
+
const displayItemInstance = ref(null);
|
|
13296
|
+
const cellInstance = ref(null);
|
|
13297
|
+
const formRefs = inject(
|
|
13298
|
+
TableFormRefInjectionKey,
|
|
13299
|
+
null
|
|
13300
|
+
);
|
|
13301
|
+
const handleClick = (event) => {
|
|
13302
|
+
emit("cellClick", props.row, props.column, event);
|
|
13303
|
+
};
|
|
13304
|
+
const handleDblclick = (event) => {
|
|
13305
|
+
emit("cellDblclick", props.row, props.column, event);
|
|
13306
|
+
};
|
|
13307
|
+
const handleChange = (data) => {
|
|
13308
|
+
emit("formChange", {
|
|
13309
|
+
...data,
|
|
13310
|
+
index: props.index,
|
|
13311
|
+
rowIndex: props.index,
|
|
13312
|
+
cellIndex: props.cellIndex,
|
|
13313
|
+
column: { ...props.rest.column, ...props.column }
|
|
13314
|
+
});
|
|
13315
|
+
};
|
|
13316
|
+
const syncFormRef = () => {
|
|
13317
|
+
const instance = displayItemInstance.value;
|
|
13318
|
+
if (!formRefs || !instance) return;
|
|
13319
|
+
const info = {
|
|
13320
|
+
...instance,
|
|
13321
|
+
...instance.getDisplayItemInstance(),
|
|
13322
|
+
index: props.index,
|
|
13323
|
+
rowIndex: props.index,
|
|
13324
|
+
cellIndex: props.cellIndex
|
|
13325
|
+
};
|
|
13326
|
+
set(formRefs.value, [props.index, props.cellIndex], info);
|
|
13327
|
+
};
|
|
13328
|
+
watch(
|
|
13329
|
+
() => [props.index, props.cellIndex, props.column.prop, displayItemInstance.value],
|
|
13330
|
+
syncFormRef,
|
|
13331
|
+
{
|
|
13332
|
+
flush: "post",
|
|
13333
|
+
immediate: true
|
|
13334
|
+
}
|
|
13335
|
+
);
|
|
13336
|
+
expose({
|
|
13337
|
+
cellInstance,
|
|
13338
|
+
startCellEdit: () => {
|
|
13339
|
+
var _a;
|
|
13340
|
+
return (_a = displayItemInstance.value) == null ? void 0 : _a.startCellEdit();
|
|
13341
|
+
},
|
|
13342
|
+
stopCellEdit: () => {
|
|
13343
|
+
var _a;
|
|
13344
|
+
return (_a = displayItemInstance.value) == null ? void 0 : _a.stopCellEdit();
|
|
13345
|
+
},
|
|
13346
|
+
getDisplayItemInstance: () => {
|
|
13347
|
+
var _a;
|
|
13348
|
+
return (_a = displayItemInstance.value) == null ? void 0 : _a.getDisplayItemInstance();
|
|
13349
|
+
}
|
|
13350
|
+
});
|
|
13351
|
+
return () => h(
|
|
13352
|
+
"div",
|
|
13353
|
+
{
|
|
13354
|
+
ref: cellInstance,
|
|
13355
|
+
class: "plus-table-v2-cell",
|
|
13356
|
+
onClick: handleClick,
|
|
13357
|
+
onDblclick: handleDblclick
|
|
13358
|
+
},
|
|
13359
|
+
[
|
|
13360
|
+
h(
|
|
13361
|
+
PlusDisplayItem,
|
|
13362
|
+
{
|
|
13363
|
+
ref: displayItemInstance,
|
|
13364
|
+
column: props.column,
|
|
13365
|
+
row: props.row,
|
|
13366
|
+
index: props.index,
|
|
13367
|
+
editable: props.editable,
|
|
13368
|
+
rest: props.rest,
|
|
13369
|
+
emptyValue: props.emptyValue,
|
|
13370
|
+
onChange: handleChange
|
|
13371
|
+
},
|
|
13372
|
+
slots
|
|
13373
|
+
)
|
|
13374
|
+
]
|
|
13375
|
+
);
|
|
13376
|
+
}
|
|
13377
|
+
});
|
|
13378
|
+
|
|
13379
|
+
var _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
13380
|
+
...{
|
|
13381
|
+
name: "PlusTableV2",
|
|
13382
|
+
inheritAttrs: false
|
|
13383
|
+
},
|
|
13384
|
+
__name: "index",
|
|
13385
|
+
props: {
|
|
13386
|
+
tableData: { default: () => [] },
|
|
13387
|
+
data: { default: () => [] },
|
|
13388
|
+
columns: { default: () => [] },
|
|
13389
|
+
defaultSize: { default: "default" },
|
|
13390
|
+
pagination: { type: [Boolean, Object], default: false },
|
|
13391
|
+
actionBar: { type: [Boolean, Object], default: false },
|
|
13392
|
+
hasIndexColumn: { type: Boolean, default: false },
|
|
13393
|
+
titleBar: { type: [Boolean, Object], default: true },
|
|
13394
|
+
isSelection: { type: Boolean, default: false },
|
|
13395
|
+
isRadio: { type: Boolean, default: false },
|
|
13396
|
+
specialColumnsOrder: { default: () => ["radio", "selection", "index"] },
|
|
13397
|
+
loadingStatus: { type: Boolean, default: false },
|
|
13398
|
+
height: { default: void 0 },
|
|
13399
|
+
width: { default: void 0 },
|
|
13400
|
+
rowHeight: { default: void 0 },
|
|
13401
|
+
headerHeight: { default: 50 },
|
|
13402
|
+
headerCellStyle: { default: () => ({
|
|
13403
|
+
"background-color": "var(--el-fill-color-light)"
|
|
13404
|
+
}) },
|
|
13405
|
+
rowKey: { default: "id" },
|
|
13406
|
+
defaultSelectedRadioRow: { default: void 0 },
|
|
13407
|
+
radioProps: { default: void 0 },
|
|
13408
|
+
selectionTableColumnProps: { default: () => ({ width: 40 }) },
|
|
13409
|
+
radioTableColumnProps: { default: () => ({ width: 50 }) },
|
|
13410
|
+
indexTableColumnProps: { default: () => ({}) },
|
|
13411
|
+
indexContentStyle: { type: [Object, Function], default: () => ({}) },
|
|
13412
|
+
editable: { type: [Boolean, String], default: false },
|
|
13413
|
+
adaptive: { type: [Boolean, Object], default: false },
|
|
13414
|
+
emptyValue: { default: void 0 }
|
|
13415
|
+
},
|
|
13416
|
+
emits: ["paginationChange", "clickAction", "clickActionConfirmCancel", "formChange", "refresh", "edited", "cell-click", "cell-dblclick", "filterTableHeader", "radioChange", "selection-change", "row-click", "row-dblclick"],
|
|
13417
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
13418
|
+
var _a, _b;
|
|
13419
|
+
const props = __props;
|
|
13420
|
+
const emit = __emit;
|
|
13421
|
+
const { t } = useLocale();
|
|
13422
|
+
const slots = useSlots();
|
|
13423
|
+
const tableWrapperInstance = ref(null);
|
|
13424
|
+
const tableInstance = shallowRef(null);
|
|
13425
|
+
const paginationInstance = ref(null);
|
|
13426
|
+
const state = reactive({
|
|
13427
|
+
size: props.defaultSize,
|
|
13428
|
+
subPageInfo: {
|
|
13429
|
+
...((_a = props.pagination) == null ? void 0 : _a.modelValue) || DefaultPageInfo
|
|
13430
|
+
}
|
|
13431
|
+
});
|
|
13432
|
+
const __tableData = computed(
|
|
13433
|
+
() => {
|
|
13434
|
+
var _a2;
|
|
13435
|
+
return ((_a2 = props.tableData) == null ? void 0 : _a2.length) ? props.tableData : props.data;
|
|
13436
|
+
}
|
|
13437
|
+
);
|
|
13438
|
+
const { subColumns, filterColumns, columnsIsChange, setFilterColumns } = useTableColumns({
|
|
13439
|
+
columns: () => props.columns
|
|
13440
|
+
});
|
|
13441
|
+
const formRefs = shallowRef({});
|
|
13442
|
+
const formFieldRefs = shallowRef({});
|
|
13443
|
+
const sizeRowHeightMap = {
|
|
13444
|
+
default: 50,
|
|
13445
|
+
large: 60,
|
|
13446
|
+
small: 40
|
|
13447
|
+
};
|
|
13448
|
+
const currentRowHeight = computed(() => {
|
|
13449
|
+
var _a2, _b2;
|
|
13450
|
+
return (_b2 = (_a2 = props.rowHeight) != null ? _a2 : sizeRowHeightMap[state.size]) != null ? _b2 : 50;
|
|
13451
|
+
});
|
|
13452
|
+
const containerWidth = ref(0);
|
|
13453
|
+
const fillHeight = ref(400);
|
|
13454
|
+
const tableWidth = computed(() => {
|
|
13455
|
+
if (props.width !== void 0) return toColumnNumber(props.width);
|
|
13456
|
+
return Math.max(containerWidth.value, 1);
|
|
13457
|
+
});
|
|
13458
|
+
const tableHeight = computed(() => {
|
|
13459
|
+
if (props.height !== void 0) return toColumnNumber(props.height);
|
|
13460
|
+
return fillHeight.value;
|
|
13461
|
+
});
|
|
13462
|
+
const bodyHeight = computed(() => `${tableHeight.value}px`);
|
|
13463
|
+
const calcFillHeight = () => {
|
|
13464
|
+
var _a2;
|
|
13465
|
+
if (!tableWrapperInstance.value) return;
|
|
13466
|
+
let offsetBottom = 20;
|
|
13467
|
+
if (isPlainObject(props.adaptive)) {
|
|
13468
|
+
offsetBottom = (_a2 = props.adaptive.offsetBottom) != null ? _a2 : offsetBottom;
|
|
13469
|
+
}
|
|
13470
|
+
const paginationHeight = paginationInstance.value && props.pagination ? paginationInstance.value.$el.offsetHeight : 0;
|
|
13471
|
+
const top = tableWrapperInstance.value.getBoundingClientRect().top;
|
|
13472
|
+
fillHeight.value = Math.max(window.innerHeight - top - offsetBottom - paginationHeight, 100);
|
|
13473
|
+
};
|
|
13474
|
+
const handleResize = ({ width }) => {
|
|
13475
|
+
containerWidth.value = width;
|
|
13476
|
+
};
|
|
13477
|
+
const debounceCalcFillHeight = debounce(
|
|
13478
|
+
calcFillHeight,
|
|
13479
|
+
isPlainObject(props.adaptive) ? (_b = props.adaptive.timeout) != null ? _b : 60 : 60
|
|
13480
|
+
);
|
|
13481
|
+
const radioRow = ref({});
|
|
13482
|
+
watch(
|
|
13483
|
+
() => props.defaultSelectedRadioRow,
|
|
13484
|
+
(val) => {
|
|
13485
|
+
radioRow.value = val != null ? val : {};
|
|
13486
|
+
},
|
|
13487
|
+
{ immediate: true }
|
|
13488
|
+
);
|
|
13489
|
+
const selectedRows = ref([]);
|
|
13490
|
+
const getRowKeyValue = (row) => row == null ? void 0 : row[props.rowKey];
|
|
13491
|
+
const isRowSelected = (row) => {
|
|
13492
|
+
const key = getRowKeyValue(row);
|
|
13493
|
+
return selectedRows.value.some((item) => getRowKeyValue(item) === key);
|
|
13494
|
+
};
|
|
13495
|
+
const isAllSelected = () => __tableData.value.length > 0 && selectedRows.value.length === __tableData.value.length;
|
|
13496
|
+
const isIndeterminate = () => selectedRows.value.length > 0 && selectedRows.value.length < __tableData.value.length;
|
|
13497
|
+
const handleToggleRow = (row, checked) => {
|
|
13498
|
+
const key = getRowKeyValue(row);
|
|
13499
|
+
const rest = selectedRows.value.filter((item) => getRowKeyValue(item) !== key);
|
|
13500
|
+
selectedRows.value = checked ? [...rest, row] : rest;
|
|
13501
|
+
emit("selection-change", selectedRows.value);
|
|
13502
|
+
};
|
|
13503
|
+
const handleToggleAll = (checked) => {
|
|
13504
|
+
selectedRows.value = checked ? [...__tableData.value] : [];
|
|
13505
|
+
emit("selection-change", selectedRows.value);
|
|
13506
|
+
};
|
|
13507
|
+
const handleRadioChange = (value, row) => {
|
|
13508
|
+
radioRow.value = value ? row : {};
|
|
13509
|
+
emit("radioChange", row, __tableData.value.indexOf(row), !!value);
|
|
13510
|
+
};
|
|
13511
|
+
const handleFormChange = (data) => {
|
|
13512
|
+
emit("formChange", data);
|
|
13513
|
+
};
|
|
13514
|
+
const handleRefresh = () => {
|
|
13515
|
+
emit("refresh");
|
|
13516
|
+
};
|
|
13517
|
+
const handleClickDensity = (size) => {
|
|
13518
|
+
state.size = size;
|
|
13519
|
+
};
|
|
13520
|
+
const handleFilterTableConfirm = (list, eventType) => {
|
|
13521
|
+
setFilterColumns(list);
|
|
13522
|
+
emit("filterTableHeader", list, eventType);
|
|
13523
|
+
};
|
|
13524
|
+
const handlePaginationChange = () => {
|
|
13525
|
+
emit("paginationChange", { ...state.subPageInfo });
|
|
13526
|
+
};
|
|
13527
|
+
const getCellForm = (row, column) => {
|
|
13528
|
+
var _a2;
|
|
13529
|
+
const rowIndex = __tableData.value.indexOf(row);
|
|
13530
|
+
const columnIndex = subColumns.value.findIndex((item) => item.prop === column.prop);
|
|
13531
|
+
if (rowIndex < 0 || columnIndex < 0) return null;
|
|
13532
|
+
return ((_a2 = formRefs.value[rowIndex]) == null ? void 0 : _a2[columnIndex]) || null;
|
|
13533
|
+
};
|
|
13534
|
+
const currentForm = shallowRef(null);
|
|
13535
|
+
const startCellEdit = (row, column) => {
|
|
13536
|
+
var _a2;
|
|
13537
|
+
const cellForm = getCellForm(row, column);
|
|
13538
|
+
if (!cellForm) return;
|
|
13539
|
+
document.addEventListener("click", handleStopEditClick);
|
|
13540
|
+
(_a2 = currentForm.value) == null ? void 0 : _a2.stopCellEdit();
|
|
13541
|
+
currentForm.value = cellForm;
|
|
13542
|
+
cellForm.startCellEdit();
|
|
13543
|
+
const unwatch = watch(
|
|
13544
|
+
() => formFieldRefs.value.valueIsReady,
|
|
13545
|
+
(val) => {
|
|
13546
|
+
var _a3, _b2;
|
|
13547
|
+
if ((val == null ? void 0 : val.value) && ((_b2 = (_a3 = formFieldRefs.value) == null ? void 0 : _a3.fieldInstance) == null ? void 0 : _b2.focus)) {
|
|
13548
|
+
formFieldRefs.value.fieldInstance.focus();
|
|
13549
|
+
unwatch();
|
|
13550
|
+
}
|
|
13551
|
+
}
|
|
13552
|
+
);
|
|
13553
|
+
};
|
|
13554
|
+
const handleStopEditClick = (event) => {
|
|
13555
|
+
var _a2;
|
|
13556
|
+
if (!tableWrapperInstance.value || !currentForm.value) return;
|
|
13557
|
+
const target = event == null ? void 0 : event.target;
|
|
13558
|
+
if ((_a2 = target == null ? void 0 : target.classList) == null ? void 0 : _a2.contains("el-icon")) return;
|
|
13559
|
+
if (tableWrapperInstance.value.contains(target)) return;
|
|
13560
|
+
currentForm.value.stopCellEdit();
|
|
13561
|
+
currentForm.value = null;
|
|
13562
|
+
emit("edited");
|
|
13563
|
+
document.removeEventListener("click", handleStopEditClick);
|
|
13564
|
+
};
|
|
13565
|
+
const handleCellClick = (row, column, event) => {
|
|
13566
|
+
if (props.editable === "click") startCellEdit(row, column);
|
|
13567
|
+
emit("cell-click", row, column, event.currentTarget, event);
|
|
13568
|
+
};
|
|
13569
|
+
const handleCellDblclick = (row, column, event) => {
|
|
13570
|
+
if (props.editable === "dblclick") startCellEdit(row, column);
|
|
13571
|
+
emit("cell-dblclick", row, column, event.currentTarget, event);
|
|
13572
|
+
};
|
|
13573
|
+
const getCellSlots = () => {
|
|
13574
|
+
const cellSlots = {};
|
|
13575
|
+
Object.keys(slots).forEach((key) => {
|
|
13576
|
+
if (key.startsWith("plus-") || key === "edit-icon") {
|
|
13577
|
+
cellSlots[key] = slots[key];
|
|
13578
|
+
}
|
|
13579
|
+
});
|
|
13580
|
+
return cellSlots;
|
|
13581
|
+
};
|
|
13582
|
+
const renderCell = ({
|
|
13583
|
+
column,
|
|
13584
|
+
row,
|
|
13585
|
+
rowIndex,
|
|
13586
|
+
columnIndex
|
|
13587
|
+
}) => h(
|
|
13588
|
+
TableV2Cell,
|
|
13589
|
+
{
|
|
13590
|
+
column,
|
|
13591
|
+
row,
|
|
13592
|
+
index: rowIndex,
|
|
13593
|
+
cellIndex: columnIndex,
|
|
13594
|
+
editable: props.editable,
|
|
13595
|
+
emptyValue: props.emptyValue,
|
|
13596
|
+
onCellClick: handleCellClick,
|
|
13597
|
+
onCellDblclick: handleCellDblclick,
|
|
13598
|
+
onFormChange: handleFormChange
|
|
13599
|
+
},
|
|
13600
|
+
getCellSlots()
|
|
13601
|
+
);
|
|
13602
|
+
const dataColumns = computed(
|
|
13603
|
+
() => buildDataColumns({
|
|
13604
|
+
columns: subColumns.value,
|
|
13605
|
+
renderCell,
|
|
13606
|
+
slots
|
|
13607
|
+
})
|
|
13608
|
+
);
|
|
13609
|
+
const actionBarColumn = computed(() => {
|
|
13610
|
+
var _a2;
|
|
13611
|
+
if (!props.actionBar) return null;
|
|
13612
|
+
const actionBar = props.actionBar;
|
|
13613
|
+
return {
|
|
13614
|
+
key: "actionBar",
|
|
13615
|
+
title: actionBar.label || t("plus.table.action"),
|
|
13616
|
+
width: toColumnNumber(actionBar.width) || 200,
|
|
13617
|
+
fixed: actionBar.fixed || "right",
|
|
13618
|
+
align: (_a2 = actionBar.actionBarTableColumnProps) == null ? void 0 : _a2.align,
|
|
13619
|
+
cellRenderer: ({ rowData, rowIndex }) => h(
|
|
13620
|
+
PlusTableActionBarContent,
|
|
13621
|
+
{
|
|
13622
|
+
row: rowData,
|
|
13623
|
+
index: rowIndex,
|
|
13624
|
+
type: actionBar.type,
|
|
13625
|
+
buttons: actionBar.buttons,
|
|
13626
|
+
showNumber: actionBar.showNumber,
|
|
13627
|
+
showLimitIncludeMore: actionBar.showLimitIncludeMore,
|
|
13628
|
+
confirmType: actionBar.confirmType,
|
|
13629
|
+
moreType: actionBar.moreType,
|
|
13630
|
+
onClickAction: (data) => emit("clickAction", data),
|
|
13631
|
+
onClickActionConfirmCancel: (data) => emit("clickActionConfirmCancel", data)
|
|
13632
|
+
},
|
|
13633
|
+
{
|
|
13634
|
+
"action-bar-more-icon": () => {
|
|
13635
|
+
var _a3;
|
|
13636
|
+
return (_a3 = slots["action-bar-more-icon"]) == null ? void 0 : _a3.call(slots);
|
|
13637
|
+
}
|
|
13638
|
+
}
|
|
13639
|
+
)
|
|
13640
|
+
};
|
|
13641
|
+
});
|
|
13642
|
+
const specialColumns = computed(() => {
|
|
13643
|
+
const activeList = [];
|
|
13644
|
+
if (props.isRadio) activeList.push("radio");
|
|
13645
|
+
if (props.isSelection) activeList.push("selection");
|
|
13646
|
+
if (props.hasIndexColumn) activeList.push("index");
|
|
13647
|
+
const defaultOrder = ["radio", "selection", "index"];
|
|
13648
|
+
const order = [...props.specialColumnsOrder || [], ...defaultOrder].filter(
|
|
13649
|
+
(item, index, array) => array.indexOf(item) === index
|
|
13650
|
+
);
|
|
13651
|
+
return order.filter((item) => activeList.includes(item)).map((item) => {
|
|
13652
|
+
if (item === "radio") {
|
|
13653
|
+
return buildRadioColumn({
|
|
13654
|
+
radioRow: () => radioRow.value,
|
|
13655
|
+
onChange: handleRadioChange,
|
|
13656
|
+
radioProps: props.radioProps,
|
|
13657
|
+
columnProps: props.radioTableColumnProps
|
|
13658
|
+
});
|
|
13659
|
+
}
|
|
13660
|
+
if (item === "selection") {
|
|
13661
|
+
return buildSelectionColumn({
|
|
13662
|
+
isSelected: isRowSelected,
|
|
13663
|
+
isAllSelected,
|
|
13664
|
+
isIndeterminate,
|
|
13665
|
+
onToggleRow: handleToggleRow,
|
|
13666
|
+
onToggleAll: handleToggleAll,
|
|
13667
|
+
columnProps: props.selectionTableColumnProps
|
|
13668
|
+
});
|
|
13669
|
+
}
|
|
13670
|
+
return buildIndexColumn({
|
|
13671
|
+
pageInfo: state.subPageInfo,
|
|
13672
|
+
indexContentStyle: props.indexContentStyle,
|
|
13673
|
+
columnProps: props.indexTableColumnProps
|
|
13674
|
+
});
|
|
13675
|
+
});
|
|
13676
|
+
});
|
|
13677
|
+
const allColumns = computed(() => {
|
|
13678
|
+
const list = [...specialColumns.value, ...dataColumns.value];
|
|
13679
|
+
if (actionBarColumn.value) list.push(actionBarColumn.value);
|
|
13680
|
+
return list;
|
|
13681
|
+
});
|
|
13682
|
+
const { resolvedColumns } = useTableV2Columns({
|
|
13683
|
+
columns: () => allColumns.value,
|
|
13684
|
+
containerWidth: () => tableWidth.value
|
|
13685
|
+
});
|
|
13686
|
+
const headerCellProps = () => ({ style: props.headerCellStyle });
|
|
13687
|
+
const rowEventHandlers = computed(() => ({
|
|
13688
|
+
onClick: ({ rowData, rowIndex, event }) => {
|
|
13689
|
+
emit("row-click", rowData, rowIndex, event);
|
|
13690
|
+
},
|
|
13691
|
+
onDblclick: ({ rowData, rowIndex, event }) => {
|
|
13692
|
+
emit("row-dblclick", rowData, rowIndex, event);
|
|
13693
|
+
}
|
|
13694
|
+
}));
|
|
13695
|
+
onMounted(() => {
|
|
13696
|
+
calcFillHeight();
|
|
13697
|
+
window.addEventListener("resize", debounceCalcFillHeight);
|
|
13698
|
+
});
|
|
13699
|
+
onBeforeUnmount(() => {
|
|
13700
|
+
window.removeEventListener("resize", debounceCalcFillHeight);
|
|
13701
|
+
document.removeEventListener("click", handleStopEditClick);
|
|
13702
|
+
});
|
|
13703
|
+
provide(TableFormRefInjectionKey, formRefs);
|
|
13704
|
+
provide(TableFormFieldRefInjectionKey, formFieldRefs);
|
|
13705
|
+
__expose({
|
|
13706
|
+
formRefs,
|
|
13707
|
+
tableInstance,
|
|
13708
|
+
/** 滚动到指定垂直位置 */
|
|
13709
|
+
scrollToTop: (top) => {
|
|
13710
|
+
var _a2;
|
|
13711
|
+
return (_a2 = tableInstance.value) == null ? void 0 : _a2.scrollToTop(top);
|
|
13712
|
+
},
|
|
13713
|
+
/** 滚动到指定水平位置 */
|
|
13714
|
+
scrollToLeft: (left) => {
|
|
13715
|
+
var _a2;
|
|
13716
|
+
return (_a2 = tableInstance.value) == null ? void 0 : _a2.scrollToLeft(left);
|
|
13717
|
+
},
|
|
13718
|
+
/** 滚动到指定行 */
|
|
13719
|
+
scrollToRow: (row, strategy) => {
|
|
13720
|
+
var _a2;
|
|
13721
|
+
return (_a2 = tableInstance.value) == null ? void 0 : _a2.scrollToRow(row, strategy);
|
|
13722
|
+
}
|
|
13723
|
+
});
|
|
13724
|
+
return (_ctx, _cache) => {
|
|
13725
|
+
return openBlock(), createElementBlock(
|
|
13726
|
+
"div",
|
|
13727
|
+
{
|
|
13728
|
+
ref_key: "tableWrapperInstance",
|
|
13729
|
+
ref: tableWrapperInstance,
|
|
13730
|
+
class: "plus-table-v2"
|
|
13731
|
+
},
|
|
13732
|
+
[
|
|
13733
|
+
createCommentVNode(" \u6807\u9898\u680F\uFF1A\u5237\u65B0 / \u5BC6\u5EA6 / \u5217\u8BBE\u7F6E\uFF0C\u4E0E el-table \u7248\u672C\u590D\u7528\u540C\u4E00\u7EC4\u4EF6 "),
|
|
13734
|
+
_ctx.titleBar ? (openBlock(), createBlock(unref(PlusTableTitleBar), {
|
|
13735
|
+
key: 0,
|
|
13736
|
+
"origin-columns": _ctx.columns,
|
|
13737
|
+
columns: unref(filterColumns),
|
|
13738
|
+
"default-size": state.size,
|
|
13739
|
+
"columns-is-change": unref(columnsIsChange),
|
|
13740
|
+
"title-bar": _ctx.titleBar,
|
|
13741
|
+
onClickDensity: handleClickDensity,
|
|
13742
|
+
onFilterTableHeader: handleFilterTableConfirm,
|
|
13743
|
+
onRefresh: handleRefresh
|
|
13744
|
+
}, createSlots({
|
|
13745
|
+
title: withCtx(() => [
|
|
13746
|
+
renderSlot(_ctx.$slots, "title")
|
|
13747
|
+
]),
|
|
13748
|
+
toolbar: withCtx(() => [
|
|
13749
|
+
renderSlot(_ctx.$slots, "toolbar")
|
|
13750
|
+
]),
|
|
13751
|
+
_: 2
|
|
13752
|
+
/* DYNAMIC */
|
|
13753
|
+
}, [
|
|
13754
|
+
_ctx.$slots["column-settings-icon"] ? {
|
|
13755
|
+
name: "column-settings-icon",
|
|
13756
|
+
fn: withCtx(() => [
|
|
13757
|
+
renderSlot(_ctx.$slots, "column-settings-icon")
|
|
13758
|
+
]),
|
|
13759
|
+
key: "0"
|
|
13760
|
+
} : void 0,
|
|
13761
|
+
_ctx.$slots["density-icon"] ? {
|
|
13762
|
+
name: "density-icon",
|
|
13763
|
+
fn: withCtx(() => [
|
|
13764
|
+
renderSlot(_ctx.$slots, "density-icon")
|
|
13765
|
+
]),
|
|
13766
|
+
key: "1"
|
|
13767
|
+
} : void 0
|
|
13768
|
+
]), 1032, ["origin-columns", "columns", "default-size", "columns-is-change", "title-bar"])) : createCommentVNode("v-if", true),
|
|
13769
|
+
createCommentVNode(" \u865A\u62DF\u8868\u683C\u4E3B\u4F53\uFF1A\u5BBD\u5EA6\u6491\u6EE1\u7236\u5BB9\u5668\uFF0C\u9AD8\u5EA6\u6309 props.height / adaptive \u8BA1\u7B97 "),
|
|
13770
|
+
withDirectives((openBlock(), createElementBlock(
|
|
13771
|
+
"div",
|
|
13772
|
+
{
|
|
13773
|
+
class: "plus-table-v2__body",
|
|
13774
|
+
style: normalizeStyle({ height: bodyHeight.value })
|
|
13775
|
+
},
|
|
13776
|
+
[
|
|
13777
|
+
createVNode(unref(ElAutoResizer), {
|
|
13778
|
+
"disable-height": true,
|
|
13779
|
+
"on-resize": handleResize
|
|
13780
|
+
}, {
|
|
13781
|
+
default: withCtx(() => [
|
|
13782
|
+
createVNode(unref(ElTableV2), mergeProps({
|
|
13783
|
+
ref_key: "tableInstance",
|
|
13784
|
+
ref: tableInstance,
|
|
13785
|
+
columns: unref(resolvedColumns),
|
|
13786
|
+
data: __tableData.value,
|
|
13787
|
+
width: tableWidth.value,
|
|
13788
|
+
height: tableHeight.value,
|
|
13789
|
+
"row-height": currentRowHeight.value,
|
|
13790
|
+
"header-height": _ctx.headerHeight,
|
|
13791
|
+
"row-key": _ctx.rowKey,
|
|
13792
|
+
"header-cell-props": headerCellProps,
|
|
13793
|
+
"row-event-handlers": rowEventHandlers.value,
|
|
13794
|
+
fixed: true,
|
|
13795
|
+
"scrollbar-always-on": true
|
|
13796
|
+
}, _ctx.$attrs), {
|
|
13797
|
+
empty: withCtx(() => [
|
|
13798
|
+
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
13799
|
+
createVNode(unref(ElEmpty))
|
|
13800
|
+
])
|
|
13801
|
+
]),
|
|
13802
|
+
_: 3
|
|
13803
|
+
/* FORWARDED */
|
|
13804
|
+
}, 16, ["columns", "data", "width", "height", "row-height", "header-height", "row-key", "row-event-handlers"])
|
|
13805
|
+
]),
|
|
13806
|
+
_: 3
|
|
13807
|
+
/* FORWARDED */
|
|
13808
|
+
})
|
|
13809
|
+
],
|
|
13810
|
+
4
|
|
13811
|
+
/* STYLE */
|
|
13812
|
+
)), [
|
|
13813
|
+
[unref(vLoading), _ctx.loadingStatus]
|
|
13814
|
+
]),
|
|
13815
|
+
createCommentVNode(" \u5206\u9875 "),
|
|
13816
|
+
_ctx.pagination ? (openBlock(), createBlock(unref(PlusPagination), mergeProps({
|
|
13817
|
+
key: 1,
|
|
13818
|
+
ref_key: "paginationInstance",
|
|
13819
|
+
ref: paginationInstance,
|
|
13820
|
+
modelValue: state.subPageInfo,
|
|
13821
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.subPageInfo = $event)
|
|
13822
|
+
}, _ctx.pagination, { onChange: handlePaginationChange }), createSlots({
|
|
13823
|
+
_: 2
|
|
13824
|
+
/* DYNAMIC */
|
|
13825
|
+
}, [
|
|
13826
|
+
_ctx.$slots["pagination-left"] ? {
|
|
13827
|
+
name: "pagination-left",
|
|
13828
|
+
fn: withCtx(() => [
|
|
13829
|
+
renderSlot(_ctx.$slots, "pagination-left")
|
|
13830
|
+
]),
|
|
13831
|
+
key: "0"
|
|
13832
|
+
} : void 0,
|
|
13833
|
+
_ctx.$slots["pagination-right"] ? {
|
|
13834
|
+
name: "pagination-right",
|
|
13835
|
+
fn: withCtx(() => [
|
|
13836
|
+
renderSlot(_ctx.$slots, "pagination-right")
|
|
13837
|
+
]),
|
|
13838
|
+
key: "1"
|
|
13839
|
+
} : void 0
|
|
13840
|
+
]), 1040, ["modelValue"])) : createCommentVNode("v-if", true)
|
|
13841
|
+
],
|
|
13842
|
+
512
|
|
13843
|
+
/* NEED_PATCH */
|
|
13844
|
+
);
|
|
13845
|
+
};
|
|
13846
|
+
}
|
|
13847
|
+
});
|
|
13848
|
+
|
|
13849
|
+
var TableV2 = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__file", "index.vue"]]);
|
|
13850
|
+
|
|
13851
|
+
const PlusTableV2 = TableV2;
|
|
13852
|
+
|
|
13853
|
+
var _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
13854
|
+
...{
|
|
13855
|
+
name: "PlusDescriptions"
|
|
13856
|
+
},
|
|
13857
|
+
__name: "index",
|
|
13858
|
+
props: {
|
|
13859
|
+
data: { default: () => ({}) },
|
|
13860
|
+
columns: { default: () => [] },
|
|
13861
|
+
column: { default: 3 },
|
|
13862
|
+
title: { default: "" },
|
|
13863
|
+
border: { type: Boolean, default: true },
|
|
13864
|
+
editable: { type: Boolean, default: false },
|
|
13865
|
+
formProps: { default: void 0 },
|
|
13866
|
+
descriptionsItemProps: { default: void 0 }
|
|
13867
|
+
},
|
|
13868
|
+
emits: ["formChange"],
|
|
13869
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
13870
|
+
const props = __props;
|
|
13871
|
+
const emit = __emit;
|
|
13872
|
+
const slots = useSlots();
|
|
13873
|
+
const plusDisplayItemInstance = ref();
|
|
13874
|
+
const elBorder = computed(() => props.editable ? true : props.border);
|
|
13875
|
+
const formRefs = shallowRef([]);
|
|
13876
|
+
const subColumns = computed(
|
|
13877
|
+
() => props.columns.filter((item) => unref(item.hideInDescriptions) !== true)
|
|
13878
|
+
);
|
|
13879
|
+
const getDisplayValue = (prop) => getValue(props.data, prop);
|
|
13880
|
+
const hasDescSlot = (prop) => !!slots[getDescSlotName(prop)];
|
|
13881
|
+
const hasDescLabelSlot = (prop) => !!slots[getDescLabelSlotName(prop)];
|
|
13882
|
+
const subColumnsKey = computed(() => subColumns.value.map((i) => i.prop).join(","));
|
|
13883
|
+
const setFormRef = () => {
|
|
13884
|
+
var _a, _b;
|
|
13885
|
+
if (!((_a = plusDisplayItemInstance.value) == null ? void 0 : _a.length)) return;
|
|
13886
|
+
const list = ((_b = plusDisplayItemInstance.value) == null ? void 0 : _b.map((item) => ({
|
|
13887
|
+
...item,
|
|
13888
|
+
...item == null ? void 0 : item.getDisplayItemInstance()
|
|
13889
|
+
}))) || [];
|
|
13890
|
+
formRefs.value = list;
|
|
13891
|
+
};
|
|
13892
|
+
watch(
|
|
13893
|
+
plusDisplayItemInstance,
|
|
13894
|
+
() => {
|
|
13895
|
+
setFormRef();
|
|
13896
|
+
},
|
|
13897
|
+
{
|
|
13898
|
+
deep: true,
|
|
13899
|
+
flush: "post"
|
|
13900
|
+
}
|
|
13901
|
+
);
|
|
13902
|
+
const getIsRequired = (item, index) => {
|
|
13903
|
+
var _a;
|
|
13904
|
+
const itemFormProps = isFunction(item.formProps) ? item.formProps(props.data[item.prop], { row: props.data, index }) : unref(item.formProps);
|
|
12371
13905
|
const rules = Reflect.get((itemFormProps == null ? void 0 : itemFormProps.rules) || ((_a = props.formProps) == null ? void 0 : _a.rules) || {}, item.prop) || {};
|
|
12372
13906
|
const isRequired = Object.values(rules).some((i) => i.required);
|
|
12373
13907
|
return isRequired;
|
|
@@ -13096,6 +14630,9 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
13096
14630
|
request: {},
|
|
13097
14631
|
search: { type: [Boolean, Object], default: () => ({}) },
|
|
13098
14632
|
table: { default: () => ({}) },
|
|
14633
|
+
tableType: { default: "table" },
|
|
14634
|
+
tableV2: { default: void 0 },
|
|
14635
|
+
tableLite: { default: void 0 },
|
|
13099
14636
|
params: { default: () => ({}) },
|
|
13100
14637
|
postData: { type: Function, default: void 0 },
|
|
13101
14638
|
beforeSearchSubmit: { type: Function, default: void 0 },
|
|
@@ -13114,7 +14651,7 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
13114
14651
|
searchSlot: { type: Boolean, default: false },
|
|
13115
14652
|
resetSearch: { type: Boolean, default: true }
|
|
13116
14653
|
},
|
|
13117
|
-
emits: ["update:searchValues", "search", "reset", "searchChange", "paginationChange", "requestError", "requestComplete"],
|
|
14654
|
+
emits: ["update:searchValues", "search", "reset", "searchChange", "paginationChange", "selectionChange", "requestError", "requestComplete"],
|
|
13118
14655
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
13119
14656
|
var _a, _b;
|
|
13120
14657
|
const props = __props;
|
|
@@ -13149,6 +14686,30 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
13149
14686
|
const values = ref(
|
|
13150
14687
|
(_b = props.searchValues) != null ? _b : { ...(_a = props.search) == null ? void 0 : _a.defaultValues }
|
|
13151
14688
|
);
|
|
14689
|
+
const tableComponentMap = /* @__PURE__ */ new Map([
|
|
14690
|
+
["table", PlusTable],
|
|
14691
|
+
["table-v2", PlusTableV2],
|
|
14692
|
+
["table-lite", PlusTableLite]
|
|
14693
|
+
]);
|
|
14694
|
+
const tableComponent = computed(() => tableComponentMap.get(props.tableType) || PlusTable);
|
|
14695
|
+
const tableProps = computed(() => {
|
|
14696
|
+
if (props.tableType === "table-v2") {
|
|
14697
|
+
return { ...props.table, ...props.tableV2 };
|
|
14698
|
+
}
|
|
14699
|
+
if (props.tableType === "table-lite") {
|
|
14700
|
+
return { ...props.table, ...props.tableLite };
|
|
14701
|
+
}
|
|
14702
|
+
return props.table;
|
|
14703
|
+
});
|
|
14704
|
+
const tablePagination = computed(() => {
|
|
14705
|
+
if (props.pagination === false) return void 0;
|
|
14706
|
+
return {
|
|
14707
|
+
...props.pagination,
|
|
14708
|
+
total: total.value,
|
|
14709
|
+
modelValue: pageInfo.value,
|
|
14710
|
+
pageSizeList: computedDefaultPageSizeList.value
|
|
14711
|
+
};
|
|
14712
|
+
});
|
|
13152
14713
|
watch(
|
|
13153
14714
|
() => props.searchValues,
|
|
13154
14715
|
(val) => {
|
|
@@ -13198,6 +14759,12 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
13198
14759
|
getList();
|
|
13199
14760
|
emit("paginationChange", _pageInfo);
|
|
13200
14761
|
};
|
|
14762
|
+
const handleTablePaginationChange = (data) => {
|
|
14763
|
+
handlePaginationChange(data);
|
|
14764
|
+
};
|
|
14765
|
+
const handleTableSelectionChange = (data) => {
|
|
14766
|
+
emit("selectionChange", data || []);
|
|
14767
|
+
};
|
|
13201
14768
|
const handleSearchChange = (val, column) => {
|
|
13202
14769
|
emit("update:searchValues", val);
|
|
13203
14770
|
emit("searchChange", val, column);
|
|
@@ -13312,22 +14879,18 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
13312
14879
|
class: "plus-page__table_wrapper"
|
|
13313
14880
|
}, {
|
|
13314
14881
|
default: withCtx(() => [
|
|
13315
|
-
|
|
14882
|
+
(openBlock(), createBlock(resolveDynamicComponent(tableComponent.value), mergeProps({
|
|
13316
14883
|
ref_key: "plusTableInstance",
|
|
13317
14884
|
ref: plusTableInstance,
|
|
13318
14885
|
"title-bar": { refresh: true }
|
|
13319
|
-
},
|
|
14886
|
+
}, tableProps.value, {
|
|
13320
14887
|
"table-data": unref(tableData),
|
|
13321
14888
|
"loading-status": unref(loadingStatus),
|
|
13322
14889
|
columns: _ctx.columns,
|
|
13323
|
-
pagination:
|
|
13324
|
-
|
|
13325
|
-
|
|
13326
|
-
|
|
13327
|
-
pageSizeList: computedDefaultPageSizeList.value
|
|
13328
|
-
},
|
|
13329
|
-
onPaginationChange: handlePaginationChange,
|
|
13330
|
-
onRefresh: handleRefresh
|
|
14890
|
+
pagination: tablePagination.value,
|
|
14891
|
+
onPaginationChange: handleTablePaginationChange,
|
|
14892
|
+
onRefresh: handleRefresh,
|
|
14893
|
+
onSelectionChange: handleTableSelectionChange
|
|
13331
14894
|
}), createSlots({
|
|
13332
14895
|
_: 2
|
|
13333
14896
|
/* DYNAMIC */
|
|
@@ -13375,7 +14938,7 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
13375
14938
|
])
|
|
13376
14939
|
};
|
|
13377
14940
|
})
|
|
13378
|
-
]), 1040, ["table-data", "loading-status", "columns", "pagination"])
|
|
14941
|
+
]), 1040, ["table-data", "loading-status", "columns", "pagination"]))
|
|
13379
14942
|
]),
|
|
13380
14943
|
_: 3
|
|
13381
14944
|
/* FORWARDED */
|
|
@@ -14770,6 +16333,8 @@ const plugins = [
|
|
|
14770
16333
|
PlusDialog,
|
|
14771
16334
|
PlusPagination,
|
|
14772
16335
|
PlusTable,
|
|
16336
|
+
PlusTableLite,
|
|
16337
|
+
PlusTableV2,
|
|
14773
16338
|
PlusRadio,
|
|
14774
16339
|
PlusDatePicker,
|
|
14775
16340
|
PlusDescriptions,
|
|
@@ -14793,8 +16358,8 @@ const plugins = [
|
|
|
14793
16358
|
|
|
14794
16359
|
var installer = makeInstaller([...plugins]);
|
|
14795
16360
|
|
|
14796
|
-
const version = "1.0.
|
|
16361
|
+
const version = "1.0.2";
|
|
14797
16362
|
|
|
14798
16363
|
const install = installer.install;
|
|
14799
16364
|
|
|
14800
|
-
export { DatePickerValueIsArrayList, DefaultPageInfo, DefaultPageSizeList, PlusBreadcrumb, PlusCheckCard, PlusCheckCardGroup, PlusDatePicker, PlusDescriptions, PlusDialog, PlusDialogForm, PlusDisplayItem, PlusDrawerForm, PlusForm, PlusFormItem, PlusHeader, PlusInputTag, PlusLayout, PlusPage, PlusPagination, PlusPopover, PlusRadio, PlusSearch, PlusSidebar, PlusSidebarItem, PlusStepsForm, PlusTable, TableFormFieldRefInjectionKey, TableFormRefInjectionKey, TableFormRowInfoInjectionKey, ValueIsArrayList, ValueIsBooleanList, ValueIsNumberList, buildLocaleContext, buildTranslator, installer as default, getOptionsByOptionsMap, install, selectValueTypeList, translate, useGetOptions, useLocale, useTable, version };
|
|
16365
|
+
export { DatePickerValueIsArrayList, DefaultPageInfo, DefaultPageSizeList, PlusBreadcrumb, PlusCheckCard, PlusCheckCardGroup, PlusDatePicker, PlusDescriptions, PlusDialog, PlusDialogForm, PlusDisplayItem, PlusDrawerForm, PlusForm, PlusFormItem, PlusHeader, PlusInputTag, PlusLayout, PlusPage, PlusPagination, PlusPopover, PlusRadio, PlusSearch, PlusSidebar, PlusSidebarItem, PlusStepsForm, PlusTable, PlusTableActionBarContent, PlusTableLite, PlusTableTitleBar, PlusTableV2, TableFormFieldRefInjectionKey, TableFormRefInjectionKey, TableFormRowInfoInjectionKey, ValueIsArrayList, ValueIsBooleanList, ValueIsNumberList, buildLocaleContext, buildTranslator, installer as default, getOptionsByOptionsMap, install, selectValueTypeList, translate, useGetOptions, useLocale, useTable, useTableColumns, useTableV2Columns, version };
|