mali-applet-ui 0.2.51 → 0.2.53
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,7 +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
|
-
<
|
|
7
|
+
<ml-date-picker v-model="selectVal" v-if="selectType === 1" :border="border" :clearable="clearable"></ml-date-picker>
|
|
8
|
+
<uni-datetime-picker v-else v-model="selectDates" type="daterange" :start="minDate" :end="maxDate" @change="changeEvent" :border="border" :clear-icon="clearable"/>
|
|
8
9
|
</view>
|
|
9
10
|
</view>
|
|
10
11
|
</template>
|
|
@@ -29,6 +30,7 @@ export default {
|
|
|
29
30
|
},
|
|
30
31
|
data () {
|
|
31
32
|
return {
|
|
33
|
+
selectVal: '',
|
|
32
34
|
selectType: 5,
|
|
33
35
|
selectDates: []
|
|
34
36
|
}
|
|
@@ -67,7 +69,7 @@ export default {
|
|
|
67
69
|
let startStr = ''
|
|
68
70
|
let enStr = ''
|
|
69
71
|
if (this.selectType === 5) {
|
|
70
|
-
this.$emit('dateType', this.selectType)
|
|
72
|
+
this.$emit('update:dateType', this.selectType)
|
|
71
73
|
return
|
|
72
74
|
}
|
|
73
75
|
if (this.selectType !== null) {
|
|
@@ -76,6 +78,7 @@ export default {
|
|
|
76
78
|
switch (this.selectType) {
|
|
77
79
|
case 1:
|
|
78
80
|
startDate = new Date()
|
|
81
|
+
break
|
|
79
82
|
case 2:
|
|
80
83
|
startDate = XEUtils.getWhatWeek(endDate, -1)
|
|
81
84
|
break
|
|
@@ -89,8 +92,13 @@ export default {
|
|
|
89
92
|
startStr = XEUtils.toDateString(startDate, 'yyyy-MM-dd')
|
|
90
93
|
enStr = XEUtils.toDateString(endDate, 'yyyy-MM-dd')
|
|
91
94
|
}
|
|
95
|
+
if (this.selectType === 1) {
|
|
96
|
+
this.selectVal = startStr
|
|
97
|
+
} else {
|
|
98
|
+
this.selectVal = ''
|
|
99
|
+
}
|
|
92
100
|
this.selectDates = startStr && enStr ? [startStr, enStr] : []
|
|
93
|
-
this.$emit('dateType', this.selectType)
|
|
101
|
+
this.$emit('update:dateType', this.selectType)
|
|
94
102
|
this.$emit('update:startDate', startStr)
|
|
95
103
|
this.$emit('update:endDate', enStr)
|
|
96
104
|
this.$emit('change', { startDate: startStr, endDate: enStr })
|
|
@@ -99,7 +107,7 @@ export default {
|
|
|
99
107
|
const [startDate, endDate] = value
|
|
100
108
|
if (!startDate || !endDate) {
|
|
101
109
|
this.selectType = 5
|
|
102
|
-
this.$emit('dateType', this.selectType)
|
|
110
|
+
this.$emit('update:dateType', this.selectType)
|
|
103
111
|
}
|
|
104
112
|
this.$emit('update:startDate', startDate || '')
|
|
105
113
|
this.$emit('update:endDate', endDate || '')
|