From dccf64980d375520e562535a5bc81d7404f167f8 Mon Sep 17 00:00:00 2001
From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com>
Date: Tue, 22 Oct 2024 18:09:55 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E8=AE=A1=E5=88=92?=
=?UTF-8?q?=EF=BC=8C=E6=B6=89=E7=BD=91=E8=AE=A1=E5=88=92=E7=AD=89=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E6=90=AD=E5=BB=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/workPlan/index/components/calendar.vue | 349 ++++++++++++++++++-
pages/workPlan/index/index.vue | 6 +-
2 files changed, 333 insertions(+), 22 deletions(-)
diff --git a/pages/workPlan/index/components/calendar.vue b/pages/workPlan/index/components/calendar.vue
index ae77e2f..bd0a65f 100644
--- a/pages/workPlan/index/components/calendar.vue
+++ b/pages/workPlan/index/components/calendar.vue
@@ -5,26 +5,97 @@
{{ currentYear }}年{{ currentMonth + 1 }}月
》
-->
-
- {{ day }}
+
+
-
-
- {{ day.day }}
-
- 中:9
- 低:30
- 可接受:4
+
+
+
+
+ {{ day }}
+
+
+
+ {{ day.day }}
+
+ 中:9
+ 低:30
+ 可接受:4
+
+
+
+
+
+
+
+
+
+ {{ item.title }}
+ {{ item.time }}
+
+
+
+
+
+ {{ item.name }}
+
+
+ 高:{{ i.height }}
+ 中:{{ i.height }}
+ 低:{{ i.kjs }}
+ 可接受:{{ i.height }}
+
+
+
+
+
+
+
+ 工程名称
+ 作业人数
+
+ 周二
+ 10/22
+
+
+
+
+ 10kv换东线10kv换东线10kv换东线10kv换东线10kv换东线
+
+ 3
+
+
+ 中
+ 高
+ 低
+ 可接受
+ 特高
-
-
@@ -34,9 +105,89 @@
export default {
data() {
return {
+ activeType: 1,
currentYear: new Date().getFullYear(),
currentMonth: new Date().getMonth(),
weekdays: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
+ weekList: [
+ { title: '分公司', time: '' },
+ { title: '周一', time: this.$moment().week(this.$moment().week()).startOf('week').format('MM-DD') },
+ {
+ title: '周二',
+ time: this.$moment(this.$moment().week(this.$moment().week()).startOf('week').format('YYYY-MM-DD'))
+ .add(1, 'days')
+ .format('MM-DD')
+ },
+ {
+ title: '周三',
+ time: this.$moment(this.$moment().week(this.$moment().week()).startOf('week').format('YYYY-MM-DD'))
+ .add(2, 'days')
+ .format('MM-DD')
+ },
+ {
+ title: '周四',
+ time: this.$moment(this.$moment().week(this.$moment().week()).startOf('week').format('YYYY-MM-DD'))
+ .add(3, 'days')
+ .format('MM-DD')
+ },
+ {
+ title: '周五',
+ time: this.$moment(this.$moment().week(this.$moment().week()).startOf('week').format('YYYY-MM-DD'))
+ .add(4, 'days')
+ .format('MM-DD')
+ },
+ {
+ title: '周六',
+ time: this.$moment(this.$moment().week(this.$moment().week()).startOf('week').format('YYYY-MM-DD'))
+ .add(5, 'days')
+ .format('MM-DD')
+ },
+ { title: '周日', time: this.$moment().week(this.$moment().week()).endOf('week').format('MM-DD') }
+ ],
+ weekStart: this.$moment().week(this.$moment().week()).startOf('week').format('YYYY-MM-DD'),
+ weekEnd: this.$moment().week(this.$moment().week()).endOf('week').format('YYYY-MM-DD'),
+ currentDay: this.$moment().format('YYYY-MM-DD'),
+ weekCompanyList: [
+ {
+ name: '全部',
+ weekList: [
+ {
+ height: 3,
+ kjs: 6
+ },
+ {
+ height: 3,
+ kjs: 6
+ }
+ ]
+ },
+ {
+ name: '分公司一',
+ weekList: [
+ {
+ height: 3,
+ kjs: 6
+ },
+ {
+ height: 3,
+ kjs: 6
+ }
+ ]
+ },
+ {
+ name: '分公司二',
+ weekList: [
+ {
+ height: 3,
+ kjs: 6
+ },
+ {
+ height: 3,
+ kjs: 6
+ }
+ ]
+ }
+ ],
days: [],
customDates: {
'2023-06-15': '自定义内容'
@@ -98,9 +249,28 @@ export default {
}
this.generateCalendar()
},
+ changeDay(delta) {
+ if (delta > 0) {
+ this.currentDay = this.$moment(this.currentDay).add(1, 'days').format('YYYY-MM-DD')
+ } else {
+ this.currentDay = this.$moment(this.currentDay).subtract(1, 'days').format('YYYY-MM-DD')
+ }
+ },
+ changeWeek(delta) {
+ if (delta > 0) {
+ this.weekStart = this.$moment(this.weekStart).add(7, 'days').format('YYYY-MM-DD')
+ this.weekEnd = this.$moment(this.weekEnd).add(7, 'days').format('YYYY-MM-DD')
+ } else {
+ this.weekStart = this.$moment(this.weekStart).subtract(7, 'days').format('YYYY-MM-DD')
+ this.weekEnd = this.$moment(this.weekEnd).subtract(7, 'days').format('YYYY-MM-DD')
+ }
+ },
selectDate(day) {
console.log('选择的日期', day.date)
// 在这里可以添加选择日期后的逻辑
+ },
+ onCheckTime(type) {
+ this.activeType = type
}
}
}
@@ -113,10 +283,61 @@ export default {
/* padding: 20rpx; */
}
.header {
+ width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
+
+ view {
+ flex: 1;
+ height: 80rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 36rpx;
+ font-weight: bold;
+ }
+
+ .week-container {
+ font-size: 24rpx !important;
+ font-weight: normal !important;
+ }
+}
+
+.header view:last-child {
+ width: 45%;
+ margin-right: 20rpx;
+ background-color: #f8f8f8;
+ border-radius: 40rpx;
+
+ button {
+ flex: 1;
+ height: 80rpx;
+ color: #000;
+ line-height: 80rpx;
+ font-weight: normal;
+ font-size: 36rpx;
+ cursor: pointer;
+ transition: all 0.3s ease;
+ }
+
+ button:last-child {
+ border-radius: 40rpx;
+ }
+ button:first-child {
+ border-radius: 40rpx;
+ }
+
+ .active-button {
+ border-radius: 40rpx;
+ background-color: #21a1f4;
+ color: #fff;
+ }
+
+ button::after {
+ border: none;
+ }
}
.weekdays {
display: flex;
@@ -139,7 +360,7 @@ export default {
margin-bottom: 3rpx;
padding-left: 3rpx;
text-align: left;
- font-size: 22rpx;
+ font-size: 24rpx;
}
}
.risk-container text:first-child {
@@ -148,6 +369,12 @@ export default {
}
.risk-container text:nth-child(2) {
+ background-color: #cff2ec;
+ border-left: 2px solid #1db691;
+ }
+ .risk-container text:nth-child(3) {
+ background-color: #d8fbff;
+ border-left: 2px solid #45e6ed;
}
}
.days view {
@@ -171,4 +398,88 @@ export default {
font-size: 20rpx;
color: #007aff;
}
+
+.week-th,
+.week-td {
+ width: 100%;
+ display: flex;
+
+ view {
+ width: 12.5%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ }
+}
+
+.week-td view text {
+ width: 100%;
+ margin-bottom: 3rpx;
+ padding-left: 2rpx;
+ display: inline-block;
+ font-size: 22rpx;
+ // font-weight: bold;
+}
+
+.style_1 {
+ background-color: #ffd5d6;
+ border-left: 2px solid #f6322a;
+}
+.style_2 {
+ background-color: #fee9ca;
+ border-left: 2px solid #f58b07;
+}
+.style_3 {
+ background-color: #d1f1ec;
+ border-left: 2px solid #14bb91;
+}
+.style_4 {
+ background-color: #d8fbfc;
+ border-left: 2px solid #3eebf7;
+}
+
+.day-th,
+.day-td {
+ display: flex;
+ align-items: center;
+
+ view {
+ width: 33.33%;
+ display: flex;
+ flex-direction: column;
+ // align-items: center;
+ justify-content: center;
+
+ text {
+ width: 100%;
+ text-align: center;
+ }
+ }
+}
+
+.day-td {
+ // height: 180rpx;
+
+ view {
+ height: 100%;
+ padding: 30rpx 0;
+ }
+}
+
+.day-th view:nth-child(2) {
+ border-left: 1px solid #ccc;
+ border-right: 1px solid #ccc;
+}
+.day-td view:nth-child(2) {
+ border-left: 1px solid #ccc;
+ border-right: 1px solid #ccc;
+}
+
+.day-td view:last-child text {
+ width: 100%;
+ margin-left: 10rpx;
+ margin-bottom: 3rpx;
+ text-align: left;
+}
diff --git a/pages/workPlan/index/index.vue b/pages/workPlan/index/index.vue
index 0c7864c..d536595 100644
--- a/pages/workPlan/index/index.vue
+++ b/pages/workPlan/index/index.vue
@@ -10,7 +10,7 @@
:titleStyle="{ color: '#FFF', fontSize: '32rpx' }"
/>
-
+
@@ -28,7 +28,7 @@ import TabbarConfig from '../util/tabbar'
import DayRiskView from './components/day-risk-view'
import HomeNoticeBar from './components/home-notice-bar'
-import RiskCalendar from './components/risk-calendar.vue'
+import RiskCalendar from './components/calendar.vue'
export default {
components: {
DayRiskView,
@@ -66,7 +66,7 @@ export default {
}
.page {
width: 100vw;
- height: 100vh;
+ // height: 100vh;
// background-color: #efefef;
background: #fff;
box-sizing: border-box;
From 09413863b5e6bab75859de762735653318f7b056 Mon Sep 17 00:00:00 2001
From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com>
Date: Wed, 23 Oct 2024 09:10:06 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=A0=B7=E5=BC=8F?=
=?UTF-8?q?=E7=AD=89=E9=80=BB=E8=BE=91=E5=AE=8C=E5=96=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages.json | 6 +++
pages/workPlan/custody/index.vue | 9 ++++
pages/workPlan/index/components/calendar.vue | 52 +++++++++++++++++--
.../workbench/components/custody-model.vue | 10 +++-
4 files changed, 71 insertions(+), 6 deletions(-)
create mode 100644 pages/workPlan/custody/index.vue
diff --git a/pages.json b/pages.json
index ea058a1..84ee6f9 100644
--- a/pages.json
+++ b/pages.json
@@ -761,6 +761,12 @@
"navigationStyle": "custom"
}
},
+ {
+ "path": "pages/workPlan/custody/index",
+ "style": {
+ "navigationStyle": "custom"
+ }
+ },
{
"path": "pages/workPlan/dayPlan/index",
"style": {
diff --git a/pages/workPlan/custody/index.vue b/pages/workPlan/custody/index.vue
new file mode 100644
index 0000000..6a6bdd0
--- /dev/null
+++ b/pages/workPlan/custody/index.vue
@@ -0,0 +1,9 @@
+
+ 现场监护
+
+
+
+
+
diff --git a/pages/workPlan/index/components/calendar.vue b/pages/workPlan/index/components/calendar.vue
index bd0a65f..a843e71 100644
--- a/pages/workPlan/index/components/calendar.vue
+++ b/pages/workPlan/index/components/calendar.vue
@@ -54,9 +54,9 @@
-
+
{{ item.title }}
- {{ item.time }}
+ {{ weekTimeChange(index) }}
@@ -79,8 +79,8 @@
工程名称
作业人数
- 周二
- 10/22
+ {{ currentWeekDay }}
+ {{ currentDays }}
@@ -189,11 +189,25 @@ export default {
}
],
days: [],
+ // currentWeekDay: this.$moment().day(),
+ currentDays: this.$moment().format('MM-DD'),
customDates: {
'2023-06-15': '自定义内容'
}
}
},
+ computed: {
+ weekTimeChange() {
+ return index => {
+ return this.$moment(this.weekStart)
+ .add(index - 1, 'days')
+ .format('MM-DD')
+ }
+ },
+ currentWeekDay() {
+ return this.onTransWeek(this.$moment(this.currentDay).day())
+ }
+ },
mounted() {
this.generateCalendar()
},
@@ -252,8 +266,10 @@ export default {
changeDay(delta) {
if (delta > 0) {
this.currentDay = this.$moment(this.currentDay).add(1, 'days').format('YYYY-MM-DD')
+ this.currentDays = this.$moment(this.currentDays).add(1, 'days').format('MM-DD')
} else {
this.currentDay = this.$moment(this.currentDay).subtract(1, 'days').format('YYYY-MM-DD')
+ this.currentDays = this.$moment(this.currentDays).subtract(1, 'days').format('MM-DD')
}
},
changeWeek(delta) {
@@ -269,6 +285,34 @@ export default {
console.log('选择的日期', day.date)
// 在这里可以添加选择日期后的逻辑
},
+ onTransWeek(num) {
+ let weekStr = ''
+ switch (num) {
+ case 0:
+ weekStr = '周日'
+ break
+ case 1:
+ weekStr = '周一'
+ break
+ case 2:
+ weekStr = '周二'
+ break
+ case 3:
+ weekStr = '周三'
+ break
+ case 4:
+ weekStr = '周四'
+ break
+ case 5:
+ weekStr = '周五'
+ break
+ case 6:
+ weekStr = '周六'
+ break
+ }
+
+ return weekStr
+ },
onCheckTime(type) {
this.activeType = type
}
diff --git a/pages/workPlan/workbench/components/custody-model.vue b/pages/workPlan/workbench/components/custody-model.vue
index 6af5b72..53546ed 100644
--- a/pages/workPlan/workbench/components/custody-model.vue
+++ b/pages/workPlan/workbench/components/custody-model.vue
@@ -3,7 +3,7 @@
现场监护
-
+
现场监护
@@ -12,7 +12,13 @@
+