@bsgoal/common 1.5.5 → 1.5.6
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
|
@@ -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-
|
|
5
|
+
* @LastEditTime: 2023-05-06 11:33:21
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-form\demo.vue
|
|
7
7
|
* @Description: 表单公共组件演示组件
|
|
8
8
|
*
|
|
@@ -27,8 +27,9 @@ import { ref, computed, toRefs, watch, unref } from 'vue'
|
|
|
27
27
|
import EnumType from '../../enums/enumType.js'
|
|
28
28
|
|
|
29
29
|
const values = ref({
|
|
30
|
-
prop1:'
|
|
31
|
-
prop2:'select1'
|
|
30
|
+
prop1:'112123123123123123',
|
|
31
|
+
prop2:'select1',
|
|
32
|
+
prop20:''
|
|
32
33
|
})
|
|
33
34
|
|
|
34
35
|
const BSGOAL_BASE_FORM_REF = ref(null)
|
|
@@ -53,6 +54,15 @@ const configOptions = ref([
|
|
|
53
54
|
rules:true,
|
|
54
55
|
readonly:true
|
|
55
56
|
},
|
|
57
|
+
{
|
|
58
|
+
label: 'prop20',
|
|
59
|
+
// value: '111',
|
|
60
|
+
prop: 'prop20',
|
|
61
|
+
type: EnumType.INPUT,
|
|
62
|
+
width: '100px',
|
|
63
|
+
rules:true,
|
|
64
|
+
readonly:true
|
|
65
|
+
},
|
|
56
66
|
{
|
|
57
67
|
label: 'prop2',
|
|
58
68
|
value: 'select2',
|
|
@@ -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-
|
|
5
|
+
* @LastEditTime: 2023-05-06 11:28:13
|
|
6
6
|
* @FilePath: \common\src\components\bsgoal-base-form\index.vue
|
|
7
7
|
* @Description: 表单公共组件
|
|
8
8
|
*
|
|
@@ -71,8 +71,15 @@ const props = defineProps({
|
|
|
71
71
|
* 全局只读
|
|
72
72
|
*/
|
|
73
73
|
readonlys: {
|
|
74
|
-
type: Boolean,
|
|
74
|
+
type: [Boolean],
|
|
75
75
|
default: false
|
|
76
|
+
},
|
|
77
|
+
/**
|
|
78
|
+
* 空字段 默认值
|
|
79
|
+
*/
|
|
80
|
+
none: {
|
|
81
|
+
type: [String],
|
|
82
|
+
default: '无'
|
|
76
83
|
}
|
|
77
84
|
})
|
|
78
85
|
|
|
@@ -96,7 +103,7 @@ const watchPropList = []
|
|
|
96
103
|
* @return {*} model
|
|
97
104
|
*/
|
|
98
105
|
watchEffect(() => {
|
|
99
|
-
const { configOptions, values } = props
|
|
106
|
+
const { configOptions, values, none = '' } = props
|
|
100
107
|
const options = unref(configOptions)
|
|
101
108
|
const valuesModel = unref(values)
|
|
102
109
|
options.forEach((fei) => {
|
|
@@ -104,7 +111,7 @@ watchEffect(() => {
|
|
|
104
111
|
if (![EnumType.INPUT, EnumType.INPUT_TEXT_AREA].includes(type)) {
|
|
105
112
|
watchPropList.push(prop)
|
|
106
113
|
}
|
|
107
|
-
model.value[prop] = valuesModel[prop] || value
|
|
114
|
+
model.value[prop] = valuesModel[prop] || value || none
|
|
108
115
|
})
|
|
109
116
|
})
|
|
110
117
|
|