|
@@ -1,6 +1,16 @@
|
|
|
<template>
|
|
|
<div class="flexCoum">
|
|
|
<van-nav-bar title="今日计划" left-text="返回" @click-left="back" fixed left-arrow />
|
|
|
+ <div class="seachPlan">
|
|
|
+ <van-search
|
|
|
+ v-model="searchValue"
|
|
|
+ placeholder="请输入搜索关键词"
|
|
|
+ clearable
|
|
|
+ @input="debouncedPlanSeach"
|
|
|
+ @search="debouncedPlanSeach"
|
|
|
+ @clear="debouncedPlanSeach"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<div class="todayPlan flexCoum-box">
|
|
|
<PlanComponent :titleText="'今日计划'" :planList="planList" v-if="planList.length > 0" @planClick="getPlanList"></PlanComponent>
|
|
|
<van-empty description="暂无数据" v-else />
|
|
@@ -18,6 +28,8 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
planList: [], // 今日计划数据
|
|
|
+ searchValue: '',
|
|
|
+ debouncedPlanSeach: () => {},
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -25,11 +37,24 @@ export default {
|
|
|
created() { },
|
|
|
mounted() {
|
|
|
this.getPlanList()
|
|
|
+ this.debouncedPlanSeach = this.debounce(this.planSeach, 500); // 300ms 防抖
|
|
|
},
|
|
|
methods: {
|
|
|
back() {
|
|
|
this.$router.go(-1);
|
|
|
},
|
|
|
+ debounce(func, wait) {
|
|
|
+ let timeout;
|
|
|
+ return function (...args) {
|
|
|
+ clearTimeout(timeout);
|
|
|
+ timeout = setTimeout(() => {
|
|
|
+ func.apply(this, args);
|
|
|
+ }, wait);
|
|
|
+ };
|
|
|
+ },
|
|
|
+ planSeach() {
|
|
|
+ this.getPlanList()
|
|
|
+ },
|
|
|
getPlanList() {
|
|
|
this.$toast.loading({
|
|
|
duration: 0, // 持续展示 toast
|
|
@@ -40,7 +65,9 @@ export default {
|
|
|
pageIndex: 0,
|
|
|
pageSize: 10000,
|
|
|
planType: 0,
|
|
|
- isMob:1
|
|
|
+ isMob:1,
|
|
|
+ searchType: 5,
|
|
|
+ searchValue: this.searchValue,
|
|
|
// date: this.getNowFormatDate()
|
|
|
})
|
|
|
.then(res => {
|
|
@@ -48,6 +75,7 @@ export default {
|
|
|
res.data.records.forEach(item => { item.flg = false })
|
|
|
// this.planList = res.data.records;
|
|
|
this.planList = []
|
|
|
+ this.planListCopy = []
|
|
|
// res.data.records.forEach((item => {
|
|
|
// const newProgress = item.progress && item.progress.split('%')[0]
|
|
|
// const progressFlag = newProgress ? (newProgress > 0 && newProgress < 100) ? true : false : false
|
|
@@ -102,10 +130,11 @@ export default {
|
|
|
* {
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
-
|
|
|
+.seachPlan {
|
|
|
+ padding-top: 46px;
|
|
|
+}
|
|
|
.todayPlan {
|
|
|
height: 100%;
|
|
|
background-color: #F4F4F4;
|
|
|
- padding-top: 46px;
|
|
|
}
|
|
|
</style>
|