巡检
This commit is contained in:
@@ -77,7 +77,11 @@ const handleClose = ()=>{
|
|||||||
emit('close');
|
emit('close');
|
||||||
}
|
}
|
||||||
const handleConfirm = ()=>{
|
const handleConfirm = ()=>{
|
||||||
emit('confirm',{startDate:beginDate.value,endDate:endDate.value});
|
emit('confirm',{
|
||||||
|
startDate:beginDate.value,
|
||||||
|
endDate:endDate.value,
|
||||||
|
lastType:lastType.value
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 选择最近
|
// 选择最近
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<view class="search">
|
<view class="search">
|
||||||
<view class="search-bg s-b-left" @click="chooseDate">
|
<view class="search-bg s-b-left" @click="chooseDate">
|
||||||
<img :src="'static/images/polling/icon-search-clock.png'" class="img-icon" />
|
<img :src="'static/images/polling/icon-search-clock.png'" class="img-icon" />
|
||||||
近3天
|
{{dateStrName}}
|
||||||
<uni-icons type="down" size="16" color="#C8DCFF" style="margin-left:auto;"></uni-icons>
|
<uni-icons type="down" size="16" color="#C8DCFF" style="margin-left:auto;"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="search-bg s-b-right">
|
<view class="search-bg s-b-right">
|
||||||
@@ -99,7 +99,7 @@ import { onLoad,onHide } from '@dcloudio/uni-app';
|
|||||||
import customHeader from '@/components/customHeader.vue';
|
import customHeader from '@/components/customHeader.vue';
|
||||||
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
|
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
|
||||||
import searchDate from '@/components/searchDate.vue';
|
import searchDate from '@/components/searchDate.vue';
|
||||||
import { parseTime,getDateRange } from '@/utils/datetime.js';
|
import { parseTime,getDateRange,getDateRangeName } from '@/utils/datetime.js';
|
||||||
import { taskTypeOptions,formatTaskType,formatTaskStatus } from '@/utils/status.js';
|
import { taskTypeOptions,formatTaskType,formatTaskStatus } from '@/utils/status.js';
|
||||||
import { noticeList } from '@/api/notice.js'
|
import { noticeList } from '@/api/notice.js'
|
||||||
|
|
||||||
@@ -113,23 +113,27 @@ const chooseDate = ()=>{
|
|||||||
const dateClose=()=>{
|
const dateClose=()=>{
|
||||||
isShow.value = false;
|
isShow.value = false;
|
||||||
}
|
}
|
||||||
|
// 选完日期提交回显
|
||||||
const dateConfirm=(dateObj)=>{
|
const dateConfirm=(dateObj)=>{
|
||||||
console.log(dateObj)
|
console.log(dateObj)
|
||||||
isShow.value = false;
|
isShow.value = false;
|
||||||
dateStr.value = dateObj.startDate + ' 至 '+dateObj.endDate
|
dateStr.value = dateObj.startDate + ' 至 '+dateObj.endDate;
|
||||||
|
dateStrName.value = getDateRangeName(dateObj.lastType)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 类型索引
|
// 类型索引
|
||||||
let taskTypeIndex = ref(0);
|
let taskTypeIndex = ref(0);
|
||||||
let taskTypeArr = ref([]);
|
let taskTypeArr = ref([]);
|
||||||
let dateStr = ref('');
|
let dateStr = ref('');
|
||||||
|
let dateStrName=ref('');
|
||||||
onLoad(option => {
|
onLoad(option => {
|
||||||
taskTypeOptions.forEach(item => {
|
taskTypeOptions.forEach(item => {
|
||||||
taskTypeArr.value.push(item.label)
|
taskTypeArr.value.push(item.label)
|
||||||
});
|
});
|
||||||
|
|
||||||
let dateObj = getDateRange('3days');
|
let dateObj = getDateRange('3days');
|
||||||
dateStr.value = dateObj.startDate + ' 至 '+dateObj.endDate
|
dateStr.value = dateObj.startDate + ' 至 '+dateObj.endDate;
|
||||||
|
dateStrName.value="近3天"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -162,3 +162,25 @@ export function getDateRange(rangeType) {
|
|||||||
endDate: format(endDate)
|
endDate: format(endDate)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
// 获取rangeType名称
|
||||||
|
export function getDateRangeName(rangeType){
|
||||||
|
let str = "";
|
||||||
|
switch (rangeType) {
|
||||||
|
case '3days':
|
||||||
|
str = "近3天"; // 近3天,含今天
|
||||||
|
break;
|
||||||
|
case '7days':
|
||||||
|
str = "近7天";// 近7天,含今天
|
||||||
|
break;
|
||||||
|
case '1month':
|
||||||
|
str = "近1月";// 近1月
|
||||||
|
break;
|
||||||
|
case '3months':
|
||||||
|
str = "近3月"; // 近3月
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
str="请选择";
|
||||||
|
// throw new Error('不支持的rangeType');
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user