@bsgoal/common 2.7.9 → 2.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 +1598 -1595
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +9 -9
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/bsgoal-base-button/index.vue +10 -1
- package/src/components/bsgoal-base-dialog/demo.vue +15 -8
- package/src/components/bsgoal-base-dialog/index.vue +13 -4
- package/src/components/bsgoal-base-form/demo.vue +5 -3
- package/src/components/bsgoal-base-form/index.vue +11 -8
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-dialog .bsgoal_base_dialog_main .base_dialog_content--form .bsgoal-base-form .base_form{padding:initial;padding-top:16px}.bsgoal-base-
|
|
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-button,.bsgoal-base-button .base_button{display:inline-block}.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-dialog .bsgoal_base_dialog_main .base_dialog_content--form .bsgoal-base-form .base_form{padding:initial;padding-top:16px}.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:14px;color:#606266;height:32px;line-height:32px;padding-right:12px}
|
package/package.json
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
import { ref, unref, computed } from 'vue'
|
|
15
15
|
import { Delete, Plus, CloseBold, Select } from '@element-plus/icons-vue'
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
defineOptions({
|
|
19
18
|
name: 'BsgoalBaseButton'
|
|
20
19
|
})
|
|
@@ -51,13 +50,23 @@ const props = defineProps({
|
|
|
51
50
|
plain: {
|
|
52
51
|
type: [Boolean],
|
|
53
52
|
default: false
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* 是否有 loading
|
|
56
|
+
*/
|
|
57
|
+
hasLoading: {
|
|
58
|
+
type: [Boolean],
|
|
59
|
+
default: true
|
|
54
60
|
}
|
|
55
61
|
})
|
|
56
62
|
|
|
57
63
|
// ---> S 触发按钮 <---
|
|
58
64
|
const loading = ref(false)
|
|
59
65
|
const triggerClick = () => {
|
|
66
|
+
// 默认 loading 是打开的
|
|
67
|
+
if(props.hasLoading){
|
|
60
68
|
loading.value = true
|
|
69
|
+
}
|
|
61
70
|
const { task } = props
|
|
62
71
|
const taskValue = unref(task)
|
|
63
72
|
taskValue(() => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-23 16:35:24
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-
|
|
5
|
+
* @LastEditTime: 2023-05-30 15:31:41
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-dialog\demo.vue
|
|
7
7
|
* @Description: 弹窗公共组件 演示
|
|
8
8
|
*
|
|
@@ -52,22 +52,29 @@ const tabsConfigOptions = ref([
|
|
|
52
52
|
])
|
|
53
53
|
|
|
54
54
|
const triggerConfirm = (done) => {
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
done()
|
|
57
|
+
}, 3000)
|
|
58
|
+
console.log('关闭前')
|
|
57
59
|
}
|
|
58
60
|
</script>
|
|
59
61
|
<template>
|
|
60
62
|
<div class="bsgoal-base-dialog-demo">
|
|
61
63
|
<div class="base_dialog_demo">
|
|
62
64
|
<BsgoalBaseDialog v-model="dialogVisible" width="600" :footer="false">
|
|
63
|
-
<BsgoalBaseTabs v-memo="activeTabName"
|
|
65
|
+
<BsgoalBaseTabs v-memo="activeTabName" :config-options="tabsConfigOptions" />
|
|
64
66
|
<template #footer>
|
|
65
67
|
<el-button type="primary">底部按钮</el-button>
|
|
66
68
|
</template>
|
|
67
|
-
</BsgoalBaseDialog
|
|
68
|
-
<BsgoalBaseDialog
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
</BsgoalBaseDialog>
|
|
70
|
+
<BsgoalBaseDialog
|
|
71
|
+
v-model="dialogVisible2"
|
|
72
|
+
size="max"
|
|
73
|
+
type="form"
|
|
74
|
+
@on-confirm="triggerConfirm"
|
|
75
|
+
>
|
|
76
|
+
<BsgoalBaseTabs v-memo="activeTabName" :config-options="tabsConfigOptions" />
|
|
77
|
+
</BsgoalBaseDialog>
|
|
71
78
|
<el-button type="primary" @click="test">打开弹窗</el-button>
|
|
72
79
|
<el-button type="primary" @click="test2">打开弹窗2</el-button>
|
|
73
80
|
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-23 16:35:19
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-
|
|
5
|
+
* @LastEditTime: 2023-05-30 15:30:52
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-dialog\index.vue
|
|
7
7
|
* @Description: 弹窗公共组件
|
|
8
8
|
*
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
/* setup模板
|
|
13
13
|
---------------------------------------------------------------- */
|
|
14
14
|
import { ref, watch, computed } from 'vue'
|
|
15
|
+
import BsgoalBaseButton from '../bsgoal-base-button/index.vue'
|
|
15
16
|
|
|
16
17
|
defineOptions({
|
|
17
18
|
name: 'BsgoalBaseDialog'
|
|
@@ -95,9 +96,10 @@ const cancel = () => {
|
|
|
95
96
|
* @default:
|
|
96
97
|
* @return {*}
|
|
97
98
|
*/
|
|
98
|
-
const confirm = () => {
|
|
99
|
+
const confirm = (done = () => {}) => {
|
|
99
100
|
emits('on-confirm', () => {
|
|
100
101
|
dialogVisible.value = false
|
|
102
|
+
done()
|
|
101
103
|
})
|
|
102
104
|
}
|
|
103
105
|
|
|
@@ -156,8 +158,15 @@ const widthGet = computed(() => {
|
|
|
156
158
|
<template #footer>
|
|
157
159
|
<slot name="footer" v-if="footer">
|
|
158
160
|
<span class="base_dialog_footer">
|
|
159
|
-
<
|
|
160
|
-
|
|
161
|
+
<BsgoalBaseButton
|
|
162
|
+
:task="cancel"
|
|
163
|
+
mode="cancel"
|
|
164
|
+
:content="cancelTxt"
|
|
165
|
+
:has-loading="false"
|
|
166
|
+
>
|
|
167
|
+
</BsgoalBaseButton>
|
|
168
|
+
<BsgoalBaseButton :task="confirm" mode="confirm" :content="confirmTxt">
|
|
169
|
+
</BsgoalBaseButton>
|
|
161
170
|
</span>
|
|
162
171
|
</slot>
|
|
163
172
|
</template>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-10 15:00:00
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-30 14:
|
|
5
|
+
* @LastEditTime: 2023-05-30 14:45:55
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-form\demo.vue
|
|
7
7
|
* @Description: 表单公共组件演示组件
|
|
8
8
|
*
|
|
@@ -47,8 +47,10 @@ const configOptions = ref([
|
|
|
47
47
|
{
|
|
48
48
|
validator: (rule, value, callback) => {
|
|
49
49
|
console.log('value', value)
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
// return callback(new Error('Please input the age'))
|
|
53
|
+
return callback()
|
|
52
54
|
},
|
|
53
55
|
trigger: 'change'
|
|
54
56
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-17 11:44:29
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-30 14:
|
|
5
|
+
* @LastEditTime: 2023-05-30 14:52:13
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-form\index.vue
|
|
7
7
|
* @Description: 表单公共组件
|
|
8
8
|
*
|
|
@@ -153,8 +153,11 @@ watchEffect(() => {
|
|
|
153
153
|
watchPropList.push(prop)
|
|
154
154
|
}
|
|
155
155
|
const bindValue = unref(model)[prop]
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
if (prop.startsWith('_')) {
|
|
157
|
+
model.value[prop] = `${prop}`
|
|
158
|
+
} else {
|
|
159
|
+
model.value[prop] = bindValue || valuesModel[prop] || value
|
|
160
|
+
}
|
|
158
161
|
|
|
159
162
|
if (isObject(show)) {
|
|
160
163
|
watchPropsForShow(show, unref(model), prop)
|
|
@@ -175,13 +178,13 @@ const configOptionsGet = computed(() => {
|
|
|
175
178
|
const { configOptions } = props
|
|
176
179
|
const options = unref(configOptions)
|
|
177
180
|
const reOptions = options.map((option) => {
|
|
178
|
-
let { rules = [], label = '',
|
|
181
|
+
let { rules = [], label = '', prop = '' } = option
|
|
179
182
|
const requiredRule = { required: true, message: `${label}不能为空`, trigger: 'blur' }
|
|
180
183
|
if (isBoolean(rules) && rules) {
|
|
181
184
|
rules = [requiredRule]
|
|
182
|
-
} else if (
|
|
183
|
-
rules = [
|
|
184
|
-
}
|
|
185
|
+
} else if (Array.isArray(rules) && !!rules.length) {
|
|
186
|
+
rules = [requiredRule, ...rules]
|
|
187
|
+
}
|
|
185
188
|
option.rules = rules
|
|
186
189
|
return option
|
|
187
190
|
})
|
|
@@ -434,7 +437,7 @@ defineExpose({
|
|
|
434
437
|
:key="key"
|
|
435
438
|
>
|
|
436
439
|
<el-col :class="{ 'base_form--visible': !visible }" :xs="24" :sm="24" :md="medium">
|
|
437
|
-
<el-form-item :label="label" :prop="prop" :rules="rules"
|
|
440
|
+
<el-form-item :label="label" :prop="prop" :rules="rules">
|
|
438
441
|
<slot :name="[prop]" :option="{ readonly, value: model[prop], values: model }">
|
|
439
442
|
<!-- S 内容组件 -->
|
|
440
443
|
<template v-if="!readonly">
|