@bsgoal/common 2.16.4 → 2.17.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 +812 -798
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +6 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -3
- package/src/App.vue +0 -9
- package/src/combines/useComs.js +0 -41
- package/src/combines/useFetchs.js +0 -55
- package/src/components/bsgoal-baes-popover/demo.vue +0 -35
- package/src/components/bsgoal-baes-popover/index.vue +0 -66
- package/src/components/bsgoal-base-alert/demo.vue +0 -39
- package/src/components/bsgoal-base-alert/index.vue +0 -49
- package/src/components/bsgoal-base-button/demo.vue +0 -54
- package/src/components/bsgoal-base-button/index.vue +0 -166
- package/src/components/bsgoal-base-cascader/demo.vue +0 -128
- package/src/components/bsgoal-base-cascader/index.vue +0 -95
- package/src/components/bsgoal-base-dialog/demo.vue +0 -350
- package/src/components/bsgoal-base-dialog/index.vue +0 -260
- package/src/components/bsgoal-base-form/demo.vue +0 -289
- package/src/components/bsgoal-base-form/index.vue +0 -723
- package/src/components/bsgoal-base-frame/demo.vue +0 -35
- package/src/components/bsgoal-base-frame/index.vue +0 -28
- package/src/components/bsgoal-base-input/demo.vue +0 -48
- package/src/components/bsgoal-base-input/index.vue +0 -150
- package/src/components/bsgoal-base-item/demo.vue +0 -46
- package/src/components/bsgoal-base-item/index.vue +0 -66
- package/src/components/bsgoal-base-layout/demo.vue +0 -48
- package/src/components/bsgoal-base-layout/index.vue +0 -57
- package/src/components/bsgoal-base-line/demo.vue +0 -41
- package/src/components/bsgoal-base-line/index.vue +0 -70
- package/src/components/bsgoal-base-link/demo.vue +0 -38
- package/src/components/bsgoal-base-link/index.vue +0 -73
- package/src/components/bsgoal-base-search/demo.vue +0 -215
- package/src/components/bsgoal-base-search/index.vue +0 -534
- package/src/components/bsgoal-base-search-operation/index.vue +0 -77
- package/src/components/bsgoal-base-search-table/demo.vue +0 -784
- package/src/components/bsgoal-base-search-table/index.vue +0 -291
- package/src/components/bsgoal-base-select/demo.vue +0 -71
- package/src/components/bsgoal-base-select/index.vue +0 -111
- package/src/components/bsgoal-base-sizes/demo.vue +0 -34
- package/src/components/bsgoal-base-sizes/index.vue +0 -178
- package/src/components/bsgoal-base-switch/demo.vue +0 -39
- package/src/components/bsgoal-base-switch/index.vue +0 -76
- package/src/components/bsgoal-base-table/demo.vue +0 -302
- package/src/components/bsgoal-base-table/index.vue +0 -461
- package/src/components/bsgoal-base-table-content/index.vue +0 -64
- package/src/components/bsgoal-base-table-empty/demo.vue +0 -37
- package/src/components/bsgoal-base-table-empty/index.vue +0 -48
- package/src/components/bsgoal-base-table-pagination/demo.vue +0 -35
- package/src/components/bsgoal-base-table-pagination/index.vue +0 -110
- package/src/components/bsgoal-base-tabs/debug.log +0 -1
- package/src/components/bsgoal-base-tabs/demo.vue +0 -65
- package/src/components/bsgoal-base-tabs/index.vue +0 -122
- package/src/components/bsgoal-base-time/demo.vue +0 -69
- package/src/components/bsgoal-base-time/index.vue +0 -177
- package/src/components/bsgoal-base-time-range/demo.vue +0 -62
- package/src/components/bsgoal-base-time-range/index.vue +0 -170
- package/src/components/bsgoal-base-tooltip/demo.vue +0 -38
- package/src/components/bsgoal-base-tooltip/index.vue +0 -103
- package/src/components/bsgoal-base-tree/demo.vue +0 -141
- package/src/components/bsgoal-base-tree/index.vue +0 -286
- package/src/components/bsgoal-base-tree-fold/index.vue +0 -64
- package/src/components/bsgoal-base-tree-table/debug.log +0 -1
- package/src/components/bsgoal-base-tree-table/demo.vue +0 -859
- package/src/components/bsgoal-base-tree-table/index.vue +0 -351
- package/src/components/bsgoal-base-viewer/assets/upload_default.svg +0 -13
- package/src/components/bsgoal-base-viewer/demo.vue +0 -35
- package/src/components/bsgoal-base-viewer/index.vue +0 -66
- package/src/components/layout/layout-home.vue +0 -60
- package/src/components/layout/layout-left-menu.vue +0 -54
- package/src/components/layout/layout-right-container.vue +0 -39
- package/src/components/layout/layout-top-header.vue +0 -38
- package/src/debug.log +0 -1
- package/src/directives/directiveBase.js +0 -96
- package/src/entry.js +0 -77
- package/src/enums/componentTypeEnums.js +0 -35
- package/src/main.js +0 -11
- package/src/router/index.js +0 -161
- package/src/styles/index.css +0 -14
- package/src/utils/common.js +0 -56
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-04-15 16:34:57
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-06-28 10:12:16
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-base-table-pagination\index.vue
|
|
7
|
-
* @Description: 表格的分页按钮
|
|
8
|
-
*
|
|
9
|
-
-->
|
|
10
|
-
|
|
11
|
-
<script setup>
|
|
12
|
-
/* setup模板
|
|
13
|
-
---------------------------------------------------------------- */
|
|
14
|
-
import { ref, computed, inject, unref } from 'vue'
|
|
15
|
-
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|
16
|
-
import BsgoalBaseSizes from '../bsgoal-base-sizes/index.vue'
|
|
17
|
-
defineOptions({
|
|
18
|
-
name: 'BsgoalBaseTablePagination'
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
const props = defineProps({
|
|
22
|
-
/**
|
|
23
|
-
* 当前页数
|
|
24
|
-
*/
|
|
25
|
-
currentPage: {
|
|
26
|
-
type: [Number],
|
|
27
|
-
default: 1
|
|
28
|
-
},
|
|
29
|
-
/**
|
|
30
|
-
* 可选页数集合
|
|
31
|
-
*/
|
|
32
|
-
pageSizes: {
|
|
33
|
-
type: [Array],
|
|
34
|
-
default: () => [10, 20, 30, 40, 50, 100]
|
|
35
|
-
},
|
|
36
|
-
/**
|
|
37
|
-
* 每页显示条目个数
|
|
38
|
-
*/
|
|
39
|
-
pageSize: {
|
|
40
|
-
type: [Number],
|
|
41
|
-
default: 20
|
|
42
|
-
},
|
|
43
|
-
/**
|
|
44
|
-
* 总条目
|
|
45
|
-
*/
|
|
46
|
-
total: {
|
|
47
|
-
type: [Number],
|
|
48
|
-
default: 0
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
const emits = defineEmits(['on-size-change', 'on-current-change'])
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @Author: canlong.shen
|
|
56
|
-
* @description: page-size 改变时触发
|
|
57
|
-
* @default:
|
|
58
|
-
* @return {*}
|
|
59
|
-
*/
|
|
60
|
-
const triggerSizeChange = (size = 0) => {
|
|
61
|
-
emits('on-size-change', size)
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* @Author: canlong.shen
|
|
65
|
-
* @description: current-change
|
|
66
|
-
* @default:
|
|
67
|
-
* @return {*}
|
|
68
|
-
*/
|
|
69
|
-
const triggerCurrentChange = (current = 1) => {
|
|
70
|
-
emits('on-current-change', current)
|
|
71
|
-
}
|
|
72
|
-
const page = ref(1)
|
|
73
|
-
</script>
|
|
74
|
-
<template>
|
|
75
|
-
<div class="bsgoal-base-table-pagination">
|
|
76
|
-
<div class="base_table_pagination">
|
|
77
|
-
<el-config-provider :locale="zhCn">
|
|
78
|
-
<el-pagination
|
|
79
|
-
background
|
|
80
|
-
layout="total, slot, prev, pager, next, jumper"
|
|
81
|
-
v-model:current-page="page"
|
|
82
|
-
:page-sizes="pageSizes"
|
|
83
|
-
:page-size="pageSize"
|
|
84
|
-
:total="total"
|
|
85
|
-
@size-change="triggerSizeChange"
|
|
86
|
-
@current-change="triggerCurrentChange"
|
|
87
|
-
>
|
|
88
|
-
<template #default="">
|
|
89
|
-
<BsgoalBaseSizes
|
|
90
|
-
:page-sizes="pageSizes"
|
|
91
|
-
:page-size="pageSize"
|
|
92
|
-
@on-size-change="triggerSizeChange"
|
|
93
|
-
/>
|
|
94
|
-
</template>
|
|
95
|
-
</el-pagination>
|
|
96
|
-
</el-config-provider>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
</template>
|
|
100
|
-
<style lang="scss">
|
|
101
|
-
/* 覆盖样式
|
|
102
|
-
---------------------------------------------------------------- */
|
|
103
|
-
.bsgoal-base-table-pagination {
|
|
104
|
-
text-align: right;
|
|
105
|
-
.base_table_pagination {
|
|
106
|
-
display: inline-block;
|
|
107
|
-
margin-top: 16px;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
</style>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[0531/114341.801:ERROR:registration_protocol_win.cc(107)] CreateFile: ϵͳ�Ҳ���ָ�����ļ��� (0x2)
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-04-28 16:01:11
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-06-01 11:03:24
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-base-tabs\demo.vue
|
|
7
|
-
* @Description: tabs 标签切页 公共组件演示
|
|
8
|
-
-->
|
|
9
|
-
<script setup>
|
|
10
|
-
/* setup模板
|
|
11
|
-
---------------------------------------------------------------- */
|
|
12
|
-
import { ref } from 'vue'
|
|
13
|
-
import BsgoalBaseTabs from './index.vue'
|
|
14
|
-
|
|
15
|
-
defineOptions({
|
|
16
|
-
name: 'BsgoalBaseTabsDemo'
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
const props = defineProps({})
|
|
20
|
-
const activeTabName = ref('tab1')
|
|
21
|
-
const config = ref([
|
|
22
|
-
{
|
|
23
|
-
label: 'tab1',
|
|
24
|
-
value: 'tab1'
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
label: 'tab2',
|
|
28
|
-
value: 'tab2'
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
label: 'tab3',
|
|
32
|
-
value: 'tab3'
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
label: 'tab4',
|
|
36
|
-
value: 'tab4'
|
|
37
|
-
}
|
|
38
|
-
])
|
|
39
|
-
</script>
|
|
40
|
-
<template>
|
|
41
|
-
<div class="bsgoal-base-tabs-demo">
|
|
42
|
-
<div class="base_tabs_demo">
|
|
43
|
-
<BsgoalBaseTabs :config-options="config" stretch fill>
|
|
44
|
-
<template #tab1>
|
|
45
|
-
<div>这是 tab1</div>
|
|
46
|
-
</template>
|
|
47
|
-
</BsgoalBaseTabs>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
</template>
|
|
51
|
-
<style lang="scss" scoped>
|
|
52
|
-
/* 自定义样式
|
|
53
|
-
---------------------------------------------------------------- */
|
|
54
|
-
.base_tabs_demo {
|
|
55
|
-
position: absolute;
|
|
56
|
-
top: 0;
|
|
57
|
-
bottom: 0;
|
|
58
|
-
right: 0;
|
|
59
|
-
left: 0;
|
|
60
|
-
}
|
|
61
|
-
</style>
|
|
62
|
-
<style lang="scss">
|
|
63
|
-
/* 覆盖样式
|
|
64
|
-
---------------------------------------------------------------- */
|
|
65
|
-
</style>
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-04-28 16:01:06
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-06-01 10:43:54
|
|
6
|
-
* @FilePath: \common\src\components\bsgoal-base-tabs\index.vue
|
|
7
|
-
* @Description: tabs 标签页公共组件
|
|
8
|
-
*
|
|
9
|
-
-->
|
|
10
|
-
|
|
11
|
-
<script setup>
|
|
12
|
-
/* setup模板
|
|
13
|
-
---------------------------------------------------------------- */
|
|
14
|
-
import { ref, unref, computed } from 'vue'
|
|
15
|
-
|
|
16
|
-
defineOptions({
|
|
17
|
-
name: 'BsgoalBaseTabs'
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
const props = defineProps({
|
|
21
|
-
/**
|
|
22
|
-
* 配置项
|
|
23
|
-
* [
|
|
24
|
-
* {
|
|
25
|
-
* label: '' // 对应 label值
|
|
26
|
-
* value: '' // 对应 name值
|
|
27
|
-
* }
|
|
28
|
-
* ]
|
|
29
|
-
*/
|
|
30
|
-
configOptions: {
|
|
31
|
-
type: [Array],
|
|
32
|
-
default: () => []
|
|
33
|
-
},
|
|
34
|
-
/**
|
|
35
|
-
* 风格
|
|
36
|
-
* card : 卡片风格
|
|
37
|
-
* border-card : 带有边框的卡片风格
|
|
38
|
-
*/
|
|
39
|
-
type: {
|
|
40
|
-
type: [String],
|
|
41
|
-
default: '',
|
|
42
|
-
validator: (v) => ['card', 'border-card', ''].includes(v)
|
|
43
|
-
},
|
|
44
|
-
/**
|
|
45
|
-
* 组件绑定的值
|
|
46
|
-
*/
|
|
47
|
-
modelValue: {
|
|
48
|
-
type: [String],
|
|
49
|
-
default: ''
|
|
50
|
-
},
|
|
51
|
-
/**
|
|
52
|
-
* 是否自动撑开
|
|
53
|
-
*/
|
|
54
|
-
stretch: {
|
|
55
|
-
type: [Boolean],
|
|
56
|
-
default: false
|
|
57
|
-
},
|
|
58
|
-
/**
|
|
59
|
-
* fill 自动填满高度
|
|
60
|
-
*/
|
|
61
|
-
fill: {
|
|
62
|
-
type: [Boolean],
|
|
63
|
-
default: false
|
|
64
|
-
}
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
const emits = defineEmits(['update:modelValue'])
|
|
68
|
-
|
|
69
|
-
// ---> S modelValue Get <---
|
|
70
|
-
const modelValueGet = computed(() => {
|
|
71
|
-
const { modelValue = '', configOptions = [] } = props
|
|
72
|
-
const nameList = unref(configOptions).map((mi) => mi.value)
|
|
73
|
-
const actionName = unref(modelValue)
|
|
74
|
-
return actionName || nameList[0]
|
|
75
|
-
})
|
|
76
|
-
// ---> E modelValue Get <---
|
|
77
|
-
|
|
78
|
-
// ---> S tab的切换 <---
|
|
79
|
-
const changeTab = (activeValue = '') => {
|
|
80
|
-
emits('update:modelValue', activeValue)
|
|
81
|
-
}
|
|
82
|
-
// ---> E tab的切换 <---
|
|
83
|
-
</script>
|
|
84
|
-
<template>
|
|
85
|
-
<div class="bsgoal-base-tabs">
|
|
86
|
-
<el-tabs
|
|
87
|
-
class="base_tabs"
|
|
88
|
-
:class="{
|
|
89
|
-
'base_tabs--fill': fill
|
|
90
|
-
}"
|
|
91
|
-
:stretch="stretch"
|
|
92
|
-
:type="type"
|
|
93
|
-
:model-value="modelValueGet"
|
|
94
|
-
@tab-change="changeTab"
|
|
95
|
-
>
|
|
96
|
-
<template v-for="({ label, value }, key) of configOptions" :key="key">
|
|
97
|
-
<el-tab-pane :label="label" :name="value">
|
|
98
|
-
<slot :name="value">{{ label }}</slot>
|
|
99
|
-
</el-tab-pane>
|
|
100
|
-
</template>
|
|
101
|
-
</el-tabs>
|
|
102
|
-
</div>
|
|
103
|
-
</template>
|
|
104
|
-
<style lang="scss">
|
|
105
|
-
/* 覆盖样式
|
|
106
|
-
---------------------------------------------------------------- */
|
|
107
|
-
.bsgoal-base-tabs {
|
|
108
|
-
.base_tabs--fill {
|
|
109
|
-
position: absolute;
|
|
110
|
-
top: 8px;
|
|
111
|
-
bottom: 0;
|
|
112
|
-
left: 16px;
|
|
113
|
-
right: 16px;
|
|
114
|
-
display: flex;
|
|
115
|
-
flex-direction: column;
|
|
116
|
-
& > div.el-tabs__content {
|
|
117
|
-
flex: 1;
|
|
118
|
-
position: relative;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
</style>
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-05-24 14:58:50
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-07-11 13:40:53
|
|
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
|
-
|
|
16
|
-
defineOptions({
|
|
17
|
-
name: 'BsgoalBaseTimeDemo'
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
const props = defineProps({})
|
|
21
|
-
const time = ref('11:22')
|
|
22
|
-
|
|
23
|
-
const makeRange = (start, end) => {
|
|
24
|
-
const result = []
|
|
25
|
-
for (let i = start; i <= end; i++) {
|
|
26
|
-
result.push(i)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// console.log('makeRange',result);
|
|
30
|
-
return result
|
|
31
|
-
}
|
|
32
|
-
const disabledHours = () => {
|
|
33
|
-
return [16]
|
|
34
|
-
}
|
|
35
|
-
const disabledMinutes = (hour) => {
|
|
36
|
-
if (hour === 17) {
|
|
37
|
-
return makeRange(0, 29)
|
|
38
|
-
}
|
|
39
|
-
if (hour === 18) {
|
|
40
|
-
return makeRange(31, 59)
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const disabledSeconds = (hour, minute) => {
|
|
44
|
-
if (hour === 18 && minute === 30) {
|
|
45
|
-
return makeRange(1, 59)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
</script>
|
|
49
|
-
<template>
|
|
50
|
-
<div class="bsgoal-base-time-demo">
|
|
51
|
-
<div class="base_time_demo">
|
|
52
|
-
{{ time }}
|
|
53
|
-
<BsgoalBaseTime
|
|
54
|
-
v-model="time"
|
|
55
|
-
:disabled-hours="disabledHours"
|
|
56
|
-
:disabled-minutes="disabledMinutes"
|
|
57
|
-
:disabled-seconds="disabledSeconds"
|
|
58
|
-
/>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
</template>
|
|
62
|
-
<style lang="scss" scoped>
|
|
63
|
-
/* 自定义样式
|
|
64
|
-
---------------------------------------------------------------- */
|
|
65
|
-
</style>
|
|
66
|
-
<style lang="scss">
|
|
67
|
-
/* 覆盖样式
|
|
68
|
-
---------------------------------------------------------------- */
|
|
69
|
-
</style>
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-05-24 14:58:44
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-07-11 12:00:53
|
|
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
|
-
|
|
19
|
-
defineOptions({
|
|
20
|
-
name: 'BsgoalBaseTime'
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
const props = defineProps({
|
|
24
|
-
/**
|
|
25
|
-
* 绑定的值
|
|
26
|
-
*/
|
|
27
|
-
modelValue: {
|
|
28
|
-
type: [String],
|
|
29
|
-
default: ''
|
|
30
|
-
},
|
|
31
|
-
/**
|
|
32
|
-
* 提示占位符
|
|
33
|
-
*/
|
|
34
|
-
placeholder: {
|
|
35
|
-
type: [String],
|
|
36
|
-
default: '请选择'
|
|
37
|
-
},
|
|
38
|
-
/**
|
|
39
|
-
* 格式 HH:mm:ss
|
|
40
|
-
*/
|
|
41
|
-
format: {
|
|
42
|
-
type: [String],
|
|
43
|
-
default: 'HH:mm'
|
|
44
|
-
},
|
|
45
|
-
/**
|
|
46
|
-
* 箭头进行选择
|
|
47
|
-
*/
|
|
48
|
-
arrowControl: {
|
|
49
|
-
type: [Boolean],
|
|
50
|
-
default: false
|
|
51
|
-
},
|
|
52
|
-
/**
|
|
53
|
-
* 禁止选择部分小时选项
|
|
54
|
-
*/
|
|
55
|
-
disabledHours: {
|
|
56
|
-
type: [Function],
|
|
57
|
-
default: () => {}
|
|
58
|
-
},
|
|
59
|
-
/**
|
|
60
|
-
* 禁止选择部分分钟选项
|
|
61
|
-
*/
|
|
62
|
-
disabledMinutes: {
|
|
63
|
-
type: [Function],
|
|
64
|
-
default: () => {}
|
|
65
|
-
},
|
|
66
|
-
/**
|
|
67
|
-
* 禁止选择部分秒选项
|
|
68
|
-
*/
|
|
69
|
-
disabledSeconds: {
|
|
70
|
-
type: [Function],
|
|
71
|
-
default: () => {}
|
|
72
|
-
},
|
|
73
|
-
/**
|
|
74
|
-
* 完全只读
|
|
75
|
-
*/
|
|
76
|
-
readonly: {
|
|
77
|
-
type: [Boolean],
|
|
78
|
-
default: false
|
|
79
|
-
},
|
|
80
|
-
/**
|
|
81
|
-
* 禁用
|
|
82
|
-
*/
|
|
83
|
-
disabled: {
|
|
84
|
-
type: [Boolean],
|
|
85
|
-
default: false
|
|
86
|
-
},
|
|
87
|
-
/**
|
|
88
|
-
* 文本框可输入
|
|
89
|
-
*/
|
|
90
|
-
editable: {
|
|
91
|
-
type: [Boolean],
|
|
92
|
-
default: false
|
|
93
|
-
},
|
|
94
|
-
/**
|
|
95
|
-
* 是否显示清除按钮
|
|
96
|
-
*/
|
|
97
|
-
clearable: {
|
|
98
|
-
type: [Boolean],
|
|
99
|
-
default: false
|
|
100
|
-
},
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
// ---> S 绑定值 <---
|
|
104
|
-
|
|
105
|
-
const bindValue = ref()
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* @Author: canlong.shen
|
|
109
|
-
* @description: 转换 字符串 time 为 Date
|
|
110
|
-
* @default:
|
|
111
|
-
* @return {*}
|
|
112
|
-
*/
|
|
113
|
-
const stringToDate = (timeString = '') => {
|
|
114
|
-
return dayjs(`0000-00-00 ${timeString}`)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* @Author: canlong.shen
|
|
119
|
-
* @description: 格式化 Date 为 time 字符串
|
|
120
|
-
* @default:
|
|
121
|
-
* @return {*}
|
|
122
|
-
*/
|
|
123
|
-
const dateToString = (date = new Date()) => {
|
|
124
|
-
return dayjs(date).format(props.format)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
watchEffect(() => {
|
|
128
|
-
const { modelValue } = props
|
|
129
|
-
const timeValue = unref(modelValue)
|
|
130
|
-
if (timeValue) {
|
|
131
|
-
bindValue.value = stringToDate(timeValue)
|
|
132
|
-
}
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* @Author: canlong.shen
|
|
137
|
-
* @description: 触发 值变化
|
|
138
|
-
* @default:
|
|
139
|
-
* @return {*}
|
|
140
|
-
*/
|
|
141
|
-
const triggerChange = (date = new Date()) => {
|
|
142
|
-
const formatValue = dateToString(date)
|
|
143
|
-
emits('update:modelValue', formatValue)
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// ---> E 绑定值 <---
|
|
147
|
-
</script>
|
|
148
|
-
|
|
149
|
-
<template>
|
|
150
|
-
<div class="bsgoal-base-time">
|
|
151
|
-
<el-config-provider :locale="zhCn">
|
|
152
|
-
<el-time-picker
|
|
153
|
-
v-model="bindValue"
|
|
154
|
-
class="base_time"
|
|
155
|
-
:arrow-control="arrowControl"
|
|
156
|
-
:format="format"
|
|
157
|
-
:clearable="clearable"
|
|
158
|
-
:readonly="readonly"
|
|
159
|
-
:disabled="disabled"
|
|
160
|
-
:editable="editable"
|
|
161
|
-
:placeholder="placeholder"
|
|
162
|
-
:disabled-hours="disabledHours"
|
|
163
|
-
:disabled-minutes="disabledMinutes"
|
|
164
|
-
:disabled-seconds="disabledSeconds"
|
|
165
|
-
@change="triggerChange"
|
|
166
|
-
/>
|
|
167
|
-
</el-config-provider>
|
|
168
|
-
</div>
|
|
169
|
-
</template>
|
|
170
|
-
<style lang="scss" scoped>
|
|
171
|
-
/* 自定义样式
|
|
172
|
-
---------------------------------------------------------------- */
|
|
173
|
-
</style>
|
|
174
|
-
<style lang="scss">
|
|
175
|
-
/* 覆盖样式
|
|
176
|
-
---------------------------------------------------------------- */
|
|
177
|
-
</style>
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: canlong.shen
|
|
3
|
-
* @Date: 2023-05-24 14:10:03
|
|
4
|
-
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-07-11 10:34:27
|
|
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
|
-
|
|
17
|
-
defineOptions({
|
|
18
|
-
name: 'BsgoalBaseTimeDemoRange'
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
const props = defineProps({})
|
|
22
|
-
|
|
23
|
-
const timeRange = ref(['11:00', '12:12'])
|
|
24
|
-
|
|
25
|
-
const timeList = ref([
|
|
26
|
-
{
|
|
27
|
-
startTime: '00:00',
|
|
28
|
-
endTime: '01:00'
|
|
29
|
-
}
|
|
30
|
-
])
|
|
31
|
-
|
|
32
|
-
const startTime = ref('12:11')
|
|
33
|
-
const endTime = ref('13:55')
|
|
34
|
-
|
|
35
|
-
const changeTime = (start = '' , end = '') => {
|
|
36
|
-
console.log('start',start);
|
|
37
|
-
console.log('end',end);
|
|
38
|
-
}
|
|
39
|
-
</script>
|
|
40
|
-
<template>
|
|
41
|
-
<div class="bsgoal-base-time-range-demo">
|
|
42
|
-
<div>{{ timeRange }}</div>
|
|
43
|
-
<div>{{ startTime }}</div>
|
|
44
|
-
<div>{{ endTime }}</div>
|
|
45
|
-
<div>{{ timeList[0]['startTime'] }}</div>
|
|
46
|
-
<div>{{ timeList[0]['endTime'] }}</div>
|
|
47
|
-
<BsgoalBaseTimeRange
|
|
48
|
-
:body-style="{ width: '100%' }"
|
|
49
|
-
:modelValue="[timeList[0]['startTime'], timeList[0]['endTime']]"
|
|
50
|
-
class="base_time_range_demo"
|
|
51
|
-
@on-change="changeTime"
|
|
52
|
-
/>
|
|
53
|
-
</div>
|
|
54
|
-
</template>
|
|
55
|
-
<style lang="scss" scoped>
|
|
56
|
-
/* 自定义样式
|
|
57
|
-
---------------------------------------------------------------- */
|
|
58
|
-
</style>
|
|
59
|
-
<style lang="scss">
|
|
60
|
-
/* 覆盖样式
|
|
61
|
-
---------------------------------------------------------------- */
|
|
62
|
-
</style>
|