easybill-ui 0.1.13 → 0.1.15
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.
|
@@ -85,14 +85,14 @@ export default defineComponent({
|
|
|
85
85
|
// 先从schema中读取默认值
|
|
86
86
|
const schemaValues = sFormSchema.value.formItem.reduce<Fields>((previousValue, currentValue) => {
|
|
87
87
|
currentValue.eventObject ??= {}
|
|
88
|
-
typeof currentValue.value == "undefined" ? false : currentValue.prop && (previousValue[currentValue.prop] = currentValue.value)
|
|
88
|
+
typeof currentValue.value == "undefined" ? false : currentValue.prop && (typeof formModel[currentValue.prop] == "undefined" || formModel[currentValue.prop] === "" || formModel[currentValue.prop] === null) && (previousValue[currentValue.prop] = currentValue.value)
|
|
89
89
|
return previousValue
|
|
90
90
|
}, {})
|
|
91
91
|
|
|
92
92
|
Object.assign(formModel, schemaValues)
|
|
93
93
|
// 如果有默认值,则覆盖
|
|
94
94
|
props.fields && Object.assign(formModel, props.fields)
|
|
95
|
-
Object.assign(formModel, props.modelValue)
|
|
95
|
+
// Object.assign(formModel, props.modelValue)
|
|
96
96
|
// props.modelValue && Object.assign(formModel, props.modelValue)
|
|
97
97
|
// 异步设置默认数据
|
|
98
98
|
sFormSchema.value.formItem.forEach(async (item) => {
|
|
@@ -56,14 +56,22 @@ const eventObject = ref(
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
const changeFun = props.formItem.eventObject.change
|
|
59
|
-
result.change = () => {
|
|
59
|
+
result.change = (...args: any) => {
|
|
60
60
|
if (changeFun) {
|
|
61
|
-
const flag = changeFun && changeFun(props.formModel, props.formItem, formContext)
|
|
61
|
+
const flag = changeFun && changeFun(props.formModel, props.formItem, formContext, ...args)
|
|
62
62
|
if (flag) {
|
|
63
|
-
emit("change", props.formModel, props.formItem, formContext)
|
|
63
|
+
emit("change", props.formModel, props.formItem, formContext, ...args)
|
|
64
64
|
}
|
|
65
65
|
} else {
|
|
66
|
-
emit("change", props.formModel, props.formItem, formContext)
|
|
66
|
+
emit("change", props.formModel, props.formItem, formContext, ...args)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
for (let i in result) {
|
|
70
|
+
if (i !== "change") {
|
|
71
|
+
const fun = result[i]
|
|
72
|
+
result[i] = (...args: any) => {
|
|
73
|
+
fun(props.formModel, props.formItem, formContext, ...args)
|
|
74
|
+
}
|
|
67
75
|
}
|
|
68
76
|
}
|
|
69
77
|
return result
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ElTooltipProps } from "element-plus"
|
|
2
2
|
import { OptionItem } from "../../ConstantStatus/src/types"
|
|
3
3
|
|
|
4
|
-
export interface DetailDataItem {
|
|
4
|
+
export interface DetailDataItem extends Record<string, any> {
|
|
5
5
|
label?: string
|
|
6
6
|
value?: string | number | boolean
|
|
7
7
|
/** 当前项占的宽度,最大24, 默认24 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easybill-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "A component library for easybill",
|
|
5
5
|
"author": "tuchongyang <779311998@qq.com>",
|
|
6
6
|
"private": false,
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"publishConfig": {
|
|
15
15
|
"access": "public"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "3a4e0176fa8a2b7ad06158ac2f7bffab71e0268d"
|
|
18
18
|
}
|