From 95faeea7f46a9d8f4817c8950c697835a463ec1b Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期六, 31 十二月 2022 14:52:44 +0800
Subject: [PATCH] 1.项目页签图标替换
---
src/components/DatePicker/index.vue | 65 +++++++++++++++++++++++++++-----
1 files changed, 55 insertions(+), 10 deletions(-)
diff --git a/src/components/DatePicker/index.vue b/src/components/DatePicker/index.vue
index ae8f1e7..19764ec 100644
--- a/src/components/DatePicker/index.vue
+++ b/src/components/DatePicker/index.vue
@@ -49,6 +49,7 @@
slot="reference"
:class="[{select:isSelect(visibleDays[(i-1)*7+(j-1)])},
{dblDateStyle:isDblDate(visibleDays[(i-1)*7+(j-1)])}]"
+ :style="{background: isSelect(visibleDays[(i-1)*7+(j-1)])?$store.state.settings.theme:''}"
>{{ visibleDays[(i - 1) * 7 + (j - 1)].getDate() }}</span>
</el-popover>
@@ -129,6 +130,7 @@
CapacityPlanningOnclickSelect,
CapacityPlanningSetupSearch
} from '@/api/scgl'
+import { handleDatetime } from '@/utils/global'
var time = null
export default {
@@ -361,15 +363,57 @@
dblChooseDate(date) {
if (!this.isPastDue(date)) {
clearTimeout(time)
- this.dblDate = date
- this.isDbl = true
- this.changeTime = this.handleDatetime(date)
- this.getCapacityPlanningOnclickSelect({
- CaptPlanWorkShiftCode: this.defArr.find(item => item.name === this.changeTime).key,
- captplanid: this.rowData.CaptPlanId,
- datetime: this.handleDatetime(date)
- })
- this.getDblTime()
+ time = setTimeout(() => {
+ this.time = funsdates.getYearMonthDay(date)
+ if (typeof this.value === 'string') {
+ this.value = this.value.split(',')
+ }
+ // 鍙互鐐瑰嚮鐨勬棩鏈�
+ if (!this.isPastDue(date)) {
+ if ((this.value.indexOf(this.handleDatetime(date)) < 0 && this.value !== '') || this.value === '') { // 鏁扮粍娣诲姞
+ this.value.push(this.handleDatetime(date)) // 鏂板鍒癷nput閲�
+ const data = {
+ name: this.handleDatetime(date),
+ key: this.rowData.CaptPlanWorkShiftCode
+ }
+ this.defArr.push(data) // 鏂板鍒� 榛樿鏁扮粍閲�
+ this.dblDate = date
+ this.isDbl = true // 鍙充晶灞曞紑
+
+ this.changeTime = this.handleDatetime(date)
+
+ const DATA = {
+ CaptPlanWorkShiftCode: this.defArr.find(item => item.name === this.changeTime).key,
+ captplanid: this.rowData.CaptPlanId,
+ datetime: this.handleDatetime(date)
+ }
+ this.getCapacityPlanningOnclickSelect(DATA)
+ this.getDblTime()
+ } else if (this.value.indexOf(this.handleDatetime(date)) >= 0) {
+ this.dblDate = date
+ this.isDbl = true // 鍙充晶灞曞紑
+
+ this.changeTime = this.handleDatetime(date)
+
+ const DATA = {
+ CaptPlanWorkShiftCode: this.defArr.find(item => item.name === this.changeTime).key,
+ captplanid: this.rowData.CaptPlanId,
+ datetime: this.handleDatetime(date)
+ }
+ this.getCapacityPlanningOnclickSelect(DATA)
+ this.getDblTime()
+
+ // const indexV = this.value.indexOf(this.handleDatetime(date))
+ // this.value.splice(indexV, 1)
+ // for (const i in this.defArr) {
+ // if (this.defArr[i].name === this.handleDatetime(date)) {
+ // this.defArr.splice(i, 1)
+ // }
+ // }
+ }
+ }
+ this.$emit('input', this.value)
+ }, 300)
}
},
isDblDate(date) {
@@ -472,7 +516,8 @@
},
getCapacityPlanningCalendar() {
CapacityPlanningCalendar({ captplanid: this.rowData.CaptPlanId }).then((res) => {
- this.defArr = res.data
+ const currentDate = handleDatetime(new Date())
+ this.defArr = res.data.filter(i => i.name >= currentDate)
})
},
closeCapacityPlanningCalendar() {
--
Gitblit v1.9.3