@bsgoal/common 1.0.3 → 1.1.0
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 +487 -413
- 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/components/bsgoal-base-cascader/demo.vue +317 -0
- package/src/components/bsgoal-base-cascader/index.vue +93 -0
- package/src/components/bsgoal-base-search/demo.vue +179 -159
- package/src/components/bsgoal-base-search/index.vue +22 -2
- package/src/enums/enumType.js +3 -2
- package/src/router/index.js +6 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-13 09:38:19
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-04-
|
|
5
|
+
* @LastEditTime: 2023-04-25 16:31:56
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-search\demo.vue
|
|
7
7
|
* @Description: 表格查询组件演示
|
|
8
8
|
*
|
|
@@ -10,182 +10,202 @@
|
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
12
|
export default {
|
|
13
|
-
|
|
14
|
-
}
|
|
13
|
+
name: 'BsgoalBaseSearchDemo'
|
|
14
|
+
}
|
|
15
15
|
</script>
|
|
16
16
|
<script setup>
|
|
17
17
|
/* setup模板
|
|
18
18
|
---------------------------------------------------------------- */
|
|
19
|
-
import { ref } from 'vue'
|
|
19
|
+
import { ref } from 'vue'
|
|
20
20
|
import BsgoalBaseSearch from './index.vue'
|
|
21
21
|
import EnumType from '../../enums/enumType.js'
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
const props = defineProps({
|
|
23
|
+
const searchModelValue = ref({})
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
// props
|
|
26
|
+
const props = defineProps({})
|
|
27
27
|
let curLocalOptions = ref([
|
|
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
|
-
|
|
28
|
+
{
|
|
29
|
+
label: 'prop1',
|
|
30
|
+
// value: '111',
|
|
31
|
+
prop: 'prop1',
|
|
32
|
+
type: EnumType.INPUT
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'prop2',
|
|
36
|
+
value: 'select2',
|
|
37
|
+
type: EnumType.SELECT,
|
|
38
|
+
prop: 'prop2',
|
|
39
|
+
range: [
|
|
40
|
+
{
|
|
41
|
+
label: 'select1',
|
|
42
|
+
value: 'select1'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: 'select2',
|
|
46
|
+
value: 'select2'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: 'select3',
|
|
50
|
+
value: 'select3'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: 'select4',
|
|
54
|
+
value: 'select5'
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: 'prop3',
|
|
60
|
+
// value: '111',
|
|
61
|
+
type: EnumType.SLIDER,
|
|
62
|
+
prop: 'prop3'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: 'prop4',
|
|
66
|
+
// value: '111',
|
|
67
|
+
type: EnumType.SWITCH,
|
|
68
|
+
prop: 'prop4'
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: 'prop5',
|
|
72
|
+
// value: '111',
|
|
73
|
+
type: EnumType.RADIO,
|
|
74
|
+
prop: 'prop5',
|
|
75
|
+
range: [
|
|
76
|
+
{
|
|
77
|
+
label: 'radio1',
|
|
78
|
+
value: 'radio1'
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
label: 'radio2',
|
|
82
|
+
value: 'radio2'
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
label: 'prop6',
|
|
88
|
+
value: [],
|
|
89
|
+
type: EnumType.CHECKBOX,
|
|
90
|
+
prop: 'prop6',
|
|
91
|
+
range: [
|
|
92
|
+
{
|
|
93
|
+
label: 'checkbox1',
|
|
94
|
+
value: 'checkbox1'
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
label: 'checkbox2',
|
|
98
|
+
value: 'checkbox2'
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
label: 'prop7',
|
|
104
|
+
// value: '111',
|
|
105
|
+
type: EnumType.DATE,
|
|
106
|
+
prop: 'prop7',
|
|
107
|
+
format: 'YYYY-MM-DD'
|
|
108
|
+
},
|
|
109
|
+
// {
|
|
110
|
+
// label: 'prop8',
|
|
111
|
+
// // value: '111',
|
|
112
|
+
// type: EnumType.WEEK,
|
|
113
|
+
// prop: 'prop8'
|
|
88
114
|
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
//
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
label: 'prop16',
|
|
169
|
-
// value: '111',
|
|
170
|
-
type: EnumType.DATE_TIME_RANGE,
|
|
171
|
-
prop: 'prop16'
|
|
172
|
-
},
|
|
115
|
+
// },
|
|
116
|
+
{
|
|
117
|
+
label: 'prop9',
|
|
118
|
+
// value: '111',
|
|
119
|
+
type: EnumType.MONTH,
|
|
120
|
+
prop: 'prop9'
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
label: 'prop10',
|
|
124
|
+
// value: '111',
|
|
125
|
+
type: EnumType.YEAR,
|
|
126
|
+
prop: 'prop10'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
label: 'prop11',
|
|
130
|
+
// value: '111',
|
|
131
|
+
type: EnumType.DATE_RANGE,
|
|
132
|
+
prop: 'prop11',
|
|
133
|
+
range: ['startDate', 'endDate']
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
label: 'prop12',
|
|
137
|
+
// value: '111',
|
|
138
|
+
type: EnumType.MONTH_RANGE,
|
|
139
|
+
prop: 'prop12'
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
label: 'prop13',
|
|
143
|
+
// value: '111',
|
|
144
|
+
type: EnumType.TIME,
|
|
145
|
+
prop: 'prop13'
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
label: 'prop14',
|
|
149
|
+
// value: '111',
|
|
150
|
+
type: EnumType.TIME_RANGE,
|
|
151
|
+
prop: 'prop14'
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
label: 'prop15',
|
|
155
|
+
// value: '111',
|
|
156
|
+
type: EnumType.DATE_TIME,
|
|
157
|
+
prop: 'prop15'
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
label: 'prop16',
|
|
161
|
+
// value: '111',
|
|
162
|
+
type: EnumType.DATE_TIME_RANGE,
|
|
163
|
+
prop: 'prop16'
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
label: 'prop17',
|
|
167
|
+
type: EnumType.CASCADER,
|
|
168
|
+
prop: 'prop17',
|
|
169
|
+
range: [
|
|
170
|
+
{
|
|
171
|
+
label: 'value1',
|
|
172
|
+
value: 'value1',
|
|
173
|
+
children: [
|
|
174
|
+
{
|
|
175
|
+
label: 'value1-1',
|
|
176
|
+
value: 'value1-1'
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
label: 'value1-2',
|
|
180
|
+
value: 'value1-2'
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
label: 'value1-3',
|
|
184
|
+
value: 'value1-3'
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
label: 'value1-4',
|
|
188
|
+
value: 'value1-5'
|
|
189
|
+
},
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
}
|
|
173
194
|
])
|
|
174
195
|
const test = () => {
|
|
175
|
-
|
|
196
|
+
curLocalOptions.value = [111]
|
|
176
197
|
}
|
|
177
198
|
|
|
178
|
-
|
|
179
199
|
const curInputModel = ref({
|
|
180
|
-
|
|
200
|
+
prop: '1'
|
|
181
201
|
})
|
|
182
|
-
|
|
183
202
|
</script>
|
|
184
203
|
<template>
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
204
|
+
<div class="bsgoal-base-search_demo">
|
|
205
|
+
{{ searchModelValue }}
|
|
206
|
+
<BsgoalBaseSearch :config-options="curLocalOptions" v-model="searchModelValue" />
|
|
207
|
+
<el-button @click="test">点击按钮</el-button>
|
|
208
|
+
</div>
|
|
189
209
|
</template>
|
|
190
210
|
<style lang="scss" scoped>
|
|
191
211
|
/* 自定义样式
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-13 09:38:11
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-04-
|
|
5
|
+
* @LastEditTime: 2023-04-25 16:37:27
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-search\index.vue
|
|
7
7
|
* @Description: 表格查询 公共组件
|
|
8
8
|
*
|
|
@@ -21,6 +21,7 @@ import EnumType from '../../enums/enumType.js'
|
|
|
21
21
|
import baseDirective from '../../directives/directiveBase.js'
|
|
22
22
|
import BsgoalBaseLine from '../bsgoal-base-line/index.vue'
|
|
23
23
|
import BsgoalBaseSearchOperation from '../bsgoal-base-search-operation/index.vue'
|
|
24
|
+
import BsgoalBaseCascader from '../bsgoal-base-cascader/index.vue'
|
|
24
25
|
|
|
25
26
|
// props
|
|
26
27
|
const props = defineProps({
|
|
@@ -53,6 +54,13 @@ const props = defineProps({
|
|
|
53
54
|
medium: {
|
|
54
55
|
type: [Number, String],
|
|
55
56
|
default: 6
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* 绑定的值
|
|
60
|
+
*/
|
|
61
|
+
modelValue: {
|
|
62
|
+
type: [Object],
|
|
63
|
+
default: () => ({})
|
|
56
64
|
}
|
|
57
65
|
})
|
|
58
66
|
|
|
@@ -124,6 +132,7 @@ const placeholderSet = (type = '', label = '', placeholder = '') => {
|
|
|
124
132
|
case EnumType.YEAR:
|
|
125
133
|
case EnumType.DATE_TIME:
|
|
126
134
|
case EnumType.TIME:
|
|
135
|
+
case EnumType.CASCADER:
|
|
127
136
|
return `请选择${label}`
|
|
128
137
|
case EnumType.DATE_RANGE:
|
|
129
138
|
case EnumType.DATE_TIME_RANGE:
|
|
@@ -196,6 +205,7 @@ const triggerOperationSearch = () => {
|
|
|
196
205
|
}
|
|
197
206
|
}
|
|
198
207
|
emits('on-search', modelValue)
|
|
208
|
+
emits('update:modelValue', modelValue)
|
|
199
209
|
}
|
|
200
210
|
// 默认查询一次
|
|
201
211
|
nextTick(() => {
|
|
@@ -267,7 +277,7 @@ const triggerValueChange = (type, prop) => {
|
|
|
267
277
|
min = 1,
|
|
268
278
|
max = 10,
|
|
269
279
|
range = [],
|
|
270
|
-
format = ''
|
|
280
|
+
format = '',
|
|
271
281
|
} = {},
|
|
272
282
|
index
|
|
273
283
|
) of configOptionsGet"
|
|
@@ -430,6 +440,16 @@ const triggerValueChange = (type, prop) => {
|
|
|
430
440
|
</el-checkbox-group>
|
|
431
441
|
</template>
|
|
432
442
|
<!-- / 复选框 -->
|
|
443
|
+
<!-- / 级联选择器 -->
|
|
444
|
+
<template v-if="[EnumType.CASCADER].includes(type)">
|
|
445
|
+
<BsgoalBaseCascader
|
|
446
|
+
v-model="model[prop]"
|
|
447
|
+
:data-options="range"
|
|
448
|
+
:placeholder="placeholderSet(type, label, placeholder)"
|
|
449
|
+
@on-change="triggerValueChange(type, prop)"
|
|
450
|
+
/>
|
|
451
|
+
</template>
|
|
452
|
+
<!-- / 级联选择器 -->
|
|
433
453
|
<!-- / 模板 -->
|
|
434
454
|
<template v-if="[].includes(type)"> </template>
|
|
435
455
|
<!-- / 模板 -->
|
package/src/enums/enumType.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-13 16:20:09
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-04-
|
|
5
|
+
* @LastEditTime: 2023-04-25 16:05:15
|
|
6
6
|
* @FilePath: \common\src\enums\enumType.js
|
|
7
7
|
* @Description: 组件类型 枚举
|
|
8
8
|
*
|
|
@@ -27,5 +27,6 @@ export default {
|
|
|
27
27
|
TIME_RANGE: 'timerange',
|
|
28
28
|
DATE_TIME: 'datetime',
|
|
29
29
|
DATE_TIME_RANGE: 'datetimerange',
|
|
30
|
-
OPERATION: 'operation'
|
|
30
|
+
OPERATION: 'operation',
|
|
31
|
+
CASCADER: 'cascader',
|
|
31
32
|
}
|
package/src/router/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-10 10:41:52
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-04-
|
|
5
|
+
* @LastEditTime: 2023-04-25 15:44:05
|
|
6
6
|
* @FilePath: \common\src\router\index.js
|
|
7
7
|
* @Description: 路由配置
|
|
8
8
|
*
|
|
@@ -58,6 +58,11 @@ const router = createRouter({
|
|
|
58
58
|
name: '弹窗公共组件',
|
|
59
59
|
component: import('@/components/bsgoal-base-dialog/demo.vue')
|
|
60
60
|
},
|
|
61
|
+
{
|
|
62
|
+
path: '/bsgoal-base-cascader-demo',
|
|
63
|
+
name: '级联选择公共组件',
|
|
64
|
+
component: import('@/components/bsgoal-base-cascader/demo.vue')
|
|
65
|
+
},
|
|
61
66
|
]
|
|
62
67
|
}
|
|
63
68
|
]
|