mali-applet-ui 1.0.1 → 1.0.2

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.
Files changed (90) hide show
  1. package/README.md +1 -1
  2. package/config/index.js +1 -1
  3. package/index.js +1 -1
  4. package/lib/components/ml-amount-input/ml-amount-input.vue +282 -0
  5. package/lib/components/ml-amount-text/ml-amount-text.vue +101 -0
  6. package/{components → lib/components}/ml-approval-record/ml-approval-record.vue +4 -4
  7. package/{components → lib/components}/ml-approval-select/ml-approval-select.vue +1 -1
  8. package/{components → lib/components}/ml-approval-type/ml-approval-type.vue +4 -4
  9. package/{components → lib/components}/ml-button/ml-button.vue +5 -5
  10. package/{components → lib/components}/ml-card/ml-card.vue +0 -0
  11. package/{components → lib/components}/ml-cascader-picker/ml-cascader-picker.vue +12 -12
  12. package/{components → lib/components}/ml-checkbox/ml-checkbox.vue +12 -12
  13. package/{components → lib/components}/ml-checkbox-button/ml-checkbox-button.vue +13 -13
  14. package/{components → lib/components}/ml-checkbox-group/ml-checkbox-group.vue +13 -13
  15. package/{components → lib/components}/ml-chunk-group/ml-chunk-group.vue +4 -4
  16. package/{components → lib/components}/ml-chunk-item/ml-chunk-item.vue +4 -4
  17. package/{components → lib/components}/ml-col/ml-col.vue +3 -3
  18. package/{components → lib/components}/ml-date-picker/ml-date-picker.vue +11 -11
  19. package/{components → lib/components}/ml-date-quick-range-picker/ml-date-quick-range-picker.vue +1 -1
  20. package/{components → lib/components}/ml-date-range-picker/ml-date-range-picker.vue +2 -2
  21. package/{components → lib/components}/ml-datetime-picker/ml-datetime-picker.vue +2 -2
  22. package/{components → lib/components}/ml-datetime-range-picker/ml-datetime-range-picker.vue +1 -1
  23. package/{components → lib/components}/ml-dict-type/ml-dict-type.vue +3 -3
  24. package/{components → lib/components}/ml-drawer/ml-drawer.vue +1 -1
  25. package/{components → lib/components}/ml-echarts/echarts.min.js +0 -0
  26. package/{components → lib/components}/ml-echarts/echarts.simple.min.js +0 -0
  27. package/lib/components/ml-echarts/ml-echarts.vue +249 -0
  28. package/{components → lib/components}/ml-echarts/wx-canvas.js +38 -39
  29. package/{components → lib/components}/ml-form/ml-form.vue +4 -4
  30. package/{components → lib/components}/ml-form-group/ml-form-group.vue +1 -1
  31. package/{components → lib/components}/ml-form-item/ml-form-item.vue +3 -3
  32. package/lib/components/ml-full-watermark/ml-full-watermark.vue +37 -0
  33. package/{components → lib/components}/ml-hint/ml-hint.vue +29 -29
  34. package/{iconfont.css → lib/components/ml-icon/iconfont.css} +0 -0
  35. package/{components → lib/components}/ml-icon/ml-icon.vue +2 -2
  36. package/{components → lib/components}/ml-image-swiper/ml-image-swiper.vue +4 -4
  37. package/lib/components/ml-input/ml-input.vue +237 -0
  38. package/{components → lib/components}/ml-list-group/ml-list-group.vue +17 -15
  39. package/{components → lib/components}/ml-list-item/ml-list-item.vue +2 -3
  40. package/{components → lib/components}/ml-list-menu-group/ml-list-menu-group.vue +2 -2
  41. package/{components → lib/components}/ml-list-menu-item/ml-list-menu-item.vue +2 -2
  42. package/{components → lib/components}/ml-load-more/ml-load-more.vue +28 -24
  43. package/{components → lib/components}/ml-modal/ml-modal.vue +1 -1
  44. package/{components → lib/components}/ml-month-picker/ml-month-picker.vue +6 -6
  45. package/{components → lib/components}/ml-navbar/ml-navbar.vue +1 -1
  46. package/{components → lib/components}/ml-not-data/ml-not-data.vue +2 -2
  47. package/lib/components/ml-number-input/ml-number-input.vue +271 -0
  48. package/{components → lib/components}/ml-picker-drawer/ml-picker-drawer.vue +1 -5
  49. package/{components → lib/components}/ml-progress-bar/ml-progress-bar.vue +2 -2
  50. package/{components → lib/components}/ml-province-city-picker/ml-province-city-picker.vue +9 -9
  51. package/{components → lib/components}/ml-province-city-picker/province-city.json +0 -0
  52. package/{components → lib/components}/ml-radio/ml-radio.vue +13 -13
  53. package/{components → lib/components}/ml-radio-button/ml-radio-button.vue +12 -12
  54. package/{components → lib/components}/ml-radio-group/ml-radio-group.vue +12 -12
  55. package/{components → lib/components}/ml-rich-text/html-parser.js +2 -0
  56. package/{components → lib/components}/ml-rich-text/ml-rich-text.vue +1 -1
  57. package/{components → lib/components}/ml-row/ml-row.vue +3 -3
  58. package/{components → lib/components}/ml-section/ml-section.vue +3 -3
  59. package/{components → lib/components}/ml-select-picker/ml-select-picker.vue +8 -8
  60. package/{components → lib/components}/ml-status-tag/ml-status-tag.vue +2 -2
  61. package/{components → lib/components}/ml-switch/ml-switch.vue +1 -1
  62. package/{components → lib/components}/ml-tab-pane/ml-tab-pane.vue +2 -2
  63. package/{components → lib/components}/ml-tabbar/ml-tabbar.vue +2 -2
  64. package/{components → lib/components}/ml-table/ml-table.vue +8 -11
  65. package/{components → lib/components}/ml-tabs/ml-tabs.vue +0 -0
  66. package/{components → lib/components}/ml-text/ml-text.vue +2 -2
  67. package/{components → lib/components}/ml-textarea/ml-textarea.vue +40 -40
  68. package/lib/components/ml-textarea/voice-input.vue +197 -0
  69. package/lib/components/ml-time-line/ml-time-line.vue +101 -0
  70. package/{components → lib/components}/ml-toast/ml-toast.vue +1 -1
  71. package/{components → lib/components}/ml-tooltip/ml-tooltip.vue +1 -1
  72. package/{components → lib/components}/ml-tooltip-view/ml-tooltip-view.vue +0 -0
  73. package/lib/components/ml-upload/file-handle.js +52 -0
  74. package/lib/components/ml-upload/ml-upload.vue +539 -0
  75. package/{components → lib/components}/ml-year-picker/ml-year-picker.vue +6 -6
  76. package/package.json +84 -13
  77. package/storage/index.js +5 -5
  78. package/utils/applet.js +1 -1
  79. package/utils/file.js +1 -1
  80. package/utils/number.js +1 -1
  81. package/components/ml-amount-input/ml-amount-input.vue +0 -282
  82. package/components/ml-amount-text/ml-amount-text.vue +0 -101
  83. package/components/ml-echarts/ml-echarts.vue +0 -249
  84. package/components/ml-full-watermark/ml-full-watermark.vue +0 -37
  85. package/components/ml-input/ml-input.vue +0 -237
  86. package/components/ml-number-input/ml-number-input.vue +0 -271
  87. package/components/ml-textarea/voice-input.vue +0 -197
  88. package/components/ml-time-line/ml-time-line.vue +0 -103
  89. package/components/ml-upload/file-handle.js +0 -51
  90. package/components/ml-upload/ml-upload.vue +0 -539
package/README.md CHANGED
@@ -25,7 +25,7 @@ npm install mali-applet-ui
25
25
  "easycom": {
26
26
  "autoscan": true,
27
27
  "custom": {
28
- "^ml-(.*)": "mali-applet-ui/components/ml-$1/ml-$1.vue"
28
+ "^ml-(.*)": "mali-applet-ui/lib/components/ml-$1/ml-$1.vue"
29
29
  }
30
30
  },
31
31
  // 此为本身已有的内容
package/config/index.js CHANGED
@@ -6,4 +6,4 @@ function config (options) {
6
6
  return globalStore
7
7
  }
8
8
 
9
- export default config
9
+ export default config
package/index.js CHANGED
@@ -15,7 +15,7 @@ const MaliUI = {
15
15
  }
16
16
 
17
17
  export {
18
- MaliUtils,
18
+ MaliUtils,
19
19
  MaliToast,
20
20
  MaliModal,
21
21
  MaliLoading,
@@ -0,0 +1,282 @@
1
+ <template>
2
+ <view v-if="isFromReadonly" class="ml-amount-input is-readonly" :class="[className || '', {'is-right': align === 'right'}]">
3
+ <view class="ml-amount-input-readonly-content">¥{{ amountLabel }}</view>
4
+ </view>
5
+ <view v-else-if="!editable && (platformEnv.isWXMP || platformEnv.isQWMP)" class="ml-amount-input not-edit" :class="[className || '', {'is-right': align === 'right', 'is-border': border}]">
6
+ <view class="ml-amount-input-simulate">
7
+ <text v-if="inpVal">{{ inpVal }}</text>
8
+ <text v-else class="ml-amount-input-placeholder">{{ placeholder }}</text>
9
+ </view>
10
+ </view>
11
+ <view v-else class="ml-amount-input" :class="[{'is-right': align === 'right', 'is-border': border, 'is-disabled': disabled, 'is-clear': clearable && inpVal}, className]">
12
+ <view v-if="showTip" class="ml-amount-tip">
13
+ <view>首位:</view>
14
+ <view class="ml-amount-tip-label">{{ firstNumLabel }}</view>
15
+ </view>
16
+ <input
17
+ v-model="inpVal"
18
+ type="digit"
19
+ class="ml-amount-input-inp"
20
+ autocomplete="off"
21
+ :placeholder="placeholder"
22
+ :maxlength="maxLength"
23
+ :disabled="disabled"
24
+ @blur="blurEvent"
25
+ @input="inputEvent" />
26
+ <view v-if="clearable && !disabled && inpVal" class="ml-amount-input-clear-icon" @click.stop="clearEvent">
27
+ <ml-icon name="delete-filling"></ml-icon>
28
+ </view>
29
+ </view>
30
+ </template>
31
+
32
+ <script>
33
+ import XEUtils from 'xe-utils'
34
+ import { getPlatformEnv, toAmountString, toWanAmountString } from '../../../utils'
35
+
36
+ function eqEmptyNull (value) {
37
+ return value === '' || XEUtils.eqNull(value)
38
+ }
39
+
40
+ export default {
41
+ name: 'MlAmountInput',
42
+ options: {
43
+ virtualHost: true
44
+ },
45
+ props: {
46
+ value: [String, Number],
47
+ align: String,
48
+ border: Boolean,
49
+ min: [Number, String],
50
+ max: {
51
+ type: [Number, String],
52
+ default: 9999999999
53
+ },
54
+ maxLength: {
55
+ type: Number,
56
+ default: 12
57
+ },
58
+ negative: Boolean,
59
+ placeholder: {
60
+ type: String,
61
+ default: '请输入'
62
+ },
63
+ disabled: {
64
+ type: Boolean,
65
+ default: false
66
+ },
67
+ editable: {
68
+ type: Boolean,
69
+ default: true
70
+ },
71
+ showTip: Boolean,
72
+ clearable: Boolean,
73
+ className: String
74
+ },
75
+ inject: {
76
+ form: {
77
+ from: 'mlForm',
78
+ default: null
79
+ }
80
+ },
81
+ data () {
82
+ return {
83
+ platformEnv: getPlatformEnv(),
84
+ inpVal: ''
85
+ }
86
+ },
87
+ computed: {
88
+ isFromReadonly () {
89
+ return this.form ? this.form.readonly : false
90
+ },
91
+ currAmountNum () {
92
+ return this.value === '' ? '' : Number(this.value || 0)
93
+ },
94
+ amountLabel () {
95
+ if (this.simplify) {
96
+ return toWanAmountString(this.value)
97
+ }
98
+ return toAmountString(this.value)
99
+ },
100
+ minNum () {
101
+ if (XEUtils.isNumber(this.min) || this.min) {
102
+ return Number(this.min || 0)
103
+ }
104
+ if (this.negative) {
105
+ return -9999999999
106
+ }
107
+ return 0
108
+ },
109
+ maxNum () {
110
+ if (XEUtils.isNumber(this.max) || this.max) {
111
+ return Number(this.max)
112
+ }
113
+ return null
114
+ },
115
+ firstNumLabel () {
116
+ const numVal = XEUtils.toNumber(this.value)
117
+ if (numVal > 999999999999) {
118
+ return '万亿'
119
+ } else if (numVal > 99999999999) {
120
+ return '千亿'
121
+ } else if (numVal > 9999999999) {
122
+ return '百亿'
123
+ } else if (numVal > 999999999) {
124
+ return '十亿'
125
+ } else if (numVal > 99999999) {
126
+ return '亿'
127
+ } else if (numVal > 9999999) {
128
+ return '千万'
129
+ } else if (numVal > 999999) {
130
+ return '百万'
131
+ } else if (numVal > 99999) {
132
+ return '十万'
133
+ } else if (numVal > 9999) {
134
+ return '万'
135
+ } else if (numVal > 999) {
136
+ return '千'
137
+ } else if (numVal > 99) {
138
+ return '百'
139
+ } else if (numVal > 9) {
140
+ return '十'
141
+ }
142
+ return '-'
143
+ }
144
+ },
145
+ watch: {
146
+ value (val) {
147
+ if (!this.updateModel) {
148
+ this.inpVal = val
149
+ }
150
+ this.updateModel = false
151
+ },
152
+ min () {
153
+ this.checkValue()
154
+ },
155
+ max () {
156
+ this.checkValue()
157
+ }
158
+ },
159
+ created () {
160
+ this.updateValue(this.value)
161
+ },
162
+ methods: {
163
+ updateValue (value) {
164
+ this.inpVal = eqEmptyNull(value) ? '' : XEUtils.toFixed(XEUtils.toNumber(value), 2)
165
+ },
166
+ checkValue () {
167
+ // 如果是空值,则不处理
168
+ if (eqEmptyNull(this.inpVal) && eqEmptyNull(this.value)) {
169
+ return { status: false, value: this.inpVal }
170
+ }
171
+ const numVal = XEUtils.toNumber(this.inpVal)
172
+ if (this.minNum !== null && (numVal < this.minNum)) {
173
+ this.$emit('input', this.minNum)
174
+ return { status: false, value: this.minNum }
175
+ }
176
+ if (this.maxNum !== null && (numVal > this.maxNum)) {
177
+ this.$emit('input', this.maxNum)
178
+ return { status: false, value: this.maxNum }
179
+ }
180
+ const val = XEUtils.floor(numVal, 2)
181
+ if (`${val}` !== `${this.value}`) {
182
+ this.$emit('input', val)
183
+ return { status: false, value: val }
184
+ }
185
+ return { status: true, value: numVal }
186
+ },
187
+ blurEvent () {
188
+ const rest = this.checkValue()
189
+ this.updateModel = rest.status
190
+ if (rest.status) {
191
+ this.$nextTick(() => {
192
+ this.updateValue(rest.value)
193
+ })
194
+ }
195
+ this.$emit('blur', { value: this.inpVal })
196
+ },
197
+ inputEvent () {
198
+ const value = this.inpVal
199
+ this.$emit('input', value)
200
+ this.$emit('change', { value })
201
+ },
202
+ clearEvent () {
203
+ this.inpVal = ''
204
+ this.inputEvent()
205
+ this.$emit('clear', { value: this.inpVal })
206
+ }
207
+ }
208
+ }
209
+ </script>
210
+
211
+ <style lang="scss">
212
+ .ml-amount-input {
213
+ position: relative;
214
+ flex-grow: 1;
215
+ display: flex;
216
+ flex-direction: row;
217
+ .ml-amount-input-placeholder {
218
+ color: $uni-text-color-placeholder;
219
+ }
220
+ .ml-amount-input-readonly-content {
221
+ padding: 20rpx 4rpx;
222
+ }
223
+ .ml-amount-input-simulate {
224
+ padding: 0 10rpx;
225
+ height: 70rpx;
226
+ line-height: 70rpx;
227
+ overflow: hidden;
228
+ text-overflow: ellipsis;
229
+ white-space: nowrap;
230
+ background: #ffffff;
231
+ }
232
+ &.is-right {
233
+ .ml-amount-input-inp,
234
+ .ml-amount-input-simulate {
235
+ text-align: right;
236
+ }
237
+ }
238
+ &.is-border {
239
+ .ml-amount-input-inp,
240
+ .ml-amount-input-simulate {
241
+ border: 1px solid #e5e5e5;
242
+ border-radius: $ml-border-radius;
243
+ }
244
+ }
245
+ .ml-amount-tip {
246
+ display: flex;
247
+ flex-direction: row;
248
+ position: absolute;
249
+ top: -60rpx;
250
+ right: 10rpx;
251
+ z-index: 1;
252
+ .ml-amount-tip-label {
253
+ min-width: 60rpx;
254
+ text-align: right;
255
+ }
256
+ }
257
+ .ml-amount-input-inp {
258
+ outline: 0;
259
+ }
260
+ .ml-amount-input-inp,
261
+ .ml-amount-input-simulate {
262
+ font-size: $uni-font-size-base;
263
+ width: 100%;
264
+ height: 70rpx;
265
+ padding: 0 10rpx;
266
+ }
267
+ .ml-amount-input-inp::-webkit-outer-spin-button,
268
+ .ml-amount-input-inp::-webkit-inner-spin-button {
269
+ -webkit-appearance: none;
270
+ }
271
+ .ml-amount-input-clear-icon {
272
+ width: 60rpx;
273
+ display: flex;
274
+ flex-shrink: 0;
275
+ align-items: center;
276
+ justify-content: center;
277
+ background: #fff;
278
+ color: #c0c4cc;
279
+ border-radius: 0 $ml-border-radius $ml-border-radius 0;
280
+ }
281
+ }
282
+ </style>
@@ -0,0 +1,101 @@
1
+ <template>
2
+ <view class="ml-amount-text" :class="[className || '', status ? `ss-${status}` : '', {'is-underline': underline}]">
3
+ <slot name="symbol">
4
+ <view v-if="symbol" class="amount-flag">¥</view>
5
+ </slot>
6
+ <slot>
7
+ <view class="amount-num">{{ amountLabel }}</view>
8
+ </slot>
9
+ <slot name="unit">
10
+ <view v-if="unit" class="amount-unit">{{ amountUnit }}</view>
11
+ </slot>
12
+ </view>
13
+ </template>
14
+
15
+ <script>
16
+ import { toAmountString, toWanAmountString } from '../../../utils'
17
+
18
+ export default {
19
+ name: 'MlAmountText',
20
+ options: {
21
+ virtualHost: true
22
+ },
23
+ props: {
24
+ value: [String, Number],
25
+ simplify: Boolean,
26
+ status: String,
27
+ symbol: {
28
+ type: Boolean,
29
+ default: false
30
+ },
31
+ unit: Boolean,
32
+ underline: Boolean,
33
+ className: String
34
+ },
35
+ computed: {
36
+ amountUnit () {
37
+ if (this.simplify) {
38
+ return '万元'
39
+ }
40
+ return '元'
41
+ },
42
+ amountLabel () {
43
+ if (this.simplify) {
44
+ return toWanAmountString(this.value)
45
+ }
46
+ return toAmountString(this.value)
47
+ }
48
+ }
49
+ }
50
+ </script>
51
+
52
+ <style lang="scss">
53
+ .ml-amount-text {
54
+ display: inline;
55
+ padding: 0 4rpx;
56
+ &.is-underline {
57
+ text-decoration: underline;
58
+ }
59
+ .amount-flag,
60
+ .amount-num,
61
+ .amount-unit {
62
+ display: inline;
63
+ }
64
+ .amount-unit {
65
+ padding-left: 5rpx;
66
+ }
67
+ &.ss-primary {
68
+ color: $uni-color-primary;
69
+ }
70
+ &.ss-success {
71
+ color: $uni-color-success;
72
+ }
73
+ &.ss-info {
74
+ color: #909399;
75
+ }
76
+ &.ss-warning {
77
+ color: $uni-color-warning;
78
+ }
79
+ &.ss-danger {
80
+ color: $uni-color-error;
81
+ }
82
+ &.ss-gray {
83
+ color: $ml-gray-color;
84
+ }
85
+ &.ss-blue {
86
+ color: $ml-blue-color;
87
+ }
88
+ &.ss-green {
89
+ color: $ml-green-color;
90
+ }
91
+ &.ss-pink {
92
+ color: $ml-pink-color;
93
+ }
94
+ &.ss-orange {
95
+ color: $ml-orange-color;
96
+ }
97
+ &.ss-purple {
98
+ color: $ml-purple-color;
99
+ }
100
+ }
101
+ </style>
@@ -37,7 +37,7 @@
37
37
  </template>
38
38
 
39
39
  <script>
40
- import globalStore from '../../config/store'
40
+ import globalStore from '../../../config/store'
41
41
 
42
42
  export default {
43
43
  name: 'MlApprovalRecord',
@@ -188,9 +188,9 @@ export default {
188
188
  display: inline-block;
189
189
  vertical-align: middle;
190
190
  max-width: 150rpx;
191
- overflow: hidden;
192
- text-overflow: ellipsis;
193
- white-space: nowrap;
191
+ overflow: hidden;
192
+ text-overflow: ellipsis;
193
+ white-space: nowrap;
194
194
  margin-right: 10rpx;
195
195
  color: rgba(0, 0, 0, 0.85);
196
196
  }
@@ -41,7 +41,7 @@
41
41
  </template>
42
42
 
43
43
  <script>
44
- import globalStore from '../../config/store'
44
+ import globalStore from '../../../config/store'
45
45
 
46
46
  export default {
47
47
  name: 'MlApprovalSelect',
@@ -3,7 +3,7 @@
3
3
  </template>
4
4
 
5
5
  <script>
6
- import globalStore from '../../config/store'
6
+ import globalStore from '../../../config/store'
7
7
 
8
8
  export default {
9
9
  name: 'MlApprovalType',
@@ -27,8 +27,8 @@ export default {
27
27
  return this.selectItem ? this.selectItem.label : ''
28
28
  },
29
29
  styles () {
30
- const colStys = this.selectItem && this.selectItem.background? `background:${this.selectItem.background};` : ''
31
- const bgStys = this.selectItem && this.selectItem.color? `color:${this.selectItem.color};` : ''
30
+ const colStys = this.selectItem && this.selectItem.background ? `background:${this.selectItem.background};` : ''
31
+ const bgStys = this.selectItem && this.selectItem.color ? `color:${this.selectItem.color};` : ''
32
32
  return `${bgStys}${colStys}`
33
33
  }
34
34
  }
@@ -42,4 +42,4 @@ export default {
42
42
  border-radius: $ml-border-radius;
43
43
  font-size: 24rpx;
44
44
  }
45
- </style>
45
+ </style>
@@ -6,7 +6,7 @@
6
6
 
7
7
  <script>
8
8
  export default {
9
- name: 'MlButton',
9
+ name: 'MlButton',
10
10
  options: {
11
11
  virtualHost: true
12
12
  },
@@ -29,7 +29,7 @@ export default {
29
29
  },
30
30
  computed: {
31
31
  styles () {
32
- const wStyle = this.width ? `width:${this.width};` : ''
32
+ const wStyle = this.width ? `width:${this.width};` : ''
33
33
  const hStyle = this.height ? `height:${this.height};line-height:${this.height};` : ''
34
34
  return `${wStyle}${hStyle}`
35
35
  }
@@ -68,7 +68,7 @@ export default {
68
68
  line-height: 1.5;
69
69
  vertical-align: middle;
70
70
  background: transparent;
71
- font-size: $uni-font-size-base;
71
+ font-size: $uni-font-size-base;
72
72
  &.is-underline {
73
73
  text-decoration: underline;
74
74
  }
@@ -113,7 +113,7 @@ export default {
113
113
  line-height: 76rpx;
114
114
  border: 1px solid #e5e5e5;
115
115
  border-radius: $ml-border-radius;
116
- font-size: 32rpx;
116
+ font-size: 32rpx;
117
117
  &+.ml-button {
118
118
  margin-left: $ml-button-interval-margin;
119
119
  }
@@ -207,4 +207,4 @@ export default {
207
207
  }
208
208
  }
209
209
  }
210
- </style>
210
+ </style>
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <view v-if="isFromReadonly" class="ml-cascader-picker is-readonly">
3
- <view class="ml-cascader-picker-readonly-content">{{ selectLabel }}</view>
4
- </view>
2
+ <view v-if="isFromReadonly" class="ml-cascader-picker is-readonly">
3
+ <view class="ml-cascader-picker-readonly-content">{{ selectLabel }}</view>
4
+ </view>
5
5
  <view v-else class="ml-cascader-picker" :class="[className || '', {'is-border': border, 'is-clear': value.length}]">
6
6
  <view class="ml-cascader-picker-warpper" @click="openPopup()">
7
7
  <view class="ml-cascader-picker-text">
@@ -59,14 +59,14 @@ export default {
59
59
  2: [],
60
60
  3: [],
61
61
  4: [],
62
- 5: [],
62
+ 5: []
63
63
  }
64
64
  }
65
65
  },
66
66
  computed: {
67
- isFromReadonly () {
68
- return this.form ? this.form.readonly : false
69
- },
67
+ isFromReadonly () {
68
+ return this.form ? this.form.readonly : false
69
+ },
70
70
  optOptions () {
71
71
  return Object.assign({}, this.optionProps)
72
72
  },
@@ -145,9 +145,9 @@ export default {
145
145
  let prevItem = null
146
146
  if (prevOpts) {
147
147
  prevItem = prevOpts[this.selectIndexs[i - 1]]
148
- if (!prevItem) {
149
- prevItem = prevOpts.find(item => item[this.optValueField] === prevValue)
150
- }
148
+ // if (!prevItem) {
149
+ // prevItem = prevOpts.find(item => item[this.optValueField] === prevValue)
150
+ // }
151
151
  }
152
152
  if (prevItem) {
153
153
  const currList = prevItem[this.optChildrenField] || []
@@ -177,8 +177,8 @@ export default {
177
177
  this.selectIndexs.slice(0, this.countLevel).forEach((valIndex, colIndex) => {
178
178
  const item = this.pickerDataMaps[colIndex][valIndex]
179
179
  selection.push(item || null)
180
- value.push(item ? item[this.optValueField] : null)
181
- labels.push(item ? item[this.optLabelField] : '')
180
+ value.push(item ? item[this.optValueField] : null)
181
+ labels.push(item ? item[this.optLabelField] : '')
182
182
  })
183
183
  this.$emit('input', value)
184
184
  this.$emit('change', { value, labels, selection })
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="ml-checkbox" :class="[className || '', {'is-vertical': vertical, 'is-checked': checked, 'is-half': indeterminate, 'is-disabled': disabled}]" @tap="tapEvent">
2
+ <view class="ml-checkbox" :class="[className || '', {'is-vertical': vertical, 'is-checked': checked, 'is-half': indeterminate, 'is-disabled': disabled}]" @tap="tapEvent">
3
3
  <view class="ml-checkbox-icon">
4
4
  <ml-icon :name="checked ? 'checkbox-checked' : (indeterminate ? 'checkbox-indeterminate' : 'checkbox-unchecked')"></ml-icon>
5
5
  </view>
@@ -13,12 +13,12 @@
13
13
 
14
14
  <script>
15
15
  export default {
16
- name: 'MlCheckbox',
16
+ name: 'MlCheckbox',
17
17
  options: {
18
18
  virtualHost: true
19
19
  },
20
- props: {
21
- value: [Boolean, Number, String],
20
+ props: {
21
+ value: [Boolean, Number, String],
22
22
  label: {
23
23
  type: [Boolean, Number, String],
24
24
  default: null
@@ -28,7 +28,7 @@ export default {
28
28
  vertical: Boolean,
29
29
  content: String,
30
30
  className: String
31
- },
31
+ },
32
32
  computed: {
33
33
  checked () {
34
34
  if (this.label === null) {
@@ -37,8 +37,8 @@ export default {
37
37
  return this.label === this.value
38
38
  }
39
39
  },
40
- methods: {
41
- tapEvent () {
40
+ methods: {
41
+ tapEvent () {
42
42
  if (this.disabled) {
43
43
  return
44
44
  }
@@ -48,10 +48,10 @@ export default {
48
48
  } else {
49
49
  value = this.checked ? null : this.label
50
50
  }
51
- this.$emit('input', value)
52
- this.$emit('change', { value, label: this.label, checked: !this.checked })
53
- }
54
- }
51
+ this.$emit('input', value)
52
+ this.$emit('change', { value, label: this.label, checked: !this.checked })
53
+ }
54
+ }
55
55
  }
56
56
  </script>
57
57
 
@@ -93,4 +93,4 @@ export default {
93
93
  .ml-checkbox-content {
94
94
  flex-grow: 1;
95
95
  }
96
- </style>
96
+ </style>
@@ -1,41 +1,41 @@
1
1
  <template>
2
- <view class="ml-checkbox-button" :class="[className || '', {'is-disabled': disabled}]">
2
+ <view class="ml-checkbox-button" :class="[className || '', {'is-disabled': disabled}]">
3
3
  <view class="ml-checkbox-button-item" v-for="(item, index) in optionList" :class="{'is-disabled': disabled, 'is-active': value.includes(item.value)}" :key="index" @tap="changeEvent(item)">{{ item.label }}</view>
4
4
  </view>
5
5
  </template>
6
6
 
7
7
  <script>
8
8
  export default {
9
- name: 'MlCheckboxButton',
9
+ name: 'MlCheckboxButton',
10
10
  options: {
11
11
  virtualHost: true
12
12
  },
13
- props: {
14
- value: Array,
13
+ props: {
14
+ value: Array,
15
15
  isAll: Boolean,
16
16
  options: Array,
17
17
  disabled: Boolean,
18
18
  className: String
19
- },
19
+ },
20
20
  computed: {
21
21
  optionList () {
22
22
  return this.options || []
23
23
  }
24
24
  },
25
- methods: {
26
- changeEvent (option) {
25
+ methods: {
26
+ changeEvent (option) {
27
27
  if (this.disabled) {
28
28
  return
29
29
  }
30
30
  const checked = !this.value.includes(option.value)
31
- let value = this.value.filter(val => val !== option.value)
31
+ const value = this.value.filter(val => val !== option.value)
32
32
  if (checked) {
33
33
  value.push(option.value)
34
34
  }
35
- this.$emit('input', value)
36
- this.$emit('change', { value, option })
37
- }
38
- }
35
+ this.$emit('input', value)
36
+ this.$emit('change', { value, option })
37
+ }
38
+ }
39
39
  }
40
40
  </script>
41
41
 
@@ -65,4 +65,4 @@ export default {
65
65
  color: rgba(0,0,0,0.25);
66
66
  }
67
67
  }
68
- </style>
68
+ </style>