|
@@ -8,9 +8,14 @@
|
|
|
margin: 5px;
|
|
|
/deep/ .el-input{
|
|
|
display: inline-block;
|
|
|
- width: 200px;
|
|
|
+ width: 370px;
|
|
|
}
|
|
|
}
|
|
|
+ .add-bt{
|
|
|
+ cursor: pointer;
|
|
|
+ font-size: 18px;
|
|
|
+ float: right;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|
|
|
<template>
|
|
@@ -20,9 +25,9 @@
|
|
|
slot="dateCell"
|
|
|
slot-scope="{date, data}">
|
|
|
<div class="day-cell" @click="chooseDay(data)">
|
|
|
- <p>{{data.day.split('-')[2]}}</p>
|
|
|
- <div v-if="new Date(data.day).getMonth() + 1 == searchMonth.getMonth() + 1">
|
|
|
- <p v-for="item in planList[data.day.split('-')[2]]" :key="item.id">
|
|
|
+ <p>{{getDayNum(data.day)}}</p>
|
|
|
+ <div v-if="new Date(data.day).getMonth() == searchMonth.getMonth()">
|
|
|
+ <p v-for="item in planList[getDayNum(data.day)]" :key="item.id">
|
|
|
{{item.name}}
|
|
|
</p>
|
|
|
</div>
|
|
@@ -34,10 +39,11 @@
|
|
|
title="修改计划"
|
|
|
:visible.sync="visibleChange"
|
|
|
width="500px">
|
|
|
- <div>
|
|
|
+ <div v-for="(item, index) in dayPlan" :key="index">
|
|
|
<label>计划:</label>
|
|
|
- <el-input placeholder="" v-model="dayPlan.name"></el-input>
|
|
|
+ <el-input placeholder="" v-model="item.name"></el-input>
|
|
|
</div>
|
|
|
+ <i class="el-icon-circle-plus-outline add-bt" @click="addDayPlan()"></i>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="visibleChange = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="editTask">确 定</el-button>
|
|
@@ -60,7 +66,7 @@ export default {
|
|
|
},
|
|
|
visibleChange: false,
|
|
|
planList: {},
|
|
|
- dayPlan: {}
|
|
|
+ dayPlan: []
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -85,14 +91,24 @@ export default {
|
|
|
this.visibleChange = false;
|
|
|
},
|
|
|
chooseDay(data){
|
|
|
- this.visibleChange = true;
|
|
|
- let day = data.day.split('-')[2];
|
|
|
- if(this.planList[day].length){
|
|
|
- this.dayPlan = this.planList[day][0];
|
|
|
- }
|
|
|
- else{
|
|
|
- this.dayPlan = {};
|
|
|
+ if(new Date(data.day).getMonth() != this.searchMonth.getMonth()){
|
|
|
+ return;
|
|
|
}
|
|
|
+ this.visibleChange = true;
|
|
|
+ let day = this.getDayNum(data.day);
|
|
|
+ this.dayPlan = JSON.parse(JSON.stringify(this.planList[day]));
|
|
|
+ },
|
|
|
+ addDayPlan(){
|
|
|
+ this.dayPlan.push({
|
|
|
+ "name": "",
|
|
|
+ "content": "",
|
|
|
+ "year": "",
|
|
|
+ "userId": "",
|
|
|
+ "startTime": "",
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getDayNum(day){
|
|
|
+ return ~~day.split('-')[2];
|
|
|
}
|
|
|
}
|
|
|
}
|