mali-applet-ui 1.0.148 → 1.0.150
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.
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<ml-select-picker v-model="selectType" :options="typeList" :border="border" @change="changeTypeEvent"></ml-select-picker>
|
|
5
5
|
</view>
|
|
6
6
|
<view class="ml-date-quick-range-picker-right">
|
|
7
|
-
<ml-date-picker v-model="selectVal" v-if="selectType === 1" :border="border" :clearable="clearable"></ml-date-picker>
|
|
8
|
-
<ml-fix-uni-datetime-picker v-else v-model="selectDates" type="daterange" :start="minDate" :end="maxDate" @change="
|
|
7
|
+
<ml-date-picker v-model="selectVal" v-if="selectType === 1" :border="border" :clearable="clearable" @change="changeDateEvent"></ml-date-picker>
|
|
8
|
+
<ml-fix-uni-datetime-picker v-else v-model="selectDates" type="daterange" :start="minDate" :end="maxDate" @change="changeDaterangeEvent" :border="border" :clear-icon="clearable"/>
|
|
9
9
|
</view>
|
|
10
10
|
</view>
|
|
11
11
|
</template>
|
|
@@ -105,7 +105,11 @@ export default {
|
|
|
105
105
|
this.$emit('update:endDate', enStr)
|
|
106
106
|
this.$emit('change', { startDate: startStr, endDate: enStr })
|
|
107
107
|
},
|
|
108
|
-
|
|
108
|
+
changeDateEvent () {
|
|
109
|
+
const value = this.selectVal || ''
|
|
110
|
+
this.changeDaterangeEvent([value, value])
|
|
111
|
+
},
|
|
112
|
+
changeDaterangeEvent (value) {
|
|
109
113
|
const [startDate, endDate] = value
|
|
110
114
|
if (!startDate || !endDate) {
|
|
111
115
|
this.selectType = 5
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
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
|
-
<view v-if="hasEmpty" class="ml-list-select-page-placeholder">{{ placeholder }}</view>
|
|
4
|
+
<view v-if="hasEmpty" class="ml-list-select-page-placeholder">{{ readonly ? '' : placeholder }}</view>
|
|
5
5
|
<view v-else>
|
|
6
6
|
<slot>
|
|
7
7
|
<view>{{ selectLabel }}</view>
|
|
8
8
|
</slot>
|
|
9
9
|
</view>
|
|
10
10
|
</view>
|
|
11
|
-
<view v-if="clearable && !hasEmpty" class="ml-list-select-page-clear-icon" @click.stop="clearEvent">
|
|
11
|
+
<view v-if="clearable && !readonly && !hasEmpty" class="ml-list-select-page-clear-icon" @click.stop="clearEvent">
|
|
12
12
|
<ml-icon name="delete-filling"></ml-icon>
|
|
13
13
|
</view>
|
|
14
|
-
<view v-else class="ml-list-select-page-icon">
|
|
14
|
+
<view v-else-if="!readonly" class="ml-list-select-page-icon">
|
|
15
15
|
<ml-icon name="arrow-right" />
|
|
16
16
|
</view>
|
|
17
17
|
</view>
|
|
@@ -25,6 +25,7 @@ export default {
|
|
|
25
25
|
props: {
|
|
26
26
|
value: [Array, Number, String],
|
|
27
27
|
defaultOptions: Array,
|
|
28
|
+
options: Array,
|
|
28
29
|
optionProps: Object,
|
|
29
30
|
compTitle: {
|
|
30
31
|
type: String,
|
|
@@ -40,6 +41,7 @@ export default {
|
|
|
40
41
|
default: '请选择'
|
|
41
42
|
},
|
|
42
43
|
disabled: Boolean,
|
|
44
|
+
readonly: Boolean,
|
|
43
45
|
border: Boolean,
|
|
44
46
|
clearable: Boolean,
|
|
45
47
|
className: String
|
|
@@ -78,10 +80,18 @@ export default {
|
|
|
78
80
|
watch: {
|
|
79
81
|
defaultOptions () {
|
|
80
82
|
this.dataList = this.defaultOptions
|
|
83
|
+
},
|
|
84
|
+
options () {
|
|
85
|
+
this.dataList = this.options
|
|
81
86
|
}
|
|
82
87
|
},
|
|
83
88
|
created () {
|
|
84
|
-
|
|
89
|
+
if (this.defaultOptions) {
|
|
90
|
+
this.dataList = this.defaultOptions
|
|
91
|
+
}
|
|
92
|
+
if (this.options) {
|
|
93
|
+
this.dataList = this.options
|
|
94
|
+
}
|
|
85
95
|
},
|
|
86
96
|
methods: {
|
|
87
97
|
tapEvent () {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</view>
|
|
15
15
|
</view>
|
|
16
16
|
<view v-else class="ml-list-select-user-list">
|
|
17
|
-
<view class="ml-list-select-user-page-placeholder">{{ placeholder }}</view>
|
|
17
|
+
<view class="ml-list-select-user-page-placeholder">{{ readonly ? '' : placeholder }}</view>
|
|
18
18
|
</view>
|
|
19
19
|
<view v-if="!readonly" class="ml-list-select-user-add-item" @click="openUserEvent">
|
|
20
20
|
<view class="ml-list-select-user-add-btn">
|
|
@@ -33,6 +33,7 @@ export default {
|
|
|
33
33
|
props: {
|
|
34
34
|
value: [Array, Number, String],
|
|
35
35
|
defaultOptions: Array,
|
|
36
|
+
options: Array,
|
|
36
37
|
optionProps: Object,
|
|
37
38
|
compTitle: {
|
|
38
39
|
type: String,
|
|
@@ -87,10 +88,18 @@ export default {
|
|
|
87
88
|
watch: {
|
|
88
89
|
defaultOptions () {
|
|
89
90
|
this.dataList = this.defaultOptions
|
|
91
|
+
},
|
|
92
|
+
options () {
|
|
93
|
+
this.dataList = this.options
|
|
90
94
|
}
|
|
91
95
|
},
|
|
92
96
|
created () {
|
|
93
|
-
|
|
97
|
+
if (this.defaultOptions) {
|
|
98
|
+
this.dataList = this.defaultOptions
|
|
99
|
+
}
|
|
100
|
+
if (this.options) {
|
|
101
|
+
this.dataList = this.options
|
|
102
|
+
}
|
|
94
103
|
},
|
|
95
104
|
methods: {
|
|
96
105
|
tapEvent () {
|
|
@@ -182,6 +191,7 @@ export default {
|
|
|
182
191
|
.ml-list-select-user-list {
|
|
183
192
|
display: flex;
|
|
184
193
|
flex-direction: row;
|
|
194
|
+
align-items: center;
|
|
185
195
|
flex-wrap: wrap;
|
|
186
196
|
min-height: 76rpx;
|
|
187
197
|
}
|