@qy_better_lib/pc 0.2.34 → 0.3.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/DOCUMENTATION.md +559 -0
- package/dist/@qy_better_lib/pc.min.js +1 -1
- package/lib/commDialog/index.d.ts +3 -0
- package/lib/commDialog/index.js +8 -0
- package/lib/commDialog/src/index.vue.d.ts +102 -0
- package/lib/commDialog/src/index.vue.js +49 -0
- package/lib/commDialog/src/index.vue2.js +4 -0
- package/lib/commDialog/src/props.d.ts +49 -0
- package/lib/commDialog/src/props.js +48 -0
- package/lib/commDialog/src/type.d.ts +39 -0
- package/lib/commForm/index.d.ts +3 -0
- package/lib/commForm/index.js +8 -0
- package/lib/commForm/src/index.vue.d.ts +95 -0
- package/lib/commForm/src/index.vue.js +51 -0
- package/lib/commForm/src/index.vue2.js +4 -0
- package/lib/commForm/src/props.d.ts +49 -0
- package/lib/commForm/src/props.js +47 -0
- package/lib/commForm/src/type.d.ts +8 -0
- package/lib/contextMenu/index.d.ts +5 -2
- package/lib/contextMenu/index.js +5 -4
- package/lib/contextMenu/src/index.vue.d.ts +48 -36
- package/lib/contextMenu/src/index.vue.js +128 -79
- package/lib/contextMenu/src/index.vue2.js +2 -2
- package/lib/contextMenu/src/props.d.ts +32 -0
- package/lib/contextMenu/src/props.js +27 -0
- package/lib/contextMenu/src/type.d.ts +11 -0
- package/lib/describeView/index.js +4 -4
- package/lib/describeView/src/index.vue.d.ts +6 -9
- package/lib/describeView/src/index.vue.js +73 -70
- package/lib/describeView/src/index.vue2.js +2 -2
- package/lib/describeView/src/props.d.ts +35 -0
- package/lib/describeView/src/props.js +33 -0
- package/lib/index.d.ts +7 -3
- package/lib/index.js +31 -21
- package/lib/simpleVirtualList/index.js +4 -4
- package/lib/simpleVirtualList/src/index.vue.js +70 -53
- package/lib/simpleVirtualList/src/index.vue2.js +2 -2
- package/lib/styles/comm-form.scss +4 -0
- package/lib/styles/index.scss +6 -5
- package/lib/tableExtend/index.js +4 -4
- package/lib/tableExtend/props.d.ts +74 -15
- package/lib/tableExtend/props.js +82 -24
- package/lib/tableExtend/src/colVisible.vue.js +95 -70
- package/lib/tableExtend/src/colVisible.vue2.js +2 -2
- package/lib/tableExtend/src/index.vue.d.ts +18 -10
- package/lib/tableExtend/src/index.vue.js +171 -142
- package/lib/tableExtend/src/index.vue2.js +2 -2
- package/lib/tableExtend/src/valueCol.vue.js +11 -8
- package/lib/tableExtend/src/valueCol.vue2.js +2 -2
- package/lib/tableExtend/type.d.ts +9 -14
- package/lib/tableExtend/type.js +7 -2
- package/lib/tableExtend/useTable.d.ts +19 -50
- package/lib/tableExtend/useTable.js +95 -56
- package/lib/textButton/index.js +4 -4
- package/lib/textButton/src/index.vue.d.ts +7 -6
- package/lib/textButton/src/index.vue.js +25 -37
- package/lib/textButton/src/index.vue2.js +2 -2
- package/lib/textButton/src/props.d.ts +23 -0
- package/lib/textButton/src/props.js +30 -0
- package/lib/textButton/src/type.d.ts +30 -0
- package/lib/utils/index.d.ts +55 -13
- package/lib/utils/index.js +98 -54
- package/package.json +25 -8
- package/types/index.d.ts +9 -1
- /package/lib/styles/{contextMenu.scss → context-menu.scss} +0 -0
- /package/lib/styles/{describeView.scss → describe-view.scss} +0 -0
- /package/lib/styles/{simpleVirtualList.scss → simple-virtual-list.scss} +0 -0
- /package/lib/styles/{tableExtend.scss → table-extend.scss} +0 -0
- /package/lib/styles/{textButton.scss → text-button.scss} +0 -0
|
@@ -1,93 +1,118 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent, inject, ref, computed, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createVNode, createTextVNode, createElementBlock, Fragment, renderList, toDisplayString, normalizeClass } from "vue";
|
|
2
|
+
const _hoisted_1 = { class: "set-column-list-wrap" };
|
|
3
|
+
const _hoisted_2 = { class: "fixed-wrap" };
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3
5
|
__name: "colVisible",
|
|
4
|
-
setup(
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
setup(__props) {
|
|
7
|
+
const table_props = inject("table-extend");
|
|
8
|
+
const check_all_columns = ref(true);
|
|
9
|
+
const is_all = ref(false);
|
|
10
|
+
const checkColumnProp = computed(() => {
|
|
11
|
+
return table_props && table_props.column_config.show_column.map((m) => m.prop) || [];
|
|
12
|
+
});
|
|
13
|
+
const table_colums = computed(() => table_props?.table_colums.value || []);
|
|
14
|
+
function on_check_all_change(e) {
|
|
15
|
+
if (e) {
|
|
16
|
+
table_props && (table_props.column_config.show_column = table_colums.value);
|
|
17
|
+
} else {
|
|
18
|
+
table_props && (table_props.column_config.show_column = []);
|
|
19
|
+
}
|
|
8
20
|
}
|
|
9
|
-
function
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
21
|
+
function on_checked_change(colProps) {
|
|
22
|
+
if (table_props) {
|
|
23
|
+
table_props.column_config.show_column = table_colums.value.filter((f) => colProps.includes(f.prop));
|
|
24
|
+
const checkedCount = colProps.length;
|
|
25
|
+
check_all_columns.value = checkedCount === table_colums.value.length;
|
|
26
|
+
is_all.value = checkedCount > 0 && checkedCount < table_colums.value.length;
|
|
14
27
|
}
|
|
15
28
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
29
|
+
function on_change_fixed(type, prop) {
|
|
30
|
+
if (prop.fixed === type) {
|
|
31
|
+
prop.fixed = void 0;
|
|
32
|
+
} else {
|
|
33
|
+
prop.fixed = type;
|
|
34
|
+
}
|
|
18
35
|
}
|
|
19
|
-
return (
|
|
20
|
-
const
|
|
21
|
-
|
|
36
|
+
return (_ctx, _cache) => {
|
|
37
|
+
const _component_Setting = resolveComponent("Setting");
|
|
38
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
39
|
+
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
40
|
+
const _component_Upload = resolveComponent("Upload");
|
|
41
|
+
const _component_el_divider = resolveComponent("el-divider");
|
|
42
|
+
const _component_el_checkbox_group = resolveComponent("el-checkbox-group");
|
|
43
|
+
const _component_el_popover = resolveComponent("el-popover");
|
|
44
|
+
return openBlock(), createBlock(_component_el_popover, {
|
|
22
45
|
placement: "bottom",
|
|
23
46
|
title: "列显示设置",
|
|
24
47
|
width: 220
|
|
25
48
|
}, {
|
|
26
|
-
reference:
|
|
27
|
-
|
|
28
|
-
default:
|
|
29
|
-
|
|
49
|
+
reference: withCtx(() => [
|
|
50
|
+
createVNode(_component_el_icon, null, {
|
|
51
|
+
default: withCtx(() => [
|
|
52
|
+
createVNode(_component_Setting)
|
|
30
53
|
]),
|
|
31
54
|
_: 1
|
|
32
55
|
})
|
|
33
56
|
]),
|
|
34
|
-
default:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
indeterminate:
|
|
38
|
-
modelValue:
|
|
39
|
-
"onUpdate:modelValue":
|
|
40
|
-
onChange:
|
|
57
|
+
default: withCtx(() => [
|
|
58
|
+
createElementVNode("div", _hoisted_1, [
|
|
59
|
+
createVNode(_component_el_checkbox, {
|
|
60
|
+
indeterminate: is_all.value,
|
|
61
|
+
modelValue: check_all_columns.value,
|
|
62
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => check_all_columns.value = $event),
|
|
63
|
+
onChange: on_check_all_change
|
|
41
64
|
}, {
|
|
42
|
-
default:
|
|
43
|
-
|
|
65
|
+
default: withCtx(() => [..._cache[2] || (_cache[2] = [
|
|
66
|
+
createTextVNode("全选 ", -1)
|
|
44
67
|
])]),
|
|
45
68
|
_: 1
|
|
46
69
|
}, 8, ["indeterminate", "modelValue"]),
|
|
47
|
-
|
|
70
|
+
createVNode(_component_el_checkbox_group, {
|
|
48
71
|
class: "set-column-check-group",
|
|
49
|
-
modelValue:
|
|
50
|
-
"onUpdate:modelValue":
|
|
51
|
-
onChange:
|
|
72
|
+
modelValue: checkColumnProp.value,
|
|
73
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => checkColumnProp.value = $event),
|
|
74
|
+
onChange: on_checked_change
|
|
52
75
|
}, {
|
|
53
|
-
default:
|
|
54
|
-
(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
default: c(() => [
|
|
63
|
-
k(y(n.label), 1)
|
|
64
|
-
]),
|
|
65
|
-
_: 2
|
|
66
|
-
}, 1032, ["label"]),
|
|
67
|
-
g("div", D, [
|
|
68
|
-
l(d, {
|
|
69
|
-
class: b(["fixed-icon", n.fixed === "left" && "active"]),
|
|
70
|
-
title: "固定到左边",
|
|
71
|
-
onClick: (S) => f("left", n)
|
|
72
|
-
}, {
|
|
73
|
-
default: c(() => [
|
|
74
|
-
l(C)
|
|
75
|
-
]),
|
|
76
|
-
_: 1
|
|
77
|
-
}, 8, ["class", "onClick"]),
|
|
78
|
-
l(U, { direction: "vertical" }),
|
|
79
|
-
l(d, {
|
|
80
|
-
class: b(["fixed-icon", n.fixed === "right" && "active"]),
|
|
81
|
-
title: "固定到右边",
|
|
82
|
-
onClick: (S) => f("right", n)
|
|
76
|
+
default: withCtx(() => [
|
|
77
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(table_colums.value, (colum) => {
|
|
78
|
+
return openBlock(), createElementBlock("div", {
|
|
79
|
+
class: "group-item",
|
|
80
|
+
key: colum.prop
|
|
81
|
+
}, [
|
|
82
|
+
createVNode(_component_el_checkbox, {
|
|
83
|
+
class: "set-column-check",
|
|
84
|
+
label: colum.prop
|
|
83
85
|
}, {
|
|
84
|
-
default:
|
|
85
|
-
|
|
86
|
+
default: withCtx(() => [
|
|
87
|
+
createTextVNode(toDisplayString(colum.label), 1)
|
|
86
88
|
]),
|
|
87
|
-
_:
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
_: 2
|
|
90
|
+
}, 1032, ["label"]),
|
|
91
|
+
createElementVNode("div", _hoisted_2, [
|
|
92
|
+
createVNode(_component_el_icon, {
|
|
93
|
+
class: normalizeClass(["fixed-icon", colum.fixed === "left" && "active"]),
|
|
94
|
+
title: "固定到左边",
|
|
95
|
+
onClick: ($event) => on_change_fixed("left", colum)
|
|
96
|
+
}, {
|
|
97
|
+
default: withCtx(() => [
|
|
98
|
+
createVNode(_component_Upload)
|
|
99
|
+
]),
|
|
100
|
+
_: 1
|
|
101
|
+
}, 8, ["class", "onClick"]),
|
|
102
|
+
createVNode(_component_el_divider, { direction: "vertical" }),
|
|
103
|
+
createVNode(_component_el_icon, {
|
|
104
|
+
class: normalizeClass(["fixed-icon", colum.fixed === "right" && "active"]),
|
|
105
|
+
title: "固定到右边",
|
|
106
|
+
onClick: ($event) => on_change_fixed("right", colum)
|
|
107
|
+
}, {
|
|
108
|
+
default: withCtx(() => [
|
|
109
|
+
createVNode(_component_Upload)
|
|
110
|
+
]),
|
|
111
|
+
_: 1
|
|
112
|
+
}, 8, ["class", "onClick"])
|
|
113
|
+
])
|
|
114
|
+
]);
|
|
115
|
+
}), 128))
|
|
91
116
|
]),
|
|
92
117
|
_: 1
|
|
93
118
|
}, 8, ["modelValue"])
|
|
@@ -99,5 +124,5 @@ const z = { class: "set-column-list-wrap" }, D = { class: "fixed-wrap" }, P = /*
|
|
|
99
124
|
}
|
|
100
125
|
});
|
|
101
126
|
export {
|
|
102
|
-
|
|
127
|
+
_sfc_main as default
|
|
103
128
|
};
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import { TableColumn
|
|
1
|
+
import { TableColumn } from '..';
|
|
2
2
|
import { DefineComponent, ExtractPropTypes, PropType, Ref, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { TableAttr } from './../type';
|
|
4
|
+
/**
|
|
5
|
+
* 清空选择
|
|
6
|
+
*/
|
|
7
|
+
declare function clear_selection(): void;
|
|
8
|
+
/**
|
|
9
|
+
* 切换行选择状态
|
|
10
|
+
* @param {Object} row 行数据
|
|
11
|
+
*/
|
|
12
|
+
declare function toggle_row_selection(row: any): void;
|
|
5
13
|
declare function __VLS_template(): {
|
|
6
14
|
attrs: Partial<{}>;
|
|
7
15
|
slots: Partial<Record<`col_${string}`, (_: {
|
|
@@ -22,8 +30,8 @@ declare function __VLS_template(): {
|
|
|
22
30
|
'bottom-left'?(_: {}): any;
|
|
23
31
|
};
|
|
24
32
|
refs: {
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
table_extend_ref: HTMLDivElement;
|
|
34
|
+
table_ref: unknown;
|
|
27
35
|
};
|
|
28
36
|
rootEl: HTMLDivElement;
|
|
29
37
|
};
|
|
@@ -82,8 +90,8 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
|
|
|
82
90
|
default: () => boolean;
|
|
83
91
|
};
|
|
84
92
|
}>, {
|
|
85
|
-
clearSelection: typeof
|
|
86
|
-
toggleRowSelection: typeof
|
|
93
|
+
clearSelection: typeof clear_selection;
|
|
94
|
+
toggleRowSelection: typeof toggle_row_selection;
|
|
87
95
|
table: Ref<any, any>;
|
|
88
96
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
89
97
|
tableSort: (...args: any[]) => void;
|
|
@@ -153,9 +161,9 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
|
|
|
153
161
|
onRowClick?: ((...args: any[]) => any) | undefined;
|
|
154
162
|
onRowDblClick?: ((...args: any[]) => any) | undefined;
|
|
155
163
|
}>, {
|
|
156
|
-
tableColums: TableColumn[];
|
|
157
164
|
options: TableAttr;
|
|
158
165
|
tableData: unknown[];
|
|
166
|
+
tableColums: TableColumn[];
|
|
159
167
|
tableLoading: boolean;
|
|
160
168
|
expand: boolean;
|
|
161
169
|
selectionCol: boolean;
|
|
@@ -166,8 +174,8 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
|
|
|
166
174
|
autoPagination: boolean;
|
|
167
175
|
autoSize: boolean;
|
|
168
176
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
169
|
-
|
|
170
|
-
|
|
177
|
+
table_extend_ref: HTMLDivElement;
|
|
178
|
+
table_ref: unknown;
|
|
171
179
|
}, HTMLDivElement>;
|
|
172
180
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
173
181
|
export default _default;
|
|
@@ -1,22 +1,33 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { auto_size
|
|
3
|
-
import { useI18n
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent, provide, toRef, ref, watch, onMounted, nextTick, resolveComponent, resolveDirective, openBlock, createElementBlock, unref, createElementVNode, renderSlot, createBlock, createCommentVNode, withDirectives, mergeProps, withCtx, Fragment, renderList, createTextVNode, toDisplayString, createVNode } from "vue";
|
|
2
|
+
import { auto_size } from "@qy_better_lib/core";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
import props from "../props.js";
|
|
5
|
+
import use_table from "../useTable.js";
|
|
6
|
+
import _sfc_main$1 from "./colVisible.vue.js";
|
|
7
|
+
import _sfc_main$2 from "./valueCol.vue.js";
|
|
8
|
+
const _hoisted_1 = {
|
|
9
|
+
class: "table-extend",
|
|
10
|
+
ref: "table_extend_ref"
|
|
11
|
+
};
|
|
12
|
+
const _hoisted_2 = {
|
|
9
13
|
key: 0,
|
|
10
14
|
class: "tool-panel"
|
|
11
|
-
}
|
|
15
|
+
};
|
|
16
|
+
const _hoisted_3 = { class: "left-panel" };
|
|
17
|
+
const _hoisted_4 = { class: "right-panel" };
|
|
18
|
+
const _hoisted_5 = { class: "default-tool" };
|
|
19
|
+
const _hoisted_6 = {
|
|
12
20
|
key: 0,
|
|
13
21
|
class: "required-ident"
|
|
14
|
-
}
|
|
22
|
+
};
|
|
23
|
+
const _hoisted_7 = {
|
|
15
24
|
key: 1,
|
|
16
25
|
class: "table-bottom"
|
|
17
|
-
}
|
|
26
|
+
};
|
|
27
|
+
const _hoisted_8 = { class: "left" };
|
|
28
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
29
|
__name: "index",
|
|
19
|
-
props: { ...
|
|
30
|
+
props: { ...props() },
|
|
20
31
|
emits: [
|
|
21
32
|
"tableSort",
|
|
22
33
|
"handleSelectionChange",
|
|
@@ -25,184 +36,202 @@ const se = {
|
|
|
25
36
|
"rowClick",
|
|
26
37
|
"rowDblClick"
|
|
27
38
|
],
|
|
28
|
-
setup(
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
40
|
+
const props2 = __props;
|
|
41
|
+
const emit = __emit;
|
|
42
|
+
const { t: i18nInstance } = useI18n();
|
|
43
|
+
const {
|
|
44
|
+
selection_options,
|
|
45
|
+
// 选中行状态
|
|
46
|
+
table_attribute,
|
|
47
|
+
// 表格属性
|
|
48
|
+
pagination,
|
|
49
|
+
// 分页配置
|
|
50
|
+
has_pagination,
|
|
51
|
+
// 是否显示分页
|
|
52
|
+
column_config,
|
|
53
|
+
// 列显示/隐藏配置
|
|
54
|
+
col_setting_list,
|
|
55
|
+
// 表格显示列
|
|
56
|
+
show_tool_panel,
|
|
57
|
+
// 是否显示工具栏
|
|
58
|
+
show_bottom_panel
|
|
59
|
+
// 是否显示底部面板
|
|
60
|
+
} = use_table(i18nInstance);
|
|
61
|
+
provide("table-extend", {
|
|
62
|
+
table_props: props2,
|
|
63
|
+
table_colums: toRef(props2, "tableColums"),
|
|
64
|
+
column_config
|
|
43
65
|
});
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
(
|
|
51
|
-
|
|
52
|
-
|
|
66
|
+
const table_ref = ref(null);
|
|
67
|
+
const is_page_size_change = ref(false);
|
|
68
|
+
watch(() => props2.tableColums, (newColums) => {
|
|
69
|
+
column_config.show_column = newColums;
|
|
70
|
+
}, { deep: false });
|
|
71
|
+
watch(() => pagination.page_index, (page_index) => {
|
|
72
|
+
if (page_index && page_index > 0 && is_page_size_change.value) {
|
|
73
|
+
is_page_size_change.value = false;
|
|
74
|
+
return;
|
|
53
75
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
76
|
+
emit("currentChange", page_index);
|
|
77
|
+
table_ref.value?.setScrollTop(0);
|
|
78
|
+
});
|
|
79
|
+
watch(
|
|
80
|
+
() => pagination.page_size,
|
|
81
|
+
(page_size) => {
|
|
82
|
+
if (page_size && page_size > 0) {
|
|
83
|
+
is_page_size_change.value = true;
|
|
84
|
+
pagination.page_index = 1;
|
|
85
|
+
emit("pageSizeChange", page_size);
|
|
86
|
+
table_ref.value?.setScrollTop(0);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
onMounted(() => {
|
|
91
|
+
nextTick(() => {
|
|
92
|
+
props2.tableColums && props2.tableColums.length > 0 && (column_config.show_column = props2.tableColums);
|
|
58
93
|
});
|
|
59
|
-
}), T({
|
|
60
|
-
clearSelection: q,
|
|
61
|
-
toggleRowSelection: U,
|
|
62
|
-
table: u
|
|
63
94
|
});
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
95
|
+
__expose({
|
|
96
|
+
clearSelection: clear_selection,
|
|
97
|
+
// 清空选择
|
|
98
|
+
toggleRowSelection: toggle_row_selection,
|
|
99
|
+
// 切换行选择状态
|
|
100
|
+
table: table_ref
|
|
101
|
+
// 表格引用
|
|
102
|
+
});
|
|
103
|
+
function table_sort(column) {
|
|
104
|
+
emit("tableSort", {
|
|
105
|
+
sort_name: column.prop,
|
|
106
|
+
sort_type: column.order === "descending" ? "desc" : column.order === "ascending" ? "asc" : ""
|
|
68
107
|
});
|
|
69
108
|
}
|
|
70
|
-
function
|
|
71
|
-
|
|
109
|
+
function handle_selection_change(rows) {
|
|
110
|
+
selection_options.rows = rows;
|
|
111
|
+
selection_options.count = rows && rows.length;
|
|
112
|
+
emit("handleSelectionChange", rows);
|
|
72
113
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
114
|
+
function row_click(rows) {
|
|
115
|
+
emit("rowClick", rows);
|
|
75
116
|
}
|
|
76
|
-
function
|
|
77
|
-
|
|
117
|
+
function row_dbl_click(rows) {
|
|
118
|
+
emit("rowDblClick", rows);
|
|
78
119
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
120
|
+
function clear_selection() {
|
|
121
|
+
table_ref.value?.clearSelection();
|
|
81
122
|
}
|
|
82
|
-
function
|
|
83
|
-
|
|
123
|
+
function toggle_row_selection(row) {
|
|
124
|
+
table_ref.value?.toggleRowSelection(row);
|
|
84
125
|
}
|
|
85
|
-
return (
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
126
|
+
return (_ctx, _cache) => {
|
|
127
|
+
const _component_el_table_column = resolveComponent("el-table-column");
|
|
128
|
+
const _component_el_empty = resolveComponent("el-empty");
|
|
129
|
+
const _component_el_table = resolveComponent("el-table");
|
|
130
|
+
const _component_el_pagination = resolveComponent("el-pagination");
|
|
131
|
+
const _directive_loading = resolveDirective("loading");
|
|
132
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
133
|
+
unref(show_tool_panel) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
134
|
+
createElementVNode("div", _hoisted_3, [
|
|
135
|
+
renderSlot(_ctx.$slots, "tool-left")
|
|
95
136
|
]),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
137
|
+
createElementVNode("div", _hoisted_4, [
|
|
138
|
+
renderSlot(_ctx.$slots, "tool-right"),
|
|
139
|
+
createElementVNode("div", _hoisted_5, [
|
|
140
|
+
_ctx.isSetColumn ? (openBlock(), createBlock(_sfc_main$1, { key: 0 })) : createCommentVNode("", true)
|
|
100
141
|
])
|
|
101
142
|
])
|
|
102
|
-
])) :
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
ref_key: "
|
|
106
|
-
ref:
|
|
107
|
-
},
|
|
108
|
-
data:
|
|
109
|
-
onSortChange:
|
|
110
|
-
onSelectionChange:
|
|
111
|
-
onRowClick:
|
|
112
|
-
onRowDblclick:
|
|
143
|
+
])) : createCommentVNode("", true),
|
|
144
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
145
|
+
withDirectives((openBlock(), createBlock(_component_el_table, mergeProps({
|
|
146
|
+
ref_key: "table_ref",
|
|
147
|
+
ref: table_ref
|
|
148
|
+
}, unref(table_attribute), {
|
|
149
|
+
data: _ctx.tableData,
|
|
150
|
+
onSortChange: table_sort,
|
|
151
|
+
onSelectionChange: handle_selection_change,
|
|
152
|
+
onRowClick: row_click,
|
|
153
|
+
onRowDblclick: row_dbl_click
|
|
113
154
|
}), {
|
|
114
|
-
empty:
|
|
115
|
-
|
|
116
|
-
|
|
155
|
+
empty: withCtx(() => [
|
|
156
|
+
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
157
|
+
createVNode(_component_el_empty, { "image-size": 60 })
|
|
117
158
|
])
|
|
118
159
|
]),
|
|
119
|
-
default:
|
|
120
|
-
|
|
160
|
+
default: withCtx(() => [
|
|
161
|
+
_ctx.selectionCol ? (openBlock(), createBlock(_component_el_table_column, {
|
|
121
162
|
key: 0,
|
|
122
163
|
type: "selection",
|
|
123
|
-
width:
|
|
164
|
+
width: !_ctx.autoSize ? 50 : unref(auto_size)(50),
|
|
124
165
|
fixed: "left"
|
|
125
|
-
}, null, 8, ["width"])) :
|
|
126
|
-
|
|
166
|
+
}, null, 8, ["width"])) : createCommentVNode("", true),
|
|
167
|
+
_ctx.indexCol ? (openBlock(), createBlock(_component_el_table_column, {
|
|
127
168
|
key: 1,
|
|
128
169
|
type: "index",
|
|
129
170
|
label: "序号",
|
|
130
|
-
width:
|
|
171
|
+
width: !_ctx.autoSize ? 60 : unref(auto_size)(60),
|
|
131
172
|
fixed: "left"
|
|
132
|
-
}, null, 8, ["width"])) :
|
|
133
|
-
|
|
173
|
+
}, null, 8, ["width"])) : createCommentVNode("", true),
|
|
174
|
+
_ctx.expand ? (openBlock(), createBlock(_component_el_table_column, {
|
|
134
175
|
key: 2,
|
|
135
176
|
type: "expand"
|
|
136
177
|
}, {
|
|
137
|
-
default:
|
|
138
|
-
|
|
139
|
-
index:
|
|
140
|
-
data:
|
|
178
|
+
default: withCtx(({ row, $index }) => [
|
|
179
|
+
renderSlot(_ctx.$slots, "expand", {
|
|
180
|
+
index: $index,
|
|
181
|
+
data: row
|
|
141
182
|
})
|
|
142
183
|
]),
|
|
143
184
|
_: 3
|
|
144
|
-
})) :
|
|
145
|
-
(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
innerHTML: t.prop && d.row[t.prop]
|
|
155
|
-
}, null, 8, ue)
|
|
156
|
-
]),
|
|
157
|
-
_: 2
|
|
158
|
-
}, 1040)) : (o(), r(g, C({
|
|
159
|
-
key: 1,
|
|
160
|
-
ref_for: !0
|
|
161
|
-
}, t), {
|
|
162
|
-
default: f((d) => [
|
|
163
|
-
n(e.$slots, `col_${t.prop}`, {
|
|
164
|
-
index: d.$index,
|
|
165
|
-
data: d.row
|
|
185
|
+
})) : createCommentVNode("", true),
|
|
186
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(col_setting_list), (item) => {
|
|
187
|
+
return openBlock(), createBlock(_component_el_table_column, mergeProps({
|
|
188
|
+
key: item.prop,
|
|
189
|
+
ref_for: true
|
|
190
|
+
}, item), {
|
|
191
|
+
default: withCtx((scope) => [
|
|
192
|
+
renderSlot(_ctx.$slots, `col_${item.prop}`, {
|
|
193
|
+
index: scope.$index,
|
|
194
|
+
data: scope.row
|
|
166
195
|
}, () => [
|
|
167
|
-
|
|
196
|
+
createVNode(_sfc_main$2, mergeProps({ ref_for: true }, { row: scope.row, colCfg: item }), null, 16)
|
|
168
197
|
])
|
|
169
198
|
]),
|
|
170
|
-
header:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
199
|
+
header: withCtx(() => [
|
|
200
|
+
renderSlot(_ctx.$slots, `header_${item.prop}`, { data: item }, () => [
|
|
201
|
+
item.required ? (openBlock(), createElementBlock("span", _hoisted_6, "*")) : createCommentVNode("", true),
|
|
202
|
+
createTextVNode(" " + toDisplayString(item.label), 1)
|
|
174
203
|
])
|
|
175
204
|
]),
|
|
176
205
|
_: 2
|
|
177
|
-
}, 1040)
|
|
178
|
-
|
|
179
|
-
|
|
206
|
+
}, 1040);
|
|
207
|
+
}), 128)),
|
|
208
|
+
renderSlot(_ctx.$slots, "operatColumn")
|
|
180
209
|
]),
|
|
181
210
|
_: 3
|
|
182
211
|
}, 16, ["data"])), [
|
|
183
|
-
[
|
|
212
|
+
[_directive_loading, _ctx.tableLoading]
|
|
184
213
|
])
|
|
185
214
|
]),
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
215
|
+
unref(show_bottom_panel) || unref(has_pagination) ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
216
|
+
createElementVNode("div", _hoisted_8, [
|
|
217
|
+
renderSlot(_ctx.$slots, "bottom-left")
|
|
189
218
|
]),
|
|
190
|
-
|
|
219
|
+
unref(has_pagination) ? (openBlock(), createBlock(_component_el_pagination, {
|
|
191
220
|
key: 0,
|
|
192
|
-
"current-page":
|
|
193
|
-
"onUpdate:currentPage":
|
|
194
|
-
"page-size":
|
|
195
|
-
"onUpdate:pageSize":
|
|
196
|
-
"page-sizes":
|
|
221
|
+
"current-page": unref(pagination).page_index,
|
|
222
|
+
"onUpdate:currentPage": _cache[0] || (_cache[0] = ($event) => unref(pagination).page_index = $event),
|
|
223
|
+
"page-size": unref(pagination).page_size,
|
|
224
|
+
"onUpdate:pageSize": _cache[1] || (_cache[1] = ($event) => unref(pagination).page_size = $event),
|
|
225
|
+
"page-sizes": _ctx.sizeList,
|
|
197
226
|
layout: "total,prev,pager,next,sizes,jumper",
|
|
198
|
-
total:
|
|
227
|
+
total: _ctx.total,
|
|
199
228
|
background: ""
|
|
200
|
-
}, null, 8, ["current-page", "page-size", "page-sizes", "total"])) :
|
|
201
|
-
])) :
|
|
229
|
+
}, null, 8, ["current-page", "page-size", "page-sizes", "total"])) : createCommentVNode("", true)
|
|
230
|
+
])) : createCommentVNode("", true)
|
|
202
231
|
], 512);
|
|
203
232
|
};
|
|
204
233
|
}
|
|
205
234
|
});
|
|
206
235
|
export {
|
|
207
|
-
|
|
236
|
+
_sfc_main as default
|
|
208
237
|
};
|