mali-applet-ui 0.2.45 → 0.2.47
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.
|
@@ -40,8 +40,15 @@ export default {
|
|
|
40
40
|
readonly: Boolean,
|
|
41
41
|
vertical: Boolean,
|
|
42
42
|
labelWidth: String,
|
|
43
|
+
customVaild: Function,
|
|
43
44
|
className: String
|
|
44
45
|
},
|
|
46
|
+
inject: {
|
|
47
|
+
currVM: {
|
|
48
|
+
from: '$pageVM',
|
|
49
|
+
default: null
|
|
50
|
+
}
|
|
51
|
+
},
|
|
45
52
|
provide() {
|
|
46
53
|
return {
|
|
47
54
|
mlForm: this
|
|
@@ -105,6 +112,23 @@ export default {
|
|
|
105
112
|
if (rules) {
|
|
106
113
|
for (let i = 0; i < rules.length; i++) {
|
|
107
114
|
const rule = rules[i]
|
|
115
|
+
if (this.customVaild) {
|
|
116
|
+
const customStatus = this.customVaild.call(this.currVM, { item, rule, rules, data: this.value })
|
|
117
|
+
// 如果 true 则通过
|
|
118
|
+
if (customStatus === true) {
|
|
119
|
+
break
|
|
120
|
+
}
|
|
121
|
+
// 如果 true 则不通过
|
|
122
|
+
if (customStatus === false) {
|
|
123
|
+
errRule = rule
|
|
124
|
+
break
|
|
125
|
+
}
|
|
126
|
+
// 如果不通过并自定义提示语
|
|
127
|
+
if (XEUtils.isString(customStatus)) {
|
|
128
|
+
errRule = { field: item.field, message: customStatus }
|
|
129
|
+
break
|
|
130
|
+
}
|
|
131
|
+
}
|
|
108
132
|
if (rule.required) {
|
|
109
133
|
if (XEUtils.eqNull(itemValue) || itemValue === '') {
|
|
110
134
|
errRule = rule
|
|
@@ -170,7 +170,7 @@ export default {
|
|
|
170
170
|
this.$emit('input', this.fileList)
|
|
171
171
|
} else {
|
|
172
172
|
this.fileList = this.value.map(item => {
|
|
173
|
-
item.tempPath =
|
|
173
|
+
item.tempPath = this.getUrl(item)
|
|
174
174
|
return item
|
|
175
175
|
})
|
|
176
176
|
this.selectUniFileList = this.value.map(item => {
|