@bsgoal/common 1.7.8 → 1.8.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 +604 -551
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/bsgoal-base-form/demo.vue +6 -2
- package/src/components/bsgoal-base-layout/demo.vue +49 -0
- package/src/components/bsgoal-base-layout/index.vue +59 -0
- package/src/components/bsgoal-base-table/demo.vue +7 -5
- package/src/components/bsgoal-base-tabs/demo.vue +2 -2
- package/src/components/bsgoal-base-tabs/index.vue +13 -4
- package/src/entry.js +3 -1
- package/src/router/index.js +6 -1
package/package.json
CHANGED
|
@@ -29,6 +29,10 @@ const confirm = () => {
|
|
|
29
29
|
})
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
32
36
|
// 配置项
|
|
33
37
|
const configOptions = ref([
|
|
34
38
|
{
|
|
@@ -191,9 +195,9 @@ export default {
|
|
|
191
195
|
:values="values"
|
|
192
196
|
none="--"
|
|
193
197
|
>
|
|
194
|
-
<template #prop1="{option}">
|
|
198
|
+
<!-- <template #prop1="{option}">
|
|
195
199
|
<div>666 {{ option }} </div>
|
|
196
|
-
</template>
|
|
200
|
+
</template> -->
|
|
197
201
|
</BsgoalBaseForm>
|
|
198
202
|
<el-button type="primary" @click="confirm">提交</el-button>
|
|
199
203
|
</div>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-05-20 13:51:53
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-05-20 14:48:43
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-layout\demo.vue
|
|
7
|
+
* @Description: 布局组件 演示
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
/* setup模板
|
|
13
|
+
---------------------------------------------------------------- */
|
|
14
|
+
import { ref } from 'vue'
|
|
15
|
+
import BsgoalBaseLayout from './index.vue'
|
|
16
|
+
// props
|
|
17
|
+
const props = defineProps({})
|
|
18
|
+
</script>
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
name: 'BsgoalBaseLayoutDemo'
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
<template>
|
|
25
|
+
<div class="bsgoal-base-layout-demo">
|
|
26
|
+
<BsgoalBaseLayout>
|
|
27
|
+
<template #area>
|
|
28
|
+
<div>0</div>
|
|
29
|
+
</template>
|
|
30
|
+
<template #area1>
|
|
31
|
+
<div>1</div>
|
|
32
|
+
</template>
|
|
33
|
+
<template #area2>
|
|
34
|
+
<div>2</div>
|
|
35
|
+
</template>
|
|
36
|
+
<template #area13>
|
|
37
|
+
<div>3</div>
|
|
38
|
+
</template>
|
|
39
|
+
</BsgoalBaseLayout>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
<style lang="scss" scoped>
|
|
43
|
+
/* 自定义样式
|
|
44
|
+
---------------------------------------------------------------- */
|
|
45
|
+
</style>
|
|
46
|
+
<style lang="scss">
|
|
47
|
+
/* 覆盖样式
|
|
48
|
+
---------------------------------------------------------------- */
|
|
49
|
+
</style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: canlong.shen
|
|
3
|
+
* @Date: 2023-05-20 13:51:38
|
|
4
|
+
* @LastEditors: canlong.shen
|
|
5
|
+
* @LastEditTime: 2023-05-20 15:22:33
|
|
6
|
+
* @FilePath: \common\src\components\bsgoal-base-layout\index.vue
|
|
7
|
+
* @Description: 响应式 布局
|
|
8
|
+
*
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
/* setup模板
|
|
13
|
+
---------------------------------------------------------------- */
|
|
14
|
+
import { ref, useSlots } from 'vue'
|
|
15
|
+
// props
|
|
16
|
+
const props = defineProps({
|
|
17
|
+
/**
|
|
18
|
+
* 间隔
|
|
19
|
+
*/
|
|
20
|
+
gutter: {
|
|
21
|
+
type: [Number],
|
|
22
|
+
default: 0
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* 划分的比例
|
|
26
|
+
*/
|
|
27
|
+
ratio: {
|
|
28
|
+
type: [Number],
|
|
29
|
+
default: 12
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
// ---> S 插槽 <---
|
|
34
|
+
const slots = useSlots()
|
|
35
|
+
const slotNames = ref(Object.keys(slots))
|
|
36
|
+
// ---> E 插槽 <---
|
|
37
|
+
</script>
|
|
38
|
+
<script>
|
|
39
|
+
export default {
|
|
40
|
+
name: 'BsgoalBaseLayout'
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
<template>
|
|
44
|
+
<div class="bsgoal-base-layout">
|
|
45
|
+
<el-row class="base_layout" :gutter="gutter">
|
|
46
|
+
<template v-for="(name, key) of slotNames" :key="key">
|
|
47
|
+
<el-col :xs="24" :sm="24" :md="ratio" :lg="ratio" :xl="ratio">
|
|
48
|
+
<slot :name="name"></slot>
|
|
49
|
+
</el-col>
|
|
50
|
+
</template>
|
|
51
|
+
</el-row>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
<style lang="scss">
|
|
55
|
+
/* 覆盖样式
|
|
56
|
+
---------------------------------------------------------------- */
|
|
57
|
+
.bsgoal-base-layout {
|
|
58
|
+
}
|
|
59
|
+
</style>
|
|
@@ -214,12 +214,12 @@ setTimeout(() => {
|
|
|
214
214
|
]
|
|
215
215
|
}, 3000)
|
|
216
216
|
|
|
217
|
-
const
|
|
217
|
+
const configOptionsTable = ref([
|
|
218
218
|
{
|
|
219
219
|
label: '列列列列列列列列列1',
|
|
220
220
|
prop: 'prop1',
|
|
221
|
-
tooltip: true,
|
|
222
|
-
limit: 3
|
|
221
|
+
// tooltip: true,
|
|
222
|
+
// limit: 3
|
|
223
223
|
},
|
|
224
224
|
{
|
|
225
225
|
label: '列列列列列列列列列2',
|
|
@@ -256,15 +256,17 @@ const clearData = () => {
|
|
|
256
256
|
operation
|
|
257
257
|
selection
|
|
258
258
|
:has-page="false"
|
|
259
|
-
:config-options="
|
|
259
|
+
:config-options="configOptionsTable"
|
|
260
260
|
:data="data"
|
|
261
261
|
:auto-height="false"
|
|
262
262
|
>
|
|
263
|
+
<!-- S 操作项 -->
|
|
263
264
|
<template v-slot:operation="{ row }">
|
|
264
265
|
<div>
|
|
265
|
-
|
|
266
|
+
{{ row }}
|
|
266
267
|
</div>
|
|
267
268
|
</template>
|
|
269
|
+
<!-- E 操作项 -->
|
|
268
270
|
</BsgoalBaseTable>
|
|
269
271
|
</div>
|
|
270
272
|
</template>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-28 16:01:11
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-
|
|
5
|
+
* @LastEditTime: 2023-05-20 15:51:07
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-tabs\demo.vue
|
|
7
7
|
* @Description: tabs 标签切页 公共组件演示
|
|
8
8
|
-->
|
|
@@ -43,7 +43,7 @@ const config = ref([
|
|
|
43
43
|
<div class="bsgoal-base-tabs-demo">
|
|
44
44
|
<div class="base_tabs_demo">
|
|
45
45
|
{{ activeTabName }}
|
|
46
|
-
<BsgoalBaseTabs
|
|
46
|
+
<BsgoalBaseTabs :config-options="config" >
|
|
47
47
|
<template #tab1>
|
|
48
48
|
<div>
|
|
49
49
|
这是 tab1
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-28 16:01:06
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-
|
|
5
|
+
* @LastEditTime: 2023-05-20 15:50:39
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-tabs\index.vue
|
|
7
7
|
* @Description: tabs 标签页公共组件
|
|
8
8
|
*
|
|
@@ -16,7 +16,7 @@ export default {
|
|
|
16
16
|
<script setup>
|
|
17
17
|
/* setup模板
|
|
18
18
|
---------------------------------------------------------------- */
|
|
19
|
-
import { ref } from 'vue'
|
|
19
|
+
import { ref, unref } from 'vue'
|
|
20
20
|
const props = defineProps({
|
|
21
21
|
/**
|
|
22
22
|
* 配置项
|
|
@@ -62,6 +62,15 @@ const props = defineProps({
|
|
|
62
62
|
*/
|
|
63
63
|
const emits = defineEmits(['update:modelValue'])
|
|
64
64
|
|
|
65
|
+
// ---> S modelValue Get <---
|
|
66
|
+
|
|
67
|
+
// ---> E modelValue Get <---
|
|
68
|
+
const modelValueGet = () => {
|
|
69
|
+
const { modelValue = '', configOptions = [] } = props
|
|
70
|
+
const nameList = unref(configOptions).map((mi) => mi.value)
|
|
71
|
+
const actionName = unref(modelValue)
|
|
72
|
+
return actionName || nameList[0]
|
|
73
|
+
}
|
|
65
74
|
// ---> S tab的切换 <---
|
|
66
75
|
const changeTab = (activeValue = '') => {
|
|
67
76
|
emits('update:modelValue', activeValue)
|
|
@@ -71,10 +80,10 @@ const changeTab = (activeValue = '') => {
|
|
|
71
80
|
<template>
|
|
72
81
|
<div class="bsgoal-base-tabs">
|
|
73
82
|
<el-tabs
|
|
74
|
-
:stretch="stretch"
|
|
75
83
|
class="bsgoal_base_tabs"
|
|
84
|
+
:stretch="stretch"
|
|
76
85
|
:type="type"
|
|
77
|
-
:model-value="
|
|
86
|
+
:model-value="modelValueGet"
|
|
78
87
|
@tab-change="changeTab"
|
|
79
88
|
>
|
|
80
89
|
<template v-for="({ label, value }, key) of configOptions" :key="key">
|
package/src/entry.js
CHANGED
|
@@ -7,6 +7,7 @@ import BsgoalBaseDialog from '@/components/bsgoal-base-dialog/index.vue'
|
|
|
7
7
|
import BsgoalBaseTabs from '@/components/bsgoal-base-tabs/index.vue'
|
|
8
8
|
import BsgoalBaseLink from '@/components/bsgoal-base-link/index.vue'
|
|
9
9
|
import BsgoalBaseButton from '@/components/bsgoal-base-button/index.vue'
|
|
10
|
+
import BsgoalBaseLayout from '@/components/bsgoal-base-layout/index.vue'
|
|
10
11
|
import enumType from '@/enums/enumType.js'
|
|
11
12
|
import { useFetch } from '@/combines/useFetchs.js'
|
|
12
13
|
|
|
@@ -27,7 +28,8 @@ export default {
|
|
|
27
28
|
BsgoalBaseDialog,
|
|
28
29
|
BsgoalBaseTabs,
|
|
29
30
|
BsgoalBaseLink,
|
|
30
|
-
BsgoalBaseButton
|
|
31
|
+
BsgoalBaseButton,
|
|
32
|
+
BsgoalBaseLayout
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
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-20 14:37:30
|
|
6
6
|
* @FilePath: \common\src\router\index.js
|
|
7
7
|
* @Description: 路由配置
|
|
8
8
|
*
|
|
@@ -88,6 +88,11 @@ const router = createRouter({
|
|
|
88
88
|
name: '按钮',
|
|
89
89
|
component: import('@/components/bsgoal-base-button/demo.vue')
|
|
90
90
|
},
|
|
91
|
+
{
|
|
92
|
+
path: 'bsgoal-base-layout-demo',
|
|
93
|
+
name: '布局',
|
|
94
|
+
component: import('@/components/bsgoal-base-layout/demo.vue')
|
|
95
|
+
},
|
|
91
96
|
]
|
|
92
97
|
}
|
|
93
98
|
]
|