Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage

This commit is contained in:
liyawei
2022-08-12 17:30:05 +08:00
4 changed files with 62 additions and 131 deletions
+20 -62
View File
@@ -195,7 +195,7 @@
this.queryParam = {}
if (this.isDefault) {
let startTime = moment(new Date()).format('YYYY-MM-DD')
let endTime = this.getNewDate('after', 6)
let endTime = this.haflYear()
this.queryParam['WarnTime'] = [startTime, endTime]
this.queryParam = { ...this.queryParam }
}
@@ -217,68 +217,26 @@
}
})
},
getNewDate(flag, many) {
const thirtyDays = [4, 6, 9, 11] // 30天的月份
const thirtyOneDays = [1, 3, 5, 7, 8, 10, 12] // 31天的月份
const currDate = new Date() // 今天日期
const year = currDate.getFullYear()
let month = currDate.getMonth() + 1
let targetDateMilli = 0
let GMTDate = '' // 中国标准时间
let targetYear = '' // 年
let targetMonth = '' // 月
let targetDate = '' // 日
let dealTargetDays = '' // 目标日期
const isLeapYear = !!((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) // 是否是闰年
let countDays = 0 // 累计天数
for (let i = 0; i < many; i++) {
if (flag === 'before') {
month = month - 1 <= 0 ? 12 : month - 1
} else {
month = month + 1 > 12 ? 1 : month + 1
}
thirtyDays.includes(month) ? (countDays += 30) : thirtyOneDays.includes(month) ? (countDays += 31) : isLeapYear ? (countDays += 29) : (countDays += 28)
haflYear() {
// 先获取当前时间
var curDate = (new Date()).getTime()
// 将半年的时间单位换算成毫秒
var halfYear = 365 / 2 * 24 * 3600 * 1000
// 半年前的时间(毫秒单位)
var pastResult = curDate - halfYear
// 日期函数,定义起点为半年前
var pastDate = new Date(pastResult)
var pastYear = pastDate.getFullYear()
var pastMonth = pastDate.getMonth() + 1
var pastDay = pastDate.getDate()
if (pastMonth >= 1 && pastMonth <= 9) {
pastMonth = '0' + pastMonth
}
targetDateMilli = currDate.setDate(
currDate.getDate() - (flag === 'before' ? countDays : countDays * -1)
)
GMTDate = new Date(targetDateMilli)
targetYear = GMTDate.getFullYear()
targetMonth = GMTDate.getMonth() + 1
targetDate = GMTDate.getDate()
targetMonth = targetMonth.toString().padStart(2, '0')
targetDate = targetDate.toString().padStart(2, '0')
dealTargetDays = `${targetYear}-${targetMonth}-${targetDate}`
return dealTargetDays
if (pastDay >= 0 && pastDay <= 9) {
pastDay = '0' + pastDay
}
var endDate = pastYear + '-' + pastMonth + '-' + pastDay
return endDate
},
dateChange(item) {
this.queryParam[item] = moment(this.queryParam[item]).format('YYYY-MM-DD')
@@ -123,8 +123,8 @@
}
})
},
classificationMaintenanceModelForm(){
this.replacePage()
classificationMaintenanceModelForm() {
this.replacePage()
},
onSearch() {
this.pageNo = 1
@@ -361,6 +361,18 @@
text-align: center;
line-height: 10;
}
::v-deep .ant-tag {
padding: 2px 4px;
background: #9B9DA9;
color: #fff!important;
}
::v-deep .ant-tag-checkable:not(.ant-tag-checkable-checked):hover{
color: #fff!important;
}
::v-deep .ant-tag-checkable-checked{
background: #21c9cc;
}
</style>
<style>
.box-content-left .ant-tag {
+8 -5
View File
@@ -1239,7 +1239,10 @@ export default {
}
}
}
::v-deep .ant-modal-body {
max-height: 500px;
overflow-y: auto;
}
///deep/ .ant-table-body {
// overflow: hidden !important; ?????
//}
@@ -1350,10 +1353,10 @@ export default {
}
.ant-modal-body {
max-height: 500px;
overflow-y: auto;
}
/*.ant-modal-body {*/
/* max-height: 500px;*/
/* overflow-y: auto;*/
/*}*/
.split-detail-table {
.ant-table-body {
@@ -232,74 +232,32 @@
},
clearSelected() {
let startTime = moment(new Date()).format('YYYY-MM-DD')
let endTime = this.getNewDate('after', 6)
let endTime = this.haflYear()
this.searchParmes['WarnTime'] = [startTime, endTime]
this.searchParmes = { ...this.searchParmes }
this.pageNo = 1
this.getList()
},
getNewDate(flag, many) {
const thirtyDays = [4, 6, 9, 11] // 30天的月份
const thirtyOneDays = [1, 3, 5, 7, 8, 10, 12] // 31天的月份
const currDate = new Date() // 今天日期
const year = currDate.getFullYear()
let month = currDate.getMonth() + 1
let targetDateMilli = 0
let GMTDate = '' // 中国标准时间
let targetYear = '' // 年
let targetMonth = '' // 月
let targetDate = '' // 日
let dealTargetDays = '' // 目标日期
const isLeapYear = !!((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) // 是否是闰年
let countDays = 0 // 累计天数
for (let i = 0; i < many; i++) {
if (flag === 'before') {
month = month - 1 <= 0 ? 12 : month - 1
} else {
month = month + 1 > 12 ? 1 : month + 1
}
thirtyDays.includes(month) ? (countDays += 30) : thirtyOneDays.includes(month) ? (countDays += 31) : isLeapYear ? (countDays += 29) : (countDays += 28)
haflYear() {
// 先获取当前时间
var curDate = (new Date()).getTime()
// 将半年的时间单位换算成毫秒
var halfYear = 365 / 2 * 24 * 3600 * 1000
// 半年前的时间(毫秒单位)
var pastResult = curDate - halfYear
// 日期函数,定义起点为半年前
var pastDate = new Date(pastResult)
var pastYear = pastDate.getFullYear()
var pastMonth = pastDate.getMonth() + 1
var pastDay = pastDate.getDate()
if (pastMonth >= 1 && pastMonth <= 9) {
pastMonth = '0' + pastMonth
}
targetDateMilli = currDate.setDate(
currDate.getDate() - (flag === 'before' ? countDays : countDays * -1)
)
GMTDate = new Date(targetDateMilli)
targetYear = GMTDate.getFullYear()
targetMonth = GMTDate.getMonth() + 1
targetDate = GMTDate.getDate()
targetMonth = targetMonth.toString().padStart(2, '0')
targetDate = targetDate.toString().padStart(2, '0')
dealTargetDays = `${targetYear}-${targetMonth}-${targetDate}`
return dealTargetDays
if (pastDay >= 0 && pastDay <= 9) {
pastDay = '0' + pastDay
}
var endDate = pastYear + '-' + pastMonth + '-' + pastDay
return endDate
},
pageOnChange(page) {
this.pageNo = page