diff --git a/CHANGELOG.md b/CHANGELOG.md
index dcba80f..32260e6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
### 🌟 新功能
范围|描述|commitId
--|--|--
+ - | 上传逻辑变化 | [3ff1dc2](https://dd.tall.wiki/gitea/ccsens_fe/TALL-MUI-3/commits/3ff1dc2)
plugin | 插件添加了token及param参数 | [aeb0292](https://dd.tall.wiki/gitea/ccsens_fe/TALL-MUI-3/commits/aeb0292)
- | 标题栏变化 | [3898cfe](https://dd.tall.wiki/gitea/ccsens_fe/TALL-MUI-3/commits/3898cfe)
- | 标题栏变化 | [c0fcd9d](https://dd.tall.wiki/gitea/ccsens_fe/TALL-MUI-3/commits/c0fcd9d)
diff --git a/src/components/Calendar/Calendar.vue b/src/components/Calendar/Calendar.vue
index a4e07f5..cb8e040 100644
--- a/src/components/Calendar/Calendar.vue
+++ b/src/components/Calendar/Calendar.vue
@@ -3,8 +3,10 @@
{{ timeStr }}
+
+
-
+
{{ week }}
@@ -25,14 +27,13 @@
>
+
@@ -42,6 +43,7 @@
+
+
-
+
+
- 今日
+
+ 今日
-
+mb-3
@@ -323,22 +356,27 @@ export default {
.zzx-calendar {
width: 100%;
height: auto;
+ background-color: #fff;
+ padding-bottom: 10px;
+
.calendar-heander {
text-align: center;
- height: 60upx;
- line-height: 60upx;
+ padding: 16px 0;
position: relative;
- font-size: 30upx;
+ font-size: 15px;
}
+
.calendar-weeks {
width: 100%;
display: flex;
flex-flow: row nowrap;
- height: 60upx;
- line-height: 60upx;
+ margin-bottom: 10px;
justify-content: center;
align-items: center;
- font-size: 30upx;
+ font-size: 12px;
+ color: #9ca3af;
+ font-weight: bold;
+
.calendar-week {
width: calc(100% / 7);
height: 100%;
@@ -350,10 +388,10 @@ export default {
height: 60upx;
}
.calendar-content {
- min-height: 60upx;
+ min-height: 30px;
}
.calendar-swiper {
- min-height: 70upx;
+ min-height: 35px;
transition: height ease-out 0.3s;
}
.calendar-item {
@@ -367,10 +405,11 @@ export default {
width: 100%;
height: 100%;
overflow: hidden;
- font-size: 28upx;
+ font-size: 14px;
+
.calendar-day {
width: calc(100% / 7);
- height: 70upx;
+ height: 35px;
text-align: center;
display: flex;
flex-flow: column nowrap;
@@ -382,28 +421,30 @@ export default {
.day-hidden {
visibility: hidden;
}
+
.mode-change {
display: flex;
justify-content: center;
- margin-top: 10upx;
+ margin-top: 5px;
+
.mode-arrow-top {
width: 0;
height: 0;
- border-left: 12upx solid transparent;
- border-right: 12upx solid transparent;
- border-bottom: 10upx solid #ff6633;
+ border-left: 6px solid transparent;
+ border-right: 6px solid transparent;
+ border-bottom: 5px solid #ff6633;
}
.mode-arrow-bottom {
width: 0;
height: 0;
- border-left: 12upx solid transparent;
- border-right: 12upx solid transparent;
- border-top: 10upx solid #ff6633;
+ border-left: 6px solid transparent;
+ border-right: 6px solid transparent;
+ border-top: 5px solid #ff6633;
}
}
.is-today {
background: #ffffff;
- // border: 1upx solid #FF6633;
+ border: 1upx solid #ff6633;
border-radius: 50%;
color: #ff6633;
}
@@ -412,34 +453,20 @@ export default {
color: #ffffff;
}
.date {
- width: 50upx;
- height: 50upx;
- line-height: 50upx;
+ width: 25px;
+ height: 25px;
+ line-height: 25px;
margin: 0 auto;
- border-radius: 50upx;
+ border-radius: 25px;
}
.dot-show {
width: 8px;
height: 8px;
// background: red;
- border-radius: 10upx;
+ border-radius: 5px;
position: absolute;
top: 2px;
right: 10px;
}
- .back-today {
- // position: absolute;
- line-height: 30upx;
- font-size: 20px;
- top: 15upx;
- // border-radius: 15upx 0 0 15upx;
- color: #24abf1;
- // position: relative;
- // left: 39%;
- // margin: 5%;
- margin-top: 20px;
- display: flex;
- justify-content: center;
- }
}
diff --git a/src/components/Calendar/generateDates.js b/src/components/Calendar/generateDates.js
index 96bb32b..c08fc6a 100644
--- a/src/components/Calendar/generateDates.js
+++ b/src/components/Calendar/generateDates.js
@@ -31,10 +31,13 @@ export const formatDate = (date, fmt) => {
const padLeftZero = str => {
return ('00' + str).substr(str.length);
};
+
+// 判断是不是date对象
export const judgeType = s => {
// 函数返回数据的具体类型
return Object.prototype.toString.call(s).slice(8, -1);
};
+
export const equalDate = (d1, d2) => {
let result = false;
if (d1.getFullYear() === d2.getFullYear() && d1.getMonth() === d2.getMonth() && d1.getDate() === d2.getDate()) {
@@ -42,6 +45,7 @@ export const equalDate = (d1, d2) => {
}
return result;
};
+
/* 比较时间,时间格式为2020-04-04
*/
export const dateEqual = (before, after) => {
@@ -63,13 +67,15 @@ export const gegerateDates = (date = new Date(), type = 'week') => {
const d = date.getDate();
const days = new Date(y, m + 1, 0).getDate();
// 获取日期是星期几
- let weekIndex = date.getDay() === 0 ? 7 : date.getDay();
+ // let weekIndex = date.getDay() === 0 ? 7 : date.getDay();
+ let weekIndex = date.getDay();
if (type === 'month') {
const dobj = new Date(y, m, 1);
- weekIndex = dobj.getDay() === 0 ? 7 : dobj.getDay();
+ // weekIndex = dobj.getDay() === 0 ? 7 : dobj.getDay();
+ weekIndex = dobj.getDay();
}
if (type === 'week') {
- for (let i = weekIndex - 1; i > 0; i--) {
+ for (let i = weekIndex; i > 0; i--) {
const dtemp = new Date(y, m, d);
dtemp.setDate(dtemp.getDate() - i);
result.push({
@@ -91,7 +97,7 @@ export const gegerateDates = (date = new Date(), type = 'week') => {
}
} else if (type === 'month') {
// 上个月
- for (let i = weekIndex - 1; i > 0; i--) {
+ for (let i = weekIndex; i > 0; i--) {
const dtemp = new Date(y, m, 1);
dtemp.setDate(dtemp.getDate() - i);
result.push({
diff --git a/src/components/Projects/Projects.vue b/src/components/Projects/Projects.vue
index 1f4e699..6072cba 100644
--- a/src/components/Projects/Projects.vue
+++ b/src/components/Projects/Projects.vue
@@ -1,28 +1,26 @@
-
-
-
-
- 我的LWBS
-
-
-
-
- {{ index + 1 }}
+
+
+
+ 我的LWBS
+
+
+
+
+ {{ index + 1 }}
+
+
+
+ {{ task.taskName }}
+ {{ task.state }}
-
-
- {{ task.taskName }}
- {{ task.state }}
-
-
- {{ task.time }}
- 时长:{{ task.duration }}
-
+
+ {{ task.time }}
+ 时长:{{ task.duration }}
-
+
@@ -83,8 +81,3 @@ export default {
},
};
-
diff --git a/src/components/TimeLine/component/TimeBox.vue b/src/components/TimeLine/component/TimeBox.vue
index e630361..0afaad2 100644
--- a/src/components/TimeLine/component/TimeBox.vue
+++ b/src/components/TimeLine/component/TimeBox.vue
@@ -2,7 +2,7 @@
-
+
{{ $moment(+task.planStart).format(startTimeFormat) }}
diff --git a/src/components/TimeLine/component/TimeStatus.vue b/src/components/TimeLine/component/TimeStatus.vue
index 7b5a6a0..b6487b9 100644
--- a/src/components/TimeLine/component/TimeStatus.vue
+++ b/src/components/TimeLine/component/TimeStatus.vue
@@ -1,7 +1,13 @@
-
+
@@ -19,16 +25,11 @@ import { mapState, mapMutations } from 'vuex';
export default {
name: 'TimeStatus',
- props: {
- status: { default: 0, type: Number },
- taskName: { default: '', type: String },
- taskId: { type: String, default: '' },
- },
+ props: { task: { type: Object, default: () => {} } },
data() {
return {
- // status: 3,
- time: 20,
+ time: '',
start: [{ text: '确认开始任务', color: 'blue' }],
pause: [{ text: '继续' }, { text: '重新开始任务', color: 'blue' }, { text: '结束' }],
proceed: [{ text: '暂停' }, { text: '重新开始任务', color: 'blue' }, { text: '结束' }],
@@ -38,31 +39,46 @@ export default {
computed: {
...mapState('task', ['tip']),
+ status() {
+ return this.task ? this.task.process : 0;
+ },
+ taskName() {
+ return this.task ? this.task.name : '';
+ },
+ taskId() {
+ return this.task ? this.task.id : '';
+ },
// 图标文本颜色
// 任务状态 0未开始 1进行中 2暂停中 3已完成
orderStyle() {
let color = '#9CA3AF';
let icon = 'play-right-fill';
+ let persent = 100;
switch (this.status) {
case 1: // 进行中
color = '#60A5FA';
icon = '';
+ persent = this.computeCyclePersent();
+ console.log('persent: ', persent);
break;
case 2: // 暂停中
color = '#F87171';
icon = 'pause';
+ persent = 50; // TODO: 暂时这样 暂停状态没有计算剩余多少时间
break;
case 3: // 已结束
color = '#34D399';
icon = 'checkmark';
+ persent = 100;
break;
default:
// 未开始
color = '#9CA3AF';
icon = 'play-right';
+ persent = 100;
break;
}
- return { color, icon };
+ return { color, icon, persent };
},
},
@@ -73,16 +89,25 @@ export default {
* 点击了图标 修改任务状态
* @param {object} event
*/
- changeStatus(event) {
- const { status, taskId, taskName, tip } = this;
- tip.status = status;
- tip.taskId = taskId;
- tip.left = event.target.x;
- tip.top = event.target.y;
- tip.show = true;
- tip.text = this.genetateTips(status, taskName);
+ changeStatus() {
+ return false;
+ // const { status, taskId, taskName, tip } = this;
+ // tip.status = status;
+ // tip.taskId = taskId;
+ // tip.left = event.target.x;
+ // tip.top = event.target.y;
+ // tip.show = true;
+ // tip.text = this.genetateTips(status, taskName);
+
+ // this.setTip(tip);
+ },
- this.setTip(tip);
+ // 计算圆环的弧度百分比
+ computeCyclePersent() {
+ if (!this.task || !this.task.realStart || !this.task.planDuration) return 100;
+ const { realStart, planDuration } = this.task;
+ console.log((((Date.now() - +realStart) * 100) / +planDuration).toFixed(2));
+ return (((Date.now() - +realStart) * 100) / +planDuration).toFixed(2);
},
/**
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 46ce900..b7ef4ba 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -1,11 +1,13 @@
-
+
-
+
+
+