我的消息开发

This commit is contained in:
fengachen
2021-09-28 15:41:08 +08:00
parent d87b8eeb94
commit 74f0af9b74
14 changed files with 1612 additions and 213 deletions
+37
View File
@@ -0,0 +1,37 @@
/* 查询条件有时间范围的 混入方法 */
import moment from 'moment'
export const RangeDateMixin = {
data() {
return {
dateKeyObj: {
beginKey: 'startTime',
endKey: 'endTime'
},
rangeDateFormat: {
begin: 'YYYY-MM-DD HH:mm:ss',
end: 'YYYY-MM-DD HH:mm:ss'
}
}
},
methods: {
disabledStartDate(startValue) {
const endValue = this.queryParam[this.dateKeyObj.endKey] && moment(this.queryParam[this.dateKeyObj.endKey], this.rangeDateFormat.end)
if (!startValue || !endValue) {
return false
}
return startValue.valueOf() > endValue.valueOf()
},
disabledEndDate(endValue) {
const startValue = this.queryParam[this.dateKeyObj.beginKey] && moment(this.queryParam[this.dateKeyObj.beginKey], this.rangeDateFormat.begin)
if (!endValue || !startValue) {
return false
}
return startValue.valueOf() > endValue.valueOf()
},
disabledDateBeforeToday(current) {
return current < moment().subtract(1, 'day') // 当天之前的不可选,不包括当天
}
}
}