mali-applet-ui 1.0.85 → 1.0.87

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.
@@ -15,6 +15,7 @@ export default {
15
15
  type: Boolean,
16
16
  default: true
17
17
  },
18
+ zIndex: [Number, String],
18
19
  backgroundColor: String
19
20
  },
20
21
  provide () {
@@ -36,7 +37,8 @@ export default {
36
37
  styles () {
37
38
  const bomSys = this.bottom ? `bottom:${this.bottom};` : ''
38
39
  const bgSys = this.backgroundColor ? `background:${this.backgroundColor};` : ''
39
- return `${bomSys}${bgSys}`
40
+ const zSys = this.zIndex ? `z-index:${this.zIndex};` : ''
41
+ return `${bomSys}${bgSys}${zSys}`
40
42
  },
41
43
  activeTab () {
42
44
  if (this.tabs) {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="ml-list-select-page" :class="[className || '', {'is-border': border}]" @tap="tapEvent">
2
+ <view class="ml-list-select-page" :class="[className || '', {'is-border': border, 'is-disabled': disabled}]" @tap="tapEvent">
3
3
  <view class="ml-list-select-page-warpper">
4
4
  <view v-if="hasEmpty" class="ml-list-select-page-placeholder">{{ placeholder }}</view>
5
5
  <view v-else>
@@ -8,7 +8,7 @@
8
8
  </slot>
9
9
  </view>
10
10
  </view>
11
- <view v-if="clearable && value.length" class="ml-list-select-page-clear-icon" @click.stop="clearEvent">
11
+ <view v-if="clearable && !hasEmpty" class="ml-list-select-page-clear-icon" @click.stop="clearEvent">
12
12
  <ml-icon name="delete-filling"></ml-icon>
13
13
  </view>
14
14
  <view v-else class="ml-list-select-page-icon">
@@ -38,6 +38,7 @@ export default {
38
38
  type: String,
39
39
  default: '请选择'
40
40
  },
41
+ disabled: Boolean,
41
42
  border: Boolean,
42
43
  clearable: Boolean,
43
44
  className: String
@@ -64,17 +65,20 @@ export default {
64
65
  return XEUtils.eqNull(this.value) || this.value === ''
65
66
  },
66
67
  selectLabel () {
68
+ let rest = []
67
69
  if (this.type === 'checkbox') {
68
- return this.dataList.filter(item => this.value.includes(item[this.optValueField])).map(item => item[this.optLabelField]).join(', ')
70
+ rest = this.dataList.filter(item => this.value.includes(item[this.optValueField]))
71
+ } else if (this.type === 'radio') {
72
+ rest = this.dataList.filter(item => this.value === item[this.optValueField])
69
73
  }
70
- if (this.type === 'radio') {
71
- return this.dataList.filter(item => this.value === item[this.optValueField]).map(item => item[this.optLabelField]).join(', ')
72
- }
73
- return ''
74
+ return rest.map(item => item[this.optLabelField]).join(',')
74
75
  }
75
76
  },
76
77
  methods: {
77
78
  tapEvent () {
79
+ if (this.disabled) {
80
+ return
81
+ }
78
82
  // 打开选择列表页面
79
83
  this.$store.dispatch('openSelectPage', {
80
84
  compName: this.compRender.name, // 指定加载组件名称
@@ -99,7 +103,12 @@ export default {
99
103
  this.$emit('click', {})
100
104
  },
101
105
  clearEvent () {
102
-
106
+ let value = null
107
+ if (this.type === 'checkbox') {
108
+ value = []
109
+ }
110
+ this.$emit('input', value)
111
+ this.$emit('clear', { value })
103
112
  }
104
113
  }
105
114
  }
@@ -112,6 +121,9 @@ export default {
112
121
  padding: 0 10rpx;
113
122
  height: 70rpx;
114
123
  line-height: 70rpx;
124
+ &.is-disabled {
125
+
126
+ }
115
127
  .ml-list-select-page-warpper {
116
128
  flex-grow: 1;
117
129
  overflow: hidden;
@@ -122,6 +134,9 @@ export default {
122
134
  .ml-list-select-page-icon {
123
135
  flex-shrink: 0;
124
136
  }
137
+ .ml-list-select-page-clear-icon {
138
+ color: $ml-input-clear-icon-color;
139
+ }
125
140
  .ml-list-select-page-placeholder {
126
141
  color: $ml-input-color-placeholder;
127
142
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "1.0.85",
3
+ "version": "1.0.87",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "lib",