qy-better-lib 0.0.1
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/.vscode/extensions.json +3 -0
- package/LICENSE +24 -0
- package/README.md +2 -0
- package/index.html +13 -0
- package/package.json +37 -0
- package/packages/core/DOCUMENTATION.md +2681 -0
- package/packages/core/LICENSE +24 -0
- package/packages/core/package.json +67 -0
- package/packages/core/types/index.d.ts +39 -0
- package/packages/core/types/json.d.ts +4 -0
- package/packages/core/types/vue.shim.d.ts +5 -0
- package/packages/core/vitest.config.ts +15 -0
- package/packages/core/yarn.lock +1233 -0
- package/packages/hooks/DOCUMENTATION.md +634 -0
- package/packages/hooks/LICENSE +24 -0
- package/packages/hooks/__tests__/use-chart/index.test.ts +287 -0
- package/packages/hooks/__tests__/use-emit/index.test.ts +248 -0
- package/packages/hooks/__tests__/use-fullscreen/index.test.ts +162 -0
- package/packages/hooks/__tests__/use-image/index.test.ts +230 -0
- package/packages/hooks/__tests__/use-layout-flow/index.test.ts +382 -0
- package/packages/hooks/__tests__/use-mqtt/index.test.ts +392 -0
- package/packages/hooks/__tests__/use-print/index.test.ts +378 -0
- package/packages/hooks/__tests__/use-watermark/index.test.ts +277 -0
- package/packages/hooks/__tests__/use-websocket/index.test.ts +402 -0
- package/packages/hooks/package.json +104 -0
- package/packages/hooks/types/index.d.ts +1 -0
- package/packages/hooks/types/json.d.ts +4 -0
- package/packages/hooks/types/vue.shim.d.ts +5 -0
- package/packages/hooks/yarn.lock +1832 -0
- package/packages/lowcode/core/package.json +60 -0
- package/packages/lowcode/core/types/index.d.ts +1 -0
- package/packages/lowcode/core/types/json.d.ts +4 -0
- package/packages/lowcode/core/types/vue.shim.d.ts +5 -0
- package/packages/lowcode/core/vite.dist.min.config.js +40 -0
- package/packages/lowcode/core/vite.dist.min.config.js.map +1 -0
- package/packages/lowcode/core/vite.lib.config.js +74 -0
- package/packages/lowcode/core/vite.lib.config.js.map +1 -0
- package/packages/lowcode/core/yarn.lock +1132 -0
- package/packages/lowcode/mobile/package.json +63 -0
- package/packages/lowcode/mobile/types/index.d.ts +1 -0
- package/packages/lowcode/mobile/types/json.d.ts +4 -0
- package/packages/lowcode/mobile/types/vue.shim.d.ts +77 -0
- package/packages/lowcode/mobile/vite.config.js +11 -0
- package/packages/lowcode/mobile/vite.config.js.map +1 -0
- package/packages/lowcode/mobile/vite.dist.min.config.js +71 -0
- package/packages/lowcode/mobile/vite.dist.min.config.js.map +1 -0
- package/packages/lowcode/mobile/vite.lib.config.js +137 -0
- package/packages/lowcode/mobile/vite.lib.config.js.map +1 -0
- package/packages/lowcode/mobile/yarn.lock +3888 -0
- package/packages/lowcode/pc/package.json +64 -0
- package/packages/lowcode/pc/vite.config.js +11 -0
- package/packages/lowcode/pc/vite.config.js.map +1 -0
- package/packages/lowcode/pc/vite.dist.min.config.js +71 -0
- package/packages/lowcode/pc/vite.dist.min.config.js.map +1 -0
- package/packages/lowcode/pc/vite.lib.config.js +137 -0
- package/packages/lowcode/pc/vite.lib.config.js.map +1 -0
- package/packages/lowcode/pc/yarn.lock +4026 -0
- package/packages/pc_components/DOCUMENTATION.md +566 -0
- package/packages/pc_components/LICENSE +24 -0
- package/packages/pc_components/lib/commDialog/index.d.ts +3 -0
- package/packages/pc_components/lib/commDialog/index.js +8 -0
- package/packages/pc_components/lib/commDialog/src/index.vue.d.ts +102 -0
- package/packages/pc_components/lib/commDialog/src/index.vue.js +43 -0
- package/packages/pc_components/lib/commDialog/src/index.vue2.js +4 -0
- package/packages/pc_components/lib/commDialog/src/props.d.ts +49 -0
- package/packages/pc_components/lib/commDialog/src/props.js +48 -0
- package/packages/pc_components/lib/commDialog/src/type.d.ts +39 -0
- package/packages/pc_components/lib/commForm/index.d.ts +3 -0
- package/packages/pc_components/lib/commForm/index.js +8 -0
- package/packages/pc_components/lib/commForm/src/index.vue.d.ts +95 -0
- package/packages/pc_components/lib/commForm/src/index.vue.js +50 -0
- package/packages/pc_components/lib/commForm/src/index.vue2.js +4 -0
- package/packages/pc_components/lib/commForm/src/props.d.ts +49 -0
- package/packages/pc_components/lib/commForm/src/props.js +47 -0
- package/packages/pc_components/lib/commForm/src/type.d.ts +8 -0
- package/packages/pc_components/lib/contextMenu/index.d.ts +5 -0
- package/packages/pc_components/lib/contextMenu/index.js +8 -0
- package/packages/pc_components/lib/contextMenu/src/index.vue.d.ts +91 -0
- package/packages/pc_components/lib/contextMenu/src/index.vue.js +153 -0
- package/packages/pc_components/lib/contextMenu/src/index.vue2.js +4 -0
- package/packages/pc_components/lib/contextMenu/src/props.d.ts +32 -0
- package/packages/pc_components/lib/contextMenu/src/props.js +27 -0
- package/packages/pc_components/lib/contextMenu/src/type.d.ts +11 -0
- package/packages/pc_components/lib/describeView/index.d.ts +2 -0
- package/packages/pc_components/lib/describeView/index.js +7 -0
- package/packages/pc_components/lib/describeView/src/index.vue.d.ts +61 -0
- package/packages/pc_components/lib/describeView/src/index.vue.js +84 -0
- package/packages/pc_components/lib/describeView/src/index.vue2.js +4 -0
- package/packages/pc_components/lib/describeView/src/props.d.ts +35 -0
- package/packages/pc_components/lib/describeView/src/props.js +33 -0
- package/packages/pc_components/lib/describeView/src/type.d.ts +10 -0
- package/packages/pc_components/lib/index.d.ts +18 -0
- package/packages/pc_components/lib/index.js +40 -0
- package/packages/pc_components/lib/simpleVirtualList/index.d.ts +2 -0
- package/packages/pc_components/lib/simpleVirtualList/index.js +7 -0
- package/packages/pc_components/lib/simpleVirtualList/src/index.vue.d.ts +28 -0
- package/packages/pc_components/lib/simpleVirtualList/src/index.vue.js +101 -0
- package/packages/pc_components/lib/simpleVirtualList/src/index.vue2.js +4 -0
- package/packages/pc_components/lib/simpleVirtualList/src/type.d.ts +12 -0
- package/packages/pc_components/lib/styles/comm-form.scss +4 -0
- package/packages/pc_components/lib/styles/context-menu.scss +47 -0
- package/packages/pc_components/lib/styles/describe-view.scss +25 -0
- package/packages/pc_components/lib/styles/index.scss +6 -0
- package/packages/pc_components/lib/styles/simple-virtual-list.scss +25 -0
- package/packages/pc_components/lib/styles/table-extend.scss +100 -0
- package/packages/pc_components/lib/styles/text-button.scss +71 -0
- package/packages/pc_components/lib/tableExtend/index.d.ts +3 -0
- package/packages/pc_components/lib/tableExtend/index.js +7 -0
- package/packages/pc_components/lib/tableExtend/props.d.ts +130 -0
- package/packages/pc_components/lib/tableExtend/props.js +128 -0
- package/packages/pc_components/lib/tableExtend/src/colVisible.vue.d.ts +3 -0
- package/packages/pc_components/lib/tableExtend/src/colVisible.vue.js +128 -0
- package/packages/pc_components/lib/tableExtend/src/colVisible.vue2.js +4 -0
- package/packages/pc_components/lib/tableExtend/src/index.vue.d.ts +186 -0
- package/packages/pc_components/lib/tableExtend/src/index.vue.js +234 -0
- package/packages/pc_components/lib/tableExtend/src/index.vue2.js +4 -0
- package/packages/pc_components/lib/tableExtend/src/valueCol.vue.d.ts +24 -0
- package/packages/pc_components/lib/tableExtend/src/valueCol.vue.js +29 -0
- package/packages/pc_components/lib/tableExtend/src/valueCol.vue2.js +4 -0
- package/packages/pc_components/lib/tableExtend/type.d.ts +165 -0
- package/packages/pc_components/lib/tableExtend/type.js +9 -0
- package/packages/pc_components/lib/tableExtend/useTable.d.ts +27 -0
- package/packages/pc_components/lib/tableExtend/useTable.js +115 -0
- package/packages/pc_components/lib/textButton/index.d.ts +2 -0
- package/packages/pc_components/lib/textButton/index.js +7 -0
- package/packages/pc_components/lib/textButton/src/index.vue.d.ts +42 -0
- package/packages/pc_components/lib/textButton/src/index.vue.js +44 -0
- package/packages/pc_components/lib/textButton/src/index.vue2.js +4 -0
- package/packages/pc_components/lib/textButton/src/props.d.ts +23 -0
- package/packages/pc_components/lib/textButton/src/props.js +30 -0
- package/packages/pc_components/lib/textButton/src/type.d.ts +30 -0
- package/packages/pc_components/lib/utils/index.d.ts +77 -0
- package/packages/pc_components/lib/utils/index.js +124 -0
- package/packages/pc_components/package.json +73 -0
- package/packages/pc_components/types/index.d.ts +9 -0
- package/packages/pc_components/types/json.d.ts +4 -0
- package/packages/pc_components/types/vue.shim.d.ts +5 -0
- package/packages/pc_components/yarn.lock +1641 -0
- package/postcss.config.js +19 -0
- package/public/vite.svg +1 -0
- package/src/App.vue +37 -0
- package/src/api/index.ts +42 -0
- package/src/assets/vue.svg +1 -0
- package/src/document/core.md +2680 -0
- package/src/document/hooks.md +632 -0
- package/src/document/pc_components.md +566 -0
- package/src/locales/en.json +1 -0
- package/src/locales/zh-cn.json +1 -0
- package/src/main.ts +13 -0
- package/src/plugins/element-plus.ts +16 -0
- package/src/plugins/i18n.ts +17 -0
- package/src/plugins/index.ts +13 -0
- package/src/plugins/store.ts +12 -0
- package/src/router/index.ts +20 -0
- package/src/shared/chartType.ts +279 -0
- package/src/shared/const.ts +160 -0
- package/src/shared/lib.ts +129 -0
- package/src/shared/request.ts +255 -0
- package/src/shared/type.ts +48 -0
- package/src/shared/utils/date.ts +83 -0
- package/src/shared/utils/utils.ts +85 -0
- package/src/store/index.ts +22 -0
- package/src/store/modules/app.ts +17 -0
- package/src/store/modules/shared.ts +21 -0
- package/src/styles/index.scss +169 -0
- package/src/types/app.d.ts +23 -0
- package/src/types/echarts.d.ts +5 -0
- package/src/types/index.d.ts +1 -0
- package/src/types/json.d.ts +4 -0
- package/src/types/scss.d.ts +9 -0
- package/src/types/vue.shim.d.ts +5 -0
- package/src/views/docs/docs-content.vue +379 -0
- package/src/views/docs/docs-header.vue +130 -0
- package/src/views/docs/docs-sidebar.vue +76 -0
- package/src/views/docs/hooks.ts +600 -0
- package/src/views/docs/index.vue +30 -0
- package/src/views/docs/styles/docs-content.scss +106 -0
- package/src/views/docs/styles/docs-header.scss +20 -0
- package/src/views/docs/styles/docs-sidebar.scss +182 -0
- package/src/views/docs/styles/index.scss +14 -0
- package/src/views/docs/type.ts +101 -0
- package/src/views/index.vue +34 -0
- package/tsconfig.json +37 -0
- package/tsconfig.node.json +8 -0
- package/vite.config.ts +54 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
.contextmenu {
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 110px;
|
|
4
|
+
left: 200px;
|
|
5
|
+
z-index: 10000;
|
|
6
|
+
|
|
7
|
+
&-wrap {
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
color: var(--el-text-color-regular);
|
|
10
|
+
background-color: var(--el-bg-color);
|
|
11
|
+
border-radius: var(--el-border-radius-base);
|
|
12
|
+
box-shadow: var(--el-box-shadow);
|
|
13
|
+
padding: 5px 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
&-items {
|
|
18
|
+
list-style-type: none;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
|
|
21
|
+
.el-divider--horizontal {
|
|
22
|
+
margin: 5px 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
li {
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
user-select: none;
|
|
28
|
+
height: 34px;
|
|
29
|
+
padding: 0 20px;
|
|
30
|
+
margin: 0 5px;
|
|
31
|
+
display: flex;
|
|
32
|
+
gap: 10px;
|
|
33
|
+
align-items: center;
|
|
34
|
+
border-radius: var(--el-border-radius-base);
|
|
35
|
+
transition: background-color .3s cubic-bezier(.4, 0, .2, 1);
|
|
36
|
+
|
|
37
|
+
&.disabled {
|
|
38
|
+
cursor: not-allowed;
|
|
39
|
+
color: var(--el-text-color-disabled);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:hover {
|
|
43
|
+
background-color: var(--el-color-primary-light-7);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.describe-view-container {
|
|
2
|
+
padding: 0 16px 16px;
|
|
3
|
+
|
|
4
|
+
.view-content {
|
|
5
|
+
display: grid;
|
|
6
|
+
gap: 16px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.view-item {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
|
|
13
|
+
.label {
|
|
14
|
+
flex-shrink: 0;
|
|
15
|
+
color: #606266;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.value {
|
|
19
|
+
display: flex;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.simple-virtual-list {
|
|
2
|
+
position: relative;
|
|
3
|
+
overflow-y: auto;
|
|
4
|
+
width: 100%;
|
|
5
|
+
|
|
6
|
+
&-wrap {
|
|
7
|
+
position: absolute;
|
|
8
|
+
left: 0;
|
|
9
|
+
top: 0;
|
|
10
|
+
right: 0;
|
|
11
|
+
z-index: -1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&-content {
|
|
15
|
+
position: absolute;
|
|
16
|
+
left: 0;
|
|
17
|
+
right: 0;
|
|
18
|
+
top: 0;
|
|
19
|
+
will-change: transform;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&-item {
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
.table-extend {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
flex: 1 0 0%;
|
|
5
|
+
align-items: center;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
position: relative;
|
|
9
|
+
min-height: 200px;
|
|
10
|
+
|
|
11
|
+
.tool-panel {
|
|
12
|
+
display: flex;
|
|
13
|
+
width: 100%;
|
|
14
|
+
margin-bottom: 10px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.left-panel,
|
|
18
|
+
.right-panel {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-wrap: wrap;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: 10px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.right-panel {
|
|
26
|
+
flex: 1 0 0;
|
|
27
|
+
justify-content: flex-end;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.el-table--border td {
|
|
31
|
+
border-right: none !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.el-empty {
|
|
35
|
+
padding: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.el-empty__description {
|
|
39
|
+
margin-top: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.required-ident {
|
|
43
|
+
color: var(--el-color-danger);
|
|
44
|
+
// margin-right: 4px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.table-bottom {
|
|
48
|
+
width: 100%;
|
|
49
|
+
padding-top: 16px;
|
|
50
|
+
display: flex;
|
|
51
|
+
justify-content: space-between;
|
|
52
|
+
align-items: center;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.default-tool {
|
|
57
|
+
font-size: 18px;
|
|
58
|
+
margin-left: 10px;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
height: 100%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.set-column-list-wrap {
|
|
65
|
+
max-height: 70vh;
|
|
66
|
+
overflow: auto;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.set-column-check-group {
|
|
70
|
+
.group-item {
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
justify-content: space-between;
|
|
74
|
+
min-height: 32px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.fixed-wrap {
|
|
78
|
+
display: flex;
|
|
79
|
+
justify-content: space-between;
|
|
80
|
+
width: 50px;
|
|
81
|
+
font-size: 16px;
|
|
82
|
+
color: #333;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.fixed-icon {
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
|
|
88
|
+
&:first-child {
|
|
89
|
+
transform: rotate(-90deg);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:last-child {
|
|
93
|
+
transform: rotate(90deg);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&.active {
|
|
97
|
+
color: var(--el-color-primary);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
.text-button {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
font-size: 14px;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
user-select: none;
|
|
7
|
+
|
|
8
|
+
&.is-disabled {
|
|
9
|
+
cursor: not-allowed !important;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&-default {
|
|
13
|
+
color: inherit;
|
|
14
|
+
|
|
15
|
+
&.is-disabled {
|
|
16
|
+
color: var(--el-text-color-disabled);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&-primary {
|
|
21
|
+
color: var(--el-color-primary);
|
|
22
|
+
|
|
23
|
+
&.is-disabled {
|
|
24
|
+
color: var(--el-color-primary-light-5);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-success {
|
|
29
|
+
color: var(--el-color-success);
|
|
30
|
+
|
|
31
|
+
&.is-disabled {
|
|
32
|
+
color: var(--el-color-success-light-5);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&-warning {
|
|
37
|
+
color: var(--el-color-warning);
|
|
38
|
+
|
|
39
|
+
&.is-disabled {
|
|
40
|
+
color: var(--el-color-warning-light-5);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&-danger {
|
|
45
|
+
color: var(--el-color-danger);
|
|
46
|
+
|
|
47
|
+
&.is-disabled {
|
|
48
|
+
color: var(--el-color-danger-light-5);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&-error {
|
|
53
|
+
color: var(--el-color-error);
|
|
54
|
+
|
|
55
|
+
&.is-disabled {
|
|
56
|
+
color: var(--el-color-error-light-5);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&-info {
|
|
61
|
+
color: var(--el-color-info);
|
|
62
|
+
|
|
63
|
+
&.is-disabled {
|
|
64
|
+
color: var(--el-color-info-light-5);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&-icon {
|
|
69
|
+
margin-right: 4px;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { TableAttr, TableColumn } from './type';
|
|
3
|
+
/**
|
|
4
|
+
* 表格扩展组件属性定义
|
|
5
|
+
* @returns {Object} 组件属性配置
|
|
6
|
+
*/
|
|
7
|
+
export default function props(): {
|
|
8
|
+
/**
|
|
9
|
+
* 表格UI选项配置
|
|
10
|
+
* @type {TableAttr}
|
|
11
|
+
* @default {}
|
|
12
|
+
*/
|
|
13
|
+
options: {
|
|
14
|
+
type: PropType<TableAttr>;
|
|
15
|
+
default: () => {};
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* 表格数据源
|
|
19
|
+
* @type {Array}
|
|
20
|
+
* @default []
|
|
21
|
+
*/
|
|
22
|
+
tableData: {
|
|
23
|
+
type: ArrayConstructor;
|
|
24
|
+
default: never[];
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* 表格列配置
|
|
28
|
+
* @type {Array<TableColumn>}
|
|
29
|
+
* @default []
|
|
30
|
+
*/
|
|
31
|
+
tableColums: {
|
|
32
|
+
type: PropType<Array<TableColumn>>;
|
|
33
|
+
default: () => never[];
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* 加载状态
|
|
37
|
+
* @type {Boolean}
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
tableLoading: BooleanConstructor;
|
|
41
|
+
/**
|
|
42
|
+
* 是否显示展开行
|
|
43
|
+
* @type {Boolean}
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
expand: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: () => boolean;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* 是否显示选择列
|
|
52
|
+
* @type {Boolean}
|
|
53
|
+
* @default true
|
|
54
|
+
*/
|
|
55
|
+
selectionCol: {
|
|
56
|
+
type: BooleanConstructor;
|
|
57
|
+
default: () => boolean;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* 是否显示索引列
|
|
61
|
+
* @type {Boolean}
|
|
62
|
+
* @default true
|
|
63
|
+
*/
|
|
64
|
+
indexCol: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
default: () => boolean;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* 是否启用列显示/隐藏设置
|
|
70
|
+
* @type {Boolean}
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
isSetColumn: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
default: () => boolean;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* 分页配置
|
|
79
|
+
* @type {{ pageIndex: number; pageSize: number }}
|
|
80
|
+
*/
|
|
81
|
+
paging: {
|
|
82
|
+
type: PropType<{
|
|
83
|
+
pageIndex: number;
|
|
84
|
+
pageSize: number;
|
|
85
|
+
}>;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* 数据总数
|
|
89
|
+
* @type {Number}
|
|
90
|
+
*/
|
|
91
|
+
total: NumberConstructor;
|
|
92
|
+
/**
|
|
93
|
+
* 可选页面大小列表
|
|
94
|
+
* @type {Array<number>}
|
|
95
|
+
* @default [15, 20, 30, 50, 100]
|
|
96
|
+
*/
|
|
97
|
+
sizeList: {
|
|
98
|
+
type: PropType<Array<number>>;
|
|
99
|
+
default: () => number[];
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* 是否自动高度
|
|
103
|
+
* 最大高度为父容器高度,实际高度由数据决定
|
|
104
|
+
* @type {Boolean}
|
|
105
|
+
* @default false
|
|
106
|
+
*/
|
|
107
|
+
autoHeight: {
|
|
108
|
+
type: BooleanConstructor;
|
|
109
|
+
default: () => boolean;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* 是否自动显示分页器
|
|
113
|
+
* 当数据量满足分页时显示,否则不显示
|
|
114
|
+
* @type {Boolean}
|
|
115
|
+
* @default false
|
|
116
|
+
*/
|
|
117
|
+
autoPagination: {
|
|
118
|
+
type: BooleanConstructor;
|
|
119
|
+
default: () => boolean;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* 是否启用大小自适应
|
|
123
|
+
* @type {Boolean}
|
|
124
|
+
* @default false
|
|
125
|
+
*/
|
|
126
|
+
autoSize: {
|
|
127
|
+
type: BooleanConstructor;
|
|
128
|
+
default: () => boolean;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
function props() {
|
|
2
|
+
return {
|
|
3
|
+
/**
|
|
4
|
+
* 表格UI选项配置
|
|
5
|
+
* @type {TableAttr}
|
|
6
|
+
* @default {}
|
|
7
|
+
*/
|
|
8
|
+
options: {
|
|
9
|
+
type: Object,
|
|
10
|
+
default: () => {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
/**
|
|
15
|
+
* 表格数据源
|
|
16
|
+
* @type {Array}
|
|
17
|
+
* @default []
|
|
18
|
+
*/
|
|
19
|
+
tableData: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default: []
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* 表格列配置
|
|
25
|
+
* @type {Array<TableColumn>}
|
|
26
|
+
* @default []
|
|
27
|
+
*/
|
|
28
|
+
tableColums: {
|
|
29
|
+
type: Array,
|
|
30
|
+
default: () => []
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* 加载状态
|
|
34
|
+
* @type {Boolean}
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
tableLoading: Boolean,
|
|
38
|
+
/**
|
|
39
|
+
* 是否显示展开行
|
|
40
|
+
* @type {Boolean}
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
expand: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: () => false
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* 是否显示选择列
|
|
49
|
+
* @type {Boolean}
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
selectionCol: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: () => true
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* 是否显示索引列
|
|
58
|
+
* @type {Boolean}
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
indexCol: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: () => true
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* 是否启用列显示/隐藏设置
|
|
67
|
+
* @type {Boolean}
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
isSetColumn: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: () => false
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* 分页配置
|
|
76
|
+
* @type {{ pageIndex: number; pageSize: number }}
|
|
77
|
+
*/
|
|
78
|
+
paging: {
|
|
79
|
+
type: Object
|
|
80
|
+
},
|
|
81
|
+
/**
|
|
82
|
+
* 数据总数
|
|
83
|
+
* @type {Number}
|
|
84
|
+
*/
|
|
85
|
+
total: Number,
|
|
86
|
+
/**
|
|
87
|
+
* 可选页面大小列表
|
|
88
|
+
* @type {Array<number>}
|
|
89
|
+
* @default [15, 20, 30, 50, 100]
|
|
90
|
+
*/
|
|
91
|
+
sizeList: {
|
|
92
|
+
type: Array,
|
|
93
|
+
default: () => [15, 20, 30, 50, 100]
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* 是否自动高度
|
|
97
|
+
* 最大高度为父容器高度,实际高度由数据决定
|
|
98
|
+
* @type {Boolean}
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
autoHeight: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
default: () => false
|
|
104
|
+
},
|
|
105
|
+
/**
|
|
106
|
+
* 是否自动显示分页器
|
|
107
|
+
* 当数据量满足分页时显示,否则不显示
|
|
108
|
+
* @type {Boolean}
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
autoPagination: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: () => false
|
|
114
|
+
},
|
|
115
|
+
/**
|
|
116
|
+
* 是否启用大小自适应
|
|
117
|
+
* @type {Boolean}
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
autoSize: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
default: () => false
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
props as default
|
|
128
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,128 @@
|
|
|
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({
|
|
5
|
+
__name: "colVisible",
|
|
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
|
+
}
|
|
20
|
+
}
|
|
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;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function on_change_fixed(type, prop) {
|
|
30
|
+
if (prop.fixed === type) {
|
|
31
|
+
prop.fixed = void 0;
|
|
32
|
+
} else {
|
|
33
|
+
prop.fixed = type;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
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, {
|
|
45
|
+
placement: "bottom",
|
|
46
|
+
title: "列显示设置",
|
|
47
|
+
width: 220
|
|
48
|
+
}, {
|
|
49
|
+
reference: withCtx(() => [
|
|
50
|
+
createVNode(_component_el_icon, null, {
|
|
51
|
+
default: withCtx(() => [
|
|
52
|
+
createVNode(_component_Setting)
|
|
53
|
+
]),
|
|
54
|
+
_: 1
|
|
55
|
+
})
|
|
56
|
+
]),
|
|
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
|
|
64
|
+
}, {
|
|
65
|
+
default: withCtx(() => [..._cache[2] || (_cache[2] = [
|
|
66
|
+
createTextVNode("全选 ", -1)
|
|
67
|
+
])]),
|
|
68
|
+
_: 1
|
|
69
|
+
}, 8, ["indeterminate", "modelValue"]),
|
|
70
|
+
createVNode(_component_el_checkbox_group, {
|
|
71
|
+
class: "set-column-check-group",
|
|
72
|
+
modelValue: checkColumnProp.value,
|
|
73
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => checkColumnProp.value = $event),
|
|
74
|
+
onChange: on_checked_change
|
|
75
|
+
}, {
|
|
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
|
|
85
|
+
}, {
|
|
86
|
+
default: withCtx(() => [
|
|
87
|
+
createTextVNode(toDisplayString(colum.label), 1)
|
|
88
|
+
]),
|
|
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))
|
|
116
|
+
]),
|
|
117
|
+
_: 1
|
|
118
|
+
}, 8, ["modelValue"])
|
|
119
|
+
])
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
export {
|
|
127
|
+
_sfc_main as default
|
|
128
|
+
};
|