mali-applet-ui 1.0.103 → 1.0.105
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.
|
@@ -24,6 +24,7 @@ export default {
|
|
|
24
24
|
name: 'MlListSelectPage',
|
|
25
25
|
props: {
|
|
26
26
|
value: [Array, Number, String],
|
|
27
|
+
defaultOptions: Array,
|
|
27
28
|
optionProps: Object,
|
|
28
29
|
compTitle: {
|
|
29
30
|
type: String,
|
|
@@ -74,6 +75,14 @@ export default {
|
|
|
74
75
|
return rest.map(item => item[this.optLabelField]).join(',')
|
|
75
76
|
}
|
|
76
77
|
},
|
|
78
|
+
watch: {
|
|
79
|
+
defaultOptions () {
|
|
80
|
+
this.dataList = this.defaultOptions
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
created () {
|
|
84
|
+
this.dataList = this.defaultOptions
|
|
85
|
+
},
|
|
77
86
|
methods: {
|
|
78
87
|
tapEvent () {
|
|
79
88
|
if (this.disabled) {
|
|
@@ -28,6 +28,7 @@ export default {
|
|
|
28
28
|
name: 'MlListSelectPage',
|
|
29
29
|
props: {
|
|
30
30
|
value: [Array, Number, String],
|
|
31
|
+
defaultOptions: Array,
|
|
31
32
|
optionProps: Object,
|
|
32
33
|
compTitle: {
|
|
33
34
|
type: String,
|
|
@@ -75,6 +76,14 @@ export default {
|
|
|
75
76
|
return this.dataList.filter(item => this.value === item[this.optValueField])
|
|
76
77
|
}
|
|
77
78
|
},
|
|
79
|
+
watch: {
|
|
80
|
+
defaultOptions () {
|
|
81
|
+
this.dataList = this.defaultOptions
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
created () {
|
|
85
|
+
this.dataList = this.defaultOptions
|
|
86
|
+
},
|
|
78
87
|
methods: {
|
|
79
88
|
tapEvent () {
|
|
80
89
|
if (this.disabled) {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</view>
|
|
25
25
|
</view>
|
|
26
26
|
<template v-if="showTree && showTree.length">
|
|
27
|
-
<view class="ml-tree-node" v-for="(item, index) in showTree" :key="index"
|
|
27
|
+
<view class="ml-tree-node" v-for="(item, index) in showTree" :key="index">
|
|
28
28
|
<view class="ml-tree-node__action" v-if="check">
|
|
29
29
|
<ml-checkbox
|
|
30
30
|
:value="checkKey.indexOf(item[useProps.key]) > -1"
|
|
@@ -44,22 +44,26 @@
|
|
|
44
44
|
@tap-icon.stop="handleClickIcon($event, item)"
|
|
45
45
|
:info="getPrefixIcon(item)"
|
|
46
46
|
/>
|
|
47
|
-
<view class="ml-tree-node__title">
|
|
47
|
+
<view class="ml-tree-node__title" :class="{ 'hasExplain': item[useProps.explain] }" @tap.stop="handleIntoChildren(item)">
|
|
48
48
|
<view class="nowrap">{{ item[useProps.label] || '' }}</view>
|
|
49
49
|
<view class="ml-tree-node__explain" v-if="item[useProps.explain]">{{ item[useProps.explain] }}</view>
|
|
50
50
|
</view>
|
|
51
51
|
<view class="ml-tree-node__extra">
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
@tap
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
<view class="ml-tree-node__extra-item" @tap.stop="handleClickIcon($event, item)">
|
|
53
|
+
<MlTreeIcon
|
|
54
|
+
:margin-right="15"
|
|
55
|
+
:info="getSuffixIcon(item)"
|
|
56
|
+
/>
|
|
57
|
+
</view>
|
|
58
|
+
<view
|
|
59
|
+
@tap.stop="handleIntoChildren(item)"
|
|
60
|
+
class="ml-tree-node__extra-item"
|
|
61
|
+
v-if="(item.children && item.children.length) || (lazy && !item.isLeaf)">
|
|
62
|
+
<MlTreeIcon
|
|
63
|
+
:margin-right="15"
|
|
64
|
+
:info="{ icon: 'arrow-right' }"
|
|
65
|
+
/>
|
|
66
|
+
</view>
|
|
63
67
|
</view>
|
|
64
68
|
</view>
|
|
65
69
|
</template>
|
|
@@ -160,7 +164,6 @@ export default {
|
|
|
160
164
|
computed: {
|
|
161
165
|
showTree () {
|
|
162
166
|
const { current, tree } = this
|
|
163
|
-
console.log(current)
|
|
164
167
|
if (current) {
|
|
165
168
|
return current.children
|
|
166
169
|
}
|
|
@@ -442,12 +445,19 @@ export default {
|
|
|
442
445
|
font-size: 34rpx;
|
|
443
446
|
display: flex;
|
|
444
447
|
align-items: center;
|
|
445
|
-
height: 116rpx;
|
|
446
448
|
border-bottom: 1rpx solid #efefef;
|
|
447
449
|
|
|
448
450
|
.ml-tree-node__title {
|
|
451
|
+
height: 116rpx;
|
|
449
452
|
flex: 1;
|
|
450
453
|
width: 0;
|
|
454
|
+
display: flex;
|
|
455
|
+
align-items: center;
|
|
456
|
+
&.hasExplain {
|
|
457
|
+
align-items: normal;
|
|
458
|
+
justify-content: center;
|
|
459
|
+
flex-direction: column;
|
|
460
|
+
}
|
|
451
461
|
.nowrap {
|
|
452
462
|
white-space: nowrap;
|
|
453
463
|
overflow: hidden;
|
|
@@ -469,9 +479,15 @@ export default {
|
|
|
469
479
|
}
|
|
470
480
|
|
|
471
481
|
.ml-tree-node__extra {
|
|
482
|
+
height: 116rpx;
|
|
472
483
|
display: flex;
|
|
473
484
|
align-items: center;
|
|
474
485
|
padding: 0 0 0 20rpx;
|
|
486
|
+
.ml-tree-node__extra-item {
|
|
487
|
+
display: flex;
|
|
488
|
+
align-items: center;
|
|
489
|
+
height: 100%;
|
|
490
|
+
}
|
|
475
491
|
}
|
|
476
492
|
|
|
477
493
|
&:last-child {
|
|
@@ -480,6 +496,7 @@ export default {
|
|
|
480
496
|
|
|
481
497
|
.ml-tree-loading-tip {
|
|
482
498
|
flex: 1;
|
|
499
|
+
height: 116rpx;
|
|
483
500
|
text-align: center;
|
|
484
501
|
vertical-align: middle;
|
|
485
502
|
display: flex;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-tree-node__icon" :style="useStyle" v-if="info && info.icon" @tap
|
|
2
|
+
<view class="ml-tree-node__icon" :style="useStyle" v-if="info && info.icon" @tap="handleEvent">
|
|
3
3
|
<ml-icon :name="info.icon"></ml-icon>
|
|
4
4
|
</view>
|
|
5
5
|
</template>
|
|
@@ -31,5 +31,6 @@ export default {
|
|
|
31
31
|
<style lang="scss" scoped>
|
|
32
32
|
.ml-tree-node__icon {
|
|
33
33
|
display: inline-flex;
|
|
34
|
+
padding: 0 10rpx;
|
|
34
35
|
}
|
|
35
36
|
</style>
|