@bsgoal/common 2.0.0 → 2.5.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 +3020 -2741
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +13 -13
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/bsgoal-base-item/demo.vue +50 -0
- package/src/components/bsgoal-base-item/index.vue +59 -0
- package/src/components/bsgoal-base-select/demo.vue +58 -0
- package/src/components/bsgoal-base-select/index.vue +90 -0
- package/src/components/bsgoal-base-switch/demo.vue +39 -0
- package/src/components/bsgoal-base-switch/index.vue +76 -0
- package/src/components/bsgoal-base-time/demo.vue +38 -0
- package/src/components/bsgoal-base-time/index.vue +114 -0
- package/src/components/bsgoal-base-time-range/demo.vue +48 -0
- package/src/components/bsgoal-base-time-range/index.vue +142 -0
- package/src/entry.js +11 -1
- package/src/router/index.js +26 -1
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-form .base_form--visible{width:0px;height:0px;overflow:hidden}.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}.bsgoal-base-button,.bsgoal-base-button .base_button{display:inline-block}.bsgoal-base-alert .el-alert{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}
|
|
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-form .base_form--visible{width:0px;height:0px;overflow:hidden}.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}.bsgoal-base-button,.bsgoal-base-button .base_button{display:inline-block}.bsgoal-base-alert .el-alert,.bsgoal-base-item .base_item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bsgoal-base-item .base_item_label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:inherit;color:#606266;height:32px;line-height:32px;padding-right:12px}
|
package/package.json
CHANGED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-05-24 17:46:26
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-05-24 18:05:46
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-item\demo.vue
|
|
7
|
+
* @Description: 表单项 演示
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
/* setup模板
|
|
13
|
+
---------------------------------------------------------------- */
|
|
14
|
+
import { ref } from 'vue'
|
|
15
|
+
import BsgoalBaseItem from './index.vue'
|
|
16
|
+
import BsgoalBaseSwitch from '../bsgoal-base-switch/index.vue';
|
|
17
|
+
const props = defineProps({})
|
|
18
|
+
|
|
19
|
+
</script>
|
|
20
|
+
<script>
|
|
21
|
+
export default {
|
|
22
|
+
name: 'BsgoalBaseItemDemo'
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const switchModelValue = ref('0')
|
|
26
|
+
</script>
|
|
27
|
+
<template>
|
|
28
|
+
<div class="bsgoal-base-item-demo">
|
|
29
|
+
<div class="base_item_demo">
|
|
30
|
+
<BsgoalBaseItem>
|
|
31
|
+
<template #label>
|
|
32
|
+
<div>是否开通接听值班表设置</div>
|
|
33
|
+
</template>
|
|
34
|
+
<template #content>
|
|
35
|
+
<div>
|
|
36
|
+
<BsgoalBaseSwitch v-model="switchModelValue" />
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
</BsgoalBaseItem>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
<style lang="scss" scoped>
|
|
44
|
+
/* 自定义样式
|
|
45
|
+
---------------------------------------------------------------- */
|
|
46
|
+
</style>
|
|
47
|
+
<style lang="scss">
|
|
48
|
+
/* 覆盖样式
|
|
49
|
+
---------------------------------------------------------------- */
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-05-24 17:46:21
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-05-24 18:08:53
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-item\index.vue
|
|
7
|
+
* @Description: 表单项
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
<script setup>
|
|
11
|
+
/* setup模板
|
|
12
|
+
---------------------------------------------------------------- */
|
|
13
|
+
import { ref } from 'vue'
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
/**
|
|
16
|
+
* label 后缀
|
|
17
|
+
*/
|
|
18
|
+
suffix: {
|
|
19
|
+
type: [String],
|
|
20
|
+
default: ':'
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
</script>
|
|
24
|
+
<script>
|
|
25
|
+
export default {
|
|
26
|
+
name: 'BsgoalBaseItem'
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
<template>
|
|
30
|
+
<div class="bsgoal-base-item">
|
|
31
|
+
<div class="base_item">
|
|
32
|
+
<div class="base_item_label">
|
|
33
|
+
<slot name="label"> </slot> <span>{{ suffix }}</span>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="base_item_contetn">
|
|
36
|
+
<slot name="content"></slot>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
<style lang="scss">
|
|
42
|
+
/* 覆盖样式
|
|
43
|
+
---------------------------------------------------------------- */
|
|
44
|
+
.bsgoal-base-item {
|
|
45
|
+
.base_item {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
}
|
|
49
|
+
.base_item_label {
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
font-size: inherit;
|
|
53
|
+
color: #606266;
|
|
54
|
+
height: 32px;
|
|
55
|
+
line-height: 32px;
|
|
56
|
+
padding-right: 12px;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
</style>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-05-24 11:10:09
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-05-24 14:07:27
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-select\demo.vue
|
|
7
|
+
* @Description: select 演示
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
/* setup模板
|
|
13
|
+
---------------------------------------------------------------- */
|
|
14
|
+
import { ref } from 'vue'
|
|
15
|
+
import BsgoalBaseSelect from './index.vue'
|
|
16
|
+
|
|
17
|
+
const props = defineProps({})
|
|
18
|
+
|
|
19
|
+
const selectValue = ref('11')
|
|
20
|
+
const selectRange = ref([
|
|
21
|
+
{
|
|
22
|
+
label : '11' ,
|
|
23
|
+
value : '11'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label : '22' ,
|
|
27
|
+
value : '22'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label : '33' ,
|
|
31
|
+
value : '33'
|
|
32
|
+
},
|
|
33
|
+
])
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
</script>
|
|
38
|
+
<script>
|
|
39
|
+
export default {
|
|
40
|
+
name: 'BsgoalBaseSelectDemo'
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
<template>
|
|
44
|
+
<div class="bsgoal-base-select-demo">
|
|
45
|
+
<div class="base_select_demo">
|
|
46
|
+
{{ selectValue }}
|
|
47
|
+
<BsgoalBaseSelect v-model="selectValue" :range="selectRange" />
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
<style lang="scss" scoped>
|
|
52
|
+
/* 自定义样式
|
|
53
|
+
---------------------------------------------------------------- */
|
|
54
|
+
</style>
|
|
55
|
+
<style lang="scss">
|
|
56
|
+
/* 覆盖样式
|
|
57
|
+
---------------------------------------------------------------- */
|
|
58
|
+
</style>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-05-24 11:09:59
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-05-24 14:07:10
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-select\index.vue
|
|
7
|
+
* @Description: Select 公共组件
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
/* setup模板
|
|
13
|
+
---------------------------------------------------------------- */
|
|
14
|
+
import { ref } from 'vue'
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
/**
|
|
17
|
+
* 占位提示符
|
|
18
|
+
*/
|
|
19
|
+
placeholder: {
|
|
20
|
+
type: [String],
|
|
21
|
+
default: '请选择'
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* 可选范围 { label : '' , value : ''}
|
|
25
|
+
*/
|
|
26
|
+
range: {
|
|
27
|
+
type: [Array],
|
|
28
|
+
default: () => []
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* value
|
|
32
|
+
*/
|
|
33
|
+
modelValue: {
|
|
34
|
+
type: [],
|
|
35
|
+
default: ''
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* 无数据提示
|
|
39
|
+
*/
|
|
40
|
+
none: {
|
|
41
|
+
type: [String],
|
|
42
|
+
default: '暂无数据'
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const emits = defineEmits(['update:modelValue'])
|
|
47
|
+
|
|
48
|
+
// ---> S 触发 方法 <---
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @Author: canlong.shen
|
|
52
|
+
* @description: 触发 change
|
|
53
|
+
* @default:
|
|
54
|
+
* @return {*}
|
|
55
|
+
*/
|
|
56
|
+
const triggerChange = (value = '') => {
|
|
57
|
+
emits('update:modelValue', value)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// ---> E 触发 方法 <---
|
|
61
|
+
</script>
|
|
62
|
+
<script>
|
|
63
|
+
export default {
|
|
64
|
+
name: 'BsgoalBaseSelect'
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
67
|
+
<template>
|
|
68
|
+
<div class="bsgoal-base-select">
|
|
69
|
+
<el-select
|
|
70
|
+
clearable
|
|
71
|
+
class="base_select"
|
|
72
|
+
:model-value="modelValue"
|
|
73
|
+
:no-data-text="none"
|
|
74
|
+
:placeholder="placeholder"
|
|
75
|
+
@change="triggerChange"
|
|
76
|
+
>
|
|
77
|
+
<template v-for="({ label = '', value = '' }, key) of range" :key="key">
|
|
78
|
+
<el-option :label="label" :value="value"></el-option>
|
|
79
|
+
</template>
|
|
80
|
+
</el-select>
|
|
81
|
+
</div>
|
|
82
|
+
</template>
|
|
83
|
+
<style lang="scss" scoped>
|
|
84
|
+
/* 自定义样式
|
|
85
|
+
---------------------------------------------------------------- */
|
|
86
|
+
</style>
|
|
87
|
+
<style lang="scss">
|
|
88
|
+
/* 覆盖样式
|
|
89
|
+
---------------------------------------------------------------- */
|
|
90
|
+
</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-05-24 17:20:47
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-05-24 17:43:05
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-switch\demo.vue
|
|
7
|
+
* @Description: 开关 公共组件 演示
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
<script setup>
|
|
11
|
+
/* setup模板
|
|
12
|
+
---------------------------------------------------------------- */
|
|
13
|
+
import { ref } from 'vue'
|
|
14
|
+
import BsgoalBaseSwitch from './index.vue'
|
|
15
|
+
const props = defineProps({})
|
|
16
|
+
|
|
17
|
+
const modelValue = ref('0')
|
|
18
|
+
</script>
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
name: 'BsgoalBaseSwitchDemo'
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
<template>
|
|
25
|
+
<div class="bsgoal-base-switch-demo">
|
|
26
|
+
<div class="base_switch_demo">
|
|
27
|
+
{{ modelValue }}
|
|
28
|
+
<BsgoalBaseSwitch v-model="modelValue" />
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
<style lang="scss" scoped>
|
|
33
|
+
/* 自定义样式
|
|
34
|
+
---------------------------------------------------------------- */
|
|
35
|
+
</style>
|
|
36
|
+
<style lang="scss">
|
|
37
|
+
/* 覆盖样式
|
|
38
|
+
---------------------------------------------------------------- */
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-05-24 17:20:40
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-05-24 17:44:16
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-switch\index.vue
|
|
7
|
+
* @Description: switch 开关
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
/* setup模板
|
|
13
|
+
---------------------------------------------------------------- */
|
|
14
|
+
import { ref } from 'vue'
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
/**
|
|
17
|
+
* text 配置 选项
|
|
18
|
+
*/
|
|
19
|
+
textRange: {
|
|
20
|
+
type: [Array],
|
|
21
|
+
default: () => ['是', '否']
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* value 配置 选项
|
|
25
|
+
*/
|
|
26
|
+
valueRange: {
|
|
27
|
+
type: [Array],
|
|
28
|
+
default: () => ['1', '0']
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* value
|
|
32
|
+
*/
|
|
33
|
+
modelValue: {
|
|
34
|
+
type: [],
|
|
35
|
+
default: ''
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
const emits = defineEmits(['update:modelValue'])
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @Author: canlong.shen
|
|
42
|
+
* @description: 触发 值变化
|
|
43
|
+
* @default:
|
|
44
|
+
* @return {*}
|
|
45
|
+
*/
|
|
46
|
+
const triggerChange = (value = '') => {
|
|
47
|
+
emits('update:modelValue', value)
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<script>
|
|
52
|
+
export default {
|
|
53
|
+
name: 'BsgoalBaseSwitch'
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
<template>
|
|
57
|
+
<div class="bsgoal-base-switch">
|
|
58
|
+
<el-switch
|
|
59
|
+
class="base_switch"
|
|
60
|
+
:model-value="modelValue"
|
|
61
|
+
:active-value="valueRange[0]"
|
|
62
|
+
:inactive-value="valueRange[1]"
|
|
63
|
+
:active-text="textRange[0]"
|
|
64
|
+
:inactive-text="textRange[1]"
|
|
65
|
+
@change="triggerChange"
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
<style lang="scss" scoped>
|
|
70
|
+
/* 自定义样式
|
|
71
|
+
---------------------------------------------------------------- */
|
|
72
|
+
</style>
|
|
73
|
+
<style lang="scss">
|
|
74
|
+
/* 覆盖样式
|
|
75
|
+
---------------------------------------------------------------- */
|
|
76
|
+
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-05-24 14:58:50
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-05-24 15:37:12
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-time\demo.vue
|
|
7
|
+
* @Description: 时间选择器
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
<script setup>
|
|
11
|
+
/* setup模板
|
|
12
|
+
---------------------------------------------------------------- */
|
|
13
|
+
import { ref } from 'vue'
|
|
14
|
+
import BsgoalBaseTime from './index.vue'
|
|
15
|
+
const props = defineProps({})
|
|
16
|
+
const time = ref('11:22')
|
|
17
|
+
</script>
|
|
18
|
+
<script>
|
|
19
|
+
export default {
|
|
20
|
+
name: 'BsgoalBaseTimeDemo'
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
<template>
|
|
24
|
+
<div class="bsgoal-base-time-demo">
|
|
25
|
+
<div class="base_time_demo">
|
|
26
|
+
{{ time }}
|
|
27
|
+
<BsgoalBaseTime v-model="time" />
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
<style lang="scss" scoped>
|
|
32
|
+
/* 自定义样式
|
|
33
|
+
---------------------------------------------------------------- */
|
|
34
|
+
</style>
|
|
35
|
+
<style lang="scss">
|
|
36
|
+
/* 覆盖样式
|
|
37
|
+
---------------------------------------------------------------- */
|
|
38
|
+
</style>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-05-24 14:58:44
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-05-24 16:36:56
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-time\index.vue
|
|
7
|
+
* @Description: 时间选择器
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
/* setup模板
|
|
13
|
+
---------------------------------------------------------------- */
|
|
14
|
+
import { ref, unref, watchEffect } from 'vue'
|
|
15
|
+
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|
16
|
+
import { dayjs } from 'element-plus'
|
|
17
|
+
const emits = defineEmits(['update:modelValue'])
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
/**
|
|
20
|
+
* 绑定的值
|
|
21
|
+
*/
|
|
22
|
+
modelValue: {
|
|
23
|
+
type: [String],
|
|
24
|
+
default: ''
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* 提示占位符
|
|
28
|
+
*/
|
|
29
|
+
placeholder: {
|
|
30
|
+
type: [String],
|
|
31
|
+
default: '请选择'
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* 格式 HH:mm:ss
|
|
35
|
+
*/
|
|
36
|
+
format: {
|
|
37
|
+
type: [String],
|
|
38
|
+
default: 'HH:mm'
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
// ---> S 绑定值 <---
|
|
43
|
+
|
|
44
|
+
const bindValue = ref()
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @Author: canlong.shen
|
|
48
|
+
* @description: 转换 字符串 time 为 Date
|
|
49
|
+
* @default:
|
|
50
|
+
* @return {*}
|
|
51
|
+
*/
|
|
52
|
+
const stringToDate = (timeString = '') => {
|
|
53
|
+
return dayjs(`0000-00-00 ${timeString}`)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @Author: canlong.shen
|
|
58
|
+
* @description: 格式化 Date 为 time 字符串
|
|
59
|
+
* @default:
|
|
60
|
+
* @return {*}
|
|
61
|
+
*/
|
|
62
|
+
const dateToString = (date = new Date()) => {
|
|
63
|
+
return dayjs(date).format(props.format)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
watchEffect(() => {
|
|
67
|
+
const { modelValue } = props
|
|
68
|
+
const timeValue = unref(modelValue)
|
|
69
|
+
if (timeValue) {
|
|
70
|
+
bindValue.value = stringToDate(timeValue)
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @Author: canlong.shen
|
|
76
|
+
* @description: 触发 值变化
|
|
77
|
+
* @default:
|
|
78
|
+
* @return {*}
|
|
79
|
+
*/
|
|
80
|
+
const triggerChange = (date = new Date()) => {
|
|
81
|
+
const formatValue = dateToString(date)
|
|
82
|
+
emits('update:modelValue', formatValue)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// ---> E 绑定值 <---
|
|
86
|
+
</script>
|
|
87
|
+
|
|
88
|
+
<script>
|
|
89
|
+
export default {
|
|
90
|
+
name: 'BsgoalBaseTime'
|
|
91
|
+
}
|
|
92
|
+
</script>
|
|
93
|
+
<template>
|
|
94
|
+
<div class="bsgoal-base-time">
|
|
95
|
+
<el-config-provider :locale="zhCn">
|
|
96
|
+
<el-time-picker
|
|
97
|
+
v-model="bindValue"
|
|
98
|
+
class="base_time"
|
|
99
|
+
:format="format"
|
|
100
|
+
:clearable="false"
|
|
101
|
+
:placeholder="placeholder"
|
|
102
|
+
@change="triggerChange"
|
|
103
|
+
/>
|
|
104
|
+
</el-config-provider>
|
|
105
|
+
</div>
|
|
106
|
+
</template>
|
|
107
|
+
<style lang="scss" scoped>
|
|
108
|
+
/* 自定义样式
|
|
109
|
+
---------------------------------------------------------------- */
|
|
110
|
+
</style>
|
|
111
|
+
<style lang="scss">
|
|
112
|
+
/* 覆盖样式
|
|
113
|
+
---------------------------------------------------------------- */
|
|
114
|
+
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-05-24 14:10:03
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-05-24 16:40:42
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-time-range\demo.vue
|
|
7
|
+
* @Description: 时间选择 演示
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
/* setup模板
|
|
13
|
+
---------------------------------------------------------------- */
|
|
14
|
+
import { ref } from 'vue'
|
|
15
|
+
import BsgoalBaseTimeRange from './index.vue'
|
|
16
|
+
const props = defineProps({})
|
|
17
|
+
|
|
18
|
+
const timeRange = ref(['11:00', '12:12'])
|
|
19
|
+
|
|
20
|
+
const startTime = ref('12:11')
|
|
21
|
+
const endTime = ref('13:55')
|
|
22
|
+
</script>
|
|
23
|
+
<script>
|
|
24
|
+
export default {
|
|
25
|
+
name: 'BsgoalBaseTimeDemoRange'
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
<template>
|
|
29
|
+
<div class="bsgoal-base-time-range-demo">
|
|
30
|
+
<div>{{ timeRange }}</div>
|
|
31
|
+
<div>{{ startTime }}</div>
|
|
32
|
+
<div>{{ endTime }}</div>
|
|
33
|
+
<BsgoalBaseTimeRange
|
|
34
|
+
v-model:startTime="startTime"
|
|
35
|
+
v-model:endTime="endTime"
|
|
36
|
+
v-model="timeRange"
|
|
37
|
+
class="base_time_range_demo"
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
<style lang="scss" scoped>
|
|
42
|
+
/* 自定义样式
|
|
43
|
+
---------------------------------------------------------------- */
|
|
44
|
+
</style>
|
|
45
|
+
<style lang="scss">
|
|
46
|
+
/* 覆盖样式
|
|
47
|
+
---------------------------------------------------------------- */
|
|
48
|
+
</style>
|