@bsgoal/common 2.6.0 → 2.7.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/dist/index.mjs +2591 -2455
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +13 -13
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/bsgoal-base-input/demo.vue +43 -0
- package/src/components/bsgoal-base-input/index.vue +134 -0
- package/src/entry.js +14 -0
- package/src/router/index.js +6 -1
package/package.json
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-05-29 09:38:59
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-05-29 18:01:43
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-input\demo.vue
|
|
7
|
+
* @Description: Input 输入框 演示
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
<script setup>
|
|
11
|
+
/* setup模板
|
|
12
|
+
---------------------------------------------------------------- */
|
|
13
|
+
import { ref } from 'vue'
|
|
14
|
+
import BsgoalBaseInput from './index.vue'
|
|
15
|
+
defineOptions({
|
|
16
|
+
name: 'BsgoalBaseInputDemo'
|
|
17
|
+
})
|
|
18
|
+
const props = defineProps({})
|
|
19
|
+
|
|
20
|
+
const inputValue = ref('')
|
|
21
|
+
|
|
22
|
+
const test = () => {
|
|
23
|
+
inputValue.value = '666'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
</script>
|
|
27
|
+
<template>
|
|
28
|
+
<div class="bsgoal-base-input-demo">
|
|
29
|
+
<div class="base_input_demo">
|
|
30
|
+
{{ inputValue }}
|
|
31
|
+
<BsgoalBaseInput v-model="inputValue"/>
|
|
32
|
+
<el-button type="primary" @click="test">测试</el-button>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
<style lang="scss" scoped>
|
|
37
|
+
/* 自定义样式
|
|
38
|
+
---------------------------------------------------------------- */
|
|
39
|
+
</style>
|
|
40
|
+
<style lang="scss">
|
|
41
|
+
/* 覆盖样式
|
|
42
|
+
---------------------------------------------------------------- */
|
|
43
|
+
</style>
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-05-29 09:38:52
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-05-29 18:01:19
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-input\index.vue
|
|
7
|
+
* @Description: Input 输入框
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
/* setup模板
|
|
13
|
+
---------------------------------------------------------------- */
|
|
14
|
+
import { processSlotOutlet } from '@vue/compiler-core'
|
|
15
|
+
import { ref, watch, watchEffect } from 'vue'
|
|
16
|
+
|
|
17
|
+
defineOptions({
|
|
18
|
+
name: 'BsgoalBaseInput'
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
/**
|
|
23
|
+
* value
|
|
24
|
+
*/
|
|
25
|
+
modelValue: {
|
|
26
|
+
type: [String, Number],
|
|
27
|
+
default: ''
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* placeholder
|
|
31
|
+
*/
|
|
32
|
+
placeholder: {
|
|
33
|
+
type: [String],
|
|
34
|
+
default: '请输入'
|
|
35
|
+
},
|
|
36
|
+
/**
|
|
37
|
+
* 禁用状态
|
|
38
|
+
*/
|
|
39
|
+
disabled: {
|
|
40
|
+
type: [Boolean],
|
|
41
|
+
default: false
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* 输入值格式
|
|
45
|
+
*/
|
|
46
|
+
formatter: {
|
|
47
|
+
type: [Function],
|
|
48
|
+
default: () => {
|
|
49
|
+
return (v) => v
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* 提取值
|
|
54
|
+
*/
|
|
55
|
+
parser: {
|
|
56
|
+
type: [Function],
|
|
57
|
+
default: () => {
|
|
58
|
+
return (v) => v
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
const emits = defineEmits(['update:modelValue', 'change'])
|
|
64
|
+
|
|
65
|
+
// ---> S 值绑定 <---
|
|
66
|
+
|
|
67
|
+
const inputValue = ref('')
|
|
68
|
+
|
|
69
|
+
watchEffect(() => {
|
|
70
|
+
inputValue.value = props.modelValue
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
// ---> E 值绑定 <---
|
|
74
|
+
|
|
75
|
+
// ---> S 事件 <---
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @Author: canlong.shen
|
|
79
|
+
* @description: 触发 变动输入
|
|
80
|
+
* @default:
|
|
81
|
+
* @return {*}
|
|
82
|
+
*/
|
|
83
|
+
const change = (value = '') => {
|
|
84
|
+
emits('change', value)
|
|
85
|
+
emits('update:modelValue', value)
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* @Author: canlong.shen
|
|
89
|
+
* @description: 触发 清空输入
|
|
90
|
+
* @default:
|
|
91
|
+
* @return {*}
|
|
92
|
+
*/
|
|
93
|
+
const clear = (value = '') => {
|
|
94
|
+
emits('clear', value)
|
|
95
|
+
emits('update:modelValue', value)
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* @Author: canlong.shen
|
|
99
|
+
* @description: 触发 输入事件
|
|
100
|
+
* @default:
|
|
101
|
+
* @return {*}
|
|
102
|
+
*/
|
|
103
|
+
const input = (value = '') => {
|
|
104
|
+
emits('input', value)
|
|
105
|
+
emits('update:modelValue', value)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// ---> E 事件 <---
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
<template>
|
|
112
|
+
<div class="bsgoal-base-input">
|
|
113
|
+
<el-input
|
|
114
|
+
v-model="inputValue"
|
|
115
|
+
clearable
|
|
116
|
+
class="base_input"
|
|
117
|
+
:placeholder="placeholder"
|
|
118
|
+
:disabled="disabled"
|
|
119
|
+
:formatter="formatter"
|
|
120
|
+
:parser="parser"
|
|
121
|
+
@change="change"
|
|
122
|
+
@clear="clear"
|
|
123
|
+
@input="input"
|
|
124
|
+
/>
|
|
125
|
+
</div>
|
|
126
|
+
</template>
|
|
127
|
+
<style lang="scss" scoped>
|
|
128
|
+
/* 自定义样式
|
|
129
|
+
---------------------------------------------------------------- */
|
|
130
|
+
</style>
|
|
131
|
+
<style lang="scss">
|
|
132
|
+
/* 覆盖样式
|
|
133
|
+
---------------------------------------------------------------- */
|
|
134
|
+
</style>
|
package/src/entry.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-05-11 18:31:55
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-05-29 09:58:19
|
|
6
|
+
* @FilePath: \common\src\entry.js
|
|
7
|
+
* @Description: 打包 入口文件
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
1
13
|
import BsgoalBaseForm from '@/components/bsgoal-base-form/index.vue'
|
|
2
14
|
import BsgoalBaseTable from '@/components/bsgoal-base-table/index.vue'
|
|
3
15
|
import BsgoalBaseLine from '@/components/bsgoal-base-line/index.vue'
|
|
@@ -14,6 +26,7 @@ import BsgoalBaseTime from '@/components/bsgoal-base-time/index.vue'
|
|
|
14
26
|
import BsgoalBaseTimeRange from '@/components/bsgoal-base-time-range/index.vue'
|
|
15
27
|
import BsgoalBaseSwitch from '@/components/bsgoal-base-switch/index.vue'
|
|
16
28
|
import BsgoalBaseItem from '@/components/bsgoal-base-item/index.vue'
|
|
29
|
+
import BsgoalBaseInput from '@/components/bsgoal-base-input/index.vue'
|
|
17
30
|
import componentTypeEnums from '@/enums/componentTypeEnums.js'
|
|
18
31
|
import { useFetch } from '@/combines/useFetchs.js'
|
|
19
32
|
|
|
@@ -42,6 +55,7 @@ export default {
|
|
|
42
55
|
BsgoalBaseTimeRange,
|
|
43
56
|
BsgoalBaseSwitch,
|
|
44
57
|
BsgoalBaseItem,
|
|
58
|
+
BsgoalBaseInput,
|
|
45
59
|
}
|
|
46
60
|
|
|
47
61
|
for (const [name, component] of Object.entries(componentsMap)) {
|
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-05-
|
|
5
|
+
* @LastEditTime: 2023-05-29 09:57:18
|
|
6
6
|
* @FilePath: \common\src\router\index.js
|
|
7
7
|
* @Description: 路由配置
|
|
8
8
|
*
|
|
@@ -18,6 +18,11 @@ const router = createRouter({
|
|
|
18
18
|
name: 'home',
|
|
19
19
|
component: LayoutHome,
|
|
20
20
|
children: [
|
|
21
|
+
{
|
|
22
|
+
path: '/bsgoal-base-input-demo',
|
|
23
|
+
name: '输入框',
|
|
24
|
+
component: import('@/components/bsgoal-base-input/demo.vue')
|
|
25
|
+
},
|
|
21
26
|
{
|
|
22
27
|
path: '/bsgoal-base-table-demo',
|
|
23
28
|
name: '表格',
|