mali-applet-ui 1.0.149 → 1.0.151
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>
|
|
@@ -49,13 +49,13 @@ export default {
|
|
|
49
49
|
watch: {
|
|
50
50
|
startDate () {
|
|
51
51
|
this.$nextTick(() => {
|
|
52
|
-
this.
|
|
52
|
+
this.updateValue()
|
|
53
53
|
})
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
created () {
|
|
57
57
|
if (this.startDate) {
|
|
58
|
-
this.
|
|
58
|
+
this.updateValue()
|
|
59
59
|
}
|
|
60
60
|
if (this.dateType) {
|
|
61
61
|
this.selectType = this.dateType
|
|
@@ -67,6 +67,13 @@ export default {
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
methods: {
|
|
70
|
+
updateValue () {
|
|
71
|
+
if (this.dateType === 1) {
|
|
72
|
+
this.selectVal = this.startDate
|
|
73
|
+
} else {
|
|
74
|
+
this.selectDates = this.startDate && this.endDate ? [this.startDate, this.endDate] : []
|
|
75
|
+
}
|
|
76
|
+
},
|
|
70
77
|
changeTypeEvent () {
|
|
71
78
|
let startStr = ''
|
|
72
79
|
let enStr = ''
|
|
@@ -105,7 +112,11 @@ export default {
|
|
|
105
112
|
this.$emit('update:endDate', enStr)
|
|
106
113
|
this.$emit('change', { startDate: startStr, endDate: enStr })
|
|
107
114
|
},
|
|
108
|
-
|
|
115
|
+
changeDateEvent () {
|
|
116
|
+
const value = this.selectVal || ''
|
|
117
|
+
this.changeDaterangeEvent([value, value])
|
|
118
|
+
},
|
|
119
|
+
changeDaterangeEvent (value) {
|
|
109
120
|
const [startDate, endDate] = value
|
|
110
121
|
if (!startDate || !endDate) {
|
|
111
122
|
this.selectType = 5
|