@bsgoal/common 2.6.0 → 2.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsgoal/common",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -0,0 +1,38 @@
1
+ <!--
2
+ * @Author: canlong.shen
3
+ * @Date: 2023-05-29 09:38:59
4
+ * @LastEditors: canlong.shen
5
+ * @LastEditTime: 2023-05-29 10:00:37
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
+ </script>
23
+ <template>
24
+ <div class="bsgoal-base-input-demo">
25
+ <div class="base_input_demo">
26
+ {{ inputValue }}
27
+ <BsgoalBaseInput v-model="inputValue"/>
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,109 @@
1
+ <!--
2
+ * @Author: canlong.shen
3
+ * @Date: 2023-05-29 09:38:52
4
+ * @LastEditors: canlong.shen
5
+ * @LastEditTime: 2023-05-29 11:41:48
6
+ * @FilePath: \common\src\components\bsgoal-base-input\index.vue
7
+ * @Description: Input 输入框
8
+ *
9
+ -->
10
+
11
+ <script setup>
12
+ /* setup模板
13
+ ---------------------------------------------------------------- */
14
+ import { ref, watch } from 'vue'
15
+
16
+ defineOptions({
17
+ name: 'BsgoalBaseInput'
18
+ })
19
+
20
+ const props = defineProps({
21
+ /**
22
+ * value
23
+ */
24
+ modelValue: {
25
+ type: [String, Number],
26
+ default: ''
27
+ },
28
+ /**
29
+ * placeholder
30
+ */
31
+ placeholder: {
32
+ type: [String],
33
+ default: '请输入'
34
+ },
35
+ /**
36
+ * 禁用状态
37
+ */
38
+ disabled: {
39
+ type: [Boolean],
40
+ default: false
41
+ },
42
+ /**
43
+ * 输入值格式
44
+ */
45
+ formatter: {
46
+ type: [Function],
47
+ default: () => {
48
+ return (v) => v
49
+ }
50
+ },
51
+ /**
52
+ * 提取值
53
+ */
54
+ parser: {
55
+ type: [Function],
56
+ default: () => {
57
+ return (v) => v
58
+ }
59
+ }
60
+ })
61
+
62
+ const emits = defineEmits(['update:modelValue', 'change'])
63
+
64
+ // ---> S 值绑定 <---
65
+
66
+ const inputValue = ref(props.modelValue)
67
+ watch(inputValue, (value = '') => {
68
+ emits('update:modelValue', value)
69
+ })
70
+
71
+ // ---> E 值绑定 <---
72
+
73
+ // ---> S 事件 <---
74
+
75
+ /**
76
+ * @Author: canlong.shen
77
+ * @description: 值变动
78
+ * @default:
79
+ * @return {*}
80
+ */
81
+ const change = (value = '') => {
82
+ emits('change', value)
83
+ }
84
+
85
+ // ---> E 事件 <---
86
+ </script>
87
+
88
+ <template>
89
+ <div class="bsgoal-base-input">
90
+ <el-input
91
+ v-model="inputValue"
92
+ clearable
93
+ class="base_input"
94
+ :placeholder="placeholder"
95
+ :disabled="disabled"
96
+ :formatter="formatter"
97
+ :parser="parser"
98
+ @change="change"
99
+ />
100
+ </div>
101
+ </template>
102
+ <style lang="scss" scoped>
103
+ /* 自定义样式
104
+ ---------------------------------------------------------------- */
105
+ </style>
106
+ <style lang="scss">
107
+ /* 覆盖样式
108
+ ---------------------------------------------------------------- */
109
+ </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)) {
@@ -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-24 17:43:27
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: '表格',