mali-applet-ui 1.0.73 → 1.0.75
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.
|
@@ -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: {
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
<view class="ml-form-item-header-title">
|
|
9
9
|
<slot name="title">{{ title }}</slot>
|
|
10
10
|
</view>
|
|
11
|
+
<view class="ml-form-item-header-extra">
|
|
12
|
+
<slot name="extra"></slot>
|
|
13
|
+
</view>
|
|
11
14
|
</view>
|
|
12
15
|
<view class="ml-form-item-content">
|
|
13
16
|
<view class="ml-form-item-content-warpper">
|
|
@@ -223,10 +226,13 @@ export default {
|
|
|
223
226
|
}
|
|
224
227
|
}
|
|
225
228
|
.ml-form-item-header {
|
|
229
|
+
display: flex;
|
|
230
|
+
flex-direction: row;
|
|
226
231
|
min-height: 78rpx;
|
|
227
232
|
padding: 0 10rpx;
|
|
228
233
|
}
|
|
229
234
|
.ml-form-item-header-asterisk {
|
|
235
|
+
flex-shrink: 0;
|
|
230
236
|
position: absolute;
|
|
231
237
|
left: 10rpx;
|
|
232
238
|
color: red;
|
|
@@ -234,8 +240,14 @@ export default {
|
|
|
234
240
|
padding-top: 10rpx;
|
|
235
241
|
}
|
|
236
242
|
.ml-form-item-header-title {
|
|
237
|
-
|
|
243
|
+
flex-grow: 1;
|
|
238
244
|
color: #171A1D;
|
|
245
|
+
overflow: hidden;
|
|
246
|
+
text-overflow: ellipsis;
|
|
247
|
+
white-space: nowrap;
|
|
248
|
+
}
|
|
249
|
+
.ml-form-item-header-extra {
|
|
250
|
+
flex-shrink: 0;
|
|
239
251
|
}
|
|
240
252
|
&.is-vertical {
|
|
241
253
|
flex-direction: column;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="ml-tree-box">
|
|
3
3
|
<view class="ml-tree-tool">
|
|
4
|
-
<view class="ml-tree-breadcrumb" v-if="breadcrumb">
|
|
5
|
-
<view class="breadcrumb
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
<scroll-view :scroll-x="true" class="ml-tree-breadcrumb-scroll" v-if="breadcrumb">
|
|
5
|
+
<view class="ml-tree-breadcrumb">
|
|
6
|
+
<view class="breadcrumb-item" @click="handleToBreadcrumb()">
|
|
7
|
+
<text class="breadcrumb-text">全部</text>
|
|
8
|
+
<ml-icon v-if="cache && cache.length" name="arrow-right"></ml-icon>
|
|
9
|
+
</view>
|
|
10
|
+
<view class="breadcrumb-item" v-for="(item, index) in cache" :key="index" @click="handleToBreadcrumb(index)">
|
|
11
|
+
<text class="breadcrumb-text">{{ item[useProps.label] || '' }}</text>
|
|
12
|
+
<ml-icon v-if="index !== (cache.length - 1)" name="arrow-right"></ml-icon>
|
|
13
|
+
</view>
|
|
8
14
|
</view>
|
|
9
|
-
|
|
10
|
-
{{ item[useProps.label] || '' }}
|
|
11
|
-
<ml-icon v-if="index !== (cache.length - 1)" name="arrow-right"></ml-icon>
|
|
12
|
-
</view>
|
|
13
|
-
</view>
|
|
15
|
+
</scroll-view>
|
|
14
16
|
</view>
|
|
15
17
|
<view class="ml-tree-content">
|
|
16
18
|
<view class="ml-tree-node" v-if="cache && cache.length" @click="handleBack">
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
</view>
|
|
31
33
|
<MlTreeIcon @click="e => $emit('click-icon', item, 'prefix')" :info="getPrefixIcon(item)" :key="index"></MlTreeIcon>
|
|
32
34
|
<view class="ml-tree-node__title" @click="handleIntoChildren(item)">
|
|
33
|
-
<view>{{ item[useProps.label] || '' }}</view>
|
|
35
|
+
<view class="nowrap">{{ item[useProps.label] || '' }}</view>
|
|
34
36
|
<view class="ml-tree-node__explain" v-if="item[useProps.explain]">{{ item[useProps.explain] }}</view>
|
|
35
37
|
</view>
|
|
36
38
|
<view class="ml-tree-node__extra">
|
|
@@ -98,6 +100,12 @@ export default {
|
|
|
98
100
|
}
|
|
99
101
|
}
|
|
100
102
|
},
|
|
103
|
+
inject: {
|
|
104
|
+
currVM: {
|
|
105
|
+
from: '$pageVM',
|
|
106
|
+
default: null
|
|
107
|
+
}
|
|
108
|
+
},
|
|
101
109
|
computed: {
|
|
102
110
|
showTree () {
|
|
103
111
|
const { current, tree } = this
|
|
@@ -120,15 +128,24 @@ export default {
|
|
|
120
128
|
methods: {
|
|
121
129
|
async handleIntoChildren (item) {
|
|
122
130
|
const { lazyLoad, lazy } = this
|
|
123
|
-
|
|
131
|
+
console.log(this)
|
|
132
|
+
if (!(item.children && item.children.length) && lazy && lazyLoad && !item.isLeaf) {
|
|
124
133
|
// this.lazyLoading = true
|
|
125
|
-
await lazyLoad(item)
|
|
134
|
+
await lazyLoad.call(this.currVM, item)
|
|
126
135
|
// this.lazyLoading = false
|
|
127
136
|
}
|
|
128
137
|
if (item.children && item.children.length) {
|
|
129
138
|
this.cache.push(item)
|
|
130
139
|
}
|
|
131
140
|
},
|
|
141
|
+
async reloadLazy () {
|
|
142
|
+
const { lazyLoad, lazy, current } = this
|
|
143
|
+
if (lazy && lazyLoad) {
|
|
144
|
+
// this.lazyLoading = true
|
|
145
|
+
await lazyLoad.call(this.currVM, current)
|
|
146
|
+
// this.lazyLoading = false
|
|
147
|
+
}
|
|
148
|
+
},
|
|
132
149
|
handleBack () {
|
|
133
150
|
const { cache } = this
|
|
134
151
|
cache.splice(cache.length - 1, 1)
|
|
@@ -311,6 +328,12 @@ export default {
|
|
|
311
328
|
|
|
312
329
|
.ml-tree-node__title {
|
|
313
330
|
flex: 1;
|
|
331
|
+
width: 0;
|
|
332
|
+
.nowrap {
|
|
333
|
+
white-space: nowrap;
|
|
334
|
+
overflow: hidden;
|
|
335
|
+
text-overflow: ellipsis;
|
|
336
|
+
}
|
|
314
337
|
|
|
315
338
|
&.back {
|
|
316
339
|
color: #6e6e6e;
|
|
@@ -337,10 +360,13 @@ export default {
|
|
|
337
360
|
}
|
|
338
361
|
|
|
339
362
|
.ml-tree-tool {
|
|
363
|
+
.ml-tree-breadcrumb-scroll {
|
|
364
|
+
background-color: #f3f3f3;
|
|
365
|
+
}
|
|
340
366
|
.ml-tree-breadcrumb {
|
|
341
367
|
display: flex;
|
|
342
|
-
background-color: #f3f3f3;
|
|
343
368
|
padding: 0 30rpx;
|
|
369
|
+
align-items: center;
|
|
344
370
|
|
|
345
371
|
.breadcrumb-item {
|
|
346
372
|
position: relative;
|
|
@@ -348,6 +374,14 @@ export default {
|
|
|
348
374
|
line-height: 50rpx;
|
|
349
375
|
color: #afafaf;
|
|
350
376
|
font-size: 26rpx;
|
|
377
|
+
display: flex;
|
|
378
|
+
align-items: center;
|
|
379
|
+
.breadcrumb-text {
|
|
380
|
+
max-width: 220rpx;
|
|
381
|
+
overflow: hidden;
|
|
382
|
+
text-overflow: ellipsis;
|
|
383
|
+
white-space: nowrap;
|
|
384
|
+
}
|
|
351
385
|
|
|
352
386
|
&:last-child {
|
|
353
387
|
color: #6e6e6e;
|