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.
@@ -65,7 +65,8 @@ export default {
65
65
  })
66
66
  }
67
67
  }
68
- }
68
+ },
69
+ openAddUser () {}
69
70
  }
70
71
  }
71
72
  </script>
@@ -25,6 +25,7 @@ export default {
25
25
  height:String,
26
26
  width: String,
27
27
  lazyLoad:Boolean,
28
+ formatLegend: Function,
28
29
  className: String
29
30
  },
30
31
  inject: {
@@ -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 = item[this.urlField]
173
+ item.tempPath = this.getUrl(item)
174
174
  return item
175
175
  })
176
176
  this.selectUniFileList = this.value.map(item => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "0.2.45",
3
+ "version": "0.2.47",
4
4
  "description": "码里云小程序组件库",
5
5
  "scripts": {
6
6
  "release": "node script/release.js && npm publish"