@qy_better_lib/pc 0.2.33 → 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 +169 -144
- 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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { ViewConfig } from './type';
|
|
3
|
+
/**
|
|
4
|
+
* 描述性视图组件属性定义
|
|
5
|
+
*/
|
|
6
|
+
export declare const props: () => {
|
|
7
|
+
/**
|
|
8
|
+
* 配置项列表
|
|
9
|
+
*/
|
|
10
|
+
config: {
|
|
11
|
+
type: PropType<Array<ViewConfig>>;
|
|
12
|
+
default: () => never[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* 数据对象
|
|
16
|
+
*/
|
|
17
|
+
data: {
|
|
18
|
+
type: PropType<Record<string, any>>;
|
|
19
|
+
default: () => {};
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* 展示列数
|
|
23
|
+
*/
|
|
24
|
+
column: {
|
|
25
|
+
type: NumberConstructor;
|
|
26
|
+
default: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* label宽度:数字或字符串;如果定义多列宽度,使用字符串格式'20,30,50'
|
|
30
|
+
*/
|
|
31
|
+
labelWidth: {
|
|
32
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
33
|
+
default: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const props = () => ({
|
|
2
|
+
/**
|
|
3
|
+
* 配置项列表
|
|
4
|
+
*/
|
|
5
|
+
config: {
|
|
6
|
+
type: Array,
|
|
7
|
+
default: () => []
|
|
8
|
+
},
|
|
9
|
+
/**
|
|
10
|
+
* 数据对象
|
|
11
|
+
*/
|
|
12
|
+
data: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: () => ({})
|
|
15
|
+
},
|
|
16
|
+
/**
|
|
17
|
+
* 展示列数
|
|
18
|
+
*/
|
|
19
|
+
column: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 3
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* label宽度:数字或字符串;如果定义多列宽度,使用字符串格式'20,30,50'
|
|
25
|
+
*/
|
|
26
|
+
labelWidth: {
|
|
27
|
+
type: [Number, String],
|
|
28
|
+
default: 85
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
props
|
|
33
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { default as textButton } from './textButton';
|
|
2
2
|
import { default as tableExtend } from './tableExtend';
|
|
3
|
-
import { default as
|
|
3
|
+
import { default as ContextMenu } from './contextMenu';
|
|
4
4
|
import { default as describeView } from './describeView';
|
|
5
5
|
import { default as simpleVirtualList } from './simpleVirtualList';
|
|
6
|
+
import { default as commDialog } from './commDialog';
|
|
7
|
+
import { default as commForm } from './commForm';
|
|
6
8
|
import { App } from 'vue';
|
|
7
|
-
import {
|
|
9
|
+
import { message_alert, message_box, confirm_box, confirm_box_async, notification, close_all_messages, close_all_notifications, close_all_message_boxes } from './utils';
|
|
8
10
|
/**
|
|
9
11
|
* 安装所有组件
|
|
10
12
|
* 也可以手动安装所需组件
|
|
11
13
|
*/
|
|
12
14
|
declare function install(app: App): void;
|
|
13
15
|
export type { TableProp, TableColumn } from './tableExtend';
|
|
14
|
-
export {
|
|
16
|
+
export type { ContextMenuItem, MenuPosition } from './contextMenu';
|
|
17
|
+
export { install, textButton, tableExtend, ContextMenu, describeView, simpleVirtualList, commDialog, commForm, message_alert, message_box, confirm_box, confirm_box_async, notification, close_all_messages, close_all_notifications, close_all_message_boxes };
|
|
18
|
+
export { ContextMenu as contextMenu };
|
package/lib/index.js
CHANGED
|
@@ -3,28 +3,38 @@ import "./tableExtend/index.js";
|
|
|
3
3
|
import "./contextMenu/index.js";
|
|
4
4
|
import "./describeView/index.js";
|
|
5
5
|
import "./simpleVirtualList/index.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
import "./commDialog/index.js";
|
|
7
|
+
import "./commForm/index.js";
|
|
8
|
+
import { close_all_message_boxes, close_all_messages, close_all_notifications, confirm_box, confirm_box_async, message_alert, message_box, notification } from "./utils/index.js";
|
|
9
|
+
import _sfc_main from "./textButton/src/index.vue.js";
|
|
10
|
+
import _sfc_main$1 from "./tableExtend/src/index.vue.js";
|
|
11
|
+
import _sfc_main$2 from "./contextMenu/src/index.vue.js";
|
|
12
|
+
import _sfc_main$3 from "./describeView/src/index.vue.js";
|
|
13
|
+
import _sfc_main$4 from "./simpleVirtualList/src/index.vue.js";
|
|
14
|
+
import _sfc_main$5 from "./commDialog/src/index.vue.js";
|
|
15
|
+
import _sfc_main$6 from "./commForm/src/index.vue.js";
|
|
16
|
+
const components = [_sfc_main, _sfc_main$1, _sfc_main$2, _sfc_main$3, _sfc_main$4, _sfc_main$5, _sfc_main$6];
|
|
17
|
+
function install(app) {
|
|
18
|
+
components.forEach((component) => {
|
|
19
|
+
app.use(component);
|
|
16
20
|
});
|
|
17
21
|
}
|
|
18
22
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
_sfc_main$2 as ContextMenu,
|
|
24
|
+
close_all_message_boxes,
|
|
25
|
+
close_all_messages,
|
|
26
|
+
close_all_notifications,
|
|
27
|
+
_sfc_main$5 as commDialog,
|
|
28
|
+
_sfc_main$6 as commForm,
|
|
29
|
+
confirm_box,
|
|
30
|
+
confirm_box_async,
|
|
31
|
+
_sfc_main$2 as contextMenu,
|
|
32
|
+
_sfc_main$3 as describeView,
|
|
33
|
+
install,
|
|
34
|
+
message_alert,
|
|
35
|
+
message_box,
|
|
36
|
+
notification,
|
|
37
|
+
_sfc_main$4 as simpleVirtualList,
|
|
38
|
+
_sfc_main$1 as tableExtend,
|
|
39
|
+
_sfc_main as textButton
|
|
30
40
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import _sfc_main from "./src/index.vue.js";
|
|
2
|
+
_sfc_main.install = (app) => {
|
|
3
|
+
app.component("SimpleVirtualList", _sfc_main);
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
_sfc_main as default
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { throttle
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent, ref, computed, watch, onMounted, openBlock, createElementBlock, unref, normalizeStyle, createElementVNode, Fragment, renderList, renderSlot, createTextVNode, toDisplayString } from "vue";
|
|
2
|
+
import { throttle } from "@qy_better_lib/core";
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
4
|
__name: "index",
|
|
5
5
|
props: {
|
|
6
6
|
data: {},
|
|
@@ -9,8 +9,10 @@ const F = /* @__PURE__ */ $({
|
|
|
9
9
|
buffer: { default: 5 },
|
|
10
10
|
data_key: { default: "id" }
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const container_ref = ref();
|
|
15
|
+
const scroll_cfg = ref({
|
|
14
16
|
/**起始索引 */
|
|
15
17
|
start_index: 0,
|
|
16
18
|
/**结束索引 */
|
|
@@ -19,66 +21,81 @@ const F = /* @__PURE__ */ $({
|
|
|
19
21
|
visible_count: 0,
|
|
20
22
|
/**滚动位置 */
|
|
21
23
|
scroll_top: 0
|
|
22
|
-
}), s = c(0), x = u(() => t.data.length * t.item_height), y = u(() => l.value.start_index * t.item_height), b = u(() => {
|
|
23
|
-
const { start_index: e, end_index: i } = l.value;
|
|
24
|
-
return t.data.slice(e, i + 1);
|
|
25
24
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
const list_visible_height = ref(0);
|
|
26
|
+
const list_height = computed(() => props.data.length * props.item_height);
|
|
27
|
+
const content_offset_y = computed(() => scroll_cfg.value.start_index * props.item_height);
|
|
28
|
+
const visible_data = computed(() => {
|
|
29
|
+
const { start_index, end_index } = scroll_cfg.value;
|
|
30
|
+
return props.data.slice(start_index, end_index + 1);
|
|
31
31
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
watch(() => props.data?.length || 0, () => {
|
|
33
|
+
init();
|
|
34
|
+
});
|
|
35
|
+
onMounted(() => {
|
|
36
|
+
const container = container_ref.value;
|
|
37
|
+
list_visible_height.value = props.container_height || container.clientHeight;
|
|
38
|
+
init();
|
|
39
|
+
});
|
|
40
|
+
const throttled_scroll = throttle((e) => on_scroll(e), 80);
|
|
41
|
+
function init() {
|
|
42
|
+
if (!container_ref.value) return;
|
|
43
|
+
const visible_count = Math.ceil(list_visible_height.value / props.item_height);
|
|
44
|
+
const end_index = Math.min(visible_count + props.buffer * 2, props.data.length - 1);
|
|
45
|
+
scroll_cfg.value = {
|
|
37
46
|
start_index: 0,
|
|
38
|
-
end_index
|
|
39
|
-
visible_count
|
|
47
|
+
end_index,
|
|
48
|
+
visible_count,
|
|
40
49
|
scroll_top: 0
|
|
41
50
|
};
|
|
42
51
|
}
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
function on_scroll(e) {
|
|
53
|
+
const target = e.target;
|
|
54
|
+
const scroll_top = target.scrollTop;
|
|
55
|
+
const { visible_count } = scroll_cfg.value;
|
|
56
|
+
const start_index = Math.floor(scroll_top / props.item_height);
|
|
57
|
+
const end_index = Math.min(start_index + visible_count + props.buffer * 2, props.data.length - 1);
|
|
58
|
+
scroll_cfg.value = {
|
|
59
|
+
start_index: Math.max(0, start_index - props.buffer),
|
|
47
60
|
// 起始索引减去缓冲区,确保上方有预备项
|
|
48
|
-
end_index
|
|
49
|
-
visible_count
|
|
50
|
-
scroll_top
|
|
61
|
+
end_index,
|
|
62
|
+
visible_count,
|
|
63
|
+
scroll_top
|
|
51
64
|
};
|
|
52
65
|
}
|
|
53
|
-
return (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
p("div", {
|
|
62
|
-
class: "simple-virtual-list-wrap",
|
|
63
|
-
style: a({ height: `${x.value}px` })
|
|
64
|
-
}, null, 4),
|
|
65
|
-
p("div", {
|
|
66
|
-
class: "simple-virtual-list-content",
|
|
67
|
-
style: a({ transform: `translateY(${y.value}px)` })
|
|
66
|
+
return (_ctx, _cache) => {
|
|
67
|
+
return openBlock(), createElementBlock("div", {
|
|
68
|
+
ref_key: "container_ref",
|
|
69
|
+
ref: container_ref,
|
|
70
|
+
class: "simple-virtual-list",
|
|
71
|
+
style: normalizeStyle({ height: `${list_visible_height.value}px` }),
|
|
72
|
+
onScroll: _cache[0] || (_cache[0] = //@ts-ignore
|
|
73
|
+
(...args) => unref(throttled_scroll) && unref(throttled_scroll)(...args))
|
|
68
74
|
}, [
|
|
69
|
-
(
|
|
70
|
-
class: "simple-virtual-list-
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
createElementVNode("div", {
|
|
76
|
+
class: "simple-virtual-list-wrap",
|
|
77
|
+
style: normalizeStyle({ height: `${list_height.value}px` })
|
|
78
|
+
}, null, 4),
|
|
79
|
+
createElementVNode("div", {
|
|
80
|
+
class: "simple-virtual-list-content",
|
|
81
|
+
style: normalizeStyle({ transform: `translateY(${content_offset_y.value}px)` })
|
|
73
82
|
}, [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(visible_data.value, (item) => {
|
|
84
|
+
return openBlock(), createElementBlock("div", {
|
|
85
|
+
key: item[__props.data_key],
|
|
86
|
+
class: "simple-virtual-list-item",
|
|
87
|
+
style: normalizeStyle({ height: `${__props.item_height}px` })
|
|
88
|
+
}, [
|
|
89
|
+
renderSlot(_ctx.$slots, "item", { item }, () => [
|
|
90
|
+
createTextVNode(toDisplayString(item), 1)
|
|
91
|
+
])
|
|
92
|
+
], 4);
|
|
93
|
+
}), 128))
|
|
94
|
+
], 4)
|
|
95
|
+
], 36);
|
|
96
|
+
};
|
|
80
97
|
}
|
|
81
98
|
});
|
|
82
99
|
export {
|
|
83
|
-
|
|
100
|
+
_sfc_main as default
|
|
84
101
|
};
|
package/lib/styles/index.scss
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
@use "./
|
|
2
|
-
@use "./
|
|
3
|
-
@use "./
|
|
4
|
-
@use "./
|
|
5
|
-
@use "./
|
|
1
|
+
@use "./text-button.scss" as *;
|
|
2
|
+
@use "./table-extend.scss" as *;
|
|
3
|
+
@use "./context-menu.scss" as *;
|
|
4
|
+
@use "./describe-view.scss" as *;
|
|
5
|
+
@use "./simple-virtual-list.scss" as *;
|
|
6
|
+
@use "./comm-form.scss" as *;
|
package/lib/tableExtend/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import _sfc_main from "./src/index.vue.js";
|
|
2
|
+
_sfc_main.install = (app) => {
|
|
3
|
+
app.component("TableExtend", _sfc_main);
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
_sfc_main as default
|
|
7
7
|
};
|
|
@@ -1,69 +1,128 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
import { TableAttr, TableColumn } from './type';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* 表格扩展组件属性定义
|
|
5
|
+
* @returns {Object} 组件属性配置
|
|
6
|
+
*/
|
|
4
7
|
export default function props(): {
|
|
5
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* 表格UI选项配置
|
|
10
|
+
* @type {TableAttr}
|
|
11
|
+
* @default {}
|
|
12
|
+
*/
|
|
6
13
|
options: {
|
|
7
14
|
type: PropType<TableAttr>;
|
|
8
15
|
default: () => {};
|
|
9
16
|
};
|
|
10
|
-
|
|
17
|
+
/**
|
|
18
|
+
* 表格数据源
|
|
19
|
+
* @type {Array}
|
|
20
|
+
* @default []
|
|
21
|
+
*/
|
|
11
22
|
tableData: {
|
|
12
23
|
type: ArrayConstructor;
|
|
13
24
|
default: never[];
|
|
14
25
|
};
|
|
15
|
-
|
|
26
|
+
/**
|
|
27
|
+
* 表格列配置
|
|
28
|
+
* @type {Array<TableColumn>}
|
|
29
|
+
* @default []
|
|
30
|
+
*/
|
|
16
31
|
tableColums: {
|
|
17
32
|
type: PropType<Array<TableColumn>>;
|
|
18
33
|
default: () => never[];
|
|
19
34
|
};
|
|
20
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* 加载状态
|
|
37
|
+
* @type {Boolean}
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
21
40
|
tableLoading: BooleanConstructor;
|
|
22
|
-
|
|
41
|
+
/**
|
|
42
|
+
* 是否显示展开行
|
|
43
|
+
* @type {Boolean}
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
23
46
|
expand: {
|
|
24
47
|
type: BooleanConstructor;
|
|
25
48
|
default: () => boolean;
|
|
26
49
|
};
|
|
27
|
-
|
|
50
|
+
/**
|
|
51
|
+
* 是否显示选择列
|
|
52
|
+
* @type {Boolean}
|
|
53
|
+
* @default true
|
|
54
|
+
*/
|
|
28
55
|
selectionCol: {
|
|
29
56
|
type: BooleanConstructor;
|
|
30
57
|
default: () => boolean;
|
|
31
58
|
};
|
|
32
|
-
|
|
59
|
+
/**
|
|
60
|
+
* 是否显示索引列
|
|
61
|
+
* @type {Boolean}
|
|
62
|
+
* @default true
|
|
63
|
+
*/
|
|
33
64
|
indexCol: {
|
|
34
65
|
type: BooleanConstructor;
|
|
35
66
|
default: () => boolean;
|
|
36
67
|
};
|
|
37
|
-
|
|
68
|
+
/**
|
|
69
|
+
* 是否启用列显示/隐藏设置
|
|
70
|
+
* @type {Boolean}
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
38
73
|
isSetColumn: {
|
|
39
74
|
type: BooleanConstructor;
|
|
40
75
|
default: () => boolean;
|
|
41
76
|
};
|
|
42
|
-
|
|
77
|
+
/**
|
|
78
|
+
* 分页配置
|
|
79
|
+
* @type {{ pageIndex: number; pageSize: number }}
|
|
80
|
+
*/
|
|
43
81
|
paging: {
|
|
44
82
|
type: PropType<{
|
|
45
83
|
pageIndex: number;
|
|
46
84
|
pageSize: number;
|
|
47
85
|
}>;
|
|
48
86
|
};
|
|
49
|
-
|
|
87
|
+
/**
|
|
88
|
+
* 数据总数
|
|
89
|
+
* @type {Number}
|
|
90
|
+
*/
|
|
50
91
|
total: NumberConstructor;
|
|
51
|
-
|
|
92
|
+
/**
|
|
93
|
+
* 可选页面大小列表
|
|
94
|
+
* @type {Array<number>}
|
|
95
|
+
* @default [15, 20, 30, 50, 100]
|
|
96
|
+
*/
|
|
52
97
|
sizeList: {
|
|
53
98
|
type: PropType<Array<number>>;
|
|
54
99
|
default: () => number[];
|
|
55
100
|
};
|
|
56
|
-
|
|
101
|
+
/**
|
|
102
|
+
* 是否自动高度
|
|
103
|
+
* 最大高度为父容器高度,实际高度由数据决定
|
|
104
|
+
* @type {Boolean}
|
|
105
|
+
* @default false
|
|
106
|
+
*/
|
|
57
107
|
autoHeight: {
|
|
58
108
|
type: BooleanConstructor;
|
|
59
109
|
default: () => boolean;
|
|
60
110
|
};
|
|
61
|
-
|
|
111
|
+
/**
|
|
112
|
+
* 是否自动显示分页器
|
|
113
|
+
* 当数据量满足分页时显示,否则不显示
|
|
114
|
+
* @type {Boolean}
|
|
115
|
+
* @default false
|
|
116
|
+
*/
|
|
62
117
|
autoPagination: {
|
|
63
118
|
type: BooleanConstructor;
|
|
64
119
|
default: () => boolean;
|
|
65
120
|
};
|
|
66
|
-
|
|
121
|
+
/**
|
|
122
|
+
* 是否启用大小自适应
|
|
123
|
+
* @type {Boolean}
|
|
124
|
+
* @default false
|
|
125
|
+
*/
|
|
67
126
|
autoSize: {
|
|
68
127
|
type: BooleanConstructor;
|
|
69
128
|
default: () => boolean;
|
package/lib/tableExtend/props.js
CHANGED
|
@@ -1,70 +1,128 @@
|
|
|
1
|
-
function
|
|
1
|
+
function props() {
|
|
2
2
|
return {
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* 表格UI选项配置
|
|
5
|
+
* @type {TableAttr}
|
|
6
|
+
* @default {}
|
|
7
|
+
*/
|
|
4
8
|
options: {
|
|
5
9
|
type: Object,
|
|
6
|
-
default: () =>
|
|
10
|
+
default: () => {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
7
13
|
},
|
|
8
|
-
|
|
14
|
+
/**
|
|
15
|
+
* 表格数据源
|
|
16
|
+
* @type {Array}
|
|
17
|
+
* @default []
|
|
18
|
+
*/
|
|
9
19
|
tableData: {
|
|
10
20
|
type: Array,
|
|
11
21
|
default: []
|
|
12
22
|
},
|
|
13
|
-
|
|
23
|
+
/**
|
|
24
|
+
* 表格列配置
|
|
25
|
+
* @type {Array<TableColumn>}
|
|
26
|
+
* @default []
|
|
27
|
+
*/
|
|
14
28
|
tableColums: {
|
|
15
29
|
type: Array,
|
|
16
30
|
default: () => []
|
|
17
31
|
},
|
|
18
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* 加载状态
|
|
34
|
+
* @type {Boolean}
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
19
37
|
tableLoading: Boolean,
|
|
20
|
-
|
|
38
|
+
/**
|
|
39
|
+
* 是否显示展开行
|
|
40
|
+
* @type {Boolean}
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
21
43
|
expand: {
|
|
22
44
|
type: Boolean,
|
|
23
|
-
default: () =>
|
|
45
|
+
default: () => false
|
|
24
46
|
},
|
|
25
|
-
|
|
47
|
+
/**
|
|
48
|
+
* 是否显示选择列
|
|
49
|
+
* @type {Boolean}
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
26
52
|
selectionCol: {
|
|
27
53
|
type: Boolean,
|
|
28
|
-
default: () =>
|
|
54
|
+
default: () => true
|
|
29
55
|
},
|
|
30
|
-
|
|
56
|
+
/**
|
|
57
|
+
* 是否显示索引列
|
|
58
|
+
* @type {Boolean}
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
31
61
|
indexCol: {
|
|
32
62
|
type: Boolean,
|
|
33
|
-
default: () =>
|
|
63
|
+
default: () => true
|
|
34
64
|
},
|
|
35
|
-
|
|
65
|
+
/**
|
|
66
|
+
* 是否启用列显示/隐藏设置
|
|
67
|
+
* @type {Boolean}
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
36
70
|
isSetColumn: {
|
|
37
71
|
type: Boolean,
|
|
38
|
-
default: () =>
|
|
72
|
+
default: () => false
|
|
39
73
|
},
|
|
40
|
-
|
|
74
|
+
/**
|
|
75
|
+
* 分页配置
|
|
76
|
+
* @type {{ pageIndex: number; pageSize: number }}
|
|
77
|
+
*/
|
|
41
78
|
paging: {
|
|
42
79
|
type: Object
|
|
43
80
|
},
|
|
44
|
-
|
|
81
|
+
/**
|
|
82
|
+
* 数据总数
|
|
83
|
+
* @type {Number}
|
|
84
|
+
*/
|
|
45
85
|
total: Number,
|
|
46
|
-
|
|
86
|
+
/**
|
|
87
|
+
* 可选页面大小列表
|
|
88
|
+
* @type {Array<number>}
|
|
89
|
+
* @default [15, 20, 30, 50, 100]
|
|
90
|
+
*/
|
|
47
91
|
sizeList: {
|
|
48
92
|
type: Array,
|
|
49
93
|
default: () => [15, 20, 30, 50, 100]
|
|
50
94
|
},
|
|
51
|
-
|
|
95
|
+
/**
|
|
96
|
+
* 是否自动高度
|
|
97
|
+
* 最大高度为父容器高度,实际高度由数据决定
|
|
98
|
+
* @type {Boolean}
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
52
101
|
autoHeight: {
|
|
53
102
|
type: Boolean,
|
|
54
|
-
default: () =>
|
|
103
|
+
default: () => false
|
|
55
104
|
},
|
|
56
|
-
|
|
105
|
+
/**
|
|
106
|
+
* 是否自动显示分页器
|
|
107
|
+
* 当数据量满足分页时显示,否则不显示
|
|
108
|
+
* @type {Boolean}
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
57
111
|
autoPagination: {
|
|
58
112
|
type: Boolean,
|
|
59
|
-
default: () =>
|
|
113
|
+
default: () => false
|
|
60
114
|
},
|
|
61
|
-
|
|
115
|
+
/**
|
|
116
|
+
* 是否启用大小自适应
|
|
117
|
+
* @type {Boolean}
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
62
120
|
autoSize: {
|
|
63
121
|
type: Boolean,
|
|
64
|
-
default: () =>
|
|
122
|
+
default: () => false
|
|
65
123
|
}
|
|
66
124
|
};
|
|
67
125
|
}
|
|
68
126
|
export {
|
|
69
|
-
|
|
127
|
+
props as default
|
|
70
128
|
};
|