|
@@ -21,7 +21,8 @@
|
|
import {
|
|
import {
|
|
currentTimeStamp,
|
|
currentTimeStamp,
|
|
parseUnixTime,
|
|
parseUnixTime,
|
|
- inDateBetwen
|
|
|
|
|
|
+ inDateBetwen,
|
|
|
|
+ unixTimeStamp
|
|
} from '$project/utils'
|
|
} from '$project/utils'
|
|
export default {
|
|
export default {
|
|
name: 'DrugCalendar',
|
|
name: 'DrugCalendar',
|
|
@@ -98,23 +99,18 @@
|
|
dateNum: date.getDate()
|
|
dateNum: date.getDate()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- //console.log(this.canlender)
|
|
|
|
|
|
+ console.log(this.canlender)
|
|
},
|
|
},
|
|
//显示title
|
|
//显示title
|
|
titleStr(date) {
|
|
titleStr(date) {
|
|
- var monthList = this.monthList;
|
|
|
|
- if (monthList.length) {
|
|
|
|
- for (var i = 0; i < monthList.length; i++) {
|
|
|
|
- if (monthList[i]['name'] == date) {
|
|
|
|
- return '用药' + monthList[i]['times'] + '次';
|
|
|
|
- } else if (inDateBetwen(date, monthList[0]['name'], monthList[monthList.length - 1]['name'])) {
|
|
|
|
- return '停药';
|
|
|
|
- } else {
|
|
|
|
- return '';
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ var hasIndex = this.hasDayList.indexOf(date);
|
|
|
|
+ if (hasIndex > -1) {
|
|
|
|
+ return '用药' + this.monthList[hasIndex]['times'] + '次';
|
|
|
|
+ } else if (inDateBetwen(date, this.monthList[0]['name'], this.monthList[this.monthList.length - 1]['name'])) {
|
|
|
|
+ return '停药';
|
|
|
|
+ } else {
|
|
|
|
+ return '';
|
|
}
|
|
}
|
|
- return '';
|
|
|
|
},
|
|
},
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -131,6 +127,20 @@
|
|
console.log(newValue)
|
|
console.log(newValue)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ hasDayList: {
|
|
|
|
+ // getter
|
|
|
|
+ get: function() {
|
|
|
|
+ var list = [];
|
|
|
|
+ for (var i = 0; i < this.monthList.length; i++) {
|
|
|
|
+ list.push(this.monthList[i]['name']);
|
|
|
|
+ }
|
|
|
|
+ return list;
|
|
|
|
+ },
|
|
|
|
+ // setter
|
|
|
|
+ set: function(newValue) {
|
|
|
|
+ console.log(newValue)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|