|
@@ -12,7 +12,7 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="selct" style="display: inline-block; margin-right: 15px">
|
|
<div class="selct" style="display: inline-block; margin-right: 15px">
|
|
- <RangePicker v-model:value="selectTime" valueFormat="YYYY-MM-DD" :disabled-date="disabledDate" format="YYYY-MM-DD" @change="handleTime"/>
|
|
|
|
|
|
+ <RangePicker v-model:value="selectTime" @calendarChange="calendarPriceRangeChange" valueFormat="YYYY-MM-DD" :disabled-date="disabledDate" format="YYYY-MM-DD" @change="handleTime"/>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="selct" style="display: inline-block">
|
|
<div class="selct" style="display: inline-block">
|
|
@@ -46,6 +46,7 @@ const props = defineProps({
|
|
type RangeValue = [Dayjs, Dayjs];
|
|
type RangeValue = [Dayjs, Dayjs];
|
|
const picker = ref('date');
|
|
const picker = ref('date');
|
|
const value = ref(props.type ||'0');
|
|
const value = ref(props.type ||'0');
|
|
|
|
+const selectPriceDate = ref(dayjs().subtract(6,'month').format('YYYY-MM-DD'))
|
|
const selectTime = ref<RangeValue>([dayjs().subtract(6,'month').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]);
|
|
const selectTime = ref<RangeValue>([dayjs().subtract(6,'month').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]);
|
|
const options = ref<SelectProps['options']>([
|
|
const options = ref<SelectProps['options']>([
|
|
{
|
|
{
|
|
@@ -63,8 +64,11 @@ const options = ref<SelectProps['options']>([
|
|
]);
|
|
]);
|
|
const type = ref('0');
|
|
const type = ref('0');
|
|
const disabledDate = (current: Dayjs) => {
|
|
const disabledDate = (current: Dayjs) => {
|
|
- // Can not select days before today and today
|
|
|
|
- return current && current < dayjs().subtract(2,'year').endOf('day');
|
|
|
|
|
|
+ if(selectPriceDate.value){
|
|
|
|
+ return current >dayjs(selectPriceDate.value).add(2,'year') || current < dayjs(selectPriceDate.value).subtract(2,'year')
|
|
|
|
+ }else{
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
};
|
|
};
|
|
const typeOptions = ref<SelectProps['options']>([
|
|
const typeOptions = ref<SelectProps['options']>([
|
|
{
|
|
{
|
|
@@ -76,6 +80,9 @@ const typeOptions = ref<SelectProps['options']>([
|
|
label: props.name && props.name[1] || '累计',
|
|
label: props.name && props.name[1] || '累计',
|
|
},
|
|
},
|
|
]);
|
|
]);
|
|
|
|
+function calendarPriceRangeChange(date){
|
|
|
|
+ selectPriceDate.value = date[0]
|
|
|
|
+}
|
|
function handleData(val) {
|
|
function handleData(val) {
|
|
console.log('handleData',val)
|
|
console.log('handleData',val)
|
|
value.value = val
|
|
value.value = val
|