mali-applet-ui 1.0.72 → 1.0.74
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-amount-text" :class="[className || '', status ? `ss-${status}` : '', {'is-underline': underline}]">
|
|
2
|
+
<view class="ml-amount-text" :class="[className || '', status ? `ss-${status}` : '', {'is-underline': underline}]" @tap="tapEvent">
|
|
3
3
|
<slot name="symbol">
|
|
4
4
|
<view v-if="symbol" class="amount-flag">¥</view>
|
|
5
5
|
</slot>
|
|
@@ -45,6 +45,12 @@ export default {
|
|
|
45
45
|
}
|
|
46
46
|
return toAmountString(this.value)
|
|
47
47
|
}
|
|
48
|
+
},
|
|
49
|
+
methods: {
|
|
50
|
+
tapEvent () {
|
|
51
|
+
this.$emit('tap', {})
|
|
52
|
+
this.$emit('click', {})
|
|
53
|
+
}
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
56
|
</script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<view v-if="isFromReadonly" class="ml-date-picker is-readonly">
|
|
3
3
|
<view class="ml-date-picker-readonly-content">{{ value }}</view>
|
|
4
4
|
</view>
|
|
5
|
-
<uni-datetime-picker v-else :class="className" v-model="selectVal" type="date" :start="minDate" :end="maxDate" :placeholder="placeholder" @change="changeEvent" :border="border"/>
|
|
5
|
+
<uni-datetime-picker v-else :class="className" v-model="selectVal" type="date" :start="minDate" :end="maxDate" :placeholder="placeholder" @change="changeEvent" :clearIcon="clearable" :border="border"/>
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script>
|
|
@@ -17,6 +17,7 @@ export default {
|
|
|
17
17
|
type: Boolean,
|
|
18
18
|
default: false
|
|
19
19
|
},
|
|
20
|
+
clearable: Boolean,
|
|
20
21
|
minDate: [String, Number],
|
|
21
22
|
maxDate: [String, Number],
|
|
22
23
|
placeholder: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-dict-type" :class="[className || '', (status || showStatus) && selectStatus ? `ss-${selectStatus}` : '', {'is-underline': underline, 'is-border': border, 'is-round': round}]">
|
|
2
|
+
<view class="ml-dict-type" :class="[className || '', (status || showStatus) && selectStatus ? `ss-${selectStatus}` : '', {'is-underline': underline, 'is-border': border, 'is-round': round}]" @tap="tapEvent">
|
|
3
3
|
<view v-if="prefixIcon && prefixIcon !== 'none'" class="ml-dict-type-left-icon">
|
|
4
4
|
<ml-icon :className="prefixIcon"></ml-icon>
|
|
5
5
|
</view>
|
|
@@ -56,6 +56,12 @@ export default {
|
|
|
56
56
|
optStatusField () {
|
|
57
57
|
return this.optOptions.status || 'status'
|
|
58
58
|
}
|
|
59
|
+
},
|
|
60
|
+
methods: {
|
|
61
|
+
tapEvent () {
|
|
62
|
+
this.$emit('tap', {})
|
|
63
|
+
this.$emit('click', {})
|
|
64
|
+
}
|
|
59
65
|
}
|
|
60
66
|
}
|
|
61
67
|
</script>
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
@change="handleChangeCheckbox(item)"></ml-checkbox>
|
|
29
29
|
<ml-radio :value="checkIndex" :label="item[useProps.key]" v-else @change="handleChangeRadio"></ml-radio>
|
|
30
30
|
</view>
|
|
31
|
-
<MlTreeIcon @click="e => $emit('click-icon', 'prefix'
|
|
31
|
+
<MlTreeIcon @click="e => $emit('click-icon', item, 'prefix')" :info="getPrefixIcon(item)" :key="index"></MlTreeIcon>
|
|
32
32
|
<view class="ml-tree-node__title" @click="handleIntoChildren(item)">
|
|
33
|
-
<view>{{ item[useProps.label] || '' }}</view>
|
|
33
|
+
<view class="nowrap">{{ item[useProps.label] || '' }}</view>
|
|
34
34
|
<view class="ml-tree-node__explain" v-if="item[useProps.explain]">{{ item[useProps.explain] }}</view>
|
|
35
35
|
</view>
|
|
36
36
|
<view class="ml-tree-node__extra">
|
|
37
|
-
<MlTreeIcon @click="e => $emit('click-icon', 'suffix'
|
|
38
|
-
<MlTreeIcon @click="handleIntoChildren(item)" v-if="item.children && item.children.length" :info="{ icon: 'arrow-right' }" :key="index"></MlTreeIcon>
|
|
37
|
+
<MlTreeIcon @click="e => $emit('click-icon', item, 'suffix')" :info="getSuffixIcon(item)" :key="index"></MlTreeIcon>
|
|
38
|
+
<MlTreeIcon @click="handleIntoChildren(item)" v-if="(item.children && item.children.length) || (lazy && !item.isLeaf)" :info="{ icon: 'arrow-right' }" :key="index"></MlTreeIcon>
|
|
39
39
|
</view>
|
|
40
40
|
</view>
|
|
41
41
|
</view>
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
</template>
|
|
44
44
|
|
|
45
45
|
<script>
|
|
46
|
-
import MlTreeIcon from './ml-tree-icon'
|
|
46
|
+
import MlTreeIcon from './ml-tree-icon.vue'
|
|
47
47
|
import { findNodesByKeys, findTreeByKey } from './utils'
|
|
48
48
|
|
|
49
49
|
export default {
|
|
@@ -57,6 +57,8 @@ export default {
|
|
|
57
57
|
check: Boolean,
|
|
58
58
|
multiple: Boolean,
|
|
59
59
|
breadcrumb: Boolean,
|
|
60
|
+
lazy: Boolean,
|
|
61
|
+
lazyLoad: Function,
|
|
60
62
|
strictly: Boolean,
|
|
61
63
|
arbitrary: Boolean,
|
|
62
64
|
props: {
|
|
@@ -91,7 +93,8 @@ export default {
|
|
|
91
93
|
label: 'label',
|
|
92
94
|
children: 'children',
|
|
93
95
|
explain: 'explain',
|
|
94
|
-
user: 'user'
|
|
96
|
+
user: 'user',
|
|
97
|
+
isLeaf: 'isLeaf'
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
},
|
|
@@ -115,11 +118,25 @@ export default {
|
|
|
115
118
|
}
|
|
116
119
|
},
|
|
117
120
|
methods: {
|
|
118
|
-
handleIntoChildren (item) {
|
|
121
|
+
async handleIntoChildren (item) {
|
|
122
|
+
const { lazyLoad, lazy } = this
|
|
123
|
+
if (!(item.children && item.children) && lazy && lazyLoad && !item.isLeaf) {
|
|
124
|
+
// this.lazyLoading = true
|
|
125
|
+
await lazyLoad(item)
|
|
126
|
+
// this.lazyLoading = false
|
|
127
|
+
}
|
|
119
128
|
if (item.children && item.children.length) {
|
|
120
129
|
this.cache.push(item)
|
|
121
130
|
}
|
|
122
131
|
},
|
|
132
|
+
async reloadLazy () {
|
|
133
|
+
const { lazyLoad, lazy, current } = this
|
|
134
|
+
if (lazy && lazyLoad) {
|
|
135
|
+
// this.lazyLoading = true
|
|
136
|
+
await lazyLoad(current)
|
|
137
|
+
// this.lazyLoading = false
|
|
138
|
+
}
|
|
139
|
+
},
|
|
123
140
|
handleBack () {
|
|
124
141
|
const { cache } = this
|
|
125
142
|
cache.splice(cache.length - 1, 1)
|
|
@@ -302,6 +319,12 @@ export default {
|
|
|
302
319
|
|
|
303
320
|
.ml-tree-node__title {
|
|
304
321
|
flex: 1;
|
|
322
|
+
width: 0;
|
|
323
|
+
.nowrap {
|
|
324
|
+
white-space: nowrap;
|
|
325
|
+
overflow: hidden;
|
|
326
|
+
text-overflow: ellipsis;
|
|
327
|
+
}
|
|
305
328
|
|
|
306
329
|
&.back {
|
|
307
330
|
color: #6e6e6e;
|