@bsgoal/common 1.5.8 → 1.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +470 -438
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/combines/useComs.js +12 -3
- package/src/components/bsgoal-base-dialog/index.vue +10 -4
- package/src/components/bsgoal-base-table/demo.vue +164 -172
- package/src/components/bsgoal-base-table/index.vue +19 -2
- package/src/components/bsgoal-base-tooltip/index.vue +3 -3
- package/src/utils/common.js +53 -0
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.base_tooltip_popper{max-width:20em}.bsgoal-base-form .base_form{padding:16px 6px 8px 16px}.bsgoal-base-form .base_form .el-form-item{margin-right:10px}.bsgoal-base-form .base_form div.el-input,.bsgoal-base-form .base_form div.el-select{width:100%}.bsgoal-base-table-pagination{text-align:right}.bsgoal-base-table-pagination .base_table_pagination{display:inline-block;margin-top:16px}.bsgoal-base-table-empty .base_table_empty{text-align:center}.bsgoal-base-table-empty .base_table_empty_img{padding-top:16px;line-height:initial}.bsgoal-base-table-empty .base_table_empty_text{display:inline-block}.bsgoal-base-table .base_table{padding:16px}.bsgoal-base-table .base_table_menu{margin-bottom:8px}.bsgoal-base-table .el-table__body-wrapper{overflow-y:hidden!important}.bsgoal-base-table .el-scrollbar__view{height:100%}.bsgoal-base-line .base_line{height:10px;background-color:#f0f2f5}.bsgoal-base-line .bsgoal-base-line__vertical{display:inline-block;height:100%}.bsgoal-base-line .base_line__vertical{width:10px;height:100%}.bsgoal-base-search-operation{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bsgoal-base-search-operation .operation_fold{margin-left:12px;cursor:pointer;min-width:3em}.bsgoal-base-cascader{width:100%}.bsgoal-base-cascader .base_cascader{width:inherit}.bsgoal-base-search .base_search{padding:16px 6px 8px 16px}.bsgoal-base-search .base_search .el-form-item{margin-bottom:8px;margin-right:10px}.bsgoal-base-search .base_search div.el-input,.bsgoal-base-search .base_search div.el-select{width:100%}.bsgoal-base-tree-fold .base_tree_fold{position:absolute;top:0;bottom:0;right:10px;margin:auto;width:14px;height:38px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:10px;background-color:#409eff}.bsgoal-base-tree-fold .base_tree_fold--hide{right:0px}.bsgoal-base-tree{display:inline-block}.bsgoal-base-tree .base_tree{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;min-width:14px}.bsgoal-base-tree .base_tree_main{width:221px;padding:16px;scrollbar-width:none;-ms-overflow-style:none;overflow-x:hidden;overflow-y:auto}.bsgoal-base-tree .base_tree_main::-webkit-scrollbar{width:6px;height:6px}.bsgoal-base-tree .base_tree_main::-webkit-scrollbar-thumb{border-radius:10px;background:rgba(0,0,0,.2);width:20px}.bsgoal-base-tree .base_tree_main::-webkit-scrollbar-track{background-color:#fff}.bsgoal-base-tree .base_tree_main_input{margin-bottom:10px}.bsgoal-base-tree .base_tree .el-tree-node__content>i.el-tree-node__expand-icon{padding-left:0}.bsgoal-base-dialog .base_dialog_header{font-weight:500;color:#303133;font-size:16px}.bsgoal-base-dialog .bsgoal_base_dialog_main .el-dialog__header{padding:16px 30px;margin-right:0;background-color:#f5f7fa}.bsgoal-base-dialog .bsgoal_base_dialog_main .el-dialog__header .el-dialog__headerbtn{top:0px;right:8px}.bsgoal-base-dialog .bsgoal_base_dialog_main .el-dialog__body{padding:0}.bsgoal-base-dialog .bsgoal_base_dialog_main .base_dialog_content{padding:30px}.bsgoal-base-dialog .bsgoal_base_dialog_main .base_dialog_content--form{padding:0 0 30px 30px}
|
|
1
|
+
@charset "UTF-8";.base_tooltip_popper{max-width:20em}.bsgoal-base-form .base_form{padding:16px 6px 8px 16px}.bsgoal-base-form .base_form .el-form-item{margin-right:10px}.bsgoal-base-form .base_form div.el-input,.bsgoal-base-form .base_form div.el-select{width:100%}.bsgoal-base-table-pagination{text-align:right}.bsgoal-base-table-pagination .base_table_pagination{display:inline-block;margin-top:16px}.bsgoal-base-table-empty .base_table_empty{text-align:center}.bsgoal-base-table-empty .base_table_empty_img{padding-top:16px;line-height:initial}.bsgoal-base-table-empty .base_table_empty_text{display:inline-block}.bsgoal-base-table .base_table{padding:16px}.bsgoal-base-table .base_table_menu{margin-bottom:8px}.bsgoal-base-table .el-table__body-wrapper{overflow-y:hidden!important}.bsgoal-base-table .el-scrollbar__view{height:100%}.bsgoal-base-line .base_line{height:10px;background-color:#f0f2f5}.bsgoal-base-line .bsgoal-base-line__vertical{display:inline-block;height:100%}.bsgoal-base-line .base_line__vertical{width:10px;height:100%}.bsgoal-base-search-operation{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bsgoal-base-search-operation .operation_fold{margin-left:12px;cursor:pointer;min-width:3em}.bsgoal-base-cascader{width:100%}.bsgoal-base-cascader .base_cascader{width:inherit}.bsgoal-base-search .base_search{padding:16px 6px 8px 16px}.bsgoal-base-search .base_search .el-form-item{margin-bottom:8px;margin-right:10px}.bsgoal-base-search .base_search div.el-input,.bsgoal-base-search .base_search div.el-select{width:100%}.bsgoal-base-tree-fold .base_tree_fold{position:absolute;top:0;bottom:0;right:10px;margin:auto;width:14px;height:38px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:10px;background-color:#409eff}.bsgoal-base-tree-fold .base_tree_fold--hide{right:0px}.bsgoal-base-tree{display:inline-block}.bsgoal-base-tree .base_tree{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;min-width:14px}.bsgoal-base-tree .base_tree_main{width:221px;padding:16px;scrollbar-width:none;-ms-overflow-style:none;overflow-x:hidden;overflow-y:auto}.bsgoal-base-tree .base_tree_main::-webkit-scrollbar{width:6px;height:6px}.bsgoal-base-tree .base_tree_main::-webkit-scrollbar-thumb{border-radius:10px;background:rgba(0,0,0,.2);width:20px}.bsgoal-base-tree .base_tree_main::-webkit-scrollbar-track{background-color:#fff}.bsgoal-base-tree .base_tree_main_input{margin-bottom:10px}.bsgoal-base-tree .base_tree .el-tree-node__content>i.el-tree-node__expand-icon{padding-left:0}.bsgoal-base-dialog .base_dialog_header{font-weight:500;color:#303133;font-size:16px}.bsgoal-base-dialog .bsgoal-dialog__footer--conceal .el-dialog__footer{display:none}.bsgoal-base-dialog .bsgoal_base_dialog_main .el-dialog__header{padding:16px 30px;margin-right:0;background-color:#f5f7fa}.bsgoal-base-dialog .bsgoal_base_dialog_main .el-dialog__header .el-dialog__headerbtn{top:0px;right:8px}.bsgoal-base-dialog .bsgoal_base_dialog_main .el-dialog__body{padding:0}.bsgoal-base-dialog .bsgoal_base_dialog_main .base_dialog_content{padding:30px}.bsgoal-base-dialog .bsgoal_base_dialog_main .base_dialog_content--form{padding:0 0 30px 30px}
|
package/package.json
CHANGED
package/src/combines/useComs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-19 09:10:00
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-
|
|
5
|
+
* @LastEditTime: 2023-05-08 14:14:46
|
|
6
6
|
* @FilePath: \common\src\combines\useComs.js
|
|
7
7
|
* @Description: 组件相关的组合函数
|
|
8
8
|
*
|
|
@@ -18,14 +18,23 @@ import { unref, nextTick } from 'vue'
|
|
|
18
18
|
* @default:
|
|
19
19
|
* @return {*}
|
|
20
20
|
*/
|
|
21
|
-
export const useAutoHeight = (el = null, { expression = 75
|
|
21
|
+
export const useAutoHeight = (el = null, { expression = 75, arg = {}, height = '' } = {}) => {
|
|
22
22
|
const elValue = unref(el)
|
|
23
23
|
if (elValue) {
|
|
24
24
|
const elTable = elValue.querySelector('.el-table')
|
|
25
25
|
if (elTable) {
|
|
26
26
|
nextTick(() => {
|
|
27
27
|
const { y = 0 } = elTable.getBoundingClientRect()
|
|
28
|
-
|
|
28
|
+
let tableHeight = `calc(100vh - ${y + expression}px)`
|
|
29
|
+
const intHeight = Number.parseInt(height)
|
|
30
|
+
if (height) {
|
|
31
|
+
if (intHeight) {
|
|
32
|
+
tableHeight = `${height}px`
|
|
33
|
+
} else {
|
|
34
|
+
tableHeight = height
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
elTable.style.height = tableHeight
|
|
29
38
|
})
|
|
30
39
|
}
|
|
31
40
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-23 16:35:19
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-
|
|
5
|
+
* @LastEditTime: 2023-05-10 11:56:01
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-dialog\index.vue
|
|
7
7
|
* @Description: 弹窗公共组件
|
|
8
8
|
*
|
|
@@ -141,7 +141,8 @@ const widthGet = computed(() => {
|
|
|
141
141
|
<div class="bsgoal-base-dialog">
|
|
142
142
|
<div class="base_dialog">
|
|
143
143
|
<!-- S 组件实体 -->
|
|
144
|
-
<el-dialog v-model="dialogVisible" custom-class="bsgoal_base_dialog_main"
|
|
144
|
+
<el-dialog v-model="dialogVisible" custom-class="bsgoal_base_dialog_main"
|
|
145
|
+
:class="{ 'bsgoal-dialog__footer--conceal': !footer }" :width="widthGet">
|
|
145
146
|
<template #header>
|
|
146
147
|
<div class="base_dialog_header">{{ title }}</div>
|
|
147
148
|
</template>
|
|
@@ -171,16 +172,22 @@ const widthGet = computed(() => {
|
|
|
171
172
|
font-size: 16px;
|
|
172
173
|
}
|
|
173
174
|
|
|
175
|
+
.bsgoal-dialog__footer--conceal .el-dialog__footer {
|
|
176
|
+
display: none;
|
|
177
|
+
}
|
|
178
|
+
|
|
174
179
|
.bsgoal_base_dialog_main {
|
|
175
180
|
.el-dialog__header {
|
|
176
181
|
padding: 16px 30px;
|
|
177
182
|
margin-right: 0px;
|
|
178
183
|
background-color: #f5f7fa;
|
|
184
|
+
|
|
179
185
|
.el-dialog__headerbtn {
|
|
180
186
|
top: 0px;
|
|
181
187
|
right: 8px;
|
|
182
188
|
}
|
|
183
189
|
}
|
|
190
|
+
|
|
184
191
|
.el-dialog__body {
|
|
185
192
|
padding: 0px;
|
|
186
193
|
}
|
|
@@ -193,5 +200,4 @@ const widthGet = computed(() => {
|
|
|
193
200
|
padding: 0px 0px 30px 30px;
|
|
194
201
|
}
|
|
195
202
|
}
|
|
196
|
-
}
|
|
197
|
-
</style>
|
|
203
|
+
}</style>
|
|
@@ -2,172 +2,162 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-10 14:26:44
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-
|
|
5
|
+
* @LastEditTime: 2023-05-08 15:15:07
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-table\demo.vue
|
|
7
7
|
* @Description: 表格公共组件演示页面
|
|
8
8
|
*
|
|
9
9
|
-->
|
|
10
10
|
<script>
|
|
11
11
|
export default {
|
|
12
|
-
name:
|
|
13
|
-
}
|
|
12
|
+
name: 'BsgoalBaseTableDemo'
|
|
13
|
+
}
|
|
14
14
|
</script>
|
|
15
15
|
<script setup>
|
|
16
16
|
/* setup模板
|
|
17
17
|
---------------------------------------------------------------- */
|
|
18
|
-
import {
|
|
19
|
-
ref, computed, toRefs, watch, unref
|
|
20
|
-
} from 'vue';
|
|
18
|
+
import { ref, computed, toRefs, watch, unref } from 'vue'
|
|
21
19
|
|
|
22
20
|
import BsgoalBaseTable from './index.vue'
|
|
23
|
-
import
|
|
21
|
+
import BsgoalBaseSearch from '../bsgoal-base-search/index.vue'
|
|
24
22
|
import EnumType from '../../enums/enumType.js'
|
|
25
23
|
let searchOptions = ref([
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
// {
|
|
114
|
-
// label: 'prop8',
|
|
115
|
-
// // value: '111',
|
|
116
|
-
// type: EnumType.WEEK,
|
|
117
|
-
// prop: 'prop8'
|
|
118
|
-
|
|
119
|
-
// },
|
|
120
|
-
{
|
|
121
|
-
label: 'prop9',
|
|
122
|
-
// value: '111',
|
|
123
|
-
type: EnumType.MONTH,
|
|
124
|
-
prop: 'prop9'
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
label: 'prop10',
|
|
129
|
-
// value: '111',
|
|
130
|
-
type: EnumType.YEAR,
|
|
131
|
-
prop: 'prop10'
|
|
24
|
+
{
|
|
25
|
+
label: 'prop1',
|
|
26
|
+
// value: '111',
|
|
27
|
+
prop: 'prop1',
|
|
28
|
+
type: EnumType.INPUT
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: 'prop2',
|
|
32
|
+
value: 'select2',
|
|
33
|
+
type: EnumType.SELECT,
|
|
34
|
+
prop: 'prop2',
|
|
35
|
+
range: [
|
|
36
|
+
{
|
|
37
|
+
label: 'select1',
|
|
38
|
+
value: 'select1'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: 'select2',
|
|
42
|
+
value: 'select2'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: 'select3',
|
|
46
|
+
value: 'select3'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: 'select4',
|
|
50
|
+
value: 'select5'
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: 'prop3',
|
|
56
|
+
// value: '111',
|
|
57
|
+
type: EnumType.SLIDER,
|
|
58
|
+
prop: 'prop3'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: 'prop4',
|
|
62
|
+
// value: '111',
|
|
63
|
+
type: EnumType.SWITCH,
|
|
64
|
+
prop: 'prop4'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: 'prop5',
|
|
68
|
+
// value: '111',
|
|
69
|
+
type: EnumType.RADIO,
|
|
70
|
+
prop: 'prop5',
|
|
71
|
+
range: [
|
|
72
|
+
{
|
|
73
|
+
label: 'radio1',
|
|
74
|
+
value: 'radio1'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: 'radio2',
|
|
78
|
+
value: 'radio2'
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: 'prop6',
|
|
84
|
+
value: [],
|
|
85
|
+
type: EnumType.CHECKBOX,
|
|
86
|
+
prop: 'prop6',
|
|
87
|
+
range: [
|
|
88
|
+
{
|
|
89
|
+
label: 'checkbox1',
|
|
90
|
+
value: 'checkbox1'
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
label: 'checkbox2',
|
|
94
|
+
value: 'checkbox2'
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
label: 'prop7',
|
|
100
|
+
// value: '111',
|
|
101
|
+
type: EnumType.DATE,
|
|
102
|
+
prop: 'prop7',
|
|
103
|
+
format: 'YYYY-MM-DD'
|
|
104
|
+
},
|
|
105
|
+
// {
|
|
106
|
+
// label: 'prop8',
|
|
107
|
+
// // value: '111',
|
|
108
|
+
// type: EnumType.WEEK,
|
|
109
|
+
// prop: 'prop8'
|
|
132
110
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
111
|
+
// },
|
|
112
|
+
{
|
|
113
|
+
label: 'prop9',
|
|
114
|
+
// value: '111',
|
|
115
|
+
type: EnumType.MONTH,
|
|
116
|
+
prop: 'prop9'
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
label: 'prop10',
|
|
120
|
+
// value: '111',
|
|
121
|
+
type: EnumType.YEAR,
|
|
122
|
+
prop: 'prop10'
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
label: 'prop11',
|
|
126
|
+
// value: '111',
|
|
127
|
+
type: EnumType.DATE_RANGE,
|
|
128
|
+
prop: 'prop11',
|
|
129
|
+
range: ['startDate', 'endDate']
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
label: 'prop12',
|
|
133
|
+
// value: '111',
|
|
134
|
+
type: EnumType.MONTH_RANGE,
|
|
135
|
+
prop: 'prop12'
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
label: 'prop13',
|
|
139
|
+
// value: '111',
|
|
140
|
+
type: EnumType.TIME,
|
|
141
|
+
prop: 'prop13'
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
label: 'prop14',
|
|
145
|
+
// value: '111',
|
|
146
|
+
type: EnumType.TIME_RANGE,
|
|
147
|
+
prop: 'prop14'
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
label: 'prop15',
|
|
151
|
+
// value: '111',
|
|
152
|
+
type: EnumType.DATE_TIME,
|
|
153
|
+
prop: 'prop15'
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
label: 'prop16',
|
|
157
|
+
// value: '111',
|
|
158
|
+
type: EnumType.DATE_TIME_RANGE,
|
|
159
|
+
prop: 'prop16'
|
|
160
|
+
}
|
|
171
161
|
])
|
|
172
162
|
const data = ref([
|
|
173
163
|
{
|
|
@@ -176,7 +166,7 @@ const data = ref([
|
|
|
176
166
|
prop3: 'prop3',
|
|
177
167
|
prop4: 'prop4',
|
|
178
168
|
prop5: 'prop5',
|
|
179
|
-
prop6: 'prop6'
|
|
169
|
+
prop6: 'prop6'
|
|
180
170
|
},
|
|
181
171
|
{
|
|
182
172
|
prop1: 'prop1',
|
|
@@ -184,7 +174,7 @@ const data = ref([
|
|
|
184
174
|
prop3: 'prop3',
|
|
185
175
|
prop4: 'prop4',
|
|
186
176
|
prop5: 'prop5',
|
|
187
|
-
prop6: 'prop6'
|
|
177
|
+
prop6: 'prop6'
|
|
188
178
|
},
|
|
189
179
|
{
|
|
190
180
|
prop1: 'prop1',
|
|
@@ -192,7 +182,7 @@ const data = ref([
|
|
|
192
182
|
prop3: 'prop3',
|
|
193
183
|
prop4: 'prop4',
|
|
194
184
|
prop5: 'prop5',
|
|
195
|
-
prop6: 'prop6'
|
|
185
|
+
prop6: 'prop6'
|
|
196
186
|
},
|
|
197
187
|
{
|
|
198
188
|
prop1: 'prop1',
|
|
@@ -200,7 +190,7 @@ const data = ref([
|
|
|
200
190
|
prop3: 'prop3',
|
|
201
191
|
prop4: 'prop4',
|
|
202
192
|
prop5: 'prop5',
|
|
203
|
-
prop6: 'prop6'
|
|
193
|
+
prop6: 'prop6'
|
|
204
194
|
},
|
|
205
195
|
{
|
|
206
196
|
prop1: 'prop1',
|
|
@@ -208,7 +198,7 @@ const data = ref([
|
|
|
208
198
|
prop3: 'prop3',
|
|
209
199
|
prop4: 'prop4',
|
|
210
200
|
prop5: 'prop5',
|
|
211
|
-
prop6: 'prop6'
|
|
201
|
+
prop6: 'prop6'
|
|
212
202
|
},
|
|
213
203
|
{
|
|
214
204
|
prop1: 'prop1',
|
|
@@ -216,8 +206,8 @@ const data = ref([
|
|
|
216
206
|
prop3: 'prop3',
|
|
217
207
|
prop4: 'prop4',
|
|
218
208
|
prop5: 'prop5',
|
|
219
|
-
prop6: 'prop6'
|
|
220
|
-
}
|
|
209
|
+
prop6: 'prop6'
|
|
210
|
+
}
|
|
221
211
|
])
|
|
222
212
|
|
|
223
213
|
const options = ref([
|
|
@@ -244,30 +234,32 @@ const options = ref([
|
|
|
244
234
|
{
|
|
245
235
|
label: '列列列列列列列列列6',
|
|
246
236
|
prop: 'prop6'
|
|
247
|
-
}
|
|
237
|
+
}
|
|
248
238
|
])
|
|
249
239
|
|
|
250
240
|
const clearData = () => {
|
|
251
|
-
|
|
252
|
-
data.value = []
|
|
241
|
+
data.value = []
|
|
253
242
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
243
|
</script>
|
|
258
244
|
<template>
|
|
259
245
|
<div class="bsgoal-base-table-demo">
|
|
260
246
|
<!-- <BsgoalBaseSearch :config-options="searchOptions" /> -->
|
|
261
247
|
<el-button type="primary" @click="clearData">设置为空数据</el-button>
|
|
262
|
-
<BsgoalBaseTable
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
248
|
+
<BsgoalBaseTable
|
|
249
|
+
operation
|
|
250
|
+
operation-width="200"
|
|
251
|
+
selection
|
|
252
|
+
:config-options="options"
|
|
253
|
+
:data="data"
|
|
254
|
+
:auto-height="false"
|
|
255
|
+
>
|
|
256
|
+
<template v-slot:operation="{ row }">
|
|
257
|
+
<div>
|
|
258
|
+
<el-button type="primary">操作按钮</el-button>
|
|
259
|
+
</div>
|
|
260
|
+
</template>
|
|
268
261
|
</BsgoalBaseTable>
|
|
269
262
|
<hr />
|
|
270
|
-
|
|
271
263
|
</div>
|
|
272
264
|
</template>
|
|
273
265
|
<style lang="scss" scoped>
|
|
@@ -277,4 +269,4 @@ const clearData = () => {
|
|
|
277
269
|
<style lang="scss">
|
|
278
270
|
/* 覆盖样式
|
|
279
271
|
---------------------------------------------------------------- */
|
|
280
|
-
</style>
|
|
272
|
+
</style>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-10 11:29:04
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-
|
|
5
|
+
* @LastEditTime: 2023-05-08 15:19:02
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-table\index.vue
|
|
7
7
|
* @Description:
|
|
8
8
|
*
|
|
@@ -22,6 +22,7 @@ import BsgoalBaseTablePagination from '../bsgoal-base-table-pagination/index.vue
|
|
|
22
22
|
import BsgoalBaseTableEmpty from '../bsgoal-base-table-empty/index.vue'
|
|
23
23
|
import { useAutoHeight } from '../../combines/useComs.js'
|
|
24
24
|
import { useFetch } from '../../combines/useFetchs.js'
|
|
25
|
+
import { isBoolean } from '@/utils/common.js'
|
|
25
26
|
|
|
26
27
|
const props = defineProps({
|
|
27
28
|
/**
|
|
@@ -107,6 +108,18 @@ const props = defineProps({
|
|
|
107
108
|
expression: {
|
|
108
109
|
type: [Number],
|
|
109
110
|
default: 75
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* 表格高度
|
|
114
|
+
*
|
|
115
|
+
* 默认 : 自动计算
|
|
116
|
+
* 布尔值 : 默认表格高度
|
|
117
|
+
* 字符串 : 直接赋值给 height
|
|
118
|
+
* 数字 : 直接赋值给 height + 'px'
|
|
119
|
+
*/
|
|
120
|
+
height: {
|
|
121
|
+
type: [Number, String, Boolean],
|
|
122
|
+
default: ''
|
|
110
123
|
}
|
|
111
124
|
})
|
|
112
125
|
|
|
@@ -136,9 +149,13 @@ const EL_TABLE_WRAP_REF = ref(null)
|
|
|
136
149
|
// 折叠状态响应值
|
|
137
150
|
const transferFoldStatus = inject('transferFoldStatus')
|
|
138
151
|
watchEffect(() => {
|
|
152
|
+
const { height } = props
|
|
139
153
|
const status = transferFoldStatus ? transferFoldStatus.value : false
|
|
140
154
|
const expressionVal = unref(props.expression)
|
|
141
|
-
|
|
155
|
+
// 默认是打开表格高度自动计算的
|
|
156
|
+
if (!isBoolean(height)) {
|
|
157
|
+
useAutoHeight(EL_TABLE_WRAP_REF, { arg: status, expression: expressionVal, height })
|
|
158
|
+
}
|
|
142
159
|
})
|
|
143
160
|
|
|
144
161
|
// 触发搜索
|
|
@@ -54,15 +54,15 @@ const props = defineProps({
|
|
|
54
54
|
none: {
|
|
55
55
|
type: [String],
|
|
56
56
|
default: '无'
|
|
57
|
-
}
|
|
57
|
+
},
|
|
58
58
|
})
|
|
59
59
|
|
|
60
60
|
// ---> S 字符数限制 <---
|
|
61
61
|
const contentGet = computed(() => {
|
|
62
|
-
const { content = '', limit = 0
|
|
62
|
+
const { content = '', limit = 0, none = '' } = props
|
|
63
63
|
let contentString = content
|
|
64
64
|
const contentLength = content.length
|
|
65
|
-
if (
|
|
65
|
+
if (limit && contentLength > limit) {
|
|
66
66
|
contentString = `${content.substring(0, limit)}...`
|
|
67
67
|
}
|
|
68
68
|
return contentString || none
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-05-08 15:11:05
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-05-08 15:11:11
|
|
6
|
+
* @FilePath: \common\src\utils\common.js
|
|
7
|
+
* @Description: 常用的工具方法
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export const getInstanceType = (instance = null) => {
|
|
13
|
+
const type = toString.apply(instance)
|
|
14
|
+
|
|
15
|
+
switch (type) {
|
|
16
|
+
case '[object Object]':
|
|
17
|
+
return 'object'
|
|
18
|
+
case '[object Function]':
|
|
19
|
+
return 'function'
|
|
20
|
+
case '[object String]':
|
|
21
|
+
return 'string'
|
|
22
|
+
case '[object Number]':
|
|
23
|
+
return 'number'
|
|
24
|
+
case '[object Null]':
|
|
25
|
+
return 'null'
|
|
26
|
+
case '[object Boolean]':
|
|
27
|
+
return 'boolean'
|
|
28
|
+
case '[object Undefind]':
|
|
29
|
+
return 'undefind'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const isObject = (tar) => {
|
|
34
|
+
return getInstanceType(tar) === 'object'
|
|
35
|
+
}
|
|
36
|
+
export const isFunction = (tar) => {
|
|
37
|
+
return getInstanceType(tar) === 'function'
|
|
38
|
+
}
|
|
39
|
+
export const isString = (tar) => {
|
|
40
|
+
return getInstanceType(tar) === 'string'
|
|
41
|
+
}
|
|
42
|
+
export const isNumber = (tar) => {
|
|
43
|
+
return getInstanceType(tar) === 'number'
|
|
44
|
+
}
|
|
45
|
+
export const isNull = (tar) => {
|
|
46
|
+
return getInstanceType(tar) === 'null'
|
|
47
|
+
}
|
|
48
|
+
export const isBoolean = (tar) => {
|
|
49
|
+
return getInstanceType(tar) === 'boolean'
|
|
50
|
+
}
|
|
51
|
+
export const isUndefind = (tar) => {
|
|
52
|
+
return getInstanceType(tar) === 'undefind'
|
|
53
|
+
}
|