From ba70879e87a8377fe8a7f3dffad9e2b119bd695a Mon Sep 17 00:00:00 2001
From: lzhe <181968431@qq.com>
Date: 星期日, 24 十一月 2024 01:02:56 +0800
Subject: [PATCH] 1
---
src/views/console/base/Add.vue | 46 +++++++++++++++++++++++++++++++++-------------
1 files changed, 33 insertions(+), 13 deletions(-)
diff --git a/src/views/console/base/Add.vue b/src/views/console/base/Add.vue
index 5a4e836..8e244b1 100644
--- a/src/views/console/base/Add.vue
+++ b/src/views/console/base/Add.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-05-04 16:37:48
* @LastEditors: gaoshp
- * @LastEditTime: 2024-10-09 22:50:13
+ * @LastEditTime: 2024-11-07 21:45:28
* @FilePath: /cps-web/src/views/console/base/Add.vue
-->
<template>
@@ -225,7 +225,7 @@
this.form.date[0] = moment().format('YYYY-MM-DD')
}
// console.log(this.months)
- this.$HTTP.post('/api/blade-cps/shift-off-day/list', {
+ this.$HTTP.post('/api/smis/shift-off-day/list', {
year: currentYear,
startOffDay: `${currentYear}-01-01`,
endOffDay: `${currentYear}-12-31`
@@ -375,14 +375,21 @@
},
})
// 浼樺厛
- this.months[i].attributes.push({
- dates: dates.filter(v => v.isHighPriority === 1).map(v => v.calendarDate),
- bar: {
- style: {
- backgroundColor: 'red',
- }
- },
- })
+ console.log('------------->>>>', dates)
+ let hiIndex = this.months[i].attributes.findIndex(v => v.bar)
+ if (hiIndex > -1) {
+ this.months[i].attributes[hiIndex].dates.push(...dates.filter(v => v.isHighPriority === 1).map(v => v.calendarDate))
+ } else {
+ this.months[i].attributes.push({
+ dates: dates.filter(v => v.isHighPriority === 1).map(v => v.calendarDate),
+ bar: {
+ style: {
+ backgroundColor: 'red',
+ }
+ },
+ })
+ }
+
this.months[i].attributes[1] = {
highlight: true,
dates: []
@@ -398,6 +405,7 @@
return false
},
changeHigh(val) {
+ console.log('------------changeHigh')
if (this.currentDateItem) {
// 璁剧疆浼樺厛
let index = this.currentDateItem.attributes.findIndex(item => !!item.bar)
@@ -525,8 +533,20 @@
}
},
planCancel() {
+ // 鍙栨秷鎺掔彮鍙兘鍙栨秷褰撳墠鏃堕棿涔嬪悗鐨勬帓鐝�
+ let now = moment(moment().format('YYYY-MM-DD')).valueOf()
this.months.forEach((item, i) => {
- item.attributes = item.attributes.slice(0, 2)
+ // item.attributes = item.attributes.slice(0, 2)
+ item.attributes = item.attributes.map((v, i) => {
+ if (i > 1) {
+ v.dates = v.dates.filter(c => {
+ if (moment(c).valueOf() <= now) {
+ return true
+ }
+ })
+ }
+ return v
+ })
})
},
save() {
@@ -558,7 +578,7 @@
status: 1,
dateDTOList: list
}
- this.$HTTP.post('/api/blade-cps/calendar', data).then(res => {
+ this.$HTTP.post('/api/smis/calendar', data).then(res => {
if (res.code === 200) {
this.$emit('success')
} else {
@@ -570,7 +590,7 @@
id: this.drawerInfo.id,
dateDTOList: list
}
- this.$HTTP.put('/api/blade-cps/calendar', data).then(res => {
+ this.$HTTP.put('/api/smis/calendar', data).then(res => {
if (res.code === 200) {
this.$emit('success')
} else {
--
Gitblit v1.9.3